main_2020_edit.js 2.4 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491
  1. window.common = null;
  2. window.MathLight = null;
  3. window.math = null
  4. var dealMap = (map)=>{//使不resize when image is not power of two
  5. map.wrapS = map.wrapT = THREE.ClampToEdgeWrapping;
  6. map.minFilter = THREE.LinearFilter;
  7. map.magFilter = THREE.LinearFilter;
  8. map.generateMipmaps = true;
  9. }
  10. /* var sortByScore = function(list,g_tourAudio request, rank) {
  11. var i = common.filterAll(list, request);
  12. return 0 === i.length ? null : i = i.map(function(e) {
  13. return {
  14. item: e,
  15. score: rank.reduce(function(t, i) {
  16. return t + i(e);
  17. }, 0)
  18. };
  19. }).sort(function(e, t) {
  20. return t.score - e.score;
  21. });
  22. };
  23. */
  24. var getTransformSid = function(){
  25. var name
  26. if(player.mode == 'panorama'){
  27. name = player.currentPano ? player.currentPano.id : 'outside'
  28. }else{
  29. name = 'outside'
  30. }
  31. return name
  32. }
  33. var convertTool = {
  34. getPos2d : function(point, camera, dom){//获取一个三维坐标对应屏幕中的二维坐标
  35. var camera = camera || player.camera;
  36. var dom = dom || player.domElement;
  37. 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);
  38. var x,y;
  39. x = (pos.x + 1) / 2 * dom.clientWidth;
  40. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  41. var inSight = x <= dom.clientWidth && x >= 0 //是否在屏幕中
  42. && y <= dom.clientHeight && y >= 0
  43. return {
  44. pos: new THREE.Vector2(x,y), // 屏幕像素坐标
  45. vector: pos, //(范围 -1 ~ 1)
  46. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  47. inSight : inSight //在屏幕范围内可见
  48. };
  49. },
  50. ifShelter: function(pos3d){//检测某点在视线中是否被mesh遮挡
  51. var ori = player.position
  52. var dir = pos3d.clone().sub(ori).normalize()
  53. var ray = new THREE.Raycaster(ori, dir) //由外向里 因为模型从内侧是可见的所以从外侧
  54. /* if(config.isEdit && publicObjectSet.editor.mainDesign.editing){
  55. var o = ray.intersectObjects(publicObjectSet.editor.mainDesign.wallMeshes);
  56. }else{ */
  57. var o = ray.intersectObjects(player.model.colliders);
  58. //}
  59. var len = pos3d.distanceTo(ori);
  60. if (o && o.length) {
  61. for(var i=0;i<o.length;i++){
  62. if(o[i].distance < len){ return true; }//有遮挡
  63. }
  64. }
  65. },
  66. /*
  67. 拖拽时,获取鼠标在拖拽面上的位置(需要借助另一个intersectPlane面来计算,即和相机方向一样的面,可保证铺满屏幕)
  68. 但是不一定能获取到,比如鼠标射线不朝向拖拽面时,即使获取也会是一个意外的反方向的交点。
  69. */
  70. getPosAtPlane : function(pos, info/* , mouse, camera */){ //pos:与intersectPlane的交点 见笔记
  71. var A = pos;
  72. var player = player;
  73. var mouse = player.mouse;
  74. var O = new THREE.Vector3(mouse.x, mouse.y, -1).unproject(player.camera);
  75. if(info.y != void 0){//地面线的
  76. var y = info.y;
  77. if(player.mode == "floorplan"/* || Math.abs(O.x-pos.x)<0.0001 && Math.abs(O.z-pos.z)<0.0001) */){
  78. //intersectPlane和地面平行,无交点
  79. var x = pos.x, z = pos.z;
  80. }else{
  81. if(y<player.camera.position.y && O.y <= A.y /* || y>player.camera.position.y && O.y >= A.y */)return null; //鼠标射线向上。因为相机一定位于地面以上(地面不会抬高到相机上吧?),所以无交点。
  82. if(O.y == A.y){console.log('一样??');return;}
  83. if(A.y == y){console.log('一样2??');return;}
  84. var r = (O.y-y)/(A.y-y);
  85. var x = (r*A.x-O.x)/(r-1);
  86. var z = (r*A.z-O.z)/(r-1);
  87. }
  88. }else{//垂直的也有越过消失点以后反向变化的情况,但使用时影响不大
  89. var N = info.normalVec;
  90. var P = info.pullPos;
  91. if(N.y != 0 ){console.log('N.y != 0');return;} //仅仅支持垂直于地面的的墙壁,目前都是
  92. if(O.z==A.z){console.log('O.z==A.z?');return;}
  93. if(N.z!=0 && N.x != 0){//直接用这个通用的也可以,支持斜线的墙
  94. //console.log('N.z==0 && N.x == 0?');
  95. var c = ( N.x*(A.x-O.x) + N.y*(A.y-O.y) + N.z*(A.z-O.z));
  96. if(c == 0){console.log("分母为0?? return;");return;}
  97. var t = -((N.x*O.x + N.y*O.y + N.z*O.z) - (P.x*N.x + P.y*N.y + P.z*N.z) ) / c
  98. var x = t * (A.x - O.x) + O.x;
  99. var y = t * (A.y - O.y) + O.y;
  100. var z = t * (A.z - O.z) + O.z;
  101. /*原理: 已知空间直线L:(x-a)/m=(x-b)/n=(z-c)/p和空间平面π:Ax+By+Cz+D=0;
  102. 求直线L与平面π的交点的坐标。
  103. 把直线方程改写成参数形式:设(x-a)/m=(x-b)/n=(z-c)/p=t;
  104. 则x=mt+a;y=nt+b;z=pt+c;代入平面π的方程得:
  105. A(mt+a)+B(nt+b)+C(pt+c)+D=0
  106. 由此解得t=-(Aa+Bb+Cc+D)/(Am+Bn+Cp)
  107. 再代入参数方程即得交点的坐标(x,y,z). */
  108. }else if(N.x ==0 ){ //z与pullPos相等
  109. var z = P.z;
  110. if(O.y == A.y){console.log('一样??');return;}
  111. if(A.y == y){console.log('一样2??');return;}
  112. if(A.z == z){console.log('一样3??');return;}
  113. var r = (O.z-z)/(A.z-z);
  114. var x = (r*A.x-O.x)/(r-1);
  115. var y = (r*A.y-O.y)/(r-1);
  116. }else if(N.z == 0){//x与pullPos相等
  117. var x = P.x;
  118. if(O.y == A.y){console.log('一样??');return;}
  119. if(A.y == y){console.log('一样2??');return;}
  120. if(A.x == x){console.log('一样3??');return;}
  121. var r = (O.x-x)/(A.x-x);
  122. var y = (r*A.y-O.y)/(r-1);
  123. var z = (r*A.z-O.z)/(r-1);
  124. }
  125. }
  126. return new THREE.Vector3(x,y,z);
  127. },
  128. getMouseIntersect : function(camera, meshes, mouse){//获取鼠标和meshes交点
  129. var raycaster = new THREE.Raycaster;
  130. camera.updateMatrixWorld();
  131. var origin = new THREE.Vector3(mouse.x,mouse.y,-1).unproject(camera)
  132. , end = new THREE.Vector3(mouse.x,mouse.y,1).unproject(camera);
  133. var dir = end.sub(origin).normalize()
  134. raycaster.set(origin, dir);
  135. var n = raycaster.intersectObjects(meshes);
  136. if (0 === n.length)
  137. return null;
  138. return n[0];
  139. },
  140. ifIntersectChunks : function(A,B,options={}){//获取某个线段/射线和meshes的交点
  141. var dir = B.clone().sub(A).normalize();
  142. var len = options.InfinityLen ? Infinity : A.distanceTo(B) + (options.extLen||0);
  143. var ray = new THREE.Raycaster(A.clone(), dir, 0, len);
  144. var o = ray.intersectObjects(options.model || player.model.colliders);
  145. if (o && o.length)return o;
  146. if(options.throughWidth){ //允许最小宽度,防止穿过极小的缝隙导致撞墙感
  147. var normal = math.getNormal({points:[{x:A.x, y:A.z},{x:B.x, y:B.z}]});//线段法线
  148. normal.multiplyScalar(options.throughWidth)
  149. var normalVec3 = new THREE.Vector3(normal.x, 0, normal.y);
  150. var A2 = A.clone().add(normalVec3)
  151. ray.set(A2, dir);
  152. var o2 = ray.intersectObjects(options.model || player.model.colliders);
  153. ray.set(A.clone().add(normalVec3.negate()), dir);
  154. if (o2 && o2.length)return o2;
  155. var o3 = ray.intersectObjects(options.model || player.model.colliders);
  156. if (o3 && o3.length)return o3;
  157. }
  158. return null;
  159. },
  160. getPosAtSphere : function(pos3d, toPanoPos){
  161. var dir = pos3d.clone().sub(toPanoPos);
  162. dir.normalize();//然后计算在球中
  163. dir.multiplyScalar(Constants.skyRadius);
  164. dir.add(toPanoPos);
  165. return dir;
  166. }
  167. }
  168. var dom = {
  169. getOffset: function(e, t, i) {
  170. for (left = "left" == e ? t.offsetLeft : t.offsetTop,
  171. i = i || $("body")[0]; (t = t.offsetParent) && t != i; )
  172. left += "left" == e ? t.offsetLeft : t.offsetTop;
  173. return left
  174. }
  175. };
  176. if (function() {
  177. "use strict";
  178. function o(e, t) {
  179. return typeof e === t
  180. }
  181. function a(e, t) {
  182. return e instanceof t
  183. }
  184. function s(e) {
  185. return e && e.nodeType
  186. }
  187. function l(e) {
  188. return s(e) ? e : a(e, y) ? e[0] : void 0
  189. }
  190. function e(e, i, n) {
  191. return y.each(e, function(e, t) {
  192. n = i.call(t, n, e, t)
  193. }),
  194. n
  195. }
  196. function t(e, t, i) {
  197. var n, r, o;
  198. if (e === t)
  199. return !0;
  200. if (!e || !t || e.constructor !== t.constructor)
  201. return !1;
  202. for (n = 0,
  203. r = i.length; n < r; n += 1) {
  204. if (e[o = i[n]] && E(e[o].equals) && !e[o].equals(t[o]))
  205. return !1;
  206. if (e[o] !== t[o])
  207. return !1
  208. }
  209. return !0
  210. }
  211. function c(e, t, i, n) {
  212. this.left = w(e),
  213. this.top = w(t),
  214. this.width = w(i),
  215. this.height = w(n),
  216. this.right = this.left + this.width,
  217. this.bottom = this.top + this.height
  218. }
  219. function h(e, t, i, n) {
  220. this.visible = e || 0,
  221. this.viewport = t || 0,
  222. this.possible = i || 0,
  223. this.rects = n && I({}, n) || null
  224. }
  225. function r(e, t) {
  226. this.els = e,
  227. this.viewport = t
  228. }
  229. function n(e, t) {
  230. return e.val - t.val
  231. }
  232. function u(e, t) {
  233. return t.val - e.val
  234. }
  235. function d(e) {
  236. var t = c.ofContent(e, !0)
  237. , i = c.ofViewport(e, !0)
  238. , n = t.width - i.width
  239. , r = t.height - i.height;
  240. this.content = t,
  241. this.viewport = i,
  242. this.width = n <= 0 ? null : i.left / n,
  243. this.height = r <= 0 ? null : i.top / r,
  244. this.left = i.left,
  245. this.top = i.top,
  246. this.right = t.right - i.right,
  247. this.bottom = t.bottom - i.bottom
  248. }
  249. function p(e) {
  250. this.el = e || window
  251. }
  252. function f(e, t) {
  253. this.context = e,
  254. this.viewport = t,
  255. this.init()
  256. }
  257. function g(e, t, i, n) {
  258. this.context = new r(e,t),
  259. this.property = i,
  260. this.descending = n,
  261. this.init()
  262. }
  263. function m(e) {
  264. e && e !== window && e !== document ? (this.context = e,
  265. this.$autoTarget = y(e)) : this.context = window,
  266. this.init()
  267. }
  268. 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 = {},
  269. v = 1,
  270. function(e) {
  271. return e ? (i[e] || (i[e] = v,
  272. v += 1),
  273. i[e]) : 0
  274. }
  275. );
  276. I(c.prototype, {
  277. equals: function(e) {
  278. return t(this, e, ["left", "top", "width", "height"])
  279. },
  280. area: function() {
  281. return this.width * this.height
  282. },
  283. relativeTo: function(e) {
  284. return new c(this.left - e.left,this.top - e.top,this.width,this.height)
  285. },
  286. intersection: function(e) {
  287. if (!a(e, c))
  288. return null;
  289. var t = _(this.left, e.left)
  290. , i = b(this.right, e.right)
  291. , n = _(this.top, e.top)
  292. , r = i - t
  293. , o = b(this.bottom, e.bottom) - n;
  294. return 0 <= r && 0 <= o ? new c(t,n,r,o) : null
  295. },
  296. envelope: function(e) {
  297. if (!a(e, c))
  298. return this;
  299. var t = b(this.left, e.left)
  300. , i = _(this.right, e.right)
  301. , n = b(this.top, e.top);
  302. return new c(t,n,i - t,_(this.bottom, e.bottom) - n)
  303. }
  304. }),
  305. I(c, {
  306. ofContent: function(e, t) {
  307. 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())
  308. },
  309. ofViewport: function(e, t) {
  310. 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())
  311. },
  312. ofElement: function(e) {
  313. var t = y(e);
  314. if (!t.is(":visible"))
  315. return null;
  316. var i = t.offset();
  317. return new c(i.left,i.top,t.outerWidth(),t.outerHeight())
  318. }
  319. }),
  320. I(h.prototype, {
  321. equals: function(e) {
  322. return this.fracsEqual(e) && this.rectsEqual(e)
  323. },
  324. fracsEqual: function(e) {
  325. return t(this, e, ["visible", "viewport", "possible"])
  326. },
  327. rectsEqual: function(e) {
  328. return t(this.rects, e.rects, ["document", "element", "viewport"])
  329. }
  330. }),
  331. I(h, {
  332. of: function(e, t) {
  333. var i, n, r;
  334. return e = s(e) && c.ofElement(e) || e,
  335. t = s(t) && c.ofViewport(t) || t || c.ofViewport(),
  336. e instanceof c && (i = e.intersection(t)) ? (n = i.area(),
  337. r = b(e.width, t.width) * b(e.height, t.height),
  338. new h(n / e.area(),n / t.area(),n / r,{
  339. document: i,
  340. element: i.relativeTo(e),
  341. viewport: i.relativeTo(t)
  342. })) : new h
  343. }
  344. });
  345. var x = ["width", "height", "left", "right", "top", "bottom"]
  346. , S = ["possible", "visible", "viewport"];
  347. I(r.prototype, {
  348. sorted: function(t, e) {
  349. var i = this.viewport;
  350. return y.map(this.els, function(e) {
  351. return {
  352. el: e,
  353. val: function(e, t, i) {
  354. var n;
  355. return 0 <= y.inArray(i, x) ? n = c.ofElement(e) : 0 <= y.inArray(i, S) && (n = h.of(e, t)),
  356. n ? n[i] : 0
  357. }(e, i, t)
  358. }
  359. }).sort(e ? u : n)
  360. },
  361. best: function(e, t) {
  362. return this.els.length ? this.sorted(e, t)[0] : null
  363. }
  364. }),
  365. I(d.prototype, {
  366. equals: function(e) {
  367. return t(this, e, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  368. }
  369. }),
  370. I(p.prototype, {
  371. equals: function(e) {
  372. return t(this, e, ["el"])
  373. },
  374. scrollState: function() {
  375. return new d(this.el)
  376. },
  377. scrollTo: function(e, t, i) {
  378. var n = y(this.el === window ? "html,body" : this.el);
  379. e = e || 0,
  380. t = t || 0,
  381. i = isNaN(i) ? 1e3 : i,
  382. n.stop(!0).animate({
  383. scrollLeft: e,
  384. scrollTop: t
  385. }, i)
  386. },
  387. scroll: function(e, t, i) {
  388. var n = this.el === window ? A : y(this.el);
  389. e = e || 0,
  390. t = t || 0,
  391. this.scrollTo(n.scrollLeft() + e, n.scrollTop() + t, i)
  392. },
  393. scrollToRect: function(e, t, i, n) {
  394. t = t || 0,
  395. i = i || 0,
  396. this.scrollTo(e.left - t, e.top - i, n)
  397. },
  398. scrollToElement: function(e, t, i, n) {
  399. var r = c.ofElement(e).relativeTo(c.ofContent(this.el));
  400. this.scrollToRect(r, t, i, n)
  401. }
  402. });
  403. var M = {
  404. init: function() {
  405. this.callbacks = y.Callbacks("memory unique"),
  406. this.currVal = null,
  407. this.prevVal = null,
  408. this.checkProxy = y.proxy(this.check, this),
  409. this.autoCheck()
  410. },
  411. bind: function(e) {
  412. this.callbacks.add(e)
  413. },
  414. unbind: function(e) {
  415. e ? this.callbacks.remove(e) : this.callbacks.empty()
  416. },
  417. trigger: function() {
  418. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  419. },
  420. check: function(e) {
  421. var t = this.updatedValue(e);
  422. return void 0 !== t && (this.prevVal = this.currVal,
  423. this.currVal = t,
  424. this.trigger(),
  425. !0)
  426. },
  427. $autoTarget: A,
  428. autoEvents: "load resize scroll",
  429. autoCheck: function(e) {
  430. this.$autoTarget[!1 === e ? "off" : "on"](this.autoEvents, this.checkProxy)
  431. }
  432. };
  433. I(f.prototype, M, {
  434. updatedValue: function() {
  435. var e = h.of(this.context, this.viewport);
  436. return this.currVal && this.currVal.equals(e) ? void 0 : e
  437. }
  438. }),
  439. I(g.prototype, M, {
  440. updatedValue: function() {
  441. var e = this.context.best(this.property, this.descending);
  442. return e && (e = 0 < e.val ? e.el : null,
  443. this.currVal !== e) ? e : void 0
  444. }
  445. }),
  446. I(m.prototype, M, {
  447. updatedValue: function() {
  448. var e = new d(this.context);
  449. return this.currVal && this.currVal.equals(e) ? void 0 : e
  450. }
  451. });
  452. var R, P, O, L, D, N, F, B, V, k, U = "fracs";
  453. function H(e, t, i, n) {
  454. return i = N(i) ? i.apply(e, t) : i,
  455. N(n[i]) ? n[i].apply(e, t) : void L.error('Method "' + i + '" does not exist on jQuery.' + R)
  456. }
  457. R = U,
  458. P = {
  459. statics: {
  460. version: "0.15.0",
  461. Rect: c,
  462. Fractions: h,
  463. Group: r,
  464. ScrollState: d,
  465. Viewport: p,
  466. FracsCallbacks: f,
  467. GroupCallbacks: g,
  468. ScrollStateCallbacks: m,
  469. fracs: function(e, t) {
  470. return h.of(e, t)
  471. }
  472. },
  473. methods: {
  474. content: function(e) {
  475. return this.length ? c.ofContent(this[0], e) : null
  476. },
  477. envelope: function() {
  478. return e(this, function(e) {
  479. var t = c.ofElement(this);
  480. return e ? e.envelope(t) : t
  481. })
  482. },
  483. fracs: function(e, i, n) {
  484. o(e, "string") || (n = i,
  485. i = e,
  486. e = null),
  487. E(i) || (n = i,
  488. i = null),
  489. n = l(n);
  490. var r = U + ".fracs." + T(n);
  491. return "unbind" === e ? this.each(function() {
  492. var e = y(this).data(r);
  493. e && e.unbind(i)
  494. }) : "check" === e ? this.each(function() {
  495. var e = y(this).data(r);
  496. e && e.check()
  497. }) : E(i) ? this.each(function() {
  498. var e = y(this)
  499. , t = e.data(r);
  500. t || (t = new f(this,n),
  501. e.data(r, t)),
  502. t.bind(i)
  503. }) : this.length ? h.of(this[0], n) : null
  504. },
  505. intersection: function() {
  506. return e(this, function(e) {
  507. var t = c.ofElement(this);
  508. return e ? e.intersection(t) : t
  509. })
  510. },
  511. max: function(e, t, i) {
  512. return E(t) || (i = t,
  513. t = null),
  514. i = l(i),
  515. t ? (new g(this,i,e,!0).bind(t),
  516. this) : this.pushStack(new r(this,i).best(e, !0).el)
  517. },
  518. min: function(e, t, i) {
  519. return E(t) || (i = t,
  520. t = null),
  521. i = l(i),
  522. t ? (new g(this,i,e).bind(t),
  523. this) : this.pushStack(new r(this,i).best(e).el)
  524. },
  525. rect: function() {
  526. return this.length ? c.ofElement(this[0]) : null
  527. },
  528. scrollState: function(e, i) {
  529. var n = U + ".scrollState";
  530. return o(e, "string") || (i = e,
  531. e = null),
  532. "unbind" === e ? this.each(function() {
  533. var e = y(this).data(n);
  534. e && e.unbind(i)
  535. }) : "check" === e ? this.each(function() {
  536. var e = y(this).data(n);
  537. e && e.check()
  538. }) : E(i) ? this.each(function() {
  539. var e = y(this)
  540. , t = e.data(n);
  541. t || (t = new m(this),
  542. e.data(n, t)),
  543. t.bind(i)
  544. }) : this.length ? new d(this[0]) : null
  545. },
  546. scroll: function(e, t, i) {
  547. return this.each(function() {
  548. new p(this).scroll(e, t, i)
  549. })
  550. },
  551. scrollTo: function(e, t, i, n) {
  552. return y.isNumeric(e) && (n = i,
  553. i = t,
  554. t = e,
  555. e = null),
  556. e = l(e),
  557. this.each(function() {
  558. e ? new p(this).scrollToElement(e, t, i, n) : new p(this).scrollTo(t, i, n)
  559. })
  560. },
  561. scrollToThis: function(e, t, i, n) {
  562. return (n = new p(l(n))).scrollToElement(this[0], e, t, i),
  563. this
  564. },
  565. softLink: function(t, i, n, r) {
  566. return r = new p(l(r)),
  567. this.filter("a[href^=#]").each(function() {
  568. var e = y(this);
  569. e.on("click", function() {
  570. r.scrollToElement(y(e.attr("href"))[0], t, i, n)
  571. })
  572. })
  573. },
  574. sort: function(e, t, i) {
  575. return o(t, "boolean") || (i = t,
  576. t = null),
  577. i = l(i),
  578. this.pushStack(y.map(new r(this,i).sorted(e, !t), function(e) {
  579. return e.el
  580. }))
  581. },
  582. viewport: function(e) {
  583. return this.length ? c.ofViewport(this[0], e) : null
  584. }
  585. },
  586. defaultStatic: "fracs",
  587. defaultMethod: "fracs"
  588. },
  589. O = [].slice,
  590. L = jQuery,
  591. D = L.extend,
  592. N = L.isFunction,
  593. F = D({}, P),
  594. B = function() {
  595. return H(this, O.call(arguments), F.defaultStatic, B)
  596. }
  597. ,
  598. V = function(e) {
  599. return N(V[e]) ? V[e].apply(this, O.call(arguments, 1)) : H(this, O.call(arguments), F.defaultMethod, V)
  600. }
  601. ,
  602. (k = function(e) {
  603. e && (D(B, e.statics),
  604. D(V, e.methods)),
  605. B.modplug = k
  606. }
  607. ).prev = {
  608. statics: L[R],
  609. methods: L.fn[R]
  610. },
  611. k(P),
  612. L[R] = B,
  613. L.fn[R] = V
  614. }(),
  615. "undefined" == typeof jQuery)
  616. throw new Error("Bootstrap's JavaScript requires jQuery");
  617. !function(m) {
  618. "use strict";
  619. function r(e, t) {
  620. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  621. this.init("tooltip", e, t)
  622. }
  623. r.VERSION = "3.2.0",
  624. r.DEFAULTS = {
  625. animation: !0,
  626. placement: "top",
  627. selector: !1,
  628. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  629. trigger: "hover focus",
  630. title: "",
  631. delay: 0,
  632. html: !1,
  633. container: !1,
  634. viewport: {
  635. selector: "body",
  636. padding: 0
  637. }
  638. },
  639. r.prototype.init = function(e, t, i) {
  640. this.enabled = !0,
  641. this.type = e,
  642. this.$element = m(t),
  643. this.options = this.getOptions(i),
  644. this.$viewport = this.options.viewport && m(this.options.viewport.selector || this.options.viewport);
  645. for (var n = this.options.trigger.split(" "), r = n.length; r--; ) {
  646. var o = n[r];
  647. if ("click" == o)
  648. this.$element.on("click." + this.type, this.options.selector, m.proxy(this.toggle, this));
  649. else if ("manual" != o) {
  650. var a = "hover" == o ? "mouseenter" : "focusin"
  651. , s = "hover" == o ? "mouseleave" : "focusout";
  652. this.$element.on(a + "." + this.type, this.options.selector, m.proxy(this.enter, this)),
  653. this.$element.on(s + "." + this.type, this.options.selector, m.proxy(this.leave, this))
  654. }
  655. }
  656. this.options.selector ? this._options = m.extend({}, this.options, {
  657. trigger: "manual",
  658. selector: ""
  659. }) : this.fixTitle()
  660. }
  661. ,
  662. r.prototype.getDefaults = function() {
  663. return r.DEFAULTS
  664. }
  665. ,
  666. r.prototype.getOptions = function(e) {
  667. return (e = m.extend({}, this.getDefaults(), this.$element.data(), e)).delay && "number" == typeof e.delay && (e.delay = {
  668. show: e.delay,
  669. hide: e.delay
  670. }),
  671. e
  672. }
  673. ,
  674. r.prototype.getDelegateOptions = function() {
  675. var i = {}
  676. , n = this.getDefaults();
  677. return this._options && m.each(this._options, function(e, t) {
  678. n[e] != t && (i[e] = t)
  679. }),
  680. i
  681. }
  682. ,
  683. r.prototype.enter = function(e) {
  684. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  685. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  686. m(e.currentTarget).data("bs." + this.type, t)),
  687. clearTimeout(t.timeout),
  688. t.hoverState = "in",
  689. t.options.delay && t.options.delay.show ? void (t.timeout = setTimeout(function() {}, t.options.delay.show)) : t.show()
  690. }
  691. ,
  692. r.prototype.leave = function(e) {
  693. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  694. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  695. m(e.currentTarget).data("bs." + this.type, t)),
  696. clearTimeout(t.timeout),
  697. t.hoverState = "out",
  698. t.options.delay && t.options.delay.hide ? void (t.timeout = setTimeout(function() {
  699. "out" == t.hoverState && t.hide()
  700. }, t.options.delay.hide)) : t.hide()
  701. }
  702. ,
  703. r.prototype.show = function() {
  704. var e = m.Event("show.bs." + this.type);
  705. if (this.hasContent() && this.enabled) {
  706. this.$element.trigger(e);
  707. var t = m.contains(document.documentElement, this.$element[0]);
  708. if (e.isDefaultPrevented() || !t)
  709. return;
  710. var i = this
  711. , n = this.tip()
  712. , r = this.getUID(this.type);
  713. this.setContent(),
  714. n.attr("id", r),
  715. this.$element.attr("aria-describedby", r),
  716. this.options.animation && n.addClass("fade");
  717. var o = "function" == typeof this.options.placement ? this.options.placement.call(this, n[0], this.$element[0]) : this.options.placement
  718. , a = /\s?auto?\s?/i
  719. , s = a.test(o);
  720. s && (o = o.replace(a, "") || "top"),
  721. n.detach().css({
  722. top: 0,
  723. left: 0,
  724. display: "block"
  725. }).addClass(o).data("bs." + this.type, this),
  726. this.options.container ? n.appendTo(this.options.container) : n.insertAfter(this.$element);
  727. var l = this.getPosition()
  728. , c = n[0].offsetWidth
  729. , h = n[0].offsetHeight;
  730. if (s) {
  731. var u = o
  732. , d = this.$element.parent()
  733. , p = this.getPosition(d);
  734. 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,
  735. n.removeClass(u).addClass(o)
  736. }
  737. var f = this.getCalculatedOffset(o, l, c, h);
  738. this.applyPlacement(f, o);
  739. var g = function() {
  740. i.$element.trigger("shown.bs." + i.type),
  741. i.hoverState = null
  742. };
  743. m.support.transition && this.$tip.hasClass("fade") ? n.one("bsTransitionEnd", g).emulateTransitionEnd(150) : g()
  744. }
  745. }
  746. ,
  747. r.prototype.applyPlacement = function(e, t) {
  748. var i = this.tip()
  749. , n = i[0].offsetWidth
  750. , r = i[0].offsetHeight
  751. , o = parseInt(i.css("margin-top"), 10)
  752. , a = parseInt(i.css("margin-left"), 10);
  753. isNaN(o) && (o = 0),
  754. isNaN(a) && (a = 0),
  755. e.top = e.top + o,
  756. e.left = e.left + a,
  757. m.offset.setOffset(i[0], m.extend({
  758. using: function(e) {
  759. i.css({
  760. top: Math.round(e.top),
  761. left: Math.round(e.left)
  762. })
  763. }
  764. }, e), 0),
  765. i.addClass("in");
  766. var s = i[0].offsetWidth
  767. , l = i[0].offsetHeight;
  768. "top" == t && l != r && (e.top = e.top + r - l);
  769. var c = this.getViewportAdjustedDelta(t, e, s, l);
  770. c.left ? e.left += c.left : e.top += c.top;
  771. var h = c.left ? 2 * c.left - n + s : 2 * c.top - r + l
  772. , u = c.left ? "left" : "top"
  773. , d = c.left ? "offsetWidth" : "offsetHeight";
  774. i.offset(e),
  775. this.replaceArrow(h, i[0][d], u)
  776. }
  777. ,
  778. r.prototype.replaceArrow = function(e, t, i) {
  779. this.arrow().css(i, e ? 50 * (1 - e / t) + "%" : "")
  780. }
  781. ,
  782. r.prototype.setContent = function() {
  783. var e = this.tip()
  784. , t = this.getTitle();
  785. e.find(".tooltip-inner")[this.options.html ? "html" : "text"](t),
  786. e.removeClass("fade in top bottom left right")
  787. }
  788. ,
  789. r.prototype.hide = function() {
  790. function e() {
  791. "in" != t.hoverState && i.detach(),
  792. t.$element.trigger("hidden.bs." + t.type)
  793. }
  794. var t = this
  795. , i = this.tip()
  796. , n = m.Event("hide.bs." + this.type);
  797. if (this.$element.removeAttr("aria-describedby"),
  798. this.$element.trigger(n),
  799. !n.isDefaultPrevented())
  800. return i.removeClass("in"),
  801. m.support.transition && this.$tip.hasClass("fade") ? i.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  802. this.hoverState = null,
  803. this
  804. }
  805. ,
  806. r.prototype.fixTitle = function() {
  807. var e = this.$element;
  808. !e.attr("title") && "string" == typeof e.attr("data-original-title") || e.attr("data-original-title", e.attr("title") || "").attr("title", "")
  809. }
  810. ,
  811. r.prototype.hasContent = function() {
  812. return this.getTitle()
  813. }
  814. ,
  815. r.prototype.getPosition = function(e) {
  816. var t = (e = e || this.$element)[0]
  817. , i = "BODY" == t.tagName;
  818. return m.extend({}, "function" == typeof t.getBoundingClientRect ? t.getBoundingClientRect() : null, {
  819. scroll: i ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  820. width: i ? m(window).width() : e.outerWidth(),
  821. height: i ? m(window).height() : e.outerHeight()
  822. }, i ? {
  823. top: 0,
  824. left: 0
  825. } : e.offset())
  826. }
  827. ,
  828. r.prototype.getCalculatedOffset = function(e, t, i, n) {
  829. return "bottom" == e ? {
  830. top: t.top + t.height,
  831. left: t.left + t.width / 2 - i / 2
  832. } : "top" == e ? {
  833. top: t.top - n,
  834. left: t.left + t.width / 2 - i / 2
  835. } : "left" == e ? {
  836. top: t.top + t.height / 2 - n / 2,
  837. left: t.left - i
  838. } : {
  839. top: t.top + t.height / 2 - n / 2,
  840. left: t.left + t.width
  841. }
  842. }
  843. ,
  844. r.prototype.getViewportAdjustedDelta = function(e, t, i, n) {
  845. var r = {
  846. top: 0,
  847. left: 0
  848. };
  849. if (!this.$viewport)
  850. return r;
  851. var o = this.options.viewport && this.options.viewport.padding || 0
  852. , a = this.getPosition(this.$viewport);
  853. if (/right|left/.test(e)) {
  854. var s = t.top - o - a.scroll
  855. , l = t.top + o - a.scroll + n;
  856. s < a.top ? r.top = a.top - s : l > a.top + a.height && (r.top = a.top + a.height - l)
  857. } else {
  858. var c = t.left - o
  859. , h = t.left + o + i;
  860. c < a.left ? r.left = a.left - c : h > a.width && (r.left = a.left + a.width - h)
  861. }
  862. return r
  863. }
  864. ,
  865. r.prototype.getTitle = function() {
  866. var e = this.$element
  867. , t = this.options;
  868. return e.attr("data-original-title") || ("function" == typeof t.title ? t.title.call(e[0]) : t.title)
  869. }
  870. ,
  871. r.prototype.getUID = function(e) {
  872. for (; e += ~~(1e6 * Math.random()),
  873. document.getElementById(e); )
  874. ;
  875. return e
  876. }
  877. ,
  878. r.prototype.tip = function() {
  879. return this.$tip = this.$tip || m(this.options.template)
  880. }
  881. ,
  882. r.prototype.arrow = function() {
  883. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  884. }
  885. ,
  886. r.prototype.validate = function() {
  887. this.$element[0].parentNode || (this.hide(),
  888. this.$element = null,
  889. this.options = null)
  890. }
  891. ,
  892. r.prototype.enable = function() {
  893. this.enabled = !0
  894. }
  895. ,
  896. r.prototype.disable = function() {
  897. this.enabled = !1
  898. }
  899. ,
  900. r.prototype.toggleEnabled = function() {
  901. this.enabled = !this.enabled
  902. }
  903. ,
  904. r.prototype.toggle = function(e) {
  905. var t = this;
  906. e && ((t = m(e.currentTarget).data("bs." + this.type)) || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  907. m(e.currentTarget).data("bs." + this.type, t))),
  908. t.tip().hasClass("in") ? t.leave(t) : t.enter(t)
  909. }
  910. ,
  911. r.prototype.destroy = function() {
  912. clearTimeout(this.timeout),
  913. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  914. }
  915. ;
  916. var e = m.fn.tooltip;
  917. m.fn.tooltip = function(n) {
  918. return this.each(function() {
  919. var e = m(this)
  920. , t = e.data("bs.tooltip")
  921. , i = "object" == typeof n && n;
  922. !t && "destroy" == n || (t || e.data("bs.tooltip", t = new r(this,i)),
  923. "string" == typeof n && t[n]())
  924. })
  925. }
  926. ,
  927. m.fn.tooltip.Constructor = r,
  928. m.fn.tooltip.noConflict = function() {
  929. return m.fn.tooltip = e,
  930. this
  931. }
  932. }(jQuery),
  933. function(e, t, i) {
  934. "undefined" != typeof module && module.exports ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : t.Keen = i()
  935. }(0, this, function() {
  936. "use strict";
  937. function Keen() {
  938. return _init.apply(this, arguments)
  939. }
  940. function _init(e) {
  941. if (_isUndefined(e))
  942. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  943. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  944. throw new Error("Please provide a projectId");
  945. this.configure(e)
  946. }
  947. function _extend(e) {
  948. for (var t = 1; t < arguments.length; t++)
  949. for (var i in arguments[t])
  950. e[i] = arguments[t][i];
  951. return e
  952. }
  953. function _isUndefined(e) {
  954. return void 0 === e
  955. }
  956. function _type(e) {
  957. var t = e && e.constructor ? e.constructor.toString() : void 0;
  958. return t ? t.match(/function (.*)\(/)[1] : "Null"
  959. }
  960. function _each(e, t, i) {
  961. var n;
  962. if (!e)
  963. return 0;
  964. if (i = i || e,
  965. "array" === _type(e)) {
  966. for (n = 0; n < e.length; n++)
  967. if (!1 === t.call(i, e[n], n, e))
  968. return 0
  969. } else
  970. for (n in e)
  971. if (e.hasOwnProperty(n) && !1 === t.call(i, e[n], n, e))
  972. return 0;
  973. return 1
  974. }
  975. function _parse_params(e) {
  976. for (var t, i = {}, n = /\+/g, r = /([^&=]+)=?([^&]*)/g, o = function(e) {
  977. return decodeURIComponent(e.replace(n, " "))
  978. }, a = e.split("?")[1]; t = r.exec(a); )
  979. i[o(t[1])] = o(t[2]);
  980. return i
  981. }
  982. function _set_protocol(e) {
  983. switch (e) {
  984. case "http":
  985. return "http";
  986. case "auto":
  987. return location.protocol.replace(/:/g, "");
  988. case "https":
  989. case void 0:
  990. default:
  991. return "https"
  992. }
  993. }
  994. function _set_request_type(e) {
  995. var t = e || "jsonp"
  996. , i = !1;
  997. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (i = !0),
  998. null == t || "xhr" == t ? i ? "xhr" : "jsonp" : t
  999. }
  1000. function _build_url(e) {
  1001. return this.client.endpoint + "/projects/" + this.client.projectId + e
  1002. }
  1003. function _uploadEvent(e, t, i, n, r) {
  1004. var o = _build_url.apply(this, ["/events/" + e])
  1005. , a = {};
  1006. for (var s in i = !1 !== i,
  1007. this.client.globalProperties && (a = this.client.globalProperties(e)),
  1008. t)
  1009. t.hasOwnProperty(s) && (a[s] = t[s]);
  1010. switch (this.client.requestType) {
  1011. case "xhr":
  1012. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, i, n, r]);
  1013. break;
  1014. case "jsonp":
  1015. var l = JSON.stringify(a)
  1016. , c = Keen.Base64.encode(l);
  1017. o = (o = (o = o + "?api_key=" + this.client.writeKey) + "&data=" + c) + "&modified=" + (new Date).getTime(),
  1018. _request.jsonp.apply(this, [o, this.client.writeKey, n, r]);
  1019. break;
  1020. case "beacon":
  1021. l = JSON.stringify(a),
  1022. c = Keen.Base64.encode(l);
  1023. o = (o = (o = o + "?api_key=" + encodeURIComponent(this.client.writeKey)) + "&data=" + encodeURIComponent(c)) + "&modified=" + encodeURIComponent((new Date).getTime()),
  1024. o += "&c=clv1",
  1025. _request.beacon.apply(this, [o, null, n, r])
  1026. }
  1027. }
  1028. Keen.prototype.configure = function(e) {
  1029. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  1030. e.protocol = _set_protocol(e.protocol),
  1031. e.requestType = _set_request_type(e.requestType),
  1032. this.client = {
  1033. projectId: e.projectId,
  1034. writeKey: e.writeKey,
  1035. readKey: e.readKey,
  1036. globalProperties: null,
  1037. endpoint: e.protocol + "://" + e.host,
  1038. requestType: e.requestType
  1039. },
  1040. Keen.trigger("client", this, e),
  1041. this.trigger("ready"),
  1042. this
  1043. }
  1044. ;
  1045. var _request = {
  1046. xhr: function(e, t, i, n, r, o, a, s) {
  1047. if (!r)
  1048. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  1049. var l = new XMLHttpRequest;
  1050. if (l.onreadystatechange = function() {
  1051. if (4 == l.readyState)
  1052. if (200 <= l.status && l.status < 300) {
  1053. var e;
  1054. try {
  1055. e = JSON.parse(l.responseText)
  1056. } catch (e) {
  1057. Keen.log("Could not JSON parse HTTP response: " + l.responseText),
  1058. s && s(l, e)
  1059. }
  1060. a && e && a(e)
  1061. } else
  1062. Keen.log("HTTP request failed."),
  1063. s && s(l, null)
  1064. }
  1065. ,
  1066. l.open(e, t, o),
  1067. r && l.setRequestHeader("Authorization", r),
  1068. n && l.setRequestHeader("Content-Type", "application/json"),
  1069. i)
  1070. for (var c in i)
  1071. i.hasOwnProperty(c) && l.setRequestHeader(c, i[c]);
  1072. var h = n ? JSON.stringify(n) : null;
  1073. l.send(h)
  1074. },
  1075. jsonp: function(e, t, i, n) {
  1076. if (!t)
  1077. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  1078. if (t && e.indexOf("api_key") < 0) {
  1079. var r = 0 < e.indexOf("?") ? "&" : "?";
  1080. e = e + r + "api_key=" + t
  1081. }
  1082. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  1083. o += "a";
  1084. var a = !1;
  1085. window[o] = function(e) {
  1086. a = !0,
  1087. i && e && i(e),
  1088. window[o] = void 0
  1089. }
  1090. ,
  1091. e = e + "&jsonp=" + o;
  1092. var s = document.createElement("script");
  1093. s.id = "keen-jsonp",
  1094. s.src = e,
  1095. document.getElementsByTagName("head")[0].appendChild(s),
  1096. s.onreadystatechange = function() {
  1097. !1 === a && "loaded" === this.readyState && (a = !0,
  1098. n && n())
  1099. }
  1100. ,
  1101. s.onerror = function() {
  1102. !1 === a && (a = !0,
  1103. n && n())
  1104. }
  1105. },
  1106. beacon: function(e, t, i, n) {
  1107. if (t && e.indexOf("api_key") < 0) {
  1108. var r = 0 < e.indexOf("?") ? "&" : "?";
  1109. e = e + r + "api_key=" + t
  1110. }
  1111. var o = document.createElement("img");
  1112. o.onload = function() {
  1113. if (!0,
  1114. "naturalHeight"in this) {
  1115. if (this.naturalHeight + this.naturalWidth === 0)
  1116. return void this.onerror()
  1117. } else if (this.width + this.height === 0)
  1118. return void this.onerror();
  1119. i && i({
  1120. created: !0
  1121. })
  1122. }
  1123. ,
  1124. o.onerror = function() {
  1125. !0,
  1126. n && n()
  1127. }
  1128. ,
  1129. o.src = e
  1130. }
  1131. }
  1132. , Events = Keen.Events = {
  1133. on: function(e, t) {
  1134. return this.listeners || (this.listeners = {}),
  1135. (this.listeners[e] || (this.listeners[e] = [])).push({
  1136. callback: t
  1137. }),
  1138. this
  1139. },
  1140. off: function(e, t) {
  1141. if (!e && !t)
  1142. return this.listeners = void 0,
  1143. delete this.listeners,
  1144. this;
  1145. for (var i = this.listeners[e] || [], n = i.length; n--; )
  1146. t && t == i[n].callback && this.listeners[e].splice(n, 1),
  1147. t && 0 != i.length || (this.listeners[e] = void 0,
  1148. delete this.listeners[e]);
  1149. return this
  1150. },
  1151. trigger: function(e) {
  1152. if (!this.listeners)
  1153. return this;
  1154. for (var t = Array.prototype.slice.call(arguments, 1), i = this.listeners[e] || [], n = 0; n < i.length; n++)
  1155. i[n].callback.apply(this, t);
  1156. return this
  1157. }
  1158. };
  1159. _extend(Keen.prototype, Events),
  1160. _extend(Keen, Events),
  1161. Keen.loaded = !0,
  1162. Keen.utils = {
  1163. each: _each,
  1164. extend: _extend,
  1165. parseParams: _parse_params
  1166. },
  1167. Keen.ready = function(e) {
  1168. Keen.loaded ? e() : Keen.on("ready", e)
  1169. }
  1170. ,
  1171. Keen.log = function(e) {
  1172. "object" == typeof console && console.log("[Keen IO]", e)
  1173. }
  1174. ;
  1175. var Plugins = Keen.Plugins = {}, Hh, Ih;
  1176. Keen.prototype.addEvent = function() {
  1177. _uploadEvent.apply(this, arguments)
  1178. }
  1179. ,
  1180. Keen.prototype.addEventSync = function(e, t, i, n) {
  1181. _uploadEvent.apply(this, [e, t, !1, i, n])
  1182. }
  1183. ,
  1184. Keen.prototype.trackExternalLink = function(e, t, i, n, r) {
  1185. var o = e
  1186. , a = o.metaKey
  1187. , s = o.target
  1188. , l = !1
  1189. , c = function() {};
  1190. return void 0 === n && (n = 500),
  1191. "A" === s.nodeName ? c = function() {
  1192. a || l || (l = !0,
  1193. window.location = s.href)
  1194. }
  1195. : "FORM" === s.nodeName && (c = function() {
  1196. l || (l = !0,
  1197. s.submit())
  1198. }
  1199. ),
  1200. r && (c = function() {
  1201. l || (l = !0,
  1202. r())
  1203. }
  1204. ),
  1205. _uploadEvent.call(this, t, i, c, c),
  1206. setTimeout(function() {
  1207. c()
  1208. }, n),
  1209. !!a && void 0
  1210. }
  1211. ,
  1212. Keen.prototype.setGlobalProperties = function(e) {
  1213. if (!this.client)
  1214. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1215. if (!e || "function" != typeof e)
  1216. throw new Error("Invalid value for global properties: " + e);
  1217. this.client.globalProperties = e
  1218. }
  1219. ,
  1220. Keen.Base64 = {
  1221. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1222. encode: function(e) {
  1223. var t, i, n, r, o, a, s, l = "", c = 0, h = this.map;
  1224. for (e = this.utf8.encode(e); c < e.length; )
  1225. t = e.charCodeAt(c++),
  1226. i = e.charCodeAt(c++),
  1227. n = e.charCodeAt(c++),
  1228. r = t >> 2,
  1229. o = (3 & t) << 4 | i >> 4,
  1230. a = isNaN(i) ? 64 : (15 & i) << 2 | n >> 6,
  1231. s = isNaN(i) || isNaN(n) ? 64 : 63 & n,
  1232. l = l + h.charAt(r) + h.charAt(o) + h.charAt(a) + h.charAt(s);
  1233. return l
  1234. },
  1235. decode: function(e) {
  1236. var t, i, n, r, o, a, s = "", l = 0, c = this.map, h = String.fromCharCode;
  1237. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1238. t = c.indexOf(e.charAt(l++)),
  1239. o = (15 & (i = c.indexOf(e.charAt(l++)))) << 4 | (n = c.indexOf(e.charAt(l++))) >> 2,
  1240. a = (3 & n) << 6 | (r = c.indexOf(e.charAt(l++))),
  1241. s = s + (h(t << 2 | i >> 4) + (64 != n ? h(o) : "")) + (64 != r ? h(a) : "");
  1242. return this.utf8.decode(s)
  1243. },
  1244. utf8: {
  1245. encode: function(e) {
  1246. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1247. 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);
  1248. return i
  1249. },
  1250. decode: function(e) {
  1251. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1252. 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];
  1253. return i
  1254. }
  1255. }
  1256. },
  1257. "object" != typeof JSON && (JSON = {}),
  1258. function() {
  1259. function f(e) {
  1260. return e < 10 ? "0" + e : e
  1261. }
  1262. function quote(e) {
  1263. return escapable.lastIndex = 0,
  1264. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1265. var t = meta[e];
  1266. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1267. }) + '"' : '"' + e + '"'
  1268. }
  1269. function str(e, t) {
  1270. var i, n, r, o, a, s = gap, l = t[e];
  1271. switch (l && "object" == typeof l && "function" == typeof l.toJSON && (l = l.toJSON(e)),
  1272. "function" == typeof rep && (l = rep.call(t, e, l)),
  1273. typeof l) {
  1274. case "string":
  1275. return quote(l);
  1276. case "number":
  1277. return isFinite(l) ? String(l) : "null";
  1278. case "boolean":
  1279. case "null":
  1280. return String(l);
  1281. case "object":
  1282. if (!l)
  1283. return "null";
  1284. if (gap += indent,
  1285. a = [],
  1286. "[object Array]" === Object.prototype.toString.apply(l)) {
  1287. for (o = l.length,
  1288. i = 0; i < o; i += 1)
  1289. a[i] = str(i, l) || "null";
  1290. return r = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + s + "]" : "[" + a.join(",") + "]",
  1291. gap = s,
  1292. r
  1293. }
  1294. if (rep && "object" == typeof rep)
  1295. for (o = rep.length,
  1296. i = 0; i < o; i += 1)
  1297. "string" == typeof rep[i] && ((r = str(n = rep[i], l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1298. else
  1299. for (n in l)
  1300. Object.prototype.hasOwnProperty.call(l, n) && ((r = str(n, l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1301. return r = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + s + "}" : "{" + a.join(",") + "}",
  1302. gap = s,
  1303. r
  1304. }
  1305. }
  1306. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1307. 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
  1308. }
  1309. ,
  1310. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1311. return this.valueOf()
  1312. }
  1313. );
  1314. 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 = {
  1315. "\b": "\\b",
  1316. "\t": "\\t",
  1317. "\n": "\\n",
  1318. "\f": "\\f",
  1319. "\r": "\\r",
  1320. '"': '\\"',
  1321. "\\": "\\\\"
  1322. }, rep;
  1323. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, i) {
  1324. var n;
  1325. if (indent = gap = "",
  1326. "number" == typeof i)
  1327. for (n = 0; n < i; n += 1)
  1328. indent += " ";
  1329. else
  1330. "string" == typeof i && (indent = i);
  1331. if ((rep = t) && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1332. throw new Error("JSON.stringify");
  1333. return str("", {
  1334. "": e
  1335. })
  1336. }
  1337. ),
  1338. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1339. function walk(e, t) {
  1340. var i, n, r = e[t];
  1341. if (r && "object" == typeof r)
  1342. for (i in r)
  1343. Object.prototype.hasOwnProperty.call(r, i) && (void 0 !== (n = walk(r, i)) ? r[i] = n : delete r[i]);
  1344. return reviver.call(e, t, r)
  1345. }
  1346. var j;
  1347. if (text = String(text),
  1348. cx.lastIndex = 0,
  1349. cx.test(text) && (text = text.replace(cx, function(e) {
  1350. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1351. })),
  1352. /^[\],:{}\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, "")))
  1353. return j = eval("(" + text + ")"),
  1354. "function" == typeof reviver ? walk({
  1355. "": j
  1356. }, "") : j;
  1357. throw new SyntaxError("JSON.parse")
  1358. }
  1359. )
  1360. }(),
  1361. Hh = Keen.utils,
  1362. Ih = function(i) {
  1363. function e(e) {
  1364. for (u = 1; e = n.shift(); )
  1365. e()
  1366. }
  1367. 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]);
  1368. return r[l] && r[l](s, t = function() {
  1369. r.removeEventListener(s, t, !1),
  1370. e()
  1371. }
  1372. , !1),
  1373. a && r.attachEvent(c, t = function() {
  1374. /^c/.test(r[h]) && (r.detachEvent(c, t),
  1375. e())
  1376. }
  1377. ),
  1378. i = a ? function(t) {
  1379. self != top ? u ? t() : n.push(t) : function() {
  1380. try {
  1381. o.doScroll("left")
  1382. } catch (e) {
  1383. return setTimeout(function() {
  1384. i(t)
  1385. }, 50)
  1386. }
  1387. t()
  1388. }()
  1389. }
  1390. : function(e) {
  1391. u ? e() : n.push(e)
  1392. }
  1393. }
  1394. ,
  1395. "undefined" != typeof module && module.exports ? module.exports = Ih() : "function" == typeof define && define.amd ? define(Ih) : Hh.domready = Ih();
  1396. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1397. if (loaded && cached) {
  1398. for (var instance in clients = cached.clients || {},
  1399. ready = cached.ready || [],
  1400. clients)
  1401. if (clients.hasOwnProperty(instance)) {
  1402. var client = clients[instance];
  1403. for (var method in Keen.prototype)
  1404. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1405. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1406. ,
  1407. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1408. ,
  1409. client._config && (client.configure.call(client, client._config),
  1410. delete client._config),
  1411. client._setGlobalProperties) {
  1412. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1413. client.setGlobalProperties.apply(client, globals[i]);
  1414. delete client._setGlobalProperties
  1415. }
  1416. if (client._addEvent) {
  1417. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1418. client.addEvent.apply(client, queue[i]);
  1419. delete client._addEvent
  1420. }
  1421. var callback = client._on || [];
  1422. if (client._on) {
  1423. for (var i = 0; i < callback.length; i++)
  1424. client.on.apply(client, callback[i]);
  1425. client.trigger("ready"),
  1426. delete client._on
  1427. }
  1428. }
  1429. for (var i = 0; i < ready.length; i++) {
  1430. var callback = ready[i];
  1431. Keen.on("ready", function() {
  1432. callback()
  1433. })
  1434. }
  1435. }
  1436. return Keen.loaded && setTimeout(function() {
  1437. Keen.utils.domready(function() {
  1438. Keen.trigger("ready")
  1439. })
  1440. }, 0),
  1441. Keen
  1442. }),
  1443. function() {
  1444. var i = window.analytics = window.analytics || [];
  1445. if (!i.initialize) {
  1446. if (i.invoked)
  1447. return window.console && console.error && console.error("Segment snippet included twice.");
  1448. i.invoked = !0,
  1449. i.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1450. i.factory = function(t) {
  1451. return function() {
  1452. var e = Array.prototype.slice.call(arguments);
  1453. return e.unshift(t),
  1454. i.push(e),
  1455. i
  1456. }
  1457. }
  1458. ;
  1459. for (var e = 0; e < i.methods.length; e++) {
  1460. var t = i.methods[e];
  1461. i[t] = i.factory(t)
  1462. }
  1463. i.load = function(e) {
  1464. var t = document.createElement("script");
  1465. t.type = "text/javascript",
  1466. t.async = !0,
  1467. t.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + e + "/analytics.min.js";
  1468. var i = document.getElementsByTagName("script")[0];
  1469. i.parentNode.insertBefore(t, i)
  1470. }
  1471. ,
  1472. i.SNIPPET_VERSION = "4.0.0"
  1473. }
  1474. }(),
  1475. function(i, u) {
  1476. "use strict";
  1477. var d = "function"
  1478. , p = "undefined"
  1479. , f = "object"
  1480. , e = "major"
  1481. , t = "model"
  1482. , n = "name"
  1483. , r = "type"
  1484. , o = "vendor"
  1485. , a = "version"
  1486. , s = "architecture"
  1487. , l = "console"
  1488. , c = "mobile"
  1489. , h = "tablet"
  1490. , g = {
  1491. has: function(e, t) {
  1492. return -1 !== t.toLowerCase().indexOf(e.toLowerCase())
  1493. },
  1494. lowerize: function(e) {
  1495. return e.toLowerCase()
  1496. }
  1497. }
  1498. , m = {
  1499. rgx: function() {
  1500. for (var e, t, i, n, r, o, a, s = 0, l = arguments; s < l.length; s += 2) {
  1501. var c = l[s]
  1502. , h = l[s + 1];
  1503. if (typeof e == p)
  1504. for (n in e = {},
  1505. h)
  1506. typeof (r = h[n]) == f ? e[r[0]] = u : e[r] = u;
  1507. for (t = i = 0; t < c.length; t++)
  1508. if (o = c[t].exec(this.getUA())) {
  1509. for (n = 0; n < h.length; n++)
  1510. a = o[++i],
  1511. 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;
  1512. break
  1513. }
  1514. if (o)
  1515. break
  1516. }
  1517. return e
  1518. },
  1519. str: function(e, t) {
  1520. for (var i in t)
  1521. if (typeof t[i] == f && 0 < t[i].length) {
  1522. for (var n = 0; n < t[i].length; n++)
  1523. if (g.has(t[i][n], e))
  1524. return "?" === i ? u : i
  1525. } else if (g.has(t[i], e))
  1526. return "?" === i ? u : i;
  1527. return e
  1528. }
  1529. }
  1530. , v = {
  1531. browser: {
  1532. oldsafari: {
  1533. major: {
  1534. 1: ["/8", "/1", "/3"],
  1535. 2: "/4",
  1536. "?": "/"
  1537. },
  1538. version: {
  1539. "1.0": "/8",
  1540. 1.2: "/1",
  1541. 1.3: "/3",
  1542. "2.0": "/412",
  1543. "2.0.2": "/416",
  1544. "2.0.3": "/417",
  1545. "2.0.4": "/419",
  1546. "?": "/"
  1547. }
  1548. }
  1549. },
  1550. device: {
  1551. sprint: {
  1552. model: {
  1553. "Evo Shift 4G": "7373KT"
  1554. },
  1555. vendor: {
  1556. HTC: "APA",
  1557. Sprint: "Sprint"
  1558. }
  1559. }
  1560. },
  1561. os: {
  1562. windows: {
  1563. version: {
  1564. ME: "4.90",
  1565. "NT 3.11": "NT3.51",
  1566. "NT 4.0": "NT4.0",
  1567. 2e3: "NT 5.0",
  1568. XP: ["NT 5.1", "NT 5.2"],
  1569. Vista: "NT 6.0",
  1570. 7: "NT 6.1",
  1571. 8: "NT 6.2",
  1572. 8.1: "NT 6.3",
  1573. RT: "ARM"
  1574. }
  1575. }
  1576. }
  1577. }
  1578. , y = {
  1579. 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]],
  1580. 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]],
  1581. 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]],
  1582. 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]],
  1583. 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]]
  1584. }
  1585. , A = function(e) {
  1586. var t = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : "");
  1587. return this instanceof A ? (this.getBrowser = function() {
  1588. return m.rgx.apply(this, y.browser)
  1589. }
  1590. ,
  1591. this.getCPU = function() {
  1592. return m.rgx.apply(this, y.cpu)
  1593. }
  1594. ,
  1595. this.getDevice = function() {
  1596. return m.rgx.apply(this, y.device)
  1597. }
  1598. ,
  1599. this.getEngine = function() {
  1600. return m.rgx.apply(this, y.engine)
  1601. }
  1602. ,
  1603. this.getOS = function() {
  1604. return m.rgx.apply(this, y.os)
  1605. }
  1606. ,
  1607. this.getResult = function() {
  1608. return {
  1609. ua: this.getUA(),
  1610. browser: this.getBrowser(),
  1611. engine: this.getEngine(),
  1612. os: this.getOS(),
  1613. device: this.getDevice(),
  1614. cpu: this.getCPU()
  1615. }
  1616. }
  1617. ,
  1618. this.getUA = function() {
  1619. return t
  1620. }
  1621. ,
  1622. this.setUA = function(e) {
  1623. return t = e,
  1624. this
  1625. }
  1626. ,
  1627. void this.setUA(t)) : new A(e).getResult()
  1628. };
  1629. if (typeof exports != p)
  1630. typeof module != p && module.exports && (exports = module.exports = A),
  1631. exports.UAParser = A;
  1632. else if (i.UAParser = A,
  1633. typeof define == d && define.amd && define(function() {
  1634. return A
  1635. }),
  1636. typeof i.jQuery != p) {
  1637. var C = i.jQuery
  1638. , I = new A;
  1639. C.ua = I.getResult(),
  1640. C.ua.get = function() {
  1641. return I.getUA()
  1642. }
  1643. ,
  1644. C.ua.set = function(e) {
  1645. I.setUA(e);
  1646. var t = I.getResult();
  1647. for (var i in t)
  1648. C.ua[i] = t[i]
  1649. }
  1650. }
  1651. }(this),
  1652. window.Modernizr = function(e, t) {
  1653. function i(e, t) {
  1654. return typeof e === t
  1655. }
  1656. var n, r, o, a = {}, s = t.documentElement, l = t.createElement("modernizr"), c = l.style, h = {}, u = [], d = u.slice, p = {}.hasOwnProperty;
  1657. for (var f in r = i(p, "undefined") || i(p.call, "undefined") ? function(e, t) {
  1658. return t in e && i(e.constructor.prototype[t], "undefined")
  1659. }
  1660. : function(e, t) {
  1661. return p.call(e, t)
  1662. }
  1663. ,
  1664. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1665. var r = this;
  1666. if ("function" != typeof r)
  1667. throw new TypeError;
  1668. var o = d.call(arguments, 1)
  1669. , a = function() {
  1670. if (this instanceof a) {
  1671. function e() {}
  1672. e.prototype = r.prototype;
  1673. var t = new e
  1674. , i = r.apply(t, o.concat(d.call(arguments)));
  1675. return Object(i) === i ? i : t
  1676. }
  1677. return r.apply(n, o.concat(d.call(arguments)))
  1678. };
  1679. return a
  1680. }
  1681. ),
  1682. h.webgl = function() {
  1683. return !!e.WebGLRenderingContext
  1684. }
  1685. ,
  1686. h)
  1687. r(h, f) && (n = f.toLowerCase(),
  1688. a[n] = h[f](),
  1689. u.push((a[n] ? "" : "no-") + n));
  1690. return a.addTest = function(e, t) {
  1691. if ("object" == typeof e)
  1692. for (var i in e)
  1693. r(e, i) && a.addTest(i, e[i]);
  1694. else {
  1695. if (e = e.toLowerCase(),
  1696. void 0 !== a[e])
  1697. return a;
  1698. t = "function" == typeof t ? t() : t,
  1699. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (t ? "" : "no-") + e),
  1700. a[e] = t
  1701. }
  1702. return a
  1703. }
  1704. ,
  1705. o = "",
  1706. c.cssText = o,
  1707. l = null,
  1708. a._version = "2.8.2",
  1709. a
  1710. }(this, this.document),
  1711. function(xe, e, Se) {
  1712. "use strict";
  1713. function Me(s, e, n) {
  1714. function a(e) {
  1715. var t = Q.length;
  1716. if (G.old = xe.extend({}, G),
  1717. H = V ? 0 : k[F.horizontal ? "width" : "height"](),
  1718. Y = W[F.horizontal ? "width" : "height"](),
  1719. z = V ? s : U[F.horizontal ? "outerWidth" : "outerHeight"](),
  1720. Q.length = 0,
  1721. G.start = 0,
  1722. G.end = nt(z - H, 0),
  1723. le) {
  1724. $.length,
  1725. J = U.children(F.itemSelector),
  1726. $.length = 0;
  1727. 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;
  1728. z = 0,
  1729. J.each(function(e, t) {
  1730. var i = xe(t)
  1731. , n = t.getBoundingClientRect()
  1732. , r = it(F.horizontal ? n.width || n.right - n.left : n.height || n.bottom - n.top)
  1733. , o = Ne(i, F.horizontal ? "marginLeft" : "marginTop")
  1734. , a = Ne(i, F.horizontal ? "marginRight" : "marginBottom")
  1735. , s = r + o + a
  1736. , l = !o || !a
  1737. , c = {};
  1738. c.el = t,
  1739. c.size = l ? r : s,
  1740. c.half = c.size / 2,
  1741. c.start = z + (l ? o : 0),
  1742. c.center = c.start - it(H / 2 - c.size / 2),
  1743. c.end = c.start - H + c.size,
  1744. e || (z += u),
  1745. z += s,
  1746. F.horizontal || p || a && o && 0 < e && (z -= rt(o, a)),
  1747. e === g && (c.end += d,
  1748. z += d,
  1749. f = l ? a : 0),
  1750. $.push(c),
  1751. h = c
  1752. }),
  1753. U[0].style[F.horizontal ? "width" : "height"] = (i ? z : z - u - d) + "px",
  1754. z -= f,
  1755. $.length ? (G.start = $[0][ae ? "center" : "start"],
  1756. G.end = ae ? h.center : H < z ? h.end : G.start) : G.start = G.end = 0
  1757. }
  1758. if (G.center = it(G.end / 2 + G.start / 2),
  1759. v(),
  1760. j.length && 0 < Y && (F.dynamicHandle ? (q = Fe(q = G.start === G.end ? Y : it(Y * H / z), F.minHandleSize, Y),
  1761. j[0].style[F.horizontal ? "width" : "height"] = q + "px") : q = j[F.horizontal ? "outerWidth" : "outerHeight"](),
  1762. X.end = Y - q,
  1763. _e || c()),
  1764. !V && 0 < H) {
  1765. var n = G.start
  1766. , r = "";
  1767. if (le)
  1768. xe.each($, function(e, t) {
  1769. ae ? Q.push(t.center) : t.start + t.size > n && n <= G.end && (n = t.start,
  1770. Q.push(n),
  1771. (n += H) > G.end && n < G.end + H && Q.push(G.end))
  1772. });
  1773. else
  1774. for (; n - H < G.end; )
  1775. Q.push(n),
  1776. n += H;
  1777. if (Z[0] && t !== Q.length) {
  1778. for (var o = 0; o < Q.length; o++)
  1779. r += F.pageBuilder.call(B, o);
  1780. (K = Z.html(r).children()).eq(ee.activePage).addClass(F.activeClass)
  1781. }
  1782. }
  1783. if (ee.slideeSize = z,
  1784. ee.frameSize = H,
  1785. ee.sbSize = Y,
  1786. ee.handleSize = q,
  1787. le) {
  1788. e && null != F.startAt && (m(F.startAt),
  1789. B[se ? "toCenter" : "toStart"](F.startAt));
  1790. var a = $[ee.activeItem];
  1791. l(se && a ? a.center : Fe(G.dest, G.start, G.end))
  1792. } else
  1793. e ? null != F.startAt && l(F.startAt, 1) : l(Fe(G.dest, G.start, G.end));
  1794. L("load")
  1795. }
  1796. function l(e, t, i) {
  1797. if (le && Ie.released && !i) {
  1798. var n = d(e)
  1799. , r = e > G.start && e < G.end;
  1800. se ? (r && (e = $[n.centerItem].center),
  1801. ae && F.activateMiddle && m(n.centerItem)) : r && (e = $[n.firstItem].start)
  1802. }
  1803. 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),
  1804. Ae.start = +new Date,
  1805. Ae.time = 0,
  1806. Ae.from = G.cur,
  1807. Ae.to = e,
  1808. Ae.delta = e - G.cur,
  1809. Ae.tweesing = Ie.tweese || Ie.init && !Ie.slidee,
  1810. Ae.immediate = !Ae.tweesing && (t || Ie.init && Ie.slidee || !F.speed),
  1811. Ie.tweese = 0,
  1812. e !== G.dest && (G.dest = e,
  1813. L("change"),
  1814. _e || o()),
  1815. g(),
  1816. v(),
  1817. p(),
  1818. K[0] && ye.page !== ee.activePage && (ye.page = ee.activePage,
  1819. K.removeClass(F.activeClass).eq(ee.activePage).addClass(F.activeClass),
  1820. L("activePage", ye.page))
  1821. }
  1822. function o() {
  1823. if (B.initialized) {
  1824. if (!_e)
  1825. return _e = Ge(o),
  1826. void (Ie.released && L("moveStart"));
  1827. Ae.immediate ? G.cur = Ae.to : Ae.tweesing ? (Ae.tweeseDelta = Ae.to - G.cur,
  1828. $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),
  1829. G.cur = Ae.from + Ae.delta * xe.easing[F.easing](Ae.time / F.speed, Ae.time, 0, 1, F.speed)),
  1830. Ae.to === G.cur ? (G.cur = Ae.to,
  1831. Ie.tweese = _e = 0) : _e = Ge(o),
  1832. L("move"),
  1833. 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"),
  1834. !_e && Ie.released && L("moveEnd"),
  1835. c()
  1836. }
  1837. }
  1838. function c() {
  1839. 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,
  1840. X.cur = Fe(it(X.cur), X.start, X.end),
  1841. ye.hPos !== X.cur && (ye.hPos = X.cur,
  1842. Ve ? j[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + X.cur + "px)" : j[0].style[F.horizontal ? "left" : "top"] = X.cur + "px"))
  1843. }
  1844. function t() {
  1845. Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) || B.stop(),
  1846. Te = Ie.init ? Ge(t) : 0,
  1847. Ce.now = +new Date,
  1848. Ce.pos = G.cur + (Ce.now - Ce.lastTime) / 1e3 * Ce.speed,
  1849. l(Ie.init ? Ce.pos : it(Ce.pos)),
  1850. Ie.init || G.cur !== G.dest || L("moveEnd"),
  1851. Ce.lastTime = Ce.now
  1852. }
  1853. function i(e, t, i) {
  1854. if ("boolean" === Re(t) && (i = t,
  1855. t = Se),
  1856. t === Se)
  1857. l(G[e], i);
  1858. else {
  1859. if (se && "center" !== e)
  1860. return;
  1861. var n = B.getPos(t);
  1862. n && l(n[e], i, !se)
  1863. }
  1864. }
  1865. function h(e) {
  1866. return null != e ? De(e) ? 0 <= e && e < $.length ? e : -1 : J.index(e) : -1
  1867. }
  1868. function u(e) {
  1869. return h(De(e) && e < 0 ? e + $.length : e)
  1870. }
  1871. function m(e, t) {
  1872. var i = h(e);
  1873. return !(!le || i < 0) && (ye.active === i && !t || (J.eq(ee.activeItem).removeClass(F.activeClass),
  1874. J.eq(i).addClass(F.activeClass),
  1875. ye.active = ee.activeItem = i,
  1876. p(),
  1877. L("active", i)),
  1878. i)
  1879. }
  1880. function d(e) {
  1881. e = Fe(De(e) ? e : G.dest, G.start, G.end);
  1882. var t = {}
  1883. , i = ae ? 0 : H / 2;
  1884. if (!V)
  1885. for (var n = 0, r = Q.length; n < r; n++) {
  1886. if (e >= G.end || n === Q.length - 1) {
  1887. t.activePage = Q.length - 1;
  1888. break
  1889. }
  1890. if (e <= Q[n] + i) {
  1891. t.activePage = n;
  1892. break
  1893. }
  1894. }
  1895. if (le) {
  1896. for (var o = !1, a = !1, s = !1, l = 0, c = $.length; l < c; l++)
  1897. if (!1 === o && e <= $[l].start + $[l].half && (o = l),
  1898. !1 === s && e <= $[l].center + $[l].half && (s = l),
  1899. l === c - 1 || e <= $[l].end + $[l].half) {
  1900. a = l;
  1901. break
  1902. }
  1903. t.firstItem = De(o) ? o : 0,
  1904. t.centerItem = De(s) ? s : t.firstItem,
  1905. t.lastItem = De(a) ? a : t.centerItem
  1906. }
  1907. return t
  1908. }
  1909. function v(e) {
  1910. xe.extend(ee, d(e))
  1911. }
  1912. function p() {
  1913. var e = G.dest <= G.start
  1914. , t = G.dest >= G.end
  1915. , i = (e ? 1 : 0) | (t ? 2 : 0);
  1916. if (ye.slideePosState !== i && (ye.slideePosState = i,
  1917. ge.is("button,input") && ge.prop("disabled", e),
  1918. me.is("button,input") && me.prop("disabled", t),
  1919. ge.add(de)[e ? "addClass" : "removeClass"](F.disabledClass),
  1920. me.add(ue)[t ? "addClass" : "removeClass"](F.disabledClass)),
  1921. ye.fwdbwdState !== i && Ie.released && (ye.fwdbwdState = i,
  1922. de.is("button,input") && de.prop("disabled", e),
  1923. ue.is("button,input") && ue.prop("disabled", t)),
  1924. le && null != ee.activeItem) {
  1925. var n = 0 === ee.activeItem
  1926. , r = ee.activeItem >= $.length - 1
  1927. , o = (n ? 1 : 0) | (r ? 2 : 0);
  1928. ye.itemsButtonState !== o && (ye.itemsButtonState = o,
  1929. pe.is("button,input") && pe.prop("disabled", n),
  1930. fe.is("button,input") && fe.prop("disabled", r),
  1931. pe[n ? "addClass" : "removeClass"](F.disabledClass),
  1932. fe[r ? "addClass" : "removeClass"](F.disabledClass))
  1933. }
  1934. }
  1935. function r(e, t, i) {
  1936. if (e = u(e),
  1937. t = u(t),
  1938. -1 < e && -1 < t && e !== t && (!i || t !== e - 1) && (i || t !== e + 1)) {
  1939. J.eq(e)[i ? "insertAfter" : "insertBefore"]($[t].el);
  1940. var n = e < t ? e : i ? t : t - 1
  1941. , r = t < e ? e : i ? t + 1 : t
  1942. , o = t < e;
  1943. 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)),
  1944. a()
  1945. }
  1946. }
  1947. function f(e, t) {
  1948. for (var i = 0, n = ve[e].length; i < n; i++)
  1949. if (ve[e][i] === t)
  1950. return i;
  1951. return -1
  1952. }
  1953. function g() {
  1954. Ie.released && !B.isPaused && B.resume()
  1955. }
  1956. function y(e) {
  1957. return it(Fe(e, X.start, X.end) / X.end * (G.end - G.start)) + G.start
  1958. }
  1959. function A() {
  1960. Ie.history[0] = Ie.history[1],
  1961. Ie.history[1] = Ie.history[2],
  1962. Ie.history[2] = Ie.history[3],
  1963. Ie.history[3] = Ie.delta
  1964. }
  1965. function C(e) {
  1966. Ie.released = 0,
  1967. Ie.source = e,
  1968. Ie.slidee = "slidee" === e
  1969. }
  1970. function I(e) {
  1971. var t = "touchstart" === e.type
  1972. , i = e.data.source
  1973. , n = "slidee" === i;
  1974. 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),
  1975. C(i),
  1976. Ie.init = 0,
  1977. Ie.$source = xe(e.target),
  1978. Ie.touch = t,
  1979. Ie.pointer = t ? e.originalEvent.touches[0] : e,
  1980. Ie.initX = Ie.pointer.pageX,
  1981. Ie.initY = Ie.pointer.pageY,
  1982. Ie.initPos = n ? G.cur : X.cur,
  1983. Ie.start = +new Date,
  1984. Ie.time = 0,
  1985. Ie.path = 0,
  1986. Ie.delta = 0,
  1987. Ie.locked = 0,
  1988. Ie.history = [0, 0, 0, 0],
  1989. Ie.pathToLock = n ? t ? 30 : 10 : 0,
  1990. We.on(t ? qe : Ye, E),
  1991. B.pause(1),
  1992. (n ? U : j).addClass(F.draggedClass),
  1993. L("moveStart"),
  1994. n && (be = setInterval(A, 10)))
  1995. }
  1996. function E(e) {
  1997. if (Ie.released = "mouseup" === e.type || "touchend" === e.type,
  1998. Ie.pointer = Ie.touch ? e.originalEvent[Ie.released ? "changedTouches" : "touches"][0] : e,
  1999. Ie.pathX = Ie.pointer.pageX - Ie.initX,
  2000. Ie.pathY = Ie.pointer.pageY - Ie.initY,
  2001. Ie.path = et(tt(Ie.pathX, 2) + tt(Ie.pathY, 2)),
  2002. Ie.delta = F.horizontal ? Ie.pathX : Ie.pathY,
  2003. Ie.released || !(Ie.path < 1)) {
  2004. if (!Ie.init) {
  2005. if (!(F.horizontal ? $e(Ie.pathX) > $e(Ie.pathY) : $e(Ie.pathX) < $e(Ie.pathY)))
  2006. return _();
  2007. Ie.init = 1
  2008. }
  2009. Pe(e),
  2010. !Ie.locked && Ie.path > Ie.pathToLock && Ie.slidee && (Ie.locked = 1,
  2011. Ie.$source.on(Ze, Oe)),
  2012. Ie.released && (_(),
  2013. F.releaseSwing && Ie.slidee && (Ie.swing = (Ie.delta - Ie.history[0]) / 40 * 300,
  2014. Ie.delta += Ie.swing,
  2015. Ie.tweese = 10 < $e(Ie.swing))),
  2016. l(Ie.slidee ? it(Ie.initPos - Ie.delta) : y(Ie.initPos + Ie.delta))
  2017. }
  2018. }
  2019. function _() {
  2020. clearInterval(be),
  2021. Ie.released = !0,
  2022. We.off(Ie.touch ? qe : Ye, E),
  2023. (Ie.slidee ? U : j).removeClass(F.draggedClass),
  2024. setTimeout(function() {
  2025. Ie.$source.off(Ze, Oe)
  2026. }),
  2027. G.cur === G.dest && Ie.init && L("moveEnd"),
  2028. B.resume(1),
  2029. Ie.init = 0
  2030. }
  2031. function b(e) {
  2032. return ~xe.inArray(e.nodeName, Qe) || xe(e).is(F.interactive)
  2033. }
  2034. function w() {
  2035. B.stop(),
  2036. We.off("mouseup", w)
  2037. }
  2038. function T(e) {
  2039. switch (Pe(e),
  2040. this) {
  2041. case ue[0]:
  2042. case de[0]:
  2043. B.moveBy(ue.is(this) ? F.moveBy : -F.moveBy),
  2044. We.on("mouseup", w);
  2045. break;
  2046. case pe[0]:
  2047. B.prev();
  2048. break;
  2049. case fe[0]:
  2050. B.next();
  2051. break;
  2052. case ge[0]:
  2053. B.prevPage();
  2054. break;
  2055. case me[0]:
  2056. B.nextPage()
  2057. }
  2058. }
  2059. function x(e) {
  2060. e.originalEvent[He] = B;
  2061. var t = +new Date;
  2062. if (ot + F.scrollHijack > t && ce[0] !== document && ce[0] !== window)
  2063. ot = t;
  2064. else if (F.scrollBy && G.start !== G.end) {
  2065. var i = function(e) {
  2066. return Ee.curDelta = (F.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  2067. Ee.curDelta /= 1 === e.deltaMode ? 3 : 100,
  2068. le ? (Ue = +new Date,
  2069. Ee.last < Ue - Ee.resetTime && (Ee.delta = 0),
  2070. Ee.last = Ue,
  2071. Ee.delta += Ee.curDelta,
  2072. $e(Ee.delta) < 1 ? Ee.finalDelta = 0 : (Ee.finalDelta = it(Ee.delta / 1),
  2073. Ee.delta %= 1),
  2074. Ee.finalDelta) : Ee.curDelta
  2075. }(e.originalEvent);
  2076. (F.scrollTrap || 0 < i && G.dest < G.end || i < 0 && G.dest > G.start) && Pe(e, 1),
  2077. B.slideBy(F.scrollBy * i)
  2078. }
  2079. }
  2080. function S(e) {
  2081. F.clickBar && e.target === W[0] && (Pe(e),
  2082. l(y((F.horizontal ? e.pageX - W.offset().left : e.pageY - W.offset().top) - q / 2)))
  2083. }
  2084. function M(e) {
  2085. if (F.keyboardNavBy)
  2086. switch (e.which) {
  2087. case F.horizontal ? 37 : 38:
  2088. Pe(e),
  2089. B["pages" === F.keyboardNavBy ? "prevPage" : "prev"]();
  2090. break;
  2091. case F.horizontal ? 39 : 40:
  2092. Pe(e),
  2093. B["pages" === F.keyboardNavBy ? "nextPage" : "next"]()
  2094. }
  2095. }
  2096. function R(e) {
  2097. return b(this) ? void (e.originalEvent[He + "ignore"] = !0) : void (this.parentNode !== U[0] || e.originalEvent[He + "ignore"] || B.activate(this))
  2098. }
  2099. function P() {
  2100. this.parentNode === Z[0] && B.activatePage(K.index(this))
  2101. }
  2102. function O(e) {
  2103. F.pauseOnHover && B["mouseenter" === e.type ? "pause" : "resume"](2)
  2104. }
  2105. function L(e, t) {
  2106. if (ve[e]) {
  2107. for (N = ve[e].length,
  2108. Je.length = 0,
  2109. D = 0; D < N; D++)
  2110. Je.push(ve[e][D]);
  2111. for (D = 0; D < N; D++)
  2112. Je[D].call(B, e, t)
  2113. }
  2114. }
  2115. 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 = {
  2116. start: 0,
  2117. center: 0,
  2118. end: 0,
  2119. cur: 0,
  2120. dest: 0
  2121. }, W = xe(F.scrollBar).eq(0), j = W.children().eq(0), Y = 0, q = 0, X = {
  2122. start: 0,
  2123. end: 0,
  2124. cur: 0
  2125. }, Z = xe(F.pagesBar), K = 0, Q = [], J = 0, $ = [], ee = {
  2126. firstItem: 0,
  2127. lastItem: 0,
  2128. centerItem: 0,
  2129. activeItem: null,
  2130. activePage: 0
  2131. }, 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 = {
  2132. released: 1
  2133. }, Ee = {
  2134. last: 0,
  2135. delta: 0,
  2136. resetTime: 200
  2137. }, _e = 0, be = 0, we = 0, Te = 0;
  2138. V || (s = k[0]),
  2139. B.initialized = 0,
  2140. B.frame = s,
  2141. B.slidee = U[0],
  2142. B.pos = G,
  2143. B.rel = ee,
  2144. B.items = $,
  2145. B.pages = Q,
  2146. B.isPaused = 0,
  2147. B.options = F,
  2148. B.dragging = Ie,
  2149. B.reload = function() {
  2150. a()
  2151. }
  2152. ,
  2153. B.getPos = function(e) {
  2154. if (le) {
  2155. var t = h(e);
  2156. return -1 !== t && $[t]
  2157. }
  2158. var i = U.find(e).eq(0);
  2159. if (i[0]) {
  2160. var n = F.horizontal ? i.offset().left - U.offset().left : i.offset().top - U.offset().top
  2161. , r = i[F.horizontal ? "outerWidth" : "outerHeight"]();
  2162. return {
  2163. start: n,
  2164. center: n - H / 2 + r / 2,
  2165. end: n - H + r,
  2166. size: r
  2167. }
  2168. }
  2169. return !1
  2170. }
  2171. ,
  2172. B.moveBy = function(e) {
  2173. Ce.speed = e,
  2174. !Ie.init && Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) && (Ce.lastTime = +new Date,
  2175. Ce.startPos = G.cur,
  2176. C("button"),
  2177. Ie.init = 1,
  2178. L("moveStart"),
  2179. ze(Te),
  2180. t())
  2181. }
  2182. ,
  2183. B.stop = function() {
  2184. "button" === Ie.source && (Ie.init = 0,
  2185. Ie.released = 1)
  2186. }
  2187. ,
  2188. B.prev = function() {
  2189. B.activate(null == ee.activeItem ? 0 : ee.activeItem - 1)
  2190. }
  2191. ,
  2192. B.next = function() {
  2193. B.activate(null == ee.activeItem ? 0 : ee.activeItem + 1)
  2194. }
  2195. ,
  2196. B.prevPage = function() {
  2197. B.activatePage(ee.activePage - 1)
  2198. }
  2199. ,
  2200. B.nextPage = function() {
  2201. B.activatePage(ee.activePage + 1)
  2202. }
  2203. ,
  2204. B.slideBy = function(e, t) {
  2205. e && (le ? B[se ? "toCenter" : "toStart"](Fe((se ? ee.centerItem : ee.firstItem) + F.scrollBy * e, 0, $.length)) : l(G.dest + e, t))
  2206. }
  2207. ,
  2208. B.slideTo = function(e, t) {
  2209. l(e, t)
  2210. }
  2211. ,
  2212. B.toStart = function(e, t) {
  2213. i("start", e, t)
  2214. }
  2215. ,
  2216. B.toEnd = function(e, t) {
  2217. i("end", e, t)
  2218. }
  2219. ,
  2220. B.toCenter = function(e, t) {
  2221. i("center", e, t)
  2222. }
  2223. ,
  2224. B.getIndex = h,
  2225. B.activate = function(e, t) {
  2226. var i = m(e);
  2227. F.smart && !1 !== i && (se ? B.toCenter(i, t) : i >= ee.lastItem ? B.toStart(i, t) : i <= ee.firstItem ? B.toEnd(i, t) : g())
  2228. }
  2229. ,
  2230. B.activatePage = function(e, t) {
  2231. De(e) && l(Q[Fe(e, 0, Q.length - 1)], t)
  2232. }
  2233. ,
  2234. B.resume = function(e) {
  2235. F.cycleBy && F.cycleInterval && ("items" !== F.cycleBy || $[0] && null != ee.activeItem) && !(e < B.isPaused) && (B.isPaused = 0,
  2236. we ? we = clearTimeout(we) : L("resume"),
  2237. we = setTimeout(function() {
  2238. switch (L("cycle"),
  2239. F.cycleBy) {
  2240. case "items":
  2241. B.activate(ee.activeItem >= $.length - 1 ? 0 : ee.activeItem + 1);
  2242. break;
  2243. case "pages":
  2244. B.activatePage(ee.activePage >= Q.length - 1 ? 0 : ee.activePage + 1)
  2245. }
  2246. }, F.cycleInterval))
  2247. }
  2248. ,
  2249. B.pause = function(e) {
  2250. e < B.isPaused || (B.isPaused = e || 100,
  2251. we && (we = clearTimeout(we),
  2252. L("pause")))
  2253. }
  2254. ,
  2255. B.toggle = function() {
  2256. B[we ? "pause" : "resume"]()
  2257. }
  2258. ,
  2259. B.set = function(e, t) {
  2260. xe.isPlainObject(e) ? xe.extend(F, e) : F.hasOwnProperty(e) && (F[e] = t)
  2261. }
  2262. ,
  2263. B.add = function(e, t) {
  2264. var i = xe(e);
  2265. le ? (null == t || !$[0] || t >= $.length ? i.appendTo(U) : $.length && i.insertBefore($[t].el),
  2266. null != ee.activeItem && t <= ee.activeItem && (ye.active = ee.activeItem += i.length)) : U.append(i),
  2267. a()
  2268. }
  2269. ,
  2270. B.remove = function(e) {
  2271. if (le) {
  2272. var t = u(e);
  2273. if (-1 < t) {
  2274. J.eq(t).remove();
  2275. var i = t === ee.activeItem;
  2276. null != ee.activeItem && t < ee.activeItem && (ye.active = --ee.activeItem),
  2277. a(),
  2278. i && (ye.active = null,
  2279. B.activate(ee.activeItem))
  2280. }
  2281. } else
  2282. xe(e).remove(),
  2283. a()
  2284. }
  2285. ,
  2286. B.moveAfter = function(e, t) {
  2287. r(e, t, 1)
  2288. }
  2289. ,
  2290. B.moveBefore = function(e, t) {
  2291. r(e, t)
  2292. }
  2293. ,
  2294. B.on = function(e, t) {
  2295. if ("object" === Re(e))
  2296. for (var i in e)
  2297. e.hasOwnProperty(i) && B.on(i, e[i]);
  2298. else if ("function" === Re(t))
  2299. for (var n = e.split(" "), r = 0, o = n.length; r < o; r++)
  2300. ve[n[r]] = ve[n[r]] || [],
  2301. -1 === f(n[r], t) && ve[n[r]].push(t);
  2302. else if ("array" === Re(t))
  2303. for (var a = 0, s = t.length; a < s; a++)
  2304. B.on(e, t[a])
  2305. }
  2306. ,
  2307. B.one = function(t, i) {
  2308. B.on(t, function e() {
  2309. i.apply(B, arguments),
  2310. B.off(t, e)
  2311. })
  2312. }
  2313. ,
  2314. B.off = function(e, t) {
  2315. if (t instanceof Array)
  2316. for (var i = 0, n = t.length; i < n; i++)
  2317. B.off(e, t[i]);
  2318. else
  2319. for (var r = e.split(" "), o = 0, a = r.length; o < a; o++)
  2320. if (ve[r[o]] = ve[r[o]] || [],
  2321. null == t)
  2322. ve[r[o]].length = 0;
  2323. else {
  2324. var s = f(r[o], t);
  2325. -1 !== s && ve[r[o]].splice(s, 1)
  2326. }
  2327. }
  2328. ,
  2329. B.destroy = function() {
  2330. return ce.add(j).add(W).add(Z).add(ue).add(de).add(pe).add(fe).add(ge).add(me).off("." + He),
  2331. We.off("keydown", M),
  2332. pe.add(fe).add(ge).add(me).removeClass(F.disabledClass),
  2333. J && null != ee.activeItem && J.eq(ee.activeItem).removeClass(F.activeClass),
  2334. Z.empty(),
  2335. V || (k.off("." + He),
  2336. te.restore(),
  2337. ie.restore(),
  2338. ne.restore(),
  2339. re.restore(),
  2340. xe.removeData(s, He)),
  2341. $.length = Q.length = 0,
  2342. ye = {},
  2343. B.initialized = 0,
  2344. B
  2345. }
  2346. ,
  2347. B.init = function() {
  2348. if (!B.initialized) {
  2349. B.on(n);
  2350. var e = ["overflow", "position"]
  2351. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2352. te.save.apply(te, e),
  2353. ne.save.apply(ne, e),
  2354. ie.save.apply(ie, t),
  2355. re.save.apply(re, t);
  2356. var i = j;
  2357. return V || (i = i.add(U),
  2358. k.css("overflow", "hidden"),
  2359. Ve || "static" !== k.css("position") || k.css("position", "relative")),
  2360. Ve ? ke && i.css(Ve, ke) : ("static" === W.css("position") && W.css("position", "relative"),
  2361. i.css({
  2362. position: "absolute"
  2363. })),
  2364. F.forward && ue.on(Ke, T),
  2365. F.backward && de.on(Ke, T),
  2366. F.prev && pe.on(Ze, T),
  2367. F.next && fe.on(Ze, T),
  2368. F.prevPage && ge.on(Ze, T),
  2369. F.nextPage && me.on(Ze, T),
  2370. ce.on(Xe, x),
  2371. W[0] && W.on(Ze, S),
  2372. le && F.activateOn && k.on(F.activateOn + "." + He, "*", R),
  2373. Z[0] && F.activatePageOn && Z.on(F.activatePageOn + "." + He, "*", P),
  2374. he.on(je, {
  2375. source: "slidee"
  2376. }, I),
  2377. j && j.on(je, {
  2378. source: "handle"
  2379. }, I),
  2380. We.on("keydown", M),
  2381. V || (k.on("mouseenter." + He + " mouseleave." + He, O),
  2382. k.on("scroll." + He, Le)),
  2383. B.initialized = 1,
  2384. a(!0),
  2385. F.cycleBy && !V && B[F.startPaused ? "pause" : "resume"](),
  2386. B
  2387. }
  2388. }
  2389. }
  2390. function Re(e) {
  2391. 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
  2392. }
  2393. function Pe(e, t) {
  2394. e.preventDefault(),
  2395. t && e.stopPropagation()
  2396. }
  2397. function Oe(e) {
  2398. Pe(e, 1),
  2399. xe(this).off(e.type, Oe)
  2400. }
  2401. function Le() {
  2402. this.scrollLeft = 0,
  2403. this.scrollTop = 0
  2404. }
  2405. function De(e) {
  2406. return !isNaN(parseFloat(e)) && isFinite(e)
  2407. }
  2408. function Ne(e, t) {
  2409. return 0 | it(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2410. }
  2411. function Fe(e, t, i) {
  2412. return e < t ? t : i < e ? i : e
  2413. }
  2414. function Be(t) {
  2415. var i = {
  2416. style: {},
  2417. save: function() {
  2418. if (t && t.nodeType) {
  2419. for (var e = 0; e < arguments.length; e++)
  2420. i.style[arguments[e]] = t.style[arguments[e]];
  2421. return i
  2422. }
  2423. },
  2424. restore: function() {
  2425. if (t && t.nodeType) {
  2426. for (var e in i.style)
  2427. i.style.hasOwnProperty(e) && (t.style[e] = i.style[e]);
  2428. return i
  2429. }
  2430. }
  2431. };
  2432. return i
  2433. }
  2434. 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;
  2435. function t(e) {
  2436. for (var t = 0, i = r.length; t < i; t++) {
  2437. var n = r[t] ? r[t] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2438. if (null != o.style[n])
  2439. return n
  2440. }
  2441. }
  2442. We.on(Xe, function(e) {
  2443. var t = e.originalEvent[He]
  2444. , i = +new Date;
  2445. (!t || t.options.scrollHijack < i - ot) && (ot = i)
  2446. }),
  2447. function(t) {
  2448. Ge = t.requestAnimationFrame || t.webkitRequestAnimationFrame || function(e) {
  2449. var t = (new Date).getTime()
  2450. , i = Math.max(0, 16 - (t - r))
  2451. , n = setTimeout(e, i);
  2452. return r = t,
  2453. n
  2454. }
  2455. ;
  2456. var r = (new Date).getTime()
  2457. , i = t.cancelAnimationFrame || t.webkitCancelAnimationFrame || t.clearTimeout;
  2458. ze = function(e) {
  2459. i.call(t, e)
  2460. }
  2461. }(window),
  2462. r = ["", "webkit", "moz", "ms", "o"],
  2463. o = document.createElement("div"),
  2464. Ve = t("transform"),
  2465. ke = t("perspective") ? "translateZ(0) " : "",
  2466. e.Sly = Me,
  2467. xe.fn.sly = function(n, r) {
  2468. var o, a;
  2469. return xe.isPlainObject(n) || ("string" !== Re(n) && !1 !== n || (o = !1 === n ? "destroy" : n,
  2470. a = Array.prototype.slice.call(arguments, 1)),
  2471. n = {}),
  2472. this.each(function(e, t) {
  2473. var i = xe.data(t, He);
  2474. i || o ? i && o && i[o] && i[o].apply(i, a) : i = xe.data(t, He, new Me(t,n,r).init())
  2475. })
  2476. }
  2477. ,
  2478. Me.defaults = {
  2479. slidee: null,
  2480. horizontal: !1,
  2481. itemNav: null,
  2482. itemSelector: null,
  2483. smart: !1,
  2484. activateOn: null,
  2485. activateMiddle: !1,
  2486. scrollSource: null,
  2487. scrollBy: 0,
  2488. scrollHijack: 300,
  2489. scrollTrap: !1,
  2490. dragSource: null,
  2491. mouseDragging: !1,
  2492. touchDragging: !1,
  2493. releaseSwing: !1,
  2494. swingSpeed: .2,
  2495. elasticBounds: !1,
  2496. interactive: null,
  2497. scrollBar: null,
  2498. dragHandle: !1,
  2499. dynamicHandle: !1,
  2500. minHandleSize: 50,
  2501. clickBar: !1,
  2502. syncSpeed: .5,
  2503. pagesBar: null,
  2504. activatePageOn: null,
  2505. pageBuilder: function(e) {
  2506. return "<li>" + (e + 1) + "</li>"
  2507. },
  2508. forward: null,
  2509. backward: null,
  2510. prev: null,
  2511. next: null,
  2512. prevPage: null,
  2513. nextPage: null,
  2514. cycleBy: null,
  2515. cycleInterval: 5e3,
  2516. pauseOnHover: !1,
  2517. startPaused: !1,
  2518. moveBy: 300,
  2519. speed: 0,
  2520. easing: "swing",
  2521. startAt: null,
  2522. keyboardNavBy: null,
  2523. draggedClass: "dragged",
  2524. activeClass: "active",
  2525. disabledClass: "disabled"
  2526. }
  2527. }(jQuery, window),
  2528. function o(a, s, l) {
  2529. function c(i, e) {
  2530. if (!s[i]) {
  2531. if (!a[i]) {
  2532. var t = "function" == typeof require && require;
  2533. if (!e && t)
  2534. return t(i, !0);
  2535. if (h)
  2536. return h(i, !0);
  2537. var n = new Error("Cannot find module '" + i + "'");
  2538. throw n.code = "MODULE_NOT_FOUND",
  2539. n
  2540. }
  2541. var r = s[i] = {
  2542. exports: {}
  2543. };
  2544. a[i][0].call(r.exports, function(e) {
  2545. var t = a[i][1][e];
  2546. return c(t || e)
  2547. }, r, r.exports, o, a, s, l)
  2548. }
  2549. return s[i].exports
  2550. }
  2551. for (var h = "function" == typeof require && require, e = 0; e < l.length; e++)
  2552. c(l[e]);
  2553. return c
  2554. }({
  2555. 1: [function(p, f, e) {
  2556. (function(e) {
  2557. "use strict";
  2558. function t(e) {
  2559. this.player = null,
  2560. this.director = null,
  2561. this.modelManager = null,
  2562. this.container = null,
  2563. this.tagManager = null,
  2564. this.fadeInSpeed = e,
  2565. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2566. }
  2567. var r = p("three")
  2568. , i = p("./util/logger")
  2569. , n = (p("./util/common"),
  2570. p("./enum/PlayerEvents"))
  2571. , o = p("./enum/DirectorEvents")
  2572. , a = p("./settings")
  2573. , s = p("./enum/Viewmode")
  2574. , l = (p("./enum/WarpStyle"),
  2575. p("./enum/BlackoutStyle"),
  2576. p("./enum/ModelManagerEvents"))
  2577. , c = p("./enum/tagEvents")
  2578. , h = p("./util/transitions")
  2579. , u = p("./util/lerp")
  2580. , d = new i(e);
  2581. t.prototype.init = function(e, t, i, n, r) {
  2582. (window.app = this).player = t,
  2583. this.director = e,
  2584. this.modelManager = i,
  2585. this.tagManager = n,
  2586. this.container = r,
  2587. this.updateModel(),
  2588. this.bindEvents()
  2589. }
  2590. ,
  2591. t.prototype.bindEvents = function() {
  2592. this.modelManager.on(l.ActiveModelChanged, this.updateModel.bind(this)),
  2593. this.player.on(n.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2594. this.player.on(n.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2595. this.player.on(n.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2596. this.player.on(n.StartInside, this.handleStartInside.bind(this)),
  2597. this.player.on(n.StartOutside, this.handleStartOutside.bind(this)),
  2598. this.player.on(n.WarpStarted, this.handleWarpStarted.bind(this)),
  2599. this.director.on(o.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2600. this.tagManager.on(c.TagActivated, this.ontagActivated.bind(this)),
  2601. this.tagManager.on(c.TagNavigation, this.onNavigationTotag.bind(this))
  2602. }
  2603. ,
  2604. t.prototype.updateModel = function() {
  2605. this.model = this.modelManager.getActiveModel()
  2606. }
  2607. ,
  2608. t.prototype.handleWarpStarted = function() {
  2609. this.hidePlayerReticule()
  2610. }
  2611. ,
  2612. t.prototype.ontagActivated = function() {
  2613. this.hidePlayerReticule()
  2614. }
  2615. ,
  2616. t.prototype.onNavigationTotag = function() {
  2617. this.hidePlayerReticule()
  2618. }
  2619. ,
  2620. t.prototype.handlePlayerModeChanging = function(e, t, i) {
  2621. var n = this.modelManager.getActiveModel()
  2622. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : a[t].markerOpacity;
  2623. n.fadePanoMarkers(r),
  2624. n.setMode(t)
  2625. }
  2626. ,
  2627. t.prototype.handlePlayerModeChanged = function(e, t) {
  2628. var i = this.modelManager.getActiveModel()
  2629. , n = t === s.PANORAMA ? r.DoubleSide : r.FrontSide;
  2630. i.setSide(n),
  2631. i.setMode(t)
  2632. }
  2633. ,
  2634. t.prototype.handleClosestPanoChanging = function(e, t, i) {
  2635. i !== s.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2636. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2637. }
  2638. ,
  2639. t.prototype.handleActionInterruption = function() {}
  2640. ,
  2641. t.prototype.handleStartInside = function(e) {
  2642. var t = a[this.player.mode]
  2643. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2644. this.fadeIn(this.fadeInSpeed),
  2645. this.model.alpha = 0,
  2646. this.model.skybox.material.uniforms.opacity.value = 1,
  2647. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2648. var n = this.player.reticule;
  2649. h.start(u.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2650. }
  2651. ,
  2652. t.prototype.handleStartOutside = function(e) {
  2653. this.fadeIn(e)
  2654. }
  2655. ,
  2656. t.prototype.fadeIn = function(e) {
  2657. null != e || (e = 2e3,
  2658. d.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2659. $(this.container).fadeIn(e)
  2660. }
  2661. ,
  2662. t.prototype.hidePlayerReticule = function() {
  2663. this.player.reticule.hide()
  2664. }
  2665. ,
  2666. f.exports = t
  2667. }
  2668. ).call(this, "/js/DisplayController.js")
  2669. }
  2670. , {
  2671. "./enum/BlackoutStyle": 18,
  2672. "./enum/DirectorEvents": 23,
  2673. "./enum/tagEvents": 32,
  2674. "./enum/ModelManagerEvents": 33,
  2675. "./enum/PlayerEvents": 40,
  2676. "./enum/Viewmode": 51,
  2677. "./enum/WarpStyle": 52,
  2678. "./settings": 166,
  2679. "./util/common": 185,
  2680. "./util/lerp": 188,
  2681. "./util/logger": 189,
  2682. "./util/transitions": 195,
  2683. three: 217
  2684. }],
  2685. 2: [function(e, t, i) {
  2686. "use strict";
  2687. function n() {
  2688. this.baseStartTime = performance.timing.navigationStart,
  2689. this.loadingStartTime = null,
  2690. this.waitingStartTime = null,
  2691. this.appReadyTime = null
  2692. }
  2693. n.prototype.setBaseStartTime = function(e) {
  2694. this.baseStartTime = e || Date.now()
  2695. }
  2696. ,
  2697. n.prototype.setWaitingStartTime = function(e) {
  2698. this.waitingStartTime = e || Date.now()
  2699. }
  2700. ,
  2701. n.prototype.setLoadingStartTime = function(e) {
  2702. this.loadingStartTime = e || Date.now()
  2703. }
  2704. ,
  2705. n.prototype.setAppReadyTime = function(e) {
  2706. this.appReadyTime = e || Date.now()
  2707. }
  2708. ,
  2709. n.prototype.calcFullLoadingTime = function() {
  2710. var e = this.appReadyTime - this.baseStartTime;
  2711. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2712. e
  2713. }
  2714. ,
  2715. t.exports = n
  2716. }
  2717. , {}],
  2718. 3: [function(i, n, e) {
  2719. (function(e) {
  2720. "use strict";
  2721. function a() {
  2722. return 100 * Math.random()
  2723. }
  2724. var t = i("./util/logger")
  2725. , s = i("./util/browser")
  2726. , l = new t(e)
  2727. , c = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2728. initialized: !1,
  2729. init: function(e, t) {
  2730. if (t = t || {},
  2731. !this.initialized) {
  2732. for (var i in this.initialized = !0,
  2733. s.valueFromHash("tilegen") && (t.tilegen = 1 === s.valueFromHash("tilegen", 0)),
  2734. s.valueFromHash("imgopt") && (t.imgopt = 1 === s.valueFromHash("imgopt", 0)),
  2735. e) {
  2736. var n = i.match("^sc_tilegen_([0-9]+)$");
  2737. n && (c.tilegen = a() < parseInt(n[1]));
  2738. var r = i.match("^sc_imgopt_([0-9]+)$");
  2739. r && (c.imgopt = a() < parseInt(r[1]))
  2740. }
  2741. for (var o in t)
  2742. c[o] = t[o],
  2743. l.debug("A/B override:", o, c[o])
  2744. }
  2745. },
  2746. changeIfTileGenerating: function(e) {
  2747. return c.tilegen && (e += -1 === e.indexOf("?") ? "?" : "&",
  2748. e += ""),
  2749. e
  2750. },
  2751. changeIfImageOptimzing: function(e) {
  2752. if(e.includes("blob:http"))return e;//add
  2753. return c.imgopt && -1 === e.indexOf("imgopt=1") && (e += -1 === e.indexOf("?") ? "?" : "&",
  2754. e += ""),
  2755. e
  2756. },
  2757. tilegen: !1,
  2758. imgopt: !1
  2759. };
  2760. n.exports = c
  2761. }
  2762. ).call(this, "/js/ab.js")
  2763. }
  2764. , {
  2765. "./util/browser": 182,
  2766. "./util/logger": 189
  2767. }],
  2768. 4: [function(u, d, e) {
  2769. (function(e) {
  2770. "use strict";
  2771. function r(n, e, t, i) {
  2772. function r(e) {
  2773. a[e.sid] = !0;
  2774. var t = e.billboard.media && e.billboard.media.type
  2775. , i = {
  2776. tag_id: e.sid,
  2777. tags_visited: Object.keys(a).length,
  2778. tag_count: Object.keys(n.tags).length,
  2779. tag_view_count: ++d,
  2780. has_media: !!t
  2781. };
  2782. t && (i.media_type = t),
  2783. g("tag_opened", i)
  2784. }
  2785. var o, a = {}, s = Date.now() - P, l = null;
  2786. i && (l = Date.now() - window.navigationStart);
  2787. try {
  2788. o = /* n.data.player_options.highlight_reel && */ 0 < n.heroLocations.length
  2789. } catch (n) {
  2790. o = !1
  2791. }
  2792. var c, h = n.supportsVR;
  2793. h || (c = "VR disabled at the model/account level",
  2794. 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"))),
  2795. g("model_loaded", {
  2796. duration: s,
  2797. duration_from_navigation_start: l,
  2798. has_hlr: o,
  2799. has_vr: h,
  2800. vr_reason: c
  2801. });
  2802. var u = 0;
  2803. n.panos.forEach(function(e) {
  2804. e.on("enter", function() {
  2805. f("pano_viewed", {
  2806. pano_id: e.id,
  2807. pano_view_count: ++u,
  2808. alignment_type: e.alignmentType,
  2809. interaction_source: R,
  2810. navigation_source: v
  2811. })
  2812. })
  2813. });
  2814. var d = 0;
  2815. for (var p in n.tags)
  2816. n.tags[p].billboard.on(M.OPENED, r.bind(this, n.tags[p]));
  2817. e.on("tour_auto", function(e) {
  2818. v = "tour_" + e
  2819. }),
  2820. e.on("tour_manual", function(e) {
  2821. R = "gui-" + e,
  2822. v = "tour_manual"
  2823. }),
  2824. t.on(C.InteractionKey, function() {
  2825. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionKey)
  2826. }),
  2827. t.on(C.InteractionDirect, function() {
  2828. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionDirect)
  2829. }),
  2830. function(t) {
  2831. I.on(T.OPENED, function() {
  2832. f("showcase_share_intent", {
  2833. pano_id: t.currentPano && t.currentPano.id
  2834. })
  2835. }),
  2836. I.on(T.LINK_CLICKED, function(e) {
  2837. f("showcase_share_action", {
  2838. channel: e.channel,
  2839. pano_id: t.currentPano && t.currentPano.id
  2840. })
  2841. }),
  2842. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2843. f("showcase_share_origin_link_clicked")
  2844. })
  2845. }(e),
  2846. function() {
  2847. _.on(S.OPENED, f.bind(this, "showcase_gui", {
  2848. gui_action: "click_vr_button"
  2849. })),
  2850. _.on(S.LAUNCH, function(e) {
  2851. f("showcase_gui", {
  2852. gui_action: "launch_vr",
  2853. vr_platform: e.vr_platform,
  2854. vr_app: e.vr_app
  2855. })
  2856. }),
  2857. _.on(S.PREV, f.bind(this, "showcase_gui", {
  2858. gui_action: "vr_modal_prev"
  2859. })),
  2860. _.on(S.NEXT, function(e) {
  2861. f("showcase_gui", {
  2862. gui_action: e.nextAction
  2863. })
  2864. }),
  2865. _.on(S.CLOSED, f.bind(this, "showcase_gui", {
  2866. gui_action: "vr_modal_close"
  2867. })),
  2868. _.on(S.falseICECHOSEN, function(e) {
  2869. f("showcase_gui", {
  2870. gui_action: e.name + " "
  2871. })
  2872. }),
  2873. _.on(S.STORE, function(e) {
  2874. f("showcase_gui", {
  2875. gui_action: "launch_store",
  2876. store: e
  2877. })
  2878. })
  2879. }()
  2880. }
  2881. function f(e, t) {
  2882. if (t = t || {},
  2883. i)
  2884. try {
  2885. window.analytics.track(e, s.extendObject(t, c), {
  2886. context: {
  2887. app: {
  2888. name: "showcase",
  2889. version: "2.25.6-0-gd87e5b1"
  2890. },
  2891. screen: {
  2892. width: window.screen.width,
  2893. height: window.screen.height,
  2894. density: window.devicePixelRatio
  2895. }
  2896. }
  2897. })
  2898. } catch (t) {
  2899. console.warn("Failed to send data to segment for " + e)
  2900. }
  2901. }
  2902. function g(e, t) {
  2903. f(e, t = t || {})
  2904. }
  2905. function m(e, t) {
  2906. R = e === C.InteractionGui ? "gui-" + t : e,
  2907. v = "self_guided"
  2908. }
  2909. var v, o, a = (u("three"),
  2910. u("./util/ajax"),
  2911. u("./ab")), y = u("./util/browser"), s = u("./util/common"), t = u("./settings"), A = (u("./localization/localize"),
  2912. 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"),
  2913. "direct"), i = null, n = !1, P = null, c = null, h = s.uuid4();
  2914. d.exports = {
  2915. report: function(e, t, i, n) {
  2916. !function(e, t) {
  2917. if (o)
  2918. try {
  2919. o.addEvent(e, s.extendObject({
  2920. host: window.location.host,
  2921. keen: {
  2922. addons: [{
  2923. name: "keen:ua_parser",
  2924. input: {
  2925. ua_string: "user_agent"
  2926. },
  2927. output: "parsed_user_agent"
  2928. }]
  2929. },
  2930. user_agent: "${keen.user_agent}",
  2931. referrer: {
  2932. url: s.normalizeUrl(document.referrer),
  2933. domain: s.domainFromUrl(document.referrer),
  2934. url_original: document.referrer
  2935. },
  2936. embedded: y.inIframe(),
  2937. is_mobile: y.isMobile(),
  2938. version: "2.25.6-0-gd87e5b1"
  2939. }, t))
  2940. } catch (e) {
  2941. l.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2942. }
  2943. }("Session starts", {
  2944. model: e,
  2945. status: t,
  2946. loadtime: Date.now() - (P || Date.now()),
  2947. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2948. autoplay: i,
  2949. quickstart: n,
  2950. ab_tilegen: a.tilegen,
  2951. ab_imgopt: a.imgopt
  2952. })
  2953. },
  2954. impression: function(e) {
  2955. g("impression", {
  2956. visible: void 0 === (e = e || {}).isVisible || e.isVisible,
  2957. url_params: (void 0 !== e.immediate && e.immediate,
  2958. window.location.search.substr(1).split("&"))
  2959. })
  2960. },
  2961. initKeen: function(e) {
  2962. return e.token && e.appId ? void (o = new Keen({
  2963. projectId: e.appId,
  2964. writeKey: e.token,
  2965. readKey: "",
  2966. requestType: "xhr"
  2967. })) : void l.warn("no keen token/appId")
  2968. },
  2969. initSegment: function(e) {
  2970. return e.token ? (i = e.token,
  2971. window.analytics.load(e.token),
  2972. c = {
  2973. model_id: e.model,
  2974. start_source: e.startSource,
  2975. autoplay: e.autoplay,
  2976. quickstart: e.quickstart,
  2977. language_tag: t.languageTag,
  2978. is_mobile: y.isMobile(),
  2979. iframe: y.inIframe(),
  2980. aspect_ratio: y.aspectRatio(),
  2981. session_id: h,
  2982. window: {
  2983. width: $("#player").width(),
  2984. height: $("#player").height()
  2985. },
  2986. platform: {
  2987. browser: {
  2988. name: $.ua.browser.name,
  2989. major: $.ua.browser.major,
  2990. version: $.ua.browser.version
  2991. },
  2992. os: {
  2993. name: $.ua.os.name,
  2994. version: $.ua.os.version
  2995. },
  2996. device: {
  2997. vendor: $.ua.device.vendor,
  2998. model: $.ua.device.model,
  2999. type: $.ua.device.type
  3000. }
  3001. }
  3002. },
  3003. n = Math.random() < t.analytics.sessionTrackingRate,
  3004. l.debug("tracking sample rate = " + t.analytics.sessionTrackingRate),
  3005. void l.debug("tracking this session = " + n)) : void l.warn("no segment token")
  3006. },
  3007. sessionStart: function(e) {
  3008. l.debug("analytics user_session_start"),
  3009. f("session_started"),
  3010. P = Date.now(),
  3011. window.addEventListener("unload", function() {
  3012. !function(e, t) {
  3013. if (t = t || {},
  3014. navigator.sendBeacon && i)
  3015. try {
  3016. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  3017. event: e,
  3018. anonymousId: window.analytics.user().anonymousId(),
  3019. properties: s.extendObject(t, c),
  3020. writeKey: i,
  3021. sentAt: Date.now(),
  3022. type: "track",
  3023. context: {
  3024. userAgent: y.userAgent(),
  3025. library: {
  3026. name: "showcase-beacon",
  3027. version: "2.25.6-0-gd87e5b1"
  3028. },
  3029. app: {
  3030. name: "showcase",
  3031. version: "2.25.6-0-gd87e5b1"
  3032. }
  3033. }
  3034. }))
  3035. } catch (e) {
  3036. console.warn("Failed to send async segment request")
  3037. }
  3038. }("session_ended", {
  3039. duration: Date.now() - P
  3040. })
  3041. })
  3042. },
  3043. modelLoaded: function(e, t, i, n) {
  3044. r(e, t, i, n)
  3045. },
  3046. loadComplete: function(e) {
  3047. f("load_times", {
  3048. time_to_app_start: e
  3049. })
  3050. },
  3051. track: function(e, t) {
  3052. n && (l.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  3053. f(e, t))
  3054. },
  3055. trackAlways: function(e, t) {
  3056. l.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  3057. f(e, t)
  3058. },
  3059. getSessionId: function() {
  3060. return h
  3061. },
  3062. updateInteraction: m
  3063. }
  3064. }
  3065. ).call(this, "/js/analytics.js")
  3066. }
  3067. , {
  3068. "./ab": 3,
  3069. "./enum/ControlEvents": 21,
  3070. "./enum/PlayerEvents": 40,
  3071. "./enum/VROption": 47,
  3072. "./enum/VRPlatforms": 49,
  3073. "./enum/Viewmode": 51,
  3074. "./gui/sharing/ShareEvents": 76,
  3075. "./gui/sharing/modal": 77,
  3076. "./gui/title/TitleEvents": 80,
  3077. "./gui/title/titleBar": 82,
  3078. "./gui/vr/vrEvent": 85,
  3079. "./gui/vr/vrModal": 87,
  3080. "./localization/localize": 108,
  3081. "./tag/Billboard/BillboardEvent": 120,
  3082. "./settings": 166,
  3083. "./util/ajax": 181,
  3084. "./util/browser": 182,
  3085. "./util/common": 185,
  3086. "./util/logger": 189,
  3087. three: 217
  3088. }],
  3089. 5: [function(e, t, i) {
  3090. "use strict";
  3091. function n() {
  3092. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  3093. this.controls = null
  3094. }
  3095. var r = e("three")
  3096. , o = e("../constants")
  3097. , a = e("../util/cameraLight");
  3098. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  3099. this.aspect = e,
  3100. this.updateProjectionMatrix()
  3101. }
  3102. ,
  3103. t.exports = n
  3104. }
  3105. , {
  3106. "../constants": 8,
  3107. "../util/cameraLight": 184,
  3108. three: 217
  3109. }],
  3110. 6: [function(e, t, i) {
  3111. "use strict";
  3112. function n() {
  3113. var e = $("#player").width() / $("#player").height();
  3114. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  3115. this.controls = null,
  3116. this.updateAspect(e)
  3117. }
  3118. var r = e("three")
  3119. , o = e("../constants");
  3120. (n.prototype = Object.create(r.OrthographicCamera.prototype)).updateAspect = function(e) {
  3121. this.aspect = e,
  3122. this.top = o.orthoBase / e,
  3123. this.bottom = -o.orthoBase / e,
  3124. this.updateProjectionMatrix()
  3125. }
  3126. ,
  3127. t.exports = n
  3128. }
  3129. , {
  3130. "../constants": 8,
  3131. three: 217
  3132. }],
  3133. 7: [function(e, t, i) {
  3134. "use strict";
  3135. function n() {
  3136. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  3137. this.controls = null
  3138. }
  3139. var r = e("three")
  3140. , o = e("../settings")
  3141. , a = e("../util/cameraLight");
  3142. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  3143. this.aspect = e,
  3144. this.updateProjectionMatrix()
  3145. }
  3146. ,
  3147. t.exports = n
  3148. }
  3149. , {
  3150. "../settings": 166,
  3151. "../util/cameraLight": 184,
  3152. three: 217
  3153. }],
  3154. 8: [function(e, t, i) {
  3155. "use strict";
  3156. t.exports = {
  3157. signedUrlDefaultExpireTime: 24e4,
  3158. signedUrlCheckInterval: 1e4,
  3159. signedUrlRefreshBuffer: 15e3,
  3160. dollhouseFOV: 70,
  3161. dollhouseNear: .1,//1,
  3162. dollhouseFar: 5e3,
  3163. insideFOV: 70,
  3164. insideFOVMax: 120,
  3165. insideNear: .1,
  3166. insideFar: 5e3,
  3167. insideLookSpeed: .12,
  3168. insideLookLimitUp: 40,
  3169. insideLookLimitDown: -40,
  3170. orthoNear: 1,
  3171. orthoFar: 5e3,
  3172. orthoBase: 10,
  3173. narrowLandscapeHeight: 290,
  3174. reallyNarrowLandscapeHeight: 250,
  3175. visionTilingStartDate: new Date("8/26/2016"),
  3176. visionTilingStartVersion: "1.1.407.13667",
  3177. windowHeightHighQualityThreshold: 900,
  3178. tourStepDelayDefault: 3500,
  3179. tourStepDelaySlideShow: 5e3,
  3180. workshopApsect: 9 / 16,
  3181. highQualityMaxZoom: 2,
  3182. ultraHighQualityMaxZoom: 3
  3183. }
  3184. }
  3185. , {}],
  3186. 9: [function(e, t, i) {
  3187. "use strict";
  3188. function n() {
  3189. this.activeControl = null,
  3190. this.controls = {},
  3191. this.cameras = {}
  3192. }
  3193. var a = e("./PanoramaControls")
  3194. , s = e("./DollhouseControls")
  3195. , l = e("./FloorplanControls")
  3196. , c = e("../cameras/PanoramaCamera")
  3197. , h = e("../cameras/DollhouseCamera")
  3198. , u = e("../cameras/FloorplanCamera")
  3199. , r = e("events").EventEmitter
  3200. , d = e("../enum/ControlEvents")
  3201. , o = e("../enum/ModelManagerEvents")
  3202. , p = e("../enum/Viewmode")
  3203. , f = e("../settings");
  3204. (n.prototype = Object.create(r.prototype)).init = function(e, t) {
  3205. this.setUpControls(),
  3206. this.bindEvents(e, t)
  3207. }
  3208. ,
  3209. n.prototype.activateControls = function(e) {
  3210. this.activeControl && (this.activeControl.reset(),
  3211. this.activeControl.enabled = !1),
  3212. this.controls[e] && (this.controls[e].enabled = !0),
  3213. this.activeControl = this.controls[e]
  3214. }
  3215. ,
  3216. n.prototype.setUpControls = function() {
  3217. var i = {}
  3218. , n = {}
  3219. , e = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3220. , r = [c, h, u]
  3221. , o = [a, s, l];
  3222. e.forEach(function(e, t) {
  3223. i[e] = new r[t],
  3224. n[e] = new o[t](i[e]),
  3225. n[e].on(d.Move, this.emit.bind(this, d.Move)),
  3226. n[e].on(d.InputStart, this.emit.bind(this, d.InputStart)),
  3227. n[e].on(d.InteractionDirect, this.emit.bind(this, d.InteractionDirect)),
  3228. n[e].on(d.InteractionKey, this.emit.bind(this, d.InteractionKey)),
  3229. n[e].on(d.Pinch, this.emit.bind(this, d.Pinch)),
  3230. n[e].on(d.Scroll, this.emit.bind(this, d.Scroll))
  3231. }
  3232. .bind(this)),
  3233. this.controls = n,
  3234. this.cameras = i
  3235. }
  3236. ,
  3237. n.prototype.bindEvents = function(e, t) {
  3238. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3239. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3240. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3241. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3242. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this), {
  3243. passive: !1
  3244. }),
  3245. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3246. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3247. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3248. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3249. e.addEventListener("contextmenu", function(e) {
  3250. e.preventDefault()
  3251. }),
  3252. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3253. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3254. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3255. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3256. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3257. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3258. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3259. t.on(o.ActiveModelChanged, function(e) {
  3260. this.setModelForControls(e.model)
  3261. }
  3262. .bind(this))
  3263. }
  3264. ,
  3265. n.prototype.setModelForControls = function(e) {
  3266. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3267. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3268. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3269. this.controls[e].setBounds(t)
  3270. }
  3271. .bind(this))
  3272. }
  3273. ,
  3274. n.prototype.onMouseDown = function(e) {
  3275. e.preventDefault(),
  3276. this.activeControl && this.activeControl.onMouseDown(e)
  3277. }
  3278. ,
  3279. n.prototype.onMouseMove = function(e) {
  3280. e.preventDefault(),
  3281. this.activeControl && this.activeControl.onMouseMove(e)
  3282. }
  3283. ,
  3284. n.prototype.onMouseUp = function(e) {
  3285. e.preventDefault(),
  3286. this.activeControl && this.activeControl.onMouseUp(e)
  3287. }
  3288. ,
  3289. n.prototype.onMouseOver = function(e) {
  3290. e.preventDefault(),
  3291. this.activeControl && this.activeControl.onMouseOver(e)
  3292. }
  3293. ,
  3294. n.prototype.onMouseWheel = function(e) {
  3295. e.preventDefault(),
  3296. this.activeControl && this.activeControl.onMouseWheel(e)
  3297. }
  3298. ,
  3299. n.prototype.onTouchStart = function(e) {
  3300. e.preventDefault(),
  3301. this.activeControl && this.activeControl.onTouchStart(e),
  3302. $("#hotListWrap")[0].classList.remove("hotListActive"),
  3303. $("#hotListContent ul .active").removeClass("active"),
  3304. $("#hotList")[0].classList.remove("active")
  3305. }
  3306. ,
  3307. n.prototype.onTouchMove = function(e) {
  3308. e.preventDefault(),
  3309. this.activeControl && this.activeControl.onTouchMove(e)
  3310. }
  3311. ,
  3312. n.prototype.onTouchEnd = function(e) {
  3313. e.preventDefault(),
  3314. this.activeControl && this.activeControl.onTouchEnd(e)
  3315. }
  3316. ,
  3317. n.prototype.onPointerDown = function(e) {
  3318. if (e.preventDefault(),
  3319. this.activeControl)
  3320. switch (e.pointerType) {
  3321. case "mouse":
  3322. this.activeControl.onMouseDown(e);
  3323. break;
  3324. default:
  3325. this.activeControl.onPointerDown(e)
  3326. }
  3327. }
  3328. ,
  3329. n.prototype.onPointerMove = function(e) {
  3330. if (e.preventDefault(),
  3331. this.activeControl)
  3332. switch (e.pointerType) {
  3333. case "mouse":
  3334. this.activeControl.onMouseMove(e);
  3335. break;
  3336. default:
  3337. this.activeControl.onPointerMove(e)
  3338. }
  3339. }
  3340. ,
  3341. n.prototype.onPointerUp = function(e) {
  3342. if (e.preventDefault(),
  3343. this.activeControl)
  3344. switch (e.pointerType) {
  3345. case "mouse":
  3346. this.activeControl.onMouseUp(e);
  3347. break;
  3348. default:
  3349. this.activeControl.onPointerUp(e)
  3350. }
  3351. }
  3352. ,
  3353. n.prototype.onPointerCancel = function(e) {
  3354. e.preventDefault(),
  3355. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3356. }
  3357. ,
  3358. n.prototype.onKeyDown = function(e) {
  3359. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3360. this.activeControl && this.activeControl.onKeyDown(e))
  3361. }
  3362. ,
  3363. n.prototype.onKeyUp = function(e) {
  3364. e.preventDefault(),
  3365. this.activeControl && this.activeControl.onKeyUp(e)
  3366. }
  3367. ,
  3368. t.exports = n
  3369. }
  3370. , {
  3371. "../cameras/DollhouseCamera": 5,
  3372. "../cameras/FloorplanCamera": 6,
  3373. "../cameras/PanoramaCamera": 7,
  3374. "../enum/ControlEvents": 21,
  3375. "../enum/ModelManagerEvents": 33,
  3376. "../enum/Viewmode": 51,
  3377. "../settings": 166,
  3378. "./DollhouseControls": 10,
  3379. "./FloorplanControls": 11,
  3380. "./PanoramaControls": 13,
  3381. events: 202
  3382. }],
  3383. 10: [function(e, t, i) {
  3384. "use strict";
  3385. function n(e) {
  3386. a.call(this, e),
  3387. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3388. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3389. this.minDistance = o.dollhouseDefault.minDistance,
  3390. this.maxDistance = o.dollhouseDefault.maxDistance,
  3391. this.adjustedMinDistance = this.minDistance,
  3392. this.adjustedMaxDistance = this.maxDistance
  3393. }
  3394. var r = e("three")
  3395. , o = e("../settings")
  3396. , a = e("./OutsideControls");
  3397. (n.prototype = Object.create(a.prototype)).pan = function(e, t) {
  3398. this.camera.updateMatrix();
  3399. var i = this.camera.position.clone().sub(this.target).length();
  3400. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3401. this.panLeft(2 * e * i / $("#player").height()),
  3402. this.panUp(-2 * t * i / $("#player").height())
  3403. }
  3404. ,
  3405. n.prototype.updateZoom = function() {
  3406. return this.offset.length() * this.scale
  3407. }
  3408. ,
  3409. n.prototype.setZoomBounds = function(e) {
  3410. var t = e.min.distanceTo(e.max);
  3411. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3412. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3413. this.minDistance = this.adjustedMinDistance,
  3414. this.maxDistance = this.adjustedMaxDistance
  3415. }
  3416. ,
  3417. n.prototype.resetRanges = function(e, t) {
  3418. e ? (this.minDistance = Math.min(e, this.minDistance),
  3419. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3420. this.maxDistance = this.adjustedMaxDistance),
  3421. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3422. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3423. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3424. }
  3425. ,
  3426. n.prototype.toJSON = function() {
  3427. return a.prototype.toJSON.call(this)
  3428. }
  3429. ,
  3430. t.exports = n
  3431. }
  3432. , {
  3433. "../settings": 166,
  3434. "./OutsideControls": 12,
  3435. three: 217
  3436. }],
  3437. 11: [function(e, t, i) {
  3438. "use strict";
  3439. function n(e) {
  3440. c.call(this, e),
  3441. this.minDistance = 15,
  3442. this.maxDistance = 50,
  3443. this.noRotateUpDown = !0,
  3444. this.minPolarAngle = 0,
  3445. this.maxPolarAngle = 0,
  3446. this.mouseActions[u.LEFT] = h.PAN,
  3447. this.mouseActions[u.MIDDLE] = h.DOLLY,
  3448. this.mouseActions[u.RIGHT] = h.ROTATE,
  3449. this.touchActions[1] = h.PAN,
  3450. this.touchActions[2] = h.ROTATE_DOLLY,
  3451. this.absoluteScale = 1,
  3452. this.currentScale = 1
  3453. }
  3454. 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");
  3455. (n.prototype = Object.create(c.prototype)).zoomToContain = function(e) {
  3456. this.absoluteScale = this.getDefaultAbsoluteScale(e);
  3457. this.currentScale = this.absoluteScale
  3458. }
  3459. ,
  3460. n.prototype.getDefaultAbsoluteScale = function(modelSize) {
  3461. var t = Math.max(modelSize.x, modelSize.z)
  3462. , i = Math.min(modelSize.x, modelSize.z)
  3463. , n = Math.max(t, i * this.camera.aspect)
  3464. , r = Math.max(i, t * this.camera.aspect);
  3465. var absoluteScale = (p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase * 1.2
  3466. return absoluteScale
  3467. },
  3468. n.prototype.rotateToView = function(e, t) {
  3469. var i = 0;
  3470. p.aspectRatio() < 1 == e.x < e.z ? 0 < t.z && (i = Math.PI) : i = 0 < t.x ? Math.PI / 2 : -Math.PI / 2,
  3471. this.rotateLeft(i),
  3472. this.update(0)
  3473. }
  3474. ,
  3475. n.prototype.pan = function(e, t) {
  3476. this.camera.updateMatrix(),
  3477. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3478. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3479. }
  3480. ,
  3481. n.prototype.updateZoom = function() {
  3482. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3483. this.absoluteScale = Math.max(l.zoomNearLimit, Math.min(this.absoluteScale, l.zoomFarLimit)),
  3484. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3485. this.camera.left = -l.orthoBase * this.currentScale,
  3486. this.camera.right = l.orthoBase * this.currentScale,
  3487. this.camera.top = l.orthoBase * this.currentScale / this.camera.aspect,
  3488. this.camera.bottom = -l.orthoBase * this.currentScale / this.camera.aspect,
  3489. this.camera.updateProjectionMatrix(),
  3490. this.offset.length()
  3491. }
  3492. ,
  3493. n.prototype.toJSON = (r = new s.Quaternion,
  3494. o = (new s.Quaternion).setFromAxisAngle(new s.Vector3(0,1,0), s.Math.degToRad(90)),
  3495. a = new s.Quaternion,
  3496. function() {
  3497. var e = c.prototype.toJSON.call(this);
  3498. return r.copy(e.camera_quaternion),
  3499. a.copy(o),
  3500. a.multiply(r),
  3501. e.camera_quaternion.x = d.toPrecision(a.x, 4),
  3502. e.camera_quaternion.y = d.toPrecision(a.y, 4),
  3503. e.camera_quaternion.z = d.toPrecision(a.z, 4),
  3504. e.camera_quaternion.w = d.toPrecision(a.w, 4),
  3505. e.ortho_zoom = d.toPrecision(this.currentScale * this.camera.aspect, 4),
  3506. e
  3507. }
  3508. ),
  3509. t.exports = n
  3510. }
  3511. , {
  3512. "../enum/ControlActions": 20,
  3513. "../enum/MouseButton": 34,
  3514. "../settings": 166,
  3515. "../util/browser": 182,
  3516. "../util/math": 190,
  3517. "./OutsideControls": 12,
  3518. three: 217
  3519. }],
  3520. 12: [function(e, t, i) {
  3521. "use strict";
  3522. function n(e) {
  3523. this.camera = e,
  3524. (this.camera.controls = this).enabled = !1,
  3525. this.target = new a.Vector3,
  3526. this.targetBounds = new a.Box3,
  3527. this.zoomSpeed = 2,//编辑时缩放快一些
  3528. this.minDistance = 0,
  3529. this.maxDistance = 1 / 0,
  3530. this.noRotateUpDown = !1,
  3531. this.rotateSpeed = 1,
  3532. this.keyboardZoomSpeed = 0,
  3533. this.keyPanSpeed = 7,
  3534. this.autoRotate = !1,
  3535. this.autoRotateSpeed = 2,
  3536. this.autoPan = !1,
  3537. this.autoPanPosition = new a.Vector3,
  3538. this.minPolarAngle = a.Math.degToRad(25),
  3539. this.maxPolarAngle = a.Math.degToRad(65),
  3540. this.rotationAcceleration = new a.Vector2,
  3541. this.rotationSpeed = new a.Vector2,
  3542. this.panAcceleration = new a.Vector2,
  3543. this.panSpeed = new a.Vector2,
  3544. this.rotateStart = new a.Vector2,
  3545. this.rotateEnd = new a.Vector2,
  3546. this.rotateDelta = new a.Vector2,
  3547. this.panStart = new a.Vector2,
  3548. this.panEnd = new a.Vector2,
  3549. this.panDelta = new a.Vector2,
  3550. this.panOffset = new a.Vector3,
  3551. this.offset = new a.Vector3,
  3552. this.dollyStart = new a.Vector2,
  3553. this.dollyEnd = new a.Vector2,
  3554. this.dollyDelta = new a.Vector2,
  3555. this.phiDelta = 0,
  3556. this.thetaDelta = 0,
  3557. this.scale = 1,
  3558. this.panVector = new a.Vector3,
  3559. this.lastPosition = new a.Vector3,
  3560. this.state = u.NONE,
  3561. this.mouseActions = {},
  3562. this.mouseActions[d.LEFT] = u.ROTATE,
  3563. this.mouseActions[d.MIDDLE] = u.DOLLY,
  3564. this.mouseActions[d.RIGHT] = u.PAN,
  3565. this.touchActions = {},
  3566. this.touchActions[1] = u.ROTATE,
  3567. this.touchActions[2] = u.PAN_DOLLY,
  3568. this.lastMoveTime = 0,
  3569. this.pointersLimit = 2,
  3570. this.pointers = []
  3571. }
  3572. 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;
  3573. (n.prototype = Object.create(g.prototype)).setBounds = function(e) {
  3574. this.targetBounds = e
  3575. }
  3576. ,
  3577. n.prototype.isEngaged = function() {
  3578. return this.state !== u.NONE
  3579. }
  3580. ,
  3581. n.prototype.rotateLeft = function(e) {
  3582. void 0 === e && (e = this.getAutoRotationAngle()),
  3583. this.thetaDelta -= e
  3584. }
  3585. ,
  3586. n.prototype.rotateUp = function(e) {
  3587. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3588. this.phiDelta -= e)
  3589. }
  3590. ,
  3591. n.prototype.panLeft = function(e) {
  3592. var t = this.camera.matrix.elements;
  3593. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3594. this.panOffset.multiplyScalar(-e),
  3595. this.panVector.add(this.panOffset)
  3596. }
  3597. ,
  3598. n.prototype.panUp = function(e) {
  3599. var t = this.camera.matrix.elements;
  3600. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3601. this.panOffset.multiplyScalar(-e),
  3602. this.panVector.add(this.panOffset)
  3603. }
  3604. ,
  3605. n.prototype.startRotating = function(e, t) {
  3606. e && this.navRotationAcc("x", e),
  3607. t && this.navRotationAcc("y", t)
  3608. }
  3609. ,
  3610. n.prototype.stopRotating = function(e) {
  3611. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3612. this.navRotationAcc("x", 0),
  3613. this.navRotationAcc("y", 0)
  3614. }
  3615. ,
  3616. n.prototype.setAutoPanPosition = (r = new a.Vector3,
  3617. o = new a.Vector3,
  3618. function(e, t) {
  3619. r.copy(this.camera.position),
  3620. void 0 === e && null === e || r.setX(e),
  3621. void 0 === t && null === t || r.setZ(t);
  3622. var i = this.camera.position.distanceTo(this.target)
  3623. , n = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3624. this.targetClamped = !1,
  3625. o.copy(r).addScaledVector(n, i),
  3626. this.targetBounds.containsPoint(o) || (this.targetBounds.clampPoint(o, o),
  3627. r.copy(o).addScaledVector(n, -i),
  3628. this.targetClamped = !0),
  3629. this.autoPanPosition.x = r.x,
  3630. this.autoPanPosition.z = r.z,
  3631. this.autoPan && this.stopAutoPanning()
  3632. }
  3633. ),
  3634. n.prototype.stopAutoPanning = function() {
  3635. var e = this.autoPan;
  3636. this.autoPan = !1,
  3637. this.emit(this.targetClamped ? f.AutoPanClamped : e ? f.AutoPanInterrupt : f.AutoPanComplete)
  3638. }
  3639. ,
  3640. n.prototype.dollyIn = function(e) {
  3641. void 0 === e && (e = this.getZoomScale()),
  3642. this.scale /= e
  3643. }
  3644. ,
  3645. n.prototype.dollyOut = function(e) {
  3646. void 0 === e && (e = this.getZoomScale()),
  3647. this.scale *= e
  3648. }
  3649. ,
  3650. n.prototype.updatePan = function(e) {
  3651. if (this.panSpeed.multiplyScalar(1 - c.panFriction).addScaledVector(this.panAcceleration, c.panAccelerationOutside * e),
  3652. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3653. this.autoPan) {
  3654. var t = (new a.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3655. t.setY(0).clampLength(0, 50 * e),
  3656. this.target.add(t),
  3657. this.camera.position.add(t),
  3658. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3659. this.stopAutoPanning())
  3660. }
  3661. }
  3662. ,
  3663. n.prototype.update = function(e) {
  3664. e = e || 1 / 60,
  3665. this.rotationSpeed.multiplyScalar(1 - c.rotationFriction).addScaledVector(this.rotationAcceleration, c.rotationAccelerationOutside * e),
  3666. this.rotateLeft(-this.rotationSpeed.x),
  3667. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3668. this.updatePan(e);
  3669. var t = this.camera.position;
  3670. this.offset.copy(t).sub(this.target);
  3671. var i = Math.atan2(this.offset.x, this.offset.z)
  3672. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3673. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3674. i += this.thetaDelta,
  3675. n += this.phiDelta,
  3676. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3677. n = Math.max(1e-6, Math.min(Math.PI - 1e-6, n));
  3678. var r = this.updateZoom();
  3679. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3680. this.target.add(this.panVector),
  3681. this.targetBounds.clampPoint(this.target, this.target),
  3682. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3683. this.offset.y = r * Math.cos(n),
  3684. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3685. t.copy(this.target).add(this.offset),
  3686. this.camera.lookAt(this.target),
  3687. this.thetaDelta = 0,
  3688. this.phiDelta = 0,
  3689. this.scale = 1,
  3690. this.panVector.set(0, 0, 0),
  3691. 0 < this.lastPosition.distanceTo(this.camera.position) && this.lastPosition.copy(this.camera.position)
  3692. }
  3693. ,
  3694. n.prototype.getAutoRotationAngle = function() {
  3695. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3696. }
  3697. ,
  3698. n.prototype.getZoomScale = function() {
  3699. return Math.pow(.95, this.zoomSpeed)
  3700. }
  3701. ,
  3702. n.prototype.onMouseDown = function(e) {
  3703. if (this.enabled) {
  3704. switch (e.preventDefault(),
  3705. this.stopAutoPanning(),
  3706. this.mouseDown = !0,
  3707. this.state = this.mouseActions[e.button],
  3708. this.state) {
  3709. case u.ROTATE:
  3710. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3711. this.rotationSpeed.set(0, 0);
  3712. break;
  3713. case u.DOLLY:
  3714. this.dollyStart.set(e.clientX, e.clientY);
  3715. break;
  3716. case u.PAN:
  3717. this.panStart.set(e.clientX, e.clientY)
  3718. }
  3719. this.emit(f.InputStart, "mouse")
  3720. }
  3721. }
  3722. ,
  3723. n.prototype.onMouseMove = function(e) {
  3724. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3725. switch (e.preventDefault(),
  3726. this.state) {
  3727. case u.ROTATE:
  3728. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3729. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3730. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3731. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3732. this.rotateStart.copy(this.rotateEnd);
  3733. break;
  3734. case u.DOLLY:
  3735. this.dollyEnd.set(e.clientX, e.clientY),
  3736. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart),
  3737. (0 < this.dollyDelta.y ? this.dollyIn : this.dollyOut).call(this),
  3738. this.dollyStart.copy(this.dollyEnd);
  3739. break;
  3740. case u.PAN:
  3741. this.panEnd.set(e.clientX, e.clientY),
  3742. this.panDelta.subVectors(this.panEnd, this.panStart),
  3743. this.pan(this.panDelta.x, this.panDelta.y),
  3744. this.panStart.copy(this.panEnd)
  3745. }
  3746. this.emit(f.Move, "mouse"),
  3747. this.lastMoveTime = e.timeStamp,
  3748. this.update()
  3749. }
  3750. }
  3751. ,
  3752. n.prototype.onMouseUp = function(e) {
  3753. this.enabled && (this.mouseDown = !1,
  3754. this.state = u.NONE,
  3755. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3756. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3757. this.update(),
  3758. this.rotationAcceleration.set(0, 0),
  3759. this.rotateDelta.set(0, 0)))
  3760. }
  3761. ,
  3762. n.prototype.onMouseOver = function(e) {
  3763. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3764. }
  3765. ,
  3766. n.prototype.onMouseWheel = function(e) {
  3767. this.enabled && c.useWheel && (this.emit(f.Move, "wheel"),
  3768. (0 < (e.wheelDelta || -e.detail) ? this.dollyOut : this.dollyIn).call(this),
  3769. this.update())
  3770. }
  3771. ,
  3772. n.prototype.onKeyDown = function(e) {
  3773. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3774. this.handleKeyDown(e.which)))
  3775. }
  3776. ,
  3777. n.prototype.navRotationAcc = function(e, t) {
  3778. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3779. }
  3780. ,
  3781. n.prototype.navPanAcc = function(e, t) {
  3782. this.stopAutoPanning(),
  3783. this.panAcceleration[e] = t
  3784. }
  3785. ,
  3786. n.prototype.handleKeyDown = function(e) {
  3787. var t = !0;
  3788. switch (e) {
  3789. case p.UPARROW:
  3790. case p.I:
  3791. this.navRotationAcc("y", 1);
  3792. break;
  3793. case p.DOWNARROW:
  3794. case p.K:
  3795. this.navRotationAcc("y", -1);
  3796. break;
  3797. case p.LEFTARROW:
  3798. case p.J:
  3799. this.navRotationAcc("x", -1);
  3800. break;
  3801. case p.RIGHTARROW:
  3802. case p.L:
  3803. this.navRotationAcc("x", 1);
  3804. break;
  3805. case p.W:
  3806. this.navPanAcc("y", 1);
  3807. break;
  3808. case p.S:
  3809. this.navPanAcc("y", -1);
  3810. break;
  3811. case p.A:
  3812. this.navPanAcc("x", -1);
  3813. break;
  3814. case p.D:
  3815. this.navPanAcc("x", 1);
  3816. break;
  3817. default:
  3818. t = !1
  3819. }
  3820. t && this.emit(f.Move, "key")
  3821. }
  3822. ,
  3823. n.prototype.onKeyUp = function(e) {
  3824. this.enabled && (e.preventDefault(),
  3825. e.stopPropagation(),
  3826. this.handleKeyUp(e.which))
  3827. }
  3828. ,
  3829. n.prototype.handleKeyUp = function(e) {
  3830. switch (e) {
  3831. case p.I:
  3832. case p.K:
  3833. case p.UPARROW:
  3834. case p.DOWNARROW:
  3835. this.keyboardZoomSpeed = 0,
  3836. this.rotationAcceleration.y = 0;
  3837. break;
  3838. case p.J:
  3839. case p.L:
  3840. case p.LEFTARROW:
  3841. case p.RIGHTARROW:
  3842. this.rotationAcceleration.x = 0;
  3843. break;
  3844. case p.S:
  3845. case p.W:
  3846. this.panAcceleration.y = 0;
  3847. break;
  3848. case p.A:
  3849. case p.D:
  3850. this.panAcceleration.x = 0
  3851. }
  3852. }
  3853. ,
  3854. n.prototype.onTouchStart = function(i) {
  3855. if (this.enabled || this.state === u.NONE) {
  3856. i.preventDefault(),
  3857. i.stopPropagation(),
  3858. this.stopAutoPanning();
  3859. var e = function() {
  3860. if (2 === i.touches.length) {
  3861. var e = i.touches[0].pageX - i.touches[1].pageX
  3862. , t = i.touches[0].pageY - i.touches[1].pageY;
  3863. this.dollyStart.set(e, t)
  3864. }
  3865. }
  3866. .bind(this)
  3867. , t = function() {
  3868. this.panStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3869. }
  3870. .bind(this)
  3871. , n = function() {
  3872. this.rotateStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3873. }
  3874. .bind(this);
  3875. switch (this.state = this.touchActions[i.touches.length],
  3876. this.state) {
  3877. case u.PAN_DOLLY:
  3878. e();
  3879. case u.PAN:
  3880. t();
  3881. break;
  3882. case u.ROTATE_DOLLY:
  3883. e();
  3884. case u.ROTATE:
  3885. n()
  3886. }
  3887. this.rotationSpeed.set(0, 0),
  3888. this.emit(f.InputStart, "touch")
  3889. }
  3890. }
  3891. ,
  3892. n.prototype.onTouchMove = function(a) {
  3893. if (this.enabled && this.state !== u.NONE) {
  3894. a.preventDefault(),
  3895. a.stopPropagation();
  3896. var s = function() {
  3897. var e = a.touches[0].pageX - a.touches[1].pageX
  3898. , t = a.touches[0].pageY - a.touches[1].pageY;
  3899. this.dollyEnd.set(e, t);
  3900. var i = this.dollyStart.length() - this.dollyEnd.length();
  3901. 0 < i ? this.dollyOut(1 + i / 500) : this.dollyIn(1 - i / 500),
  3902. this.dollyStart.copy(this.dollyEnd)
  3903. }
  3904. .bind(this)
  3905. , e = function() {
  3906. this.panEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3907. this.panDelta.subVectors(this.panEnd, this.panStart),
  3908. this.pan(this.panDelta.x, this.panDelta.y),
  3909. this.panStart.copy(this.panEnd),
  3910. this.rotateDelta.set(0, 0)
  3911. }
  3912. .bind(this)
  3913. , l = function() {
  3914. this.rotateEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3915. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3916. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3917. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3918. this.rotateStart.copy(this.rotateEnd)
  3919. }
  3920. .bind(this)
  3921. , t = function() {
  3922. if (2 === a.touches.length) {
  3923. var e = window.devicePixelRatio || 1
  3924. , t = a.touches[1].pageX - a.touches[0].pageX
  3925. , i = a.touches[1].pageY - a.touches[0].pageY
  3926. , n = Math.sqrt(t * t + i * i);
  3927. if (Math.abs(this.dollyStart.length() - n) > c.input.touchMoveThreshold * e)
  3928. this.state = u.DOLLY,
  3929. s();
  3930. else {
  3931. var r = h.average(a.touches, "pageX")
  3932. , o = h.average(a.touches, "pageY");
  3933. this.rotateDelta.set(r, o).sub(this.rotateStart).length() > c.input.touchMoveThreshold && (this.state = u.ROTATE,
  3934. this.rotateStart.set(r, o),
  3935. l())
  3936. }
  3937. }
  3938. }
  3939. .bind(this);
  3940. switch (this.state) {
  3941. case u.PAN_DOLLY:
  3942. s();
  3943. case u.PAN:
  3944. e();
  3945. break;
  3946. case u.ROTATE_DOLLY:
  3947. t();
  3948. break;
  3949. case u.DOLLY:
  3950. s();
  3951. break;
  3952. case u.ROTATE:
  3953. l();
  3954. break;
  3955. default:
  3956. this.state = u.NONE
  3957. }
  3958. this.lastMoveTime = a.timeStamp,
  3959. this.emit(f.Move, "touch")
  3960. }
  3961. }
  3962. ,
  3963. n.prototype.onTouchEnd = function(e) {
  3964. this.enabled && (this.state === u.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3965. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3966. this.state = u.NONE,
  3967. this.update(),
  3968. this.rotationAcceleration.set(0, 0),
  3969. this.rotateDelta.set(0, 0))
  3970. }
  3971. ,
  3972. n.prototype.onPointerDown = function(e) {
  3973. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3974. id: e.pointerId,
  3975. pageX: e.pageX,
  3976. pageY: e.pageY
  3977. }),
  3978. e.touches = this.pointers,
  3979. this.onTouchStart(e)),
  3980. this.emit(f.InputStart, "pointer"))
  3981. }
  3982. ,
  3983. n.prototype.onPointerMove = function(t) {
  3984. this.enabled && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  3985. t.pointerId === e.id && (e.pageX = t.pageX,
  3986. e.pageY = t.pageY)
  3987. }),
  3988. t.touches = this.pointers,
  3989. this.onTouchMove(t))
  3990. }
  3991. ,
  3992. n.prototype.onPointerUp = function(i) {
  3993. this.enabled && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  3994. i.pointerId === e.id && this.pointers.splice(t, 1)
  3995. }
  3996. .bind(this)),
  3997. i.touches = this.pointers,
  3998. this.onTouchEnd(i))
  3999. }
  4000. ,
  4001. n.prototype.reset = function() {
  4002. this.state = u.NONE,
  4003. this.stopAutoPanning(),
  4004. this.rotationSpeed.set(0, 0),
  4005. this.rotationAcceleration.set(0, 0),
  4006. this.panSpeed.set(0, 0),
  4007. this.panAcceleration.set(0, 0)
  4008. }
  4009. ,
  4010. n.prototype.toJSON = function() {
  4011. return {
  4012. camera_position: {
  4013. x: s.toPrecision(this.camera.position.x, 4),
  4014. y: s.toPrecision(this.camera.position.y, 4),
  4015. z: s.toPrecision(this.camera.position.z, 4)
  4016. },
  4017. camera_quaternion: {
  4018. x: s.toPrecision(this.camera.quaternion.x, 4),
  4019. y: s.toPrecision(this.camera.quaternion.y, 4),
  4020. z: s.toPrecision(this.camera.quaternion.z, 4),
  4021. w: s.toPrecision(this.camera.quaternion.w, 4)
  4022. }
  4023. }
  4024. }
  4025. ,
  4026. t.exports = n
  4027. }
  4028. , {
  4029. "../enum/ControlActions": 20,
  4030. "../enum/ControlEvents": 21,
  4031. "../enum/Keys": 30,
  4032. "../enum/MouseButton": 34,
  4033. "../enum/Vectors": 50,
  4034. "../settings": 166,
  4035. "../util/common": 185,
  4036. "../util/math": 190,
  4037. events: 202,
  4038. three: 217
  4039. }],
  4040. 13: [function(u, d, e) {
  4041. (function(e) {
  4042. "use strict";
  4043. function t(e) {
  4044. this.camera = e,
  4045. (this.camera.controls = this).target = new s.Vector3(0,0,0),
  4046. this.lookVector = new s.Vector3,
  4047. this.lookSpeed = .05,
  4048. this.rotationAcc = new s.Vector2,
  4049. this.rotationSpeed = new s.Vector2,
  4050. this.lat = 0,
  4051. this.lon = 0,
  4052. this.phi = 0,
  4053. this.theta = 0,
  4054. this.enabled = !1,
  4055. this.locked = !1,
  4056. this.pointer = new s.Vector2(0,0),
  4057. this.rotationHistory = [],
  4058. this.rotationDifference = new s.Vector2,
  4059. this.pointerDragOn = !1,
  4060. this.pointerDragStart = new s.Vector2(0,0),
  4061. this.pinchDistance = 0,
  4062. this.moveStart = new s.Vector2,
  4063. this.moveTolerance = .01,
  4064. this.pointersLimit = 2,
  4065. this.pointers = []
  4066. }
  4067. var s = u("three")
  4068. , i = u("../util/logger")
  4069. , n = u("../settings")
  4070. , r = u("../util/common")
  4071. , o = u("../util/math")
  4072. , a = (u("../enum/Vectors"),
  4073. u("../enum/MouseButton"))
  4074. , l = u("../enum/Keys")
  4075. , c = u("../enum/ControlEvents")
  4076. , h = u("events").EventEmitter;
  4077. new i(e),
  4078. (t.prototype = Object.create(h.prototype)).usable = function() {
  4079. return this.enabled && !this.locked
  4080. }
  4081. ,
  4082. /* t.prototype.lookAt = function(e) {
  4083. var t = this.camera.position.clone().sub(e)
  4084. , i = Math.atan(t.z / t.x);
  4085. i += t.x < 0 ? Math.PI : 0,
  4086. i += 0 < t.x && t.z < 0 ? 2 * Math.PI : 0,
  4087. this.lon = s.Math.radToDeg(i) + 180;
  4088. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4089. , r = Math.atan(t.y / n);
  4090. this.lat = -s.Math.radToDeg(r)
  4091. } */
  4092. t.prototype.lookAt = function(aim, dir) {
  4093. var t = dir || this.camera.position.clone().sub(aim); //aim所指点的笛卡尔坐标系
  4094. var i = Math.atan(t.z / t.x);
  4095. i += t.x < 0 ? Math.PI : 0;
  4096. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0;
  4097. this.lon = s.Math.radToDeg(i) + 180;
  4098. var n = Math.sqrt(t.x * t.x + t.z * t.z),
  4099. o = Math.atan(t.y / n);
  4100. this.lat = -s.Math.radToDeg(o);
  4101. }
  4102. ,
  4103. t.prototype.startRotationFrom = function(e, t) {
  4104. o.convertScreenPositionToNDC(e, t, this.pointer),
  4105. this.pointerDragOn = !0,
  4106. this.pointerDragStart.copy(this.pointer),
  4107. this.moveStart.copy(this.pointer),
  4108. this.rotationHistory = [],
  4109. this.rotationSpeed.set(0, 0)
  4110. }
  4111. ,
  4112. t.prototype.onMouseOver = function(e) {
  4113. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4114. }
  4115. ,
  4116. t.prototype.onTouchStart = function(e) {
  4117. if (this.usable()) {
  4118. switch (e.preventDefault(),
  4119. e.stopPropagation(),
  4120. e.touches.length) {
  4121. case 1:
  4122. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4123. break;
  4124. case 2:
  4125. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4126. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  4127. this.pinchDistance = Math.sqrt(t * t + i * i)
  4128. }
  4129. this.emit(c.InputStart, "touch")
  4130. }
  4131. }
  4132. ,
  4133. t.prototype.onPointerDown = function(e) {
  4134. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4135. id: e.pointerId,
  4136. clientX: e.clientX,
  4137. clientY: e.clientY
  4138. }),
  4139. e.touches = this.pointers,
  4140. this.onTouchStart(e),
  4141. this.emit(c.InputStart, "pointer"))
  4142. }
  4143. ,
  4144. t.prototype.onMouseDown = function(e) {
  4145. if (this.usable()) {
  4146. switch (e.preventDefault(),
  4147. e.stopPropagation(),
  4148. e.button) {
  4149. case a.LEFT:
  4150. this.startRotationFrom(e.clientX, e.clientY)
  4151. }
  4152. this.emit(c.InputStart, "mouse")
  4153. }
  4154. }
  4155. ,
  4156. t.prototype.updateRotation = function() {
  4157. if (this.usable() && this.pointerDragOn) {
  4158. var e = new s.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4159. , t = new s.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4160. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4161. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4162. , r = Math.atan2(e.y, i)
  4163. , o = Math.atan2(t.y, n);
  4164. this.rotationDifference.y = s.Math.radToDeg(r - o),
  4165. e.y = 0,
  4166. t.y = 0;
  4167. var a = Math.acos(e.dot(t) / e.length() / t.length());
  4168. isNaN(a) || (this.rotationDifference.x = s.Math.radToDeg(a),
  4169. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4170. this.pointerDragStart.copy(this.pointer)
  4171. }
  4172. }
  4173. ,
  4174. t.prototype.onMouseMove = function(e) {
  4175. this.usable() && (o.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4176. 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"))
  4177. }
  4178. ,
  4179. t.prototype.onTouchMove = function(e) {
  4180. if (this.usable())
  4181. switch (this.emit(c.Move, "touch"),
  4182. e.touches.length) {
  4183. case 1:
  4184. o.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4185. break;
  4186. case 2:
  4187. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4188. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4189. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4190. .01 < Math.abs(n) && (this.emit(c.InteractionDirect),
  4191. this.emit(c.Pinch, n),
  4192. this.pinchDistance -= n)
  4193. }
  4194. }
  4195. ,
  4196. t.prototype.onPointerMove = function(t) {
  4197. this.usable() && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  4198. t.pointerId === e.id && (e.clientX = t.clientX,
  4199. e.clientY = t.clientY)
  4200. }),
  4201. t.touches = this.pointers,
  4202. this.onTouchMove(t))
  4203. }
  4204. ,
  4205. t.prototype.endRotation = function() {
  4206. this.pointerDragOn = !1;
  4207. var e = r.averageVectors(this.rotationHistory);
  4208. this.rotationSpeed.set(e.x * n.rotationAfterMoveMultiplier, e.y * n.rotationAfterMoveMultiplier)
  4209. }
  4210. ,
  4211. t.prototype.onTouchEnd = function(e) {
  4212. this.usable() && (e.preventDefault(),
  4213. e.stopPropagation(),
  4214. this.endRotation())
  4215. }
  4216. ,
  4217. t.prototype.onMouseUp = function(e) {
  4218. this.usable() && (e.preventDefault(),
  4219. e.stopPropagation(),
  4220. this.endRotation())
  4221. }
  4222. ,
  4223. t.prototype.onPointerUp = function(i) {
  4224. this.usable() && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  4225. i.pointerId === e.id && this.pointers.splice(t, 1)
  4226. }
  4227. .bind(this)),
  4228. i.touches = this.pointers,
  4229. this.onTouchEnd(i))
  4230. }
  4231. ,
  4232. t.prototype.update = function(e) {
  4233. for (this.lon,
  4234. this.lat,
  4235. this.updateRotation(),
  4236. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > n.rotationAfterMoveHistoryCount; )
  4237. this.rotationHistory.shift();
  4238. this.lon += this.rotationDifference.x,
  4239. this.lat += this.rotationDifference.y,
  4240. this.rotationDifference.set(0, 0),
  4241. this.rotationSpeed.x = this.rotationSpeed.x * (1 - n.rotationFriction) + this.rotationAcc.x * n.rotationAccelerationInside,
  4242. this.rotationSpeed.y = this.rotationSpeed.y * (1 - n.rotationFriction) + this.rotationAcc.y * n.rotationAccelerationInside,
  4243. this.lon += this.rotationSpeed.x * e,
  4244. this.lat += this.rotationSpeed.y * e
  4245. var insideLookLimitDown = n.insideLookLimitDown - n.insideFOV/2 + this.camera.fov / 2
  4246. var insideLookLimitUp = n.insideLookLimitUp + n.insideFOV/2 - this.camera.fov / 2
  4247. this.lat = Math.max(insideLookLimitDown, Math.min(insideLookLimitUp, this.lat)); //通过预定义的俯仰角最大最小范围(insideLookLimitUp、insideLookLimitDown)来限制俯仰角。 注:这种数学计算很常见,因此API也很常见(clamp),等价于 this.lat = THREE.Math.clamp( this.lat, settings.insideLookLimitDown, settings.insideLookLimitUp );
  4248. //this.lat = Math.max(n.insideLookLimitDown, Math.min(n.insideLookLimitUp, this.lat)),
  4249. this.phi = s.Math.degToRad(90 - this.lat),
  4250. this.theta = s.Math.degToRad(this.lon),
  4251. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4252. this.lookVector.y = Math.cos(this.phi),
  4253. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4254. this.target.copy(this.lookVector).add(this.camera.position),
  4255. this.camera.lookAt(this.target)
  4256. }
  4257. ,
  4258. t.prototype.onMouseWheel = function(e) {
  4259. if (this.usable()) {
  4260. var t = e.wheelDelta || -e.detail;
  4261. this.emit(c.InteractionDirect),
  4262. this.emit(c.Scroll, t)
  4263. }
  4264. }
  4265. ,
  4266. t.prototype.onKeyDown = function(e) {
  4267. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4268. this.handleKeyDown(e.which)))
  4269. }
  4270. ,
  4271. t.prototype.handleKeyDown = function(e) {
  4272. var t = function(e, t) {
  4273. this.rotationAcc[e] = t
  4274. }
  4275. .bind(this);
  4276. this.emit(c.InteractionKey);
  4277. var i = !0;
  4278. switch (e) {
  4279. case l.LEFTARROW:
  4280. case l.J:
  4281. t("x", -1);
  4282. break;
  4283. case l.RIGHTARROW:
  4284. case l.L:
  4285. t("x", 1);
  4286. break;
  4287. case l.I:
  4288. t("y", 1);
  4289. break;
  4290. case l.K:
  4291. t("y", -1);
  4292. break;
  4293. default:
  4294. i = !1
  4295. }
  4296. i && this.emit(c.Move, "key")
  4297. }
  4298. ,
  4299. t.prototype.onKeyUp = function(e) {
  4300. this.usable() && (e.preventDefault(),
  4301. e.stopPropagation(),
  4302. this.handleKeyUp(e.which))
  4303. }
  4304. ,
  4305. t.prototype.handleKeyUp = function(e) {
  4306. switch (e) {
  4307. case l.LEFTARROW:
  4308. case l.J:
  4309. case l.RIGHTARROW:
  4310. case l.L:
  4311. this.rotationAcc.x = 0;
  4312. break;
  4313. case l.I:
  4314. case l.K:
  4315. this.rotationAcc.y = 0
  4316. }
  4317. }
  4318. ,
  4319. t.prototype.startRotating = function(e, t) {
  4320. e && (this.rotationAcc.x = e),
  4321. t && (this.rotationAcc.y = t)
  4322. }
  4323. ,
  4324. t.prototype.stopRotating = function(e) {
  4325. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4326. this.rotationAcc.set(0, 0)
  4327. }
  4328. ,
  4329. t.prototype.reset = function() {
  4330. this.pointerDragOn = !1,
  4331. this.rotationAcc.set(0, 0),
  4332. this.rotationSpeed.set(0, 0),
  4333. this.pointers = []
  4334. }
  4335. ,
  4336. t.prototype.toJSON = function() {
  4337. return {
  4338. camera_position: {
  4339. x: o.toPrecision(this.camera.position.x, 4),
  4340. y: o.toPrecision(this.camera.position.y, 4),
  4341. z: o.toPrecision(this.camera.position.z, 4)
  4342. },
  4343. camera_quaternion: {
  4344. x: o.toPrecision(this.camera.quaternion.x, 4),
  4345. y: o.toPrecision(this.camera.quaternion.y, 4),
  4346. z: o.toPrecision(this.camera.quaternion.z, 4),
  4347. w: o.toPrecision(this.camera.quaternion.w, 4)
  4348. }
  4349. }
  4350. }
  4351. ,
  4352. t.prototype.setStateFromJSON = function(e) {
  4353. this.camera.position.copy(e.camera_position),
  4354. this.camera.quaternion.copy(e.camera_quaternion)
  4355. }
  4356. ,
  4357. d.exports = t
  4358. }
  4359. ).call(this, "/js/controls/PanoramaControls.js")
  4360. }
  4361. , {
  4362. "../enum/ControlEvents": 21,
  4363. "../enum/Keys": 30,
  4364. "../enum/MouseButton": 34,
  4365. "../enum/Vectors": 50,
  4366. "../settings": 166,
  4367. "../util/common": 185,
  4368. "../util/logger": 189,
  4369. "../util/math": 190,
  4370. events: 202,
  4371. three: 217
  4372. }],
  4373. 14: [function(t, i, e) {
  4374. (function(e) {
  4375. "use strict";
  4376. var c = t("three")
  4377. , h = t("../enum/Viewmode")
  4378. , u = new (t("../util/logger"))(e);
  4379. i.exports = {
  4380. serialize: function(e) {
  4381. return encodeURI(JSON.stringify(e))
  4382. },
  4383. deserialize: function(e) {
  4384. function t(e) {
  4385. return e.reduce(function(e, t) {
  4386. return e && "number" == typeof t && !isNaN(t)
  4387. }, !0)
  4388. }
  4389. try {
  4390. var i = JSON.parse(decodeURI(e))
  4391. , n = {
  4392. mode: h.fromInt(i.camera_mode),
  4393. panoId: i.scan_id,
  4394. position: (new c.Vector3).copy(i.camera_position),
  4395. quaternion: (new c.Quaternion).copy(i.camera_quaternion),
  4396. zoom: i.ortho_zoom,
  4397. floorVisibility: i.floor_visibility
  4398. }
  4399. , r = n.position;
  4400. t([r.x, r.y, r.z]) || n.position.set(0, 0, 0);
  4401. var o = n.quaternion;
  4402. return t([o.x, o.y, o.z, o.w]) || n.quaternion.set(0, 0, 0, 1),
  4403. n
  4404. } catch (i) {
  4405. u.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4406. try {
  4407. var a = e.split(",")
  4408. , s = {
  4409. x: parseFloat(a[2]),
  4410. y: parseFloat(a[3]),
  4411. z: parseFloat(a[4])
  4412. }
  4413. , l = {
  4414. x: parseFloat(a[5]),
  4415. y: parseFloat(a[6]),
  4416. z: parseFloat(a[7]),
  4417. w: parseFloat(a[8])
  4418. };
  4419. return t([s.x, s.y, s.z]) || (s.x = 0,
  4420. s.y = 0,
  4421. s.z = 0),
  4422. t([l.x, l.y, l.z, l.w]) || (l.x = 0,
  4423. l.y = 0,
  4424. l.z = 0,
  4425. l.w = 1),
  4426. {
  4427. mode: h.fromInt(a[0]),
  4428. panoId: a[1],
  4429. position: (new c.Vector3).copy(s),
  4430. quaternion: (new c.Quaternion).copy(l)
  4431. }
  4432. } catch (t) {
  4433. u.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4434. }
  4435. }
  4436. return null
  4437. }
  4438. }
  4439. }
  4440. ).call(this, "/js/controls/serializer.js")
  4441. }
  4442. , {
  4443. "../enum/Viewmode": 51,
  4444. "../util/logger": 189,
  4445. three: 217
  4446. }],
  4447. 15: [function(C, I, e) {
  4448. (function(e) {
  4449. "use strict";
  4450. function t() {
  4451. this.endlessLoop = r.warp.loop,
  4452. this.clock = new i.Clock(!0),
  4453. this.model = null,
  4454. this.player = null,
  4455. this.currentItem = null,
  4456. this.destinationItem = null,
  4457. this.tourIsPlaying = !1,
  4458. this.transitionStage = v.None,
  4459. this.nextFunc = null,
  4460. this.onTheBus = !1,
  4461. this.tourInProgress = !1,
  4462. this.reachSource = null,
  4463. this.interrupted = !1,
  4464. this.nItems = 0,
  4465. this.walkingSectionPaused = !1
  4466. }
  4467. var i = C("three")
  4468. , n = C("./util/logger")
  4469. , r = C("./settings")
  4470. , o = C("./util/transitions")
  4471. , a = C("events").EventEmitter
  4472. , s = C("./enum/Viewmode")
  4473. , l = C("./analytics")
  4474. , c = C("./enum/WarpStyle")
  4475. , h = (o = C("./util/transitions"),
  4476. C("./model/ModelManager"),
  4477. C("./enum/ModelManagerEvents"))
  4478. , u = C("./enum/DirectorEvents")
  4479. , d = C("./enum/PlayerEvents")
  4480. , p = (C("./enum/ControlEvents"),
  4481. C("./enum/BlackoutStyle"))
  4482. , f = C("./enum/PathDiscardMode")
  4483. , g = C("./enum/PathDisplayMode")
  4484. , m = (C("./player"),
  4485. new n(e))
  4486. , v = Object.freeze({
  4487. None: 0,
  4488. Moving: 1,
  4489. Aiming: 2,
  4490. Interlude: 3
  4491. })
  4492. , y = Object.freeze({
  4493. Forward: 1,
  4494. NoChange: 0,
  4495. Backwards: -1
  4496. })
  4497. , A = o.getUniqueId();
  4498. (t.prototype = Object.create(a.prototype)).init = function(e, t) {
  4499. this.player = e,
  4500. this.modelManager = t,
  4501. this.updateModel(),
  4502. this.resetAll(),
  4503. this.bindEvents()
  4504. }
  4505. ,
  4506. t.prototype.resetAll = function() {
  4507. if (this.currentItem = null,
  4508. this.destinationItem = null,
  4509. this.tourIsPlaying = !1,
  4510. //this.bgmReplay(),
  4511. this.transitionStage = v.None,
  4512. this.nextFunc = null,
  4513. this.onTheBus = !1,
  4514. this.reachSource = null,
  4515. this.interrupted = !1,
  4516. this.model) {
  4517. var e = r.path.typ === c.WALK ? c.WALK : c.STD;
  4518. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && !1 === this.model.data.player_options.fast_transitions ? e : c.BLACK
  4519. } else
  4520. this.defaultWarpStyle = c.BLACK,
  4521. m.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4522. this.resetSpecialTransition()
  4523. }
  4524. ,
  4525. t.prototype.updateModel = function() {
  4526. this.model = this.modelManager.getActiveModel(),
  4527. this.nItems = this.model.heroLocations.length
  4528. }
  4529. ,
  4530. t.prototype.bindEvents = function() {
  4531. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  4532. this.player.on(d.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4533. this.player.on(d.Move, this.handlePlayerMove.bind(this)),
  4534. this.player.on(d.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4535. this.player.on(d.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4536. this.player.on(d.InputStart, this.handlePlayerInputStart.bind(this)),
  4537. this.player.on(d.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4538. this.player.once(d.Move, function() {
  4539. o.cancelById(A)
  4540. })
  4541. }
  4542. ,
  4543. t.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4544. return e === c.WALK && (this.interrupt(p.NONE),
  4545. this.pauseWalkingSection(),
  4546. this.player.fastForwardActivePanoFlight(),
  4547. !0)
  4548. }
  4549. ,
  4550. t.prototype.handlePlayerMove = function(e) {
  4551. this.transitionStage === v.Interlude && this.interrupt(p.NONE),
  4552. this.emit("update.controls")
  4553. }
  4554. ,
  4555. t.prototype.handlePlayerPanoChosen = function(e, t) {
  4556. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4557. this.emit("update.controls"))
  4558. }
  4559. ,
  4560. t.prototype.handlePlayerModeChanged = function(e, t) {
  4561. this.intermediateState() || e === t || (this.onTheBus = !1,
  4562. this.emit("update.controls"))
  4563. }
  4564. ,
  4565. t.prototype.handlePlayerInputStart = function(e) {
  4566. this.transitionStage === v.Interlude && this.interrupt(p.NONE)
  4567. }
  4568. ,
  4569. t.prototype.handlePlayerFlyingStarted = function() {
  4570. this.clearWalkingSectionPaused()
  4571. }
  4572. ,
  4573. t.prototype.describe = function() {
  4574. return {
  4575. nItems: this.nItems,
  4576. currentItem: this.currentItem,
  4577. destinationItem: this.destinationItem,
  4578. tourIsPlaying: this.tourIsPlaying,
  4579. onTheBus: this.onTheBus,
  4580. endlessLoop: this.endlessLoop,
  4581. viewMode: this.player.mode,
  4582. inTransition: this._inTransition(),
  4583. transitionStage: this.transitionStage,
  4584. tourInProgress: this.tourInProgress
  4585. }
  4586. }
  4587. ,
  4588. t.prototype._inTransition = function() {
  4589. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === s.TRANSITIONING || this.tourIsPlaying
  4590. }
  4591. ,
  4592. t.prototype.bounceable = function() {
  4593. var e = this.clock.getDelta();
  4594. return this.isInterrupted() || e < .9 && .01 < e || this.player.flying && !this.player.isWarping()
  4595. }
  4596. ,
  4597. t.prototype.itemCompare = function(item1, item2, type){//add
  4598. if(type == 'equal'){//==
  4599. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  4600. }else if(type == 'less'){//<
  4601. return item1 && item2 && (item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
  4602. }
  4603. }
  4604. t.prototype.currentMoveDirection = function() {
  4605. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4606. return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.itemCompare(this.destinationItem, this.currentItem,'equal') ? y.NoChange : this.itemCompare(this.currentItem, this.destinationItem,'less') ? y.Forward : y.Backwards
  4607. }
  4608. ,
  4609. t.prototype.clearPath = function() {
  4610. this._inTransition() || this.player.path.discardPathObject()
  4611. }
  4612. ,
  4613. t.prototype.allFloors = function() {
  4614. this.model.toggleAllFloors()
  4615. }
  4616. ,
  4617. t.prototype.actionComplete = function(e) {
  4618. if (this.interrupted = !1,
  4619. this.transitionStage = v.None,
  4620. this.resetSpecialTransition(),
  4621. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4622. this.tourIsPlaying || (this.player.disablePreRendering(),
  4623. this.player.mode === s.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4624. this.emit("update.controls"),
  4625. this.nextFunc) {
  4626. var t = this.nextFunc;
  4627. this.nextFunc = null,
  4628. t()
  4629. }
  4630. }
  4631. ,
  4632. t.prototype.awaitCompletion = function(e, t) {
  4633. this.nextFunc = t,
  4634. e()
  4635. }
  4636. ,
  4637. t.prototype.updateSuccessFunction = function(e) {
  4638. this.nextFunc = e
  4639. }
  4640. ,
  4641. t.prototype.interrupt = function(e, t) {
  4642. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4643. this.tourIsPlaying = !1,
  4644. //this.bgmReplay(),
  4645. this.interrupted = !0,
  4646. this.nextFunc = null,
  4647. this.emit(u.ActionInterrupted),
  4648. null != e || (e = p.BEGINNING),
  4649. this.player.interruptAndFastForward(e, t),
  4650. !0)
  4651. }
  4652. ,
  4653. t.prototype.wouldInterrupt = function() {
  4654. return this.transitionStage !== v.None
  4655. }
  4656. ,
  4657. t.prototype.intermediateState = function() {
  4658. return this.transitionStage !== v.None
  4659. }
  4660. ,
  4661. t.prototype.isInterrupted = function() {
  4662. return this.interrupted
  4663. }
  4664. ,
  4665. t.prototype.pauseWalkingSection = function() {
  4666. this.walkingSectionPaused = !0
  4667. }
  4668. ,
  4669. t.prototype.clearWalkingSectionPaused = function() {
  4670. this.walkingSectionPaused = !1
  4671. }
  4672. ,
  4673. t.prototype.autoTour = function() {
  4674. var i = Date.now();
  4675. this.model.auxDataPromise.then(function() {
  4676. i = Date.now() - i;
  4677. var e = r.warp.auto
  4678. , t = this.model.data && this.model.data.player_options/* && this.model.data.player_options.highlight_reel */;
  4679. 0 <= e && 1 < this.model.heroCount() && t && o.trigger({
  4680. duration: Math.max(1e3 * Math.min(300, e) - i, 0),
  4681. done: function() {
  4682. this.playTour()
  4683. }
  4684. .bind(this),
  4685. name: "_atr",
  4686. id: A
  4687. })
  4688. }
  4689. .bind(this))
  4690. }
  4691. ,
  4692. t.prototype.atDestinationPano = function() {
  4693. if (!this.player.currentPano || null === this.destinationItem)
  4694. return !1;
  4695. var e = this.player.currentPano.id;
  4696. if (void 0 === e)
  4697. return !1;
  4698. var t = this.model.heroLocations;
  4699. //return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4700. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  4701. return destination && destination.panoId == e
  4702. }
  4703. ,
  4704. t.prototype.redirectToItem = function(e, t) {
  4705. if (null != e)
  4706. if (this.wouldInterrupt())
  4707. if (this.player.mode !== s.TRANSITIONING) {
  4708. m.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4709. var i = function() {
  4710. o.setTimeout(function() {
  4711. this.setDestinationItem(e),
  4712. this.goToDestination(!0, p.BEGINNING, r.warp.warpInterruptionRedirectTime, !1)
  4713. }
  4714. .bind(this), 0)
  4715. }
  4716. .bind(this);
  4717. this.interrupt(p.END, 0),
  4718. this.updateSuccessFunction(i)
  4719. } else
  4720. m.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4721. else
  4722. m.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4723. else
  4724. m.warn("Director.redirectToItem() -> Redirecting to null item.")
  4725. }
  4726. ,
  4727. t.prototype.useSpecialTransition = function(e) {
  4728. void 0 !== e && this.defaultWarpStyle !== c.BLACK && m.debug("useSpecialTransition(): " + e),
  4729. this.nextWarpStyle = c.BLACK
  4730. }
  4731. ,
  4732. t.prototype.resetSpecialTransition = function() {
  4733. this.nextWarpStyle = this.defaultWarpStyle
  4734. }
  4735. ,
  4736. t.prototype.arrivedAtDestination = function(e) {
  4737. if (this.player.flying || this.player.isWarping())
  4738. m.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4739. else {
  4740. this.transitionStage = v.Aiming;
  4741. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4742. this.player.model.fadePanoMarkers(0),
  4743. this.awaitCompletion(function() {
  4744. this.resetSpecialTransition(),
  4745. e ? this.player.aimTourCamera(this.destinationItem, g.Retain, g.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4746. }
  4747. .bind(this), t)
  4748. }
  4749. }
  4750. ,
  4751. t.prototype.goToDestination = function(e, t, i, n) {
  4752. //音频
  4753. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
  4754. if(musicInfo && musicInfo.music){
  4755. let src = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  4756. let audioObj = SoundManager.list.find(e=>e.name == 'tour')
  4757. let audioSrc1 = common.getFileNameFromUrl(audioObj.src);
  4758. let audioSrc2 = common.getFileNameFromUrl(src)
  4759. if(audioSrc1 == audioSrc2){//应该是继续播放该folder
  4760. if(this.destinationItem[1] == 0){//从头开始播放 因为可能暂停后然后再点该缩略图播
  4761. SoundManager.play('tour',null,0) // currentTime = 0;
  4762. }else if( audioObj.audio.paused && audioObj.audio.currentTime < audioObj.audio.duration ){//未播完
  4763. SoundManager.play('tour')//继续播。 如果不是< 说明播完了,item[1]不为0应该是继续播放就不需要从头
  4764. }
  4765. }else{//很可能是该folder的起始
  4766. SoundManager.play('tour', manage.dealURL(src))
  4767. }
  4768. }
  4769. if (this.onTheBus = !0,
  4770. this.emit("update.controls"),
  4771. this.player.updateLastView(),
  4772. n || !this.atDestinationPano()){
  4773. if (this.player.flying || this.player.isWarping())
  4774. m.warn("Cannot go to new destination while player is flying or warping.");
  4775. else {
  4776. var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4777. , s = null
  4778. , l = null;
  4779. if (a.isPano()) {
  4780. var o1 = this.getMomentTour(this.destinationItem) //window.DATA.momentTour || "walk";
  4781. l = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, g.Show, f.Slow, o1, !0, i, this.actionComplete.bind(this)),
  4782. s = this.arrivedAtDestination.bind(this, !0)
  4783. //add
  4784. if(o1=='black' && a.zoom && a.zoom != this.player.zoomLevel){
  4785. this.player.smoothZoomFovTo(null, a.zoom, r.warp.teleportTime) //瞬间过渡的时间
  4786. }
  4787. } else{
  4788. l = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4789. s = this.arrivedAtDestination.bind(this, !1);
  4790. }
  4791. this.transitionStage = v.Moving,
  4792. this.model.fadePanoMarkers(0),
  4793. this.awaitCompletion(function() {
  4794. l()
  4795. }
  4796. .bind(this), s),
  4797. this.emit("update.controls")
  4798. }
  4799. }else{
  4800. //add 原地旋转时, 写到_warpCameraAim里,因那有时间
  4801. /* var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4802. if(a.zoom && a.zoom != this.player.zoomLevel){
  4803. this.player.smoothZoomFovTo(null, a.zoom, r.warp.teleportTime) //瞬间过渡的时间
  4804. } */
  4805. this.arrivedAtDestination(!0)
  4806. }
  4807. }
  4808. ,
  4809. t.prototype.tourInterlude = function() {
  4810. if (l.trackAlways("reach_highlight", {
  4811. reach_source: this.reachSource
  4812. }),
  4813. this.model.fadePanoMarkers(0),
  4814. this.emit("update.controls"),
  4815. this.tourIsPlaying)
  4816. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4817. this.stopTour(),
  4818. this.emit(u.TourEnd),
  4819. void (this.player.mode === s.PANORAMA && this.model.fadePanoMarkers(r.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4820. this.transitionStage = v.Interlude,
  4821. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4822. }
  4823. .bind(this), this.goNext.bind(this))
  4824. }
  4825. ,
  4826. t.prototype.playTour = function() {
  4827. if (!this.bounceable())
  4828. return this.tourIsPlaying ? void m.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4829. this.tourInProgress = !0,
  4830. this.reachSource = "play",
  4831. this.tourIsPlaying = !0,
  4832. this.wasZoomEnabled = this.player.zoomEnabled,
  4833. this.player.zoomEnabled = !1,
  4834. this.resetSpecialTransition(),
  4835. this.emit("update.controls"),
  4836. this.emit(u.TourStart),
  4837. this.player.enablePreRendering(),
  4838. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4839. this.goToDestination()) : this.goNext()))
  4840. }
  4841. ,
  4842. t.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4843. this.isInterrupted() || this.transitionStage === v.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4844. this.tourIsPlaying = !1,
  4845. //(!isAutoStop || g_tourAudio && g_tourAudio.paused )&&this.bgmReplay(),//xzw
  4846. this.interrupt(),
  4847. this.clearWalkingSectionPaused(),
  4848. this.resetSpecialTransition(),
  4849. this.emit("update.controls"))
  4850. }
  4851. ,
  4852. t.prototype.endTourProgress = function() {
  4853. this.tourInProgress = !1,
  4854. this.emit("update.controls"),
  4855. this.emit(u.TourEnd)
  4856. }
  4857. ,
  4858. t.prototype.goToHighlight = function(e) {
  4859. if (this.wouldInterrupt())
  4860. this.itemCompare(this.destinationItem,e,'equal') ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4861. else {
  4862. if (m.debug("<tour.goto " + e + ">"),
  4863. this.isInterrupted())
  4864. return;
  4865. this.clearWalkingSectionPaused(),
  4866. this.setDestinationItem(e),
  4867. this.useSpecialTransition("Hilight"),
  4868. this.goToDestination(),
  4869. l.trackAlways("reach_highlight", {
  4870. reach_source: "thumb"
  4871. })
  4872. }
  4873. }
  4874. ,
  4875. t.prototype.prevHighlight = function() {
  4876. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4877. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4878. this.reachSource = "prev",
  4879. this.goPrev()))
  4880. }
  4881. ,
  4882. t.prototype.nextHighlight = function() {
  4883. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4884. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4885. this.reachSource = "next",
  4886. this.goNext()))
  4887. }
  4888. ,
  4889. t.prototype.changeMode = function(e) {
  4890. var t = $.Deferred()
  4891. , i = t.resolve.bind(t)
  4892. , n = t.reject.bind(t);
  4893. if (this.emit(u.StartModeChange),
  4894. !function() {
  4895. return this.clearWalkingSectionPaused(),
  4896. !!this.wouldInterrupt() && (this.interrupt(),
  4897. !0)
  4898. }
  4899. .bind(this)()) {
  4900. switch (e) {
  4901. case s.PANORAMA:
  4902. 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);
  4903. break;
  4904. case s.DOLLHOUSE:
  4905. case s.FLOORPLAN:
  4906. this.player.flyToNewMode({
  4907. mode: e
  4908. }).done(i).fail(n);
  4909. break;
  4910. case s.OUTDOOR:
  4911. 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)
  4912. }
  4913. return t.promise()
  4914. }
  4915. }
  4916. ,
  4917. t.prototype.atEndOfTour = function(item) {
  4918. //return this.currentItem >= this.nItems - 1
  4919. var end = this.currentItem && this.currentItem[0] >= this.nItems - 1;
  4920. if(end){
  4921. var heroLocations = this.model.heroLocations[this.nItems-1].heroLocations
  4922. if(heroLocations){
  4923. end = this.currentItem[1] >= heroLocations.length - 1
  4924. }
  4925. }
  4926. return end;
  4927. }
  4928. ,
  4929. t.prototype.firstDestination = function() {
  4930. //return 0 < this.nItems ? 0 : null
  4931. return 0 < this.nItems ? [0,0]: null
  4932. }
  4933. ,
  4934. t.prototype.finalDestination = function() {
  4935. //return 0 < this.nItems ? this.nItems - 1 : null
  4936. return 0 < this.nItems ? [this.nItems - 1,0]: null
  4937. }
  4938. ,
  4939. t.prototype.goPrev = function() {
  4940. this.tourAdvance(-1)
  4941. }
  4942. ,
  4943. t.prototype.goNext = function() {
  4944. this.tourAdvance(1)
  4945. }
  4946. ,
  4947. t.prototype.setDestinationItem = function(e) {
  4948. this.destinationItem = e,
  4949. this.emit("update.controls")
  4950. }
  4951. ,
  4952. t.prototype.setCurrentItem = function(e) {
  4953. this.currentItem = e,
  4954. this.emit("update.controls")
  4955. }
  4956. ,
  4957. t.prototype.nextItem = function(currentItem) {
  4958. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4959. if(currentItem == void 0)return this.firstDestination()
  4960. var currentLocation = this.model.heroLocations[currentItem[0]];
  4961. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  4962. var item;
  4963. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  4964. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  4965. }else{
  4966. item = [currentItem[0] , currentItem[1]+1]
  4967. }
  4968. if(item[0] >= this.nItems ){
  4969. item = this.firstDestination()
  4970. }
  4971. return item;
  4972. //暂时不理会endlessLoop,默认为false
  4973. }
  4974. ,
  4975. t.prototype.prevItem = function(currentItem) {
  4976. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4977. if(currentItem == void 0)return this.firstDestination()//finalDestination?
  4978. var item;
  4979. var lastLocation = this.model.heroLocations[currentItem[0]-1];
  4980. if(!lastLocation) return this.finalDestination()//[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  4981. else{
  4982. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  4983. if(this.currentItem[1] == 0){//子目录中第一个
  4984. return [currentItem[0] - 1, lastChildNum-1]
  4985. }else{
  4986. return [currentItem[0], currentItem[1]-1]
  4987. }
  4988. }
  4989. }
  4990. ,
  4991. t.prototype.tourAdvance = function(e) {//e是1或-1
  4992. m.debug("tourAdvance(" + e + ")")
  4993. if(null === this.currentItem || void 0 === this.currentItem){
  4994. this.setDestinationItem(this.firstDestination())
  4995. }else{
  4996. var item
  4997. if(e == 1){
  4998. item = this.nextItem(this.currentItem)
  4999. /* var currentLocation = this.model.heroLocations[this.currentItem[0]];
  5000. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  5001. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  5002. this.setDestinationItem([this.currentItem[0] + 1, 0]) //结果可能超出nItems
  5003. }else{
  5004. this.setDestinationItem([this.currentItem[0] , this.currentItem[1]+1])
  5005. } */
  5006. }else if(e == -1){
  5007. item = this.prevItem(this.currentItem)
  5008. /* var lastLocation = this.model.heroLocations[this.currentItem[0]-1];
  5009. if(!lastLocation) this.setDestinationItem([-1, 0]) //结果小于0
  5010. else{
  5011. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  5012. if(this.currentItem[1] == 0){//子目录中第一个
  5013. this.setDestinationItem([this.currentItem[0] - 1, lastChildNum-1])
  5014. }else{
  5015. this.setDestinationItem([this.currentItem[0], this.currentItem[1]-1])
  5016. }
  5017. } */
  5018. }
  5019. //this.setDestinationItem(this.currentItem + e)
  5020. this.setDestinationItem(item)
  5021. }
  5022. if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')[0] < 0 ){
  5023. this.useSpecialTransition("reverse-looping to end")
  5024. }else if(this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')){
  5025. this.useSpecialTransition("looping back to start")
  5026. }
  5027. /* if(this.destinationItem[0] < 0 ){
  5028. this.setDestinationItem(this.finalDestination())
  5029. this.useSpecialTransition("reverse-looping to end")
  5030. }else{
  5031. this.destinationItem[0] >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  5032. this.useSpecialTransition("looping back to start"))
  5033. } */
  5034. /* var momentTour = this.getMomentTour(this.destinationItem);
  5035. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  5036. var i = this.player.zoomLevel;
  5037. this.player.zoomEnabled = !0;
  5038. var t = function(e, t) {
  5039. this.player.zoomTo((1 - e) * i, !0)
  5040. }
  5041. .bind(this);
  5042. o.start(t, 1500, function() {}, 0, h.easeOutQuad, "zoom")
  5043. } */
  5044. this.goToDestination()
  5045. }
  5046. ,
  5047. t.prototype.getMomentTour = function(destinationItem) {//add
  5048. var wholeMomentTour = window.DATA.momentTour || "walk"; //最外层
  5049. if(!destinationItem) return wholeMomentTour
  5050. else{
  5051. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem)//最内层。 如果有使用最内层
  5052. if(currentLocation.momentTour)return currentLocation.momentTour;
  5053. var currentLocation_ = this.model.heroLocations[destinationItem[0]];
  5054. return currentLocation_.momentTour || wholeMomentTour; //若中间层或最内层有就使用,否则使用最外层
  5055. }
  5056. }
  5057. ,
  5058. I.exports = t
  5059. }
  5060. ).call(this, "/js/director.js")
  5061. }
  5062. , {
  5063. "./analytics": 4,
  5064. "./enum/BlackoutStyle": 18,
  5065. "./enum/ControlEvents": 21,
  5066. "./enum/DirectorEvents": 23,
  5067. "./enum/ModelManagerEvents": 33,
  5068. "./enum/PathDiscardMode": 38,
  5069. "./enum/PathDisplayMode": 39,
  5070. "./enum/PlayerEvents": 40,
  5071. "./enum/Viewmode": 51,
  5072. "./enum/WarpStyle": 52,
  5073. "./model/ModelManager": 140,
  5074. "./player": 155,
  5075. "./settings": 166,
  5076. "./util/logger": 189,
  5077. "./util/transitions": 195,
  5078. events: 202,
  5079. three: 217
  5080. }],
  5081. 16: [function(e, t, i) {
  5082. "use strict";
  5083. var n = e("three")
  5084. , r = e("./enum/Viewmode")
  5085. , o = (e("./settings"),
  5086. e("./util/transitions"))
  5087. , a = e("./enum/PlayerEvents")
  5088. , s = new n.ShaderPass(n.HorizontalBlurShader)
  5089. , l = new n.ShaderPass(n.VerticalBlurShader);
  5090. l.renderToScreen = !0;
  5091. var c = $("#player").width() / $("#player").height();
  5092. isNaN(c) && (c = 1);
  5093. var h = {
  5094. currentBlur: 0,
  5095. aspect: c,
  5096. blurStrength: 1,
  5097. hblurPass: s,
  5098. vblurPass: l,
  5099. bindEvents: function(e) {
  5100. e.on(a.ModeChanged, function(e, t) {
  5101. e === r.PANORAMA && (o.cancel(h.blur),
  5102. o.cancel(h.addBlur),
  5103. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  5104. })
  5105. },
  5106. blur: function(e) {
  5107. var t = (h.currentBlur = e) * h.blurStrength;
  5108. l.uniforms.v.value = t / 512 * h.aspect,
  5109. s.uniforms.h.value = t / 512
  5110. },
  5111. addBlur: function(e) {
  5112. e = Math.max(e, h.currentBlur),
  5113. h.blur(e)
  5114. },
  5115. removeBlur: function(e) {
  5116. e = Math.min(1 - e, h.currentBlur),
  5117. h.blur(e)
  5118. }
  5119. };
  5120. h.blur(0),
  5121. t.exports = h
  5122. }
  5123. , {
  5124. "./enum/PlayerEvents": 40,
  5125. "./enum/Viewmode": 51,
  5126. "./settings": 166,
  5127. "./util/transitions": 195,
  5128. three: 217
  5129. }],
  5130. 17: [function(e, t, i) {
  5131. "use strict";
  5132. t.exports = {
  5133. UNKNOWN: 0,
  5134. ALIGNED: 1,
  5135. UNALIGNED: 2,
  5136. PLACED: 3
  5137. }
  5138. }
  5139. , {}],
  5140. 18: [function(e, t, i) {
  5141. "use strict";
  5142. t.exports = {
  5143. NONE: 0,
  5144. MIDDLE: 1,
  5145. END: 2,
  5146. BEGINNING: 3,
  5147. FADEIN: 4
  5148. }
  5149. }
  5150. , {}],
  5151. 19: [function(e, t, i) {
  5152. "use strict";
  5153. var r = e("three");
  5154. t.exports = {
  5155. newBlue: new r.Color(4967932),
  5156. altBlue: new r.Color(47355),
  5157. tagDefault: new r.Color(223357),
  5158. classicBlue: new r.Color(53759),
  5159. mpYellow: new r.Color(16502016),
  5160. mpOrange: new r.Color(16428055),
  5161. mpBlue: new r.Color(12096),
  5162. mpLtGrey: new r.Color(13751252),
  5163. mpDkGrey: new r.Color(10000019),
  5164. mpRed: new r.Color(12525854),
  5165. mpOrangeDesat: new r.Color(16764529),
  5166. mpBlueDesat: new r.Color(4034734),
  5167. mpRedDesat: new r.Color(14705505),
  5168. white: new r.Color(16777215),
  5169. black: new r.Color(0),
  5170. _desat: function(e, t) {
  5171. var i = t || .3
  5172. , n = (new r.Color).copy(e).getHSL();
  5173. return (new r.Color).setHSL(n.h, n.s * (1 - i), n.l)
  5174. },
  5175. _darken: function(e, t) {
  5176. var i = t || .2
  5177. , n = e.getHSL();
  5178. return (new r.Color).setHSL(n.h, n.s, n.l * (1 - i))
  5179. }
  5180. }
  5181. }
  5182. , {
  5183. three: 217
  5184. }],
  5185. 20: [function(e, t, i) {
  5186. "use strict";
  5187. t.exports = {
  5188. NONE: -1,
  5189. ROTATE: 0,
  5190. DOLLY: 1,
  5191. PAN: 2,
  5192. ROTATE_DOLLY: 3,
  5193. PAN_DOLLY: 4
  5194. }
  5195. }
  5196. , {}],
  5197. 21: [function(e, t, i) {
  5198. "use strict";
  5199. t.exports = {
  5200. Move: "move",
  5201. InteractionDirect: "interaction.direct",
  5202. InteractionKey: "interaction.key",
  5203. InteractionGui: "interaction.gui",
  5204. FlyInDirection: "fly.direction",
  5205. InputStart: "input.start",
  5206. Pinch: "input.pinch",
  5207. Scroll: "input.scroll",
  5208. AutoPanInterrupt: "autopan.interrupt",
  5209. AutoPanComplete: "autopan.complete",
  5210. AutoPanClamped: "autopan.clamped",
  5211. LongTap: "longtap"
  5212. }
  5213. }
  5214. , {}],
  5215. 22: [function(e, t, i) {
  5216. "use strict";
  5217. t.exports = Object.freeze({
  5218. FORWARD: "FORWARD",
  5219. LEFT: "LEFT",
  5220. RIGHT: "RIGHT",
  5221. BACK: "BACK",
  5222. UP: "UP",
  5223. DOWN: "DOWN"
  5224. })
  5225. }
  5226. , {}],
  5227. 23: [function(e, t, i) {
  5228. "use strict";
  5229. t.exports = {
  5230. ActionInterrupted: "action.interrupted",
  5231. TourStart: "tour.start",
  5232. TourEnd: "tour.end",
  5233. StartModeChange: "mode.startChange"
  5234. }
  5235. }
  5236. , {}],
  5237. 24: [function(e, t, i) {
  5238. "use strict";
  5239. t.exports = Object.freeze({
  5240. None: 0,
  5241. Queued: 1,
  5242. ForceQueued: 2,
  5243. Downloading: 3,
  5244. Downloaded: 4,
  5245. DownloadFailed: 5
  5246. })
  5247. }
  5248. , {}],
  5249. 25: [function(e, t, i) {
  5250. "use strict";
  5251. t.exports = {
  5252. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5253. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5254. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5255. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5256. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5257. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5258. }
  5259. }
  5260. , {}],
  5261. 26: [function(e, t, i) {
  5262. "use strict";
  5263. t.exports = {
  5264. Texture2D: 0,
  5265. TextureCube: 1
  5266. }
  5267. }
  5268. , {}],
  5269. 27: [function(e, t, i) {
  5270. "use strict";
  5271. t.exports = {
  5272. SMALL: "small",
  5273. LARGE: "large"
  5274. }
  5275. }
  5276. , {}],
  5277. 28: [function(e, t, i) {
  5278. "use strict";
  5279. var n = e("./Viewmode")
  5280. , r = {
  5281. LANDING: {},
  5282. NAVIGATION: "navigation",
  5283. MORE_HELP: "moreHelp",
  5284. TOUR_INTERACTION: {}
  5285. };
  5286. r.LANDING[n.PANORAMA] = "panorama.landing",
  5287. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5288. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5289. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5290. r.TOUR_INTERACTION.standard = "standard.tour",
  5291. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5292. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5293. t.exports = r
  5294. }
  5295. , {
  5296. "./Viewmode": 51
  5297. }],
  5298. 29: [function(e, t, i) {
  5299. "use strict";
  5300. var n = {
  5301. UP: 1,
  5302. DOWN: -1,
  5303. LEFT: "L",
  5304. RIGHT: "R",
  5305. FORWARD: "F",
  5306. BACK: "B",
  5307. reverse: {},
  5308. opposite: function(e) {
  5309. return this.reverse[e.toString()]
  5310. }
  5311. };
  5312. n.reverse[n.UP] = n.DOWN,
  5313. n.reverse[n.DOWN] = n.UP,
  5314. n.reverse[n.LEFT] = n.RIGHT,
  5315. n.reverse[n.RIGHT] = n.LEFT,
  5316. n.reverse[n.FORWARD] = n.BACK,
  5317. n.reverse[n.BACK] = n.FORWARD,
  5318. t.exports = n
  5319. }
  5320. , {}],
  5321. 30: [function(e, t, i) {
  5322. "use strict";
  5323. var n = {
  5324. ZERO: 48,
  5325. ONE: 49,
  5326. TWO: 50,
  5327. THREE: 51,
  5328. FOUR: 52,
  5329. FIVE: 53,
  5330. SIX: 54,
  5331. SEVEN: 55,
  5332. EIGHT: 56,
  5333. NINE: 57,
  5334. LEFTARROW: 37,
  5335. UPARROW: 38,
  5336. RIGHTARROW: 39,
  5337. DOWNARROW: 40,
  5338. A: 65,
  5339. B: 66,
  5340. C: 67,
  5341. D: 68,
  5342. E: 69,
  5343. F: 70,
  5344. G: 71,
  5345. H: 72,
  5346. I: 73,
  5347. J: 74,
  5348. K: 75,
  5349. L: 76,
  5350. M: 77,
  5351. N: 78,
  5352. O: 79,
  5353. P: 80,
  5354. Q: 81,
  5355. R: 82,
  5356. S: 83,
  5357. T: 84,
  5358. U: 85,
  5359. V: 86,
  5360. W: 87,
  5361. X: 88,
  5362. Y: 89,
  5363. Z: 90,
  5364. SPACE: 32,
  5365. RETURN: 13,
  5366. SEMICOLON: 186,
  5367. PLUSEQUALS: 187,
  5368. DASHUNDERSCORE: 189,
  5369. OPENBRACKET: 219
  5370. };
  5371. e("../util/browser").detectFirefox() && (n.SEMICOLON = 59,
  5372. n.PLUSEQUALS = 61,
  5373. n.DASHUNDERSCORE = 173),
  5374. t.exports = n
  5375. }
  5376. , {
  5377. "../util/browser": 182
  5378. }],
  5379. 31: [function(e, t, i) {
  5380. "use strict";
  5381. t.exports = {
  5382. EN_US: "en-US",
  5383. ES_MX: "es-MX",
  5384. FR_FR: "fr-FR",
  5385. DE_DE: "de-DE",
  5386. RU_RU: "ru-RU",
  5387. CN_CN: "cn-CN",
  5388. JP_JP: "jp-JP"
  5389. }
  5390. }
  5391. , {}],
  5392. 32: [function(e, t, i) {
  5393. "use strict";
  5394. t.exports = {
  5395. TagActivated: "tag.activated",
  5396. TagDismissed: "tag.dismissed",
  5397. TagNavigation: "tag.navigation"
  5398. }
  5399. }
  5400. , {}],
  5401. 33: [function(e, t, i) {
  5402. "use strict";
  5403. t.exports = {
  5404. ModelAdded: "model-added",
  5405. ActiveModelChanged: "active-model-changed"
  5406. }
  5407. }
  5408. , {}],
  5409. 34: [function(e, t, i) {
  5410. "use strict";
  5411. t.exports = {
  5412. LEFT: 0,
  5413. MIDDLE: 1,
  5414. RIGHT: 2
  5415. }
  5416. }
  5417. , {}],
  5418. 35: [function(e, t, i) {
  5419. "use strict";
  5420. t.exports = {
  5421. PanoRenderComplete: "panorama.render.complete",
  5422. TileRenderFailure: "panorama.tile.render.failed",
  5423. TileRenderSuccess: "panorama.tile.render.success",
  5424. TileUploadAttempted: "panorama.tile.upload.attempted",
  5425. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5426. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5427. }
  5428. }
  5429. , {}],
  5430. 36: [function(e, t, i) {
  5431. "use strict";
  5432. t.exports = {
  5433. BASE: 1,
  5434. STANDARD: 2,
  5435. HIGH: 3,
  5436. ULTRAHIGH: 4
  5437. }
  5438. }
  5439. , {}],
  5440. 37: [function(e, t, i) {
  5441. "use strict";
  5442. t.exports = {
  5443. LoadComplete: "panorama.load.complete",
  5444. LoadFailed: "panorama.load.failed",
  5445. TileLoaded: "panorama.tile.loaded"
  5446. }
  5447. }
  5448. , {}],
  5449. 38: [function(e, t, i) {
  5450. "use strict";
  5451. t.exports = Object.freeze({
  5452. Standard: 0,
  5453. Slow: 1,
  5454. Retain: 2
  5455. })
  5456. }
  5457. , {}],
  5458. 39: [function(e, t, i) {
  5459. "use strict";
  5460. t.exports = Object.freeze({
  5461. Show: 0,
  5462. Hide: 1,
  5463. Retain: 2
  5464. })
  5465. }
  5466. , {}],
  5467. 40: [function(e, t, i) {
  5468. "use strict";
  5469. t.exports = {
  5470. Move: "move",
  5471. MoveComplete: "move.complete",
  5472. ModeChanged: "mode.changed",
  5473. ModeChanging: "mode.changing",
  5474. PanoChosen: "pano.chosen",
  5475. ClosestPanoChanging: "closest.pano.changing",
  5476. WarpStarted: "warp.started",
  5477. WarpInterrupted: "warp.interrupted",
  5478. WarpEnded: "warp.ended",
  5479. FlyinFinished: "flyin.finished",
  5480. FlyingStarted: "flying.started",
  5481. FlyingInterrupted: "flying.interrupted",
  5482. FlyingEnded: "flying.ended",
  5483. Ready: "ready",
  5484. StartInside: "start.inside",
  5485. StartOutside: "start.outside",
  5486. ViewChanged: "view.changed",
  5487. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5488. InputStart: "input.start"
  5489. }
  5490. }
  5491. , {}],
  5492. 41: [function(e, t, i) {
  5493. "use strict";
  5494. t.exports = Object.freeze({
  5495. DEFAULT: 0,
  5496. PANOMARKERS: 1,
  5497. RETICULE: 2,
  5498. TAG: 3
  5499. })
  5500. }
  5501. , {}],
  5502. 42: [function(e, t, i) {
  5503. "use strict";
  5504. t.exports = {
  5505. visibleFloor: 1,
  5506. ghostFloor: 3,
  5507. boundingSkybox: 1,
  5508. panoMarker: 2,
  5509. reticule: 3,
  5510. tagStem: 4,
  5511. tagDisc: 5,
  5512. ribbon: 100
  5513. }
  5514. }
  5515. , {}],
  5516. 43: [function(e, t, i) {
  5517. "use strict";
  5518. t.exports = {
  5519. ContextCreated: "scene-renderer-context-created",
  5520. AfterRender: "after-render",
  5521. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5522. }
  5523. }
  5524. , {}],
  5525. 44: [function(e, t, i) {
  5526. "use strict";
  5527. t.exports = {
  5528. IDLE: "idle",
  5529. BROWSE: "browse",
  5530. EXAMINE: "examine"
  5531. }
  5532. }
  5533. , {}],
  5534. 45: [function(e, t, i) {
  5535. "use strict";
  5536. t.exports = {
  5537. TileDownloadSuccess: "tiledownloader.download.success",
  5538. TileDownloadFailure: "tiledownloader.download.failure",
  5539. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5540. }
  5541. }
  5542. , {}],
  5543. 46: [function(e, t, i) {
  5544. "use strict";
  5545. t.exports = {
  5546. CardboardAndroid: "googlevr",
  5547. GearVR: "gearvr",
  5548. CardboardIOS: "googlevrios",
  5549. Cardboard: "googlevr"
  5550. }
  5551. }
  5552. , {}],
  5553. 47: [function(e, t, i) {
  5554. "use strict";
  5555. t.exports = {
  5556. NONE: 0,
  5557. CONTEXTUAL: 1,
  5558. ANDROID: 2
  5559. }
  5560. }
  5561. , {}],
  5562. 48: [function(e, t, i) {
  5563. "use strict";
  5564. var n = {
  5565. Title: 0,
  5566. Cardboard: 1
  5567. }
  5568. , r = {
  5569. Title: 0,
  5570. Cardboard: 1,
  5571. Gear: 2
  5572. };
  5573. [n, r].forEach(function(e) {
  5574. e.pageCount = Object.keys(e).length
  5575. }),
  5576. t.exports.ios = n,
  5577. t.exports.standard = r
  5578. }
  5579. , {}],
  5580. 49: [function(e, t, i) {
  5581. "use strict";
  5582. t.exports = {
  5583. Android: "android",
  5584. IOS: "ios",
  5585. Desktop: "desktop",
  5586. UnsupportedAndroid: "android-unsupported"
  5587. }
  5588. }
  5589. , {}],
  5590. 50: [function(e, t, i) {
  5591. "use strict";
  5592. var n = e("three");
  5593. t.exports = {
  5594. UP: new n.Vector3(0,1,0),
  5595. DOWN: new n.Vector3(0,-1,0),
  5596. LEFT: new n.Vector3(-1,0,0),
  5597. RIGHT: new n.Vector3(1,0,0),
  5598. FORWARD: new n.Vector3(0,0,-1),
  5599. BACK: new n.Vector3(0,0,1)
  5600. }
  5601. }
  5602. , {
  5603. three: 217
  5604. }],
  5605. 51: [function(e, t, i) {
  5606. "use strict";
  5607. var n = e("../exception/ViewmodeConvertException")
  5608. , r = e("./coreViewmodes")
  5609. , o = {
  5610. MESH: "mesh",
  5611. OUTDOOR: "outdoor",
  5612. TRANSITIONING: "transitioning",
  5613. toInt: function(e) {
  5614. switch (e) {
  5615. case this.PANORAMA:
  5616. return 1;
  5617. case this.DOLLHOUSE:
  5618. return 2;
  5619. case this.FLOORPLAN:
  5620. return 3;
  5621. case this.OUTDOOR:
  5622. return 4;
  5623. case this.TRANSITIONING:
  5624. return -1
  5625. }
  5626. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5627. },
  5628. fromInt: function(e) {
  5629. switch (e) {
  5630. case "1":
  5631. case 1:
  5632. return this.PANORAMA;
  5633. case "2":
  5634. case 2:
  5635. return this.DOLLHOUSE;
  5636. case "3":
  5637. case 3:
  5638. return this.FLOORPLAN;
  5639. case "4":
  5640. case 4:
  5641. return this.OUTDOOR
  5642. }
  5643. throw new n("No known conversion for int to viewmode for int: " + e)
  5644. },
  5645. convertWorkshopModeInt: function(e) {
  5646. switch (e) {
  5647. case "0":
  5648. case 0:
  5649. case void 0:
  5650. return this.PANORAMA;
  5651. case "1":
  5652. case 1:
  5653. return this.FLOORPLAN;
  5654. case "2":
  5655. case 2:
  5656. return this.DOLLHOUSE;
  5657. case "3":
  5658. case 3:
  5659. return this.MESH
  5660. }
  5661. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5662. }
  5663. };
  5664. e("../util/common").extendObject(o, r),
  5665. t.exports = o
  5666. }
  5667. , {
  5668. "../exception/ViewmodeConvertException": 58,
  5669. "../util/common": 185,
  5670. "./coreViewmodes": 54
  5671. }],
  5672. 52: [function(e, t, i) {
  5673. "use strict";
  5674. t.exports = {
  5675. BLACK: "black",
  5676. STD: "std",
  5677. WALK: "walk"
  5678. }
  5679. }
  5680. , {}],
  5681. 53: [function(e, t, i) {
  5682. "use strict";
  5683. t.exports = {
  5684. ZoomIn: "zoom.in",
  5685. ZoomOut: "zoom.out",
  5686. ZoomMax: "zoom.max",
  5687. ZoomMin: "zoom.min"
  5688. }
  5689. }
  5690. , {}],
  5691. 54: [function(e, t, i) {
  5692. "use strict";
  5693. t.exports = {
  5694. PANORAMA: "panorama",
  5695. DOLLHOUSE: "dollhouse",
  5696. FLOORPLAN: "floorplan"
  5697. }
  5698. }
  5699. , {}],
  5700. 55: [function(e, t, i) {
  5701. "use strict";
  5702. t.exports = function(e) {
  5703. this.message = e
  5704. }
  5705. }
  5706. , {}],
  5707. 56: [function(e, t, i) {
  5708. "use strict";
  5709. function n(e) {
  5710. r.call(this, e)
  5711. }
  5712. var r = e("./BasicException");
  5713. n.prototype = Object.create(r.prototype),
  5714. t.exports = n
  5715. }
  5716. , {
  5717. "./BasicException": 55
  5718. }],
  5719. 57: [function(e, t, i) {
  5720. "use strict";
  5721. function n(e) {
  5722. r.call(this, e)
  5723. }
  5724. var r = e("./BasicException");
  5725. n.prototype = Object.create(r.prototype),
  5726. t.exports = n
  5727. }
  5728. , {
  5729. "./BasicException": 55
  5730. }],
  5731. 58: [function(e, t, i) {
  5732. "use strict";
  5733. function n(e) {
  5734. r.call(this, e)
  5735. }
  5736. var r = e("./BasicException");
  5737. n.prototype = Object.create(r.prototype),
  5738. t.exports = n
  5739. }
  5740. , {
  5741. "./BasicException": 55
  5742. }],
  5743. 59: [function(a, s, e) {
  5744. (function(e) {
  5745. "use strict";
  5746. var i = a("./util/ajax")
  5747. , n = a("./util/showcase")
  5748. , t = a("./util/logger")
  5749. , r = new t(e)
  5750. , o = {};
  5751. s.exports = {
  5752. loadFeatureFlags: function(e) {
  5753. var t = $.Deferred();
  5754. return i.get(e.urlBase + "", {
  5755. responseType: "json",
  5756. prefetchFrom: "user",
  5757. auth: n.getAuthorizationHeader()
  5758. }).done(function(e) {
  5759. (o = function(e) {
  5760. var t = {};
  5761. if (e) {
  5762. var i = e.flags;
  5763. if (i)
  5764. for (var n in i)
  5765. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5766. return t
  5767. }
  5768. return r.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5769. null
  5770. }(e)) ? t.resolve(o) : t.reject("loading-failed")
  5771. }).fail(function() {
  5772. r.debug("Retrieval of feature flags failed."),
  5773. t.reject("loading-failed")
  5774. }),
  5775. t.promise()
  5776. },
  5777. getFlags: function() {
  5778. return o
  5779. },
  5780. updateDependentSettings: function(e, t) {
  5781. (e = e || o).labels && (t.labels.enabled = !0),
  5782. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5783. e.showcase_sdk && (t.sdkInit = !0),
  5784. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5785. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5786. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5787. e.hide_sc_sharing && (t.share.enabled = !1)
  5788. }
  5789. }
  5790. }
  5791. ).call(this, "/js/featureflags.js")
  5792. }
  5793. , {
  5794. "./util/ajax": 181,
  5795. "./util/logger": 189,
  5796. "./util/showcase": 193
  5797. }],
  5798. 60: [function(e, t, i) {
  5799. "use strict";
  5800. var n = (e("../util/common"),
  5801. {
  5802. status: 0,
  5803. set: function(e) {
  5804. if (isNaN(e))
  5805. return !1;
  5806. var t = $(".progressbar");
  5807. e < 0 && (e = 0),
  5808. 100 < e && (e = 100);
  5809. var i = e * (parseInt(t.css("width").replace("px", "")) / 100)
  5810. , n = Math.round(e)
  5811. , r = parseInt(i) - 15;
  5812. t.find(".bar").css("width", i),
  5813. t.find(".label").css("left", r),
  5814. t.find(".perc").text(n + "%"),
  5815. this.status = e
  5816. },
  5817. done: function(e) {
  5818. return e || this.status ? (this.status = null,
  5819. this.set(100)) : this
  5820. }
  5821. });
  5822. t.exports.circleLoader = n
  5823. }
  5824. , {
  5825. "../util/common": 185
  5826. }],
  5827. 61: [function(e, t, i) {
  5828. "use strict";
  5829. t.exports = Object.freeze({
  5830. CLOSE: "modal.closer.close"
  5831. })
  5832. }
  5833. , {}],
  5834. 62: [function(e, t, i) {
  5835. "use strict";
  5836. function n(t, e) {
  5837. function i() {
  5838. var e = t.offsetHeight >= $("#player").height() && t.offsetWidth >= $("#player").width();
  5839. e !== p && ((p = e) ? (t.classList.add("closeByFooter"),
  5840. c.classList.add("closeByFooter")) : (t.classList.remove("closeByFooter"),
  5841. c.classList.remove("closeByFooter")))
  5842. }
  5843. e ? setTimeout(i, r.guiAnimationSpeed) : i()
  5844. }
  5845. var r = e("../../settings")
  5846. , o = (e("../../tag/Media/MediaEvent"),
  5847. e("../../util/browser"))
  5848. , a = e("../../util/common")
  5849. , s = e("./ModalCloserEvent")
  5850. , l = e("events").EventEmitter
  5851. , c = document.getElementsByClassName("footer")[0]
  5852. , h = c.querySelectorAll(".close")[0]
  5853. , u = null
  5854. , d = null
  5855. , p = null
  5856. , f = (o.isMobile(),
  5857. {
  5858. open: function(e) {
  5859. e && (n(e),
  5860. u && h.removeEventListener("click", u, !0),
  5861. u = function(e, t) {
  5862. t && (t.stopPropagation(),
  5863. t.preventDefault()),
  5864. e && this.emit(s.CLOSE, e),
  5865. f.reset()
  5866. }
  5867. .bind(this, e.id),
  5868. h.addEventListener("click", u, !0),
  5869. d && window.removeEventListener("resize", d, !0),
  5870. d = n.bind(this, e),
  5871. window.addEventListener("resize", d, !0))
  5872. },
  5873. reset: function() {
  5874. c.classList.remove("closeByFooter"),
  5875. h.removeEventListener("click", u, !0),
  5876. window.removeEventListener("resize", d, !0),
  5877. u = d = p = null
  5878. }
  5879. });
  5880. a.extendObject(f, l.prototype),
  5881. t.exports = f
  5882. }
  5883. , {
  5884. "../../tag/Media/MediaEvent": 131,
  5885. "../../settings": 166,
  5886. "../../util/browser": 182,
  5887. "../../util/common": 185,
  5888. "./ModalCloserEvent": 61,
  5889. events: 202
  5890. }],
  5891. 63: [function(e, t, i) {
  5892. "use strict";
  5893. var A = e("../lib/dat.gui")
  5894. , C = e("three")
  5895. , I = e("../util/easing")
  5896. , E = e("../enum/Viewmode")
  5897. , _ = e("../enum/Colors")
  5898. , b = e("../enum/WarpStyle")
  5899. , w = e("../settings");
  5900. e("../tag/tag"),
  5901. A.GUI.prototype.removeFolder = function(e) {
  5902. var t = this.__folders[e];
  5903. t && (t.close(),
  5904. this.__ul.removeChild(t.domElement.parentNode),
  5905. delete this.__folders[e],
  5906. this.onResize())
  5907. }
  5908. ,
  5909. t.exports.toggle = function(t, e, i) {
  5910. var n = new A.GUI({
  5911. width: 400
  5912. })
  5913. , r = n.addFolder("Flydown from Dollhouse");
  5914. r.add(w.flydown, "movementEasing", Object.keys(I)),
  5915. r.add(w.flydown, "movementDelay", 0, 1).step(.01),
  5916. r.add(w.flydown, "rotationEasing", Object.keys(I)),
  5917. r.add(w.flydown, "rotationDelay", 0, 1).step(.01),
  5918. r.add(w.flydown, "modelTextureDelay", 0, 1).step(.01),
  5919. r.add(w.flydown, "skyboxDelay", 0, 1).step(.01),
  5920. r.add(w.dollhouseDefault, "minPolarAngle", 0, C.Math.degToRad(50)),
  5921. r.add(w.dollhouseDefault, "maxPolarAngle", C.Math.degToRad(50), C.Math.degToRad(170));
  5922. var o = n.addFolder("Transition between panos");
  5923. o.add(w.transition, "blur", 0, 10).onFinishChange(function() {}),
  5924. o.add(w.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5925. w.transition.flyTime = 0,
  5926. o.__controllers.forEach(function(e) {
  5927. e.updateDisplay()
  5928. })
  5929. }),
  5930. o.add(w.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5931. w.transition.flySpeed = 0,
  5932. o.__controllers.forEach(function(e) {
  5933. e.updateDisplay()
  5934. })
  5935. }),
  5936. o.add(w.transition, "aimTime", 500, 2500).step(50),
  5937. o.add(w.transition, "aimSlowFactor", 1, 3).step(.1),
  5938. o.add(w.transition, "movementEasing", Object.keys(I));
  5939. var a = n.addFolder("Path Display");
  5940. a.add(w.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5941. a.add(w.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5942. a.add(w.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5943. a.add(w.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5944. a.add(w.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5945. a.add(w.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5946. a.add(w.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5947. a.add(w.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5948. a.add(w.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5949. a.add(w.path, "color", Object.keys(_)).onFinishChange(function() {
  5950. w.path.color = _[w.path.color],
  5951. w.path.colorUp = _._desat(w.path.color),
  5952. w.path.colorDown = _.darken(w.path.color)
  5953. }),
  5954. a.add(w, "reticuleColor", Object.keys(_)).onFinishChange(function() {
  5955. w.reticuleColor = _[w.reticuleColor]
  5956. });
  5957. var s = n.addFolder("Warping")
  5958. , l = s.addFolder("Warp/Teleport");
  5959. l.add(w.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5960. l.add(w.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5961. l.add(w.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5962. l.add(w.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5963. l.add(w.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5964. l.add(w.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5965. l.add(w.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5966. l.add(w.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5967. l.add(w.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5968. l.add(w.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5969. l.add(w.path, "mapGuides").onFinishChange(function() {}),
  5970. l.add(w.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5971. l.add(w.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5972. l.add(w.path, "typ", Object.keys(b)).onFinishChange(function() {
  5973. w.path.typ = b[w.path.typ]
  5974. }),
  5975. l.add(w.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5976. e.endlessLoop = w.warp.loop
  5977. }),
  5978. l.add(w.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5979. l.add(w.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5980. l.add(w.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5981. var c = s.addFolder("Long Warp Only");
  5982. c.add(w.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5983. w.warp.flySpeed = 0,
  5984. c.__controllers.forEach(function(e) {
  5985. e.updateDisplay()
  5986. })
  5987. }),
  5988. c.add(w.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5989. c.add(w.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5990. c.add(w.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5991. c.add(w.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5992. c.add(w.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5993. c.add(w.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5994. c.add(w.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5995. c.add(w.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5996. c.add(w.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5997. var h = n.addFolder("Warp Esoterica");
  5998. h.add(w.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5999. h.add(w.warp, "blur", .01, 1).onFinishChange(function() {}),
  6000. h.add(w.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  6001. w.warp.minWarpTime = 0,
  6002. h.__controllers.forEach(function(e) {
  6003. e.updateDisplay()
  6004. })
  6005. }),
  6006. h.add(w.warp, "showBunny").onFinishChange(function() {}),
  6007. h.add(w.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  6008. h.add(w.warp, "movementEasing", Object.keys(I));
  6009. var u = n.addFolder("Misc");
  6010. u.add(w, "dollhouseFOV", 10, 180).onChange(function() {
  6011. i.cameras[E.DOLLHOUSE].fov = w.dollhouseFOV
  6012. }),
  6013. u.add(w, "insideFOV", 10, 180).onChange(function() {
  6014. i.cameras[E.PANORAMA].fov = w.insideFOV
  6015. }),
  6016. u.add(w, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  6017. u.add(w, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  6018. u.add(w, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  6019. var d = n.addFolder("Navigation");
  6020. d.add(w.navigation, "panoScores").onFinishChange(function() {
  6021. w.navigation.panoScores || t.panos.forEach(function(e) {
  6022. e.floor.remove(e.text3d),
  6023. e.text3d = null
  6024. })
  6025. }),
  6026. d.add(w.navigation, "mouseDirection"),
  6027. d.add(w.navigation, "filterStrictness", 0, 1),
  6028. d.add(w.navigation, "angleFactor", -60, 0),
  6029. d.add(w.navigation, "directionFactor", 1, 20),
  6030. d.add(w.navigation, "distanceFactor", -5, 5),
  6031. d.add(w.navigation, "optionalityFactor", .1, 10);
  6032. var p = n.addFolder("tags")
  6033. , f = p.addFolder("Tag Creation");
  6034. f.add(w.tags.pole, "enabled").name("poleEnabled"),
  6035. f.add(w.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  6036. f.add(w.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  6037. f.add(w.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  6038. var g = p.addFolder("Visibility");
  6039. g.add(w.tags.visibility, "anyDistance"),
  6040. g.add(w.tags.visibility, "visibleDistance", .1, 30).step(.1),
  6041. g.add(w.tags.visibility, "cameraClearance", 0, 1).step(.01),
  6042. g.add(w.tags.visibility, "hideViaFloor"),
  6043. g.add(w.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  6044. g.add(w.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  6045. var m = p.addFolder("Disc Parameters");
  6046. m.add(w.tags.disc.scale, "nearBound", .1, 10).step(.1),
  6047. m.add(w.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  6048. m.add(w.tags.disc.scale, "linkFarBound").onChange(function(e) {
  6049. e && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - w.tags.disc.scale.linkPercent / 100))
  6050. }),
  6051. m.add(w.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  6052. w.tags.disc.scale.linkFarBound && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - e / 100))
  6053. }),
  6054. m.add(w.tags.disc.scale, "maxSize", 40, 200).step(1),
  6055. m.add(w.tags.disc.scale, "minSize", 20, 100).step(1),
  6056. m.add(w.tags.disc.scale, "responsiveness", 0, 100).step(1);
  6057. var v = p.addFolder("Navigate");
  6058. v.add(w.tags.navigate, "nearestPano").name("nearestPano"),
  6059. v.add(w.tags.navigate, "lineOfSight").name("lineOfSight"),
  6060. v.add(w.tags.navigate, "reactivate").name("reactivate"),
  6061. v.add(w.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  6062. v.add(w.tags.navigate, "tiltTolerance", 0, 50).step(1),
  6063. v.add(w.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  6064. var y = n.addFolder("Debug");
  6065. y.add(w, "wireframe").onFinishChange(function() {
  6066. t.chunks.forEach(function(e) {
  6067. e.material && (e.wireframeTwin || (e.wireframeTwin = new C.WireframeHelper(e),
  6068. e.wireframeTwin.material.depthWrite = !1,
  6069. e.wireframeTwin.material.depthTest = !1,
  6070. e.wireframeTwin.material.opacity = .5,
  6071. e.wireframeTwin.material.transparent = !0),
  6072. w.wireframe ? t.add(e.wireframeTwin) : t.remove(e.wireframeTwin))
  6073. })
  6074. }),
  6075. y.add(w, "skyboxWireframe").onFinishChange(function() {
  6076. w.skyboxWireframe ? (t.skybox.wireframe = new C.WireframeHelper(t.skybox),
  6077. t.add(t.skybox.wireframe)) : (t.remove(t.skybox.wireframe),
  6078. t.skybox.wireframe = null)
  6079. }),
  6080. y.add(w, "showSweeps").onFinishChange(function() {
  6081. t.setSweepVisibility(w.showSweeps)
  6082. }),
  6083. y.add(w, "showMesh").onFinishChange(function() {
  6084. t.chunks.forEach(function(e) {
  6085. e.visible = w.showMesh
  6086. })
  6087. }),
  6088. y.add(w, "showFloors").onFinishChange(function() {
  6089. t.floors.forEach(function(e) {
  6090. e.collider.children.forEach(function(e) {
  6091. e.material.visible = w.showFloors
  6092. })
  6093. })
  6094. }),
  6095. y.add(w, "showSkyboxes").onFinishChange(function() {
  6096. t.panos.forEach(function(e) {
  6097. e.skyboxMesh.visible = w.showSkyboxes
  6098. })
  6099. }),
  6100. y.add(w, "showNeighbors").onChange(function() {}),
  6101. y.add(t, "alpha", 0, 1)
  6102. }
  6103. }
  6104. , {
  6105. "../enum/Colors": 19,
  6106. "../enum/Viewmode": 51,
  6107. "../enum/WarpStyle": 52,
  6108. "../lib/dat.gui": 93,
  6109. "../tag/tag": 123,
  6110. "../settings": 166,
  6111. "../util/easing": 186,
  6112. three: 217
  6113. }],
  6114. 64: [function(c, h, e) {
  6115. (function(e) {
  6116. "use strict";
  6117. function i(e, t, i, n) {
  6118. $(".gui-error .error-problem-text").text(e),
  6119. $(".gui-error .error-solution-text").text(t),
  6120. $(".gui-error .error-explanation").text(i),
  6121. $(".gui-error .error-actions").html(n),
  6122. $(window).resize(),
  6123. $(".gui-error").fadeIn(),
  6124. $("#bottom-logo").fadeIn()
  6125. }
  6126. function n(e) {
  6127. 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("");
  6128. i(e, s.ERROR_BROWSER_SOLUTION, s.ERROR_BROWSER_EXPLANATION, t),
  6129. r.isMobile() || $("[rel=tiletip]").tooltip({
  6130. placement: "bottom",
  6131. delay: {
  6132. show: 50,
  6133. hide: 0
  6134. },
  6135. trigger: "hover",
  6136. viewport: {
  6137. selector: "body",
  6138. padding: 10
  6139. }
  6140. })
  6141. }
  6142. function t() {
  6143. var e = r.isMobile() ? "" : '<span class="link install-browser">' + s.ERROR_GENERIC_ACTIONS_2 + "</span>" + s.ERROR_GENERIC_ACTIONS_3
  6144. , t = [s.ERROR_GENERIC_ACTIONS_1, e].join("");
  6145. i(s.ERROR_GENERIC_PROBLEM, s.ERROR_GENERIC_SOLUTION, "", t),
  6146. r.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  6147. e.preventDefault(),
  6148. e.stopPropagation(),
  6149. n(" ")
  6150. })
  6151. }
  6152. var r = c("./../util/browser")
  6153. , o = c("./../analytics")
  6154. , a = c("./../settings")
  6155. , s = c("../localization/localize")
  6156. , l = new (c("./../util/logger"))(e);
  6157. h.exports.error = function(e) {
  6158. if ($("head title").text(a.pageTitle),
  6159. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  6160. $("#gui-loading").fadeOut(250),
  6161. $("#quick-blackout").hide(),
  6162. o.track("showcase_error", {
  6163. error_key: e
  6164. }),
  6165. s.locale || s.init(),
  6166. "webgl-unsupported" === e)
  6167. r.isMobile() ? t() : n(s.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6168. else if ("webgl-ios" === e)
  6169. 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>.");
  6170. else if ("webgl-safari" === e)
  6171. 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>.");
  6172. else if ("webgl-generic" === e)
  6173. t();
  6174. else if ("missing-urls" === e)
  6175. i(s.ERROR_MISSING_URLS_PROBLEM, "", s.ERROR_MISSING_URLS_EXPLANATION);
  6176. else if ("loading-failed" === e)
  6177. 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>.");
  6178. else {
  6179. if ("loading-failed-maintenance" !== e)
  6180. return void l.error("Unhandled error: " + e);
  6181. i(s.ERROR_MAINTENANCE_PROBLEM, s.ERROR_MAINTENANCE_SOLUTION)
  6182. }
  6183. }
  6184. }
  6185. ).call(this, "/js/gui/error.js")
  6186. }
  6187. , {
  6188. "../localization/localize": 108,
  6189. "./../analytics": 4,
  6190. "./../settings": 166,
  6191. "./../util/browser": 182,
  6192. "./../util/logger": 189
  6193. }],
  6194. 65: [function(Oe, Le, e) {
  6195. (function(e) {
  6196. "use strict";
  6197. function c() {
  6198. for (var e in Ce)
  6199. if (Ce.hasOwnProperty(e)) {
  6200. var t = Ce[e];
  6201. if (!t.visible)
  6202. for (var i = 0; i < t.elements.length; i++)
  6203. $(t.elements[i]).hide()
  6204. }
  6205. Ce.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6206. !1 === Ce.tourControls.visible && $("#drawer").addClass("fullWidth"),
  6207. ge = [],
  6208. Ce.floors.visible && ge.push(".gui-floor", ".gui-floor-title"),
  6209. ge.push(".hideTarget", ".pinTop.right")
  6210. }
  6211. function v(e, t) {
  6212. var i = !S.isMobile() && M.zoom.enabled && t.mode === ie.PANORAMA && !e.tourIsPlaying;
  6213. $("#gui-zoomin").toggle(i),
  6214. $("#gui-zoomout").toggle(i)
  6215. }
  6216. function l() {
  6217. n(),
  6218. $(".pinBottom").toggleClass("open"),
  6219. $("#drawer").toggleClass("open"),
  6220. $(".footer").toggleClass("open"),
  6221. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", se.CLOSE_HIGHLIGHTS),
  6222. _e("highlights")) : ($("#pullTab .icon").attr("data-original-title", se.OPEN_HIGHLIGHTS),
  6223. O.resetDrawer()),
  6224. setTimeout(function() {
  6225. $("#pullTab").toggleClass("opened")
  6226. }, $("#drawer").hasClass("open") ? 0 : M.highlightAnimationDuration),
  6227. $(".pinBottom").hasClass("open") && t($(".vr-popup")) && $(".vr-popup").is(":visible") && X.dismiss()
  6228. }
  6229. function t(e) {
  6230. var t;
  6231. return "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6232. t = e.position().top + e.outerHeight(),
  6233. e.attr("style", "display: none")),
  6234. $("#player").outerHeight() - 130 < t + 25
  6235. }
  6236. function y(e) {
  6237. "touchstart" === e.type && e.preventDefault(),
  6238. e.stopPropagation()
  6239. }
  6240. function n() {
  6241. w && (w.reload(),
  6242. w.init())
  6243. }
  6244. function r() {
  6245. $("#gui-spinner").stop(!0, !0),
  6246. $("#gui-spinner").fadeOut(1e3),
  6247. !(Ae = !0)
  6248. }
  6249. function A(e, t) {
  6250. var i = e.mode
  6251. , n = t || e.currentPano;
  6252. $("#gui-modes-dollhouse").toggleClass("active", i === ie.DOLLHOUSE),
  6253. $("#gui-modes-floorplan").toggleClass("active", i === ie.FLOORPLAN),
  6254. $("#gui-modes-inside").toggleClass("active", i === ie.PANORAMA),
  6255. i === ie.PANORAMA ? ($("#view-controllers").slideUp(500),
  6256. M.show360Views.enabled && !n.isAligned() ? ($(".gui-floor").addClass("hidden"),
  6257. $("#gui-modes-outside").addClass("desktop-only")) : ($(".gui-floor").removeClass("hidden"),
  6258. $("#gui-modes-outside").removeClass("desktop-only")),
  6259. $("#gui-modes-outside").removeClass("hidden")) : i !== ie.TRANSITIONING && (r(),
  6260. pe = i,
  6261. $("#gui-modes-outside").addClass("hidden"),
  6262. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6263. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(M.guiAnimationSpeed))
  6264. }
  6265. function C(t, i) {
  6266. function e() {
  6267. document.getElementById("vr").classList.remove("hidden"),
  6268. M.vr.allowWebVR ? S.getVRDisplay().then(function(e) {
  6269. S.supportsFullscreen() ? function(e) {
  6270. ue.info(e.displayName + " detected, VR button activates WebVR experience"),
  6271. Q.init(t.data, i, e, x),
  6272. Q.on(J.OPENED, _e.bind(gui, "vr")),
  6273. Q.on(J.SHOW_TERMS, W.show.bind(W))
  6274. }(e) : (ue.warn("Unable to use WebVR when full screen is not supported"),
  6275. $(".improper-embed").toggleClass("hidden", !1),
  6276. n())
  6277. }, function(e) {
  6278. n()
  6279. }) : n()
  6280. }
  6281. function n() {
  6282. var e;
  6283. ue.info("WebVR support not found, VR button activates native app VR modal"),
  6284. X.init(t.data, x),
  6285. X.on(Z.OPENED, (e = document.getElementById("vr-modal"),
  6286. function() {
  6287. _e("vr"),
  6288. V.open(e)
  6289. }
  6290. )),
  6291. X.on(Z.CLOSED, V.reset)
  6292. }
  6293. if (M.vr.enabled && t.supportsVR && !S.valueFromHash("mls", 0))
  6294. switch (M.vr.option) {
  6295. case le.CONTEXTUAL:
  6296. e();
  6297. break;
  6298. case le.ANDROID:
  6299. S.detectAndroid() && e();
  6300. break;
  6301. case le.NONE:
  6302. }
  6303. }
  6304. function h(e, i) {
  6305. for (var n = $(".gui-floor"), t = 0; t < e.floors.length; t++)
  6306. if ("372" !== getQueryVariable("m")) {
  6307. var r = $('<div class="floorChoice" data-index="' + t + '"></div>').text(e.floors.get(t).name);
  6308. $(".gui-floor").find(".container").prepend(r)
  6309. }
  6310. n.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + se.FLOOR_ALL + "</div>"),
  6311. n.on("click", function(e) {
  6312. y(e),
  6313. _e("floor"),
  6314. n.toggleClass("open")
  6315. }),
  6316. $(".floorChoice").on("click", function(e) {
  6317. y(e);
  6318. var t = $(this).data("index");
  6319. "all" !== t ? (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6320. i.player.gotoFloor(t),
  6321. R.track("showcase_gui", {
  6322. gui_action: "click_floor_select_button",
  6323. interaction_source: "gui"
  6324. })) : (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6325. _e("move"),
  6326. i.allFloors(),
  6327. R.track("showcase_gui", {
  6328. gui_action: "click_toggle_all_floors_button",
  6329. interaction_source: "gui"
  6330. })),
  6331. n.removeClass("open")
  6332. })
  6333. }
  6334. function I(e, t) {
  6335. e && (t === ie.DOLLHOUSE || t === ie.FLOORPLAN ? ($(".allFloorBtn").show(),
  6336. $(".gui-floor-icon").hide(),
  6337. $(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),
  6338. $(".gui-floor-icon").show(),
  6339. $(".gui-floor-title").hide()),
  6340. e.model.allFloorsVisible ? ($(".gui-floor-title").text(se.FLOOR_ALL),
  6341. $(".gui-floor-number").text(se.FLOOR_ALL),
  6342. $(".floorChoice").removeClass("active"),
  6343. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6344. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6345. $(".floorChoice").removeClass("active"),
  6346. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6347. }
  6348. function E() {
  6349. var e = $("#player").width() - 20
  6350. , t = $("#scroller")
  6351. , i = $("#drawer")
  6352. , n = $(".pinBottom");
  6353. $("#player").width() < 488 || $("#player").height() < 488 ? (t.addClass("hidden"),
  6354. i.addClass("noScroll"),
  6355. n.addClass("noScroll")) : e < T != !i.hasClass("noScroll") && (t.toggleClass("hidden"),
  6356. i.toggleClass("noScroll"),
  6357. n.toggleClass("noScroll"))
  6358. }
  6359. function _(e) {
  6360. e.waitQueue.length <= 0 ? r() : ye || function(e) {
  6361. e = e || 0,
  6362. Ae = !1,
  6363. window.setTimeout(function() {
  6364. Ae || (!0,
  6365. $("#gui-spinner").stop(!0, !0).show())
  6366. }
  6367. .bind(this), e)
  6368. }(M.modelComponentLoadSpinnerDelay)
  6369. }
  6370. function b(e, t) {
  6371. for (var i = []; e; )
  6372. i.push(e),
  6373. e = e.parentNode;
  6374. for (; t && -1 === i.indexOf(t); )
  6375. t = t.parentNode;
  6376. return t
  6377. }
  6378. var w, T, o, a, x, i, s, u, d, p, f, g, S = (Oe("three"),
  6379. Oe("../util/ajax"),
  6380. Oe("../util/browser")), M = Oe("../settings"), R = Oe("../analytics"), m = (Oe("../util/transitions"),
  6381. Oe("../util/camera"),
  6382. Oe("../util/logger")), P = (Oe("../objects/Snapshot"),
  6383. 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"),
  6384. Oe("../tag/Media/MediaEvent")), re = (Oe("../enum/PathDiscardMode"),
  6385. Oe("../enum/PathDisplayMode"),
  6386. Oe("../enum/DirectorEvents"),
  6387. Oe("../enum/PlayerEvents")), oe = Oe("../enum/ControlEvents"), ae = Oe("./sharing/ShareEvents"), se = Oe("../localization/localize"), le = (Oe("../enum/Vectors"),
  6388. Oe("../enum/WarpStyle"),
  6389. Oe("../enum/AlignmentType"),
  6390. Oe("../enum/VROption")), ce = Oe("./konami"), he = Oe("../lib/dat.gui"), ue = new m(e), de = (Oe("../util/showcase"),
  6391. Oe("../enum/ZoomEvents")), pe = ie.DOLLHOUSE, fe = 0, ge = [".hideTarget"], me = null, ve = null, ye = !1, Ae = !1, Ce = {
  6392. coBrand: {
  6393. visible: !0,
  6394. elements: [".co-brand", "#loaderCoBrand"]
  6395. },
  6396. help: {
  6397. visible: !0,
  6398. elements: [".nav-help", "#nav-help"]
  6399. },
  6400. tourControls: {
  6401. visible: !0,
  6402. elements: [".next", ".previous", "#play"]
  6403. },
  6404. highlight: {
  6405. visible: !0,
  6406. elements: ["#drawer", "#pullTab"]
  6407. },
  6408. share: {
  6409. visible: !0,
  6410. elements: [".socialButton", "#share"]
  6411. },
  6412. fullScreen: {
  6413. visible: !0,
  6414. elements: ["#gui-fullscreen"]
  6415. },
  6416. floors: {
  6417. visible: !0,
  6418. elements: [".gui-floor"]
  6419. }
  6420. }, Ie = (g = document.getElementById("drawer"),
  6421. function() {
  6422. $("#player").height() < 400 && g.classList.contains("open") && l()
  6423. }
  6424. ), Ee = (f = document.getElementById("meta-info"),
  6425. function() {
  6426. $("#player").height() < 400 && f.classList.contains("expand") && z.toggleMeta(!0)
  6427. }
  6428. ), _e = (i = document.getElementById("meta-info"),
  6429. s = document.getElementById("interaction-modal"),
  6430. u = $("#drawer").eq(0),
  6431. d = $(".gui-floor").eq(0),
  6432. p = $(".vr-popup").eq(0),
  6433. function(e) {
  6434. switch (e) {
  6435. case "info":
  6436. we(),
  6437. Te(),
  6438. Ie(),
  6439. Me(),
  6440. Re(),
  6441. xe(),
  6442. Pe();
  6443. break;
  6444. case "terms":
  6445. be(),
  6446. Te(),
  6447. Se(),
  6448. Me(),
  6449. Re(),
  6450. xe(),
  6451. Pe();
  6452. break;
  6453. case "help":
  6454. be(),
  6455. we(),
  6456. Me(),
  6457. Re(),
  6458. xe(),
  6459. Pe();
  6460. break;
  6461. case "vr":
  6462. be(),
  6463. we(),
  6464. Me(),
  6465. Re(),
  6466. Te(),
  6467. Pe(),
  6468. t(p) && Se();
  6469. break;
  6470. case "highlights":
  6471. Ee(),
  6472. we(),
  6473. Me(),
  6474. Re();
  6475. break;
  6476. case "share":
  6477. be(),
  6478. we(),
  6479. Te(),
  6480. Re(),
  6481. xe(),
  6482. Pe();
  6483. break;
  6484. case "floor":
  6485. we(),
  6486. Me(),
  6487. xe();
  6488. break;
  6489. case "view":
  6490. Re(),
  6491. Me(),
  6492. we(),
  6493. xe();
  6494. break;
  6495. case "tour":
  6496. case "move":
  6497. we(),
  6498. Me(),
  6499. Re(),
  6500. xe();
  6501. break;
  6502. case "resize":
  6503. be(),
  6504. Ie(),
  6505. Re();
  6506. break;
  6507. case "tag":
  6508. we(),
  6509. Te(),
  6510. Me(),
  6511. Re(),
  6512. xe()
  6513. }
  6514. }
  6515. );
  6516. function be() {
  6517. i.classList.contains("expand") && z.toggleMeta(!0)
  6518. }
  6519. function we() {
  6520. W.hide()
  6521. }
  6522. function Te() {
  6523. U.close()
  6524. }
  6525. function xe() {
  6526. X.dismiss()
  6527. }
  6528. function Se() {
  6529. u.hasClass("open") && l()
  6530. }
  6531. function Me() {
  6532. K.hide()
  6533. }
  6534. function Re() {
  6535. d.hasClass("open") && d.removeClass("open")
  6536. }
  6537. function Pe() {
  6538. s.classList.contains("fadeIn") && (s.classList.contains("landing") ? D.dismissModal() : s.classList.contains("tour") && q.dismissModal())
  6539. }
  6540. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  6541. $("#gui-fullscreen").toggle(!S.isFullscreen()),
  6542. $("#gui-fullscreen-exit").toggle(!!S.isFullscreen()),
  6543. setTimeout(function() {
  6544. $(".icon:visible").hide().show(0)
  6545. }, 100)
  6546. }),
  6547. $("#gui-fullscreen").find("a").on("click", function(e) {
  6548. y(e),
  6549. S.requestFullscreen($("body")[0]),
  6550. R.track("showcase_gui", {
  6551. gui_action: "click_enter_fullscreen",
  6552. interaction_source: "gui"
  6553. })
  6554. }),
  6555. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  6556. y(e),
  6557. S.exitFullscreen(),
  6558. R.track("showcase_gui", {
  6559. gui_action: "click_exit_fullscreen",
  6560. interaction_source: "gui"
  6561. })
  6562. }),
  6563. $(window).on("resize", function(e) {
  6564. var t = e.target.innerHeight
  6565. , i = e.target.innerWidth;
  6566. t === o && i === a || (Ce.highlight.visible && E(),
  6567. _e("resize"),
  6568. $(".pinTop.right").removeClass("hideUnderMeta"),
  6569. n(),
  6570. o = t,
  6571. a = i)
  6572. }).resize(),
  6573. S.supportsFullscreen() || $("#gui-fullscreen").hide(),
  6574. $("#pullTab").on("click", function(e) {
  6575. y(e),
  6576. $("#drawer").hasClass("open") ? (R.trackAlways("showcase_gui", {
  6577. gui_action: "hide_highlight_reel"
  6578. }),
  6579. $(this).addClass("open").children("img").attr("src", "images/auto.png")) : (R.trackAlways("showcase_gui", {
  6580. gui_action: "show_highlight_reel"
  6581. }),
  6582. $(this).removeClass("open").children("img").attr("src", "images/auto-suspend.png")),
  6583. l()
  6584. }),
  6585. window.DATA.showHotListSta && ($("#hotList").css("display", ""),
  6586. $("#hotList").on("click", function(e) {
  6587. y(e);
  6588. var t = $("#hotListWrap")[0];
  6589. t.classList.contains("hotListActive") ? (t.classList.remove("hotListActive"),
  6590. this.classList.remove("active")) : (t.classList.add("hotListActive"),
  6591. this.classList.add("active"))
  6592. }),
  6593. $("#hotListContent ul").on("mouseover", function(e) {
  6594. y(e);
  6595. var t = e.target
  6596. , i = document.getElementById("hotListWrap");
  6597. if ("SPAN" === t.tagName) {
  6598. var n = t.parentElement.parentElement;
  6599. t.offsetWidth + 116 >= n.clientWidth ? i.style.width = t.offsetWidth + 116 + "px" : i.style.width = ""
  6600. } else if ("LI" === t.tagName) {
  6601. n = t.parentElement;
  6602. t.children[0].offsetWidth + 116 >= n.clientWidth ? i.style.width = t.children[0].offsetWidth + 116 + "px" : i.style.width = ""
  6603. } else
  6604. i.style.width = ""
  6605. }),
  6606. $("#hotListContent ul").on("click", function(e) {
  6607. y(e),
  6608. this.preElem && this.preElem.classList.remove("active"),
  6609. "SPAN" === e.target.tagName ? (e.target.parentElement.classList.add("active"),
  6610. e.target.parentElement.hot && e.target.parentElement.hot.examine(!0),
  6611. this.preElem = e.target.parentElement) : (e.target.classList.add("active"),
  6612. e.target.hot && e.target.hot.examine(!0),
  6613. this.preElem = e.target)
  6614. }),
  6615. $("#hotListClose").on("click", function(e) {
  6616. y(e),
  6617. $("#hotListWrap")[0].classList.remove("hotListActive"),
  6618. $("#hotListContent ul .active").removeClass("active"),
  6619. $("#hotList")[0].classList.remove("active")
  6620. })),
  6621. "true" === window.DATA.supportsVR && $("#vr").css("display", ""),
  6622. $("#more-menu-button").on("click", function(e) {
  6623. y(e),
  6624. $("#more-menu").toggleClass("open")
  6625. }),
  6626. Le.exports.init = function(s, l, c, e, t, i, n) {
  6627. var r;
  6628. x = n,
  6629. s.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6630. s.supportedModes[ie.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6631. F.init(),
  6632. D.init(s, i),
  6633. ce.init(s, l, e),
  6634. $(".icon").on("mouseover", function() {
  6635. l.player && l.player.reticule.hide()
  6636. }),
  6637. function(e, t) {
  6638. var i = t.player;
  6639. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6640. y(e),
  6641. R.updateInteraction(oe.InteractionGui, "inside-button"),
  6642. R.track("USER", {
  6643. event_type: "showcase_gui",
  6644. gui_action: "click_inside_mode_button"
  6645. }),
  6646. t.changeMode(ie.PANORAMA)
  6647. }),
  6648. $("#gui-modes-outside").find("a").on("click", function(e) {
  6649. y(e),
  6650. R.track("showcase_gui", {
  6651. gui_action: "click_outside_mode_button"
  6652. }),
  6653. t.changeMode(pe)
  6654. }),
  6655. $("#gui-modes-floorplan").on("click", function(e) {
  6656. y(e),
  6657. i.mode !== ie.FLOORPLAN && (R.track("showcase_gui", {
  6658. gui_action: "click_floorplan_mode_button"
  6659. }),
  6660. t.changeMode(ie.FLOORPLAN))
  6661. }),
  6662. $("#gui-modes-dollhouse").on("click", function(e) {
  6663. y(e),
  6664. i.mode !== ie.DOLLHOUSE && (R.track("showcase_gui", {
  6665. gui_action: "click_dollhouse_mode_button"
  6666. }),
  6667. t.changeMode(ie.DOLLHOUSE))
  6668. })
  6669. }(0, l),
  6670. function(e, t) {
  6671. $("#play").on("mousedown touchstart", function(e) {
  6672. y(e),
  6673. _e("tour"),
  6674. q.play(),
  6675. R.trackAlways("showcase_gui", {
  6676. gui_action: "play_highlights"
  6677. })
  6678. }),
  6679. window.startAndPlay = function(e) {
  6680. _e("tour"),
  6681. q.play(),
  6682. R.trackAlways("showcase_gui", {
  6683. gui_action: "play_highlights"
  6684. })
  6685. }
  6686. ,
  6687. $("#pause").on("mousedown touchstart", function(e) {
  6688. y(e),
  6689. q.pause(),
  6690. R.trackAlways("showcase_gui", {
  6691. gui_action: "pause_highlights"
  6692. })
  6693. }),
  6694. $("#gui-zoomin").find("a").on("click", function(e) {
  6695. y(e),
  6696. t.player.zoomInIncrementally()
  6697. }),
  6698. $("#gui-zoomout").find("a").on("click", function(e) {
  6699. y(e),
  6700. t.player.zoomOutIncrementally()
  6701. })
  6702. }(0, l),
  6703. s.data.enable_social_sharing && s.data.is_public && M.share.enabled && (K.init(DATA.name/* s.data.name */),
  6704. K.on(ae.OPENED, (r = document.getElementById("share-modal"),
  6705. function() {
  6706. _e("share"),
  6707. V.open(r)
  6708. }
  6709. )),
  6710. K.on(ae.CLOSED, V.reset)),
  6711. 0 < s.heroLocations.length ? function(e, i, t) {
  6712. var n = 100 / (fe = e.heroLocations.length) + "%"
  6713. , r = $("#thumb-container")
  6714. , o = $("#progressBar");
  6715. $("#status").find(".totalSteps").text(fe);
  6716. for (var a = 0; a < fe; a++) {
  6717. var s = e.heroLocations[a]
  6718. , l = $('<li class="thumbImg" data-index=""><img src=""></li>');
  6719. if(s.heroLocations){//有子项,选第一张截图
  6720. var tmp = s.heroLocations[0].thumbUrl.replace('https://','').replace('http://','')
  6721. }else{
  6722. var tmp = s.thumbUrl.replace('https://','').replace('http://','')
  6723. }
  6724. if (l.attr("data-index", a),
  6725. //Ce.highlight.visible && l.find("img").attr("src",'https://'+tmp),
  6726. Ce.highlight.visible && l.find("img").attr("src", 'http://'+tmp),// xzw改 导览图片 https在某些服务器打不开
  6727. s.name) {
  6728. var c = $('<div class="overlay"></div>').text(s.name);
  6729. l.prepend(c)
  6730. }
  6731. if (e.has360Views && s.cameraMode === ie.PANORAMA) {
  6732. var h = e.panos.get(s.panoId)
  6733. , 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>';
  6734. l.prepend(u)
  6735. }
  6736. r.append(l),
  6737. o.append('<div class="step" data-idx="' + a + '" style="width:' + n + '"></div>')
  6738. }
  6739. T = 144 * fe,
  6740. 111 * fe,
  6741. $(".thumbImg").on("mouseover", function() {
  6742. !function(e) {
  6743. return e.describe().inTransition
  6744. }(i) && t.showPathToHeroLocation([$(this).data("index"),0])//改
  6745. }),
  6746. $(".thumbImg").on("mouseout", function() {
  6747. i.clearPath()
  6748. }),
  6749. $(".thumbImg").on("click", function(e) {
  6750. y(e);
  6751. var t = $(this);
  6752. R.updateInteraction(oe.InteractionGui, "thumbnail"),
  6753. R.trackAlways("showcase_gui", {
  6754. gui_action: "click_highlight"
  6755. }),
  6756. i.goToHighlight([t.data("index"),0])//改
  6757. }),
  6758. $(".previous").find("a").on("click", function(e) {
  6759. y(e),
  6760. R.trackAlways("showcase_gui", {
  6761. gui_action: "prev_highlight"
  6762. }),
  6763. i.prevHighlight()
  6764. }),
  6765. $(".next").find("a").on("click", function(e) {
  6766. y(e),
  6767. R.trackAlways("showcase_gui", {
  6768. gui_action: "next_highlight"
  6769. }),
  6770. i.nextHighlight()
  6771. }),
  6772. $("#drawer").on("mouseleave", function(t) {
  6773. var i;
  6774. y(t);
  6775. try {
  6776. i = new MouseEvent("mouseup",{
  6777. clientX: t.clientX,
  6778. clientY: t.clientY,
  6779. screenX: t.screenX,
  6780. screenY: t.screenY
  6781. })
  6782. } catch (e) {
  6783. (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)
  6784. }
  6785. document.dispatchEvent(i)
  6786. }),
  6787. (w = new Sly($("#scrollFrame"),{
  6788. horizontal: !0,
  6789. itemNav: "centered",
  6790. smart: !0,
  6791. scrollTrap: !0,
  6792. scrollBy: 1,
  6793. mouseDragging: !0,
  6794. touchDragging: !0,
  6795. speed: 300,
  6796. dragHandle: !0,
  6797. dynamicHandle: !0,
  6798. clickBar: !0,
  6799. scrollBar: $("#scroller"),
  6800. activateOn: null
  6801. }).init()).on("active", function(e, t) {
  6802. t,
  6803. _e("tour"),
  6804. $(".step").removeClass("active"),
  6805. $("#status").find(".curIdx").text(t + 1);
  6806. for (var i = 0; i <= t; i++)
  6807. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6808. }),
  6809. E()
  6810. }(s, l, c) : (Ce.highlight.visible = !1,
  6811. Ce.tourControls.visible = !1),
  6812. z.on(G.OPEN_INFO, _e.bind(this, "info")),
  6813. function() {
  6814. var n;
  6815. document.body.addEventListener("mousedown", function(e) {
  6816. n = 0 === e.button || 1 === e.which ? e.target : null
  6817. }, !0),
  6818. document.body.addEventListener("mouseup", function(t) {
  6819. n !== t.target && (n = b(n, t.target));
  6820. var e = document.getElementById("gui-parent");
  6821. if (b(e, n) !== e && (n = null),
  6822. n) {
  6823. var i;
  6824. try {
  6825. i = new MouseEvent("click",t)
  6826. } catch (e) {
  6827. (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)
  6828. }
  6829. i.syntheticClick = !0,
  6830. n.dispatchEvent(i),
  6831. n = null
  6832. }
  6833. }, !0),
  6834. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6835. e.syntheticClick || (e.stopPropagation(),
  6836. "A" === e.target.nodeName && e.preventDefault())
  6837. }, !0)
  6838. }(),
  6839. A(c),
  6840. C(s, t),
  6841. s.on("floor.changed", I),
  6842. s.on("waiting", function(e) {
  6843. _(e)
  6844. }
  6845. .bind(this, s)),
  6846. s.on("waiting-done", function(e) {
  6847. _(e)
  6848. }
  6849. .bind(this, s)),
  6850. c.on(re.ModeChanged, function(e, t) {
  6851. A(c),
  6852. v(l, c),
  6853. t === ie.PANORAMA && c.currentPano && !c.currentPano.isAligned() && (t = ie.OUTDOOR),
  6854. U.updateMode(t)
  6855. }),
  6856. e.on(oe.Move, _e.bind(this, "move")),
  6857. c.on(re.Ready, function() {
  6858. O.init(e, c, c.tagManager, l),
  6859. c.on(re.ModeChanged, function(e, t) {
  6860. e !== t && $(".vr-popup").is(":visible") && X.dismiss()
  6861. })
  6862. }),
  6863. c.on(re.PanoChosen, function(e, t) {
  6864. A(c, t),
  6865. U.updateMode(t && !t.isAligned() ? ie.OUTDOOR : ie.PANORAMA)
  6866. }),
  6867. V.on(k.CLOSE, function(e) {
  6868. switch (e) {
  6869. case "vr-modal":
  6870. X.dismiss();
  6871. break;
  6872. case "share-modal":
  6873. K.hide();
  6874. break;
  6875. case "terms-modal":
  6876. W.hide()
  6877. }
  6878. });
  6879. 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();
  6880. l.on("update.controls", function() {
  6881. var e, t, i, n = l.describe();
  6882. if (n.tourIsPlaying || c.isWarping() ? (Ce.tourControls.visible && (h.hide(),
  6883. u.show()),
  6884. n.tourInProgress && (d.forEach(function(e) {
  6885. e.classList.add("playing")
  6886. }),
  6887. p.addClass("playing"),
  6888. f.addClass("playing"))) : (Ce.tourControls.visible && (h.show(),
  6889. u.hide()),
  6890. n.tourInProgress || (q.stopTour(),
  6891. d.forEach(function(e) {
  6892. e.classList.remove("playing")
  6893. }),
  6894. p.removeClass("playing"),
  6895. f.removeClass("playing"))),
  6896. null !== n.currentItem) {
  6897. var r, o;
  6898. $("#status").find(".curIdx").text(n.currentItem[0] + 1),
  6899. n.onTheBus ? (r = "active",
  6900. o = "recent") : (o = "active",
  6901. r = "recent");
  6902. var a = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
  6903. for (e = 0; e < s.heroLocations.length; e += 1)
  6904. i = g.eq(e),
  6905. t = m.eq(e),
  6906. i.removeClass(o),
  6907. t.removeClass(o),
  6908. n.onTheBus && e === n.destinationItem[0] ? (i.addClass(r),
  6909. t.addClass(r),
  6910. w.activate(e)) : n.onTheBus && a && e === n.currentItem[0] ? (i.addClass(r),
  6911. t.addClass(r)) : (i.removeClass(r),
  6912. t.removeClass(r))
  6913. } else
  6914. for (e = 0; e < s.heroLocations.length; e += 1)
  6915. i = g.eq(e),
  6916. t = m.eq(e),
  6917. i.removeClass("active recent"),
  6918. t.removeClass("active recent");
  6919. v(l, c)
  6920. }),
  6921. document.addEventListener("keydown", function(e) {
  6922. switch (R.updateInteraction(oe.InteractionKey),
  6923. e.which) {
  6924. case te.ZERO:
  6925. M.debug && s.toggleAlpha();
  6926. break;
  6927. case te.NINE:
  6928. M.debug && B.toggle();
  6929. break;
  6930. case te.ONE:
  6931. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.PANORAMA);
  6932. break;
  6933. case te.TWO:
  6934. s.outsideAllowed() && !c.isInMode(ie.DOLLHOUSE, ie.TRANSITIONING) && l.changeMode(ie.DOLLHOUSE);
  6935. break;
  6936. case te.THREE:
  6937. s.outsideAllowed() && !c.isInMode(ie.FLOORPLAN, ie.TRANSITIONING) && l.changeMode(ie.FLOORPLAN);
  6938. break;
  6939. case te.FOUR:
  6940. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.OUTDOOR);
  6941. break;
  6942. case te.SPACE:
  6943. Ce.tourControls.visible && ($("#playHead").hasClass("playing") || _e("tour"));
  6944. break;
  6945. case te.RETURN:
  6946. M.debug && s.toggleExplodeUp();
  6947. break;
  6948. case te.P:
  6949. !function(e) {
  6950. me.gui || (me.gui = function(e) {
  6951. var t = new he.GUI;
  6952. return t.add(M, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6953. e.setSweepVisibility(M.showSweeps)
  6954. }),
  6955. t.add(M, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6956. t.add(M.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6957. M.transition.flySpeed = 0,
  6958. t.__controllers.forEach(function(e) {
  6959. e.updateDisplay()
  6960. })
  6961. }),
  6962. t.add(M.path, "opacity", 0, 1).name("Path opacity"),
  6963. $(t.__closeButton).hide(),
  6964. t
  6965. }(me.model)),
  6966. (me.visible = e) ? $(me.gui.domElement).show() : $(me.gui.domElement).hide()
  6967. }(!me.visible);
  6968. break;
  6969. case te.U:
  6970. !function(e) {
  6971. ve.gui || (ve.gui = function(t, i) {
  6972. function e() {
  6973. var e = i.toJSON();
  6974. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + t.sid + "&start=" + ee.serialize(e),
  6975. i.tagManager.activeTag && (n.linkToLocation += "&tag=" + i.tagManager.activeTag.sid)
  6976. }
  6977. var n = {}
  6978. , r = new he.GUI({
  6979. autoPlace: !0,
  6980. width: "60%"
  6981. });
  6982. return e(),
  6983. i.on(re.ViewChanged, e),
  6984. r.add(n, "linkToLocation").name(se.LINK_TO_LOCATION).listen(),
  6985. r.domElement.id = "datLinks",
  6986. [].slice.call(r.domElement.querySelectorAll(".property-name")).forEach(function(e) {
  6987. if (!S.detectSafari()) {
  6988. var t = document.createElement("button");
  6989. t.classList.add("btn-deep-link"),
  6990. t.innerText = se.MENU_COPY,
  6991. e.nextSibling.appendChild(t);
  6992. var n = function() {
  6993. alert(se.LINK_ALERT_COPY),
  6994. t.hide()
  6995. };
  6996. t.addEventListener("click", function(e) {
  6997. try {
  6998. var t = e.target.parentNode.childNodes[0];
  6999. t.select();
  7000. var i = document.execCommand("copy");
  7001. t.blur(),
  7002. i || n()
  7003. } catch (e) {
  7004. n()
  7005. }
  7006. })
  7007. }
  7008. }),
  7009. $(r.__closeButton).hide(),
  7010. r
  7011. }(ve.model, ve.player)),
  7012. (ve.visible = e) ? $(ve.gui.domElement).show() : $(ve.gui.domElement).hide()
  7013. }(!ve.visible);
  7014. break;
  7015. case te.X:
  7016. M.debug && s.toggleExplode();
  7017. break;
  7018. case te.PLUSEQUALS:
  7019. l.player.activatePersistentZooming(!0),
  7020. O.hideUi();
  7021. break;
  7022. case te.DASHUNDERSCORE:
  7023. l.player.activatePersistentZooming(!1),
  7024. O.hideUi();
  7025. break;
  7026. case te.SEVEN:
  7027. ue.info("Zoom level: " + l.player.zoomLevel + ", FOV: " + l.player.zoomFov);
  7028. break;
  7029. case te.EIGHT:
  7030. l.player.decreaseZoomSpeed();
  7031. break;
  7032. case te.NINE:
  7033. l.player.increaseZoomSpeed()
  7034. }
  7035. return c && c.reticule.hide(),
  7036. !0
  7037. }
  7038. .bind(this)),
  7039. document.addEventListener("keyup", function(e) {
  7040. switch (e.which) {
  7041. case te.PLUSEQUALS:
  7042. l.player.deactivatePersistentZooming();
  7043. break;
  7044. case te.DASHUNDERSCORE:
  7045. l.player.deactivatePersistentZooming()
  7046. }
  7047. }
  7048. .bind(this)),
  7049. function(e) {
  7050. me = {
  7051. gui: null,
  7052. visible: !1,
  7053. model: e
  7054. }
  7055. }(s),
  7056. function(e, t) {
  7057. ve = {
  7058. gui: null,
  7059. visible: !1,
  7060. model: e,
  7061. player: t
  7062. }
  7063. }(s, l.player),
  7064. function(e) {
  7065. function t(e, i) {
  7066. $(e).find("a").each(function(e, t) {
  7067. i ? $(t).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(t).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  7068. t.style.pointerEvents = i ? "auto" : "none"
  7069. })
  7070. }
  7071. e.on(de.ZoomMax, function() {
  7072. t("#gui-zoomin", !1),
  7073. t("#gui-zoomout", !0)
  7074. }),
  7075. e.on(de.ZoomMin, function() {
  7076. t("#gui-zoomin", !0),
  7077. t("#gui-zoomout", !1)
  7078. }),
  7079. e.on(de.ZoomIn, function() {
  7080. t("#gui-zoomout", !0)
  7081. }),
  7082. e.on(de.ZoomOut, function() {
  7083. t("#gui-zoomin", !0)
  7084. }),
  7085. e.zoomLevel >= M.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  7086. e.zoomLevel <= M.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  7087. }(c),
  7088. P.setAutoPlay(s.heroCount()),
  7089. U.init(c, i.mode),
  7090. U.on(H.OPENED, _e.bind(this, "help")),
  7091. W.init(),
  7092. W.on(j.OPENED, (o = document.getElementById("terms-modal"),
  7093. function() {
  7094. _e("terms"),
  7095. V.open(o)
  7096. }
  7097. )),
  7098. W.on(j.CLOSED, V.reset),
  7099. M.quickstart.enabled || D.delayLanding(i.mode).then(D.showMessage.bind(this, c, l, Ce.coBrand.visible)),
  7100. (M.quickstart.enabled || c.model.outsideAllowed()) && O.init(e, c, c.tagManager, l),
  7101. M.profiling.enabled && B.show(),
  7102. q.init(l)
  7103. }
  7104. ,
  7105. Le.exports.startLoading = function(e, t, i, n, r, o) {
  7106. function a() {
  7107. o.setLoadingStartTime(),
  7108. function() {
  7109. function e(e) {
  7110. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)
  7111. }
  7112. $("body").css("touch-action", "none"),
  7113. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {});
  7114. var t = document.getElementById("terms-text")
  7115. , i = document.getElementById("more-help-wrapper")
  7116. , n = (document.getElementById("navigation-help-wrapper"),
  7117. document.getElementById("help-dialog"),
  7118. document.getElementById("tag-billboards"));
  7119. M.useWheel && (document.body.addEventListener("mousewheel", e, {
  7120. passive: !1
  7121. }),
  7122. document.body.addEventListener("DOMMouseScroll", e)),
  7123. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  7124. e.stopPropagation()
  7125. })
  7126. }(),
  7127. r ? (D.showMessage(t, i, Ce.coBrand.visible),
  7128. l()) : function(e) {
  7129. L.show(e),
  7130. c()
  7131. }(l)
  7132. }
  7133. var s = $.Deferred()
  7134. , l = s.resolve.bind(s);
  7135. ye = !0,
  7136. _(e);
  7137. e.data.player_options && function(e) {
  7138. Ce.tourControls.visible = true//e.tour_buttons && S.valueFromHash("gt", 1),
  7139. Ce.coBrand.visible = e.presented_by && 1 !== M.specialEdition && M.brand && !S.valueFromHash("mls", !1),
  7140. Ce.highlight.visible = /* e.highlight_reel && */ 1 !== M.specialEdition && M.showHighlights
  7141. }(e.data.player_options),
  7142. 1 === M.specialEdition && $("body").addClass("specialEdition");
  7143. se.localizeGUI();
  7144. !function(i) {
  7145. function e(e, t) {
  7146. return !!i.player_options[e] && i[t || e]
  7147. }
  7148. $(".model-title").text(i.name);
  7149. var t = M.pageTitle;
  7150. 2 !== S.valueFromHash("mls", 0) && i.name && (t = i.name),
  7151. document.title = t,
  7152. S.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  7153. delay: {
  7154. show: 50,
  7155. hide: 0
  7156. },
  7157. trigger: "hover",
  7158. html: !1,
  7159. viewport: {
  7160. selector: "body",
  7161. padding: 10
  7162. }
  7163. }),
  7164. S.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  7165. z.populate({
  7166. name: e("model_name", "name"),
  7167. coBrand: e("presented_by"),
  7168. description: e("model_summary", "summary") || "暂无内容",
  7169. contactName: e("contact_name"),
  7170. address: e("address"),
  7171. phone: e("contact_phone"),
  7172. formattedPhone: i.formatted_contact_phone,
  7173. email: e("contact_email"),
  7174. url: e("external_url"),
  7175. socialSharing: i.enable_social_sharing && i.is_public
  7176. })
  7177. }(e.data);
  7178. r || $(".quick").addClass("hidden");
  7179. n ? (R.impression(),
  7180. a()) : (o.setWaitingStartTime(),
  7181. N.show(r, a))
  7182. return s
  7183. }
  7184. ,
  7185. Le.exports.endLoading = function(e, t, i) {
  7186. var n = t.player;
  7187. function r() {
  7188. i.dismissExaminedTag(),
  7189. i.disableHovering()
  7190. }
  7191. $("#gui-thumb").fadeOut(2500),
  7192. L.hide(function() {
  7193. ye = !1
  7194. }),
  7195. Y.init(e, i),
  7196. z.finishSetup(Object.keys(e.tags).length),
  7197. i.on(ne.IMAGE_OPENED, _e.bind(this, "tag")),
  7198. X.on(Z.OPENED, r),
  7199. K.on(ae.OPENED, r),
  7200. U.on(H.OPENED, r),
  7201. W.on(j.OPENED, r);
  7202. var o = i.enableHovering.bind(i);
  7203. if (X.on(Z.CLOSED, o),
  7204. K.on(ae.CLOSED, o),
  7205. U.on(H.CLOSED, o),
  7206. W.on(j.CLOSED, o),
  7207. M.labels.enabled && Object.keys(e.labels).length,
  7208. e.floors.length <= 1 || !Ce.floors.visible ? Ce.floors.visible = !1 : (h(e, t),
  7209. I(e.currentFloor, n.mode)),
  7210. "372" === getQueryVariable("m") && (Ce.floors.visible = 1,
  7211. h(e, t)),
  7212. c(),
  7213. v(t, t.player),
  7214. $("#gui").fadeIn(1500),
  7215. Ce.highlight.visible && (2 !== M.startHighlights || e.has360Views) && setTimeout(function() {
  7216. l(),
  7217. (!e.has360Views && 1 !== M.startHighlights || e.has360Views && 0 === M.startHighlights) && setTimeout(l, 2e3)
  7218. }, 2e3),
  7219. !S.isMobile())
  7220. for (var a = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], s = 0; s < a.length; s++)
  7221. $(a[s]).addClass("hasHover");
  7222. _(e),
  7223. z.setupToggling(),
  7224. window.editHotPanel && editHotPanel(),
  7225. function() {
  7226. var i = $("#pullTab")
  7227. , e = {
  7228. bottom: {
  7229. "border-bottom-left-radius": "10px",
  7230. "border-bottom-right-radius": "10px"
  7231. },
  7232. top: {
  7233. "border-top-left-radius": "10px",
  7234. "border-top-right-radius": "10px"
  7235. }
  7236. }
  7237. , t = {
  7238. bottom: {
  7239. "border-top-right-radius": "10px",
  7240. "border-bottom-right-radius": "10px"
  7241. },
  7242. top: {
  7243. "border-bottom-left-radius": "10px",
  7244. "border-top-left-radius": "10px"
  7245. }
  7246. };
  7247. function n(e, t) {
  7248. $("#gui-modes-map > div:visible:last").css(e),
  7249. i.is(":visible") ? $(".viewContainer > div:visible:first").css(t) : $("#gui-modes-map > div:visible:first").css(t)
  7250. }
  7251. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n(e.bottom, e.top) : n(t.bottom, t.top);
  7252. (window.DATA.model.special || "true" === window.DATA.special) && window.specialScene && specialScene.special().afterImplement()
  7253. }()
  7254. $(".toolRight a").removeClass('hasHover')
  7255. }
  7256. ,
  7257. Le.exports.onProgress = function(e) {
  7258. L.progress(e)
  7259. }
  7260. }
  7261. ).call(this, "/js/gui/gui.js")
  7262. }
  7263. , {
  7264. "../analytics": 4,
  7265. "../controls/serializer": 14,
  7266. "../enum/AlignmentType": 17,
  7267. "../enum/BlackoutStyle": 18,
  7268. "../enum/ControlEvents": 21,
  7269. "../enum/DirectorEvents": 23,
  7270. "../enum/Keys": 30,
  7271. "../enum/PathDiscardMode": 38,
  7272. "../enum/PathDisplayMode": 39,
  7273. "../enum/PlayerEvents": 40,
  7274. "../enum/VROption": 47,
  7275. "../enum/Vectors": 50,
  7276. "../enum/Viewmode": 51,
  7277. "../enum/WarpStyle": 52,
  7278. "../enum/ZoomEvents": 53,
  7279. "../lib/dat.gui": 93,
  7280. "../localization/localize": 108,
  7281. "../tag/Media/MediaEvent": 131,
  7282. "../objects/Snapshot": 153,
  7283. "../settings": 166,
  7284. "../util/ajax": 181,
  7285. "../util/browser": 182,
  7286. "../util/camera": 183,
  7287. "../util/logger": 189,
  7288. "../util/showcase": 193,
  7289. "../util/transitions": 195,
  7290. "./closer/ModalCloserEvent": 61,
  7291. "./closer/modalCloser": 62,
  7292. "./help/HelpEvent": 66,
  7293. "./help/help": 67,
  7294. "./helpManager": 68,
  7295. "./immersiveMode": 69,
  7296. "./konami": 70,
  7297. "./landingScreen": 71,
  7298. "./loadingScreen": 72,
  7299. "./memoryUsage": 73,
  7300. "./playButton": 74,
  7301. "./populateModal": 75,
  7302. "./sharing/ShareEvents": 76,
  7303. "./sharing/modal": 77,
  7304. "./terms/TermsEvent": 78,
  7305. "./terms/terms": 79,
  7306. "./title/TitleEvents": 80,
  7307. "./title/tagToggle": 81,
  7308. "./title/titleBar": 82,
  7309. "./tourInteraction": 84,
  7310. "./vr/vrEvent": 85,
  7311. "./vr/vrModal": 87,
  7312. "./webvr/WebVrEvent": 88,
  7313. "./webvr/webVRgui": 89,
  7314. three: 217
  7315. }],
  7316. 66: [function(e, t, i) {
  7317. "use strict";
  7318. t.exports = Object.freeze({
  7319. OPENED: "help.opened",
  7320. CLOSED: "help.closed"
  7321. })
  7322. }
  7323. , {}],
  7324. 67: [function(e, t, i) {
  7325. "use strict";
  7326. function n() {
  7327. p.on("click", function(e) {
  7328. T && T !== a.TRANSITIONING && (0 < window.getComputedStyle(v).getPropertyValue("opacity") && !x ? S.close() : T && T !== a.TRANSITIONING && (x = !0,
  7329. setTimeout(function() {
  7330. x = !1
  7331. }, h.help.modalStayDuration),
  7332. S.emit(l.OPENED),
  7333. f.addClass("open " + T),
  7334. p.addClass("open"),
  7335. o(),
  7336. r(),
  7337. v.style.removeProperty ? v.style.removeProperty("display") : v.style.removeAttribute("display"),
  7338. v.classList.add("fadeIn")))
  7339. }),
  7340. E.on("click", function(e) {
  7341. S.close()
  7342. }),
  7343. C.on("click", function(e) {
  7344. T && T !== a.TRANSITIONING && (o(),
  7345. r())
  7346. }),
  7347. I.on("click", function(e) {
  7348. o(),
  7349. I.addClass("underline-tab"),
  7350. c.fill(b, s.MORE_HELP),
  7351. f.addClass("more-help")
  7352. })
  7353. }
  7354. function r() {
  7355. C.addClass("underline-tab"),
  7356. c.fill(_, s.NAVIGATION, T),
  7357. f.addClass(T)
  7358. }
  7359. function o() {
  7360. f.removeClass("more-help " + a.PANORAMA + " " + a.DOLLHOUSE + " " + a.FLOORPLAN + " " + a.OUTDOOR),
  7361. A.forEach(function(e) {
  7362. e.classList.remove("underline-tab")
  7363. })
  7364. }
  7365. var a = e("../../enum/Viewmode")
  7366. , s = e("../../enum/HelpModalType")
  7367. , l = e("./HelpEvent")
  7368. , c = (e("../helpManager"),
  7369. e("./../populateModal"))
  7370. , h = e("../../settings")
  7371. , u = e("../../util/common")
  7372. , d = e("events").EventEmitter
  7373. , p = $(".footer-help").eq(0)
  7374. , f = $("#help-dialog").eq(0)
  7375. , g = document.querySelector("#quick-logo")
  7376. , m = document.querySelector("#loaderCoBrand")
  7377. , v = document.querySelector("#help-dialog")
  7378. , y = document.querySelector(".footer")
  7379. , A = $(".help-tabs").children().toArray()
  7380. , C = $(".navigation-tab").eq(0)
  7381. , I = $(".more-help-tab").eq(0)
  7382. , E = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7383. f.find(".close").eq(0))
  7384. , _ = f.find(".interactions").toArray()
  7385. , b = f.find(".ui-instructions").toArray()
  7386. , w = a.PANORAMA
  7387. , T = a.PANORAMA
  7388. , x = !1
  7389. , S = {
  7390. init: function(e, t) {
  7391. w = T = t,
  7392. [v, m, g, y].forEach(function(e) {
  7393. e.classList.add(c.deviceType)
  7394. }),
  7395. n()
  7396. },
  7397. close: function() {
  7398. if (f.hasClass("open") && (this.emit(l.CLOSED),
  7399. p.removeClass("open"),
  7400. f.removeClass("open"),
  7401. v.classList.contains("fadeIn"))) {
  7402. v.classList.remove("fadeIn");
  7403. var e = T === a.TRANSITIONING ? w : T;
  7404. c.clear(_, s.NAVIGATION, e)
  7405. }
  7406. },
  7407. updateMode: function(e) {
  7408. w = T,
  7409. T = e
  7410. }
  7411. };
  7412. u.extendObject(S, d.prototype),
  7413. t.exports = S
  7414. }
  7415. , {
  7416. "../../enum/HelpModalType": 28,
  7417. "../../enum/Viewmode": 51,
  7418. "../../settings": 166,
  7419. "../../util/common": 185,
  7420. "../helpManager": 68,
  7421. "./../populateModal": 75,
  7422. "./HelpEvent": 66,
  7423. events: 202
  7424. }],
  7425. 68: [function(s, l, e) {
  7426. (function(e) {
  7427. "use strict";
  7428. var t = s("../util/browser")
  7429. , i = s("./../util/logger")
  7430. , n = s("./../settings")
  7431. , r = new i(e)
  7432. , o = function() {
  7433. var t;
  7434. try {
  7435. return t = window.localStorage.getItem("visitCount") || "0",
  7436. t = (parseFloat(t) + 1).toString(),
  7437. window.localStorage.setItem("visitCount", t),
  7438. r.debug("visitCount = " + t),
  7439. t
  7440. } catch (e) {
  7441. t = "1",
  7442. r.debug("couldn't set local storage")
  7443. }
  7444. }()
  7445. , a = !1;
  7446. l.exports = {
  7447. isHelpDisabled: function() {
  7448. return "0" === t.valueFromHash("help", null) || a
  7449. },
  7450. isLargeHelpEnabled: function() {
  7451. return ("1" === o || "1" === t.valueFromHash("help", null)) && !this.isHelpDisabled()
  7452. },
  7453. isSmallHelpEnabled: function() {
  7454. return "2" === t.valueFromHash("help", null) && !this.isHelpDisabled()
  7455. },
  7456. isHelpEnabled: function() {
  7457. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7458. },
  7459. setAutoPlay: function(e) {
  7460. a = 0 <= n.warp.auto && 1 < e
  7461. }
  7462. }
  7463. }
  7464. ).call(this, "/js/gui/helpManager.js")
  7465. }
  7466. , {
  7467. "../util/browser": 182,
  7468. "./../settings": 166,
  7469. "./../util/logger": 189
  7470. }],
  7471. 69: [function(e, t, i) {
  7472. "use strict";
  7473. function r(e) {
  7474. M || n(e) && C.hasClass("playing") || (clearTimeout(x),
  7475. T = !0,
  7476. h.close(),
  7477. function(e) {
  7478. !n(e) && S ? v.forEach(function(e) {
  7479. e.classList.remove("drawerOpen"),
  7480. e.classList.add("duringTour")
  7481. }) : C.hasClass("open") ? v.forEach(function(e) {
  7482. e.classList.remove("duringTour"),
  7483. e.classList.add("drawerOpen")
  7484. }) : P || R === g.FLOORPLAN || R === g.DOLLHOUSE || v.forEach(function(e) {
  7485. e.classList.add("fadeOut")
  7486. })
  7487. }(e),
  7488. R !== g.DOLLHOUSE && R !== g.FLOORPLAN && (E.hasClass("expand") && !_.hasClass("closed") || l.valueFromHash("title", 1),
  7489. C.hasClass("playing") || (y.forEach(function(e) {
  7490. e.classList.add("detectHover")
  7491. }),
  7492. x = setTimeout(a, c.immersive.timeToShowAgain))))
  7493. }
  7494. function o() {
  7495. C.hasClass("playing") || (clearTimeout(x),
  7496. x = setTimeout(a, c.immersive.timeToShowAgain))
  7497. }
  7498. function a() {
  7499. clearTimeout(x),
  7500. T = !1,
  7501. m.forEach(function(e) {
  7502. e.classList.remove("drawerOpen")
  7503. }),
  7504. S || v.forEach(function(e) {
  7505. e.classList.remove("duringTour")
  7506. }),
  7507. y.forEach(function(e) {
  7508. e.classList.remove("detectHover")
  7509. })
  7510. }
  7511. function s() {
  7512. T ? a() : r(),
  7513. M = !0,
  7514. setTimeout(function() {
  7515. M = !1
  7516. }, c.immersive.uiStayDuration)
  7517. }
  7518. function n(e) {
  7519. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7520. }
  7521. var l = e("../util/browser")
  7522. , c = e("../settings")
  7523. , h = e("./help/help")
  7524. , u = e("../enum/tagEvents")
  7525. , d = e("../enum/ControlEvents")
  7526. , p = e("../enum/PlayerEvents")
  7527. , f = e("../enum/DirectorEvents")
  7528. , g = (p = e("../enum/PlayerEvents"),
  7529. e("../enum/Viewmode"))
  7530. , m = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7531. , v = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7532. , y = $("#hover-bottom, #hover-top").toArray()
  7533. , A = ($("#pullTab").eq(0),
  7534. $("#playHead").eq(0),
  7535. $(".pinBottom-container").eq(0))
  7536. , C = $("#drawer").eq(0)
  7537. , I = $("#drawer-container").eq(0)
  7538. , E = $("#meta-info").eq(0)
  7539. , _ = $(".pinTop.left").eq(0)
  7540. , b = $("#player").eq(0)
  7541. , w = document.getElementById("pullTab")
  7542. , T = !1
  7543. , x = null
  7544. , S = !1
  7545. , M = !1
  7546. , R = null
  7547. , P = !1;
  7548. t.exports.init = function(e, t, i, n) {
  7549. (function(t, i, e, n) {
  7550. [g.PANORAMA, g.DOLLHOUSE, g.FLOORPLAN].forEach(function(e) {
  7551. t.controls[e].on(d.Move, r),
  7552. t.controls[e].on(d.LongTap, s)
  7553. }),
  7554. b.on("mousewheel DOMMouseScroll", r),
  7555. e.on(u.TagActivated, r),
  7556. e.on(u.TagNavigation, r),
  7557. i.on(p.FlyingEnded, o),
  7558. i.on(p.ModeChanging, function(e, t) {
  7559. P = t !== g.PANORAMA && e !== g.PANORAMA
  7560. }),
  7561. i.on(p.ModeChanged, function(e, t) {
  7562. R = i.mode,
  7563. t !== g.TRANSITIONING ? a() : r("modeChange")
  7564. }),
  7565. n.on(f.TourStart, function() {
  7566. S = !0,
  7567. r()
  7568. }),
  7569. n.on(f.TourEnd, function() {
  7570. S = !1,
  7571. a()
  7572. }),
  7573. n.on(f.ActionInterrupted, function() {
  7574. S = !1
  7575. }),
  7576. w.addEventListener("touchend", function() {
  7577. $("#pullTab").hasClass("opened") && !S && a()
  7578. }, !0)
  7579. }
  7580. )(e, t, i, n),
  7581. l.isMobile() ? (y.forEach(function(e) {
  7582. e.classList.add("mobile")
  7583. }),
  7584. A.click(a)) : (y.forEach(function(e) {
  7585. e.addEventListener("mouseleave", function() {
  7586. !b.is(":hover") && y[0].classList.contains("detectHover") && a()
  7587. }, !0)
  7588. }),
  7589. b.mouseleave(function() {
  7590. y[0].classList.contains("detectHover") && a()
  7591. })),
  7592. R = t.mode
  7593. }
  7594. ,
  7595. t.exports.hideUi = r,
  7596. t.exports.resetDrawer = function() {
  7597. I.hasClass("duringTour") || (S = !1,
  7598. r("gui"),
  7599. a())
  7600. }
  7601. }
  7602. , {
  7603. "../enum/ControlEvents": 21,
  7604. "../enum/DirectorEvents": 23,
  7605. "../enum/tagEvents": 32,
  7606. "../enum/PlayerEvents": 40,
  7607. "../enum/Viewmode": 51,
  7608. "../settings": 166,
  7609. "../util/browser": 182,
  7610. "./help/help": 67
  7611. }],
  7612. 70: [function(i, n, e) {
  7613. (function(e) {
  7614. "use strict";
  7615. var t = i("./../util/logger")
  7616. , o = i("./../settings")
  7617. , a = i("./debug")
  7618. , s = i("./../util/common")
  7619. , l = (i("./gui"),
  7620. new t(e));
  7621. o.console && $("body").append('<div id="debug-console"></div>'),
  7622. n.exports.init = function(i, n, r) {
  7623. l.debug("konami has the modelInstance");
  7624. var t = [];
  7625. $(window).on("keydown", function(e) {
  7626. t.push(e.which),
  7627. t.length > o.secretPanelWord.length && t.shift(),
  7628. s.equalLists(t, o.secretPanelWord) && (l.debug("Developer mode active."),
  7629. o.debug = !0)
  7630. }),
  7631. $(window).on("keydown", function e(t) {
  7632. o.debug && 72 === t.which && (i && r ? (a.toggle(i, n, r),
  7633. $(window).off("keydown", e)) : console.warn("sorry we're not ready yet"))
  7634. })
  7635. }
  7636. }
  7637. ).call(this, "/js/gui/konami.js")
  7638. }
  7639. , {
  7640. "./../settings": 166,
  7641. "./../util/common": 185,
  7642. "./../util/logger": 189,
  7643. "./debug": 63,
  7644. "./gui": 65
  7645. }],
  7646. 71: [function(e, t, i) {
  7647. "use strict";
  7648. function r() {
  7649. s.clear(m, l.LANDING[v]),
  7650. g.removeClass("fadeIn")
  7651. }
  7652. var o = e("../settings")
  7653. , a = (e("./help/help"),
  7654. e("./helpManager"))
  7655. , s = e("./populateModal")
  7656. , l = e("../enum/HelpModalType")
  7657. , n = e("../enum/Viewmode")
  7658. , c = e("../enum/DirectorEvents")
  7659. , h = e("../enum/PlayerEvents")
  7660. , u = $("#quick-blackout").eq(0)
  7661. , d = $("#quick-logo").eq(0)
  7662. , p = $(".quick-brand").toArray()
  7663. , f = $("#loaderCoBrand").eq(0)
  7664. , g = $("#interaction-modal").eq(0)
  7665. , m = g.find(".interaction").toArray()
  7666. , v = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7667. "");
  7668. t.exports.delayLanding = function(e) {
  7669. var t = $.Deferred();
  7670. e || t.resolve();
  7671. var i = o.startupFlyinDelay;
  7672. return e === n.PANORAMA && (i += o.dollhouse.transitionTime),
  7673. setTimeout(t.resolve.bind(t), i),
  7674. t
  7675. }
  7676. ,
  7677. t.exports.showMessage = function(e, t, i) {
  7678. var n = 0;
  7679. o.quickstart.enabled && (function(e) {
  7680. /* e && (f.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7681. d.before(f),
  7682. p = $(".quick-brand").toArray()), */
  7683. u.addClass("fadeOut")
  7684. /* setTimeout(function() {
  7685. p.forEach(function(e) {
  7686. e.classList.add("fadeIn")
  7687. })
  7688. }, o.quickstart.showTextDelay),
  7689. setTimeout(function() {
  7690. p.forEach(function(e) {
  7691. e.classList.add("fadeOut")
  7692. })
  7693. }, o.quickstart.fadeOutDelay) */
  7694. }(i),
  7695. n = o.quickstart.showTextDelay + o.quickstart.fadeOutDelay),
  7696. function(e, t) {
  7697. setTimeout(function() {
  7698. if (a.isHelpEnabled()) {
  7699. if (t(),
  7700. s.init(),
  7701. g.addClass("fadeIn landing " + s.deviceType),
  7702. a.isSmallHelpEnabled())
  7703. return void g.addClass("small");
  7704. s.fill(m, l.LANDING[v]),
  7705. g.addClass(v)
  7706. }
  7707. }, e);
  7708. var i = {
  7709. pc: ["images/pc_step1.png", "images/pc_step2.png", "images/pc_step3.png"],
  7710. mobile: ["images/phone_step1.png", "images/phone_step2.png", "images/phone_step3.png"]
  7711. }
  7712. , n = $(".nav-icon .icon");
  7713. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) && n.attr("src", i.mobile[0]);
  7714. function r(e) {
  7715. e.on("click", function() {
  7716. var e = null;
  7717. if (e = "plus" == $(this).attr("data-id") ? +n.attr("data-page") + 1 : +n.attr("data-page") - 1,
  7718. i.length < e || e < 1)
  7719. return !1;
  7720. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n.attr({
  7721. "data-page": e,
  7722. src: i.mobile[e - 1]
  7723. }) : n.attr({
  7724. "data-page": e,
  7725. src: i.pc[e - 1]
  7726. })
  7727. })
  7728. }
  7729. r($(".next-button")),
  7730. r($(".prev-button"))
  7731. }(n, function() {
  7732. e.once(h.Move, r),
  7733. t.once(c.TourStart, r)
  7734. })
  7735. }
  7736. ,
  7737. t.exports.init = function(e, t) {
  7738. v = t.mode === n.PANORAMA && t.pano && !t.pano.isAligned() ? n.OUTDOOR : t.mode
  7739. }
  7740. ,
  7741. t.exports.dismissModal = r
  7742. }
  7743. , {
  7744. "../enum/DirectorEvents": 23,
  7745. "../enum/HelpModalType": 28,
  7746. "../enum/PlayerEvents": 40,
  7747. "../enum/Viewmode": 51,
  7748. "../settings": 166,
  7749. "./help/help": 67,
  7750. "./helpManager": 68,
  7751. "./populateModal": 75
  7752. }],
  7753. 72: [function(e, t, i) {
  7754. "use strict";
  7755. var n = e("./circleLoader").circleLoader;
  7756. t.exports = {
  7757. element: $("#gui-loading"),
  7758. hide: function(e) {
  7759. n.done(),
  7760. this.element.fadeOut(1500, e)
  7761. },
  7762. show: function(e) {
  7763. this.element.fadeIn(500, function() {
  7764. this.element.css("display", "table"),
  7765. e && e()
  7766. }
  7767. .bind(this))
  7768. },
  7769. progress: function(e) {
  7770. n.set(e)
  7771. }
  7772. }
  7773. }
  7774. , {
  7775. "./circleLoader": 60
  7776. }],
  7777. 73: [function(e, t, i) {
  7778. "use strict";
  7779. var n = e("../settings")
  7780. , r = $("#memory-info")
  7781. , o = r.find("#memory-gpu")
  7782. , a = !1;
  7783. t.exports = {
  7784. show: function() {
  7785. n.profiling.enabled && (r.show(),
  7786. a = !0)
  7787. },
  7788. hide: function() {
  7789. r.hide(),
  7790. a = !1
  7791. },
  7792. toggle: function() {
  7793. a ? this.hide() : this.show()
  7794. },
  7795. update: function(e) {
  7796. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7797. }
  7798. }
  7799. }
  7800. , {
  7801. "../settings": 166
  7802. }],
  7803. 74: [function(e, t, i) {
  7804. "use strict";
  7805. e("../util/browser"),
  7806. e("../analytics");
  7807. e("../settings"),
  7808. t.exports = {
  7809. show: function(e, t) {
  7810. $("#gui-message").fadeOut(500, function() {
  7811. t()
  7812. })
  7813. }
  7814. }
  7815. }
  7816. , {
  7817. "../analytics": 4,
  7818. "../settings": 166,
  7819. "../util/browser": 182
  7820. }],
  7821. 75: [function(e, t, i) {
  7822. "use strict";
  7823. function n(e, t, i, n) {
  7824. i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  7825. }
  7826. var r = e("../util/browser")
  7827. , o = e("../localization/localize")
  7828. , a = e("../enum/HelpModalType")
  7829. , s = (e("../enum/HelpModalSize"),
  7830. e("../enum/Viewmode"));
  7831. t.exports = {
  7832. init: function() {
  7833. if (!this.hasInitialized) {
  7834. this.hasInitialized = !0,
  7835. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7836. this.assets = {},
  7837. this.assets[a.LANDING[s.PANORAMA]] = {
  7838. desktop: {
  7839. left: {
  7840. "top-info": o.ROTATE,
  7841. "big-image": "images/nav_help_mouse_drag_left.png",
  7842. keyboard: "images/nav_help_keyboard_left_right.png"
  7843. },
  7844. middle: {
  7845. "top-info": o.MOVE,
  7846. "big-image": "images/nav_help_mouse_click.png",
  7847. keyboard: "images/nav_help_keyboard_up_down.png"
  7848. },
  7849. right: {
  7850. "top-info": o.ZOOM,
  7851. "big-image": "images/nav_help_mouse_zoom.png",
  7852. keyboard: "images/nav_help_zoom_keys.png"
  7853. }
  7854. },
  7855. mobile: {
  7856. left: {
  7857. "top-info": o.ROTATE,
  7858. "big-image": "images/nav_help_gesture_drag.png"
  7859. },
  7860. middle: {
  7861. "top-info": o.MOVE,
  7862. "big-image": "images/nav_help_gesture_tap.png"
  7863. },
  7864. right: {
  7865. "top-info": o.ZOOM,
  7866. "big-image": "images/nav_help_gesture_pinch.png"
  7867. }
  7868. }
  7869. },
  7870. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7871. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7872. desktop: {
  7873. left: {
  7874. "top-info": o.ROTATE,
  7875. "big-image": "images/nav_help_mouse_drag_left.png",
  7876. keyboard: "images/nav_help_keyboard_left_right.png"
  7877. },
  7878. middle: {
  7879. "top-info": o.MOVE,
  7880. "big-image": "images/nav_help_mouse_position_right.png"
  7881. }
  7882. },
  7883. mobile: {
  7884. left: {
  7885. "top-info": o.ROTATE,
  7886. "big-image": "images/nav_help_gesture_drag.png"
  7887. },
  7888. middle: {
  7889. "top-info": o.MOVE,
  7890. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7891. }
  7892. }
  7893. },
  7894. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7895. desktop: {
  7896. left: {
  7897. "top-info": o.MOVE,
  7898. "big-image": "images/nav_help_mouse_position_left.png"
  7899. },
  7900. middle: {
  7901. "top-info": o.ROTATE,
  7902. "big-image": "images/nav_help_mouse_drag_right.png",
  7903. keyboard: "images/nav_help_keyboard_left_right.png"
  7904. }
  7905. },
  7906. mobile: {
  7907. left: {
  7908. "top-info": o.MOVE,
  7909. "big-image": "images/nav_help_gesture_position.png"
  7910. },
  7911. middle: {
  7912. "top-info": o.ROTATE,
  7913. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7914. }
  7915. }
  7916. };
  7917. var e = {
  7918. "top-info": o.INSIDE,
  7919. "big-image": "images/nav_help_click_inside.png",
  7920. keyboard: "images/nav_help_inside_key.png"
  7921. };
  7922. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7923. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7924. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7925. var t = {
  7926. "top-info": o.INSIDE,
  7927. "big-image": "images/nav_help_tap_inside.png"
  7928. };
  7929. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7930. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7931. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7932. this.assets[a.NAVIGATION] = {},
  7933. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7934. desktop: {
  7935. left: {
  7936. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7937. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7938. "big-image": "images/nav_help_mouse_drag_left.png",
  7939. keyboard: "images/nav_help_keyboard_left_right.png"
  7940. },
  7941. middle: {
  7942. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7943. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7944. "big-image": "images/nav_help_mouse_click.png",
  7945. keyboard: "images/nav_help_keyboard_up_down.png"
  7946. },
  7947. right: {
  7948. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7949. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7950. "big-image": "images/nav_help_mouse_zoom.png",
  7951. keyboard: "images/nav_help_zoom_keys.png"
  7952. }
  7953. },
  7954. mobile: {
  7955. left: {
  7956. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7957. "big-image": "images/nav_help_gesture_drag.png"
  7958. },
  7959. middle: {
  7960. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7961. "big-image": "images/nav_help_gesture_tap.png"
  7962. },
  7963. right: {
  7964. "top-info": o.HELP_MOBILE_3,
  7965. "big-image": "images/nav_help_gesture_pinch.png"
  7966. }
  7967. }
  7968. },
  7969. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7970. desktop: {
  7971. left: {
  7972. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7973. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7974. "big-image": "images/nav_help_mouse_drag_left.png",
  7975. keyboard: "images/nav_help_keyboard_all.png"
  7976. },
  7977. middle: {
  7978. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  7979. "big-image": "images/nav_help_mouse_position_right.png"
  7980. },
  7981. right: {
  7982. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  7983. "big-image": "images/nav_help_mouse_zoom.png"
  7984. }
  7985. },
  7986. mobile: {
  7987. left: {
  7988. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  7989. "big-image": "images/nav_help_gesture_drag.png"
  7990. },
  7991. middle: {
  7992. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  7993. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7994. },
  7995. right: {
  7996. "top-info": o.HELP_MOBILE_3,
  7997. "big-image": "images/nav_help_gesture_pinch.png"
  7998. }
  7999. }
  8000. },
  8001. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  8002. desktop: {
  8003. left: {
  8004. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  8005. "big-image": "images/nav_help_mouse_position_left.png"
  8006. },
  8007. middle: {
  8008. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  8009. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  8010. "big-image": "images/nav_help_mouse_drag_right.png",
  8011. keyboard: "images/nav_help_keyboard_left_right.png"
  8012. },
  8013. right: {
  8014. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  8015. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  8016. "big-image": "images/nav_help_mouse_zoom.png",
  8017. keyboard: "images/nav_help_keyboard_up_down.png"
  8018. }
  8019. },
  8020. mobile: {
  8021. left: {
  8022. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  8023. "big-image": "images/nav_help_gesture_position.png"
  8024. },
  8025. middle: {
  8026. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  8027. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  8028. },
  8029. right: {
  8030. "top-info": o.HELP_MOBILE_3,
  8031. "big-image": "images/nav_help_gesture_pinch.png"
  8032. }
  8033. }
  8034. },
  8035. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  8036. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  8037. "top-info": o.HELP_DESKTOP_360_2A,
  8038. "bottom-info": o.HELP_DESKTOP_360_2B,
  8039. "big-image": "images/nav_help_click_inside.png",
  8040. keyboard: "images/nav_help_inside_key.png"
  8041. },
  8042. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  8043. "top-info": o.HELP_MOBILE_360_2,
  8044. "big-image": "images/nav_help_tap_inside.png"
  8045. },
  8046. this.assets[a.MORE_HELP] = {
  8047. desktop: {
  8048. "more-help-hlr": {
  8049. "top-info": o.HELP_MORE_HLR_A,
  8050. "big-image": "images/nav_help_expand.svg",
  8051. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8052. },
  8053. "more-help-dollhouse": {
  8054. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8055. "big-image": "images/nav_help_dollhouse.svg",
  8056. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8057. },
  8058. "more-help-floors": {
  8059. "top-info": o.HELP_MORE_FLOORS_A,
  8060. "big-image": "images/nav_help_floor picker.svg",
  8061. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8062. },
  8063. "more-help-tag": {
  8064. "top-info": o.HELP_MORE_TAG_A,
  8065. "big-image": "images/nav_help_tag.svg",
  8066. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  8067. },
  8068. "more-help-zoom": {
  8069. "top-info": o.HELP_MORE_ZOOM_A,
  8070. "big-image": "images/nav_help_zoom.svg",
  8071. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  8072. },
  8073. "more-help-tour": {
  8074. "top-info": o.HELP_MORE_TOUR_A,
  8075. "big-image": "images/nav_help_play.png",
  8076. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8077. },
  8078. "more-help-inside": {
  8079. "top-info": o.HELP_MORE_INSIDE_A,
  8080. "big-image": "images/nav_help_inside.svg",
  8081. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  8082. },
  8083. "more-help-vr": {
  8084. "top-info": o.HELP_MORE_VR_A,
  8085. "big-image": "images/nav_help_vr.svg",
  8086. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  8087. },
  8088. "more-help-360": {
  8089. "top-info": o.HELP_MORE_360_A,
  8090. "big-image": "images/nav_help_360.svg",
  8091. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  8092. },
  8093. "more-help-fullscreen": {
  8094. "top-info": o.HELP_MORE_FULLSCREEN_A,
  8095. "big-image": "images/nav_help_fullscreen.svg",
  8096. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8097. }
  8098. },
  8099. mobile: {
  8100. "more-help-hlr": {
  8101. "top-info": o.HELP_MORE_HLR_A,
  8102. "big-image": "images/nav_help_expand.svg",
  8103. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8104. },
  8105. "more-help-dollhouse": {
  8106. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8107. "big-image": "images/nav_help_dollhouse.svg",
  8108. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8109. },
  8110. "more-help-floors": {
  8111. "top-info": o.HELP_MORE_FLOORS_A,
  8112. "big-image": "images/nav_help_floor picker.svg",
  8113. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8114. },
  8115. "more-help-tag": {
  8116. "top-info": o.HELP_MORE_TAG_A,
  8117. "big-image": "images/nav_help_tag.svg",
  8118. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8119. },
  8120. "more-help-tour": {
  8121. "top-info": o.HELP_MORE_TOUR_A,
  8122. "big-image": "images/nav_help_play.png",
  8123. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8124. },
  8125. "more-help-inside": {
  8126. "top-info": o.HELP_MORE_INSIDE_A,
  8127. "big-image": "images/nav_help_inside.svg",
  8128. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8129. },
  8130. "more-help-vr": {
  8131. "top-info": o.HELP_MORE_VR_A,
  8132. "big-image": "images/webvr.svg",
  8133. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8134. },
  8135. "more-help-360": {
  8136. "top-info": o.HELP_MORE_360_A,
  8137. "big-image": "images/nav_help_360.svg",
  8138. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8139. }
  8140. }
  8141. },
  8142. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8143. desktop: {
  8144. left: {
  8145. "top-info": o.ROTATE,
  8146. "big-image": "images/nav_help_mouse_drag_left.png",
  8147. keyboard: "images/nav_help_keyboard_left_right.png"
  8148. },
  8149. middle: {
  8150. "top-info": o.MOVE,
  8151. "big-image": "images/nav_help_mouse_click.png",
  8152. keyboard: "images/nav_help_keyboard_up_down.png"
  8153. },
  8154. right: {
  8155. "top-info": o.PLAY,
  8156. "big-image": "images/Desktop-help-play-button.svg",
  8157. keyboard: "images/Desktop-help-spacebar-2.svg"
  8158. }
  8159. },
  8160. mobile: {
  8161. left: {
  8162. "top-info": o.ROTATE,
  8163. "big-image": "images/nav_help_gesture_drag.png"
  8164. },
  8165. middle: {
  8166. "top-info": o.MOVE,
  8167. "big-image": "images/nav_help_gesture_tap.png"
  8168. },
  8169. right: {
  8170. "top-info": o.PLAY,
  8171. "big-image": "images/mobile-help-play-button.svg"
  8172. }
  8173. }
  8174. },
  8175. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8176. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8177. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8178. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8179. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8180. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8181. }
  8182. },
  8183. fill: function(e, t, i) {
  8184. n.call(this, e, t, i, !0)
  8185. },
  8186. clear: function(e, t, i) {
  8187. n.call(this, e, t, i, !1)
  8188. }
  8189. }
  8190. }
  8191. , {
  8192. "../enum/HelpModalSize": 27,
  8193. "../enum/HelpModalType": 28,
  8194. "../enum/Viewmode": 51,
  8195. "../localization/localize": 108,
  8196. "../util/browser": 182
  8197. }],
  8198. 76: [function(e, t, i) {
  8199. "use strict";
  8200. t.exports = Object.freeze({
  8201. OPENED: "share.open",
  8202. CLOSED: "share.closed",
  8203. LINK_CLICKED: "share.linked"
  8204. })
  8205. }
  8206. , {}],
  8207. 77: [function(e, t, i) {
  8208. "use strict";
  8209. function n(n) {
  8210. function e(e, t) {
  8211. var i = "top=" + (window.screenY + ($("#player").height() - t) / 2) + ",left=" + (window.screenX + ($("#player").width() - e) / 2) + ",width=" + e + ",height=" + t;
  8212. I.emit(l.LINK_CLICKED, {
  8213. channel: n
  8214. }),
  8215. window.open(C[n], "shareWindow", i)
  8216. }
  8217. switch (n) {
  8218. case A.FACEBOOK:
  8219. e(580, 420);
  8220. break;
  8221. case A.TWITTER:
  8222. e(550, 440);
  8223. break;
  8224. case A.MAIL:
  8225. I.emit(l.LINK_CLICKED, {
  8226. channel: "email"
  8227. }),
  8228. window.open(C[n], "_blank");
  8229. break;
  8230. case A.LINKEDIN:
  8231. }
  8232. }
  8233. function r(e) {
  8234. I.emit(l.LINK_CLICKED, {
  8235. channel: "copylink"
  8236. });
  8237. var t = document.createRange();
  8238. t.selectNodeContents(v);
  8239. var i = window.getSelection();
  8240. i.removeAllRanges(),
  8241. i.addRange(t),
  8242. document.execCommand("copy"),
  8243. y.classList.remove("hidden"),
  8244. v.classList.add("highlighted")
  8245. }
  8246. function o(e) {
  8247. e && (e.stopPropagation(),
  8248. e.target === v) || (window.getSelection().removeAllRanges(),
  8249. v.classList.remove("highlighted"),
  8250. y.classList.add("hidden"))
  8251. }
  8252. var a = e("../../util/browser")
  8253. , s = e("../../localization/localize")
  8254. , l = e("./ShareEvents")
  8255. , c = e("../../util/common")
  8256. , h = e("events").EventEmitter
  8257. , u = document.getElementById("sharing")
  8258. , d = document.getElementById("share-modal")
  8259. , p = document.getElementById("share-close")
  8260. , f = document.getElementById("facebook-share")
  8261. , g = document.getElementById("twitter-share")
  8262. , m = document.getElementById("mail-share")
  8263. , v = document.getElementById("share-url-text")
  8264. , y = document.getElementById("copy-success")
  8265. , A = Object.freeze({
  8266. FACEBOOK: "facebook",
  8267. TWITTER: "twitter",
  8268. MAIL: "mail",
  8269. LINKEDIN: "linkedin"
  8270. })
  8271. , C = {};
  8272. C[A.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8273. C[A.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8274. C[A.MAIL] = "mailto:?subject=";
  8275. var I = {
  8276. init: function(e) {
  8277. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8278. C[A.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8279. C[A.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8280. C[A.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8281. u.addEventListener("click", this.toggle.bind(this)),
  8282. p.addEventListener("click", this.hide.bind(this)),
  8283. v.addEventListener("click", r),
  8284. d.addEventListener("click", o),
  8285. f.addEventListener("click", n.bind(this, A.FACEBOOK)),
  8286. g.addEventListener("click", n.bind(this, A.TWITTER)),
  8287. m.addEventListener("click", n.bind(this, A.MAIL)),
  8288. v.textContent = window.location.href + "&utm_source=4",
  8289. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8290. u.classList.remove("hidden")
  8291. },
  8292. show: function() {
  8293. this.emit(l.OPENED),
  8294. d.classList.add("fadeIn")
  8295. },
  8296. hide: function() {
  8297. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8298. document.selection && document.selection.empty(),
  8299. window.getSelection().removeAllRanges(),
  8300. o(),
  8301. d.classList.remove("fadeIn"))
  8302. },
  8303. toggle: function() {
  8304. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8305. }
  8306. };
  8307. c.extendObject(I, h.prototype),
  8308. t.exports = I
  8309. }
  8310. , {
  8311. "../../localization/localize": 108,
  8312. "../../util/browser": 182,
  8313. "../../util/common": 185,
  8314. "./ShareEvents": 76,
  8315. events: 202
  8316. }],
  8317. 78: [function(e, t, i) {
  8318. "use strict";
  8319. t.exports = Object.freeze({
  8320. OPENED: "terms.opened",
  8321. CLOSED: "terms.closed"
  8322. })
  8323. }
  8324. , {}],
  8325. 79: [function(e, t, i) {
  8326. "use strict";
  8327. var n = e("./TermsEvent")
  8328. , r = e("../../localization/localize")
  8329. , o = e("../../analytics")
  8330. , a = e("../../util/ajax")
  8331. , s = e("../../util/common")
  8332. , l = e("events").EventEmitter
  8333. , c = document.getElementById("terms-modal")
  8334. , h = {
  8335. init: function() {
  8336. $(".footer-terms").on("click", function(e) {
  8337. e.preventDefault(),
  8338. this.show()
  8339. }
  8340. .bind(this)),
  8341. $("#terms-modal .close").on("click", this.hide.bind(this))
  8342. },
  8343. show: function() {
  8344. this.emit(n.OPENED),
  8345. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8346. var t = $("#terms-text").html(e);
  8347. o.track("showcase_gui", {
  8348. gui_action: "click_terms_button",
  8349. interaction_source: "gui"
  8350. }),
  8351. t.find("a").attr("target", "_blank")
  8352. }).fail(function() {
  8353. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8354. }),
  8355. c.classList.add("fadeIn")
  8356. },
  8357. hide: function(e) {
  8358. e && e.preventDefault(),
  8359. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8360. c.classList.remove("fadeIn")
  8361. }
  8362. };
  8363. s.extendObject(h, l.prototype),
  8364. t.exports = h
  8365. }
  8366. , {
  8367. "../../analytics": 4,
  8368. "../../localization/localize": 108,
  8369. "../../util/ajax": 181,
  8370. "../../util/common": 185,
  8371. "./TermsEvent": 78,
  8372. events: 202
  8373. }],
  8374. 80: [function(e, t, i) {
  8375. "use strict";
  8376. t.exports = Object.freeze({
  8377. OPEN_INFO: "title.open.info",
  8378. CLOSE_INFO: "title.close.info",
  8379. SHOW_INFO: "title.show.info",
  8380. HIDE_INFO: "title.hide.info",
  8381. LINK_CLICKED: "title.link.click",
  8382. CONTACT_LINK_CLICKED: "title.contact.click",
  8383. ORIGIN_LINK_CLICKED: "title.origin.click"
  8384. })
  8385. }
  8386. , {}],
  8387. 81: [function(e, t, i) {
  8388. "use strict";
  8389. var o = e("../../settings");
  8390. t.exports.init = function(e, t) {
  8391. o.tags.enabled && 0 !== Object.keys(e.tags).length && function(t, i) {
  8392. function e(e) {
  8393. t.shouldShowtags = "show" === this.value,
  8394. t.shouldShowtags ? i.showAlltags(o.tags.startup.fadeInDuration) : i.hideAlltags(o.tags.startup.fadeInDuration)
  8395. }
  8396. document.getElementById("tag-toggles").classList.remove("hidden"),
  8397. document.getElementById("radio-tag-show").checked = !0;
  8398. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8399. n[r].addEventListener("change", e)
  8400. }(e, t)
  8401. }
  8402. }
  8403. , {
  8404. "../../settings": 166
  8405. }],
  8406. 82: [function(S, M, e) {
  8407. (function(e) {
  8408. "use strict";
  8409. function i(e) {
  8410. return !(!e || l.inIframe() && document.referrer === e || (E.classList.remove("hidden"),
  8411. _.innerHTML = r.WEBVR_LEARN_MORE + ": ",
  8412. _.appendChild(function(e) {
  8413. var t = document.createElement("a");
  8414. return t.id = "url",
  8415. t.target = "_blank",
  8416. t.href = e,
  8417. t.innerText = e,
  8418. t.addEventListener("click", x.emit.bind(x, a.ORIGIN_LINK_CLICKED)),
  8419. t
  8420. }(e)),
  8421. b.forEach(function(e) {
  8422. e.classList.add("share-link")
  8423. }),
  8424. 0))
  8425. }
  8426. function s(e, t) {
  8427. var i = e
  8428. , n = t;
  8429. return function(e, t) {
  8430. i.push(t || n, e)
  8431. }
  8432. }
  8433. var l = S("../../util/browser")
  8434. , t = S("../../util/common")
  8435. , n = S("../../util/logger")
  8436. , r = S("../../localization/localize")
  8437. , o = S("./titleBarSettings")
  8438. , c = S("../../settings")
  8439. , a = S("./TitleEvents")
  8440. , h = S("events").EventEmitter
  8441. , u = new n(e)
  8442. , d = document.querySelector(".pinTop.left")
  8443. , p = document.getElementsByClassName("title-container")[0]
  8444. , f = document.getElementById("title-toggle").querySelector("i")
  8445. , g = document.getElementById("meta-info-wrapper")
  8446. , m = document.getElementById("meta-info")
  8447. , v = document.getElementById("meta-description")
  8448. , y = document.getElementsByClassName("contact-info")[0]
  8449. , A = document.getElementById("contact-data")
  8450. , C = document.getElementById("addressTxt")
  8451. , I = document.getElementById("tag-toggles")
  8452. , E = document.getElementById("share-origin")
  8453. , _ = document.getElementById("share-link-wrapper")
  8454. , b = [m, g, p]
  8455. , w = !1
  8456. , T = !1
  8457. , x = {
  8458. populate: function(e) {
  8459. if (function(e, t) {
  8460. return e && l.valueFromHash("title", 1) && 2 !== l.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8461. (g_weixinObj.title = e).length > o.minTooltipCharacters && p.parentElement.setAttribute("data-original-title", e),
  8462. t && 1 !== c.specialEdition && c.brand && !c.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8463. document.getElementById("gui-name").classList.add("noCoBrand"),
  8464. document.getElementById("cobrandTitle").classList.add("hidden")),
  8465. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8466. !1)
  8467. }(DATA.name, e.coBrand)) {
  8468. if (function(e) {
  8469. e ? (w = !0,
  8470. v.innerHTML = e) : v.classList.add("hidden")
  8471. }(e.description),
  8472. function(e, t, i, n) {
  8473. if ((e || t || i) && c.brand && !l.valueFromHash("mls", !1)) {
  8474. w = !0;
  8475. var r = []
  8476. , o = s(r, "<br>");
  8477. if (e && o('<span id="contactName">' + e + "</span>"),
  8478. t) {
  8479. var a = n || t;
  8480. o(l.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>")
  8481. }
  8482. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8483. r[0] = "",
  8484. A.innerHTML = r.join("")
  8485. } else
  8486. y.classList.add("hidden")
  8487. }(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8488. function(e) {
  8489. if ("string" == typeof e)
  8490. try {
  8491. e = JSON.parse(e)
  8492. } catch (e) {
  8493. return u.warn("Unable to parse address data"),
  8494. C.parentElement.classList.add("hidden")
  8495. }
  8496. if (e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)) {
  8497. w = !0;
  8498. var t = []
  8499. , i = s(t, " ");
  8500. e.address_1 && i(e.address_1),
  8501. e.address_2 && i(e.address_2),
  8502. e.city && i(e.city, ", "),
  8503. e.state && i(e.state, ", "),
  8504. e.zip && i(e.zip, e.state ? " " : ", "),
  8505. t[0] = "",
  8506. C.innerText = t.join("")
  8507. } else
  8508. C.parentElement.classList.add("hidden")
  8509. }(e.address),
  8510. w) {
  8511. var t = document.createElement("br");
  8512. I.insertBefore(t, I.firstElementChild)
  8513. }
  8514. e.socialSharing && c.share.enabled && (T = i(e.url))
  8515. }
  8516. },
  8517. finishSetup: function(e) {
  8518. w = w || !!e,
  8519. document.getElementById("title-toggle").addEventListener("click", x.toggleTitle.bind(x)),
  8520. w && p.addEventListener("click", x.toggleMeta.bind(x, !1)),
  8521. [].slice.call(v.querySelectorAll("a")).forEach(function(e) {
  8522. e.addEventListener("click", x.emit.bind(x, a.LINK_CLICKED))
  8523. }),
  8524. [].slice.call(y.querySelectorAll("a")).forEach(function(e) {
  8525. e.addEventListener("click", x.emit.bind(x, a.CONTACT_LINK_CLICKED, {
  8526. contact_type: e.getAttribute("id")
  8527. }))
  8528. }),
  8529. w || (T ? p.classList.add("share-only") : p.classList.add("no-meta"))
  8530. },
  8531. toggleMeta: function(e, t) {
  8532. var i = document.getElementById("model-title");
  8533. t && t.preventDefault();
  8534. var n = m.classList.contains("expand");
  8535. e && !n || (n ? (b.forEach(function(e) {
  8536. e.classList.remove("expand")
  8537. }),
  8538. this.emit(a.CLOSE_INFO),
  8539. i.classList.remove("expand")) : (b.forEach(function(e) {
  8540. e.classList.add("expand")
  8541. }),
  8542. i.classList.add("expand"),
  8543. this.emit(a.OPEN_INFO)))
  8544. },
  8545. setupToggling: function() {
  8546. g.style.height = m.offsetHeight + "px",
  8547. m.addEventListener("transitionend", function() {
  8548. g.style.height = m.offsetHeight + "px"
  8549. })
  8550. },
  8551. toggleTitle: function(e) {
  8552. e && e.preventDefault(),
  8553. d.classList.contains("closed") ? (d.classList.add("open"),
  8554. f.classList.remove("icon-dpad-right"),
  8555. f.classList.add("icon-dpad-left"),
  8556. this.emit(a.SHOW_INFO),
  8557. setTimeout(function() {
  8558. d.classList.remove("closed"),
  8559. d.classList.remove("open")
  8560. }, o.removeAnimationClasses)) : (d.classList.add("closed"),
  8561. f.classList.remove("icon-dpad-left"),
  8562. f.classList.add("icon-dpad-right"),
  8563. this.emit(a.HIDE_INFO))
  8564. }
  8565. };
  8566. t.extendObject(x, h.prototype),
  8567. M.exports = x
  8568. }
  8569. ).call(this, "/js/gui/title/titleBar.js")
  8570. }
  8571. , {
  8572. "../../localization/localize": 108,
  8573. "../../settings": 166,
  8574. "../../util/browser": 182,
  8575. "../../util/common": 185,
  8576. "../../util/logger": 189,
  8577. "./TitleEvents": 80,
  8578. "./titleBarSettings": 83,
  8579. events: 202
  8580. }],
  8581. 83: [function(e, t, i) {
  8582. "use strict";
  8583. t.exports = Object.freeze({
  8584. minTooltipCharacters: 19,
  8585. removeAnimationClasses: 500
  8586. })
  8587. }
  8588. , {}],
  8589. 84: [function(e, t, i) {
  8590. "use strict";
  8591. function n() {
  8592. v.playTour(),
  8593. y && clearTimeout(y),
  8594. c(),
  8595. E.removeClass("fadeIn")
  8596. }
  8597. function r() {
  8598. A.classList.contains("playing") && (v.stopTour(),
  8599. E.addClass("fadeIn"),
  8600. setTimeout(function() {
  8601. E.removeClass("fadeIn")
  8602. }, h.tourInteraction.showPauseButton),
  8603. M || (clearTimeout(y),
  8604. y = setTimeout(s, h.tourInteraction.showModal)),
  8605. setTimeout(function() {
  8606. A.classList.remove("playing")
  8607. }, h.tourInteraction.allowNextClick))
  8608. }
  8609. function o() {
  8610. v.tourInProgress && (v.stopTour(),
  8611. v.endTourProgress(),
  8612. A.classList.remove("playing"))
  8613. }
  8614. function a() {
  8615. _.is(":visible") ? n() : r()
  8616. }
  8617. function s() {//去掉导览结束时的提示
  8618. /* if (!h.tourInteraction.disabled) {
  8619. T.removeClass("small landing " + d.FLOORPLAN + " " + d.OUTDOOR + " " + d.PANORAMA),
  8620. T.addClass("fadeIn tour " + p.deviceType);
  8621. var e, t = h.tourInteraction.smallModal ? m.SMALL : m.LARGE;
  8622. if (!h.tourInteraction.smallModal)
  8623. 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,
  8624. p.fill(x, g.TOUR_INTERACTION[e]),
  8625. T.addClass(e);
  8626. T.addClass(t)
  8627. } */
  8628. }
  8629. function l(e, t) {
  8630. if (t) {
  8631. var i = "keydown" === t.type
  8632. , n = t.which === u.SPACE || v.tourIsPlaying;
  8633. i && n || e || (M = !0),
  8634. v.atEndOfTour() && c(),
  8635. !v.tourIsPlaying && v.tourInProgress && (E.removeClass("fadeIn"),
  8636. c(),
  8637. t.which !== u.SPACE && o()),
  8638. i && n && a()
  8639. }
  8640. }
  8641. function c() {
  8642. T.removeClass("fadeIn")
  8643. }
  8644. var h = (e("../util/browser"),
  8645. e("../settings"))
  8646. , u = e("../enum/Keys")
  8647. , d = e("../enum/Viewmode")
  8648. , p = (e("./helpManager"),
  8649. e("./populateModal"))
  8650. , f = e("../enum/DirectorEvents")
  8651. , g = e("../enum/HelpModalType")
  8652. , m = e("../enum/HelpModalSize")
  8653. , v = null
  8654. , y = null
  8655. , A = document.getElementById("pause-overlay")
  8656. , C = document.getElementById("player")
  8657. , I = document.getElementById("gui")
  8658. , E = $("#pause-icon").eq(0)
  8659. , _ = $("#play").eq(0)
  8660. , b = $("#playHead").eq(0)
  8661. , w = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8662. , T = $("#interaction-modal").eq(0)
  8663. , x = $("#interaction-modal .interaction").toArray()
  8664. , S = ["touchstart", "mousedown", "pointerdown"]
  8665. , M = !1;
  8666. t.exports.init = function(e) {
  8667. v = e,
  8668. S.forEach(function(t) {
  8669. C.addEventListener(t, l.bind(this, !1), !0),
  8670. I.addEventListener(t, l.bind(this, !0), !0),
  8671. A.addEventListener(t, r, !0),
  8672. w.forEach(function(e) {
  8673. e.addEventListener(t, o, !0)
  8674. }),
  8675. $("#drawer img").on(t, o)
  8676. }),
  8677. document.addEventListener("keydown", l.bind(this, !1), !0),
  8678. v.on(f.TourStart, function() {
  8679. A.classList.add("playing")
  8680. })
  8681. }
  8682. ,
  8683. t.exports.play = n,
  8684. t.exports.pause = r,
  8685. t.exports.pauseWithoutCTA = o,
  8686. t.exports.togglePlay = a,
  8687. t.exports.stopTour = function() {
  8688. b.hasClass("playing") && (clearTimeout(y),
  8689. v.atEndOfTour() ? (A.classList.remove("playing"),
  8690. s()) : E.removeClass("fadeIn"))
  8691. }
  8692. ,
  8693. t.exports.dismissModal = c
  8694. }
  8695. , {
  8696. "../enum/DirectorEvents": 23,
  8697. "../enum/HelpModalSize": 27,
  8698. "../enum/HelpModalType": 28,
  8699. "../enum/Keys": 30,
  8700. "../enum/Viewmode": 51,
  8701. "../settings": 166,
  8702. "../util/browser": 182,
  8703. "./helpManager": 68,
  8704. "./populateModal": 75
  8705. }],
  8706. 85: [function(e, t, i) {
  8707. "use strict";
  8708. t.exports = Object.freeze({
  8709. OPENED: "vr.modal.opened",
  8710. LAUNCH: "vr.modal.launch",
  8711. CLOSED: "vr.modal.closed",
  8712. NEXT: "vr.modal.next",
  8713. PREV: "vr.modal.prev",
  8714. STORE: "vr.modal.store",
  8715. falseICECHOSEN: "vr.modal.device"
  8716. })
  8717. }
  8718. , {}],
  8719. 86: [function(e, t, i) {
  8720. "use strict";
  8721. var h = e("../../util/browser")
  8722. , u = e("../../enum/VRApps")
  8723. , n = e("../../enum/VRPlatforms")
  8724. , d = e("../../util/ajax")
  8725. , p = e("../../settings")
  8726. , r = {};
  8727. for (var o in r[u.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8728. r[u.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8729. r[u.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=",
  8730. u) {
  8731. var a = u[o];
  8732. r[a] += encodeURIComponent(document.referrer + "&display=" + a)
  8733. }
  8734. var s, f = {}, g = (-1 === (s = window.location.host).indexOf(".port.com") && -1 === s.indexOf("localhost") && (s = "my.port.com"),
  8735. "https://" + s);
  8736. t.exports.init = function(e, t, o) {
  8737. function a(e, t, i, n) {
  8738. function r() {
  8739. return "&utm_medium=" + (h.inIframe() ? "embed" : "direct") + ("&utm_source=" + s) + ("&utm_showcase_session_id=" + o)
  8740. }
  8741. 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()
  8742. }
  8743. var s = h.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8744. , l = g + "/vr/dlist/?ret=" + s
  8745. , c = g + "/vr/show/?ret=" + s;
  8746. switch (e) {
  8747. case n.IOS:
  8748. !function(t, e, i, n) {
  8749. var r = a(t, e, i, n)
  8750. , o = {
  8751. responseType: "json",
  8752. data: {
  8753. branch_key: p.appConfig.branch_key,
  8754. data: {
  8755. m: e,
  8756. full_url: r,
  8757. $desktop_url: "",
  8758. $og_app_id: "331853976762864119",
  8759. $og_title: i,
  8760. $og_description: n,
  8761. $og_image_url: location.origin + "/api/v1/player/models/" + e + "/thumb",
  8762. $canonical_url: window.location.href
  8763. }
  8764. }
  8765. };
  8766. d.post("https://api.branch.io/v1/url", o).done(function(e) {
  8767. f[t] = e.url
  8768. }).fail(function(e) {
  8769. f[t] = e
  8770. }
  8771. .bind(this, r))
  8772. }(u.CardboardIOS, t.sid, t.name, t.summary);
  8773. break;
  8774. default:
  8775. !function(e, t, i) {
  8776. for (var n in u) {
  8777. var r = u[n]
  8778. , o = a(r, e, t, i);
  8779. f[r] = o
  8780. }
  8781. }(t.sid, t.name, t.summary)
  8782. }
  8783. }
  8784. ,
  8785. t.exports.launch = function(e) {
  8786. var t = f[e];
  8787. window.open(t, "_blank")
  8788. }
  8789. ,
  8790. t.exports.launchStore = function(e) {
  8791. var t = r[e];
  8792. window.open(t, "_blank")
  8793. }
  8794. }
  8795. , {
  8796. "../../enum/VRApps": 46,
  8797. "../../enum/VRPlatforms": 49,
  8798. "../../settings": 166,
  8799. "../../util/ajax": 181,
  8800. "../../util/browser": 182
  8801. }],
  8802. 87: [function(e, t, i) {
  8803. "use strict";
  8804. function c(e) {
  8805. var t;
  8806. switch (e) {
  8807. case y.IOS:
  8808. return 9 < (t = g.iosVersion()).major || 9 === t.major && 1 <= t.minor;
  8809. case y.Android:
  8810. return 4 < (t = g.androidVersion()).major || 4 === t.major && 4 < t.minor || 4 === t.major && 4 === t.minor && 4 <= t.patch
  8811. }
  8812. return !1
  8813. }
  8814. function h(e) {
  8815. switch (e) {
  8816. case y.Android:
  8817. x.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8818. x.filter(".gearvr").off().on("click", q.gear),
  8819. n(k, U, "logo-button", "same-line");
  8820. break;
  8821. case y.UnsupportedAndroid:
  8822. n("", H, "", "");
  8823. break;
  8824. case y.IOS:
  8825. x.filter(".cardboard").off().on("click", q.cardboardIOS),
  8826. n(k, "", "logo-button", "");
  8827. break;
  8828. case y.Desktop:
  8829. x.filter(".cardboard").off().on("click", r.bind(this, null, N, B)),
  8830. x.filter(".gearvr").off().on("click", r.bind(this, U, F, null)),
  8831. n(k, U, "logo-button", "same-line"),
  8832. Q.cardboard()
  8833. }
  8834. }
  8835. function u(e) {
  8836. $(".p1, .p2, .p3").hide(),
  8837. l.insertAfter(T),
  8838. w.removeClass("front-page"),
  8839. w.removeClass("details-page"),
  8840. w.removeClass("lastPage"),
  8841. x.removeClass("logo-button"),
  8842. x.removeClass("same-line"),
  8843. T.removeClass("headsetOptions"),
  8844. S.attr("src", ""),
  8845. S.filter(".second").removeClass("gear"),
  8846. S.css("display", "inline-block"),
  8847. S.off(),
  8848. M.filter(".second").css("display", ""),
  8849. O.css("display", "none"),
  8850. $(".p" + (e + 1) + _).show(),
  8851. S.filter(".third").insertBefore(M.filter(".third"))
  8852. }
  8853. function n(e, t, i, n) {
  8854. w.addClass("front-page"),
  8855. S.filter(".first").attr("src", e),
  8856. S.filter(".second").attr("src", t),
  8857. x.filter(".first").addClass(i),
  8858. x.filter(".second").addClass(i),
  8859. x.addClass(n),
  8860. ".show-desktop" === _ && T.insertAfter(l)
  8861. }
  8862. function r(e, t, i) {
  8863. T.addClass("headsetOptions"),
  8864. x.off(),
  8865. S.filter(".second").attr("src", t),
  8866. O.css("display", "block"),
  8867. M.filter(".second").css("display", "none"),
  8868. O.on("click", function() {
  8869. u(b.Title),
  8870. h(y.Desktop)
  8871. }),
  8872. e && (X.emit(C.falseICECHOSEN, {
  8873. name: v.GearVR
  8874. }),
  8875. S.filter(".first").attr("src", e),
  8876. S.filter(".second").addClass("gear"),
  8877. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8878. Q.gearvr()),
  8879. i && (X.emit(C.falseICECHOSEN, {
  8880. name: v.Cardboard
  8881. }),
  8882. S.filter(".third").attr("src", i),
  8883. S.filter(".third").show(),
  8884. S.filter(".third").insertAfter(S.filter(".second")),
  8885. S.filter(".third").addClass("link"),
  8886. S.filter(".second").addClass("link"),
  8887. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8888. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid)),
  8889. Q.cardboard())
  8890. }
  8891. function d(e, t) {
  8892. switch (t) {
  8893. case y.IOS:
  8894. j = W,
  8895. Y = G;
  8896. break;
  8897. case y.Desktop:
  8898. e === b.Cardboard ? (j = N,
  8899. Y = B,
  8900. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8901. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid))) : (j = F,
  8902. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8903. Y = "");
  8904. break;
  8905. default:
  8906. Y = e === b.Cardboard ? (j = H,
  8907. G) : (j = V,
  8908. z)
  8909. }
  8910. }
  8911. function p(e, t, i) {
  8912. w.find(".inner").addClass("details-page"),
  8913. w.addClass("details-page"),
  8914. S.filter(".first").attr("src", e),
  8915. S.filter(".second").attr("src", t),
  8916. S.filter(".third").attr("src", i)
  8917. }
  8918. function f() {
  8919. var e = 1 < g.aspectRatio() && g.isMobile();
  8920. w.toggleClass("landscape", e).toggleClass("portrait", !e),
  8921. w.toggleClass("tiny", $("#player").height() <= o.narrowLandscapeHeight),
  8922. w.toggleClass("tinier", $("#player").height() <= o.reallyNarrowLandscapeHeight)
  8923. }
  8924. var g = e("../../util/browser")
  8925. , m = e("./vrLink")
  8926. , v = e("../../enum/VRApps")
  8927. , y = e("../../enum/VRPlatforms")
  8928. , A = e("../../enum/VRPages")
  8929. , C = e("./vrEvent")
  8930. , o = (e("../../settings"),
  8931. e("../../constants"))
  8932. , I = e("../../localization/localize")
  8933. , a = e("../../util/common")
  8934. , s = e("events").EventEmitter
  8935. , E = 0
  8936. , _ = null
  8937. , b = A.standard
  8938. , w = $(".vr-popup")
  8939. , l = w.find(".vr-popup-body")
  8940. , T = w.find(".vr-images")
  8941. , x = w.find(".img-container")
  8942. , S = w.find(".vr-sm-image")
  8943. , M = x.find(".vr-img-caption")
  8944. , R = $(".vr-buttons").find(".prev-button")
  8945. , P = $(".vr-buttons").find(".next-button")
  8946. , O = T.find(".front-close")
  8947. , L = $(".vr-page")
  8948. , D = w.find("img")
  8949. , N = "images/apple-store.png"
  8950. , F = "images/badge-oculus.png"
  8951. , B = "images/badge-cardboard.png"
  8952. , V = "images/logo-samsung.png"
  8953. , k = "images/headset-cardboard.png"
  8954. , U = "images/headset-gearvr.png"
  8955. , H = "images/ico-android-robot.png"
  8956. , z = "images/ico-gearvr.png"
  8957. , G = "images/ico-vr.png"
  8958. , W = "images/apple-logo-white.svg"
  8959. , j = null
  8960. , Y = null
  8961. , q = {}
  8962. , X = {
  8963. init: function(e, t) {
  8964. function i(e) {
  8965. X.emit(C.STORE, {
  8966. type: e
  8967. }),
  8968. m.launchStore(e)
  8969. }
  8970. function n(e) {
  8971. switch (e !== b.pageCount && (u(e),
  8972. L.text(e + 1 + " / " + b.pageCount)),
  8973. e) {
  8974. case b.Title:
  8975. R.css("display", "none"),
  8976. P.text(a[e]),
  8977. h(r);
  8978. break;
  8979. case b.Cardboard:
  8980. R.css("display", "block"),
  8981. P.text(a[e]),
  8982. x.filter(".cardboard").off(),
  8983. x.filter(".gearvr").off(),
  8984. d(e, r),
  8985. p(k, j, Y);
  8986. break;
  8987. case b.Gear:
  8988. P.text(a[e]),
  8989. d(e, r),
  8990. w.addClass("lastPage"),
  8991. p(U, j, Y);
  8992. break;
  8993. case b.pageCount:
  8994. w.removeClass("fadeIn"),
  8995. X.emit(C.CLOSED)
  8996. }
  8997. D.filter("[src='']").hide()
  8998. }
  8999. var r = g.detectAndroid() ? g.detectAndroidMobile() && c(y.Android) ? (w.addClass("supported"),
  9000. _ = ".show-supported",
  9001. y.Android) : (w.addClass("unsupported"),
  9002. _ = ".show-unsupported",
  9003. y.UnsupportedAndroid) : g.detectIPhone() || g.detectIPod() ? (w.addClass("ios"),
  9004. _ = ".show-ios",
  9005. b = A.ios,
  9006. y.IOS) : (w.addClass("desktop"),
  9007. _ = ".show-desktop",
  9008. y.Desktop);
  9009. function o(e) {
  9010. X.emit(C.LAUNCH, {
  9011. vr_platform: r,
  9012. vr_app: e
  9013. }),
  9014. m.launch(e)
  9015. }
  9016. m.init(r, e, t),
  9017. r !== y.Desktop && w.addClass("mobile"),
  9018. q.cardboardAndroid = o.bind(this, v.CardboardAndroid),
  9019. q.gear = o.bind(this, v.GearVR),
  9020. q.cardboardIOS = o.bind(this, v.CardboardIOS),
  9021. f(),
  9022. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  9023. $(_).show();
  9024. var a = [I.VR_LEARN_MORE_CAPS, I.VR_NEXT_CAPS, I.VR_GOT_IT_CAPS]
  9025. , s = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  9026. r === y.IOS && (a.splice(1, 1),
  9027. s.splice(1, 1)),
  9028. $("#vr").on("click", function(e) {
  9029. e.preventDefault(),
  9030. window.vrEnabled || (window.vrEnabled = !0,
  9031. this.classList.add("active"),
  9032. $("#gui div").not("#vrOff").addClass("vrHide"),
  9033. $("#vrOffImg").css({
  9034. display: "inline-block"
  9035. }))
  9036. }),
  9037. $("#vrOff").on("click", function() {
  9038. window.vrEnabled = !1,
  9039. $("#gui div").not("#vrOff").removeClass("vrHide"),
  9040. $("#vrOffImg").css({
  9041. display: "none"
  9042. }),
  9043. $("#player canvas").css({
  9044. width: "",
  9045. height: ""
  9046. }),
  9047. $("#vr").removeClass("active")
  9048. });
  9049. var l = "https://my.port.com/vr/show/?m=" + e.sid;
  9050. r === y.IOS ? $(".cardboardLink").on("click", i.bind(this, v.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, v.CardboardAndroid)),
  9051. $(".gearLink").on("click", i.bind(this, v.GearVR)),
  9052. $("span.modelLink").text(l),
  9053. R.on("click", function(e) {
  9054. X.emit(C.PREV),
  9055. n(--E)
  9056. }),
  9057. P.on("click", function(e) {
  9058. P.text(),
  9059. X.emit(C.NEXT, {
  9060. nextAction: s[E]
  9061. }),
  9062. n(++E)
  9063. }),
  9064. w.find(".close").on("click", X.dismiss)
  9065. },
  9066. dismiss: function() {
  9067. w.hasClass("fadeIn") && (w.removeClass("fadeIn"),
  9068. X.emit(C.CLOSED))
  9069. },
  9070. isDeviceSupported: c
  9071. };
  9072. a.extendObject(X, s.prototype),
  9073. $(window).resize(f);
  9074. var Z, K, Q = (Z = M.filter(".first").find(".cardboard"),
  9075. K = M.filter(".first").find(".gearvr"),
  9076. {
  9077. cardboard: function() {
  9078. K.addClass("hidden"),
  9079. Z.removeClass("hidden")
  9080. },
  9081. gearvr: function() {
  9082. Z.addClass("hidden"),
  9083. K.removeClass("hidden")
  9084. }
  9085. });
  9086. t.exports = X
  9087. }
  9088. , {
  9089. "../../constants": 8,
  9090. "../../enum/VRApps": 46,
  9091. "../../enum/VRPages": 48,
  9092. "../../enum/VRPlatforms": 49,
  9093. "../../localization/localize": 108,
  9094. "../../settings": 166,
  9095. "../../util/browser": 182,
  9096. "../../util/common": 185,
  9097. "./vrEvent": 85,
  9098. "./vrLink": 86,
  9099. events: 202
  9100. }],
  9101. 88: [function(e, t, i) {
  9102. "use strict";
  9103. t.exports = Object.freeze({
  9104. OPENED: "webvr.modal.opened",
  9105. SHOW_TERMS: "webvr.footer.show.terms"
  9106. })
  9107. }
  9108. , {}],
  9109. 89: [function(B, V, e) {
  9110. (function(e) {
  9111. "use strict";
  9112. function a() {
  9113. function t() {
  9114. p.isPresenting || (r.info("exiting webVR"),
  9115. c("webvr_exit_app"),
  9116. -1 === window.location.search.indexOf("&qs=1") ? window.location = window.location + "&qs=1" : window.location = window.location,
  9117. window.removeEventListener("vrdisplaypresentchange", t))
  9118. }
  9119. r.info("Headset mounted"),
  9120. u.suspend();
  9121. var e = document.createElement("canvas");
  9122. for (e.getContext("webgl"),
  9123. e.className = "webvr-canvas",
  9124. document.bgColor = "#000",
  9125. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9126. document.body.removeChild(document.body.firstChild);
  9127. document.body.appendChild(e),
  9128. c("webvr_enter_app"),
  9129. p.requestPresent([{
  9130. source: e,
  9131. predistorted: !0
  9132. }]).catch(function(e) {
  9133. r.error("Failed to present: " + e),
  9134. c("webvr_exit_calibrate"),
  9135. t()
  9136. }),
  9137. d.then(function() {
  9138. window.dispatchEvent(new Event("vrapp-start"))
  9139. }),
  9140. window.addEventListener("vrdisplaypresentchange", t)
  9141. }
  9142. function s() {
  9143. c("webvr_modal_close"),
  9144. _.find(".enter-button").off("click", a),
  9145. E.fadeOut(g.guiAnimationSpeed, function() {
  9146. _.toggleClass("hidden", !1),
  9147. b.toggleClass("hidden", !0),
  9148. f.exitFullscreen()
  9149. }),
  9150. I.fadeIn(g.guiAnimationSpeed)
  9151. }
  9152. function t() {
  9153. M.toggleClass("hidden", !0),
  9154. S.toggleClass("hidden", !1)
  9155. }
  9156. function l() {
  9157. _.toggleClass("hidden"),
  9158. b.toggleClass("hidden")
  9159. }
  9160. function c(e) {
  9161. var t = f.isLandscape() ? "landscape" : "portrait";
  9162. i.trackAlways("showcase_gui", {
  9163. gui_action: e,
  9164. orientation: t
  9165. })
  9166. }
  9167. function h() {
  9168. var e = f.isLandscape();
  9169. E.toggleClass("landscape", e).toggleClass("portrait", !e)
  9170. }
  9171. var u, d, p, f = B("../../util/browser"), g = B("../../settings"), m = (B("./../gui"),
  9172. B("../../enum/VRPlatforms")), v = B("../../enum/VRApps"), y = B("./../vr/vrLink"), A = B("./WebVrEvent"), i = B("../../analytics"), C = (B("../../constants"),
  9173. 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 = {
  9174. init: function(e, t, i, n) {
  9175. function r(e) {
  9176. e.preventDefault(),
  9177. o(e.currentTarget.id)
  9178. }
  9179. function o(i) {
  9180. F[i](),
  9181. Object.keys(F).map(function(e, t) {
  9182. $("#" + e).toggleClass("tabs-underlined", e === i)
  9183. })
  9184. }
  9185. p = i,
  9186. u = t,
  9187. y.init(m.Android, e, n),
  9188. h(),
  9189. new RegExp("daydream","i").test(p.displayName) ? (o("tabdaydream"),
  9190. w.filter(".device-headset-side").attr("src", "images/device-daydream-side.png"),
  9191. _.find(".title").text(C.localizeText("WEBVR_FOR_DAYDREAM"))) : (o("tabcardboard"),
  9192. w.filter(".device-headset-side").attr("src", R),
  9193. _.find(".title").text(C.localizeText("WEBVR_FOR_CARDBOARD"))),
  9194. $("#vr").on("click", function(e) {
  9195. e.preventDefault(),
  9196. c("click_webvr_button"),
  9197. E.is(":hidden") && (N.emit(A.OPENED),
  9198. I.fadeOut(g.guiAnimationSpeed),
  9199. E.fadeIn(g.guiAnimationSpeed),
  9200. function() {
  9201. if (!d) {
  9202. var n = "https://static.port.com/webvr/" + (f.valueFromHash("webvr") || g.appConfig.webvr_version) + "/js/main.js";
  9203. d = new Promise(function(e, t) {
  9204. var i = document.createElement("script");
  9205. i.type = "text/javascript",
  9206. i.src = n,
  9207. i.onload = e,
  9208. document.head.appendChild(i)
  9209. }
  9210. )
  9211. }
  9212. _.find(".enter-button").on("click", a)
  9213. }())
  9214. }),
  9215. $(".webvr-popup .close").on("click", function(e) {
  9216. e.preventDefault(),
  9217. _.hasClass("hidden") ? (c("webvr_help_close"),
  9218. l()) : s()
  9219. }),
  9220. $("#tabcardboard").on("click", r),
  9221. $("#tabdaydream").on("click", r),
  9222. $("#tabnative").on("click", r),
  9223. $(".webvr-popup .open-with-app").on("click", function(e) {
  9224. e.preventDefault(),
  9225. c("webvr_learn_more"),
  9226. o("tabnative"),
  9227. l()
  9228. }),
  9229. $(".webvr-popup .help").on("click", function(e) {
  9230. e.preventDefault(),
  9231. c(_.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9232. l()
  9233. }),
  9234. $(".webvr-popup .terms").on("click", function(e) {
  9235. e.preventDefault(),
  9236. c("webvr_click_terms"),
  9237. s(),
  9238. N.emit(A.SHOW_TERMS)
  9239. }),
  9240. T.on("click", function(e) {
  9241. e.preventDefault(),
  9242. c(D),
  9243. window.open(L, "_blank")
  9244. }),
  9245. x.on("click", function(e) {
  9246. e.preventDefault(),
  9247. c("webvr_phone_link"),
  9248. window.open("https://vr.google.com/daydream/phones/", "_blank")
  9249. }),
  9250. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9251. e.preventDefault(),
  9252. c("webvr_cardboard_link"),
  9253. y.launch(v.CardboardAndroid)
  9254. }),
  9255. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9256. e.preventDefault(),
  9257. c("webvr_oculus_link"),
  9258. y.launch(v.GearVR)
  9259. })
  9260. }
  9261. }, F = {
  9262. tabcardboard: function() {
  9263. w.filter(".device-headset").attr("src", R),
  9264. w.filter(".device-phone").attr("src", "images/ico-android-robot.png"),
  9265. L = "https://vr.google.com/cardboard/get-cardboard/",
  9266. D = "webvr_cardboard_link",
  9267. T.text(C.localizeText("VR_GOOGLE_CARDBOARD")),
  9268. x.text(C.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9269. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9270. t()
  9271. },
  9272. tabdaydream: function() {
  9273. w.filter(".device-headset").attr("src", "images/device-daydream.png"),
  9274. w.filter(".device-phone").attr("src", "images/device-pixel.png"),
  9275. L = P,
  9276. D = O,
  9277. T.text(C.localizeText("WEBVR_DAYDREAM_VIEW")),
  9278. x.text(C.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9279. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9280. t()
  9281. },
  9282. tabnative: function() {
  9283. w.filter(".badge-cardboard").attr("src", "images/badge-cardboard.png"),
  9284. w.filter(".badge-oculus").attr("src", "images/badge-oculus.png"),
  9285. M.toggleClass("hidden", !1),
  9286. S.toggleClass("hidden", !0)
  9287. }
  9288. };
  9289. n.extendObject(N, o.prototype),
  9290. $(window).resize(h),
  9291. V.exports = N
  9292. }
  9293. ).call(this, "/js/gui/webvr/webVRgui.js")
  9294. }
  9295. , {
  9296. "../../analytics": 4,
  9297. "../../constants": 8,
  9298. "../../enum/VRApps": 46,
  9299. "../../enum/VRPlatforms": 49,
  9300. "../../localization/localize": 108,
  9301. "../../settings": 166,
  9302. "../../util/browser": 182,
  9303. "../../util/common": 185,
  9304. "../../util/logger": 189,
  9305. "./../gui": 65,
  9306. "./../vr/vrLink": 86,
  9307. "./WebVrEvent": 88,
  9308. events: 202
  9309. }],
  9310. 90: [function(e, t, i) {
  9311. "use strict";
  9312. function n(e, t, i, n, r) {
  9313. this.floorId = n || 0 === n ? n : -1,
  9314. this.roomId = r || "",
  9315. this.labelId = e,
  9316. this.position = (new o.Vector3).copy(t),
  9317. this.text = i
  9318. }
  9319. var o = e("three")
  9320. , r = e("../util/browser");
  9321. n.prototype.build = function() {
  9322. var e = window.document.createElement("div");
  9323. r.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9324. var t = window.document.createElement("div");
  9325. t.setAttribute("class", "gui-floorplan-label-text");
  9326. var i = window.document.createTextNode(this.text);
  9327. t.appendChild(i),
  9328. e.appendChild(t),
  9329. window.document.body.appendChild(e),
  9330. this.labelGui = e,
  9331. this.textBlock = t,
  9332. $(this.labelGui).hide();
  9333. var n = window.getComputedStyle(this.labelGui);
  9334. this.initialTransform = n.transform || n.webkitTransform
  9335. }
  9336. ,
  9337. t.exports = n
  9338. }
  9339. , {
  9340. "../util/browser": 182,
  9341. three: 217
  9342. }],
  9343. 91: [function(e, t, i) {
  9344. "use strict";
  9345. function n() {
  9346. this.player = null,
  9347. this.modelManager = null,
  9348. this.container = null
  9349. }
  9350. var c, o, r = e("three"), a = (e("../util/common"),
  9351. e("../enum/PlayerEvents")), s = (e("../enum/DirectorEvents"),
  9352. e("../enum/ModelManagerEvents")), l = e("../settings"), h = e("../enum/Viewmode"), u = (e("../enum/WarpStyle"),
  9353. e("../util/transitions"),
  9354. e("../util/lerp"),
  9355. e("../util/browser"));
  9356. n.prototype.init = function(e, t, i) {
  9357. this.player = e,
  9358. this.modelManager = t,
  9359. this.container = i,
  9360. this.updateModel(),
  9361. this.bindEvents()
  9362. }
  9363. ,
  9364. n.prototype.bindEvents = function() {
  9365. this.modelManager.on(s.ActiveModelChanged, this.updateModel.bind(this)),
  9366. this.player.on(a.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9367. this.player.on(a.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9368. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  9369. this.player.on(a.StartOutside, this.handleStartOutside.bind(this))
  9370. }
  9371. ,
  9372. n.prototype.updateModel = function() {
  9373. this.model = this.modelManager.getActiveModel()
  9374. }
  9375. ,
  9376. n.prototype.handlePlayerViewChanged = function() {
  9377. this.updateLabelVisibility(),
  9378. this.updateLabelDisplay()
  9379. }
  9380. ,
  9381. n.prototype.getLabelsForFloor = function(t, i) {
  9382. return (i = i || []).length = 0,
  9383. this.model.labels.forEach(function(e) {
  9384. this.labelVisibleForFloor(e, t) && i.push(e)
  9385. }
  9386. .bind(this)),
  9387. i
  9388. }
  9389. ,
  9390. n.prototype.getLabelsForCurrentFloor = function(e) {
  9391. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9392. }
  9393. ,
  9394. n.prototype.labelVisibleForFloor = function(e, t) {
  9395. var i = u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.mobile || !u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.desktop;
  9396. if (!this.model.showingLabels || !e.labelGui || !i)
  9397. return !1;
  9398. var n = e.floorId === this.model.floors.size() - 1;
  9399. return this.model.allFloorsVisible ? n : e.floorId === t
  9400. }
  9401. ,
  9402. n.prototype.updateLabelVisibility = function(e) {
  9403. this.model.labels.forEach(function(e) {
  9404. 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)
  9405. }
  9406. .bind(this))
  9407. }
  9408. ,
  9409. n.prototype.showAllLabels = function(t, i) {
  9410. this.model.labels.forEach(function(e) {
  9411. this.showLabel(e, t, i)
  9412. }
  9413. .bind(this))
  9414. }
  9415. ,
  9416. n.prototype.hideAllLabels = function(t, i) {
  9417. this.model.labels.forEach(function(e) {
  9418. this.hideLabel(e, t, i)
  9419. }
  9420. .bind(this))
  9421. }
  9422. ,
  9423. n.prototype.showLabel = function(e, t, i) {
  9424. this.model.showingLabels && (e.visible || (e.visible = !0,
  9425. e.labelGui.style.display = "block",
  9426. e.labelGui.style.opacity = 0,
  9427. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9428. }
  9429. ,
  9430. n.prototype.hideLabel = function(e, t, i) {
  9431. e.visible && (e.visible = !1,
  9432. u.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9433. }
  9434. ,
  9435. n.prototype.supportedMode = function() {
  9436. return this.player.mode === h.FLOORPLAN
  9437. }
  9438. ,
  9439. n.prototype.updateLabelDisplay = (new r.Vector3,
  9440. new r.Vector3,
  9441. o = [],
  9442. function() {
  9443. var e = this.player.getLabelScaleFactor()
  9444. , t = 1.2 * (1 - e) + .6
  9445. , i = u.isMobile() ? l.labels.zoomTruncateThreshhold.mobile : l.labels.zoomTruncateThreshhold.desktop;
  9446. this.getLabelsForCurrentFloor(o);
  9447. for (var n = 0; n < o.length; n++) {
  9448. var r = o[n];
  9449. this.supportedMode() && r.labelGui && (this.updateProjectedGuiElement(r.labelGui, r.textBlock, r.position, t, t),
  9450. 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)
  9451. }
  9452. }
  9453. ),
  9454. n.prototype.updateProjectedGuiElement = (c = new r.Vector3,
  9455. new r.Vector3,
  9456. function(e, t, i, n, r) {
  9457. t.style.fontSize = 100 * r + "%";
  9458. var o = .5 * $("#player").width()
  9459. , a = .5 * $("#player").height();
  9460. c.copy(i),
  9461. c.project(this.player.camera);
  9462. var s = c.x * o + o
  9463. , l = -c.y * a + a;
  9464. s -= e.offsetWidth / 2,
  9465. l -= e.offsetHeight / 2,
  9466. e.style.left = s + "px",
  9467. e.style.top = l + "px"
  9468. }
  9469. ),
  9470. n.prototype.handleStartInside = function(e) {
  9471. this.updateLabelVisibility()
  9472. }
  9473. ,
  9474. n.prototype.handleStartOutside = function() {
  9475. this.updateLabelVisibility()
  9476. }
  9477. ,
  9478. t.exports = n
  9479. }
  9480. , {
  9481. "../enum/DirectorEvents": 23,
  9482. "../enum/ModelManagerEvents": 33,
  9483. "../enum/PlayerEvents": 40,
  9484. "../enum/Viewmode": 51,
  9485. "../enum/WarpStyle": 52,
  9486. "../settings": 166,
  9487. "../util/browser": 182,
  9488. "../util/common": 185,
  9489. "../util/lerp": 188,
  9490. "../util/transitions": 195,
  9491. three: 217
  9492. }],
  9493. 92: [function(e, t, i) {
  9494. "use strict";
  9495. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9496. if (null == this)
  9497. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9498. if ("function" != typeof e)
  9499. throw new TypeError("predicate must be a function");
  9500. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9501. if (t = i[o],
  9502. e.call(r, t, o, i))
  9503. return o;
  9504. return -1
  9505. }
  9506. ),
  9507. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9508. value: function(e) {
  9509. if (null == this)
  9510. throw new TypeError('"this" is null or not defined');
  9511. var t = Object(this)
  9512. , i = t.length >>> 0;
  9513. if ("function" != typeof e)
  9514. throw new TypeError("predicate must be a function");
  9515. for (var n = arguments[1], r = 0; r < i; ) {
  9516. var o = t[r];
  9517. if (e.call(n, o, r, t))
  9518. return o;
  9519. r++
  9520. }
  9521. }
  9522. })
  9523. }
  9524. , {}],
  9525. 93: [function(e, t, i) {
  9526. "use strict";
  9527. 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 || {};
  9528. function te() {
  9529. this.backgroundElement = document.createElement("div"),
  9530. r.extend(this.backgroundElement.style, {
  9531. backgroundColor: "rgba(0,0,0,0.8)",
  9532. top: 0,
  9533. left: 0,
  9534. display: "none",
  9535. zIndex: "1000",
  9536. opacity: 0,
  9537. WebkitTransition: "opacity 0.2s linear"
  9538. }),
  9539. n.makeFullscreen(this.backgroundElement),
  9540. this.backgroundElement.style.position = "fixed",
  9541. this.domElement = document.createElement("div"),
  9542. r.extend(this.domElement.style, {
  9543. position: "fixed",
  9544. display: "none",
  9545. zIndex: "1001",
  9546. opacity: 0,
  9547. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  9548. }),
  9549. document.body.appendChild(this.backgroundElement),
  9550. document.body.appendChild(this.domElement);
  9551. var e = this;
  9552. n.bind(this.backgroundElement, "click", function() {
  9553. e.hide()
  9554. })
  9555. }
  9556. function ie(e, t, i) {
  9557. Object.defineProperty(e, t, {
  9558. get: function() {
  9559. return "RGB" === this.__state.space || re(this, t, i),
  9560. this.__state[t]
  9561. },
  9562. set: function(e) {
  9563. "RGB" !== this.__state.space && (re(this, t, i),
  9564. this.__state.space = "RGB"),
  9565. this.__state[t] = e
  9566. }
  9567. })
  9568. }
  9569. function ne(e, t) {
  9570. Object.defineProperty(e, t, {
  9571. get: function() {
  9572. return "HSV" === this.__state.space || oe(this),
  9573. this.__state[t]
  9574. },
  9575. set: function(e) {
  9576. "HSV" !== this.__state.space && (oe(this),
  9577. this.__state.space = "HSV"),
  9578. this.__state[t] = e
  9579. }
  9580. })
  9581. }
  9582. function re(e, t, i) {
  9583. if ("HEX" === e.__state.space)
  9584. e.__state[t] = a.component_from_hex(e.__state.hex, i);
  9585. else {
  9586. if ("HSV" !== e.__state.space)
  9587. throw "Corrupted color state";
  9588. l.extend(e.__state, a.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  9589. }
  9590. }
  9591. function oe(e) {
  9592. var t = a.rgb_to_hsv(e.r, e.g, e.b);
  9593. l.extend(e.__state, {
  9594. s: t.s,
  9595. v: t.v
  9596. }),
  9597. l.isNaN(t.h) ? l.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = t.h
  9598. }
  9599. function ae() {
  9600. if (this.__state = o.apply(this, arguments),
  9601. !1 === this.__state)
  9602. throw "Failed to interpret color arguments";
  9603. this.__state.a = this.__state.a || 1
  9604. }
  9605. function se(e) {
  9606. return -1 < (e = e.toString()).indexOf(".") ? e.length - e.indexOf(".") - 1 : 0
  9607. }
  9608. function le(e, t) {
  9609. this.initialValue = e[t],
  9610. this.domElement = document.createElement("div"),
  9611. this.object = e,
  9612. this.property = t,
  9613. this.__onChange = void 0,
  9614. this.__onFinishChange = void 0
  9615. }
  9616. (t.exports = ee).gui = ee.gui || {},
  9617. ee.utils = ee.utils || {},
  9618. ee.controllers = ee.controllers || {},
  9619. ee.dom = ee.dom || {},
  9620. ee.color = ee.color || {},
  9621. ee.utils.css = {
  9622. load: function(e, t) {
  9623. var i = (t = t || document).createElement("link");
  9624. i.type = "text/css",
  9625. i.rel = "stylesheet",
  9626. i.href = e,
  9627. t.getElementsByTagName("head")[0].appendChild(i)
  9628. },
  9629. inject: function(e, t) {
  9630. t = t || document;
  9631. var i = document.createElement("style");
  9632. i.type = "text/css",
  9633. i.innerHTML = e,
  9634. t.getElementsByTagName("head")[0].appendChild(i)
  9635. }
  9636. },
  9637. ee.utils.common = (Q = Array.prototype.forEach,
  9638. J = Array.prototype.slice,
  9639. {
  9640. BREAK: {},
  9641. extend: function(i) {
  9642. return this.each(J.call(arguments, 1), function(e) {
  9643. for (var t in e)
  9644. this.isUndefined(e[t]) || (i[t] = e[t])
  9645. }, this),
  9646. i
  9647. },
  9648. defaults: function(i) {
  9649. return this.each(J.call(arguments, 1), function(e) {
  9650. for (var t in e)
  9651. this.isUndefined(i[t]) && (i[t] = e[t])
  9652. }, this),
  9653. i
  9654. },
  9655. compose: function() {
  9656. var i = J.call(arguments);
  9657. return function() {
  9658. for (var e = J.call(arguments), t = i.length - 1; 0 <= t; t--)
  9659. e = [i[t].apply(this, e)];
  9660. return e[0]
  9661. }
  9662. },
  9663. each: function(e, t, i) {
  9664. if (e)
  9665. if (Q && e.forEach && e.forEach === Q)
  9666. e.forEach(t, i);
  9667. else if (e.length === e.length + 0) {
  9668. for (var n = 0, r = e.length; n < r; n++)
  9669. if (n in e && t.call(i, e[n], n) === this.BREAK)
  9670. return
  9671. } else
  9672. for (var n in e)
  9673. if (t.call(i, e[n], n) === this.BREAK)
  9674. return
  9675. },
  9676. defer: function(e) {
  9677. setTimeout(e, 0)
  9678. },
  9679. toArray: function(e) {
  9680. return e.toArray ? e.toArray() : J.call(e)
  9681. },
  9682. isUndefined: function(e) {
  9683. return void 0 === e
  9684. },
  9685. isNull: function(e) {
  9686. return null === e
  9687. },
  9688. isNaN: function(e) {
  9689. return e != e
  9690. },
  9691. isArray: Array.isArray || function(e) {
  9692. return e.constructor === Array
  9693. }
  9694. ,
  9695. isObject: function(e) {
  9696. return e === Object(e)
  9697. },
  9698. isNumber: function(e) {
  9699. return e === e + 0
  9700. },
  9701. isString: function(e) {
  9702. return e === e + ""
  9703. },
  9704. isBoolean: function(e) {
  9705. return !1 === e || !0 === e
  9706. },
  9707. isFunction: function(e) {
  9708. return "[object Function]" === Object.prototype.toString.call(e)
  9709. }
  9710. }),
  9711. ee.controllers.Controller = (ee.utils.common.extend(le.prototype, {
  9712. onChange: function(e) {
  9713. return this.__onChange = e,
  9714. this
  9715. },
  9716. onFinishChange: function(e) {
  9717. return this.__onFinishChange = e,
  9718. this
  9719. },
  9720. setValue: function(e) {
  9721. return this.object[this.property] = e,
  9722. this.__onChange && this.__onChange.call(this, e),
  9723. this.updateDisplay(),
  9724. this
  9725. },
  9726. getValue: function() {
  9727. return this.object[this.property]
  9728. },
  9729. updateDisplay: function() {
  9730. return this
  9731. },
  9732. isModified: function() {
  9733. return this.initialValue !== this.getValue()
  9734. }
  9735. }),
  9736. le),
  9737. ee.dom.dom = function(c) {
  9738. function i(e) {
  9739. if ("0" === e || c.isUndefined(e))
  9740. return 0;
  9741. var t = e.match(n);
  9742. return c.isNull(t) ? 0 : parseFloat(t[1])
  9743. }
  9744. var h = {};
  9745. c.each({
  9746. HTMLEvents: ["change"],
  9747. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9748. KeyboardEvents: ["keydown"]
  9749. }, function(e, t) {
  9750. c.each(e, function(e) {
  9751. h[e] = t
  9752. })
  9753. });
  9754. var n = /(\d+(\.\d+)?)px/
  9755. , r = {
  9756. makeSelectable: function(e, t) {
  9757. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9758. return !1
  9759. }
  9760. : function() {}
  9761. ,
  9762. e.style.MozUserSelect = t ? "auto" : "none",
  9763. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9764. e.unselectable = t ? "on" : "off")
  9765. },
  9766. makeFullscreen: function(e, t, i) {
  9767. c.isUndefined(t) && (t = !0),
  9768. c.isUndefined(i) && (i = !0),
  9769. e.style.position = "absolute",
  9770. t && (e.style.left = 0,
  9771. e.style.right = 0),
  9772. i && (e.style.top = 0,
  9773. e.style.bottom = 0)
  9774. },
  9775. fakeEvent: function(e, t, i, n) {
  9776. i = i || {};
  9777. var r = h[t];
  9778. if (!r)
  9779. throw new Error("Event type " + t + " not supported.");
  9780. var o = document.createEvent(r);
  9781. switch (r) {
  9782. case "MouseEvents":
  9783. var a = i.x || i.clientX || 0
  9784. , s = i.y || i.clientY || 0;
  9785. o.initMouseEvent(t, i.bubbles || !1, i.cancelable || !0, window, i.clickCount || 1, 0, 0, a, s, !1, !1, !1, !1, 0, null);
  9786. break;
  9787. case "KeyboardEvents":
  9788. var l = o.initKeyboardEvent || o.initKeyEvent;
  9789. c.defaults(i, {
  9790. cancelable: !0,
  9791. ctrlKey: !1,
  9792. altKey: !1,
  9793. shiftKey: !1,
  9794. metaKey: !1,
  9795. keyCode: void 0,
  9796. charCode: void 0
  9797. }),
  9798. l(t, i.bubbles || !1, i.cancelable, window, i.ctrlKey, i.altKey, i.shiftKey, i.metaKey, i.keyCode, i.charCode);
  9799. break;
  9800. default:
  9801. o.initEvent(t, i.bubbles || !1, i.cancelable || !0)
  9802. }
  9803. c.defaults(o, n),
  9804. e.dispatchEvent(o)
  9805. },
  9806. bind: function(e, t, i, n) {
  9807. return n = n || !1,
  9808. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9809. r
  9810. },
  9811. unbind: function(e, t, i, n) {
  9812. return n = n || !1,
  9813. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9814. r
  9815. },
  9816. addClass: function(e, t) {
  9817. if (void 0 === e.className)
  9818. e.className = t;
  9819. else if (e.className !== t) {
  9820. var i = e.className.split(/ +/);
  9821. -1 == i.indexOf(t) && (i.push(t),
  9822. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9823. }
  9824. return r
  9825. },
  9826. removeClass: function(e, t) {
  9827. if (t)
  9828. if (void 0 === e.className)
  9829. ;
  9830. else if (e.className === t)
  9831. e.removeAttribute("class");
  9832. else {
  9833. var i = e.className.split(/ +/)
  9834. , n = i.indexOf(t);
  9835. -1 != n && (i.splice(n, 1),
  9836. e.className = i.join(" "))
  9837. }
  9838. else
  9839. e.className = void 0;
  9840. return r
  9841. },
  9842. hasClass: function(e, t) {
  9843. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9844. },
  9845. getWidth: function(e) {
  9846. var t = getComputedStyle(e);
  9847. return i(t["border-left-width"]) + i(t["border-right-width"]) + i(t["padding-left"]) + i(t["padding-right"]) + i(t.width)
  9848. },
  9849. getHeight: function(e) {
  9850. var t = getComputedStyle(e);
  9851. return i(t["border-top-width"]) + i(t["border-bottom-width"]) + i(t["padding-top"]) + i(t["padding-bottom"]) + i(t.height)
  9852. },
  9853. getOffset: function(e) {
  9854. var t = {
  9855. left: 0,
  9856. top: 0
  9857. };
  9858. if (e.offsetParent)
  9859. for (; t.left += e.offsetLeft,
  9860. t.top += e.offsetTop,
  9861. e = e.offsetParent; )
  9862. ;
  9863. return t
  9864. },
  9865. isActive: function(e) {
  9866. return e === document.activeElement && (e.type || e.href)
  9867. }
  9868. };
  9869. return r
  9870. }(ee.utils.common),
  9871. ee.controllers.OptionController = (q = ee.controllers.Controller,
  9872. X = ee.dom.dom,
  9873. Z = ee.utils.common,
  9874. (K = function(e, t, i) {
  9875. K.superclass.call(this, e, t);
  9876. var n = this;
  9877. if (this.__select = document.createElement("select"),
  9878. Z.isArray(i)) {
  9879. var r = {};
  9880. Z.each(i, function(e) {
  9881. r[e] = e
  9882. }),
  9883. i = r
  9884. }
  9885. Z.each(i, function(e, t) {
  9886. var i = document.createElement("option");
  9887. i.innerHTML = t,
  9888. i.setAttribute("value", e),
  9889. n.__select.appendChild(i)
  9890. }),
  9891. this.updateDisplay(),
  9892. X.bind(this.__select, "change", function() {
  9893. var e = this.options[this.selectedIndex].value;
  9894. n.setValue(e)
  9895. }),
  9896. this.domElement.appendChild(this.__select)
  9897. }
  9898. ).superclass = q,
  9899. Z.extend(K.prototype, q.prototype, {
  9900. setValue: function(e) {
  9901. var t = K.superclass.prototype.setValue.call(this, e);
  9902. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9903. t
  9904. },
  9905. updateDisplay: function() {
  9906. return this.__select.value = this.getValue(),
  9907. K.superclass.prototype.updateDisplay.call(this)
  9908. }
  9909. }),
  9910. K),
  9911. ee.controllers.NumberController = (W = ee.controllers.Controller,
  9912. j = ee.utils.common,
  9913. (Y = function(e, t, i) {
  9914. Y.superclass.call(this, e, t),
  9915. i = i || {},
  9916. this.__min = i.min,
  9917. this.__max = i.max,
  9918. this.__step = i.step,
  9919. 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,
  9920. this.__precision = se(this.__impliedStep)
  9921. }
  9922. ).superclass = W,
  9923. j.extend(Y.prototype, W.prototype, {
  9924. setValue: function(e) {
  9925. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9926. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9927. Y.superclass.prototype.setValue.call(this, e)
  9928. },
  9929. min: function(e) {
  9930. return this.__min = e,
  9931. this
  9932. },
  9933. max: function(e) {
  9934. return this.__max = e,
  9935. this
  9936. },
  9937. step: function(e) {
  9938. return this.__step = e,
  9939. this.__impliedStep = e,
  9940. this.__precision = se(e),
  9941. this
  9942. }
  9943. }),
  9944. Y),
  9945. ee.controllers.NumberControllerBox = (U = ee.controllers.NumberController,
  9946. H = ee.dom.dom,
  9947. z = ee.utils.common,
  9948. (G = function(e, t, i) {
  9949. function n() {
  9950. var e = parseFloat(s.__input.value);
  9951. z.isNaN(e) || s.setValue(e)
  9952. }
  9953. function r(e) {
  9954. var t = a - e.clientY;
  9955. s.setValue(s.getValue() + t * s.__impliedStep),
  9956. a = e.clientY
  9957. }
  9958. function o() {
  9959. H.unbind(window, "mousemove", r),
  9960. H.unbind(window, "mouseup", o)
  9961. }
  9962. this.__truncationSuspended = !1,
  9963. G.superclass.call(this, e, t, i);
  9964. var a, s = this;
  9965. this.__input = document.createElement("input"),
  9966. this.__input.setAttribute("type", "text"),
  9967. H.bind(this.__input, "change", n),
  9968. H.bind(this.__input, "blur", function() {
  9969. n(),
  9970. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9971. }),
  9972. H.bind(this.__input, "mousedown", function(e) {
  9973. H.bind(window, "mousemove", r),
  9974. H.bind(window, "mouseup", o),
  9975. a = e.clientY
  9976. }),
  9977. H.bind(this.__input, "keydown", function(e) {
  9978. 13 === e.keyCode && (s.__truncationSuspended = !0,
  9979. this.blur(),
  9980. s.__truncationSuspended = !1)
  9981. }),
  9982. this.updateDisplay(),
  9983. this.domElement.appendChild(this.__input)
  9984. }
  9985. ).superclass = U,
  9986. z.extend(G.prototype, U.prototype, {
  9987. updateDisplay: function() {
  9988. return this.__input.value = this.__truncationSuspended ? this.getValue() : function(e, t) {
  9989. var i = Math.pow(10, t);
  9990. return Math.round(e * i) / i
  9991. }(this.getValue(), this.__precision),
  9992. G.superclass.prototype.updateDisplay.call(this)
  9993. }
  9994. }),
  9995. G),
  9996. ee.controllers.NumberControllerSlider = (N = ee.controllers.NumberController,
  9997. F = ee.dom.dom,
  9998. B = ee.utils.css,
  9999. V = ee.utils.common,
  10000. (k = function(e, t, i, n, r) {
  10001. function o(e) {
  10002. e.preventDefault();
  10003. var t = F.getOffset(s.__background)
  10004. , i = F.getWidth(s.__background);
  10005. return s.setValue(function(e, t, i, n, r) {
  10006. return n + (e - t) / (i - t) * (r - n)
  10007. }(e.clientX, t.left, t.left + i, s.__min, s.__max)),
  10008. !1
  10009. }
  10010. function a() {
  10011. F.unbind(window, "mousemove", o),
  10012. F.unbind(window, "mouseup", a),
  10013. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  10014. }
  10015. k.superclass.call(this, e, t, {
  10016. min: i,
  10017. max: n,
  10018. step: r
  10019. });
  10020. var s = this;
  10021. this.__background = document.createElement("div"),
  10022. this.__foreground = document.createElement("div"),
  10023. F.bind(this.__background, "mousedown", function(e) {
  10024. F.bind(window, "mousemove", o),
  10025. F.bind(window, "mouseup", a),
  10026. o(e)
  10027. }),
  10028. F.addClass(this.__background, "slider"),
  10029. F.addClass(this.__foreground, "slider-fg"),
  10030. this.updateDisplay(),
  10031. this.__background.appendChild(this.__foreground),
  10032. this.domElement.appendChild(this.__background)
  10033. }
  10034. ).superclass = N,
  10035. k.useDefaultStyles = function() {
  10036. 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}")
  10037. }
  10038. ,
  10039. V.extend(k.prototype, N.prototype, {
  10040. updateDisplay: function() {
  10041. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  10042. return this.__foreground.style.width = 100 * e + "%",
  10043. k.superclass.prototype.updateDisplay.call(this)
  10044. }
  10045. }),
  10046. k),
  10047. ee.controllers.FunctionController = (P = ee.controllers.Controller,
  10048. O = ee.dom.dom,
  10049. L = ee.utils.common,
  10050. (D = function(e, t, i) {
  10051. D.superclass.call(this, e, t);
  10052. var n = this;
  10053. this.__button = document.createElement("div"),
  10054. this.__button.innerHTML = void 0 === i ? "Fire" : i,
  10055. O.bind(this.__button, "click", function(e) {
  10056. return e.preventDefault(),
  10057. n.fire(),
  10058. !1
  10059. }),
  10060. O.addClass(this.__button, "button"),
  10061. this.domElement.appendChild(this.__button)
  10062. }
  10063. ).superclass = P,
  10064. L.extend(D.prototype, P.prototype, {
  10065. fire: function() {
  10066. this.__onChange && this.__onChange.call(this),
  10067. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10068. this.getValue().call(this.object)
  10069. }
  10070. }),
  10071. D),
  10072. ee.controllers.BooleanController = (x = ee.controllers.Controller,
  10073. S = ee.dom.dom,
  10074. M = ee.utils.common,
  10075. (R = function(e, t) {
  10076. R.superclass.call(this, e, t);
  10077. var i = this;
  10078. this.__prev = this.getValue(),
  10079. this.__checkbox = document.createElement("input"),
  10080. this.__checkbox.setAttribute("type", "checkbox"),
  10081. S.bind(this.__checkbox, "change", function() {
  10082. i.setValue(!i.__prev)
  10083. }, !1),
  10084. this.domElement.appendChild(this.__checkbox),
  10085. this.updateDisplay()
  10086. }
  10087. ).superclass = x,
  10088. M.extend(R.prototype, x.prototype, {
  10089. setValue: function(e) {
  10090. var t = R.superclass.prototype.setValue.call(this, e);
  10091. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10092. this.__prev = this.getValue(),
  10093. t
  10094. },
  10095. updateDisplay: function() {
  10096. return !0 === this.getValue() ? (this.__checkbox.setAttribute("checked", "checked"),
  10097. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  10098. R.superclass.prototype.updateDisplay.call(this)
  10099. }
  10100. }),
  10101. R),
  10102. ee.color.toString = (T = ee.utils.common,
  10103. function(e) {
  10104. if (1 == e.a || T.isUndefined(e.a)) {
  10105. for (var t = e.hex.toString(16); t.length < 6; )
  10106. t = "0" + t;
  10107. return "#" + t
  10108. }
  10109. return "rgba(" + Math.round(e.r) + "," + Math.round(e.g) + "," + Math.round(e.b) + "," + e.a + ")"
  10110. }
  10111. ),
  10112. ee.color.interpret = (I = ee.color.toString,
  10113. E = ee.utils.common,
  10114. w = [{
  10115. litmus: E.isString,
  10116. conversions: {
  10117. THREE_CHAR_HEX: {
  10118. read: function(e) {
  10119. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10120. return null !== t && {
  10121. space: "HEX",
  10122. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10123. }
  10124. },
  10125. write: I
  10126. },
  10127. SIX_CHAR_HEX: {
  10128. read: function(e) {
  10129. var t = e.match(/^#([A-F0-9]{6})$/i);
  10130. return null !== t && {
  10131. space: "HEX",
  10132. hex: parseInt("0x" + t[1].toString())
  10133. }
  10134. },
  10135. write: I
  10136. },
  10137. CSS_RGB: {
  10138. read: function(e) {
  10139. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10140. return null !== t && {
  10141. space: "RGB",
  10142. r: parseFloat(t[1]),
  10143. g: parseFloat(t[2]),
  10144. b: parseFloat(t[3])
  10145. }
  10146. },
  10147. write: I
  10148. },
  10149. CSS_RGBA: {
  10150. read: function(e) {
  10151. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10152. return null !== t && {
  10153. space: "RGB",
  10154. r: parseFloat(t[1]),
  10155. g: parseFloat(t[2]),
  10156. b: parseFloat(t[3]),
  10157. a: parseFloat(t[4])
  10158. }
  10159. },
  10160. write: I
  10161. }
  10162. }
  10163. }, {
  10164. litmus: E.isNumber,
  10165. conversions: {
  10166. HEX: {
  10167. read: function(e) {
  10168. return {
  10169. space: "HEX",
  10170. hex: e,
  10171. conversionName: "HEX"
  10172. }
  10173. },
  10174. write: function(e) {
  10175. return e.hex
  10176. }
  10177. }
  10178. }
  10179. }, {
  10180. litmus: E.isArray,
  10181. conversions: {
  10182. RGB_ARRAY: {
  10183. read: function(e) {
  10184. return 3 == e.length && {
  10185. space: "RGB",
  10186. r: e[0],
  10187. g: e[1],
  10188. b: e[2]
  10189. }
  10190. },
  10191. write: function(e) {
  10192. return [e.r, e.g, e.b]
  10193. }
  10194. },
  10195. RGBA_ARRAY: {
  10196. read: function(e) {
  10197. return 4 == e.length && {
  10198. space: "RGB",
  10199. r: e[0],
  10200. g: e[1],
  10201. b: e[2],
  10202. a: e[3]
  10203. }
  10204. },
  10205. write: function(e) {
  10206. return [e.r, e.g, e.b, e.a]
  10207. }
  10208. }
  10209. }
  10210. }, {
  10211. litmus: E.isObject,
  10212. conversions: {
  10213. RGBA_OBJ: {
  10214. read: function(e) {
  10215. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b) && E.isNumber(e.a)) && {
  10216. space: "RGB",
  10217. r: e.r,
  10218. g: e.g,
  10219. b: e.b,
  10220. a: e.a
  10221. }
  10222. },
  10223. write: function(e) {
  10224. return {
  10225. r: e.r,
  10226. g: e.g,
  10227. b: e.b,
  10228. a: e.a
  10229. }
  10230. }
  10231. },
  10232. RGB_OBJ: {
  10233. read: function(e) {
  10234. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b)) && {
  10235. space: "RGB",
  10236. r: e.r,
  10237. g: e.g,
  10238. b: e.b
  10239. }
  10240. },
  10241. write: function(e) {
  10242. return {
  10243. r: e.r,
  10244. g: e.g,
  10245. b: e.b
  10246. }
  10247. }
  10248. },
  10249. HSVA_OBJ: {
  10250. read: function(e) {
  10251. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v) && E.isNumber(e.a)) && {
  10252. space: "HSV",
  10253. h: e.h,
  10254. s: e.s,
  10255. v: e.v,
  10256. a: e.a
  10257. }
  10258. },
  10259. write: function(e) {
  10260. return {
  10261. h: e.h,
  10262. s: e.s,
  10263. v: e.v,
  10264. a: e.a
  10265. }
  10266. }
  10267. },
  10268. HSV_OBJ: {
  10269. read: function(e) {
  10270. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v)) && {
  10271. space: "HSV",
  10272. h: e.h,
  10273. s: e.s,
  10274. v: e.v
  10275. }
  10276. },
  10277. write: function(e) {
  10278. return {
  10279. h: e.h,
  10280. s: e.s,
  10281. v: e.v
  10282. }
  10283. }
  10284. }
  10285. }
  10286. }],
  10287. function() {
  10288. b = !1;
  10289. var i = 1 < arguments.length ? E.toArray(arguments) : arguments[0];
  10290. return E.each(w, function(e) {
  10291. if (e.litmus(i))
  10292. return E.each(e.conversions, function(e, t) {
  10293. if (_ = e.read(i),
  10294. !1 === b && !1 !== _)
  10295. return (b = _).conversionName = t,
  10296. _.conversion = e,
  10297. E.BREAK
  10298. }),
  10299. E.BREAK
  10300. }),
  10301. b
  10302. }
  10303. ),
  10304. ee.GUI = ee.gui.GUI = function(e, t, i, c, h, u, d, p, f, n, g, r, o, m, v) {
  10305. function y(e, t, i, n) {
  10306. if (void 0 === t[i])
  10307. throw new Error("Object " + t + ' has no property "' + i + '"');
  10308. var r;
  10309. if (n.color)
  10310. r = new g(t,i);
  10311. else {
  10312. var o = [t, i].concat(n.factoryArgs);
  10313. r = c.apply(e, o)
  10314. }
  10315. n.before instanceof h && (n.before = n.before.__li),
  10316. C(e, r),
  10317. m.addClass(r.domElement, "c");
  10318. var a = document.createElement("span");
  10319. m.addClass(a, "property-name"),
  10320. a.innerHTML = r.property;
  10321. var s = document.createElement("div");
  10322. s.appendChild(a),
  10323. s.appendChild(r.domElement);
  10324. var l = A(e, s, n.before);
  10325. return m.addClass(l, R.CLASS_CONTROLLER_ROW),
  10326. m.addClass(l, typeof r.getValue()),
  10327. function(t, i, n) {
  10328. if (n.__li = i,
  10329. n.__gui = t,
  10330. v.extend(n, {
  10331. options: function(e) {
  10332. return 1 < arguments.length ? (n.remove(),
  10333. y(t, n.object, n.property, {
  10334. before: n.__li.nextElementSibling,
  10335. factoryArgs: [v.toArray(arguments)]
  10336. })) : v.isArray(e) || v.isObject(e) ? (n.remove(),
  10337. y(t, n.object, n.property, {
  10338. before: n.__li.nextElementSibling,
  10339. factoryArgs: [e]
  10340. })) : void 0
  10341. },
  10342. name: function(e) {
  10343. return n.__li.firstElementChild.firstElementChild.innerHTML = e,
  10344. n
  10345. },
  10346. listen: function() {
  10347. return n.__gui.listen(n),
  10348. n
  10349. },
  10350. remove: function() {
  10351. return n.__gui.remove(n),
  10352. n
  10353. }
  10354. }),
  10355. n instanceof f) {
  10356. var r = new p(n.object,n.property,{
  10357. min: n.__min,
  10358. max: n.__max,
  10359. step: n.__step
  10360. });
  10361. v.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10362. var t = n[e]
  10363. , i = r[e];
  10364. n[e] = r[e] = function() {
  10365. var e = Array.prototype.slice.call(arguments);
  10366. return t.apply(n, e),
  10367. i.apply(r, e)
  10368. }
  10369. }),
  10370. m.addClass(i, "has-slider"),
  10371. n.domElement.insertBefore(r.domElement, n.domElement.firstElementChild)
  10372. } else if (n instanceof p) {
  10373. var e = function(e) {
  10374. return v.isNumber(n.__min) && v.isNumber(n.__max) ? (n.remove(),
  10375. y(t, n.object, n.property, {
  10376. before: n.__li.nextElementSibling,
  10377. factoryArgs: [n.__min, n.__max, n.__step]
  10378. })) : e
  10379. };
  10380. n.min = v.compose(e, n.min),
  10381. n.max = v.compose(e, n.max)
  10382. } else
  10383. n instanceof u ? (m.bind(i, "click", function() {
  10384. m.fakeEvent(n.__checkbox, "click")
  10385. }),
  10386. m.bind(n.__checkbox, "click", function(e) {
  10387. e.stopPropagation()
  10388. })) : n instanceof d ? (m.bind(i, "click", function() {
  10389. m.fakeEvent(n.__button, "click")
  10390. }),
  10391. m.bind(i, "mouseover", function() {
  10392. m.addClass(n.__button, "hover")
  10393. }),
  10394. m.bind(i, "mouseout", function() {
  10395. m.removeClass(n.__button, "hover")
  10396. })) : n instanceof g && (m.addClass(i, "color"),
  10397. n.updateDisplay = v.compose(function(e) {
  10398. return i.style.borderLeftColor = n.__color.toString(),
  10399. e
  10400. }, n.updateDisplay),
  10401. n.updateDisplay());
  10402. n.setValue = v.compose(function(e) {
  10403. return t.getRoot().__preset_select && n.isModified() && _(t.getRoot(), !0),
  10404. e
  10405. }, n.setValue)
  10406. }(e, l, r),
  10407. e.__controllers.push(r),
  10408. r
  10409. }
  10410. function A(e, t, i) {
  10411. var n = document.createElement("li");
  10412. return t && n.appendChild(t),
  10413. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10414. e.onResize(),
  10415. n
  10416. }
  10417. function C(e, t) {
  10418. var i = e.getRoot()
  10419. , n = i.__rememberedObjects.indexOf(t.object);
  10420. if (-1 != n) {
  10421. var r = i.__rememberedObjectIndecesToControllers[n];
  10422. if (void 0 === r && (r = {},
  10423. i.__rememberedObjectIndecesToControllers[n] = r),
  10424. r[t.property] = t,
  10425. i.load && i.load.remembered) {
  10426. var o, a = i.load.remembered;
  10427. if (a[e.preset])
  10428. o = a[e.preset];
  10429. else {
  10430. if (!a[T])
  10431. return;
  10432. o = a[T]
  10433. }
  10434. if (o[n] && void 0 !== o[n][t.property]) {
  10435. var s = o[n][t.property];
  10436. t.initialValue = s,
  10437. t.setValue(s)
  10438. }
  10439. }
  10440. }
  10441. }
  10442. function I(e, t) {
  10443. return document.location.href + "." + t
  10444. }
  10445. function l(e, t) {
  10446. e.domElement.style.width = t + "px",
  10447. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10448. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10449. }
  10450. function a(r, o) {
  10451. var a = {};
  10452. return v.each(r.__rememberedObjects, function(e, t) {
  10453. var i = {}
  10454. , n = r.__rememberedObjectIndecesToControllers[t];
  10455. v.each(n, function(e, t) {
  10456. i[t] = o ? e.initialValue : e.getValue()
  10457. }),
  10458. a[t] = i
  10459. }),
  10460. a
  10461. }
  10462. function E(e, t, i) {
  10463. var n = document.createElement("option");
  10464. n.innerHTML = t,
  10465. n.value = t,
  10466. e.__preset_select.appendChild(n),
  10467. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10468. }
  10469. function _(e, t) {
  10470. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10471. i.innerHTML = t ? i.value + "*" : i.value
  10472. }
  10473. 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");
  10474. var b, w, T = "Default", x = function() {
  10475. try {
  10476. return "localStorage"in window && null !== window.localStorage
  10477. } catch (e) {
  10478. return !1
  10479. }
  10480. }(), S = !0, s = !1, M = [], R = function(t) {
  10481. var i = this;
  10482. this.domElement = document.createElement("div"),
  10483. this.__ul = document.createElement("ul"),
  10484. this.domElement.appendChild(this.__ul),
  10485. m.addClass(this.domElement, "dg"),
  10486. this.__folders = {},
  10487. this.__controllers = [],
  10488. this.__rememberedObjects = [],
  10489. this.__rememberedObjectIndecesToControllers = [],
  10490. this.__listening = [],
  10491. t = t || {},
  10492. t = v.defaults(t, {
  10493. autoPlace: !0,
  10494. width: R.DEFAULT_WIDTH
  10495. }),
  10496. t = v.defaults(t, {
  10497. resizable: t.autoPlace,
  10498. hideable: t.autoPlace
  10499. }),
  10500. v.isUndefined(t.load) ? t.load = {
  10501. preset: T
  10502. } : t.preset && (t.load.preset = t.preset),
  10503. v.isUndefined(t.parent) && t.hideable && M.push(this),
  10504. t.resizable = v.isUndefined(t.parent) && t.resizable,
  10505. t.autoPlace && v.isUndefined(t.scrollable) && (t.scrollable = !0);
  10506. var n, e, r = x && "true" === localStorage.getItem(I(0, "isLocal"));
  10507. if (Object.defineProperties(this, {
  10508. parent: {
  10509. get: function() {
  10510. return t.parent
  10511. }
  10512. },
  10513. scrollable: {
  10514. get: function() {
  10515. return t.scrollable
  10516. }
  10517. },
  10518. autoPlace: {
  10519. get: function() {
  10520. return t.autoPlace
  10521. }
  10522. },
  10523. preset: {
  10524. get: function() {
  10525. return i.parent ? i.getRoot().preset : t.load.preset
  10526. },
  10527. set: function(e) {
  10528. i.parent ? i.getRoot().preset = e : t.load.preset = e,
  10529. function(e) {
  10530. for (var t = 0; t < e.__preset_select.length; t++)
  10531. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10532. }(this),
  10533. i.revert()
  10534. }
  10535. },
  10536. width: {
  10537. get: function() {
  10538. return t.width
  10539. },
  10540. set: function(e) {
  10541. t.width = e,
  10542. l(i, e)
  10543. }
  10544. },
  10545. name: {
  10546. get: function() {
  10547. return t.name
  10548. },
  10549. set: function(e) {
  10550. t.name = e,
  10551. a && (a.innerHTML = t.name)
  10552. }
  10553. },
  10554. closed: {
  10555. get: function() {
  10556. return t.closed
  10557. },
  10558. set: function(e) {
  10559. t.closed = e,
  10560. t.closed ? m.addClass(i.__ul, R.CLASS_CLOSED) : m.removeClass(i.__ul, R.CLASS_CLOSED),
  10561. this.onResize(),
  10562. i.__closeButton && (i.__closeButton.innerHTML = e ? R.TEXT_OPEN : R.TEXT_CLOSED)
  10563. }
  10564. },
  10565. load: {
  10566. get: function() {
  10567. return t.load
  10568. }
  10569. },
  10570. useLocalStorage: {
  10571. get: function() {
  10572. return r
  10573. },
  10574. set: function(e) {
  10575. x && ((r = e) ? m.bind(window, "unload", n) : m.unbind(window, "unload", n),
  10576. localStorage.setItem(I(0, "isLocal"), e))
  10577. }
  10578. }
  10579. }),
  10580. v.isUndefined(t.parent)) {
  10581. if (t.closed = !1,
  10582. m.addClass(this.domElement, R.CLASS_MAIN),
  10583. m.makeSelectable(this.domElement, !1),
  10584. x && r) {
  10585. i.useLocalStorage = !0;
  10586. var o = localStorage.getItem(I(0, "gui"));
  10587. o && (t.load = JSON.parse(o))
  10588. }
  10589. this.__closeButton = document.createElement("div"),
  10590. this.__closeButton.innerHTML = R.TEXT_CLOSED,
  10591. m.addClass(this.__closeButton, R.CLASS_CLOSE_BUTTON),
  10592. this.domElement.appendChild(this.__closeButton),
  10593. m.bind(this.__closeButton, "click", function() {
  10594. i.closed = !i.closed
  10595. })
  10596. } else {
  10597. void 0 === t.closed && (t.closed = !0);
  10598. var a = document.createTextNode(t.name);
  10599. m.addClass(a, "controller-name");
  10600. var s = A(i, a);
  10601. m.addClass(this.__ul, R.CLASS_CLOSED),
  10602. m.addClass(s, "title"),
  10603. m.bind(s, "click", function(e) {
  10604. return e.preventDefault(),
  10605. i.closed = !i.closed,
  10606. !1
  10607. }),
  10608. t.closed || (this.closed = !1)
  10609. }
  10610. t.autoPlace && (v.isUndefined(t.parent) && (S && (w = document.createElement("div"),
  10611. m.addClass(w, "dg"),
  10612. m.addClass(w, R.CLASS_AUTO_PLACE_CONTAINER),
  10613. document.body.appendChild(w),
  10614. S = !1),
  10615. w.appendChild(this.domElement),
  10616. m.addClass(this.domElement, R.CLASS_AUTO_PLACE)),
  10617. this.parent || l(i, t.width)),
  10618. m.bind(window, "resize", function() {
  10619. i.onResize()
  10620. }),
  10621. m.bind(this.__ul, "webkitTransitionEnd", function() {
  10622. i.onResize()
  10623. }),
  10624. m.bind(this.__ul, "transitionend", function() {
  10625. i.onResize()
  10626. }),
  10627. m.bind(this.__ul, "oTransitionEnd", function() {
  10628. i.onResize()
  10629. }),
  10630. this.onResize(),
  10631. t.resizable && function(t) {
  10632. function e(e) {
  10633. return e.preventDefault(),
  10634. r = e.clientX,
  10635. m.addClass(t.__closeButton, R.CLASS_DRAG),
  10636. m.bind(window, "mousemove", i),
  10637. m.bind(window, "mouseup", n),
  10638. !1
  10639. }
  10640. function i(e) {
  10641. return e.preventDefault(),
  10642. t.width += r - e.clientX,
  10643. t.onResize(),
  10644. r = e.clientX,
  10645. !1
  10646. }
  10647. function n() {
  10648. m.removeClass(t.__closeButton, R.CLASS_DRAG),
  10649. m.unbind(window, "mousemove", i),
  10650. m.unbind(window, "mouseup", n)
  10651. }
  10652. var r;
  10653. t.__resize_handle = document.createElement("div"),
  10654. v.extend(t.__resize_handle.style, {
  10655. width: "6px",
  10656. marginLeft: "-3px",
  10657. height: "200px",
  10658. cursor: "ew-resize",
  10659. position: "absolute"
  10660. }),
  10661. m.bind(t.__resize_handle, "mousedown", e),
  10662. m.bind(t.__closeButton, "mousedown", e),
  10663. t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild)
  10664. }(this),
  10665. n = function() {
  10666. x && "true" === localStorage.getItem(I(0, "isLocal")) && localStorage.setItem(I(0, "gui"), JSON.stringify(i.getSaveObject()))
  10667. }
  10668. ,
  10669. this.saveToLocalStorageIfPossible = n,
  10670. i.getRoot(),
  10671. t.parent || ((e = i.getRoot()).width += 1,
  10672. v.defer(function() {
  10673. e.width -= 1
  10674. }))
  10675. };
  10676. return R.toggleHide = function() {
  10677. s = !s,
  10678. v.each(M, function(e) {
  10679. e.domElement.style.zIndex = s ? -999 : 999,
  10680. e.domElement.style.opacity = s ? 0 : 1
  10681. })
  10682. }
  10683. ,
  10684. R.CLASS_AUTO_PLACE = "a",
  10685. R.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10686. R.CLASS_MAIN = "main",
  10687. R.CLASS_CONTROLLER_ROW = "cr",
  10688. R.CLASS_TOO_TALL = "taller-than-window",
  10689. R.CLASS_CLOSED = "closed",
  10690. R.CLASS_CLOSE_BUTTON = "close-button",
  10691. R.CLASS_DRAG = "drag",
  10692. R.DEFAULT_WIDTH = 245,
  10693. R.TEXT_CLOSED = "Close Controls",
  10694. R.TEXT_OPEN = "Open Controls",
  10695. m.bind(window, "keydown", function(e) {
  10696. "text" === document.activeElement.type || 72 !== e.which && 72 != e.keyCode || R.toggleHide()
  10697. }, !1),
  10698. v.extend(R.prototype, {
  10699. add: function(e, t) {
  10700. return y(this, e, t, {
  10701. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10702. })
  10703. },
  10704. addColor: function(e, t) {
  10705. return y(this, e, t, {
  10706. color: !0
  10707. })
  10708. },
  10709. remove: function(e) {
  10710. this.__ul.removeChild(e.__li),
  10711. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10712. var t = this;
  10713. v.defer(function() {
  10714. t.onResize()
  10715. })
  10716. },
  10717. destroy: function() {
  10718. this.autoPlace && w.removeChild(this.domElement)
  10719. },
  10720. addFolder: function(e) {
  10721. if (void 0 !== this.__folders[e])
  10722. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10723. var t = {
  10724. name: e,
  10725. parent: this
  10726. };
  10727. t.autoPlace = this.autoPlace,
  10728. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10729. t.load = this.load.folders[e]);
  10730. var i = new R(t);
  10731. this.__folders[e] = i;
  10732. var n = A(this, i.domElement);
  10733. return m.addClass(n, "folder"),
  10734. i
  10735. },
  10736. open: function() {
  10737. this.closed = !1
  10738. },
  10739. close: function() {
  10740. this.closed = !0
  10741. },
  10742. onResize: function() {
  10743. var t = this.getRoot();
  10744. if (t.scrollable) {
  10745. var e = m.getOffset(t.__ul).top
  10746. , i = 0;
  10747. v.each(t.__ul.childNodes, function(e) {
  10748. t.autoPlace && e === t.__save_row || (i += m.getHeight(e))
  10749. }),
  10750. $("#player").height() - e - 20 < i ? (m.addClass(t.domElement, R.CLASS_TOO_TALL),
  10751. t.__ul.style.height = $("#player").height() - e - 20 + "px") : (m.removeClass(t.domElement, R.CLASS_TOO_TALL),
  10752. t.__ul.style.height = "auto")
  10753. }
  10754. t.__resize_handle && v.defer(function() {
  10755. t.__resize_handle.style.height = t.__ul.offsetHeight + "px"
  10756. }),
  10757. t.__closeButton && (t.__closeButton.style.width = t.width + "px")
  10758. },
  10759. remember: function() {
  10760. 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>'),
  10761. this.parent)
  10762. throw new Error("You can only call remember on a top level GUI.");
  10763. var t = this;
  10764. v.each(Array.prototype.slice.call(arguments), function(e) {
  10765. 0 == t.__rememberedObjects.length && function(i) {
  10766. var e = i.__save_row = document.createElement("li");
  10767. m.addClass(i.domElement, "has-save"),
  10768. i.__ul.insertBefore(e, i.__ul.firstChild),
  10769. m.addClass(e, "save-row");
  10770. var t = document.createElement("span");
  10771. t.innerHTML = "&nbsp;",
  10772. m.addClass(t, "button gears");
  10773. var n = document.createElement("span");
  10774. n.innerHTML = "Save",
  10775. m.addClass(n, "button"),
  10776. m.addClass(n, "save");
  10777. var r = document.createElement("span");
  10778. r.innerHTML = "New",
  10779. m.addClass(r, "button"),
  10780. m.addClass(r, "save-as");
  10781. var o = document.createElement("span");
  10782. o.innerHTML = "Revert",
  10783. m.addClass(o, "button"),
  10784. m.addClass(o, "revert");
  10785. var a = i.__preset_select = document.createElement("select");
  10786. if (i.load && i.load.remembered ? v.each(i.load.remembered, function(e, t) {
  10787. E(i, t, t == i.preset)
  10788. }) : E(i, T, !1),
  10789. m.bind(a, "change", function() {
  10790. for (var e = 0; e < i.__preset_select.length; e++)
  10791. i.__preset_select[e].innerHTML = i.__preset_select[e].value;
  10792. i.preset = this.value
  10793. }),
  10794. e.appendChild(a),
  10795. e.appendChild(t),
  10796. e.appendChild(n),
  10797. e.appendChild(r),
  10798. e.appendChild(o),
  10799. x) {
  10800. var s = document.getElementById("dg-save-locally")
  10801. , l = document.getElementById("dg-local-explain");
  10802. s.style.display = "block";
  10803. var c = document.getElementById("dg-local-storage");
  10804. "true" === localStorage.getItem(I(0, "isLocal")) && c.setAttribute("checked", "checked");
  10805. var h = function() {
  10806. l.style.display = i.useLocalStorage ? "block" : "none"
  10807. };
  10808. h(),
  10809. m.bind(c, "change", function() {
  10810. i.useLocalStorage = !i.useLocalStorage,
  10811. h()
  10812. })
  10813. }
  10814. var u = document.getElementById("dg-new-constructor");
  10815. m.bind(u, "keydown", function(e) {
  10816. !e.metaKey || 67 !== e.which && 67 != e.keyCode || b.hide()
  10817. }),
  10818. m.bind(t, "click", function() {
  10819. u.innerHTML = JSON.stringify(i.getSaveObject(), void 0, 2),
  10820. b.show(),
  10821. u.focus(),
  10822. u.select()
  10823. }),
  10824. m.bind(n, "click", function() {
  10825. i.save()
  10826. }),
  10827. m.bind(r, "click", function() {
  10828. var e = prompt("Enter a new preset name.");
  10829. e && i.saveAs(e)
  10830. }),
  10831. m.bind(o, "click", function() {
  10832. i.revert()
  10833. })
  10834. }(t),
  10835. -1 == t.__rememberedObjects.indexOf(e) && t.__rememberedObjects.push(e)
  10836. }),
  10837. this.autoPlace && l(this, this.width)
  10838. },
  10839. getRoot: function() {
  10840. for (var e = this; e.parent; )
  10841. e = e.parent;
  10842. return e
  10843. },
  10844. getSaveObject: function() {
  10845. var i = this.load;
  10846. return i.closed = this.closed,
  10847. 0 < this.__rememberedObjects.length && (i.preset = this.preset,
  10848. i.remembered || (i.remembered = {}),
  10849. i.remembered[this.preset] = a(this)),
  10850. i.folders = {},
  10851. v.each(this.__folders, function(e, t) {
  10852. i.folders[t] = e.getSaveObject()
  10853. }),
  10854. i
  10855. },
  10856. save: function() {
  10857. this.load.remembered || (this.load.remembered = {}),
  10858. this.load.remembered[this.preset] = a(this),
  10859. _(this, !1),
  10860. this.saveToLocalStorageIfPossible()
  10861. },
  10862. saveAs: function(e) {
  10863. this.load.remembered || (this.load.remembered = {},
  10864. this.load.remembered[T] = a(this, !0)),
  10865. this.load.remembered[e] = a(this),
  10866. this.preset = e,
  10867. E(this, e, !0),
  10868. this.saveToLocalStorageIfPossible()
  10869. },
  10870. revert: function(t) {
  10871. v.each(this.__controllers, function(e) {
  10872. this.getRoot().load.remembered ? C(t || this.getRoot(), e) : e.setValue(e.initialValue)
  10873. }, this),
  10874. v.each(this.__folders, function(e) {
  10875. e.revert(e)
  10876. }),
  10877. t || _(this.getRoot(), !1)
  10878. },
  10879. listen: function(e) {
  10880. var t = 0 == this.__listening.length;
  10881. this.__listening.push(e),
  10882. t && function e(t) {
  10883. 0 != t.length && r(function() {
  10884. e(t)
  10885. }),
  10886. v.each(t, function(e) {
  10887. e.updateDisplay()
  10888. })
  10889. }(this.__listening)
  10890. }
  10891. }),
  10892. R
  10893. }(ee.utils.css, 0, 0, ee.controllers.factory = (h = ee.controllers.OptionController,
  10894. u = ee.controllers.NumberControllerBox,
  10895. d = ee.controllers.NumberControllerSlider,
  10896. p = ee.controllers.StringController = (v = ee.controllers.Controller,
  10897. y = ee.dom.dom,
  10898. A = ee.utils.common,
  10899. (C = function(e, t) {
  10900. function i() {
  10901. n.setValue(n.__input.value)
  10902. }
  10903. C.superclass.call(this, e, t);
  10904. var n = this;
  10905. this.__input = document.createElement("input"),
  10906. this.__input.setAttribute("type", "text"),
  10907. y.bind(this.__input, "keyup", i),
  10908. y.bind(this.__input, "change", i),
  10909. y.bind(this.__input, "blur", function() {
  10910. n.__onFinishChange && n.__onFinishChange.call(n, n.getValue())
  10911. }),
  10912. y.bind(this.__input, "keydown", function(e) {
  10913. 13 === e.keyCode && this.blur()
  10914. }),
  10915. this.updateDisplay(),
  10916. this.domElement.appendChild(this.__input)
  10917. }
  10918. ).superclass = v,
  10919. A.extend(C.prototype, v.prototype, {
  10920. updateDisplay: function() {
  10921. return y.isActive(this.__input) || (this.__input.value = this.getValue()),
  10922. C.superclass.prototype.updateDisplay.call(this)
  10923. }
  10924. }),
  10925. C),
  10926. f = ee.controllers.FunctionController,
  10927. g = ee.controllers.BooleanController,
  10928. m = ee.utils.common,
  10929. function(e, t) {
  10930. var i = e[t];
  10931. 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,{
  10932. min: arguments[2],
  10933. max: arguments[3]
  10934. }) : m.isString(i) ? new p(e,t) : m.isFunction(i) ? new f(e,t,"") : m.isBoolean(i) ? new g(e,t) : void 0
  10935. }
  10936. ), 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) {
  10937. function f(t, i, n, r) {
  10938. t.style.background = "",
  10939. p.each(o, function(e) {
  10940. t.style.cssText += "background: " + e + "linear-gradient(" + i + ", " + n + " 0%, " + r + " 100%); "
  10941. })
  10942. }
  10943. var g = function(e, t) {
  10944. function i(e) {
  10945. a(e),
  10946. h.bind(window, "mousemove", a),
  10947. h.bind(window, "mouseup", n)
  10948. }
  10949. function n() {
  10950. h.unbind(window, "mousemove", a),
  10951. h.unbind(window, "mouseup", n)
  10952. }
  10953. function r() {
  10954. var e = d(this.value);
  10955. !1 !== e ? (l.__color.__state = e,
  10956. l.setValue(l.__color.toOriginal())) : this.value = l.__color.toString()
  10957. }
  10958. function o() {
  10959. h.unbind(window, "mousemove", s),
  10960. h.unbind(window, "mouseup", o)
  10961. }
  10962. function a(e) {
  10963. e.preventDefault();
  10964. var t = h.getWidth(l.__saturation_field)
  10965. , i = h.getOffset(l.__saturation_field)
  10966. , n = (e.clientX - i.left + document.body.scrollLeft) / t
  10967. , r = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10968. return 1 < r ? r = 1 : r < 0 && (r = 0),
  10969. 1 < n ? n = 1 : n < 0 && (n = 0),
  10970. l.__color.v = r,
  10971. l.__color.s = n,
  10972. l.setValue(l.__color.toOriginal()),
  10973. !1
  10974. }
  10975. function s(e) {
  10976. e.preventDefault();
  10977. var t = h.getHeight(l.__hue_field)
  10978. , i = h.getOffset(l.__hue_field)
  10979. , n = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10980. return 1 < n ? n = 1 : n < 0 && (n = 0),
  10981. l.__color.h = 360 * n,
  10982. l.setValue(l.__color.toOriginal()),
  10983. !1
  10984. }
  10985. g.superclass.call(this, e, t),
  10986. this.__color = new u(this.getValue()),
  10987. this.__temp = new u(0);
  10988. var l = this;
  10989. this.domElement = document.createElement("div"),
  10990. h.makeSelectable(this.domElement, !1),
  10991. this.__selector = document.createElement("div"),
  10992. this.__selector.className = "selector",
  10993. this.__saturation_field = document.createElement("div"),
  10994. this.__saturation_field.className = "saturation-field",
  10995. this.__field_knob = document.createElement("div"),
  10996. this.__field_knob.className = "field-knob",
  10997. this.__field_knob_border = "2px solid ",
  10998. this.__hue_knob = document.createElement("div"),
  10999. this.__hue_knob.className = "hue-knob",
  11000. this.__hue_field = document.createElement("div"),
  11001. this.__hue_field.className = "hue-field",
  11002. this.__input = document.createElement("input"),
  11003. this.__input.type = "text",
  11004. this.__input_textShadow = "0 1px 1px ",
  11005. h.bind(this.__input, "keydown", function(e) {
  11006. 13 === e.keyCode && r.call(this)
  11007. }),
  11008. h.bind(this.__input, "blur", r),
  11009. h.bind(this.__selector, "mousedown", function(e) {
  11010. h.addClass(this, "drag").bind(window, "mouseup", function(e) {
  11011. h.removeClass(l.__selector, "drag")
  11012. })
  11013. });
  11014. var c = document.createElement("div");
  11015. p.extend(this.__selector.style, {
  11016. width: "122px",
  11017. height: "102px",
  11018. padding: "3px",
  11019. backgroundColor: "#222",
  11020. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  11021. }),
  11022. p.extend(this.__field_knob.style, {
  11023. position: "absolute",
  11024. width: "12px",
  11025. height: "12px",
  11026. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  11027. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  11028. borderRadius: "12px",
  11029. zIndex: 1
  11030. }),
  11031. p.extend(this.__hue_knob.style, {
  11032. position: "absolute",
  11033. width: "15px",
  11034. height: "2px",
  11035. borderRight: "4px solid #fff",
  11036. zIndex: 1
  11037. }),
  11038. p.extend(this.__saturation_field.style, {
  11039. width: "100px",
  11040. height: "100px",
  11041. border: "1px solid #555",
  11042. marginRight: "3px",
  11043. display: "inline-block",
  11044. cursor: "pointer"
  11045. }),
  11046. p.extend(c.style, {
  11047. width: "100%",
  11048. height: "100%",
  11049. background: "none"
  11050. }),
  11051. f(c, "top", "rgba(0,0,0,0)", "#000"),
  11052. p.extend(this.__hue_field.style, {
  11053. width: "15px",
  11054. height: "100px",
  11055. display: "inline-block",
  11056. border: "1px solid #555",
  11057. cursor: "ns-resize"
  11058. }),
  11059. function(e) {
  11060. e.style.background = "",
  11061. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  11062. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11063. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11064. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11065. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  11066. }(this.__hue_field),
  11067. p.extend(this.__input.style, {
  11068. outline: "none",
  11069. textAlign: "center",
  11070. color: "#fff",
  11071. border: 0,
  11072. fontWeight: "bold",
  11073. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  11074. }),
  11075. h.bind(this.__saturation_field, "mousedown", i),
  11076. h.bind(this.__field_knob, "mousedown", i),
  11077. h.bind(this.__hue_field, "mousedown", function(e) {
  11078. s(e),
  11079. h.bind(window, "mousemove", s),
  11080. h.bind(window, "mouseup", o)
  11081. }),
  11082. this.__saturation_field.appendChild(c),
  11083. this.__selector.appendChild(this.__field_knob),
  11084. this.__selector.appendChild(this.__saturation_field),
  11085. this.__selector.appendChild(this.__hue_field),
  11086. this.__hue_field.appendChild(this.__hue_knob),
  11087. this.domElement.appendChild(this.__input),
  11088. this.domElement.appendChild(this.__selector),
  11089. this.updateDisplay()
  11090. };
  11091. g.superclass = e,
  11092. p.extend(g.prototype, e.prototype, {
  11093. updateDisplay: function() {
  11094. var t = d(this.getValue());
  11095. if (!1 !== t) {
  11096. var i = !1;
  11097. p.each(u.COMPONENTS, function(e) {
  11098. if (!p.isUndefined(t[e]) && !p.isUndefined(this.__color.__state[e]) && t[e] !== this.__color.__state[e])
  11099. return i = !0,
  11100. {}
  11101. }, this),
  11102. i && p.extend(this.__color.__state, t)
  11103. }
  11104. p.extend(this.__temp.__state, this.__color.__state),
  11105. this.__temp.a = 1;
  11106. var e = this.__color.v < .5 || .5 < this.__color.s ? 255 : 0
  11107. , n = 255 - e;
  11108. p.extend(this.__field_knob.style, {
  11109. marginLeft: 100 * this.__color.s - 7 + "px",
  11110. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11111. backgroundColor: this.__temp.toString(),
  11112. border: this.__field_knob_border + "rgb(" + e + "," + e + "," + e + ")"
  11113. }),
  11114. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11115. this.__temp.s = 1,
  11116. this.__temp.v = 1,
  11117. f(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11118. p.extend(this.__input.style, {
  11119. backgroundColor: this.__input.value = this.__color.toString(),
  11120. color: "rgb(" + e + "," + e + "," + e + ")",
  11121. textShadow: this.__input_textShadow + "rgba(" + n + "," + n + "," + n + ",.7)"
  11122. })
  11123. }
  11124. });
  11125. var o = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11126. return g
  11127. }(ee.controllers.Controller, ee.dom.dom, ee.color.Color = (o = ee.color.interpret,
  11128. a = ee.color.math = {
  11129. hsv_to_rgb: function(e, t, i) {
  11130. var n = Math.floor(e / 60) % 6
  11131. , r = e / 60 - Math.floor(e / 60)
  11132. , o = i * (1 - t)
  11133. , a = i * (1 - r * t)
  11134. , s = i * (1 - (1 - r) * t)
  11135. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11136. return {
  11137. r: 255 * l[0],
  11138. g: 255 * l[1],
  11139. b: 255 * l[2]
  11140. }
  11141. },
  11142. rgb_to_hsv: function(e, t, i) {
  11143. var n, r = Math.min(e, t, i), o = Math.max(e, t, i), a = o - r;
  11144. return 0 == o ? {
  11145. h: NaN,
  11146. s: 0,
  11147. v: 0
  11148. } : (n = e == o ? (t - i) / a : t == o ? 2 + (i - e) / a : 4 + (e - t) / a,
  11149. (n /= 6) < 0 && (n += 1),
  11150. {
  11151. h: 360 * n,
  11152. s: a / o,
  11153. v: o / 255
  11154. })
  11155. },
  11156. rgb_to_hex: function(e, t, i) {
  11157. var n = this.hex_with_component(0, 2, e);
  11158. return n = this.hex_with_component(n, 1, t),
  11159. this.hex_with_component(n, 0, i)
  11160. },
  11161. component_from_hex: function(e, t) {
  11162. return e >> 8 * t & 255
  11163. },
  11164. hex_with_component: function(e, t, i) {
  11165. return i << (c = 8 * t) | e & ~(255 << c)
  11166. }
  11167. },
  11168. s = ee.color.toString,
  11169. l = ee.utils.common,
  11170. ae.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11171. l.extend(ae.prototype, {
  11172. toString: function() {
  11173. return s(this)
  11174. },
  11175. toOriginal: function() {
  11176. return this.__state.conversion.write(this)
  11177. }
  11178. }),
  11179. ie(ae.prototype, "r", 2),
  11180. ie(ae.prototype, "g", 1),
  11181. ie(ae.prototype, "b", 0),
  11182. ne(ae.prototype, "h"),
  11183. ne(ae.prototype, "s"),
  11184. ne(ae.prototype, "v"),
  11185. Object.defineProperty(ae.prototype, "a", {
  11186. get: function() {
  11187. return this.__state.a
  11188. },
  11189. set: function(e) {
  11190. this.__state.a = e
  11191. }
  11192. }),
  11193. Object.defineProperty(ae.prototype, "hex", {
  11194. get: function() {
  11195. return "HEX" !== !this.__state.space && (this.__state.hex = a.rgb_to_hex(this.r, this.g, this.b)),
  11196. this.__state.hex
  11197. },
  11198. set: function(e) {
  11199. this.__state.space = "HEX",
  11200. this.__state.hex = e
  11201. }
  11202. }),
  11203. ae), ee.color.interpret, ee.utils.common), ee.utils.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11204. window.setTimeout(e, 1e3 / 60)
  11205. }
  11206. , ee.dom.CenteredDiv = (n = ee.dom.dom,
  11207. r = ee.utils.common,
  11208. te.prototype.show = function() {
  11209. var e = this;
  11210. this.backgroundElement.style.display = "block",
  11211. this.domElement.style.display = "block",
  11212. this.domElement.style.opacity = 0,
  11213. this.domElement.style.webkitTransform = "scale(1.1)",
  11214. this.layout(),
  11215. r.defer(function() {
  11216. e.backgroundElement.style.opacity = 1,
  11217. e.domElement.style.opacity = 1,
  11218. e.domElement.style.webkitTransform = "scale(1)"
  11219. })
  11220. }
  11221. ,
  11222. te.prototype.hide = function() {
  11223. var e = this
  11224. , t = function() {
  11225. e.domElement.style.display = "none",
  11226. e.backgroundElement.style.display = "none",
  11227. n.unbind(e.domElement, "webkitTransitionEnd", t),
  11228. n.unbind(e.domElement, "transitionend", t),
  11229. n.unbind(e.domElement, "oTransitionEnd", t)
  11230. };
  11231. n.bind(this.domElement, "webkitTransitionEnd", t),
  11232. n.bind(this.domElement, "transitionend", t),
  11233. n.bind(this.domElement, "oTransitionEnd", t),
  11234. this.backgroundElement.style.opacity = 0,
  11235. this.domElement.style.opacity = 0,
  11236. this.domElement.style.webkitTransform = "scale(1.1)"
  11237. }
  11238. ,
  11239. te.prototype.layout = function() {
  11240. this.domElement.style.left = $("#player").width() / 2 - n.getWidth(this.domElement) / 2 + "px",
  11241. this.domElement.style.top = $("#player").height() / 2 - n.getHeight(this.domElement) / 2 + "px"
  11242. }
  11243. ,
  11244. te), ee.dom.dom, ee.utils.common)
  11245. }
  11246. , {}],
  11247. 94: [function(e, t, i) {
  11248. (function(J) {
  11249. "use strict";
  11250. function i(e) {
  11251. function t(e, t) {
  11252. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11253. for (var a = 1; a <= e[o]; a++)
  11254. r[t[n]] = [],
  11255. r[t[n]][0] = i,
  11256. r[t[n]][1] = o,
  11257. n++,
  11258. i++;
  11259. i *= 2
  11260. }
  11261. return r
  11262. }
  11263. function _(e) {
  11264. for (var t = e[0], i = e[1] - 1; 0 <= i; )
  11265. t & 1 << i && (B |= 1 << V),
  11266. i--,
  11267. --V < 0 && (255 == B ? (b(255),
  11268. b(0)) : b(B),
  11269. V = 7,
  11270. B = 0)
  11271. }
  11272. function b(e) {
  11273. F.push(e)
  11274. }
  11275. function w(e) {
  11276. b(e >> 8 & 255),
  11277. b(255 & e)
  11278. }
  11279. function T(e, t, i, n, r) {
  11280. for (var o, a = r[0], s = r[240], l = function(e, t) {
  11281. var i, n, r, o, a, s, l, c, h, u, d = 0;
  11282. for (h = 0; h < 8; ++h) {
  11283. i = e[d],
  11284. n = e[d + 1],
  11285. r = e[d + 2],
  11286. o = e[d + 3],
  11287. a = e[d + 4],
  11288. s = e[d + 5],
  11289. l = e[d + 6];
  11290. var p = i + (c = e[d + 7])
  11291. , f = i - c
  11292. , g = n + l
  11293. , m = n - l
  11294. , v = r + s
  11295. , y = r - s
  11296. , A = o + a
  11297. , C = o - a
  11298. , I = p + A
  11299. , E = p - A
  11300. , _ = g + v
  11301. , b = g - v;
  11302. e[d] = I + _,
  11303. e[d + 4] = I - _;
  11304. var w = .707106781 * (b + E);
  11305. e[d + 2] = E + w,
  11306. e[d + 6] = E - w;
  11307. var T = .382683433 * ((I = C + y) - (b = m + f))
  11308. , x = .5411961 * I + T
  11309. , S = 1.306562965 * b + T
  11310. , M = .707106781 * (_ = y + m)
  11311. , R = f + M
  11312. , P = f - M;
  11313. e[d + 5] = P + x,
  11314. e[d + 3] = P - x,
  11315. e[d + 1] = R + S,
  11316. e[d + 7] = R - S,
  11317. d += 8
  11318. }
  11319. for (h = d = 0; h < 8; ++h) {
  11320. i = e[d],
  11321. n = e[d + 8],
  11322. r = e[d + 16],
  11323. o = e[d + 24],
  11324. a = e[d + 32],
  11325. s = e[d + 40],
  11326. l = e[d + 48];
  11327. var O = i + (c = e[d + 56])
  11328. , L = i - c
  11329. , D = n + l
  11330. , N = n - l
  11331. , F = r + s
  11332. , B = r - s
  11333. , V = o + a
  11334. , k = o - a
  11335. , U = O + V
  11336. , H = O - V
  11337. , z = D + F
  11338. , G = D - F;
  11339. e[d] = U + z,
  11340. e[d + 32] = U - z;
  11341. var W = .707106781 * (G + H);
  11342. e[d + 16] = H + W,
  11343. e[d + 48] = H - W;
  11344. var j = .382683433 * ((U = k + B) - (G = N + L))
  11345. , Y = .5411961 * U + j
  11346. , q = 1.306562965 * G + j
  11347. , X = .707106781 * (z = B + N)
  11348. , Z = L + X
  11349. , K = L - X;
  11350. e[d + 40] = K + Y,
  11351. e[d + 24] = K - Y,
  11352. e[d + 8] = Z + q,
  11353. e[d + 56] = Z - q,
  11354. d++
  11355. }
  11356. for (h = 0; h < 64; ++h)
  11357. u = e[h] * t[h],
  11358. Q[h] = 0 < u ? .5 + u | 0 : u - .5 | 0;
  11359. return Q
  11360. }(e, t), c = 0; c < 64; ++c)
  11361. A[C[c]] = l[c];
  11362. var h = A[0] - i;
  11363. i = A[0],
  11364. 0 == h ? _(n[0]) : (_(n[y[o = 32767 + h]]),
  11365. _(v[o]));
  11366. for (var u = 63; 0 < u && 0 == A[u]; u--)
  11367. ;
  11368. if (0 == u)
  11369. return _(a),
  11370. i;
  11371. for (var d, p = 1; p <= u; ) {
  11372. for (var f = p; 0 == A[p] && p <= u; ++p)
  11373. ;
  11374. var g = p - f;
  11375. if (16 <= g) {
  11376. d = g >> 4;
  11377. for (var m = 1; m <= d; ++m)
  11378. _(s);
  11379. g &= 15
  11380. }
  11381. o = 32767 + A[p],
  11382. _(r[(g << 4) + y[o]]),
  11383. _(v[o]),
  11384. p++
  11385. }
  11386. return 63 != u && _(a),
  11387. i
  11388. }
  11389. function x(e) {
  11390. if (e <= 0 && (e = 1),
  11391. 100 < e && (e = 100),
  11392. i != e) {
  11393. (function(e) {
  11394. 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++) {
  11395. var n = u((t[i] * e + 50) / 100);
  11396. n < 1 ? n = 1 : 255 < n && (n = 255),
  11397. O[C[i]] = n
  11398. }
  11399. 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++) {
  11400. var a = u((r[o] * e + 50) / 100);
  11401. a < 1 ? a = 1 : 255 < a && (a = 255),
  11402. L[C[o]] = a
  11403. }
  11404. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11405. for (var h = 0; h < 8; h++)
  11406. D[l] = 1 / (O[C[l]] * s[c] * s[h] * 8),
  11407. N[l] = 1 / (L[C[l]] * s[c] * s[h] * 8),
  11408. l++
  11409. }
  11410. )(e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)),
  11411. i = e
  11412. }
  11413. }
  11414. var S, M, R, P, i, u = (Math.round,
  11415. 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];
  11416. this.encode = function(e, t) {
  11417. var i = ((new Date).getTime(),
  11418. t.quality);
  11419. i && x(i),
  11420. F = new Array,
  11421. B = 0,
  11422. V = 7,
  11423. w(65496),
  11424. w(65504),
  11425. w(16),
  11426. b(74),
  11427. b(70),
  11428. b(73),
  11429. b(70),
  11430. b(0),
  11431. b(1),
  11432. b(1),
  11433. b(0),
  11434. w(1),
  11435. w(1),
  11436. b(0),
  11437. b(0),
  11438. function() {
  11439. w(65499),
  11440. w(132),
  11441. b(0);
  11442. for (var e = 0; e < 64; e++)
  11443. b(O[e]);
  11444. b(1);
  11445. for (var t = 0; t < 64; t++)
  11446. b(L[t])
  11447. }(),
  11448. function(e, t) {
  11449. w(65472),
  11450. w(17),
  11451. b(8),
  11452. w(t),
  11453. w(e),
  11454. b(3),
  11455. b(1),
  11456. b(17),
  11457. b(0),
  11458. b(2),
  11459. b(17),
  11460. b(1),
  11461. b(3),
  11462. b(17),
  11463. b(1)
  11464. }(e.width, e.height),
  11465. function() {
  11466. w(65476),
  11467. w(418),
  11468. b(0);
  11469. for (var e = 0; e < 16; e++)
  11470. b(G[e + 1]);
  11471. for (var t = 0; t <= 11; t++)
  11472. b(W[t]);
  11473. b(16);
  11474. for (var i = 0; i < 16; i++)
  11475. b(j[i + 1]);
  11476. for (var n = 0; n <= 161; n++)
  11477. b(Y[n]);
  11478. b(1);
  11479. for (var r = 0; r < 16; r++)
  11480. b(q[r + 1]);
  11481. for (var o = 0; o <= 11; o++)
  11482. b(X[o]);
  11483. b(17);
  11484. for (var a = 0; a < 16; a++)
  11485. b(Z[a + 1]);
  11486. for (var s = 0; s <= 161; s++)
  11487. b(K[s])
  11488. }(),
  11489. w(65498),
  11490. w(12),
  11491. b(3),
  11492. b(1),
  11493. b(0),
  11494. b(2),
  11495. b(17),
  11496. b(3),
  11497. b(17),
  11498. b(0),
  11499. b(63),
  11500. b(0);
  11501. var n = 0
  11502. , r = 0
  11503. , o = 0;
  11504. B = 0,
  11505. V = 7,
  11506. this.encode.displayName = "_encode_";
  11507. 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; ) {
  11508. for (a = 0; a < A; ) {
  11509. for (u = h = A * C + a,
  11510. d = -1,
  11511. f = p = 0; f < 64; f++)
  11512. u = h + (p = (y ? 63 - f : f) >> 3) * A + (d = 4 * (7 & f)),
  11513. v <= C + p && (u -= A * (C + 1 + p - v)),
  11514. A <= a + d && (u -= a + d - A + 4),
  11515. s = g[u++],
  11516. l = g[u++],
  11517. c = g[u++],
  11518. k[f] = (z[s] + z[l + 256 >> 0] + z[c + 512 >> 0] >> 16) - 128,
  11519. U[f] = (z[s + 768 >> 0] + z[l + 1024 >> 0] + z[c + 1280 >> 0] >> 16) - 128,
  11520. H[f] = (z[s + 1280 >> 0] + z[l + 1536 >> 0] + z[c + 1792 >> 0] >> 16) - 128;
  11521. n = T(k, D, n, S, R),
  11522. r = T(U, N, r, M, P),
  11523. o = T(H, N, o, M, P),
  11524. a += 32
  11525. }
  11526. C += I
  11527. }
  11528. if (0 <= V) {
  11529. var E = [];
  11530. E[1] = V + 1,
  11531. E[0] = (1 << V + 1) - 1,
  11532. _(E)
  11533. }
  11534. return w(65497),
  11535. new J(F)
  11536. }
  11537. ,
  11538. (new Date).getTime(),
  11539. e = e || 50,
  11540. function() {
  11541. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11542. n[t] = e(t)
  11543. }(),
  11544. S = t(G, W),
  11545. M = t(q, X),
  11546. R = t(j, Y),
  11547. P = t(Z, K),
  11548. function() {
  11549. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11550. for (var n = e; n < t; n++)
  11551. y[32767 + n] = i,
  11552. v[32767 + n] = [],
  11553. v[32767 + n][1] = i,
  11554. v[32767 + n][0] = n;
  11555. for (var r = -(t - 1); r <= -e; r++)
  11556. y[32767 + r] = i,
  11557. v[32767 + r] = [],
  11558. v[32767 + r][1] = i,
  11559. v[32767 + r][0] = t - 1 + r;
  11560. e <<= 1,
  11561. t <<= 1
  11562. }
  11563. }(),
  11564. function() {
  11565. for (var e = 0; e < 256; e++)
  11566. z[e] = 19595 * e,
  11567. z[e + 256 >> 0] = 38470 * e,
  11568. z[e + 512 >> 0] = 7471 * e + 32768,
  11569. z[e + 768 >> 0] = -11059 * e,
  11570. z[e + 1024 >> 0] = -21709 * e,
  11571. z[e + 1280 >> 0] = 32768 * e + 8421375,
  11572. z[e + 1536 >> 0] = -27439 * e,
  11573. z[e + 1792 >> 0] = -5329 * e
  11574. }(),
  11575. x(e),
  11576. (new Date).getTime()
  11577. }
  11578. t.exports.encode = function(e, t) {
  11579. return (t = t || {}).quality = t.quality || 50,
  11580. {
  11581. data: new i(t.quality).encode(e, t),
  11582. width: e.width,
  11583. height: e.height
  11584. }
  11585. }
  11586. }
  11587. ).call(this, e("buffer").Buffer)
  11588. }
  11589. , {
  11590. buffer: 198
  11591. }],
  11592. 95: [function(e, t, i) {
  11593. "use strict";
  11594. !function() {
  11595. if ("performance"in window == 0 && (window.performance = {}),
  11596. Date.now = Date.now || function() {
  11597. return (new Date).getTime()
  11598. }
  11599. ,
  11600. "now"in window.performance == 0) {
  11601. var e = Date.now();
  11602. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11603. window.performance.now = function() {
  11604. return Date.now() - e
  11605. }
  11606. }
  11607. }()
  11608. }
  11609. , {}],
  11610. 96: [function(e, t, i) {
  11611. "use strict";
  11612. var a = e("three");
  11613. a.EffectComposer = function(e, t) {
  11614. if (this.renderer = e,
  11615. void 0 === t) {
  11616. var i = {
  11617. minFilter: a.LinearFilter,
  11618. magFilter: a.LinearFilter,
  11619. format: a.RGBAFormat,
  11620. stencilBuffer: !1
  11621. }
  11622. , n = e.getSize();
  11623. t = new a.WebGLRenderTarget(n.width,n.height,i)
  11624. }
  11625. this.renderTarget1 = t,
  11626. this.renderTarget2 = t.clone(),
  11627. this.writeBuffer = this.renderTarget1,
  11628. this.readBuffer = this.renderTarget2,
  11629. this.passes = [],
  11630. void 0 === a.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11631. this.copyPass = new a.ShaderPass(a.CopyShader)
  11632. }
  11633. ,
  11634. a.EffectComposer.prototype = {
  11635. swapBuffers: function() {
  11636. var e = this.readBuffer;
  11637. this.readBuffer = this.writeBuffer,
  11638. this.writeBuffer = e
  11639. },
  11640. addPass: function(e) {
  11641. this.passes.push(e)
  11642. },
  11643. insertPass: function(e, t) {
  11644. this.passes.splice(t, 0, e)
  11645. },
  11646. render: function(e) {
  11647. this.writeBuffer = this.renderTarget1,
  11648. this.readBuffer = this.renderTarget2;
  11649. var t, i, n = !1, r = this.passes.length;
  11650. for (i = 0; i < r; i++)
  11651. if ((t = this.passes[i]).enabled) {
  11652. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, n),
  11653. t.needsSwap) {
  11654. if (n) {
  11655. var o = this.renderer.context;
  11656. o.stencilFunc(o.NOTEQUAL, 1, 4294967295),
  11657. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11658. o.stencilFunc(o.EQUAL, 1, 4294967295)
  11659. }
  11660. this.swapBuffers()
  11661. }
  11662. t instanceof a.MaskPass ? n = !0 : t instanceof a.ClearMaskPass && (n = !1)
  11663. }
  11664. },
  11665. reset: function(e) {
  11666. if (void 0 === e) {
  11667. var t = this.renderer.getSize();
  11668. (e = this.renderTarget1.clone()).setSize(t.width, t.height)
  11669. }
  11670. this.renderTarget1.dispose(),
  11671. this.renderTarget2.dispose(),
  11672. this.renderTarget1 = e,
  11673. this.renderTarget2 = e.clone(),
  11674. this.writeBuffer = this.renderTarget1,
  11675. this.readBuffer = this.renderTarget2
  11676. },
  11677. setSize: function(e, t) {
  11678. this.renderTarget1.setSize(e, t),
  11679. this.renderTarget2.setSize(e, t)
  11680. }
  11681. }
  11682. }
  11683. , {
  11684. three: 217
  11685. }],
  11686. 97: [function(e, t, i) {
  11687. "use strict";
  11688. var n = e("three");
  11689. n.MaskPass = function(e, t) {
  11690. this.scene = e,
  11691. this.camera = t,
  11692. this.enabled = !0,
  11693. this.clear = !0,
  11694. this.needsSwap = !1,
  11695. this.inverse = !1
  11696. }
  11697. ,
  11698. n.MaskPass.prototype = {
  11699. render: function(e, t, i, n) {
  11700. var r, o, a = e.context;
  11701. a.colorMask(!1, !1, !1, !1),
  11702. a.depthMask(!1),
  11703. o = this.inverse ? (r = 0,
  11704. 1) : (r = 1,
  11705. 0),
  11706. a.enable(a.STENCIL_TEST),
  11707. a.stencilOp(a.REPLACE, a.REPLACE, a.REPLACE),
  11708. a.stencilFunc(a.ALWAYS, r, 4294967295),
  11709. a.clearStencil(o),
  11710. e.render(this.scene, this.camera, i, this.clear),
  11711. e.render(this.scene, this.camera, t, this.clear),
  11712. a.colorMask(!0, !0, !0, !0),
  11713. a.depthMask(!0),
  11714. a.stencilFunc(a.EQUAL, 1, 4294967295),
  11715. a.stencilOp(a.KEEP, a.KEEP, a.KEEP)
  11716. }
  11717. },
  11718. n.ClearMaskPass = function() {
  11719. this.enabled = !0
  11720. }
  11721. ,
  11722. n.ClearMaskPass.prototype = {
  11723. render: function(e, t, i, n) {
  11724. var r = e.context;
  11725. r.disable(r.STENCIL_TEST)
  11726. }
  11727. }
  11728. }
  11729. , {
  11730. three: 217
  11731. }],
  11732. 98: [function(e, t, i) {
  11733. "use strict";
  11734. var o = e("three");
  11735. o.RenderPass = function(e, t, i, n, r) {
  11736. this.scene = e,
  11737. this.camera = t,
  11738. this.overrideMaterial = i,
  11739. this.clearColor = n,
  11740. this.clearAlpha = void 0 !== r ? r : 1,
  11741. this.oldClearColor = new o.Color,
  11742. this.oldClearAlpha = 1,
  11743. this.enabled = !0,
  11744. this.clear = !0,
  11745. this.needsSwap = !1
  11746. }
  11747. ,
  11748. o.RenderPass.prototype = {
  11749. render: function(e, t, i, n) {
  11750. this.scene.overrideMaterial = this.overrideMaterial,
  11751. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11752. this.oldClearAlpha = e.getClearAlpha(),
  11753. e.setClearColor(this.clearColor, this.clearAlpha)),
  11754. e.render(this.scene, this.camera, i, this.clear),
  11755. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11756. this.scene.overrideMaterial = null
  11757. }
  11758. }
  11759. }
  11760. , {
  11761. three: 217
  11762. }],
  11763. 99: [function(e, t, i) {
  11764. "use strict";
  11765. var n = e("three");
  11766. n.ShaderPass = function(e, t) {
  11767. this.textureID = void 0 !== t ? t : "tDiffuse",
  11768. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11769. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11770. this.material = new n.ShaderMaterial({
  11771. defines: e.defines || {},
  11772. uniforms: this.uniforms,
  11773. vertexShader: e.vertexShader,
  11774. fragmentShader: e.fragmentShader
  11775. })),
  11776. this.renderToScreen = !1,
  11777. this.enabled = !0,
  11778. this.needsSwap = !0,
  11779. this.clear = !1,
  11780. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11781. this.scene = new n.Scene,
  11782. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11783. this.scene.add(this.quad)
  11784. }
  11785. ,
  11786. n.ShaderPass.prototype = {
  11787. render: function(e, t, i, n) {
  11788. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11789. this.quad.material = this.material,
  11790. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11791. }
  11792. }
  11793. }
  11794. , {
  11795. three: 217
  11796. }],
  11797. 100: [function(e, t, i) {
  11798. "use strict";
  11799. e("three").CopyShader = {
  11800. uniforms: {
  11801. tDiffuse: {
  11802. type: "t",
  11803. value: null
  11804. },
  11805. opacity: {
  11806. type: "f",
  11807. value: 1
  11808. }
  11809. },
  11810. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11811. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11812. }
  11813. }
  11814. , {
  11815. three: 217
  11816. }],
  11817. 101: [function(e, t, i) {
  11818. "use strict";
  11819. e("three").HorizontalBlurShader = {
  11820. uniforms: {
  11821. tDiffuse: {
  11822. type: "t",
  11823. value: null
  11824. },
  11825. h: {
  11826. type: "f",
  11827. value: 1 / 512
  11828. }
  11829. },
  11830. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11831. 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")
  11832. }
  11833. }
  11834. , {
  11835. three: 217
  11836. }],
  11837. 102: [function(e, t, i) {
  11838. "use strict";
  11839. e("three").VerticalBlurShader = {
  11840. uniforms: {
  11841. tDiffuse: {
  11842. type: "t",
  11843. value: null
  11844. },
  11845. v: {
  11846. type: "f",
  11847. value: 1 / 512
  11848. }
  11849. },
  11850. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11851. 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")
  11852. }
  11853. }
  11854. , {
  11855. three: 217
  11856. }],
  11857. 103: [function(e, t, i) {
  11858. "use strict";
  11859. var z = e("three");
  11860. !function() {
  11861. if ("performance"in window == 0 && (window.performance = {}),
  11862. "now"in window.performance == 0) {
  11863. var e = Date.now();
  11864. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11865. window.performance.now = function() {
  11866. return Date.now() - e
  11867. }
  11868. }
  11869. }(),
  11870. z.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11871. var t, i = this.extensions, n = this.context;
  11872. if (e === z.RepeatWrapping)
  11873. return n.REPEAT;
  11874. if (e === z.ClampToEdgeWrapping)
  11875. return n.CLAMP_TO_EDGE;
  11876. if (e === z.MirroredRepeatWrapping)
  11877. return n.MIRRORED_REPEAT;
  11878. if (e === z.NearestFilter)
  11879. return n.NEAREST;
  11880. if (e === z.NearestMipMapNearestFilter)
  11881. return n.NEAREST_MIPMAP_NEAREST;
  11882. if (e === z.NearestMipMapLinearFilter)
  11883. return n.NEAREST_MIPMAP_LINEAR;
  11884. if (e === z.LinearFilter)
  11885. return n.LINEAR;
  11886. if (e === z.LinearMipMapNearestFilter)
  11887. return n.LINEAR_MIPMAP_NEAREST;
  11888. if (e === z.LinearMipMapLinearFilter)
  11889. return n.LINEAR_MIPMAP_LINEAR;
  11890. if (e === z.UnsignedByteType)
  11891. return n.UNSIGNED_BYTE;
  11892. if (e === z.UnsignedShort4444Type)
  11893. return n.UNSIGNED_SHORT_4_4_4_4;
  11894. if (e === z.UnsignedShort5551Type)
  11895. return n.UNSIGNED_SHORT_5_5_5_1;
  11896. if (e === z.UnsignedShort565Type)
  11897. return n.UNSIGNED_SHORT_5_6_5;
  11898. if (e === z.ByteType)
  11899. return n.BYTE;
  11900. if (e === z.ShortType)
  11901. return n.SHORT;
  11902. if (e === z.UnsignedShortType)
  11903. return n.UNSIGNED_SHORT;
  11904. if (e === z.IntType)
  11905. return n.INT;
  11906. if (e === z.UnsignedIntType)
  11907. return n.UNSIGNED_INT;
  11908. if (e === z.FloatType)
  11909. return n.FLOAT;
  11910. if (null !== (t = i.get("OES_texture_half_float")) && e === z.HalfFloatType)
  11911. return t.HALF_FLOAT_OES;
  11912. if (e === z.AlphaFormat)
  11913. return n.ALPHA;
  11914. if (e === z.RGBFormat)
  11915. return n.RGB;
  11916. if (e === z.RGBAFormat)
  11917. return n.RGBA;
  11918. if (e === z.LuminanceFormat)
  11919. return n.LUMINANCE;
  11920. if (e === z.LuminanceAlphaFormat)
  11921. return n.LUMINANCE_ALPHA;
  11922. if (e === z.AddEquation)
  11923. return n.FUNC_ADD;
  11924. if (e === z.SubtractEquation)
  11925. return n.FUNC_SUBTRACT;
  11926. if (e === z.ReverseSubtractEquation)
  11927. return n.FUNC_REVERSE_SUBTRACT;
  11928. if (e === z.ZeroFactor)
  11929. return n.ZERO;
  11930. if (e === z.OneFactor)
  11931. return n.ONE;
  11932. if (e === z.SrcColorFactor)
  11933. return n.SRC_COLOR;
  11934. if (e === z.OneMinusSrcColorFactor)
  11935. return n.ONE_MINUS_SRC_COLOR;
  11936. if (e === z.SrcAlphaFactor)
  11937. return n.SRC_ALPHA;
  11938. if (e === z.OneMinusSrcAlphaFactor)
  11939. return n.ONE_MINUS_SRC_ALPHA;
  11940. if (e === z.DstAlphaFactor)
  11941. return n.DST_ALPHA;
  11942. if (e === z.OneMinusDstAlphaFactor)
  11943. return n.ONE_MINUS_DST_ALPHA;
  11944. if (e === z.DstColorFactor)
  11945. return n.DST_COLOR;
  11946. if (e === z.OneMinusDstColorFactor)
  11947. return n.ONE_MINUS_DST_COLOR;
  11948. if (e === z.SrcAlphaSaturateFactor)
  11949. return n.SRC_ALPHA_SATURATE;
  11950. if (null !== (t = i.get("WEBGL_compressed_texture_s3tc"))) {
  11951. if (e === z.RGB_S3TC_DXT1_Format)
  11952. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  11953. if (e === z.RGBA_S3TC_DXT1_Format)
  11954. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  11955. if (e === z.RGBA_S3TC_DXT3_Format)
  11956. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  11957. if (e === z.RGBA_S3TC_DXT5_Format)
  11958. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  11959. }
  11960. if (null !== (t = i.get("WEBGL_compressed_texture_pvrtc"))) {
  11961. if (e === z.RGB_PVRTC_4BPPV1_Format)
  11962. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  11963. if (e === z.RGB_PVRTC_2BPPV1_Format)
  11964. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  11965. if (e === z.RGBA_PVRTC_4BPPV1_Format)
  11966. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  11967. if (e === z.RGBA_PVRTC_2BPPV1_Format)
  11968. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  11969. }
  11970. if (null !== (t = i.get("WEBGL_compressed_texture_etc1")) && e === z.RGB_ETC1_Format)
  11971. return t.COMPRESSED_RGB_ETC1_WEBGL;
  11972. if (null !== (t = i.get("EXT_blend_minmax"))) {
  11973. if (e === z.MinEquation)
  11974. return t.MIN_EXT;
  11975. if (e === z.MaxEquation)
  11976. return t.MAX_EXT
  11977. }
  11978. return 0
  11979. }
  11980. ,
  11981. z.WebGLState = function(l, i, c) {
  11982. var n = this
  11983. , r = new z.Vector4
  11984. , e = l.getParameter(l.MAX_VERTEX_ATTRIBS)
  11985. , o = new Uint8Array(e)
  11986. , a = new Uint8Array(e)
  11987. , s = new Uint8Array(e)
  11988. , t = {}
  11989. , h = null
  11990. , u = null
  11991. , d = null
  11992. , p = null
  11993. , f = null
  11994. , g = null
  11995. , m = null
  11996. , v = null
  11997. , y = !1
  11998. , A = null
  11999. , C = null
  12000. , I = null
  12001. , E = null
  12002. , _ = null
  12003. , b = null
  12004. , w = null
  12005. , T = null
  12006. , x = null
  12007. , S = null
  12008. , M = null
  12009. , R = null
  12010. , P = null
  12011. , O = null
  12012. , L = null
  12013. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  12014. , N = void 0
  12015. , F = {}
  12016. , B = new z.Vector4
  12017. , V = null
  12018. , k = null
  12019. , U = new z.Vector4
  12020. , H = new z.Vector4;
  12021. this.init = function() {
  12022. this.clearColor(0, 0, 0, 1),
  12023. this.clearDepth(1),
  12024. this.clearStencil(0),
  12025. this.enable(l.DEPTH_TEST),
  12026. l.depthFunc(l.LEQUAL),
  12027. l.frontFace(l.CCW),
  12028. l.cullFace(l.BACK),
  12029. this.enable(l.CULL_FACE),
  12030. this.enable(l.BLEND),
  12031. l.blendEquation(l.FUNC_ADD),
  12032. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  12033. }
  12034. ,
  12035. this.initAttributes = function() {
  12036. for (var e = 0, t = o.length; e < t; e++)
  12037. o[e] = 0
  12038. }
  12039. ,
  12040. this.enableAttribute = function(e) {
  12041. o[e] = 1,
  12042. 0 === a[e] && (l.enableVertexAttribArray(e),
  12043. a[e] = 1),
  12044. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  12045. s[e] = 0)
  12046. }
  12047. ,
  12048. this.enableAttributeAndDivisor = function(e, t, i) {
  12049. o[e] = 1,
  12050. 0 === a[e] && (l.enableVertexAttribArray(e),
  12051. a[e] = 1),
  12052. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  12053. s[e] = t)
  12054. }
  12055. ,
  12056. this.disableUnusedAttributes = function() {
  12057. for (var e = 0, t = a.length; e < t; e++)
  12058. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  12059. a[e] = 0)
  12060. }
  12061. ,
  12062. this.enable = function(e) {
  12063. !0 !== t[e] && (l.enable(e),
  12064. t[e] = !0)
  12065. }
  12066. ,
  12067. this.disable = function(e) {
  12068. !1 !== t[e] && (l.disable(e),
  12069. t[e] = !1)
  12070. }
  12071. ,
  12072. this.getCompressedTextureFormats = function() {
  12073. if (null === h && (h = [],
  12074. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  12075. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  12076. h.push(e[t]);
  12077. return h
  12078. }
  12079. ,
  12080. this.setBlending = function(e, t, i, n, r, o, a, s) {
  12081. e === z.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  12082. e === u && s === y || (e === z.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12083. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  12084. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === z.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12085. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  12086. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === z.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12087. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  12088. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12089. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12090. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  12091. u = e,
  12092. y = s),
  12093. e === z.CustomBlending ? (r = r || t,
  12094. o = o || i,
  12095. a = a || n,
  12096. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  12097. d = t,
  12098. g = r),
  12099. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  12100. p = i,
  12101. f = n,
  12102. m = o,
  12103. v = a)) : v = m = g = f = p = d = null
  12104. }
  12105. ,
  12106. this.setDepthFunc = function(e) {
  12107. if (A !== e) {
  12108. if (e)
  12109. switch (e) {
  12110. case z.NeverDepth:
  12111. l.depthFunc(l.NEVER);
  12112. break;
  12113. case z.AlwaysDepth:
  12114. l.depthFunc(l.ALWAYS);
  12115. break;
  12116. case z.LessDepth:
  12117. l.depthFunc(l.LESS);
  12118. break;
  12119. case z.LessEqualDepth:
  12120. l.depthFunc(l.LEQUAL);
  12121. break;
  12122. case z.EqualDepth:
  12123. l.depthFunc(l.EQUAL);
  12124. break;
  12125. case z.GreaterEqualDepth:
  12126. l.depthFunc(l.GEQUAL);
  12127. break;
  12128. case z.GreaterDepth:
  12129. l.depthFunc(l.GREATER);
  12130. break;
  12131. case z.NotEqualDepth:
  12132. l.depthFunc(l.NOTEQUAL);
  12133. break;
  12134. default:
  12135. l.depthFunc(l.LEQUAL)
  12136. }
  12137. else
  12138. l.depthFunc(l.LEQUAL);
  12139. A = e
  12140. }
  12141. }
  12142. ,
  12143. this.setDepthTest = function(e) {
  12144. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  12145. }
  12146. ,
  12147. this.setDepthWrite = function(e) {
  12148. C !== e && (l.depthMask(e),
  12149. C = e)
  12150. }
  12151. ,
  12152. this.setColorWrite = function(e) {
  12153. I !== e && (l.colorMask(e, e, e, e),
  12154. I = e)
  12155. }
  12156. ,
  12157. this.setStencilFunc = function(e, t, i) {
  12158. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  12159. _ = e,
  12160. b = t,
  12161. w = i)
  12162. }
  12163. ,
  12164. this.setStencilOp = function(e, t, i) {
  12165. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  12166. T = e,
  12167. x = t,
  12168. S = i)
  12169. }
  12170. ,
  12171. this.setStencilTest = function(e) {
  12172. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  12173. }
  12174. ,
  12175. this.setStencilWrite = function(e) {
  12176. E !== e && (l.stencilMask(e),
  12177. E = e)
  12178. }
  12179. ,
  12180. this.setFlipSided = function(e) {
  12181. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  12182. M = e)
  12183. }
  12184. ,
  12185. this.setLineWidth = function(e) {
  12186. e !== R && (l.lineWidth(e),
  12187. R = e)
  12188. }
  12189. ,
  12190. this.setPolygonOffset = function(e, t, i) {
  12191. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  12192. !e || P === t && O === i || (l.polygonOffset(t, i),
  12193. P = t,
  12194. O = i)
  12195. }
  12196. ,
  12197. this.getScissorTest = function() {
  12198. return L
  12199. }
  12200. ,
  12201. this.setScissorTest = function(e) {
  12202. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  12203. }
  12204. ,
  12205. this.activeTexture = function(e) {
  12206. void 0 === e && (e = l.TEXTURE0 + D - 1),
  12207. N !== e && (l.activeTexture(e),
  12208. N = e)
  12209. }
  12210. ,
  12211. this.bindTexture = function(e, t) {
  12212. void 0 === N && n.activeTexture();
  12213. var i = F[N];
  12214. void 0 === i && (i = {
  12215. type: void 0,
  12216. texture: void 0
  12217. },
  12218. F[N] = i),
  12219. i.type === e && i.texture === t || (l.bindTexture(e, t),
  12220. i.type = e,
  12221. i.texture = t)
  12222. }
  12223. ,
  12224. this.compressedTexImage2D = function() {
  12225. try {
  12226. l.compressedTexImage2D.apply(l, arguments)
  12227. } catch (e) {
  12228. console.error(e)
  12229. }
  12230. }
  12231. ,
  12232. this.texImage2D = function() {
  12233. try {
  12234. l.texImage2D.apply(l, arguments)
  12235. } catch (e) {
  12236. console.error(e)
  12237. }
  12238. }
  12239. ,
  12240. this.clearColor = function(e, t, i, n) {
  12241. r.set(e, t, i, n),
  12242. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  12243. B.copy(r))
  12244. }
  12245. ,
  12246. this.clearDepth = function(e) {
  12247. V !== e && (l.clearDepth(e),
  12248. V = e)
  12249. }
  12250. ,
  12251. this.clearStencil = function(e) {
  12252. k !== e && (l.clearStencil(e),
  12253. k = e)
  12254. }
  12255. ,
  12256. this.scissor = function(e) {
  12257. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  12258. U.copy(e))
  12259. }
  12260. ,
  12261. this.viewport = function(e) {
  12262. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  12263. H.copy(e))
  12264. }
  12265. ,
  12266. this.reset = function() {
  12267. for (var e = 0; e < a.length; e++)
  12268. 1 === a[e] && (l.disableVertexAttribArray(e),
  12269. a[e] = 0);
  12270. t = {},
  12271. N = void 0,
  12272. F = {},
  12273. M = E = C = I = u = h = null
  12274. }
  12275. }
  12276. }
  12277. , {
  12278. three: 217
  12279. }],
  12280. 104: [function(a, h, e) {
  12281. (function(i, e) {
  12282. "use strict";
  12283. function t(e) {
  12284. this.urls = e;
  12285. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12286. this.builder = n.loadProto(t),
  12287. this.decoder = this.builder.build("binary_mesh")
  12288. }
  12289. var s = a("three")
  12290. , n = a("protobufjs")
  12291. , r = a("../util/logger")
  12292. , o = (a("../util/common"),
  12293. a("../util/ajax"))
  12294. , l = a("../objects/Chunk")
  12295. , c = new r(e);
  12296. t.prototype = {
  12297. constructor: t,
  12298. load: function(t, i, n, r) {
  12299. return c.time("download"),
  12300. o.get(t, {
  12301. responseType: "arraybuffer"
  12302. }).done(function(e) {
  12303. c.timeEnd("download"),
  12304. this.parse(e, t, i, n, r)
  12305. }
  12306. .bind(this)).fail(r)
  12307. },
  12308. parse: function(e, t, i, n, r) {
  12309. var o = this.readProtobuf(e);
  12310. if (!o)
  12311. return r();
  12312. try {
  12313. c.time("convert to webgl"),
  12314. this.convertProtobufToSceneObject(o, t, i, n, r),
  12315. c.timeEnd("convert to webgl")
  12316. } catch (e) {
  12317. return c.error("failed parsing .dam"),
  12318. c.error(e.message),
  12319. r()
  12320. }
  12321. },
  12322. readProtobuf: function(e) {
  12323. var t;
  12324. try {
  12325. c.time("parse proto"),
  12326. t = this.decoder.decode(e),
  12327. c.timeEnd("parse proto")
  12328. } catch (e) {
  12329. return c.error("failed parsing proto for .dam"),
  12330. c.error(e.message),
  12331. null
  12332. }
  12333. return t
  12334. },
  12335. convertProtobufToSceneObject: function(e, i, t, n, r) {
  12336. if (0 === e.chunk.length)
  12337. return c.warn("No chunks in damfile..."),
  12338. t([]);
  12339. var o = new s.Matrix4;
  12340. o.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12341. var a = e.chunk.map(function(e) {
  12342. var t = new s.BufferGeometry;
  12343. return t.addAttribute("position", new s.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12344. 0 < e.vertices.uv.length && t.addAttribute("uv", new s.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12345. t.setIndex(new s.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12346. t.applyMatrix(o),
  12347. t.computeBoundingBox(),
  12348. new l({
  12349. geometry: t,
  12350. textureName: e.material_name,
  12351. name: e.chunk_name,
  12352. meshUrl: i
  12353. })
  12354. });
  12355. return a ? t(a) : (c.error(".dam protobuf came out with no chunks..."),
  12356. r())
  12357. }
  12358. },
  12359. h.exports = t
  12360. }
  12361. ).call(this, a("buffer").Buffer, "/js/loaders/DamLoader.js")
  12362. }
  12363. , {
  12364. "../objects/Chunk": 144,
  12365. "../util/ajax": 181,
  12366. "../util/common": 185,
  12367. "../util/logger": 189,
  12368. buffer: 198,
  12369. protobufjs: 214,
  12370. three: 217
  12371. }],
  12372. 105: [function(n, r, e) {
  12373. (function(e) {
  12374. "use strict";
  12375. var t = (n("three"),
  12376. n("../settings"),
  12377. n("../util/browser"),
  12378. n("./DamLoader"))
  12379. , i = n("../util/logger")
  12380. , u = (n("../ab"),
  12381. new i(e));
  12382. r.exports = {
  12383. getLoaders: function() {
  12384. return [["_50k", ".dam", t], ["", ".dam", t]]
  12385. },
  12386. load: function(e, t, i, n, r, o) {
  12387. var a = this.getLoaders()[o = o || 0];
  12388. if (a) {
  12389. var s = a[0]
  12390. , l = a[1]
  12391. , c = new a[2](t)
  12392. , h = t.get(e + s + l);
  12393. h ? (u.debug("Trying " + s + l),
  12394. c.load(h, i, n, function() {
  12395. this.load(e, t, i, n, r, ++o)
  12396. }
  12397. .bind(this))) : (u.debug("Skipping " + l + ", not available"),
  12398. this.load(e, t, i, n, r, ++o))
  12399. } else
  12400. r && r("No suitable model file found...")
  12401. }
  12402. }
  12403. }
  12404. ).call(this, "/js/loaders/ModelLoader.js")
  12405. }
  12406. , {
  12407. "../ab": 3,
  12408. "../settings": 166,
  12409. "../util/browser": 182,
  12410. "../util/logger": 189,
  12411. "./DamLoader": 104,
  12412. three: 217
  12413. }],
  12414. 106: [function(i, n, e) {
  12415. (function(e) {
  12416. "use strict";
  12417. var l = i("../util/common")
  12418. , c = i("../util/texture")
  12419. , h = i("../util/browser")
  12420. , t = i("../util/logger")
  12421. , u = i("../settings")
  12422. , d = new t(e);
  12423. n.exports = {
  12424. load: function(i, n) {
  12425. if (!i.chunks[0] || !i.chunks[0].meshUrl)
  12426. return $.when();
  12427. var r = l.countUnique(i.chunks.map(function(e) {
  12428. return e.textureName
  12429. }))
  12430. , e = -1 !== i.chunks[0].meshUrl.indexOf("_50k") ? "_50k" : ""
  12431. , t = "_50k" == e ? "high" : "low";
  12432. u.minimalMemoryMode && "high" === t && (h.detectSamsungS6() ? (d.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12433. t = "low") : r > u.maxMobileTextures && (d.warn("Model probably too large for mobile, turning down quality."),
  12434. t = "low"));
  12435. var o = i.data.job.uuid + e + "_texture_jpg_" + t + "/"
  12436. , a = $.Deferred()
  12437. , s = 0;
  12438. return i.chunks.forEach(function(e) {
  12439. if (!e.material.map && e.textureName) {
  12440. var t = i.urls.get(o + e.textureName);
  12441. e.setTextureMap(c.load(t, function(e, t) {
  12442. e || (n.push(t),
  12443. s++,
  12444. a.notify(s, r),
  12445. s === r && a.resolve())
  12446. }
  12447. .bind(this, c.isLoaded(t))))
  12448. }
  12449. }),
  12450. a.promise()
  12451. }
  12452. }
  12453. }
  12454. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12455. }
  12456. , {
  12457. "../settings": 166,
  12458. "../util/browser": 182,
  12459. "../util/common": 185,
  12460. "../util/logger": 189,
  12461. "../util/texture": 194
  12462. }],
  12463. 107: [function(s, l, e) {
  12464. (function(n, e) {
  12465. "use strict";
  12466. function t(e) {
  12467. this.model = e,
  12468. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12469. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12470. var t = n("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12471. , i = r.loadProto(t);
  12472. this.decoder = i.build("VisionModeldata")
  12473. }
  12474. var r = s("protobufjs")
  12475. , i = s("../util/ajax")
  12476. , o = (s("../util/common"),
  12477. s("../util/math"))
  12478. , a = new (s("../util/logger"))(e);
  12479. t.prototype.load = function() {
  12480. return this.modelDataPath ? (a.info("Using vision.modeldata"),
  12481. this.loadVisionModelData()) : this.sweepLocationsPath ? (a.warn("Using sweep_locations.csv"),
  12482. this.loadSweepLocationsCSV()) : (a.warn("No sweep file found"),
  12483. $.when([]))
  12484. }
  12485. ,
  12486. t.prototype.loadVisionModelData = function() {
  12487. return i.get(this.modelDataPath, {
  12488. responseType: "arraybuffer"
  12489. }).then(function(e) {
  12490. var t;
  12491. try {
  12492. t = this.decoder.decode(e)
  12493. } catch (e) {
  12494. return a.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12495. this.loadSweepLocationsCSV()
  12496. }
  12497. var i = t.sweepLocations.map(function(e) {
  12498. return {
  12499. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12500. position: {
  12501. x: e.pose.translation.x,
  12502. y: e.pose.translation.y,
  12503. z: e.pose.translation.z
  12504. },
  12505. quaternion: {
  12506. x: e.pose.rotation.x,
  12507. y: e.pose.rotation.y,
  12508. z: e.pose.rotation.z,
  12509. w: e.pose.rotation.w
  12510. },
  12511. puck: {
  12512. x: e.puck.x,
  12513. y: e.puck.y,
  12514. z: e.puck.z
  12515. },
  12516. floor: e.group,
  12517. neighbours: e.visibles,
  12518. alignmentType: e.alignment_type
  12519. }
  12520. }).map(function(e) {
  12521. return e.position = o.convertVisionVector(e.position),
  12522. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12523. e.puck = o.convertVisionVector(e.puck),
  12524. e
  12525. });
  12526. return i.forEach(function(e) {
  12527. if(e.neighbours.find(a=>a==-1)){
  12528. console.log('%c neighbours 存在-1 ' +e.uuid ,"color:#f00")
  12529. }
  12530. e.neighbours = e.neighbours.filter(e=>i[e])
  12531. e.neighbours = e.neighbours.map(function(e) {
  12532. return i[e].uuid
  12533. })
  12534. }),
  12535. i
  12536. }
  12537. .bind(this), function() {
  12538. return a.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12539. this.loadSweepLocationsCSV()
  12540. }
  12541. .bind(this))
  12542. }
  12543. ,
  12544. t.prototype.loadSweepLocationsCSV = function() {
  12545. return i.get(this.sweepLocationsPath).then(function(e) {
  12546. return e.split("\n").map(function(e) {
  12547. return e.split(", ")
  12548. }).filter(function(e) {
  12549. return 1 < e.length
  12550. }).map(function(e) {
  12551. return {
  12552. uuid: e[0],
  12553. position: {
  12554. x: parseFloat(e[1]),
  12555. y: parseFloat(e[2]),
  12556. z: parseFloat(e[3])
  12557. },
  12558. quaternion: {
  12559. x: parseFloat(e[4]),
  12560. y: parseFloat(e[5]),
  12561. z: parseFloat(e[6]),
  12562. w: parseFloat(e[7])
  12563. }
  12564. }
  12565. }).map(function(e) {
  12566. return e.position = o.convertVisionVector(e.position),
  12567. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12568. e
  12569. })
  12570. }).fail(function() {
  12571. a.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12572. })
  12573. }
  12574. ,
  12575. l.exports = t
  12576. }
  12577. ).call(this, s("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12578. }
  12579. , {
  12580. "../util/ajax": 181,
  12581. "../util/common": 185,
  12582. "../util/logger": 189,
  12583. "../util/math": 190,
  12584. buffer: 198,
  12585. protobufjs: 214
  12586. }],
  12587. 108: [function(s, l, e) {
  12588. (function(e) {
  12589. "use strict";
  12590. function t() {
  12591. this.locale = null
  12592. }
  12593. var i = s("../settings")
  12594. , n = s("../util/common")
  12595. , r = s("../util/logger")
  12596. , o = s("../enum/Locale")
  12597. , a = new r(e);
  12598. t.prototype.init = function() {
  12599. var e;
  12600. switch (i.languageTag) {
  12601. case null:
  12602. case "en":
  12603. case o.EN_US:
  12604. this.locale = o.EN_US,
  12605. e = s("./strings-en-US");
  12606. break;
  12607. case "es":
  12608. case o.ES_MX:
  12609. this.locale = o.ES_MX,
  12610. e = s("./strings-es-MX");
  12611. break;
  12612. case "fr":
  12613. case o.FR_FR:
  12614. this.locale = o.FR_FR,
  12615. e = s("./strings-fr-FR");
  12616. break;
  12617. case "de":
  12618. case o.DE_DE:
  12619. this.locale = o.DE_DE,
  12620. e = s("./strings-de-DE");
  12621. break;
  12622. case "ru":
  12623. case o.RU_RU:
  12624. this.locale = o.RU_RU,
  12625. e = s("./strings-ru-RU");
  12626. break;
  12627. case "cn":
  12628. case o.CN_CN:
  12629. this.locale = o.CN_CN,
  12630. e = s("./strings-cn-CN");
  12631. break;
  12632. case "jp":
  12633. case o.JP_JP:
  12634. this.locale = o.JP_JP,
  12635. e = s("./strings-jp-JP");
  12636. break;
  12637. default:
  12638. a.info("Unsupported language tag, defaulting to 'en-US'"),
  12639. this.locale = o.EN_US,
  12640. e = s("./strings-en-US")
  12641. }
  12642. a.info("Using locale '" + this.locale + "'"),
  12643. n.extendObject(this, e)
  12644. }
  12645. ,
  12646. t.prototype.localizeGUI = function() {
  12647. var e = document.querySelector("#gui-parent");
  12648. this.localizeTree(e),
  12649. this.localizeLoadingText()
  12650. }
  12651. ,
  12652. t.prototype.localizeLoadingText = function() {
  12653. document.querySelector("#help-dialog").classList.add(this.locale),
  12654. document.querySelector("#interaction-modal").classList.add(this.locale),
  12655. document.querySelector("#gui").classList.add(this.locale)
  12656. }
  12657. ,
  12658. t.prototype.localizeTree = function(e) {
  12659. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12660. if (e.nodeType === Node.TEXT_NODE)
  12661. (t = e.data.match(n)) && (i = t[1],
  12662. e.data = this.localizeText(i) || i);
  12663. else if (e.nodeType === Node.ELEMENT_NODE) {
  12664. var r = e.getAttribute("title");
  12665. r && ((t = r.match(n)) && (i = t[1],
  12666. e.setAttribute("title", this.localizeText(i) || i)))
  12667. }
  12668. for (e = e.firstChild; e; )
  12669. this.localizeTree(e),
  12670. e = e.nextSibling
  12671. }
  12672. ,
  12673. t.prototype.localizeText = function(e) {
  12674. var t = this[e];
  12675. return t || this.locale === o.EN_US || (a.warn("Localization key '" + e + "' not available for locale '" + this.locale + "', defaulting to English."),
  12676. t = s("./strings-en-US")[e]),
  12677. t || a.warn("Localization key '" + e + "' not available for locale 'en-US'"),
  12678. t
  12679. }
  12680. ,
  12681. l.exports = new t
  12682. }
  12683. ).call(this, "/js/localization/localize.js")
  12684. }
  12685. , {
  12686. "../enum/Locale": 31,
  12687. "../settings": 166,
  12688. "../util/common": 185,
  12689. "../util/logger": 189,
  12690. "./strings-cn-CN": 109,
  12691. "./strings-de-DE": 110,
  12692. "./strings-en-US": 111,
  12693. "./strings-es-MX": 112,
  12694. "./strings-fr-FR": 113,
  12695. "./strings-jp-JP": 114,
  12696. "./strings-ru-RU": 115
  12697. }],
  12698. 109: [function(e, t, i) {
  12699. "use strict";
  12700. t.exports = {
  12701. PAGE_TITLE: "",
  12702. LOADING: "正在加载",
  12703. PRESENTED_BY_CAPS: "呈现者:",
  12704. POWERED_BY: "技术支持:",
  12705. POWERED_BY_CAPS: "技术支持:",
  12706. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12707. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12708. PRESENTED_BY: "呈现者:",
  12709. MORE: "更多 ",
  12710. LESS: "更少 ",
  12711. TAG_CONTENT: "tag™ 内容",
  12712. SHOW: "显示",
  12713. HIDE: "隐藏",
  12714. DOLLHOUSE: "场景屋",
  12715. FLOOR_PLAN: "楼层平面图",
  12716. OPEN_HIGHLIGHTS: "打开精彩片段",
  12717. CLOSE_HIGHLIGHTS: "关闭",
  12718. PREVIOUS: "上一个",
  12719. PLAY: "播放",
  12720. PAUSE: "暂停",
  12721. NEXT: "下一个",
  12722. EXPLORE_3D_SPACE: "探索 3D 空间",
  12723. VIEW_DOLLHOUSE: "观看场景屋",
  12724. SOCIAL_SHARING: "分享这个空间",
  12725. VIEW_IN_VR: "以 VR 观看",
  12726. VIEW_FULLSCREEN: "全屏观看",
  12727. EXIT_FULLSCREEN: " 退出全屏",
  12728. ZOOM_IN: "放大",
  12729. ZOOM_OUT: "缩小",
  12730. FLOOR_NAME: "楼层",
  12731. FLOOR_ALL: "ALL",
  12732. FLOOR_Lang: ["Floor", ""],
  12733. TERMS: "条款",
  12734. PORT_TERMS: "port 条款",
  12735. TERMS_OF_USE: "使用条款",
  12736. CLOSE_TERMS: "关闭",
  12737. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12738. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12739. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12740. WEBVR_ENTER_WEBVR: "进入 VR",
  12741. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12742. WEBVR_LEARN_MORE: "了解更多",
  12743. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12744. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12745. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12746. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12747. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12748. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12749. VR_LEARN_MORE_CAPS: "了解更多",
  12750. VR_PREVIOUS_CAPS: "上一个’,",
  12751. VR_NEXT_CAPS: "下一个",
  12752. VR_GOT_IT_CAPS: "明白了",
  12753. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12754. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12755. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12756. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12757. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12758. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12759. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12760. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12761. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12762. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12763. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12764. VR_APP: "port VR 应用程序",
  12765. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12766. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12767. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12768. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12769. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12770. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12771. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12772. VR_ANDROID_DVICES: "Android 设备",
  12773. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12774. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12775. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12776. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12777. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12778. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12779. VR_DOWNLOAD_HERE: "在此下载",
  12780. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12781. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12782. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12783. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12784. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12785. SHARE_TO: "分享到",
  12786. SHARE_LINK: "直接链接",
  12787. SHARE_EXPLORE: "探索",
  12788. SHARE_AT: "在",
  12789. SHARE_WITH: "使用",
  12790. SHARE_3D: "以 3D",
  12791. SHARE_COPIED: "已复制!",
  12792. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12793. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12794. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12795. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12796. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12797. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12798. ERROR_GENERIC_ACTIONS_3: " 或",
  12799. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12800. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12801. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12802. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12803. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12804. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12805. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12806. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12807. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12808. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12809. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12810. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12811. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12812. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12813. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12814. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12815. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12816. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12817. LINK_TO_LOCATION: "地点链接",
  12818. MENU_COPY: "复制",
  12819. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12820. ROTATE: "旋转",
  12821. MOVE: "移动",
  12822. INSIDE: "内部",
  12823. ZOOM: "缩放",
  12824. HELP: "小帮手",
  12825. HELP_NAVIGATION_TAB: "导航",
  12826. HELP_MORE_HELP_TAB: "更多帮助",
  12827. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12828. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12829. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12830. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12831. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12832. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12833. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12834. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12835. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12836. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12837. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12838. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12839. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12840. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12841. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12842. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12843. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12844. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12845. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12846. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12847. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12848. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12849. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12850. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12851. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12852. HELP_MORE_HLR_A: "精彩片段集锦",
  12853. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12854. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12855. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12856. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12857. HELP_MORE_FLOORS_A: "楼层选择器",
  12858. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12859. HELP_MORE_TAG_A: "tag™ 贴文",
  12860. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12861. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12862. HELP_MORE_ZOOM_A: "缩放控件",
  12863. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12864. HELP_MORE_TOUR_A: "导览控件",
  12865. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12866. HELP_MORE_INSIDE_A: "内部视图",
  12867. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12868. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12869. HELP_MORE_VR_A: "VR 模式",
  12870. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12871. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12872. HELP_MORE_360_A: "360° 视图",
  12873. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12874. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12875. HELP_MORE_FULLSCREEN_A: "全屏",
  12876. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12877. CLOSE: "关闭"
  12878. }
  12879. }
  12880. , {}],
  12881. 110: [function(e, t, i) {
  12882. "use strict";
  12883. t.exports = {
  12884. PAGE_TITLE: "",
  12885. LOADING: "Lädt",
  12886. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  12887. POWERED_BY: "Angetrieben von",
  12888. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  12889. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12890. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12891. PRESENTED_BY: "Präsentiert von ",
  12892. MORE: "Mehr ",
  12893. LESS: "Weniger ",
  12894. TAG_CONTENT: "tag™ Inhalt",
  12895. SHOW: "Anzeigen",
  12896. HIDE: "Verbergen",
  12897. DOLLHOUSE: "Puppenhaus",
  12898. FLOOR_PLAN: "Grundriss",
  12899. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  12900. CLOSE_HIGHLIGHTS: "Schließen",
  12901. PREVIOUS: "Vorheriges",
  12902. PLAY: "Abspielen",
  12903. PAUSE: "Pausieren",
  12904. NEXT: "Nächstes",
  12905. EXPLORE_3D_SPACE: "Innenraum betreten",
  12906. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  12907. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  12908. VIEW_IN_VR: "In VR ansehen",
  12909. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  12910. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  12911. ZOOM_IN: "Vergrößern",
  12912. ZOOM_OUT: "Verkleinern",
  12913. FLOOR_NAME: "Etage ",
  12914. FLOOR_ALL: "Alle",
  12915. TERMS: "Bedingungen",
  12916. PORT_TERMS: "port Bedingungen",
  12917. TERMS_OF_USE: "Nutzungsbedingungen",
  12918. TERMS_TEXT_FILE: "terms-de-DE.html",
  12919. CLOSE_TERMS: "Schließen",
  12920. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  12921. HELP: "Hilfe",
  12922. HELP_NAVIGATION_TAB: "Navigation",
  12923. HELP_MORE_HELP_TAB: "Hilfe-Details",
  12924. CLOSE: "Schließen",
  12925. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  12926. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  12927. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12928. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  12929. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  12930. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  12931. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  12932. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  12933. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  12934. 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.",
  12935. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12936. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  12937. 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.",
  12938. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  12939. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12940. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  12941. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  12942. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  12943. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  12944. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  12945. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  12946. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  12947. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  12948. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  12949. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  12950. HELP_MORE_HLR_A: "Liste das Highlight",
  12951. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  12952. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  12953. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12954. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12955. HELP_MORE_FLOORS_A: "Etage auswählen",
  12956. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  12957. HELP_MORE_TAG_A: "tag™ Posts",
  12958. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  12959. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  12960. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  12961. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  12962. HELP_MORE_TOUR_A: "Tour Steuerung",
  12963. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  12964. HELP_MORE_INSIDE_A: "Innenansicht",
  12965. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  12966. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  12967. HELP_MORE_VR_A: "VR Modus",
  12968. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  12969. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  12970. HELP_MORE_360_A: "360° Views Ansicht ",
  12971. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12972. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12973. HELP_MORE_FULLSCREEN_A: "Vollbild",
  12974. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  12975. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  12976. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  12977. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  12978. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  12979. WEBVR_LEARN_MORE: "Mehr Infos",
  12980. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12981. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12982. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12983. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  12984. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  12985. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12986. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12987. VR_APP: "port VR App",
  12988. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  12989. 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",
  12990. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  12991. VR_APP_FOR_ANDROID: "port VR app für Android",
  12992. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  12993. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12994. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  12995. VR_PREVIOUS_CAPS: "ZURÜCK",
  12996. VR_NEXT_CAPS: "WEITER",
  12997. VR_GOT_IT_CAPS: "VERSTANDEN",
  12998. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  12999. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  13000. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  13001. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  13002. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  13003. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  13004. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13005. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13006. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13007. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  13008. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  13009. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  13010. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13011. VR_ANDROID_DVICES: "Android Geräte",
  13012. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  13013. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  13014. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  13015. VR_DOWNLOAD_HERE: "Hier runterladen",
  13016. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  13017. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  13018. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  13019. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  13020. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13021. SHARE_TO: "Teilen auf",
  13022. SHARE_LINK: "Direkter Link",
  13023. SHARE_EXPLORE: "Umsehen",
  13024. SHARE_AT: "auf",
  13025. SHARE_WITH: "mit",
  13026. SHARE_3D: "in 3D",
  13027. SHARE_COPIED: "Kopiert!",
  13028. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13029. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13030. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13031. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13032. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13033. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13034. ERROR_GENERIC_ACTIONS_3: " oder ",
  13035. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13036. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13037. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13038. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13039. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13040. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13041. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13042. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13043. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13044. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13045. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13046. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13047. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13048. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13049. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13050. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13051. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13052. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13053. LINK_TO_LOCATION: "Link zu",
  13054. MENU_COPY: "Kopieren",
  13055. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13056. ROTATE: "Drehen",
  13057. INSIDE: "Drinnen",
  13058. MOVE: "Bewegen",
  13059. ZOOM: "Vergrößern"
  13060. }
  13061. }
  13062. , {}],
  13063. 111: [function(e, t, i) {
  13064. "use strict";
  13065. t.exports = {
  13066. PAGE_TITLE: "",
  13067. LOADING: "Loading",
  13068. PRESENTED_BY_CAPS: "PRESENTED BY",
  13069. POWERED_BY: "powered by ",
  13070. POWERED_BY_CAPS: "POWERED BY",
  13071. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13072. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13073. PRESENTED_BY: "Presented by ",
  13074. MORE: "More ",
  13075. LESS: "Less ",
  13076. TAG_CONTENT: "tag™ Content",
  13077. SHOW: "Show",
  13078. HIDE: "Hide",
  13079. DOLLHOUSE: "Dollhouse",
  13080. FLOOR_PLAN: "Floor plan",
  13081. OPEN_HIGHLIGHTS: "Open Highlights",
  13082. CLOSE_HIGHLIGHTS: "Close",
  13083. PREVIOUS: "Previous",
  13084. PLAY: "Play",
  13085. PAUSE: "Pause",
  13086. NEXT: "Next",
  13087. EXPLORE_3D_SPACE: "Explore 3D Space",
  13088. VIEW_DOLLHOUSE: "View dollhouse",
  13089. SOCIAL_SHARING: "Share this Space",
  13090. VIEW_IN_VR: "View in VR",
  13091. VIEW_FULLSCREEN: "全屏",
  13092. EXIT_FULLSCREEN: "退出全屏",
  13093. ZOOM_IN: "Zoom in",
  13094. ZOOM_OUT: "Zoom out",
  13095. FLOOR_NAME: "Floor ",
  13096. FLOOR_ALL: "全部",
  13097. TERMS: "Terms",
  13098. PORT_TERMS: "port terms",
  13099. TERMS_OF_USE: "Terms of Use",
  13100. TERMS_TEXT_FILE: "terms-en-US.html",
  13101. CLOSE_TERMS: "Close",
  13102. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13103. HELP: "Help",
  13104. HELP_NAVIGATION_TAB: "Navigation",
  13105. HELP_MORE_HELP_TAB: "More Help",
  13106. CLOSE: "Close",
  13107. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13108. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13109. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13110. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13111. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13112. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13113. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13114. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13115. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13116. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13117. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13118. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13119. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13120. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13121. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13122. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13123. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13124. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13125. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13126. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13127. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13128. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13129. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13130. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13131. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13132. HELP_MORE_HLR_A: "Highlight Reel",
  13133. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13134. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13135. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13136. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13137. HELP_MORE_FLOORS_A: "Floor Selector",
  13138. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13139. HELP_MORE_TAG_A: "tag™ Posts",
  13140. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13141. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13142. HELP_MORE_ZOOM_A: "Zoom Controls",
  13143. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13144. HELP_MORE_TOUR_A: "Tour Controls",
  13145. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13146. HELP_MORE_INSIDE_A: "Inside View",
  13147. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13148. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13149. HELP_MORE_VR_A: "VR Mode",
  13150. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13151. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13152. HELP_MORE_360_A: "360° Views",
  13153. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13154. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13155. HELP_MORE_FULLSCREEN_A: "Full screen",
  13156. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13157. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13158. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13159. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13160. WEBVR_ENTER_WEBVR: "ENTER VR",
  13161. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13162. WEBVR_LEARN_MORE: "Learn more",
  13163. WEBVR_VIEW_SPACE: "View Space in VR",
  13164. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13165. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13166. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13167. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13168. VR_PREVIOUS_CAPS: "PREVIOUS",
  13169. VR_NEXT_CAPS: "NEXT",
  13170. VR_GOT_IT_CAPS: "GOT IT",
  13171. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13172. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13173. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13174. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13175. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13176. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13177. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13178. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13179. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13180. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13181. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13182. VR_APP: "port VR App",
  13183. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13184. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13185. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13186. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13187. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13188. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13189. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13190. VR_ANDROID_DVICES: "Android Devices",
  13191. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13192. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13193. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13194. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13195. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13196. VR_APP_OPEN: "Open with the port VR app instead",
  13197. VR_DOWNLOAD_HERE: "Download here",
  13198. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13199. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13200. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13201. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13202. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13203. SHARE_TO: "Share to",
  13204. SHARE_LINK: "Direct Link",
  13205. SHARE_EXPLORE: "Explore ",
  13206. SHARE_AT: "at",
  13207. SHARE_WITH: "with",
  13208. SHARE_3D: " in 3D",
  13209. SHARE_COPIED: "Copied!",
  13210. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13211. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13212. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13213. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13214. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13215. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13216. ERROR_GENERIC_ACTIONS_3: " or ",
  13217. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13218. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13219. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13220. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13221. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13222. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13223. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13224. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13225. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13226. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13227. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13228. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13229. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13230. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13231. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13232. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13233. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13234. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13235. LINK_TO_LOCATION: "Link to location",
  13236. MENU_COPY: "Copy",
  13237. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13238. ROTATE: "Rotate",
  13239. INSIDE: "Inside",
  13240. MOVE: "Move",
  13241. ZOOM: "Zoom"
  13242. }
  13243. }
  13244. , {}],
  13245. 112: [function(e, t, i) {
  13246. "use strict";
  13247. t.exports = {
  13248. PAGE_TITLE: "",
  13249. LOADING: "Cargando",
  13250. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13251. POWERED_BY: "potenciando por ",
  13252. POWERED_BY_CAPS: "POTENCIADO POR ",
  13253. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13254. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13255. PRESENTED_BY: "Presentado por ",
  13256. MORE: "Más ",
  13257. LESS: "Menos ",
  13258. TAG_CONTENT: "Contenido de tag™",
  13259. SHOW: "Mostrar",
  13260. HIDE: "Ocultar",
  13261. DOLLHOUSE: "Dollhouse",
  13262. FLOOR_PLAN: "Planos",
  13263. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13264. CLOSE_HIGHLIGHTS: "Cerrar",
  13265. PREVIOUS: "Anterior",
  13266. PLAY: "Play",
  13267. PAUSE: "Pausa",
  13268. NEXT: "Siguiente",
  13269. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13270. VIEW_DOLLHOUSE: "Ver dollhouse",
  13271. SOCIAL_SHARING: "Compartir este espacio",
  13272. VIEW_IN_VR: "Ver en realidad virtual",
  13273. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13274. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13275. ZOOM_IN: "Acercar",
  13276. ZOOM_OUT: "Alejar",
  13277. FLOOR_NAME: "Piso ",
  13278. FLOOR_ALL: "Todas",
  13279. TERMS: "Condiciones",
  13280. PORT_TERMS: "port términos de uso",
  13281. TERMS_OF_USE: "Términos de uso",
  13282. TERMS_TEXT_FILE: "terms-es-MX.html",
  13283. CLOSE_TERMS: "Cerrar",
  13284. 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.",
  13285. HELP: "Ayuda",
  13286. HELP_NAVIGATION_TAB: "Navegación",
  13287. HELP_MORE_HELP_TAB: "Más Ayuda",
  13288. CLOSE: "Cerrar",
  13289. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13290. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13291. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13292. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13293. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13294. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13295. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13296. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13297. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13298. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13299. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13300. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13301. 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.",
  13302. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13303. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13304. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13305. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13306. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13307. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13308. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13309. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13310. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13311. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13312. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13313. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13314. HELP_MORE_HLR_A: "Galería destacada",
  13315. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13316. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13317. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13318. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13319. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13320. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13321. HELP_MORE_TAG_A: "tag™ Posts",
  13322. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13323. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13324. HELP_MORE_ZOOM_A: "Controles de zoom",
  13325. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13326. HELP_MORE_TOUR_A: "Controles de recorrido",
  13327. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13328. HELP_MORE_INSIDE_A: "Vista interior",
  13329. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13330. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13331. HELP_MORE_VR_A: "Modo de realidad virtual",
  13332. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13333. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13334. HELP_MORE_360_A: "360° Views",
  13335. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13336. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13337. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13338. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13339. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13340. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13341. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13342. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13343. WEBVR_LEARN_MORE: "Más información",
  13344. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13345. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13346. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13347. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13348. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13349. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13350. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13351. VR_APP: "port VR App",
  13352. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13353. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13354. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13355. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13356. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13357. VR_PREVIOUS_CAPS: "ANTERIOR",
  13358. VR_NEXT_CAPS: "SIGUIENTE",
  13359. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13360. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13361. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13362. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13363. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13364. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13365. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13366. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13367. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13368. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13369. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13370. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13371. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13372. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13373. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13374. VR_ANDROID_DVICES: "Dispositivos Android",
  13375. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13376. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13377. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13378. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13379. VR_DOWNLOAD_HERE: "Descargar aquí",
  13380. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13381. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13382. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13383. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13384. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13385. SHARE_TO: "Compartir en",
  13386. SHARE_LINK: "Enlace directo",
  13387. SHARE_EXPLORE: "Explorar ",
  13388. SHARE_AT: "en",
  13389. SHARE_WITH: "con",
  13390. SHARE_3D: " en 3D",
  13391. SHARE_COPIED: "¡Copiado!",
  13392. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13393. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13394. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13395. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13396. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13397. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13398. ERROR_GENERIC_ACTIONS_3: " o ",
  13399. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13400. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13401. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13402. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13403. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13404. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13405. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13406. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13407. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13408. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13409. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13410. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13411. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13412. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13413. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13414. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13415. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13416. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13417. LINK_TO_LOCATION: "Enlace a la ubicación",
  13418. MENU_COPY: "Copiar",
  13419. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13420. ROTATE: "Girar",
  13421. INSIDE: "Interior",
  13422. MOVE: "Moverse",
  13423. ZOOM: "Acercar o alejar"
  13424. }
  13425. }
  13426. , {}],
  13427. 113: [function(e, t, i) {
  13428. "use strict";
  13429. t.exports = {
  13430. PAGE_TITLE: "",
  13431. LOADING: "Chargement",
  13432. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13433. POWERED_BY: "alimenté par ",
  13434. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13435. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13436. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13437. PRESENTED_BY: "Présenté par ",
  13438. MORE: "Plus ",
  13439. LESS: "Moins ",
  13440. TAG_CONTENT: "Contenu tag™",
  13441. SHOW: "Montrer",
  13442. HIDE: "Cacher",
  13443. DOLLHOUSE: "Dollhouse",
  13444. FLOOR_PLAN: "Plan de sol",
  13445. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13446. CLOSE_HIGHLIGHTS: "Fermer",
  13447. PREVIOUS: "Précédent",
  13448. PLAY: "Lecture",
  13449. PAUSE: "Pause",
  13450. NEXT: "Suivant",
  13451. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13452. VIEW_DOLLHOUSE: "Voir dollhouse",
  13453. SOCIAL_SHARING: "Partager cet espace",
  13454. VIEW_IN_VR: "Voir en VR",
  13455. VIEW_FULLSCREEN: "Plein écran",
  13456. EXIT_FULLSCREEN: "Fermer plein écran",
  13457. ZOOM_IN: "Zoom avant",
  13458. ZOOM_OUT: "Zoom arrière",
  13459. FLOOR_NAME: "Étage ",
  13460. FLOOR_ALL: "Tous",
  13461. TERMS: "Mentions légales",
  13462. PORT_TERMS: "port mentions légales",
  13463. TERMS_OF_USE: "Conditions d'utilisation",
  13464. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13465. CLOSE_TERMS: "Fermer",
  13466. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13467. HELP: "Aide",
  13468. HELP_NAVIGATION_TAB: "Navigation",
  13469. HELP_MORE_HELP_TAB: "Aide",
  13470. CLOSE: "Fermer",
  13471. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13472. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13473. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13474. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13475. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13476. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13477. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13478. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13479. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13480. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13481. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13482. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13483. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13484. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13485. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13486. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13487. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13488. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13489. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13490. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13491. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13492. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13493. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13494. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13495. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13496. HELP_MORE_HLR_A: "Carrousel",
  13497. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13498. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13499. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13500. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13501. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13502. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13503. HELP_MORE_TAG_A: "tag™ Posts",
  13504. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13505. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13506. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13507. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13508. HELP_MORE_TOUR_A: "Commandes de la visite",
  13509. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13510. HELP_MORE_INSIDE_A: "Vue intérieure",
  13511. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13512. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13513. HELP_MORE_VR_A: "Mode RV",
  13514. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13515. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13516. HELP_MORE_360_A: "Vues 360°",
  13517. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13518. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13519. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13520. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13521. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13522. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13523. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13524. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13525. WEBVR_LEARN_MORE: "En savoir plus",
  13526. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13527. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13528. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13529. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13530. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13531. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13532. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13533. VR_NEXT_CAPS: "SUIVANT",
  13534. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13535. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13536. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13537. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13538. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13539. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13540. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13541. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13542. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13543. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13544. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13545. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13546. VR_APP: "port VR App",
  13547. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13548. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13549. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13550. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13551. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13552. 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",
  13553. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13554. VR_ANDROID_DVICES: "Appareils Android",
  13555. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13556. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13557. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13558. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13559. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13560. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13561. VR_DOWNLOAD_HERE: "Télécharger ici",
  13562. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13563. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13564. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13565. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13566. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13567. SHARE_TO: "Partager sur",
  13568. SHARE_LINK: "Lien direct",
  13569. SHARE_EXPLORE: "Explorer ",
  13570. SHARE_AT: "à",
  13571. SHARE_WITH: "avec",
  13572. SHARE_3D: " en 3D",
  13573. SHARE_COPIED: "Copié!",
  13574. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13575. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13576. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13577. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13578. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13579. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13580. ERROR_GENERIC_ACTIONS_3: " ou ",
  13581. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13582. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13583. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13584. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13585. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13586. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13587. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13588. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13589. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13590. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13591. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13592. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13593. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13594. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13595. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13596. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13597. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13598. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13599. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13600. MENU_COPY: "Copie",
  13601. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13602. ROTATE: "Faire pivoter",
  13603. INSIDE: "Intérieure",
  13604. MOVE: "Se déplacer",
  13605. ZOOM: "Zoom"
  13606. }
  13607. }
  13608. , {}],
  13609. 114: [function(e, t, i) {
  13610. "use strict";
  13611. t.exports = {
  13612. PAGE_TITLE: "",
  13613. LOADING: "読み込み中",
  13614. PRESENTED_BY_CAPS: "PRESENTED BY",
  13615. POWERED_BY: "powered by",
  13616. POWERED_BY_CAPS: "POWERED BY",
  13617. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13618. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13619. PRESENTED_BY: "Presented by ",
  13620. MORE: "全て表示 ",
  13621. LESS: "閉じる ",
  13622. TAG_CONTENT: "tag™コンテンツ ",
  13623. SHOW: "表示",
  13624. HIDE: "非表示",
  13625. DOLLHOUSE: "ドールハウス",
  13626. FLOOR_PLAN: "フロアプラン",
  13627. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13628. CLOSE_HIGHLIGHTS: "閉じる",
  13629. PREVIOUS: "前へ",
  13630. PLAY: "再生",
  13631. PAUSE: "一時停止",
  13632. NEXT: "次へ",
  13633. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13634. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13635. SOCIAL_SHARING: "このSpaceを共有する",
  13636. VIEW_IN_VR: "VRで表示",
  13637. VIEW_FULLSCREEN: "フルスクリーン表示",
  13638. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13639. ZOOM_IN: "ズームイン",
  13640. ZOOM_OUT: "ズームアウト",
  13641. FLOOR_NAME: "フロア ",
  13642. FLOOR_ALL: "すべて",
  13643. TERMS: "規約",
  13644. PORT_TERMS: "port規約",
  13645. TERMS_OF_USE: "利用規約",
  13646. CLOSE_TERMS: "閉じる",
  13647. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13648. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13649. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13650. WEBVR_ENTER_WEBVR: "VRに入る",
  13651. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13652. WEBVR_LEARN_MORE: "もっと詳しく",
  13653. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13654. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13655. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13656. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13657. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13658. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13659. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13660. VR_PREVIOUS_CAPS: "前へ",
  13661. VR_NEXT_CAPS: "次へ",
  13662. VR_GOT_IT_CAPS: "了解",
  13663. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13664. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13665. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13666. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13667. VR_WHAT_YOU_NEED: "必要なもの",
  13668. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13669. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13670. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13671. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13672. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13673. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13674. VR_APP: "port VRアプリ",
  13675. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13676. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13677. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13678. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13679. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13680. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13681. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13682. VR_ANDROID_DVICES: "Androidデバイス",
  13683. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13684. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13685. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13686. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13687. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13688. VR_APP_OPEN: "port VRアプリで開く",
  13689. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13690. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13691. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13692. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13693. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13694. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13695. SHARE_TO: "共有先",
  13696. SHARE_LINK: "ダイレクトリンク",
  13697. SHARE_EXPLORE: "探索",
  13698. SHARE_AT: "場所",
  13699. SHARE_WITH: "使用アプリ",
  13700. SHARE_3D: "3Dで",
  13701. SHARE_COPIED: "コピーされました!",
  13702. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13703. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13704. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13705. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13706. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13707. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13708. ERROR_GENERIC_ACTIONS_3: "または",
  13709. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13710. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13711. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13712. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13713. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13714. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13715. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13716. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13717. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13718. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13719. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13720. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13721. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13722. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13723. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13724. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13725. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13726. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13727. LINK_TO_LOCATION: "ロケーションへのリンク",
  13728. MENU_COPY: "コピー",
  13729. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13730. ROTATE: "回転",
  13731. MOVE: "移動",
  13732. INSIDE: "内側",
  13733. ZOOM: "ズーム",
  13734. HELP: "ヘルプ",
  13735. HELP_NAVIGATION_TAB: "ナビゲーション",
  13736. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13737. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13738. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13739. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13740. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13741. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13742. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13743. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13744. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13745. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13746. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13747. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13748. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13749. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13750. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13751. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13752. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13753. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13754. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13755. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13756. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13757. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13758. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13759. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13760. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13761. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13762. HELP_MORE_HLR_A: "ハイライト",
  13763. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13764. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13765. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13766. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13767. HELP_MORE_FLOORS_A: "フロアセレクター",
  13768. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13769. HELP_MORE_TAG_A: "tag™ Posts",
  13770. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13771. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13772. HELP_MORE_ZOOM_A: "ズームコントロール",
  13773. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13774. HELP_MORE_TOUR_A: "ツアーコントロール",
  13775. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13776. HELP_MORE_INSIDE_A: "内側ビュー",
  13777. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13778. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13779. HELP_MORE_VR_A: "VRモード",
  13780. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13781. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13782. HELP_MORE_360_A: "360° Views",
  13783. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13784. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13785. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13786. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13787. CLOSE: "閉じる"
  13788. }
  13789. }
  13790. , {}],
  13791. 115: [function(e, t, i) {
  13792. "use strict";
  13793. t.exports = {
  13794. PAGE_TITLE: "",
  13795. LOADING: "Загрузка",
  13796. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13797. POWERED_BY: "разработано на платформе ",
  13798. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13799. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13800. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13801. PRESENTED_BY: "Представлено ",
  13802. MORE: "Больше ",
  13803. LESS: "Меньше ",
  13804. TAG_CONTENT: "tag™ Контент",
  13805. SHOW: "Показать",
  13806. HIDE: "Скрыть",
  13807. DOLLHOUSE: "Dollhouse",
  13808. FLOOR_PLAN: "Планировка",
  13809. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13810. CLOSE_HIGHLIGHTS: "Закрыть",
  13811. PREVIOUS: "Предыдущий",
  13812. PLAY: "Воспроизвести",
  13813. PAUSE: "Пауза",
  13814. NEXT: "Следующий",
  13815. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13816. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13817. SOCIAL_SHARING: "Поделиться этой моделью",
  13818. VIEW_IN_VR: "Посмотреть в VR",
  13819. VIEW_FULLSCREEN: "Полный экран",
  13820. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13821. ZOOM_IN: "Увеличить",
  13822. ZOOM_OUT: "Уменьшить",
  13823. FLOOR_NAME: "Этаж ",
  13824. FLOOR_ALL: "Все",
  13825. TERMS: "Условия",
  13826. PORT_TERMS: "Правила пользования",
  13827. TERMS_OF_USE: "Условия использования",
  13828. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13829. CLOSE_TERMS: "Закрыть",
  13830. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13831. HELP: "Помощь",
  13832. HELP_NAVIGATION_TAB: "Навигация",
  13833. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13834. CLOSE: "Закрыть",
  13835. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13836. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13837. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13838. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13839. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13840. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13841. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13842. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13843. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13844. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13845. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13846. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13847. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13848. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13849. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13850. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13851. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13852. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13853. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13854. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13855. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13856. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13857. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13858. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13859. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13860. HELP_MORE_HLR_A: "Фотоколлаж",
  13861. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13862. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13863. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13864. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13865. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13866. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13867. HELP_MORE_TAG_A: "tag™ Posts",
  13868. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13869. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13870. HELP_MORE_ZOOM_A: "Масштаб",
  13871. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13872. HELP_MORE_TOUR_A: "Управление Туром",
  13873. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13874. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13875. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13876. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13877. HELP_MORE_VR_A: "Режим VR",
  13878. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13879. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13880. HELP_MORE_360_A: "360° Views",
  13881. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13882. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13883. HELP_MORE_FULLSCREEN_A: "Полный экран",
  13884. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  13885. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  13886. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  13887. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  13888. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  13889. WEBVR_LEARN_MORE: "Узнать больше",
  13890. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  13891. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  13892. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13893. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  13894. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  13895. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13896. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13897. VR_APP: "port VR App",
  13898. VR_APP_OPEN: "Или открыть через приложение port VR",
  13899. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  13900. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  13901. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  13902. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  13903. VR_VIEW_SPACE: "Запустить модель в VR",
  13904. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  13905. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  13906. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  13907. VR_GOT_IT_CAPS: "ЯСНО",
  13908. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  13909. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  13910. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  13911. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  13912. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  13913. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  13914. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13915. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13916. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13917. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  13918. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  13919. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  13920. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  13921. VR_ANDROID_DVICES: "Android устройства",
  13922. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  13923. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  13924. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  13925. VR_DOWNLOAD_HERE: "Скачать здесь",
  13926. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  13927. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  13928. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  13929. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  13930. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  13931. SHARE_TO: "Поделиться",
  13932. SHARE_LINK: "Прямая ссылка",
  13933. SHARE_EXPLORE: "просмотреть",
  13934. SHARE_AT: "на",
  13935. SHARE_WITH: "с",
  13936. SHARE_3D: "в 3D",
  13937. SHARE_COPIED: "Скопировано!",
  13938. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  13939. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  13940. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  13941. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  13942. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  13943. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  13944. ERROR_GENERIC_ACTIONS_3: " или ",
  13945. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  13946. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  13947. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  13948. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  13949. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  13950. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  13951. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  13952. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  13953. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  13954. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  13955. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  13956. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  13957. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  13958. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  13959. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  13960. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  13961. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  13962. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  13963. LINK_TO_LOCATION: "Ссылка на местоположение",
  13964. MENU_COPY: "Копировать",
  13965. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  13966. ROTATE: "Вращать",
  13967. MOVE: "Передвигаться",
  13968. INSIDE: "Вид изнутри",
  13969. ZOOM: "Масштаб"
  13970. }
  13971. }
  13972. , {}],
  13973. 116: [function(r, e, t) {
  13974. (function(i) {
  13975. "use strict";
  13976. function re(e) {
  13977. console.log("e1:" + e),
  13978. e = Math.round(.4 * e * 100),
  13979. console.log("e2:" + e);
  13980. var t = $(".progressbar");
  13981. t.find(".bar").css("width", e + "%"),
  13982. t.find(".label").css("left", t.width() * e / 100 - 15 + "px"),
  13983. t.find(".perc").text(e + "%")
  13984. }
  13985. $("#gui-loading").fadeIn(200),
  13986. re(.1);
  13987. var e = g_version ? "modeldata.js" : "someData.json";
  13988. $.ajax(g_Prefix + "data/" + window.number + "/" + e + "?" + randomTime().getTime(), {
  13989. dataType: "json"
  13990. }).done(function(e) {
  13991. var t = matcher(e);
  13992. t.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}", window.number),
  13993. t.user = {
  13994. is_authenticated: !1,
  13995. 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"]
  13996. }
  13997. try{//处理一下导览数据
  13998. t.model.images = t.model.images.filter(e=>{
  13999. if(!e.locations && !e.thumbnail_signed_src)return; //旧的曾有导览数据是错误的,将它删除
  14000. if(e.locations)e.locations = e.locations.filter(e=>e)
  14001. if(e.locations && e.locations.length == 0)return;
  14002. return e
  14003. })
  14004. }catch(e){console.log(e) }
  14005. window.editTool = new EditTools()
  14006. t.hotIconScale = parseFloat(t.hotIconScale || 1)
  14007. window.DATA = t
  14008. t.model.summary = t.summary
  14009. t.model.name = t.name
  14010. for(let i in t){
  14011. t[i] == "false" && (t[i] = false)
  14012. }
  14013. re(.7),
  14014. function() {
  14015. function y(e) {
  14016. t.update(e)
  14017. }
  14018. function A(e, t) {
  14019. ne.error(t),
  14020. n.error(t),
  14021. N.report(e, "error-" + t)
  14022. }
  14023. function C(e, t, i) {
  14024. try {
  14025. e.start(t)
  14026. } catch (e) {
  14027. throw ne.warn(e.message),
  14028. function(e) {
  14029. var t = O.details();
  14030. t && "Safari" === t.name && 500 < t.version && t.version < 600 ? (n.error("webgl-safari"),
  14031. N.report(e, "error-webgl-safari")) : (n.error("webgl-generic"),
  14032. N.report(e, "error-webgl-generic"))
  14033. }(i.sid),
  14034. e
  14035. }
  14036. }
  14037. function I(e) {
  14038. e.stopPropagation(),
  14039. e.preventDefault()
  14040. }
  14041. window.DATA.hoticon && (g_HotImage = {
  14042. point: window.DATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  14043. point2: window.DATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  14044. });
  14045. if (window.DATA.backgroundMusic) {
  14046. if(window.isLocal){
  14047. SoundManager.setSrc('bgm', manage.dealURL(window.DATA.backgroundMusic))
  14048. }else{
  14049. SoundManager.setSrc('bgm', window.DATA.backgroundMusic )
  14050. }
  14051. $("#volume").show();
  14052. }else if (g_version === "one"){
  14053. SoundManager.setSrc('bgm', manage.dealURL( g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3"))
  14054. $("#volume").show();
  14055. }
  14056. //隐藏公司logo
  14057. window.DATA.loadlogo && showLogo();
  14058. r("./lib/three75-shim"),
  14059. r("./lib/array-polyfill"),
  14060. r("./lib/performance-polyfill"),
  14061. r("./lib/shaders/CopyShader.js"),
  14062. r("./lib/shaders/HorizontalBlurShader.js"),
  14063. r("./lib/shaders/VerticalBlurShader.js"),
  14064. r("./lib/postprocessing/EffectComposer.js"),
  14065. r("./lib/postprocessing/RenderPass.js"),
  14066. r("./lib/postprocessing/MaskPass.js"),
  14067. r("./lib/postprocessing/ShaderPass.js"),
  14068. window.Promise || (window.Promise = r("promise-polyfill"));
  14069. var E = r("three")
  14070. , _ = r("three")
  14071. , b = (r("./util/sentry"),
  14072. r("./player"))
  14073. , w = r("./director")
  14074. , T = r("./controls/CameraControls")
  14075. , x = r("./model/ModelManager")
  14076. , S = r("./DisplayController")
  14077. , M = r("./label/LabelDisplayController")
  14078. , R = r("./enum/Viewmode")
  14079. , e = r("./util/logger")
  14080. , P = r("./showcase")
  14081. , O = r("./util/browser")
  14082. , L = r("./settings")
  14083. , D = r("./gui/gui")
  14084. , n = r("./gui/error")
  14085. , N = r("./analytics")
  14086. , F = r("./util/transitions")
  14087. , B = r("./effects")
  14088. , V = r("./objects/Skybox")
  14089. , k = (r("./util/common"),
  14090. r("./util/PanoramaCollection"),
  14091. r("./util/math"),
  14092. r("./util/showcase"))
  14093. , U = r("./util/camera")
  14094. , H = (r("./objects/Panorama"),
  14095. r("./cameras/PanoramaCamera"),
  14096. r("./preloaders"))
  14097. , z = r("events").EventEmitter
  14098. , G = r("./featureflags")
  14099. , W = (r("./util/lerp"),
  14100. r("./util/ajax"),
  14101. r("./ab"))
  14102. , j = r("./sdk/automation.js")
  14103. , Y = r("./scene/SceneRenderer")
  14104. , q = r("./scene/QuickstartManager")
  14105. , X = r("./tile/QualityManager.js")
  14106. , Z = r("./localization/localize")
  14107. , K = r("./tag/tagManager")
  14108. , Q = r("./tile/TileDownloader")
  14109. , J = r("./tile/PanoRenderer")
  14110. , ee = (r("./enum/PanoSizeClass"),
  14111. r("./enum/PanoramaEvents"),
  14112. r("./enum/SceneRendererEvents"))
  14113. , t = r("./gui/memoryUsage")
  14114. , te = r("./enum/RenderLayers")
  14115. , ie = r("./TimingData")
  14116. , ne = new e(i);
  14117. e.level = L.logLevel,
  14118. e.consoleEnabled = L.console,
  14119. function() {
  14120. var e = window.number//k.getModelIDFromQueryString();
  14121. if (!e)
  14122. return A(null, "loading-failed");
  14123. var t = k.parseSidUrl(e)
  14124. , i = O.valueFromHash("play", !1) ? "autoplay" : O.inIframe() ? "click" : "fullpage"
  14125. , n = {
  14126. panoElementsToLoad: 6,
  14127. modelElementsToLoad: 0,
  14128. totalElementsLoaded: 0,
  14129. totalElementsToLoad: 0,
  14130. totalPercentageLoaded: 0,
  14131. progressCallback: null
  14132. }
  14133. , r = document.getElementById("player")
  14134. , o = L.quickstart.enabled
  14135. , a = null
  14136. , s = null
  14137. , l = null
  14138. , c = null
  14139. , h = null
  14140. , u = null
  14141. , d = null
  14142. , p = null
  14143. , f = null
  14144. , g = null
  14145. , m = null
  14146. , v = new ie;
  14147. !function(e) {
  14148. ne.info("Version", "2.25.6-0-gd87e5b1"),
  14149. z.defaultMaxListeners = 1e3,
  14150. function(e) {
  14151. e.addEventListener("dragenter", I, !1),
  14152. e.addEventListener("dragover", I, !1)
  14153. }(e),
  14154. O.valueFromHash("title", !0) || $(document).ready(function() {
  14155. $(".model-title").hide()
  14156. })
  14157. }(r),
  14158. function(e) {
  14159. return G.loadFeatureFlags(e).done(function(e) {
  14160. G.updateDependentSettings(e, L)
  14161. })
  14162. }({
  14163. urlBase: t.urlBase
  14164. }).then(function() {
  14165. return Z.init(),
  14166. function(e, t) {
  14167. var i = P.getModel({
  14168. url: t,
  14169. floors: O.valueFromHash("f", !0),
  14170. autoload: !1
  14171. });
  14172. return $.when(i, y).then(null, function(e) {
  14173. return this
  14174. })
  14175. }(0, e)
  14176. }).then(function(e) {
  14177. return re(.9),
  14178. function(e, t, i, n, r) {
  14179. ne.info("Model data loaded"),
  14180. ne.debug("UUID: " + e.data.job.uuid),
  14181. W.init(G.getFlags()),
  14182. i && N.initKeen({
  14183. token: i,
  14184. appId: n
  14185. }),
  14186. N.initSegment({
  14187. model: e.sid,
  14188. version: "2.25.6-0-gd87e5b1",
  14189. startSource: r.startSource,
  14190. token: t,
  14191. autoplay: r.autoplay,
  14192. quickstart: r.quickstart
  14193. })
  14194. }(g = e, L.appConfig.segment_key, L.appConfig.keen_write_key, L.appConfig.keen_project_id, {
  14195. startSource: i,
  14196. autoplay: L.autoplay,
  14197. quickstart: o
  14198. }),
  14199. g.urls.init()
  14200. }).then(function() {
  14201. return g.loadPanos()
  14202. }).then(function() {
  14203. s = U.getStartCameraOptions(g, g.panos);
  14204. //初始画面
  14205. window.DATA.camera_start && window.DATA.camera_start.thumbImg && function(e) {
  14206. $("<img/>").attr("src", e).on("load", function() {
  14207. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  14208. $(this).remove()
  14209. $(".shotImg.innerBtn").removeClass('blank').css("background-image", "url(" + e + ")")
  14210. })
  14211. }(window.DATA.camera_start.thumbImg);
  14212. {//初始化导览时间
  14213. if(DATA.tourBlackSpeed == void 0)DATA.tourBlackSpeed = 100
  14214. window._settings.warp.teleportTime = settings.teleportTime / DATA.tourBlackSpeed * 100;
  14215. if(DATA.tourWalkSpeed == void 0)DATA.tourWalkSpeed = 100
  14216. /* if(DATA.tourWalkSpeed!=void 0){
  14217. let r = 100 / DATA.tourWalkSpeed;
  14218. window._settings.warp.flytimeDistanceMultiplier = settings.flytimeDistanceMultiplier * r
  14219. window._settings.warp.flyTime = settings.flyTime * r
  14220. }else{
  14221. window._settings.warp.flyTime = settings.flyTime
  14222. } */
  14223. }
  14224. d = function(e) {
  14225. var t = new E.PerspectiveCamera;
  14226. t.layers.enable(te.PANOMARKERS),
  14227. t.layers.enable(te.RETICULE),
  14228. t.layers.enable(te.TAG);
  14229. var o = new E.Scene
  14230. , i = new E.AmbientLight(16777215);
  14231. return o.add(i),
  14232. o.skybox = new V,
  14233. o.add(o.skybox),
  14234. o.plane = new E.Mesh(new E.PlaneBufferGeometry(1e5,1e5),new E.RawShaderMaterial({
  14235. side: E.DoubleSide
  14236. })),
  14237. o.plane.position.y = 0,
  14238. o.plane.rotateX(-Math.PI / 2),
  14239. o.plane.material.visible = !1,
  14240. o.add(o.plane),
  14241. o.updateMatrixWorld(),
  14242. L.showScreenshotLocations && e.data.images.forEach(function(e) {
  14243. if (e.metadata && e.metadata.camera_position) {
  14244. var t = e.metadata.camera_position
  14245. , i = new E.Mesh(new E.BoxGeometry(.3,.3,.3));
  14246. i.position = t.clone(),
  14247. o.add(i);
  14248. var n = e.metadata.camera_quaternion
  14249. , r = new E.Vector3(0,0,-1).applyQuaternion(n);
  14250. o.add(new E.ArrowHelper(r,t.clone(),1,16711680))
  14251. }
  14252. }),
  14253. L.showAxis && (o.add(new E.ArrowHelper(new E.Vector3(0,1,0),new E.Vector3(0,0,0),1,255)),
  14254. o.add(new E.ArrowHelper(new E.Vector3(0,0,1),new E.Vector3(0,0,0),1,16711680)),
  14255. o.add(new E.ArrowHelper(new E.Vector3(1,0,0),new E.Vector3(0,0,0),1,65280))),
  14256. new Y(o,t,B)
  14257. }(g),
  14258. m = function(e, t) {
  14259. var i = e ? 1 : 1e3
  14260. , n = W.tilegen || W.imgopt ? 6 : 2;
  14261. n = O.valueFromHash("tileconc", n);
  14262. var r = new X
  14263. , o = new Q({
  14264. concurrentDownloads: n
  14265. })
  14266. , a = new J
  14267. , s = new x
  14268. , l = new w
  14269. , c = new b(t)
  14270. , h = new T
  14271. , u = new S(i)
  14272. , d = new M
  14273. , p = new K;
  14274. return {
  14275. qualityManager: r,
  14276. panoRenderer: a,
  14277. tileDownloader: o,
  14278. player: c,
  14279. director: l,
  14280. modelManager: s,
  14281. tagManager: p,
  14282. displayController: u,
  14283. labelDisplayController: d,
  14284. controls: h
  14285. }
  14286. }(o, s.mode),
  14287. l = m.controls,
  14288. c = m.player,
  14289. h = m.director,
  14290. u = m.tagManager,
  14291. p = m.tileDownloader,
  14292. f = m.qualityManager,
  14293. m.panoRenderer,
  14294. function(e, t, i, n) {
  14295. var r = i.controls
  14296. , o = i.qualityManager
  14297. , a = i.panoRenderer
  14298. , s = i.tileDownloader
  14299. , l = i.modelManager;
  14300. r.init(n, l),
  14301. j.init(i.director, r, i.player, l, t),
  14302. o.init(l),
  14303. s.init(o),
  14304. a.init(t, s, o),
  14305. l.init(s, a, o),
  14306. l.addModel(e),
  14307. t.addComponent(F)
  14308. }(g, d, m, r),
  14309. c.director = h,
  14310. g.supportsTiles && p.start(),
  14311. !o || s.mode === R.PANORAMA && s.pano || (ne.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14312. o = !1);
  14313. var e = null;
  14314. if (o) {
  14315. ne.warn("Quickstart engaged. Hold on to your knickers.");
  14316. var t = l.controls[R.PANORAMA];
  14317. a = new q(f,d.scene,d.camera,t,r),
  14318. C(d, r, g),
  14319. e = a.load(s).then(function() {
  14320. d.addComponent(a),
  14321. d.once(ee.AfterRender, function() {
  14322. ne.warn("First render after quickstart load finished.")
  14323. })
  14324. })
  14325. }
  14326. return window.flyToFirst = function() {
  14327. var e = c.model.panos.get("8d778e19657f433fb9cf8947d823bb70")
  14328. , t = new _.Quaternion(.7099827027821568,-.07708150183830938,.6958985789714591,.07555241737970636)
  14329. , i = new _.Vector3(0,0,-1).applyQuaternion(t).add(e.position);
  14330. c.flyToPano({
  14331. pano: e,
  14332. lookAtPoint: i
  14333. })
  14334. }
  14335. ,
  14336. $.when(e, D.startLoading(g, c, h, L.autoplay, o, v))
  14337. }).then(function() {
  14338. return function(e, t, i, n, r) {
  14339. return r.progressCallback = t,
  14340. N.sessionStart(),
  14341. e.load(n).progress(function(e, t) {
  14342. e.modelElementsToLoad = t[1],
  14343. function(e) {
  14344. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14345. }(e),
  14346. function(e) {
  14347. e.totalElementsLoaded++,
  14348. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14349. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0),
  14350. e.totalPercentageLoaded = .4 + .6 * e.totalPercentageLoaded,
  14351. console.log("pro:" + e.totalPercentageLoaded),
  14352. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14353. }(e)
  14354. }
  14355. .bind(this, r))
  14356. }(g, D.onProgress, 0, !o, n)
  14357. }).then(function() {
  14358. s.quickstart = o,
  14359. function(e, t, i, n) {
  14360. var r = i.qualityManager
  14361. , o = i.panoRenderer
  14362. , a = i.tileDownloader
  14363. , s = i.modelManager
  14364. , l = i.player
  14365. , c = i.director
  14366. , h = i.tagManager
  14367. , u = i.displayController
  14368. , d = i.labelDisplayController
  14369. , p = i.controls;
  14370. t.scene.add(e),
  14371. t.qualityManager = r;
  14372. var f = {
  14373. camera: t.camera,
  14374. director: c,
  14375. modelManager: s,
  14376. tileDownloader: a,
  14377. panoRenderer: o,
  14378. qualityManager: r,
  14379. tagManager: h,
  14380. container: n,
  14381. controls: p
  14382. };
  14383. l.init(f),
  14384. l.setScene(t.scene),
  14385. h.init(s, l),
  14386. c.init(l, s),
  14387. u.init(c, l, s, h, n),
  14388. d.init(l, s, n),
  14389. B.bindEvents(l),
  14390. t.addComponent(h),
  14391. t.addComponent(l),
  14392. t.addComponent(o),
  14393. l.sceneRenderer = t
  14394. }(g, d, m, r),
  14395. d.started || C(d, r, g),
  14396. N.modelLoaded(g, c, l, L.autoplay),
  14397. function(e, t, i, n) {
  14398. return ne.info("Starting player in " + i.mode),
  14399. N.report(t.sid, "started-playing", n, i.quickstart),
  14400. e.start(i)
  14401. }(c, g, s, L.autoplay).done(function() {
  14402. h.autoTour()
  14403. }),
  14404. g.supportsTiles || new H(g,c).start();
  14405. o && (d.removeComponent(a),
  14406. a.destroy(),
  14407. s.pano.enter()),
  14408. D.init(g, h, c, l, d, s, N.getSessionId()),
  14409. D.endLoading(g, h, u),
  14410. d.once(ee.AfterRender, function() {
  14411. v.setAppReadyTime();
  14412. var e = v.calcFullLoadingTime();
  14413. ne.warn("Total load time: " + e / 1e3),
  14414. N.loadComplete(e),
  14415. ne.warn("First render after model load finished.");
  14416. editTool.loadDone('data', window.DATA)
  14417. }),
  14418. d.on(ee.MemoryUsageUpdated, y)
  14419. }).fail(A.bind(this, e))
  14420. }()
  14421. }()
  14422. }).fail(e=>{
  14423. alert("缺少someData文件,请检查场景码是否正确。")
  14424. })
  14425. }
  14426. ).call(this, "/js/main.js")
  14427. }
  14428. , {
  14429. "./DisplayController": 1,
  14430. "./TimingData": 2,
  14431. "./ab": 3,
  14432. "./analytics": 4,
  14433. "./cameras/PanoramaCamera": 7,
  14434. "./controls/CameraControls": 9,
  14435. "./director": 15,
  14436. "./effects": 16,
  14437. "./enum/PanoSizeClass": 36,
  14438. "./enum/PanoramaEvents": 37,
  14439. "./enum/RenderLayers": 41,
  14440. "./enum/SceneRendererEvents": 43,
  14441. "./enum/Viewmode": 51,
  14442. "./featureflags": 59,
  14443. "./gui/error": 64,
  14444. "./gui/gui": 65,
  14445. "./gui/memoryUsage": 73,
  14446. "./label/LabelDisplayController": 91,
  14447. "./lib/array-polyfill": 92,
  14448. "./lib/performance-polyfill": 95,
  14449. "./lib/postprocessing/EffectComposer.js": 96,
  14450. "./lib/postprocessing/MaskPass.js": 97,
  14451. "./lib/postprocessing/RenderPass.js": 98,
  14452. "./lib/postprocessing/ShaderPass.js": 99,
  14453. "./lib/shaders/CopyShader.js": 100,
  14454. "./lib/shaders/HorizontalBlurShader.js": 101,
  14455. "./lib/shaders/VerticalBlurShader.js": 102,
  14456. "./lib/three75-shim": 103,
  14457. "./localization/localize": 108,
  14458. "./tag/tagManager": 124,
  14459. "./model/ModelManager": 140,
  14460. "./objects/Panorama": 148,
  14461. "./objects/Skybox": 152,
  14462. "./player": 155,
  14463. "./preloaders": 156,
  14464. "./scene/QuickstartManager": 157,
  14465. "./scene/SceneRenderer": 158,
  14466. "./sdk/automation.js": 164,
  14467. "./settings": 166,
  14468. "./showcase": 168,
  14469. "./tile/PanoRenderer": 169,
  14470. "./tile/QualityManager.js": 170,
  14471. "./tile/TileDownloader": 171,
  14472. "./util/PanoramaCollection": 178,
  14473. "./util/ajax": 181,
  14474. "./util/browser": 182,
  14475. "./util/camera": 183,
  14476. "./util/common": 185,
  14477. "./util/lerp": 188,
  14478. "./util/logger": 189,
  14479. "./util/math": 190,
  14480. "./util/sentry": 192,
  14481. "./util/showcase": 193,
  14482. "./util/transitions": 195,
  14483. events: 202,
  14484. "promise-polyfill": 213,
  14485. three: 217
  14486. }],
  14487. 117: [function(e, t, i) {
  14488. "use strict";
  14489. function n(e) {
  14490. e = e || {},
  14491. r.RawShaderMaterial.call(this, a.extendObject({
  14492. fragmentShader: o.cube.fragmentShader,
  14493. vertexShader: o.cube.vertexShader,
  14494. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14495. name: "CubemapMaterial"
  14496. }, e))
  14497. }
  14498. var r = e("three")
  14499. , o = e("../shaders")
  14500. , a = e("../util/common");
  14501. (n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n,
  14502. t.exports = n
  14503. }
  14504. , {
  14505. "../shaders": 167,
  14506. "../util/common": 185,
  14507. three: 217
  14508. }],
  14509. 118: [function(e, t, i) {
  14510. "use strict";
  14511. function n(e) {
  14512. e = e || {},
  14513. r.RawShaderMaterial.call(this, a.extendObject({
  14514. fragmentShader: o.model.fragmentShader,
  14515. vertexShader: o.model.vertexShader,
  14516. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14517. name: "ModelTextureMaterial"
  14518. }, e))
  14519. }
  14520. var r = e("three")
  14521. , o = e("../shaders")
  14522. , a = e("../util/common");
  14523. ((n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n).prototype.setProjectedPanos = function(e, t, i) {
  14524. i && (this.uniforms.progress.value = 0),
  14525. e.ensureSkyboxReadyForRender(),
  14526. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14527. this.uniforms.pano0Position.value.copy(e.position),
  14528. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14529. t.ensureSkyboxReadyForRender(),
  14530. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14531. this.uniforms.pano1Position.value.copy(t.position),
  14532. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14533. }
  14534. ,
  14535. t.exports = n
  14536. }
  14537. , {
  14538. "../shaders": 167,
  14539. "../util/common": 185,
  14540. three: 217
  14541. }],
  14542. 119: [function(m, v, e) {
  14543. (function(e) {
  14544. "use strict";
  14545. function t(e, t, i, n) {
  14546. this.div = null,
  14547. this.body = null,
  14548. this.label = e,
  14549. this.description = t,
  14550. this.parsedDescription = [],
  14551. this.media = i || {
  14552. type: null
  14553. },
  14554. this.loadingSpinner = null,
  14555. this.parser = new r({
  14556. supportLinks: !c.valueFromHash("mls"),
  14557. keepLinkLabels: !0
  14558. }),
  14559. this.state = g.CLOSED,
  14560. this.orientation = "",
  14561. this.initialTransform = "",
  14562. this.hovering = !1,
  14563. this.openTransition = null,
  14564. this.closeTransition = null,
  14565. this.openPromise = null,
  14566. this.closePromise = null,
  14567. this.animationTransition = null,
  14568. this.animationScale = 0
  14569. }
  14570. var r = m("../Parser/DescriptionParser")
  14571. , i = m("../Media/Link")
  14572. , n = m("../Media/Image")
  14573. , o = m("../Media/EmbedlyPlayer")
  14574. , a = m("../Media/EmbedlyEmbed")
  14575. , s = m("../../util/transitions")
  14576. , l = m("../../util/lerp")
  14577. , c = m("../../util/browser")
  14578. , b = m("./BillboardEvent")
  14579. , w = m("../Media/MediaEvent")
  14580. , h = m("../Parser/DescriptionChunkType")
  14581. , u = m("events").EventEmitter
  14582. , d = m("./billboardSettings")
  14583. , T = m("./overlaySettings")
  14584. , p = new (m("../../util/logger"))(e)
  14585. , f = document.getElementById("tag-billboards");
  14586. f.addEventListener("touchend", function(e) {
  14587. f.style.pointerEvents = "none"
  14588. }),
  14589. f.addEventListener("touchcancel", function(e) {
  14590. f.style.pointerEvents = "none"
  14591. });
  14592. var g = {
  14593. CLOSED: "closed",
  14594. OPENING: "opening",
  14595. OPEN: "open",
  14596. CLOSING: "closing",
  14597. ACTIVE: "active"
  14598. };
  14599. (t.prototype = Object.create(u.prototype)).build = function(e) {
  14600. this.parsedDescription = this.parser.parse(this.description);
  14601. var t = document.createElement("div");
  14602. t.className = "tag-container has-hotzone",
  14603. this.div = t,
  14604. this.body = document.createElement("div"),
  14605. this.body.className = "tag-body";
  14606. var i = document.createElement("div");
  14607. i.classList.add("tag-content");
  14608. var n = document.createElement("div");
  14609. n.classList.add("tag-text-content");
  14610. var r = document.createElement("div");
  14611. r.className = "tag-label",
  14612. r.textContent = this.label,
  14613. n.appendChild(r);
  14614. var o = document.createElement("div");
  14615. o.className = "tag-desc",
  14616. n.appendChild(o),
  14617. i.appendChild(n),
  14618. this.body.appendChild(i),
  14619. this.appendDescriptionElements(this.parsedDescription, o),
  14620. this.appendMedia(),
  14621. t.appendChild(this.body),
  14622. f.appendChild(t),
  14623. this.bindEvents(t, this.body)
  14624. }
  14625. ,
  14626. t.prototype.bindEvents = function(i, e) {
  14627. function t(n) {
  14628. return function(e) {
  14629. if (!this.div.classList.contains("overlay")) {
  14630. var t, i = document.getElementById("player");
  14631. try {
  14632. t = new MouseEvent(n,e)
  14633. } catch (i) {
  14634. (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)
  14635. }
  14636. i.dispatchEvent(t)
  14637. }
  14638. }
  14639. }
  14640. e.addEventListener("mousedown", function(e) {
  14641. e.stopPropagation()
  14642. }),
  14643. e.addEventListener("mouseup", function(e) {
  14644. e.stopPropagation()
  14645. }),
  14646. i.addEventListener("touchstart", function(e) {
  14647. f.style.pointerEvents = "auto"
  14648. }),
  14649. i.addEventListener("mousedown", t("mousedown").bind(this)),
  14650. i.addEventListener("mouseup", t("mouseup").bind(this)),
  14651. e.addEventListener("mouseover", function(e) {
  14652. this.state === g.OPEN && i.classList.remove("has-hotzone")
  14653. }
  14654. .bind(this)),
  14655. i.addEventListener("mouseenter", function(e) {
  14656. this.state !== g.CLOSING && (this.hovering = !0,
  14657. this.emit(b.ENTER))
  14658. }
  14659. .bind(this)),
  14660. i.addEventListener("mouseleave", function(e) {
  14661. this.hovering = !1,
  14662. this.emit(b.LEAVE)
  14663. }
  14664. .bind(this)),
  14665. i.addEventListener("gesturestart", function(e) {
  14666. e.preventDefault()
  14667. });
  14668. var n = i.querySelector(".tag-text-content")
  14669. , r = 0;
  14670. n.addEventListener("touchstart", function(e) {
  14671. r = e.changedTouches[0].clientY
  14672. }),
  14673. n.addEventListener("touchmove", function(t) {
  14674. function e(e) {
  14675. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight == 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14676. }
  14677. return i.classList.contains("overlay") ? e(this.querySelector(".tag-desc")) : void e(this)
  14678. }),
  14679. i.addEventListener("touchmove", function(e) {
  14680. 0 == (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14681. })
  14682. }
  14683. ,
  14684. t.prototype.appendDescriptionElements = function(e, i) {
  14685. 0 < e.length && this.div.classList.add("has-text"),
  14686. e.forEach(function(e, t) {
  14687. switch (e.type) {
  14688. case h.TEXT:
  14689. i.appendChild(this.createTextElement(e.text));
  14690. break;
  14691. case h.LINK:
  14692. i.appendChild(this.createLinkElement(e.link))
  14693. }
  14694. }
  14695. .bind(this))
  14696. }
  14697. ,
  14698. t.prototype.appendLoadingSpinner = function() {
  14699. this.loadingSpinner = document.createElement("div"),
  14700. this.loadingSpinner.classList.add("loading-spinner");
  14701. var e = document.createElement("div");
  14702. e.classList.add("gui-spinner-icon"),
  14703. this.loadingSpinner.appendChild(e),
  14704. this.body.appendChild(this.loadingSpinner)
  14705. }
  14706. ,
  14707. t.prototype.onMediaLoadFinished = function() {
  14708. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14709. this.applyOrientation(this.orientation),
  14710. this.loadingSpinner = null)
  14711. }
  14712. ,
  14713. t.prototype.appendMedia = function() {
  14714. if (this.media && this.media.type && "error" !== this.media.type && (!c.valueFromHash("mls", 0) || this.media.type === h.IMAGE)) {
  14715. this.appendLoadingSpinner();
  14716. var e = document.createElement("div");
  14717. e.classList.add("tag-media-content");
  14718. var t = document.createElement("i");
  14719. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14720. t.classList.add(e)
  14721. }),
  14722. this.body.appendChild(t),
  14723. this.body.appendChild(e),
  14724. this.media.type) {
  14725. case h.IMAGE:
  14726. e.appendChild(this.createImageElement(this.media, this.body));
  14727. break;
  14728. case h.VIDEO:
  14729. e.appendChild(this.createVideoElement(this.media, this.body));
  14730. break;
  14731. case h.RICH:
  14732. e.appendChild(this.createEmbedElement(this.media, this.body))
  14733. }
  14734. }
  14735. }
  14736. ,
  14737. t.prototype.createTextElement = function(e) {
  14738. var t = document.createElement("span");
  14739. return t.textContent = e,
  14740. t
  14741. }
  14742. ,
  14743. t.prototype.createLinkElement = function(e) {
  14744. var t = new i(e);
  14745. return t.on(w.LINK_CLICK, this.emit.bind(this, w.LINK_CLICK)),
  14746. t.createDomElement()
  14747. }
  14748. ,
  14749. t.prototype.createImageElement = function(t, C) {
  14750. function e() {
  14751. function e() {
  14752. p || (E.classList.remove("view-image"),
  14753. a.classList.add("overlay"),
  14754. t(),
  14755. window.addEventListener("resize", A),
  14756. a.addEventListener("click", i),
  14757. c.addEventListener("click", r),
  14758. o.addEventListener("click", n),
  14759. p = !0,
  14760. _.emit(w.IMAGE_OPENED))
  14761. }
  14762. function t() {
  14763. C.classList.add("show-info"),
  14764. s.classList.remove("collapsible"),
  14765. s.style.height = "";
  14766. var e = parseFloat(getComputedStyle(v).lineHeight)
  14767. , t = g + e
  14768. , i = a.clientWidth - 2 * T.boundaryWidth - m
  14769. , n = a.clientHeight - 2 * T.boundaryHeight - m - t
  14770. , r = n
  14771. , o = r * I.aspect;
  14772. i < o && (r = (o = i) / I.aspect),
  14773. n < r && (o = (r = n) * I.aspect),
  14774. o += m,
  14775. r += m + t,
  14776. C.style.width = o + "px",
  14777. C.style.height = r + "px",
  14778. l.style.paddingTop = e + m + "px",
  14779. 0 < _.description.length && (s.classList.add("collapsible"),
  14780. s.style.height = s.clientHeight + 12 + "px",
  14781. y.style.height = "calc(100% - " + v.clientHeight + "px)")
  14782. }
  14783. function i(e) {
  14784. e.target === a && n()
  14785. }
  14786. function n() {
  14787. p && (p = !1,
  14788. E.classList.add("view-image"),
  14789. a.classList.remove("overlay"),
  14790. s.style.height = "",
  14791. l.style.paddingTop = "",
  14792. C.style.width = "",
  14793. C.style.height = "",
  14794. window.removeEventListener("resize", A),
  14795. a.removeEventListener("click", i),
  14796. c.removeEventListener("click", r),
  14797. o.removeEventListener("click", n),
  14798. _.emit(w.IMAGE_CLOSED),
  14799. _.close(!0))
  14800. }
  14801. function r(e) {
  14802. C.classList.toggle("show-info")
  14803. }
  14804. var a = _.div
  14805. , s = a.getElementsByClassName("tag-content")[0]
  14806. , l = a.getElementsByClassName("tag-media-content")[0]
  14807. , o = C.getElementsByClassName("close")[0]
  14808. , c = s.getElementsByClassName("tag-label")[0];
  14809. a.classList.add("has-image"),
  14810. E.classList.add("view-image"),
  14811. a.classList.add(1 <= I.aspect ? "image-landscape" : "image-portrait"),
  14812. _.applyOrientation(_.orientation);
  14813. 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,
  14814. function() {
  14815. clearInterval(h),
  14816. clearTimeout(u),
  14817. h = setInterval(function() {
  14818. var e = a.clientHeight;
  14819. d !== e && (t(),
  14820. d = e)
  14821. }, 100),
  14822. u = setTimeout(clearInterval.bind(this, h), 1e3)
  14823. }
  14824. );
  14825. I.on(w.IMAGE_OPENING, e),
  14826. _.on(b.ACTIVATE, e),
  14827. _.on(w.IMAGE_CLOSED, I.onClosed.bind(I)),
  14828. _.on(b.CLOSING, n)
  14829. }
  14830. var I = new n
  14831. , E = I.createDomElement();
  14832. this.once(b.OPENED, function() {
  14833. I.load(t.src).then(e).catch(function(e) {
  14834. p.warn("Failed to load image:", t.src),
  14835. p.warn("with error:", e)
  14836. }).then(this.onMediaLoadFinished.bind(this))
  14837. });
  14838. var _ = this;
  14839. return E
  14840. }
  14841. ,
  14842. t.prototype.createVideoElement = function(t, e) {
  14843. var i = new o({
  14844. autoPlay: !0,
  14845. autoResume: !0,
  14846. startMuted: !1,
  14847. loop: !1
  14848. })
  14849. , n = i.createDomElement();
  14850. return this.once(b.OPENED, function() {
  14851. i.load(t.src).then(function() {
  14852. this.div.classList.add("has-video"),
  14853. this.state !== g.OPEN && this.state !== g.ACTIVE || (i.show(),
  14854. i.play()),
  14855. this.on(b.OPENING, i.show.bind(i)),
  14856. this.on(b.OPENED, i.play.bind(i)),
  14857. this.on(b.CLOSING, i.pause.bind(i)),
  14858. this.on(b.CLOSED, i.hide.bind(i))
  14859. }
  14860. .bind(this)).catch(function(e) {
  14861. p.warn("Failed to embed video:", t.src),
  14862. p.warn("with error:", e)
  14863. }).then(this.onMediaLoadFinished.bind(this))
  14864. }
  14865. .bind(this)),
  14866. n
  14867. }
  14868. ,
  14869. t.prototype.createEmbedElement = function(t, e) {
  14870. var i = new a
  14871. , n = i.createDomElement();
  14872. return this.once(b.OPENED, function() {
  14873. i.load(t.src).then(function() {
  14874. this.div.classList.add("has-embed"),
  14875. this.state !== g.OPEN && this.state !== g.ACTIVE || i.show(),
  14876. this.applyOrientation(this.orientation),
  14877. this.on(b.OPENING, i.show.bind(i)),
  14878. this.on(b.CLOSED, i.hide.bind(i))
  14879. }
  14880. .bind(this)).catch(function(e) {
  14881. p.warn("Failed to embed:", t.src),
  14882. p.warn("with error:", e)
  14883. }).then(this.onMediaLoadFinished.bind(this))
  14884. }
  14885. .bind(this)),
  14886. n
  14887. }
  14888. ,
  14889. t.prototype.open = function(e) {
  14890. return this.openPromise = $.Deferred(),
  14891. this.state === g.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  14892. this.openTransition ? e && this.setActiveState() : this.openTransition = s.setTimeout(function() {
  14893. this.state !== g.OPEN && (this.emit(b.OPENING),
  14894. e && this.emit(b.ACTIVATING),
  14895. this.state = g.OPENING,
  14896. this.animateOpen(function() {
  14897. e && this.setActiveState(),
  14898. this.openPromise.resolve()
  14899. }
  14900. .bind(this)))
  14901. }
  14902. .bind(this), d.animation.openDelay),
  14903. s.cancel(this.closeTransition),
  14904. this.closePromise && this.closePromise.reject(),
  14905. this.closeTransition = void 0,
  14906. this.openPromise.promise())
  14907. }
  14908. ,
  14909. t.prototype.close = function(e) {
  14910. return this.closePromise = $.Deferred(),
  14911. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = s.setTimeout(function() {
  14912. this.state !== g.CLOSED && (this.emit(b.CLOSING),
  14913. this.state = g.CLOSING,
  14914. this.animateClose())
  14915. }
  14916. .bind(this), d.animation.closeDelay)),
  14917. s.cancel(this.openTransition),
  14918. this.openPromise && this.openPromise.reject(),
  14919. this.openTransition = void 0,
  14920. this.closePromise.resolve(),
  14921. this.closePromise.promise())
  14922. }
  14923. ,
  14924. t.prototype.setActiveState = function() {
  14925. this.state !== g.CLOSED && (this.state = g.ACTIVE,
  14926. this.emit(b.ACTIVATE),
  14927. this.div.classList.remove("has-hotzone"))
  14928. }
  14929. ,
  14930. t.prototype.animateOpen = function(e) {
  14931. if (this.state === g.OPENING) {
  14932. if (s.cancel(this.animationTransition),
  14933. c.detectSamsungNative())
  14934. return this.boardOrientation = null,
  14935. this.div.style.visibility = "visible",
  14936. this.emit(b.OPENED),
  14937. this.state = g.OPEN,
  14938. void (e && e());
  14939. this.div.style.webkitTransform = "scale(0)",
  14940. this.div.style.transform = "scale(0)",
  14941. this.div.style.visibility = "visible",
  14942. this.animationTransition = s.start(l.property(this, "animationScale", 1), d.animation.openDuration, function() {
  14943. this.emit(b.OPENED),
  14944. this.state = g.OPEN,
  14945. e && e()
  14946. }
  14947. .bind(this))
  14948. }
  14949. }
  14950. ,
  14951. t.prototype.animateClose = function(e) {
  14952. this.state === g.CLOSING && (s.cancel(this.animationTransition),
  14953. this.animationTransition = s.start(l.property(this, "animationScale", 0), d.animation.closeDuration, function() {
  14954. this.emit(b.CLOSED),
  14955. this.state = g.CLOSED,
  14956. this.div.style.visibility = "hidden",
  14957. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  14958. e && e()
  14959. }
  14960. .bind(this)))
  14961. }
  14962. ,
  14963. t.prototype.needsUpdate = function() {
  14964. return this.state !== g.CLOSED
  14965. }
  14966. ,
  14967. t.prototype.update = function(e, t) {
  14968. if (this.needsUpdate()) {
  14969. var i = (this.updateOrientation(e),
  14970. this.calcScale(t))
  14971. , n = {
  14972. x: (e.x + 1) * $("#player").width() / 2,
  14973. y: (e.y + 1) * $("#player").height() / 2
  14974. };
  14975. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  14976. this.div.style.webkitTransform = this.div.screenTransform,
  14977. this.div.style.transform = this.div.screenTransform
  14978. }
  14979. }
  14980. ,
  14981. t.prototype.getDimensions = function() {
  14982. return this.div.getBoundingClientRect()
  14983. }
  14984. ,
  14985. t.prototype.calcScale = function(e) {
  14986. return Math.sqrt(e / 40) * d.boardToDiscRatio
  14987. }
  14988. ,
  14989. t.prototype.updateOrientation = function(e) {
  14990. if (this.state !== g.ACTIVE) {
  14991. var t = e.y < -1 / 3 ? 0 : e.y < 1 / 3 ? 1 : 2
  14992. , i = e.x < -1 / 3 ? 0 : e.x < 1 / 3 ? 1 : 2
  14993. , n = "";
  14994. n += 0 == i ? "right" : 2 == i ? "left" : "",
  14995. n += 0 == t ? "-down" : 2 == t ? "-up" : "",
  14996. 1 == i && (n = 0 == t ? "bottom" : 2 == t ? "top" : "",
  14997. 1 == t && (n = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  14998. 1 == i && 1 == t && n === this.orientation || this.applyOrientation(n)
  14999. }
  15000. }
  15001. ,
  15002. t.prototype.applyOrientation = function(e) {
  15003. this.div.style.transform = this.div.style.webkitTransform = "",
  15004. this.div.classList.remove("tag-container-" + this.orientation),
  15005. this.div.classList.add("tag-container-" + e);
  15006. var t = window.getComputedStyle(this.div);
  15007. this.initialTransform = t.transform || t.webkitTransform,
  15008. "none" === this.initialTransform && (this.initialTransform = "");
  15009. var i = t.transform.slice(7, -1).split(",")
  15010. , n = -i[4]
  15011. , r = -i[5];
  15012. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  15013. this.div.style.transformOrigin = n + "px " + r + "px",
  15014. this.orientation = e
  15015. }
  15016. ,
  15017. v.exports = t
  15018. }
  15019. ).call(this, "/js/tag/Billboard/Billboard.js")
  15020. }
  15021. , {
  15022. "../../util/browser": 182,
  15023. "../../util/lerp": 188,
  15024. "../../util/logger": 189,
  15025. "../../util/transitions": 195,
  15026. "../Media/EmbedlyEmbed": 125,
  15027. "../Media/EmbedlyPlayer": 126,
  15028. "../Media/Image": 128,
  15029. "../Media/Link": 129,
  15030. "../Media/MediaEvent": 131,
  15031. "../Parser/DescriptionChunkType": 133,
  15032. "../Parser/DescriptionParser": 134,
  15033. "./BillboardEvent": 120,
  15034. "./billboardSettings": 121,
  15035. "./overlaySettings": 122,
  15036. events: 202
  15037. }],
  15038. 120: [function(e, t, i) {
  15039. "use strict";
  15040. t.exports = Object.freeze({
  15041. ENTER: "billboard.enter",
  15042. LEAVE: "billboard.leave",
  15043. OPENING: "billboard.opening",
  15044. OPENED: "billboard.open",
  15045. CLOSING: "billboard.closing",
  15046. CLOSED: "billboard.closed",
  15047. ACTIVATING: "billboard.activating",
  15048. ACTIVATE: "billboard.activate"
  15049. })
  15050. }
  15051. , {}],
  15052. 121: [function(e, t, i) {
  15053. "use strict";
  15054. t.exports = Object.freeze({
  15055. animation: Object.freeze({
  15056. hoverOnClosing: !1,
  15057. openDelay: 100,
  15058. closeDelay: 50,
  15059. openDuration: 200,
  15060. closeDuration: 100
  15061. }),
  15062. boardToDiscRatio: 1.2
  15063. })
  15064. }
  15065. , {}],
  15066. 122: [function(e, t, i) {
  15067. "use strict";
  15068. t.exports = Object.freeze({
  15069. boundaryWidth: 30,
  15070. boundaryHeight: 0
  15071. })
  15072. }
  15073. , {}],
  15074. 123: [function(M, R, e) {
  15075. (function(e) {
  15076. "use strict";
  15077. function d(e, t, i) {
  15078. var n = i.version || "0";
  15079. "0" !== n && w.info("tag defined using version " + n),
  15080. this.model = e,
  15081. this.sid = t,
  15082. this.color = (new f.Color).set(i.color || o.tagDefault),
  15083. this.hoverColor = o._darken(this.color, .2),
  15084. this.floor = null,
  15085. this.floorIndex = i.floor,
  15086. this.mode = m.PANORAMA,
  15087. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15088. this.obj3d = null,
  15089. this.disc = null,
  15090. this.materials = {
  15091. disc: null,
  15092. pole: null
  15093. },
  15094. this.position = (new f.Vector3).copy(i.position),
  15095. this.discPosition = (new f.Vector3).copy(i.stem.direction),
  15096. this.discWorldPosition = null,
  15097. this.discScale = .05,
  15098. this.poleEnabled = i.stem.enabled,
  15099. this.billboard = new r(i.label,i.description,i.media,this),
  15100. this.visibleTransition = null,
  15101. this.hoveringDisc = !1
  15102. }
  15103. 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"),
  15104. 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);
  15105. d.prototype = Object.create(b.prototype),
  15106. d.raycaster = new f.Raycaster,
  15107. d.prototype.bindEvents = function() {
  15108. this.billboard.on(_.ENTER, this.setHoverState.bind(this)),
  15109. this.billboard.on(_.LEAVE, this.setFreeState.bind(this))
  15110. }
  15111. ,
  15112. d.prototype.build = function() {
  15113. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15114. this.floor && (this.billboard.build(this.model.sid),
  15115. this.obj3d = this.buildObject3D(),
  15116. this.floor.add(this.obj3d)),
  15117. this
  15118. }
  15119. ,
  15120. d.prototype.buildObject3D = function() {
  15121. var e = new f.Object3D;
  15122. e.position.copy(this.position);
  15123. var t = f.UniformsUtils.clone(A.tagDisc.uniforms);
  15124. t.bg.value = x,
  15125. t.mask.value = T,
  15126. t.color.value.copy(this.color),
  15127. this.materials.disc = new f.RawShaderMaterial({
  15128. transparent: !0,
  15129. vertexShader: A.tagDisc.vertexShader,
  15130. fragmentShader: A.tagDisc.fragmentShader,
  15131. uniforms: t
  15132. }),
  15133. this.disc = new f.Mesh(S,this.materials.disc),
  15134. this.disc.layers.set(a.TAG),
  15135. this.disc.position.copy(this.discPosition),
  15136. this.disc.renderOrder = s.tagDisc;
  15137. var i = (this.disc.tag = this).buildPole();
  15138. return i.layers.set(a.TAG),
  15139. i.renderOrder = s.tagStem,
  15140. e.add(i),
  15141. e.layers.set(a.TAG),
  15142. e.add(this.disc)
  15143. }
  15144. ,
  15145. d.prototype.buildPole = function() {
  15146. var e = new f.BufferGeometry
  15147. , t = new Float32Array(6);
  15148. return t[0] = t[1] = t[2] = 0,
  15149. t[3] = this.discPosition.x,
  15150. t[4] = this.discPosition.y,
  15151. t[5] = this.discPosition.z,
  15152. e.addAttribute("position", new f.BufferAttribute(t,3)),
  15153. this.materials.pole = new f.LineBasicMaterial({
  15154. linewidth: g.tags.pole.width,
  15155. color: g.tags.pole.color,
  15156. opacity: 0,
  15157. visible: this.poleEnabled,
  15158. transparent: !0,
  15159. depthWrite: !1
  15160. }),
  15161. new f.Line(e,this.materials.pole)
  15162. }
  15163. ,
  15164. d.prototype.setFreeState = function(e) {
  15165. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15166. this.materials.disc.uniforms.color.value = this.color
  15167. }
  15168. .bind(this))
  15169. }
  15170. ,
  15171. d.prototype.setHoverState = function(e) {
  15172. this.billboard.open(e),
  15173. this.materials.disc.uniforms.color.value = this.hoverColor
  15174. }
  15175. ,
  15176. d.prototype.hide = function(e, t) {
  15177. var i = $.Deferred();
  15178. if (0 === this.materials.disc.uniforms.opacity.value && !C.isRunning(this.visibleTransition))
  15179. return i.resolve().promise();
  15180. e = e || 0,
  15181. t = t || 0,
  15182. C.cancel(this.visibleTransition);
  15183. var n, r, o, a = this.materials.disc.uniforms.opacity.value / g.tags.disc.opacity, s = t + e, l = t / s;
  15184. return this.visibleTransition = C.start((n = this,
  15185. r = I.property(n.materials.disc.uniforms.opacity, "value", 0),
  15186. o = I.property(n.materials.pole, "opacity", 0),
  15187. function(e) {
  15188. r(e),
  15189. n.materials.pole && o(e)
  15190. }
  15191. ), s * a, function() {
  15192. i.resolve()
  15193. }, l, E[g.warp.blendEasing]),
  15194. i.promise()
  15195. }
  15196. ,
  15197. d.prototype.show = function(e, t) {
  15198. var i = $.Deferred();
  15199. if (this.materials.disc.uniforms.opacity.value === g.tags.disc.opacity && !C.isRunning(this.visibleTransition))
  15200. return i.resolve().promise();
  15201. e = e || 0,
  15202. t = t || 0,
  15203. C.cancel(this.visibleTransition);
  15204. 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;
  15205. return this.visibleTransition = C.start((n = this,
  15206. r = I.property(n.materials.disc.uniforms.opacity, "value", g.tags.disc.opacity),
  15207. o = I.property(n.materials.pole, "opacity", g.tags.pole.opacity),
  15208. function(e) {
  15209. r(e),
  15210. n.materials.pole && o(e)
  15211. }
  15212. ), s * a, function() {
  15213. i.resolve()
  15214. }, l, E[g.warp.blendEasing]),
  15215. i.promise()
  15216. }
  15217. ,
  15218. d.prototype.closestPanoTowardTag = function(e, t) {
  15219. var i = []
  15220. , n = []
  15221. , r = this.disc.getWorldPosition();
  15222. if (e === m.PANORAMA) {
  15223. var o = t.position.clone().sub(r).normalize();
  15224. i.push(y.filters.isPanoAligned()),
  15225. i.push(y.filters.inPanoDirection(r, o, .5)),
  15226. i.push(y.filters.isNeighbourPanoTo(t)),
  15227. n.push(y.scoreFunctions.direction(r, o))
  15228. }
  15229. var a = new f.Vector3;
  15230. i.push(function(e) {
  15231. return Math.abs(e.position.x - r.x) > g.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > g.tags.visibility.cameraClearance
  15232. }, function(e) {
  15233. a.copy(r).sub(e.position);
  15234. var t = -f.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15235. , i = g.tags.navigate.tiltTolerance;
  15236. return g.insideLookLimitDown - i < t && t < g.insideLookLimitUp + i
  15237. }),
  15238. n.push(y.scoreFunctions.distanceSquared(this, -2));
  15239. var s = this.model.panos.sortByScore(i, n);
  15240. if (g.tags.navigate.lineOfSight) {
  15241. for (var l = 0; l < s.length; l++) {
  15242. var c = s[l].pano
  15243. , h = c.position.distanceTo(r);
  15244. if (!g.tags.visibility.anyDistance && h > g.tags.visibility.visibleDistance)
  15245. return null;
  15246. d.raycaster.set(c.position, r.clone().sub(c.position).normalize());
  15247. var u = d.raycaster.intersectObjects(this.model.colliders);
  15248. if (0 === u.length || u[0].distance > h)
  15249. return c
  15250. }
  15251. return null
  15252. }
  15253. return 0 < s.length && s[0].pano
  15254. }
  15255. ,
  15256. d.prototype.examine = function(i) {
  15257. if(!player.currentPano)return;
  15258. var e = i.mode
  15259. , n = g.tags.navigate.nearestPano && this.closestPanoTowardTag(e, i.currentPano) || i.currentPano
  15260. , t = this.disc.getWorldPosition();
  15261. this.billboard.setActiveState();
  15262. var r = function() {
  15263. var e = this.billboard.getDimensions()
  15264. , t = new f.Vector3;
  15265. v.convertScreenPositionToNDC(e.left + e.width / 2, e.top + e.height / 2, t),
  15266. t.unproject(i.camera),
  15267. i.flyToPano({
  15268. pano: n,
  15269. lookAtPoint: t
  15270. })
  15271. }
  15272. .bind(this);
  15273. if (e === m.PANORAMA)
  15274. if (n !== i.currentPano) {
  15275. var o = {
  15276. pano: n,
  15277. lookAtPoint: t,
  15278. duration: null,
  15279. maxDistanceOverride: null,
  15280. skipWarpingCheck: !1
  15281. };
  15282. i.flyToPano(o, r)
  15283. } else
  15284. setTimeout(function() {
  15285. this.billboard.open().then(function() {
  15286. r()
  15287. })
  15288. }
  15289. .bind(this), 0);
  15290. else {
  15291. var a = {
  15292. pano: n
  15293. };
  15294. if (t) {
  15295. var s = (new f.Matrix4).lookAt(n.position, t, new f.Vector3(0,1,0));
  15296. a.quaternion = (new f.Quaternion).setFromRotationMatrix(s)
  15297. }
  15298. a.callback = r,
  15299. a.duration = 1500,
  15300. a.mode = m.PANORAMA,
  15301. i.flyToNewMode(a)
  15302. }
  15303. }
  15304. ,
  15305. d.prototype.update = (n = new f.Vector3,
  15306. function(e, t) {
  15307. this.discWorldPosition = this.disc.getWorldPosition(),
  15308. this.updateDisc(e, t),
  15309. this.billboard.needsUpdate() && (n.copy(this.discWorldPosition).project(t),
  15310. n.z < 1 && (n.y *= -1,
  15311. this.billboard.update(n, this.getDiscRadius(n, t))))
  15312. }
  15313. ),
  15314. d.prototype.updateDisc = (l = new f.Vector3,
  15315. c = new f.Vector3,
  15316. h = new f.Vector3,
  15317. u = new f.Vector3,
  15318. p = new f.Vector3,
  15319. function(e, t) {
  15320. var i = g.tags.visibility
  15321. , n = g.tags.disc.scale
  15322. , r = e === m.DOLLHOUSE || e === m.FLOORPLAN ? g.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15323. 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)),
  15324. this.obj3d.visible) {
  15325. this.disc.quaternion.copy(t.quaternion);
  15326. var o = n.maxSize - (n.maxSize - n.minSize) * f.Math.smoothstep(r, n.nearBound, n.farBound);
  15327. l.copy(this.discWorldPosition).project(t),
  15328. c.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(l),
  15329. h.set(o / 2, 0, 0).add(c),
  15330. u.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(h),
  15331. p.copy(u).unproject(t);
  15332. var a = p.distanceTo(this.discWorldPosition)
  15333. , s = 1 + g.tags.disc.scale.responsiveness / 100 * (d.viewportScale() - 1);
  15334. this.discScale = a * s,
  15335. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15336. }
  15337. }
  15338. ),
  15339. d.prototype.getDiscRadius = (i = new f.Vector3,
  15340. function(e, t) {
  15341. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15342. Math.abs(e.x - i.x) * $("#player").width()
  15343. }
  15344. ),
  15345. d.prototype.tagVisibleOnCurrentFloor = function(e) {
  15346. return !(e === m.DOLLHOUSE || e === m.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15347. }
  15348. ,
  15349. d.prototype.offScreen = function(e, t) {
  15350. var i = e.getWorldPosition().project(t);
  15351. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15352. }
  15353. ,
  15354. d.viewportScale = function() {
  15355. return d.viewportWidth === $("#player").width() && d.viewportHeight === $("#player").height() || (d.viewportWidth = $("#player").width(),
  15356. d.viewportHeight = $("#player").height(),
  15357. d.currentViewportScale = Math.sqrt(Math.min(d.viewportWidth, d.viewportHeight) / g.tags.disc.scale.baseViewportSize)),
  15358. d.currentViewportScale
  15359. }
  15360. ,
  15361. R.exports = d
  15362. }
  15363. ).call(this, "/js/tag/tag.js")
  15364. }
  15365. , {
  15366. "../enum/Colors": 19,
  15367. "../enum/RenderLayers": 41,
  15368. "../enum/RenderOrder": 42,
  15369. "../enum/Viewmode": 51,
  15370. "../objects/Panorama": 148,
  15371. "../settings": 166,
  15372. "../shaders": 167,
  15373. "../util/common": 185,
  15374. "../util/easing": 186,
  15375. "../util/lerp": 188,
  15376. "../util/logger": 189,
  15377. "../util/math": 190,
  15378. "../util/texture": 194,
  15379. "../util/transitions": 195,
  15380. "./Billboard/Billboard": 119,
  15381. "./Billboard/BillboardEvent": 120,
  15382. events: 202,
  15383. three: 217
  15384. }],
  15385. 124: [function(M, R, e) {
  15386. (function(e) {
  15387. "use strict";
  15388. function t() {
  15389. this.tagState = T.IDLE,
  15390. this.intersectTag = null,
  15391. this.hoveredTag = null,
  15392. this.activeTag = null,
  15393. this.tagDiscs = [],
  15394. this.raycaster = new i.Raycaster,
  15395. this.modelManager = null,
  15396. this.player = null,
  15397. this.totaltags = 0,
  15398. this.navigatingViaTag = !1,
  15399. this.enabled = !1
  15400. }
  15401. 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"),
  15402. M("../enum/TagStates")), x = M("events").EventEmitter, S = new n(e);
  15403. r.extend(t, x),
  15404. t.prototype.init = function(e, t) {
  15405. this.modelManager = e,
  15406. this.player = t,
  15407. this.updateModel(),
  15408. this.bindEvents()
  15409. }
  15410. ,
  15411. t.prototype.update = function(e) {
  15412. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15413. }
  15414. ,
  15415. t.prototype.updateTags = function(e, t, i, n) {
  15416. for (var r in this.model.tags)
  15417. this.model.tags[r].update(e, t, i, n)
  15418. }
  15419. ,
  15420. t.prototype.updateModel = function() {
  15421. this.model = this.modelManager.getActiveModel(),
  15422. this.gettagsFromModel(),
  15423. this.totaltags = Object.keys(this.model.tags).length
  15424. }
  15425. ,
  15426. t.prototype.gettagsFromModel = function() {
  15427. for (var e in this.tagDiscs = [],
  15428. this.model.tags) {
  15429. var t = this.model.tags[e].disc;
  15430. t && this.tagDiscs.push(t)
  15431. }
  15432. }
  15433. ,
  15434. t.prototype.bindEvents = function() {
  15435. function e() {
  15436. Object.keys(this.model.tags).forEach(function(e) {
  15437. var t = this.model.tags[e];
  15438. t.bindEvents(),
  15439. t.billboard.on(y.LINK_CLICK, function(e) {
  15440. e.type === A.NAVIGATION && this.navigateViaLink(e.url)
  15441. }
  15442. .bind(this)),
  15443. t.billboard.on(y.IMAGE_OPENED, function() {
  15444. this.tagState = T.EXAMINE,
  15445. this.emit(y.IMAGE_OPENED)
  15446. }
  15447. .bind(this)),
  15448. t.billboard.on(v.CLOSING, this.dismissExaminedTag.bind(this))
  15449. }
  15450. .bind(this))
  15451. }
  15452. this.modelManager.on(_.ActiveModelChanged, this.updateModel.bind(this)),
  15453. this.modelManager.on(_.ActiveModelChanged, e.bind(this)),
  15454. this.player.on(w.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15455. this.player.on(w.PanoChosen, this.onPanoChange.bind(this)),
  15456. this.player.on(w.Ready, this.onPlayerReady.bind(this)),
  15457. this.player.on(w.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15458. this.player.on(w.WarpStarted, this.handleWarpStart.bind(this)),
  15459. this.player.on(w.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15460. e.call(this)
  15461. }
  15462. ,
  15463. t.prototype.navigateViaLink = function(e) {
  15464. var t = a.deserialize(e);
  15465. if (t)
  15466. if (t.mode === C.PANORAMA) {
  15467. try {
  15468. this.player.model.panos.get(t.panoId)
  15469. } catch (e) {
  15470. return void S.warn("Unable to find panorama location", t.panoId)
  15471. }
  15472. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, I.BLACK)
  15473. } else {
  15474. var i = {
  15475. cameraMode: t.mode,
  15476. position: t.position,
  15477. quaternion: t.quaternion,
  15478. scanId: t.panoId,
  15479. orthoZoom: t.zoom,
  15480. floorVisibility: t.floorVisibility,
  15481. thumbUrl: null,
  15482. name: null
  15483. };
  15484. this.player.flyToNewMode({
  15485. mode: t.mode,
  15486. duration: m.warp.outsideTime,
  15487. warpDest: new g(i),
  15488. force: !0
  15489. })
  15490. }
  15491. }
  15492. ,
  15493. t.prototype.handleWarpStart = function(e, t, i, n) {
  15494. this.dismissExaminedTag(),
  15495. t === I.BLACK && (null != n || (n = m.warp.teleportTime),
  15496. e && (i = E.END),
  15497. this.hideShowTagsForBlackoutStyle(i, n))
  15498. }
  15499. ,
  15500. t.prototype.handleWarpInterruption = function(e, t, i) {
  15501. null != i || (i = m.warp.teleportTime),
  15502. this.hideShowTagsForBlackoutStyle(t, i)
  15503. }
  15504. ,
  15505. t.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15506. var i = 0
  15507. , n = 0
  15508. , r = t / 2;
  15509. switch (null != e || (e = E.MIDDLE),
  15510. e) {
  15511. case E.END:
  15512. this.hideAlltags(r);
  15513. break;
  15514. case E.BEGINNING:
  15515. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15516. break;
  15517. case E.NONE:
  15518. break;
  15519. case E.MIDDLE:
  15520. n = i = r,
  15521. this.hideAlltags(n),
  15522. setTimeout(function() {
  15523. this.showAlltags(i)
  15524. }
  15525. .bind(this), n);
  15526. break;
  15527. case E.FADEIN:
  15528. setTimeout(function() {
  15529. this.showAlltags(r)
  15530. }
  15531. .bind(this), r)
  15532. }
  15533. }
  15534. ,
  15535. t.prototype.onPlayerModeChanging = function(e, t) {
  15536. t !== C.PANORAMA && this.dismissExaminedTag(),
  15537. t === C.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = C.OUTDOOR);
  15538. var i = t !== C.OUTDOOR;
  15539. i !== this.model.tagsShown && (i ? this.showAlltags(m.tags.startup.fadeInDuration) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15540. }
  15541. ,
  15542. t.prototype.onPanoChange = function(e, t) {
  15543. var i = this.navigatingViaTag;
  15544. if (this.navigatingViaTag = !1,
  15545. !i) {
  15546. this.dismissExaminedTag();
  15547. var n = e && !e.isAligned() ? C.OUTDOOR : C.PANORAMA
  15548. , r = t && !t.isAligned() ? C.OUTDOOR : C.PANORAMA;
  15549. n !== r && (r === C.PANORAMA ? this.showAlltags(m.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15550. }
  15551. }
  15552. ,
  15553. t.prototype.onPlayerReady = function(e, t, i) {
  15554. this.startAlltags(e, t ? i : null)
  15555. }
  15556. ,
  15557. t.prototype.onPlayerFlyingEnded = function(e, t) {
  15558. this.updateClosestTags(e)
  15559. }
  15560. ,
  15561. t.prototype.dismissExaminedTag = function() {
  15562. this.activeTag && this.tagState === T.EXAMINE && this.dismissActiveTag(),
  15563. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15564. this.hoveredTag = null)
  15565. }
  15566. ,
  15567. t.prototype.startAlltags = function(e, t) {
  15568. this.model.shouldShowtags = m.tags.enabled,
  15569. this.enabled = !0,
  15570. e || (this.showAlltags(m.tags.startup.fadeInDuration, m.tags.startup.fadeInDelay),
  15571. t && setTimeout(function() {
  15572. this.activateTag(this.model.getTagBySid(t))
  15573. }
  15574. .bind(this), m.tags.startup.fadeInDuration / 2))
  15575. }
  15576. ,
  15577. t.prototype.showAlltags = function(e, t, i) {
  15578. function n() {
  15579. ++o === this.totaltags && (this.model.tagsShown = !0,
  15580. r.resolve())
  15581. }
  15582. var r = $.Deferred();
  15583. if (!i && this.player.mode === C.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  15584. return r.resolve().promise();
  15585. var o = 0;
  15586. for (var a in this.model.tags) {
  15587. this.model.tags[a].show(e, t).done(n.bind(this))
  15588. }
  15589. return r.promise()
  15590. }
  15591. ,
  15592. t.prototype.hideAlltags = function(e, t) {
  15593. function i() {
  15594. ++r === this.totaltags && (this.model.tagsShown = !1,
  15595. n.resolve())
  15596. }
  15597. var n = $.Deferred()
  15598. , r = 0;
  15599. for (var o in this.model.tags) {
  15600. var a = this.model.tags[o];
  15601. a.hide(e, t).done(i.bind(this)),
  15602. a === this.activeTag && this.dismissActiveTag()
  15603. }
  15604. return n.promise()
  15605. }
  15606. ,
  15607. t.prototype.enableHovering = function() {
  15608. this.enabled = !0
  15609. }
  15610. ,
  15611. t.prototype.disableHovering = function() {
  15612. this.enabled = !1
  15613. }
  15614. ,
  15615. t.prototype.activateTag = function(e, t) {
  15616. t = t || T.EXAMINE,
  15617. this.activeTag = e,
  15618. this.activeTag.hoveringDisc = !0,
  15619. this.activeTag.setHoverState(t === T.EXAMINE),
  15620. this.tagState = t,
  15621. this.emit(b.TagActivated, e)
  15622. }
  15623. ,
  15624. t.prototype.dismissActiveTag = function() {
  15625. this.activeTag.hoveringDisc = !1,
  15626. this.activeTag.setFreeState(!0);
  15627. var e = this.activeTag;
  15628. this.activeTag = null,
  15629. this.tagState = T.IDLE,
  15630. this.emit(b.TagDismissed, e)
  15631. }
  15632. ,
  15633. t.prototype.clickedOnTag = function(e) {
  15634. var t = function() {
  15635. this.navigatingViaTag = !0,
  15636. this.activeTag.examine(this.player),
  15637. this.emit(b.TagNavigation, this.activeTag)
  15638. }
  15639. .bind(this);
  15640. return this.tagState !== T.EXAMINE ? (this.activateTag(this.intersectTag, T.EXAMINE),
  15641. this.activeTag = this.intersectTag,
  15642. t(),
  15643. !0) : (this.dismissActiveTag(),
  15644. !1)
  15645. }
  15646. ,
  15647. t.prototype.intersecttag = (s = new i.Vector3,
  15648. l = new i.Vector3,
  15649. c = new i.Vector3,
  15650. function(e, t, i) {
  15651. if (!this.enabled)
  15652. return null;
  15653. var n = null
  15654. , r = this.tagDiscs.filter(function(e) {
  15655. return e.parent.visible
  15656. });
  15657. if (0 < r.length) {
  15658. var o = this.model.floors.reduce(function(e, t) {
  15659. return t.hidden ? e : e.concat(t.collider.children)
  15660. }, r);
  15661. s.set(e.x, e.y, -1).unproject(i),
  15662. l.set(e.x, e.y, 1).unproject(i),
  15663. c.copy(l).sub(s).normalize(),
  15664. this.raycaster.set(s, c);
  15665. var a = this.raycaster.intersectObjects(o);
  15666. 0 < a.length && -1 !== r.indexOf(a[0].object) && (n = a[0].object.tag)
  15667. }
  15668. return this.intersectTag = n,
  15669. t && (this.activeTag && n !== this.activeTag && (this.tagState === T.BROWSE || this.tagState === T.EXAMINE && n) && this.dismissActiveTag(),
  15670. n && n !== this.activeTag && (n.listeners(v.ENTER).length < 1 && (n.billboard.on(v.ENTER, function() {
  15671. this.hoveredTag = n
  15672. }
  15673. .bind(this)),
  15674. n.billboard.on(v.LEAVE, function() {
  15675. this.hoveredTag = null
  15676. }
  15677. .bind(this))),
  15678. this.activateTag(n, T.BROWSE))),
  15679. n
  15680. }
  15681. ),
  15682. t.prototype.rankedtagInDirection = (h = [],
  15683. u = [],
  15684. d = new i.Vector3,
  15685. p = new i.Vector3,
  15686. f = new i.Vector3,
  15687. function(e, t, i, n) {
  15688. for (var r = 0, o = u.length = 0; o < this.closesttags.length; o++) {
  15689. var a = this.closesttags[o];
  15690. p.copy(a.position),
  15691. p.add(a.discPosition),
  15692. d.copy(t),
  15693. d.sub(p).negate(),
  15694. d.normalize();
  15695. var s = d.dot(n);
  15696. if (0 <= s && (f.copy(p),
  15697. f.project(i),
  15698. this.intersecttag(f, !1, i))) {
  15699. if (r >= h.length)
  15700. for (var l = 0; l < 64; l++)
  15701. h.push({
  15702. tag: a,
  15703. dot: s
  15704. });
  15705. var c = h[r];
  15706. c.tag = a,
  15707. c.dot = s,
  15708. c.position = math.projectPositionToCanvas(p, i),
  15709. u.push(c),
  15710. r++
  15711. }
  15712. }
  15713. return u.sort(function(e, t) {
  15714. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  15715. }),
  15716. e < u.length ? u[e].tag : null
  15717. }
  15718. ),
  15719. t.prototype.updateClosestTags = (o = new i.Vector3,
  15720. function(e) {
  15721. this.closesttags || (this.closesttags = []),
  15722. this.closesttags.length = 0;
  15723. var t = this.model.tags;
  15724. if (t)
  15725. for (var i in t)
  15726. if (t.hasOwnProperty(i)) {
  15727. var n = t[i]
  15728. , r = n.position;
  15729. o.copy(e),
  15730. o.sub(r).negate(),
  15731. o.lengthSq() < 30 && this.closesttags.push(n)
  15732. }
  15733. }
  15734. ),
  15735. R.exports = t
  15736. }
  15737. ).call(this, "/js/tag/tagManager.js")
  15738. }
  15739. , {
  15740. "../controls/serializer": 14,
  15741. "../enum/BlackoutStyle": 18,
  15742. "../enum/tagEvents": 32,
  15743. "../enum/ModelManagerEvents": 33,
  15744. "../enum/PlayerEvents": 40,
  15745. "../enum/TagStates": 44,
  15746. "../enum/Viewmode": 51,
  15747. "../enum/WarpStyle": 52,
  15748. "../objects/Snapshot": 153,
  15749. "../settings": 166,
  15750. "../util/common": 185,
  15751. "../util/lerp": 188,
  15752. "../util/logger": 189,
  15753. "./Billboard/BillboardEvent": 120,
  15754. "./Media/LinkType": 130,
  15755. "./Media/MediaEvent": 131,
  15756. events: 202,
  15757. three: 217
  15758. }],
  15759. 125: [function(r, o, e) {
  15760. (function(e) {
  15761. "use strict";
  15762. function t() {
  15763. this.embedWrapper = null,
  15764. this.embedElement = null
  15765. }
  15766. var i = r("../../util/ajax")
  15767. , a = r("./mediaSettings")
  15768. , n = r("../../settings")
  15769. , s = new (r("../../util/logger"))(e);
  15770. t.prototype.createDomElement = function() {
  15771. return this.embedWrapper = document.createElement("div"),
  15772. this.embedWrapper.classList.add("tag-embed"),
  15773. this.embedWrapper.classList.add("hidden"),
  15774. this.embedWrapper
  15775. }
  15776. ,
  15777. t.prototype.load = function(e) {
  15778. var t = "https://api.embedly.com/1/oembed?key=" + n.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + a.maxEmbedWidth;
  15779. return new Promise(function(r, o) {
  15780. i.get(t).then(function(e) {
  15781. if ((e = JSON.parse(e)).html && -1 === e.html.indexOf("<script")) {
  15782. this.embedWrapper.innerHTML = e.html;
  15783. var t = Math.min(e.width, a.maxEmbedWidth) || a.maxEmbedWidth;
  15784. if (this.embedWrapper.style.width = t + "px",
  15785. e.height) {
  15786. var i = e.height / e.width;
  15787. this.embedWrapper.style.height = t * i + "px"
  15788. }
  15789. this.embedElement = this.embedWrapper.firstChild;
  15790. var n = [];
  15791. try {
  15792. n = [].slice.call(this.embedElement.querySelectorAll("a"))
  15793. } catch (e) {
  15794. s.debug("Error getting `a` elements for embed; was it an iframe?")
  15795. }
  15796. n.forEach(function(e) {
  15797. e.setAttribute("target", "_blank")
  15798. }),
  15799. this.embedElement.classList.add("hidden"),
  15800. this.embedWrapper.classList.remove("hidden"),
  15801. r()
  15802. } else
  15803. o("Not a valid embed")
  15804. }
  15805. .bind(this), function(e) {
  15806. o(e.response)
  15807. })
  15808. }
  15809. .bind(this))
  15810. }
  15811. ,
  15812. t.prototype.show = function() {
  15813. this.embedElement && this.embedElement.classList.remove("hidden")
  15814. }
  15815. ,
  15816. t.prototype.hide = function() {
  15817. this.embedElement && this.embedElement.classList.add("hidden")
  15818. }
  15819. ,
  15820. o.exports = t
  15821. }
  15822. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  15823. }
  15824. , {
  15825. "../../settings": 166,
  15826. "../../util/ajax": 181,
  15827. "../../util/logger": 189,
  15828. "./mediaSettings": 132
  15829. }],
  15830. 126: [function(a, s, e) {
  15831. (function(e) {
  15832. "use strict";
  15833. function t(e) {
  15834. r.call(this),
  15835. this.options = e,
  15836. this.playerControls = null,
  15837. this.state = o.NOT_READY
  15838. }
  15839. var i, n = a("../../util/browser"), r = a("./EmbedlyEmbed"), o = (new (a("../../util/logger"))(e),
  15840. Object.freeze({
  15841. NOT_READY: "player.not.ready",
  15842. CUED: "player.cued",
  15843. PLAYING: "player.playing",
  15844. PAUSED: "player.paused"
  15845. }));
  15846. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15847. return this.embedWrapper = document.createElement("div"),
  15848. this.embedWrapper.classList.add("tag-video"),
  15849. this.embedWrapper.classList.add("hidden"),
  15850. this.embedWrapper
  15851. }
  15852. ,
  15853. t.prototype.load = function(e) {
  15854. var t = function() {
  15855. function e(e) {
  15856. this.playerState = e
  15857. }
  15858. this.playerControls = new playerjs.Player(this.embedElement),
  15859. this.playerControls.on("ready", function(e) {
  15860. this.playerState = o.CUED,
  15861. this.options.startMuted && this.playerControls.mute()
  15862. }
  15863. .bind(this)),
  15864. this.playerControls.on("play", e.bind(this, o.PLAYING)),
  15865. this.playerControls.on("pause", e.bind(this, o.PAUSED)),
  15866. this.playerControls.on("ended", function(e) {
  15867. this.playerControls.setCurrentTime(0),
  15868. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  15869. }
  15870. .bind(this))
  15871. }
  15872. .bind(this);
  15873. return r.prototype.load.call(this, e).then(t.bind(this))
  15874. }
  15875. ,
  15876. t.prototype.play = (i = n.isMobile(),
  15877. function() {
  15878. this.playerState !== o.NOT_READY && this.playerControls && !i && (this.state === o.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  15879. }
  15880. ),
  15881. t.prototype.pause = function() {
  15882. this.playerState !== o.NOT_READY && this.playerControls && this.playerControls.pause()
  15883. }
  15884. ,
  15885. s.exports = t
  15886. }
  15887. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  15888. }
  15889. , {
  15890. "../../util/browser": 182,
  15891. "../../util/logger": 189,
  15892. "./EmbedlyEmbed": 125
  15893. }],
  15894. 127: [function(t, i, e) {
  15895. (function(e) {
  15896. "use strict";
  15897. var r = t("../../util/ajax")
  15898. , o = new (t("./mediaSettings"),
  15899. t("../../util/logger"))(e)
  15900. , a = Promise.resolve();
  15901. i.exports.enqueue = function(i) {
  15902. function n() {}
  15903. return a = new Promise(function(e, t) {
  15904. a.catch(n).then(function() {
  15905. (o.debug("requesting file from embedly:", i.href),
  15906. r.get(i.href, {
  15907. responseType: i.responseType
  15908. }).then(function(e) {
  15909. return o.debug("requesting file finished:", i.href),
  15910. e
  15911. })).then(e, t)
  15912. })
  15913. }
  15914. )
  15915. }
  15916. }
  15917. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  15918. }
  15919. , {
  15920. "../../util/ajax": 181,
  15921. "../../util/logger": 189,
  15922. "./mediaSettings": 132
  15923. }],
  15924. 128: [function(s, l, e) {
  15925. (function(e) {
  15926. "use strict";
  15927. function t() {
  15928. this.imageWrapper = null,
  15929. this.width = 0,
  15930. this.height = 0,
  15931. this.aspect = 1
  15932. }
  15933. var i = s("./MediaEvent")
  15934. , n = s("./EmbedlyQueue")
  15935. , r = s("events").EventEmitter
  15936. , o = s("../../util/logger")
  15937. , a = s("../../settings");
  15938. new o(e),
  15939. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15940. return this.imageWrapper = document.createElement("div"),
  15941. this.imageWrapper.classList.add("tag-image"),
  15942. this.imageWrapper.classList.add("hidden"),
  15943. this.imageWrapper.addEventListener("click", function(e) {
  15944. e.stopPropagation(),
  15945. this.emit(i.IMAGE_OPENING),
  15946. this.imageWrapper.style.pointerEvents = "none"
  15947. }
  15948. .bind(this)),
  15949. this.imageWrapper
  15950. }
  15951. ,
  15952. t.prototype.onClosed = function() {
  15953. this.imageWrapper.style.pointerEvents = "auto"
  15954. }
  15955. ,
  15956. t.prototype.load = function(e) {
  15957. var t = Math.max(window.screen.height, window.screen.width)
  15958. , i = "https://i.embed.ly/1/display/resize?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  15959. return new Promise(function(o, e) {
  15960. n.enqueue({
  15961. href: i,
  15962. responseType: "arraybuffer"
  15963. }).then(function(e) {
  15964. var t = new Uint8Array(e)
  15965. , i = new Blob([t])
  15966. , n = new window.Image;
  15967. n.addEventListener("load", function(e) {
  15968. var t = e.target;
  15969. this.width = t.naturalWidth,
  15970. this.height = t.naturalHeight,
  15971. this.aspect = this.width / this.height;
  15972. var i = e.target.src;
  15973. this.imageWrapper.style.backgroundImage = 'url("' + i + '")',
  15974. this.imageWrapper.style.width = this.width + "px",
  15975. this.imageWrapper.style.height = this.height + "px",
  15976. this.imageWrapper.classList.remove("hidden"),
  15977. o()
  15978. }
  15979. .bind(this));
  15980. var r = URL.createObjectURL(i);
  15981. n.src = r
  15982. }
  15983. .bind(this), e)
  15984. }
  15985. .bind(this))
  15986. }
  15987. ,
  15988. l.exports = t
  15989. }
  15990. ).call(this, "/js/tag/Media/Image.js")
  15991. }
  15992. , {
  15993. "../../settings": 166,
  15994. "../../util/logger": 189,
  15995. "./EmbedlyQueue": 127,
  15996. "./MediaEvent": 131,
  15997. events: 202
  15998. }],
  15999. 129: [function(e, t, i) {
  16000. "use strict";
  16001. function n(e) {
  16002. this.label = e.label,
  16003. this.href = e.url,
  16004. this.type = this.updateLinkForType(),
  16005. this.domElement = null,
  16006. this.id = c++
  16007. }
  16008. var r = e("./LinkType")
  16009. , o = e("./MediaEvent")
  16010. , a = e("../../util/browser")
  16011. , s = e("../../analytics")
  16012. , l = e("events").EventEmitter
  16013. , c = 0;
  16014. (n.prototype = Object.create(l.prototype)).updateLinkForType = function() {
  16015. var e, t = a.valueFromHash("m") || a.valueFromHash("model");
  16016. 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,
  16017. new RegExp("[#&?]start=([^#&?]*)").exec(e)[1]),
  16018. r.NAVIGATION) : (this.href = this.href + "&play=1",
  16019. r.MODEL) : r.EXT_LINK
  16020. }
  16021. ;
  16022. var h = {};
  16023. n.prototype.createDomElement = function() {
  16024. if (this.domElement = document.createElement("a"),
  16025. this.domElement.classList.add("tag-link"),
  16026. this.domElement.textContent = this.label,
  16027. this.type === r.EXT_LINK) {
  16028. this.domElement.textContent += " ";
  16029. var e = document.createElement("i");
  16030. e.classList.add("icon-ext-link"),
  16031. e.title = "Link to external web site",
  16032. this.domElement.appendChild(e)
  16033. }
  16034. return this.domElement.addEventListener("click", function(e) {
  16035. switch (e.stopPropagation(),
  16036. h[this.id] = !0,
  16037. s.trackAlways("click_tag_link", {
  16038. link_type: this.type,
  16039. link_count: c,
  16040. links_clicked: Object.keys(h).length
  16041. }),
  16042. this.type) {
  16043. case r.MODEL:
  16044. window.location.replace(this.href);
  16045. break;
  16046. case r.EXT_LINK:
  16047. window.open(this.href, "_blank")
  16048. }
  16049. this.emit(o.LINK_CLICK, {
  16050. type: this.type,
  16051. url: this.href
  16052. })
  16053. }
  16054. .bind(this)),
  16055. this.domElement
  16056. }
  16057. ,
  16058. t.exports = n
  16059. }
  16060. , {
  16061. "../../analytics": 4,
  16062. "../../util/browser": 182,
  16063. "./LinkType": 130,
  16064. "./MediaEvent": 131,
  16065. events: 202
  16066. }],
  16067. 130: [function(e, t, i) {
  16068. "use strict";
  16069. t.exports = {
  16070. NAVIGATION: "navigation",
  16071. MODEL: "model",
  16072. EXT_LINK: "ext-link"
  16073. }
  16074. }
  16075. , {}],
  16076. 131: [function(e, t, i) {
  16077. "use strict";
  16078. t.exports = Object.freeze({
  16079. LINK_CLICK: "mtmedia.link",
  16080. IMAGE_LOADED: "mtmedia.image.loaded",
  16081. IMAGE_OPENING: "mtmedia.image.opening",
  16082. IMAGE_OPENED: "mtmedia.image.opened",
  16083. IMAGE_CLOSING: "mtmedia.image.closing",
  16084. IMAGE_CLOSED: "mtmedia.image.closed",
  16085. VIDEO_START: "mtmedia.video.start",
  16086. VIDEO_PAUSE: "mtmedia.video.pause",
  16087. VIDEO_ENDED: "mtmedia.video.end"
  16088. })
  16089. }
  16090. , {}],
  16091. 132: [function(e, t, i) {
  16092. "use strict";
  16093. t.exports = Object.freeze({
  16094. maxEmbedWidth: 350,
  16095. defaultAspectRatio: .75
  16096. })
  16097. }
  16098. , {}],
  16099. 133: [function(e, t, i) {
  16100. "use strict";
  16101. t.exports = Object.freeze({
  16102. TEXT: "text",
  16103. LINK: "link",
  16104. IMAGE: "photo",
  16105. VIDEO: "video",
  16106. RICH: "rich"
  16107. })
  16108. }
  16109. , {}],
  16110. 134: [function(e, t, i) {
  16111. "use strict";
  16112. function n(e) {
  16113. this.capabilities = {
  16114. links: {
  16115. enable: e.supportLinks,
  16116. keepLabels: e.keepLinkLabels
  16117. }
  16118. }
  16119. }
  16120. var r = e("./DescriptionChunkType");
  16121. n.prototype.parse = function(e, i) {
  16122. var n = [];
  16123. return e.split("[").map(function(e, t) {
  16124. return 0 === t ? e : "[" + e
  16125. }).forEach(function(e) {
  16126. var t = this.findMarkdown(e);
  16127. if (t) {
  16128. if (-1 !== t.url.indexOf("javascript:"))
  16129. return;
  16130. this.addLinkChunk(n, t, i),
  16131. this.addTextChunk(n, e.slice(t.markdown.length))
  16132. } else
  16133. this.addTextChunk(n, e)
  16134. }
  16135. .bind(this)),
  16136. n
  16137. }
  16138. ,
  16139. n.prototype.findMarkdown = function(e) {
  16140. var t = e.match(/\[([^\]]*)\]\((.*)\)/);
  16141. if (t) {
  16142. for (var i = t[2], n = 1, r = 0; r < i.length && ("(" === i[r] ? n++ : ")" === i[r] && n--,
  16143. 0 !== n); )
  16144. r++;
  16145. var o = i.length - r;
  16146. return {
  16147. markdown: t[0].substring(0, t[0].length - o),
  16148. label: t[1],
  16149. url: t[2].substring(0, r)
  16150. }
  16151. }
  16152. }
  16153. ,
  16154. n.prototype.addTextChunk = function(e, t) {
  16155. 0 !== t.length && e.push({
  16156. type: r.TEXT,
  16157. text: t
  16158. })
  16159. }
  16160. ,
  16161. n.prototype.addLinkChunk = function(e, t) {
  16162. if (this.capabilities.links.enable) {
  16163. var i = {
  16164. label: t.label,
  16165. url: t.url
  16166. };
  16167. -1 === i.url.indexOf("://") && (i.url = "http://" + i.url),
  16168. e.push({
  16169. type: r.LINK,
  16170. link: i
  16171. })
  16172. } else
  16173. this.capabilities.links.keepLabels && this.addTextChunk(e, t.label)
  16174. }
  16175. ,
  16176. t.exports = n
  16177. }
  16178. , {
  16179. "./DescriptionChunkType": 133
  16180. }],
  16181. 135: [function(t, r, e) {
  16182. (function(e) {
  16183. "use strict";
  16184. var i = new (t("../util/logger"))(e)
  16185. , n = {
  16186. parseIdsFromChunkName: function(e, t) {
  16187. t.floorId = n.parseFloor(e),
  16188. t.roomId = n.parseRoom(e)
  16189. },
  16190. parseFloor: function(e) {
  16191. var t = e.match(/_group([0-9]+)/);
  16192. if (!t)
  16193. return 0;
  16194. try {
  16195. return parseInt(t[1], 10)
  16196. } catch (e) {
  16197. return i.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16198. 0
  16199. }
  16200. },
  16201. parseRoom: function(e) {
  16202. var t = e.match(/_sub([0-9]+)/);
  16203. if (!t)
  16204. return -1;
  16205. try {
  16206. return parseInt(t[1], 10)
  16207. } catch (e) {
  16208. return i.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16209. 0
  16210. }
  16211. }
  16212. };
  16213. r.exports = n
  16214. }
  16215. ).call(this, "/js/model/Chunks.js")
  16216. }
  16217. , {
  16218. "../util/logger": 189
  16219. }],
  16220. 136: [function(a, c, e) {
  16221. (function(e) {
  16222. "use strict";
  16223. function t(e) {
  16224. r.call(this),
  16225. this.model = e,
  16226. this.exploded = !1
  16227. }
  16228. var i = a("../objects/Floor")
  16229. , n = (a("../settings"),
  16230. a("../util/logger"))
  16231. , s = a("../util/transitions")
  16232. , r = a("../util/IndexedCollection")
  16233. , o = a("../util/common")
  16234. , l = a("../util/easing");
  16235. new n(e),
  16236. o.inherit(t, r),
  16237. t.prototype.add = function(e) {
  16238. r.prototype.add.call(this, e),
  16239. this.model.add(e)
  16240. }
  16241. ,
  16242. t.prototype.getIndex = function(e) {
  16243. return e.floorIndex
  16244. }
  16245. ,
  16246. t.prototype.build = function() {
  16247. this.list.forEach(function(e) {
  16248. e.build()
  16249. })
  16250. }
  16251. ,
  16252. t.prototype.size = function() {
  16253. return this.length
  16254. }
  16255. ,
  16256. t.prototype.sort = function() {
  16257. r.prototype.sort.call(this, function(e, t) {
  16258. return e.floorIndex - t.floorIndex
  16259. })
  16260. }
  16261. ,
  16262. t.prototype.nextFloor = function(e, t) {
  16263. return this.index[e.floorIndex + t] || null
  16264. }
  16265. ,
  16266. t.prototype.getFloorAtPoint = function(e) {
  16267. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16268. var r = this.list[n]
  16269. , o = r.distanceToPoint(e);
  16270. (!t || o < i) && (i = o,
  16271. t = r)
  16272. }
  16273. return t
  16274. }
  16275. ,
  16276. t.prototype.getOrMakeFloor = function(e) {
  16277. var t = this.index[e];
  16278. return t || (t = new i(this.model,e),
  16279. this.add(t)),
  16280. t
  16281. }
  16282. ,
  16283. t.prototype.hide = function() {
  16284. this.list.forEach(function(e) {
  16285. e.hide()
  16286. })
  16287. }
  16288. ,
  16289. t.prototype.show = function() {
  16290. this.list.forEach(function(e) {
  16291. e.show()
  16292. })
  16293. }
  16294. ,
  16295. t.prototype.names = function() {
  16296. return this.list.reduce(function(e, t) {
  16297. return e.concat(t.name)
  16298. }, [])
  16299. }
  16300. ,
  16301. t.prototype.toggleExplodeHorizontal = function() {
  16302. function i(e, t) {
  16303. a.copy(e.position),
  16304. e.position.x = r[e.floorIndex] * t,
  16305. e.position.y = 1 * e.floorIndex * t,
  16306. a.sub(e.position).multiplyScalar(-1),
  16307. e.panos.forEach(function(e) {
  16308. e.translate(a)
  16309. })
  16310. }
  16311. var n, r = [], o = 0;
  16312. this.list.forEach(function(e, t, i) {
  16313. n = 0 < t ? Math.max(i[t - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16314. o += n,
  16315. r[t] = o
  16316. }),
  16317. r = r.map(function(e) {
  16318. return e - o / 2
  16319. });
  16320. var a = this.list[0].position.clone();
  16321. this.exploded ? this.list.forEach(function(t) {
  16322. s.start(function(e) {
  16323. i(t, 1 - e)
  16324. }, 1500, null, 0, l.easeOutExpo)
  16325. }) : this.list.forEach(function(t) {
  16326. s.start(function(e) {
  16327. i(t, e)
  16328. }, 1500, null, 0, l.easeOutExpo)
  16329. }),
  16330. this.exploded = !this.exploded
  16331. }
  16332. ,
  16333. t.prototype.toggleExplodeVertical = function() {
  16334. function i(e, t) {
  16335. var i = i.copy(e.position);
  16336. e.position.y = (5 * e.floorIndex - n.y / 2) * t,
  16337. i.sub(e.position).multiplyScalar(-1),
  16338. e.panos.forEach(function(e) {
  16339. e.translate(i)
  16340. })
  16341. }
  16342. var n = this.model.size;
  16343. this.list[0].position.clone(),
  16344. this.exploded ? this.list.forEach(function(t) {
  16345. s.start(function(e) {
  16346. i(t, 1 - e)
  16347. }, 1500, null, 0, l.easeOutExpo)
  16348. }) : this.list.forEach(function(t) {
  16349. s.start(function(e) {
  16350. i(t, e)
  16351. }, 1500, null, 0, l.easeOutExpo)
  16352. }),
  16353. this.exploded = !this.exploded
  16354. }
  16355. ,
  16356. c.exports = t
  16357. }
  16358. ).call(this, "/js/model/FloorCollection.js")
  16359. }
  16360. , {
  16361. "../objects/Floor": 146,
  16362. "../settings": 166,
  16363. "../util/IndexedCollection": 175,
  16364. "../util/common": 185,
  16365. "../util/easing": 186,
  16366. "../util/logger": 189,
  16367. "../util/transitions": 195
  16368. }],
  16369. 137: [function(r, o, e) {
  16370. (function(e) {
  16371. "use strict";
  16372. function h() {
  16373. n.call(this)
  16374. }
  16375. var u = r("../settings")
  16376. , t = r("../util/logger")
  16377. , d = r("../enum/Viewmode")
  16378. , p = r("../objects/Snapshot")
  16379. , i = (r("../util/math"),
  16380. r("../util/common"))
  16381. , n = r("../util/IndexedCollection")
  16382. , l = new t(e);
  16383. i.inherit(h, n),
  16384. h.prototype.getImage = function(e) {
  16385. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16386. }
  16387. ,
  16388. h.prototype.filterByModesAndReel = function(e, t) {
  16389. for (var i = [], n = 0; n < t.length; n += 1) {
  16390. var r = t[n]
  16391. , o = this.index[r.sid];
  16392. o && i.push(o)
  16393. }
  16394. var a = e[d.DOLLHOUSE]
  16395. , s = e[d.FLOORPLAN];
  16396. (i = i.filter(function(e) {
  16397. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16398. return !0;
  16399. var t;
  16400. try {
  16401. t = d.convertWorkshopModeInt(e.metadata.camera_mode)
  16402. } catch (e) {
  16403. return l.debug(e.message),
  16404. !1
  16405. }
  16406. return t === d.PANORAMA || t === d.FLOORPLAN && s || t === d.DOLLHOUSE && a
  16407. })).length !== this.list.length && l.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16408. this.list = i,
  16409. this.reIndex()
  16410. }
  16411. ,
  16412. h.prototype.getHeroLocations = function(panos) {//改 增加二级location
  16413. if (0 === this.list.length)
  16414. return [];
  16415. var locations = [];
  16416. var deal = (n, container)=>{
  16417. var r = n.thumbnail_signed_src,
  16418. o = n.name || "";
  16419. if (n.metadata && void 0 !== n.metadata.camera_quaternion) {
  16420. if (!u.show360Views.enabled && n.metadata.scan_id) {
  16421. var a = panos.get(n.metadata.scan_id);
  16422. if (a && !a.isAligned()) return
  16423. }
  16424. var s = d.convertWorkshopModeInt(n.metadata.camera_mode);
  16425. if (s === d.MESH) return
  16426. if(window.isLocal)var src = manage.dealURL(r)
  16427. else var src = "one" === g_version ? g_Prefix + r + "?" + randomTime().getTime() : r + "?" + randomTime().getTime()
  16428. var l = {
  16429. cameraMode: s,
  16430. position: n.metadata.camera_position,
  16431. quaternion: n.metadata.camera_quaternion,
  16432. zoom: n.metadata.zoom,
  16433. panoId: n.metadata.scan_id,
  16434. orthoZoom: n.metadata.ortho_zoom,
  16435. floorVisibility: void 0 !== n.metadata.floor_visibility ? n.metadata.floor_visibility.slice(0) : [],
  16436. thumbUrl: src,
  16437. name: h.filterImageName(o),
  16438. sid: n.sid
  16439. }
  16440. var item = new p(l);
  16441. item.momentTour = n.momentTour
  16442. item.dontRot = n.dontRot
  16443. item.rotTime = n.rotTime
  16444. container.push(item)
  16445. return item
  16446. }
  16447. }
  16448. this.list.forEach(image=>{
  16449. if(image.images){
  16450. var folder = $.extend({}, image )
  16451. folder.heroLocations = [];
  16452. image.images.list.forEach(child=>{
  16453. deal(child, folder.heroLocations);
  16454. })
  16455. folder.musicInfo = folder.musicInfo || {}
  16456. locations.push(folder)
  16457. delete folder.images;
  16458. delete folder.locations;
  16459. }else{
  16460. var item = deal(image, locations);
  16461. item.musicInfo = image.musicInfo || g_data2.tourAudio[item.sid] || {}//新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  16462. }
  16463. })
  16464. return locations
  16465. }
  16466. ,
  16467. h.prototype.getIndex = function(e) {
  16468. return e.sid
  16469. }
  16470. ,
  16471. h.filterImageName = function(e) {
  16472. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16473. }
  16474. ,
  16475. o.exports = h
  16476. }
  16477. ).call(this, "/js/model/ImageCollection.js")
  16478. }
  16479. , {
  16480. "../enum/Viewmode": 51,
  16481. "../objects/Snapshot": 153,
  16482. "../settings": 166,
  16483. "../util/IndexedCollection": 175,
  16484. "../util/common": 185,
  16485. "../util/logger": 189,
  16486. "../util/math": 190
  16487. }],
  16488. 138: [function(h, u, e) {
  16489. (function(e) {
  16490. "use strict";
  16491. function n() {
  16492. c.call(this)
  16493. }
  16494. var r = h("../label/Label")
  16495. , i = h("../settings")
  16496. , t = h("../util/logger")
  16497. , o = h("../util/math")
  16498. , a = h("../util/ajax")
  16499. , s = h("./RoomCollection")
  16500. , l = h("../util/common")
  16501. , c = h("../util/IndexedCollection");
  16502. new t(e),
  16503. l.inherit(n, c),
  16504. n.prototype.getIndex = function(e) {
  16505. return e.labelId
  16506. }
  16507. ,
  16508. n.prototype.associateWithRooms = function(e) {
  16509. this.forEach(function(t) {
  16510. e.forEach(function(e) {
  16511. e.roomId === t.roomId && (t.room = e)
  16512. })
  16513. })
  16514. }
  16515. ,
  16516. n.prototype.createFromLabelData = function(e) {
  16517. e.forEach(function(e) {
  16518. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16519. t = s.generateRoomId(e.floorId, t);
  16520. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16521. i.position = o.convertWorkshopVector(i.position),
  16522. this.add(i),
  16523. i.build()
  16524. }
  16525. .bind(this))
  16526. }
  16527. ,
  16528. n.prototype.load = function(e, t) {
  16529. return a.get(e, {
  16530. responseType: "json",
  16531. auth: t ? i.authorizationHeader : null
  16532. }).done(function(e) {
  16533. var t = [];
  16534. for (var i in e) {
  16535. var n = e[i];
  16536. t.push(n)
  16537. }
  16538. this.createFromLabelData(t)
  16539. }
  16540. .bind(this))
  16541. }
  16542. ,
  16543. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  16544. var t = -1;
  16545. if (e) {
  16546. if(typeof e == 'number'){
  16547. t = parseInt(e)
  16548. }else{
  16549. var i = e.split("_");
  16550. t = parseInt(i[0])
  16551. }
  16552. }
  16553. return t
  16554. }
  16555. ,
  16556. u.exports = n
  16557. }
  16558. ).call(this, "/js/model/LabelCollection.js")
  16559. }
  16560. , {
  16561. "../label/Label": 90,
  16562. "../settings": 166,
  16563. "../util/IndexedCollection": 175,
  16564. "../util/ajax": 181,
  16565. "../util/common": 185,
  16566. "../util/logger": 189,
  16567. "../util/math": 190,
  16568. "./RoomCollection": 141
  16569. }],
  16570. 139: [function(P, O, e) {
  16571. (function(e) {
  16572. "use strict";
  16573. function t(e, t) {
  16574. o.Object3D.call(this),
  16575. this.sid = window.number;//t.sid,
  16576. this.data = t,
  16577. this.options = e,
  16578. this.urls = new i(e.urlFiles),
  16579. this.isPublic = void 0 !== t.is_public && t.is_public,
  16580. //创建heroLocations
  16581. this.images = new E(this),
  16582. this.images.extend(t.images),
  16583. this.images.forEach((info)=>{
  16584. if(info.locations){
  16585. info.images = new E(this);
  16586. info.images.extend(info.locations)
  16587. }
  16588. })
  16589. this.heroLocations = []
  16590. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  16591. this.outdoorPanoLocations = [],
  16592. this.floors = new c(this),
  16593. this.floorsEnabled = void 0 === e.floors || e.floors,
  16594. this.changingFloor = !1,
  16595. this.chunks = [],
  16596. this.panos = new g,
  16597. this.colliders = [],
  16598. this.loadPanosPromise = null,
  16599. this.loadMeshTexturesPromise = null,
  16600. this.auxDataPromise = null,
  16601. this.meshTexturesLoaded = !1,
  16602. this.meshTextures = [],
  16603. this.tags = {},
  16604. this.tagsShown = !1,
  16605. this.shouldShowtags = !1,
  16606. this.has360Views = !1,
  16607. this.showingLabels = u.labels.enabled && t.player_options.labels,
  16608. this.supportedModes = {},
  16609. this.supportedModes[s.PANORAMA] = !0,
  16610. this.supportedModes[s.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && I.valueFromHash("dh", 1),
  16611. this.supportedModes[s.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && I.valueFromHash("dh", 1),
  16612. this.supportedModes[s.TRANSITIONING] = !0,
  16613. this.supportsTiles = this.configureTiling(),
  16614. this.supportsVR = window.DATA.supportsVR || false//!0,
  16615. this.mode = s.DOLLHOUSE,
  16616. this.size = null,
  16617. this.center = null,
  16618. this.boundingBox = new o.Box3,
  16619. this.currentFloor = null,
  16620. this.allFloorsVisible = !0,
  16621. this.projectedPano0 = null,
  16622. this.projectedPano1 = null,
  16623. this.floorsEnabled && t.floors && -1 !== t.floors.indexOf(",") && t.floors.split(",").forEach(function(e, t) {
  16624. this.addFloor(new r(this,t,e.trim()))
  16625. }
  16626. .bind(this)),
  16627. this.waitQueue = [],
  16628. this.on("load", function(e) {
  16629. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  16630. return !e.isLoadedCallback()
  16631. }),
  16632. 0 === this.waitQueue.length && this.emit("waiting-done"))
  16633. }
  16634. .bind(this)),
  16635. this.setupCustomProperties(),
  16636. this.hots = {}
  16637. }
  16638. var o = P("three")
  16639. , a = P("../util/ajax")
  16640. , i = P("../util/ModelUrls")
  16641. , n = P("../objects/BoundingTextureSkybox")
  16642. , s = P("../enum/Viewmode")
  16643. , l = P("../enum/RenderOrder")
  16644. , r = (P("../enum/AlignmentType"),
  16645. P("../objects/Floor"))
  16646. , c = P("./FloorCollection")
  16647. , h = P("../objects/Chunk")
  16648. , u = (P("../objects/Room"),
  16649. P("../objects/Snapshot"),
  16650. P("../label/Label"),
  16651. P("../util/math"),
  16652. P("../settings"))
  16653. , d = P("../shaders")
  16654. , p = P("../util/logger")
  16655. , f = (P("../tag/tag"),
  16656. P("../tag/tagManager"),
  16657. P("../objects/Panorama"))
  16658. , g = P("../util/PanoramaCollection")
  16659. , m = P("../loaders/ModelLoader")
  16660. , v = P("../loaders/ModelTextureLoader")
  16661. , y = P("../loaders/SweepDataLoader")
  16662. , A = P("../util/transitions")
  16663. , C = (P("../util/easing"),
  16664. P("../util/lerp"),
  16665. P("../util/common"))
  16666. , I = (P("../util/texture"),
  16667. P("./../util/browser"))
  16668. , E = P("./ImageCollection")
  16669. , _ = P("./RoomCollection")
  16670. , b = P("./LabelCollection")
  16671. , w = P("./Chunks")
  16672. , T = P("./../util/showcase")
  16673. , x = P("../exception/BasicException")
  16674. , S = (P("../constants"),
  16675. P("events").EventEmitter)
  16676. // , M = P("hot")
  16677. , R = new p(e);
  16678. t.prototype = Object.create(o.Object3D.prototype),
  16679. C.extend(t, S),
  16680. t.prototype.setupCustomProperties = function() {
  16681. var t = u.modelAlpha;
  16682. Object.defineProperty(this, "alpha", {
  16683. get: function() {
  16684. return t
  16685. },
  16686. set: function(e) {
  16687. t = e,
  16688. this.chunks.forEach(function(e) {
  16689. e.material && e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = t)
  16690. })
  16691. }
  16692. })
  16693. }
  16694. ,
  16695. t.prototype.configureTiling = function() {
  16696. var e = function() {
  16697. try {
  16698. var e = document.createElement("canvas")
  16699. , t = e.getContext("webgl");
  16700. return (t = t || e.getContext("experimental-webgl")).getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  16701. } catch (e) {
  16702. return 0
  16703. }
  16704. }();
  16705. if (e < 2048)
  16706. return !1;
  16707. R.warn("Max cube texture size: " + e);
  16708. for (var t = 0; t < u.tiling.tilingFlagNames.length; t++) {
  16709. var i = u.tiling.tilingFlagNames[t];
  16710. if ("1" === I.valueFromHash(i, null))
  16711. return !0;
  16712. if ("0" === I.valueFromHash(i, null))
  16713. return !1
  16714. }
  16715. return !!T.modelDataPromisesTiles(this.data)
  16716. }
  16717. ,
  16718. t.prototype.toggleAlpha = function() {
  16719. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  16720. }
  16721. ,
  16722. t.prototype.load = function(e) {
  16723. var t = this.urls.init().then(function() {
  16724. return $.when(this.loadPanos(), this.loadMesh())
  16725. }
  16726. .bind(this));
  16727. return e ? t = t.then(this.loadMeshTextures.bind(this)) : t.then(this.loadMeshTextures.bind(this)),
  16728. this.auxDataPromise = $.when(this.loadhots(), this.loadLabels()),
  16729. $.when(t, this.auxDataPromise).done(this.build.bind(this))
  16730. }
  16731. ,
  16732. t.prototype.loadMesh = function() {
  16733. var n = $.Deferred()
  16734. , r = this;
  16735. return m.load(r.data.job.uuid, r.urls, function(e, t) {
  16736. if (0 === e.length) {
  16737. R.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  16738. r.supportedModes[s.DOLLHOUSE] = !1,
  16739. r.supportedModes[s.FLOORPLAN] = !1;
  16740. var i = new h({
  16741. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  16742. });
  16743. i.material.visible = !1,
  16744. i.rotateX(-Math.PI / 2),
  16745. i.geometry.computeBoundingBox(),
  16746. e = [i]
  16747. }
  16748. e.forEach(function(e) {
  16749. var t = r.floorsEnabled ? w.parseFloor(e.name) : 0;
  16750. r.addChunk(t, e)
  16751. }),
  16752. r.floors.sort(),
  16753. n.resolve(r)
  16754. }, function(e, t) {
  16755. n.notify(e, t)
  16756. }, function(e) {
  16757. R.error(e),
  16758. n.reject("loading-failed")
  16759. }),
  16760. n.promise()
  16761. }
  16762. ,
  16763. t.prototype.loadMeshTextures = function() {
  16764. return this.loadTexturesPromise || (this.loadTexturesPromise = v.load(this, this.meshTextures).then(function() {
  16765. this.meshTexturesLoaded = !0
  16766. }
  16767. .bind(this))),
  16768. this.loadTexturesPromise
  16769. }
  16770. ,
  16771. t.prototype.loadhots = function() {
  16772. initHot(this)
  16773. var r = $.Deferred()
  16774. , e = g_Prefix + "data/" + this.sid + "/data2.js?" + randomTime().getTime();
  16775. return a.get(e, {
  16776. responseType: "json",
  16777. auth: this.isPublic ? null : u.authorizationHeader
  16778. }).done(function(e) {
  16779. window.data2 = e;
  16780. editTool.loadDone('data2', e)
  16781. if(!e){
  16782. console.error("data2 is null")
  16783. }else{
  16784. g_data2 = hotMatcher(e)
  16785. this.hotsCount = 0;
  16786. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  16787. //window.hotData = {}
  16788. /* if(e.hots){
  16789. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  16790. sids.forEach((sid)=>{
  16791. this.hotsCount++,
  16792. this.hots[sid] = new M(sid,e.hots[sid] ,this);
  16793. //e.hots[sid].infoAttribute || (e.hots[sid].infoAttribute = {})
  16794. //this.hots[sid].initStyleImg(e.hots[sid].infoAttribute);
  16795. window.hotData[sid] = e.hots[sid];
  16796. })
  16797. }*/
  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. e.hots[sid].sid = sid
  16802. new Hot(e.hots[sid], e.hots[sid].version != 'multi' && "byHot" )
  16803. })
  16804. }
  16805. if(e.overlays){
  16806. e.overlays.forEach((info)=>{
  16807. new Hot(info, 'byOverlay')
  16808. })
  16809. }
  16810. Hot.createHotList();
  16811. /* if(e.multiOverlays){
  16812. e.multiOverlays.forEach((info)=>{
  16813. new Hot(info)
  16814. })
  16815. }) */
  16816. Hot.startLoad()
  16817. e.weixinDesc && (g_weixinObj.desc = e.weixinDesc)
  16818. }
  16819. r.resolve()
  16820. }
  16821. .bind(this)).fail(function() {
  16822. console.log("没有热点"),
  16823. editTool.loadDone('data2', null)
  16824. r.resolve()
  16825. }),
  16826. r
  16827. }
  16828. ,
  16829. t.prototype.loadPanos = function() {
  16830. if (this.loadPanosPromise)
  16831. return this.loadPanosPromise;
  16832. var e = new y(this);
  16833. return this.loadPanosPromise = e.load().then(function(e) {
  16834. window.panoListOriData = e.map(a=>a.uuid) //包括!enabled的点
  16835. return this.data.sweeps && 0 < Object.keys(this.data.sweeps).length && (e = e.filter(function(e) {
  16836. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  16837. else console.log(e.uuid)
  16838. //return this.data.sototype.loadOverlaysweeps[e.uuid].enabled
  16839. }
  16840. .bind(this))),
  16841. this.panos.extend(e.map(function(e) {
  16842. return new f(this,e.uuid,e,this.supportsTiles)
  16843. }
  16844. .bind(this))),
  16845. this.panos.forEach(function(i) {
  16846. i.neighbourUUIDs && (i.neighbourUUIDs.forEach(function(e) {
  16847. var t = this.panos.get(e);
  16848. t && this.panos.setNeighbour(i, t, !0)
  16849. }
  16850. .bind(this)),
  16851. i.neighbourPanos = this.panos.getNeighbours(i) || this.panos.setNeighbour(i, i, !0))
  16852. }
  16853. .bind(this)),
  16854. 0 === this.panos.length && (R.warn("Model has no panos, turning off inside mode"),
  16855. this.supportedModes[s.PANORAMA] = !1),
  16856. $.when(this)
  16857. }
  16858. .bind(this)),
  16859. this.loadPanosPromise
  16860. }
  16861. ,
  16862. t.prototype.loadHighlightReel = function() {
  16863. var t = $.Deferred()
  16864. , e = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  16865. return a.get(e, {
  16866. responseType: "json",
  16867. auth: this.isPublic ? null : u.authorizationHeader
  16868. }).done(function(e) {
  16869. e.reel ? (R.info("Got highlight reel with " + e.reel.length + " items"),
  16870. this.images.filterByModesAndReel(this.supportedModes, e.reel)) : R.info("No highlight reel found"),
  16871. t.resolve()
  16872. }
  16873. .bind(this)).fail(function() {
  16874. R.warn("Getting highlight reel failed, no highlights available"),
  16875. t.resolve()
  16876. }),
  16877. t
  16878. }
  16879. ,
  16880. t.prototype.waitForLoad = function(e, t) {
  16881. t() || (this.waitQueue.push({
  16882. object: e,
  16883. isLoadedCallback: t
  16884. }),
  16885. 1 === this.waitQueue.length && this.emit("waiting"))
  16886. }
  16887. ,
  16888. t.prototype.hide = function() {
  16889. this.floors.hide()
  16890. }
  16891. ,
  16892. t.prototype.show = function() {
  16893. this.floors.show()
  16894. }
  16895. ,
  16896. t.prototype.floorNames = function() {
  16897. return this.floors.names()
  16898. }
  16899. ,
  16900. t.prototype.warpDestFloors = function(e, t) {
  16901. if (e && this.floors.length === e.length) {
  16902. var i = e.findIndex(function(e) {
  16903. return e
  16904. }
  16905. .bind(this));
  16906. -1 !== i && this.setFloor(this.floors.list[i], null, t)
  16907. } else
  16908. this.toggleAllFloors(!0)
  16909. }
  16910. ,
  16911. t.prototype.setFloor = function(e, t, i) {
  16912. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  16913. this.allFloorsVisible = !1,
  16914. this._setFloor(e, t, i)
  16915. }
  16916. ,
  16917. t.prototype.toggleAllFloors = function(e) {
  16918. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  16919. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  16920. this._setFloor(this.currentFloor)
  16921. }
  16922. ,
  16923. t.prototype._setFloor = function(e, t, i) {
  16924. var n;
  16925. if (t = t || this.mode,
  16926. this.emit("floor.changed", e, t, this.currentFloor),
  16927. this.currentFloor = e,
  16928. t === s.PANORAMA) {
  16929. if (this.show(),
  16930. this.shouldShowtags && this.tagsShown)
  16931. for (n in this.tags)
  16932. this.tags[n].show(u.showFloorDuration)
  16933. } else if ((t === s.FLOORPLAN || t === s.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  16934. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  16935. }
  16936. .bind(this)),
  16937. this.shouldShowtags && this.tagsShown))
  16938. for (n in this.tags) {
  16939. var r = this.tags[n];
  16940. this.allFloorsVisible ? r.show(u.showFloorDuration) : r.floor === this.currentFloor ? r.show(u.showFloorDuration, u.showFloorDelay) : r.hide(u.hideFloorDuration, u.hideFloorDelay)
  16941. }
  16942. var o = this
  16943. , a = e;
  16944. A.start(function() {}, u.showFloorDelay, function() {
  16945. o.floors.forEach(function(t) {
  16946. t.chunks.forEach(function(e) {
  16947. e.renderOrder = t === a ? l.visibleFloor : l.ghostFloor
  16948. })
  16949. })
  16950. }
  16951. .bind(this))
  16952. }
  16953. ,
  16954. t.prototype.toggleExplode = function() {
  16955. this.floors.toggleExplodeHorizontal()
  16956. }
  16957. ,
  16958. t.prototype.toggleExplodeUp = function() {
  16959. this.floors.toggleExplodeVertical()
  16960. }
  16961. ,
  16962. t.prototype.nextFloor = function(e) {
  16963. return this.floors.nextFloor(this.currentFloor, e)
  16964. }
  16965. ,
  16966. t.prototype.addFloor = function(e) {
  16967. this.floors.add(e)
  16968. }
  16969. ,
  16970. t.prototype.getFloorAtPoint = function(e) {
  16971. return this.floors.getFloorAtPoint(e)
  16972. }
  16973. ,
  16974. t.prototype.getTagBySid = function(e) {
  16975. return this.tags[e]
  16976. }
  16977. ,
  16978. t.prototype.addChunk = function(e, t) {
  16979. this.floors.getOrMakeFloor(e).addChunk(t),
  16980. this.chunks.push(t)
  16981. }
  16982. ,
  16983. t.prototype.setMode = function(t) {
  16984. if (!this.supportedModes[t])
  16985. throw new x("Mode not supported for this model: " + t);
  16986. this.mode = t
  16987. this.skybox.material.transparent = t == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  16988. this.chunks.forEach(function(e) {
  16989. e.setMode(t)
  16990. })
  16991. }
  16992. ,
  16993. t.prototype.build = function() {
  16994. this.heroLocations = this.images.getHeroLocations(this.panos);
  16995. var e = function() {
  16996. 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()
  16997. }
  16998. .bind(this)();
  16999. for (var t in this.has360Views = u.show360Views.enabled && this.heroLocations.some(function(e) {
  17000. return e.cameraMode === s.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17001. }
  17002. .bind(this)) || e,
  17003. null === this.heroImage && R.warn("No hero image defined."),
  17004. this.currentFloor = this.floors.last(),
  17005. this.floors.build(),
  17006. this.colliders = this.floors.reduce(function(e, t) {
  17007. return e.concat(t.collider.children)
  17008. }, []),
  17009. this.panos.forEach(function(e) {
  17010. e.build1(),
  17011. e.on("enter", function() {
  17012. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17013. }
  17014. .bind(this))
  17015. }
  17016. .bind(this)),
  17017. this.panos.forEach(function(e) {
  17018. e.build2()
  17019. }),
  17020. this.floors.forEach(function(e) {
  17021. this.boundingBox.union(e.boundingBox)
  17022. }
  17023. .bind(this)),
  17024. this.size = this.boundingBox.size(),
  17025. this.center = this.boundingBox.center(),
  17026. this.floors.forEach(function(e) {
  17027. R.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17028. }
  17029. .bind(this)),
  17030. this.panos.populate_path_graph(),
  17031. this.skybox = new n(this.boundingBox),
  17032. this.skybox.matrixWorldNeedsUpdate = !0,
  17033. this.add(this.skybox),
  17034. setTimeout(function() {
  17035. //this.hotsCount && this.shineHots()
  17036. Hot.beginShineHot()
  17037. }
  17038. .bind(this), 1300),
  17039. this.tags)
  17040. this.tags[t].build();
  17041. //add-----
  17042. console.log('计算visiblePanos开始,可能需要一段时间')
  17043. for(let i in this.hots){
  17044. this.hots[i].setVisiblePanos(this.hots[i].info.visiblePanos);
  17045. }
  17046. console.log('计算visiblePanos完毕')
  17047. //---------
  17048. return R.debug("Done building model"),
  17049. 0 < f.raycastsDone && (R.warn("raycasts: " + f.raycastsDone),
  17050. R.warn("raycasts skipped: " + f.raycastsSkipped)),
  17051. this.buildRooms(),
  17052. this.labels.associateWithRooms(this.rooms),
  17053. $.when(this)
  17054. }
  17055. ,
  17056. t.prototype.loadLabels = function() {
  17057. this.labels = new b(this);
  17058. var e = $.Deferred();
  17059. window.DATA.showingLabels ? this.showingLabels = true : '';
  17060. if (!this.showingLabels)
  17061. return e.resolve();
  17062. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  17063. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  17064. R.warn("Getting labels failed, not displaying labels."),
  17065. e.resolve()
  17066. }),
  17067. e
  17068. }
  17069. ,
  17070. t.prototype.buildRooms = function() {
  17071. this.rooms = new _(this),
  17072. this.rooms.createFromChunks(this.chunks),
  17073. this.rooms.calcRoomBoundaries()
  17074. }
  17075. ,
  17076. t.prototype.updateProjectedPanos = function() {
  17077. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17078. }
  17079. ,
  17080. t.prototype.setProjectedPanos = function(t, i, n) {
  17081. null != n || (n = !0),
  17082. n = !!n,
  17083. this.projectedPano0 = t,
  17084. this.projectedPano1 = i,
  17085. this.skybox.material.setProjectedPanos(t, i, n),
  17086. this.chunks.forEach(function(e) {
  17087. e.materialInside.setProjectedPanos(t, i, n)
  17088. })
  17089. }
  17090. ,
  17091. t.prototype.setSide = function(t) {
  17092. this.floors.forEach(function(e) {
  17093. e.collider.material.side = t
  17094. })
  17095. }
  17096. ,
  17097. t.prototype.heroCount = function() {
  17098. return this.heroLocations ? this.heroLocations.length : 0
  17099. }
  17100. ,
  17101. t.prototype.getHeroDescriptorByIndex = function(e=[]) {//改 因增加了二级目录
  17102. if (e[0] < 0)
  17103. return R.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17104. null;
  17105. if (this.heroCount() < 1)
  17106. return R.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17107. null;
  17108. var t = this.heroLocations[e[0]];
  17109. if(t.heroLocations && e[1]!=void 0){
  17110. t = t.heroLocations[e[1]];
  17111. }
  17112. return void 0 === t ? (R.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17113. null) : t
  17114. }
  17115. ,
  17116. t.prototype.findPanoramicHero = function() {
  17117. for (var e in this.heroLocations)
  17118. if (this.heroLocations[e].cameraMode === s.PANORAMA)
  17119. return this.heroLocations[e];
  17120. return null
  17121. }
  17122. ,
  17123. t.prototype.listImagePanos = function() {
  17124. var i = []
  17125. , n = this;
  17126. return this.images.forEach(function(e) {
  17127. if (e.metadata && e.metadata.scan_id) {
  17128. var t = n.panos.get(e.metadata.scan_id);
  17129. t && (n.supportsTiles || t.isLoaded("high") || i.push(t))
  17130. }
  17131. }),
  17132. i
  17133. }
  17134. ,
  17135. t.prototype.fadePanoMarkers = function(e, t) {
  17136. this.panos.fadeMarkerOpacity(e, t)
  17137. }
  17138. ,
  17139. t.prototype.setSweepVisibility = function(t) {
  17140. this.panos.forEach(function(e) {
  17141. e.marker && (e.marker.visible = t)
  17142. })
  17143. }
  17144. ,
  17145. t.prototype.outsideAllowed = function() {
  17146. return this.supportedModes[s.DOLLHOUSE] && this.supportedModes[s.FLOORPLAN]
  17147. }
  17148. ,
  17149. O.exports = t
  17150. }
  17151. ).call(this, "/js/model/Model.js")
  17152. }
  17153. , {
  17154. "../constants": 8,
  17155. "../enum/AlignmentType": 17,
  17156. "../enum/RenderOrder": 42,
  17157. "../enum/Viewmode": 51,
  17158. "../exception/BasicException": 55,
  17159. "../label/Label": 90,
  17160. "../loaders/ModelLoader": 105,
  17161. "../loaders/ModelTextureLoader": 106,
  17162. "../loaders/SweepDataLoader": 107,
  17163. "../tag/tag": 123,
  17164. "../tag/tagManager": 124,
  17165. "../objects/BoundingTextureSkybox": 143,
  17166. "../objects/Chunk": 144,
  17167. "../objects/Floor": 146,
  17168. "../objects/Panorama": 148,
  17169. "../objects/Room": 150,
  17170. "../objects/Snapshot": 153,
  17171. "../settings": 166,
  17172. "../shaders": 167,
  17173. "../util/ModelUrls": 177,
  17174. "../util/PanoramaCollection": 178,
  17175. "../util/ajax": 181,
  17176. "../util/common": 185,
  17177. "../util/easing": 186,
  17178. "../util/lerp": 188,
  17179. "../util/logger": 189,
  17180. "../util/math": 190,
  17181. "../util/texture": 194,
  17182. "../util/transitions": 195,
  17183. "./../util/browser": 182,
  17184. "./../util/showcase": 193,
  17185. "./Chunks": 135,
  17186. "./FloorCollection": 136,
  17187. "./ImageCollection": 137,
  17188. "./LabelCollection": 138,
  17189. "./RoomCollection": 141,
  17190. events: 202,
  17191. three: 217,
  17192. //hot: "hot"
  17193. }],
  17194. 140: [function(e, t, i) {
  17195. "use strict";
  17196. function n() {
  17197. this.modelMap = {},
  17198. this.activeModel = null,
  17199. this.modelCount = 0,
  17200. this.tileDownloader = null,
  17201. this.panoRenderer = null
  17202. }
  17203. var r = (e("three"),
  17204. e("../util/common"))
  17205. , o = e("../exception/BasicException")
  17206. , a = e("../enum/ModelManagerEvents")
  17207. , s = e("../enum/PanoRendererEvents")
  17208. , l = e("events").EventEmitter;
  17209. n.prototype.init = function(e, t, i) {
  17210. this.tileDownloader = e,
  17211. this.panoRenderer = t,
  17212. this.qualityManager = i,
  17213. this.bindEvents()
  17214. }
  17215. ,
  17216. n.prototype.bindEvents = function() {
  17217. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17218. }
  17219. ,
  17220. n.prototype.onTileRendered = function(e, t, i, n) {}
  17221. ,
  17222. n.prototype.addModel = function(e) {
  17223. this.modelMap[e.sid] = e,
  17224. 0 === this.modelCount && this.activateModel(e.sid),
  17225. this.modelCount++,
  17226. this.emit(a.ModelAdded)
  17227. }
  17228. ,
  17229. n.prototype.getModel = function(e) {
  17230. return this.modelMap[e]
  17231. }
  17232. ,
  17233. n.prototype.activateModel = function(e) {
  17234. var t = this.modelMap[e];
  17235. if (!t)
  17236. throw new o("Tried to activate invalid model!");
  17237. var i = this.activeModel;
  17238. this.activeModel = t,
  17239. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17240. this.tileDownloader.setUrls(t.urls),
  17241. t.panos.forEach(function(e) {
  17242. e.attachToPanoRenderer(this.panoRenderer),
  17243. e.tileDownloader = this.tileDownloader,
  17244. e.qualityManager = this.qualityManager
  17245. }
  17246. .bind(this)),
  17247. this.emit(a.ActiveModelChanged, {
  17248. oldModel: i,
  17249. model: t
  17250. })
  17251. }
  17252. ,
  17253. n.prototype.getActiveModel = function() {
  17254. return this.activeModel
  17255. }
  17256. ,
  17257. r.extend(n, l),
  17258. t.exports = n
  17259. }
  17260. , {
  17261. "../enum/ModelManagerEvents": 33,
  17262. "../enum/PanoRendererEvents": 35,
  17263. "../exception/BasicException": 55,
  17264. "../util/common": 185,
  17265. events: 202,
  17266. three: 217
  17267. }],
  17268. 141: [function(r, l, e) {
  17269. (function(e) {
  17270. "use strict";
  17271. function o() {
  17272. n.call(this)
  17273. }
  17274. var a = r("../objects/Room")
  17275. , t = (r("../settings"),
  17276. r("../util/logger"))
  17277. , i = (r("../util/transitions"),
  17278. r("../util/easing"),
  17279. r("../util/common"))
  17280. , n = r("../util/IndexedCollection")
  17281. , s = r("./Chunks");
  17282. new t(e),
  17283. i.inherit(o, n),
  17284. o.prototype.getIndex = function(e) {
  17285. return e.roomId
  17286. }
  17287. ,
  17288. o.prototype.calcRoomBoundaries = function() {
  17289. this.forEach(function(e) {
  17290. e.calcBoundaries()
  17291. })
  17292. }
  17293. ,
  17294. o.prototype.createFromChunks = function(e) {
  17295. var n = {
  17296. floorId: -1,
  17297. roomId: -1
  17298. }
  17299. , r = {};
  17300. e.forEach(function(e) {
  17301. s.parseIdsFromChunkName(e.name, n);
  17302. var t = r[n.roomId];
  17303. if (!t) {
  17304. var i = o.generateRoomId(n.floorId, n.roomId);
  17305. t = new a(n.floorId,i),
  17306. this.add(t),
  17307. r[n.roomId] = t
  17308. }
  17309. t.addChunk(e)
  17310. }
  17311. .bind(this)),
  17312. this.calcRoomBoundaries()
  17313. }
  17314. ,
  17315. o.generateRoomId = function(e, t) {
  17316. return e + "_" + t
  17317. }
  17318. ,
  17319. l.exports = o
  17320. }
  17321. ).call(this, "/js/model/RoomCollection.js")
  17322. }
  17323. , {
  17324. "../objects/Room": 150,
  17325. "../settings": 166,
  17326. "../util/IndexedCollection": 175,
  17327. "../util/common": 185,
  17328. "../util/easing": 186,
  17329. "../util/logger": 189,
  17330. "../util/transitions": 195,
  17331. "./Chunks": 135
  17332. }],
  17333. 142: [function(e, t, i) {
  17334. "use strict";
  17335. function n(e, t, i) {
  17336. var n = (e = e.clone().expandByScalar(0.01)).size()
  17337. , r = new o.BoxGeometry(n.x,n.y,n.z);
  17338. r.boundingBox = e,
  17339. o.Mesh.call(this, r, t),
  17340. this.position.copy(e.center()),
  17341. this.frustumCulled = !1,
  17342. i && this.add(new o.WireframeHelper(this))
  17343. }
  17344. var o = e("three");
  17345. (n.prototype = Object.create(o.Mesh.prototype)).constructor = n,
  17346. t.exports = n
  17347. }
  17348. , {
  17349. three: 217
  17350. }],
  17351. 143: [function(l, c, e) {
  17352. (function(e) {
  17353. "use strict";
  17354. function t(e) {
  17355. s.time("Computing a nice bounding cubemap");
  17356. var t = new r({
  17357. side: i.BackSide,
  17358. transparent: !0
  17359. });
  17360. t.uniforms.modelAlpha.value = 0,
  17361. t.uniforms.opacity.value = 1 - o.modelAlpha,
  17362. this.renderOrder = a.boundingSkybox,
  17363. n.call(this, e, t),
  17364. s.timeEnd("Computing a nice bounding cubemap")
  17365. }
  17366. var i = l("three")
  17367. , n = (l("../enum/Viewmode"),
  17368. l("../shaders"),
  17369. l("./BoundingMesh"))
  17370. , r = l("../materials/ModelTextureMaterial")
  17371. , o = l("../settings")
  17372. , a = l("../enum/RenderOrder")
  17373. , s = new (l("../util/logger"))(e);
  17374. (t.prototype = Object.create(n.prototype)).constructor = t,
  17375. c.exports = t
  17376. }
  17377. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17378. }
  17379. , {
  17380. "../enum/RenderOrder": 42,
  17381. "../enum/Viewmode": 51,
  17382. "../materials/ModelTextureMaterial": 118,
  17383. "../settings": 166,
  17384. "../shaders": 167,
  17385. "../util/logger": 189,
  17386. "./BoundingMesh": 142,
  17387. three: 217
  17388. }],
  17389. 144: [function(e, t, i) {
  17390. "use strict";
  17391. function n(e) {
  17392. this.materialInside = new s({
  17393. side: r.DoubleSide
  17394. });
  17395. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17396. this.materialOutside = new r.RawShaderMaterial({
  17397. fragmentShader: o.modelOutside.fragmentShader,
  17398. vertexShader: o.modelOutside.vertexShader,
  17399. uniforms: t,
  17400. side: r.FrontSide,
  17401. name: "chunkOut"
  17402. }),
  17403. r.Mesh.call(this, e.geometry, this.materialInside),
  17404. this.name = e.name || "",
  17405. this.textureName = e.textureName,
  17406. this.meshUrl = e.meshUrl
  17407. }
  17408. var r = e("three")
  17409. , o = e("../shaders")
  17410. , a = e("../enum/Viewmode")
  17411. , s = e("../materials/ModelTextureMaterial");
  17412. (n.prototype = Object.create(r.Mesh.prototype)).setTextureMap = function(e) {
  17413. this.materialInside.uniforms.map.value = e,
  17414. this.materialOutside.uniforms.map.value = e
  17415. }
  17416. ,
  17417. n.prototype.setMode = function(e) {
  17418. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17419. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17420. t.transparent = this.material.transparent,
  17421. t.uniforms.opacity.value = this.material.uniforms.opacity.value;
  17422. this.material = t
  17423. }
  17424. ,
  17425. t.exports = n
  17426. }
  17427. , {
  17428. "../enum/Viewmode": 51,
  17429. "../materials/ModelTextureMaterial": 118,
  17430. "../shaders": 167,
  17431. three: 217
  17432. }],
  17433. 145: [function(e, t, i) {
  17434. "use strict";
  17435. function n(e) {
  17436. this.chunksize = e || 10,
  17437. this.chunks = {},
  17438. this.boundingBoxes = {},
  17439. this.children = [],
  17440. this.offset = new m.Vector3(0,.5,0),
  17441. this.material = new m.MeshBasicMaterial({
  17442. color: 16777215 * Math.random(),
  17443. side: m.DoubleSide
  17444. })
  17445. }
  17446. var m = e("three");
  17447. e("../enum/Viewmode"),
  17448. n.prototype.add = function(e) {
  17449. var t, i, n, r, o, a, s, l, c, h, u = e.attributes;
  17450. u ? (t = u.position.array,
  17451. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  17452. e.faces);
  17453. var d = new m.Vector3;
  17454. if (i)
  17455. for (n = 0,
  17456. r = i.length; n < r; n += 3) {
  17457. var p = 3 * i[n]
  17458. , f = 3 * i[n + 1]
  17459. , g = 3 * i[n + 2];
  17460. o = (t[p] + t[f] + t[g]) / 3,
  17461. a = (t[1 + p] + t[1 + f] + t[1 + g]) / 3,
  17462. s = (t[2 + p] + t[2 + f] + t[2 + g]) / 3,
  17463. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17464. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17465. this.boundingBoxes[l] = new m.Box3),
  17466. 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]),
  17467. c.expandByPoint(d.set(t[p], t[1 + p], t[2 + p])),
  17468. c.expandByPoint(d.set(t[f], t[1 + f], t[2 + f])),
  17469. c.expandByPoint(d.set(t[g], t[1 + g], t[2 + g]))
  17470. }
  17471. else
  17472. for (n = 0,
  17473. r = t.length; n < r; n += 9)
  17474. o = (t[n] + t[n + 3] + t[n + 6]) / 3,
  17475. a = (t[n + 1] + t[n + 4] + t[n + 7]) / 3,
  17476. s = (t[n + 2] + t[n + 5] + t[n + 8]) / 3,
  17477. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17478. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17479. this.boundingBoxes[l] = new m.Box3),
  17480. 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]),
  17481. c.expandByPoint(d.set(t[n], t[n + 1], t[n + 2])),
  17482. c.expandByPoint(d.set(t[n + 3], t[n + 4], t[n + 5])),
  17483. c.expandByPoint(d.set(t[n + 6], t[n + 7], t[n + 8]))
  17484. }
  17485. ,
  17486. n.prototype.build = function() {
  17487. var e = new m.Object3D;
  17488. for (var t in e.material = this.material,
  17489. this.chunks) {
  17490. var i = this.chunks[t]
  17491. , n = new m.BufferGeometry;
  17492. n.addAttribute("position", new m.BufferAttribute(new Float32Array(i),3)),
  17493. n.boundingBox = this.boundingBoxes[t];
  17494. var r = new m.Mesh(n,this.material);
  17495. r.material.visible = !1,
  17496. e.add(r),
  17497. this.chunks[t] = []
  17498. }
  17499. return e
  17500. }
  17501. ,
  17502. t.exports = n
  17503. }
  17504. , {
  17505. "../enum/Viewmode": 51,
  17506. three: 217
  17507. }],
  17508. 146: [function(e, t, i) {
  17509. "use strict";
  17510. var n = e("three")
  17511. , r = e("../settings")
  17512. , o = e("../util/common")
  17513. , a = e("../util/lerp")
  17514. , s = e("./ChunkedCollider")
  17515. , l = e("../util/transitions")
  17516. , c = e("../util/easing")
  17517. , h = (e("../objects/Panorama"),
  17518. e("../enum/RenderOrder"));
  17519. e("../localization/localize");
  17520. function u(e, t, i) {
  17521. n.Object3D.call(this),
  17522. this.model = e,
  17523. this.floorIndex = t,
  17524. this.lang = r.languageTag,
  17525. this.name = i || "cn" === r.languageTag ? "Floor " + (t + 1) : "第" + (t + 1) + "层",
  17526. this.panos = [],
  17527. this.chunks = [],
  17528. this.colliderBuilder = new s(3),
  17529. this.collider = null,
  17530. this.center = null,
  17531. this.boundingBox = new n.Box3,
  17532. this.size = null,
  17533. this.hidden = !1,
  17534. this.conservativeBoundingBox = new n.Box3,
  17535. this.debugColor = 16777215 * Math.random(),
  17536. this.transition = null
  17537. }
  17538. (u.prototype = Object.create(n.Object3D.prototype)).enter = function(e) {
  17539. this.model.setFloor(this, e)
  17540. }
  17541. ,
  17542. u.prototype.hide = function(e) {
  17543. if (!this.hidden || this.transition) {
  17544. this.chunks.forEach(function(e) {
  17545. e.material.transparent = !0
  17546. }),
  17547. l.cancel(this.transition);
  17548. var t = e ? 0 : r.hideFloorDuration + r.hideFloorDelay
  17549. , i = e ? 0 : r.hideFloorDelay / t;
  17550. this.transition = l.start(a.allUniforms(this.chunks, "opacity", .08), t, function() {
  17551. this.hidden = !0
  17552. }
  17553. .bind(this), i, c.easeInOutQuad)
  17554. }
  17555. }
  17556. ,
  17557. u.prototype.show = function(e) {
  17558. if (this.hidden || this.transition) {
  17559. this.hidden = !1,
  17560. l.cancel(this.transition);
  17561. var t = e ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay
  17562. , i = e ? 0 : r.showFloorDelay / t;
  17563. this.transition = l.start(a.allUniforms(this.chunks, "opacity", 1), t, function() {
  17564. this.hidden || this.chunks.forEach(function(e) {
  17565. e.material.transparent = !1
  17566. })
  17567. }
  17568. .bind(this), i, c.easeInOutQuad)
  17569. }
  17570. }
  17571. ,
  17572. u.prototype.toggle = function(e, t) {
  17573. (e = void 0 === e ? this.hidden : e) ? this.show(t) : this.hide(t)
  17574. }
  17575. ,
  17576. u.prototype.containsPoint = function(t) {
  17577. return this.collider.children.some(function(e) {
  17578. return e.geometry.boundingBox || e.geometry.computeBoundingBox(),
  17579. e.geometry.boundingBox.containsPoint(t)
  17580. })
  17581. }
  17582. ,
  17583. u.prototype.distanceToPoint = function(i) {
  17584. var n = null
  17585. , r = 1 / 0;
  17586. return this.collider.children.forEach(function(e) {
  17587. e.geometry.boundingBox || e.geometry.computeBoundingBox();
  17588. var t = e.geometry.boundingBox.distanceToPoint(i);
  17589. (!n || t < r) && (r = t,
  17590. n = e)
  17591. }),
  17592. r
  17593. }
  17594. ,
  17595. u.prototype.addChunk = function(e) {
  17596. e.renderOrder = h.ghostFloor,
  17597. this.add(e),
  17598. this.chunks.push(e),
  17599. this.boundingBox.union(e.geometry.boundingBox),
  17600. this.size = this.boundingBox.size(),
  17601. this.colliderBuilder.add(e.geometry)
  17602. }
  17603. ,
  17604. u.prototype.addPano = function(e) {
  17605. this.panos.push(e),
  17606. this.add(e.skyboxMesh),
  17607. e.marker && this.add(e.marker);
  17608. if(e.neighbourUUIDs && e.neighbourUUIDs.length){//add 有相邻点才算入bound 因为拍摄有bug,会出现floorPosition为000,且position位置很偏的点,它们一般都是不可见点。
  17609. var t = new n.Vector3(1,1,1)
  17610. , i = (new n.Box3).setFromCenterAndSize(e.position, t);
  17611. this.boundingBox.union(i)
  17612. }
  17613. }
  17614. ,
  17615. u.prototype.build = function() {
  17616. this.collider = this.colliderBuilder.build(!0),
  17617. this.add(this.collider),
  17618. this.center = this.boundingBox.center(),
  17619. this.conservativeBoundingBox.copy(this.boundingBox),
  17620. this.conservativeBoundingBox.min.y = o.lowerMedian(this.collider.children.map(function(e) {
  17621. return e.geometry.boundingBox.min.y
  17622. }), 5),
  17623. this.conservativeBoundingBox.max.y = o.lowerMedian(this.collider.children.map(function(e) {
  17624. return e.geometry.boundingBox.max.y
  17625. }), 5),
  17626. this.colliderBuilder = null
  17627. }
  17628. ,
  17629. u.prototype.toShortString = function() {
  17630. return o.nth(this.floorIndex + 1)
  17631. }
  17632. ,
  17633. u.prototype.toString = function() {
  17634. return this.name
  17635. }
  17636. ,
  17637. t.exports = u
  17638. }
  17639. , {
  17640. "../enum/RenderOrder": 42,
  17641. "../localization/localize": 108,
  17642. "./strings-cn-CN": 109,
  17643. "../objects/Panorama": 148,
  17644. "../settings": 166,
  17645. "../util/common": 185,
  17646. "../util/easing": 186,
  17647. "../util/lerp": 188,
  17648. "../util/transitions": 195,
  17649. "./ChunkedCollider": 145,
  17650. three: 217
  17651. }],
  17652. 147: [function(e, t, i) {
  17653. "use strict";
  17654. function n(e) {
  17655. this.player = e,
  17656. this.obj3d = null,
  17657. this.UP = new u.Vector3(0,1,0)
  17658. }
  17659. var u = e("three")
  17660. , d = e("../settings");
  17661. n.prototype.prefs = {
  17662. linewidth: 3,
  17663. height: .07,
  17664. opacity: .45,
  17665. endScale: .05
  17666. },
  17667. n.prototype.discard = function() {
  17668. if (this.obj3d) {
  17669. var e = this.obj3d.parent;
  17670. e && e.remove(this.obj3d)
  17671. }
  17672. this.obj3d = null
  17673. }
  17674. ,
  17675. n.prototype.draw = function() {
  17676. if (this.discard(),
  17677. d.showNeighbors) {
  17678. var e = this.player.currentPano.floor;
  17679. this.obj3d = new u.Object3D;
  17680. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  17681. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  17682. i.y += this.prefs.height;
  17683. var n = .1525
  17684. , r = new u.Matrix4;
  17685. for (var o in t)
  17686. if (t[o]) {
  17687. var a = this.player.model.panos.get(o)
  17688. , s = (a.position.clone().sub(this.player.model.position),
  17689. a.position.clone().sub(a.floorPosition))
  17690. , l = a.floorPosition.clone().sub(this.player.model.position);
  17691. l.y += this.prefs.height;
  17692. var c = new u.Geometry;
  17693. 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)),
  17694. 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)),
  17695. r.identity().setPosition(s),
  17696. c.applyMatrix(r),
  17697. c.vertices.push(new u.Vector3(0,-this.prefs.endScale,0)),
  17698. 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)),
  17699. r.lookAt(l, i, this.UP).setPosition(l),
  17700. c.applyMatrix(r),
  17701. c.vertices.push(l, i);
  17702. var h = new u.Line(c,new u.LineBasicMaterial({
  17703. color: a.debugColor.getHex(),
  17704. transparent: !0,
  17705. opacity: this.prefs.opacity,
  17706. depthWrite: !1,
  17707. name: "sLine" + o,
  17708. linewidth: this.prefs.linewidth
  17709. }));
  17710. this.obj3d.add(h)
  17711. }
  17712. e.add(this.obj3d)
  17713. }
  17714. }
  17715. ,
  17716. n.prototype.update = function() {
  17717. d.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  17718. }
  17719. ,
  17720. t.exports = n
  17721. }
  17722. , {
  17723. "../settings": 166,
  17724. three: 217
  17725. }],
  17726. 148: [function(S, M, e) {
  17727. (function(e) {
  17728. "use strict";
  17729. function r(e, t, i, n) {
  17730. this.model = e,
  17731. this.id = t,
  17732. this.alignmentType = i.alignmentType || c.ALIGNED,
  17733. this.neighbourUUIDs = i.neighbours,
  17734. this.neighbourPanos = null,
  17735. this.floor = null,
  17736. this.floorIndex = i.floor,
  17737. this.failedLoadingAt = 0,
  17738. this.maxLoadRetries = 4,
  17739. this.origin = i.position.clone(),
  17740. this.position = this.alignmentType === c.UNALIGNED ? new s.Vector3(0,-5,0) : i.position.clone(),
  17741. this.quaternion = i.quaternion.clone(),
  17742. this.skyboxMesh = new s.Mesh(E),
  17743. this.skyboxMesh.position.copy(this.position),
  17744. this.skyboxMesh.quaternion.copy(this.quaternion),
  17745. this.skyboxMesh.name = "skybox",
  17746. this.skyboxMesh.visible = !1,
  17747. this.skyboxMesh.updateMatrix(),
  17748. this.skyboxMesh.updateMatrixWorld(),
  17749. this.marker = null,
  17750. this.showFloorMarker = this.showFloorMarker = !window.DATA.hideFloorMarker,
  17751. this.isAligned() && (this.marker = new s.Mesh(_,new s.MeshBasicMaterial({
  17752. map: b,
  17753. side: s.DoubleSide,
  17754. opacity: 0,
  17755. transparent: !0,
  17756. depthWrite: !1
  17757. })),
  17758. this.marker.visible = this.showFloorMarker,
  17759. this.marker.renderOrder = l.panoMarker,
  17760. this.marker.name = "marker",
  17761. (this.marker.pano = this).marker.layers.set(v.PANOMARKERS),
  17762. this.marker.updateMatrixWorld(),
  17763. a.colorMarkerOnLoad && this.on("load", function() {
  17764. this.marker.material.color.set(65280)
  17765. })),
  17766. this.debugColor = (new s.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  17767. this.floorPosition = i.puck ? i.puck.clone() : null,
  17768. this.tiled = n,
  17769. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new s.Texture([null, null, null, null, null, null]),
  17770. this.solidSkybox.flipY = !1,
  17771. a.minimalMemoryMode && (this.solidSkybox.minFilter = s.LinearFilter,
  17772. this.solidSkybox.magFilter = s.LinearFilter,
  17773. this.solidSkybox.generateMipmaps = !1)),
  17774. this.zoomed = !1,
  17775. this.panoRenderer = null,
  17776. this.qualityManager = null,
  17777. this.tileDownloader = null,
  17778. this.tiledPanoRenderTarget = null,
  17779. this.minimumTiledPanoLoaded = !1,
  17780. this.highestPartialTileRenderOpCompleted = 0,
  17781. this.highestFullTileRenderOpCompleted = 0,
  17782. this.shouldRedrawOnBaseLoaded = !1,
  17783. this.lockUntilRenderingComplete = !1,
  17784. a.colorMarkerOnLoad && this.on("load", function() {
  17785. this.marker.material.color.set(65280)
  17786. }),
  17787. (e = new s.TextureLoader).setCrossOrigin(!0);
  17788. var r = e.load("images/texture.jpg");
  17789. if (this.vrMarker = new s.Mesh(new s.OctahedronGeometry(.1,0),new s.MeshLambertMaterial({
  17790. color: 16777215,
  17791. transparent: !0,
  17792. opacity: .75,
  17793. map: r
  17794. })),
  17795. this.vrMarker.boluoType = "vr",
  17796. this.vrMarker.position.z = 1,
  17797. this.vrMarker.enabled = !0,
  17798. this.vrMarker.visible = !1,
  17799. window.vrMarkers = window.vrMarkers || [],
  17800. window.vrMarkers.push(this.vrMarker),
  17801. this.marker && this.marker.add(this.vrMarker),
  17802. a.showAxis && (this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,1,0),new s.Vector3(0,0,0),1,255)),
  17803. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,0,1),new s.Vector3(0,0,0),1,16711680)),
  17804. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(1,0,0),new s.Vector3(0,0,0),1,65280))),
  17805. this.adjustAngleEnable) {
  17806. (i = new s.Quaternion).setFromAxisAngle(new s.Vector3(1,0,0), this.adjustAngleX),
  17807. this.skyboxMesh.quaternion.multiply(i);
  17808. var o = new s.Quaternion;
  17809. o.setFromAxisAngle(new s.Vector3(0,1,0), this.adjustAngleY),
  17810. this.skyboxMesh.quaternion.multiply(o),
  17811. (n = new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1), this.adjustAngleZ),
  17812. this.skyboxMesh.quaternion.multiply(n),
  17813. this.skyboxMesh.updateMatrix(),
  17814. this.skyboxMesh.updateMatrixWorld(),
  17815. this.model.updateProjectedPanos()
  17816. }
  17817. }
  17818. var i, t, s = S("three"), n = S("../util/logger"), a = S("../settings"), l = (S("../enum/Viewmode"),
  17819. S("../enum/RenderOrder")), c = S("../enum/AlignmentType"), o = (S("../util/common"),
  17820. S("../util/transitions")), h = S("../util/lerp"), u = S("../util/ajax"), d = S("../util/texture"), p = S("../util/panorama"), f = (S("../enum/TileDownloaderEvents"),
  17821. S("../enum/PanoramaEvents")), g = S("../enum/PanoRendererEvents"), m = S("../enum/PanoSizeClass"), v = S("../enum/RenderLayers"), y = (S("../scene/SceneRenderer"),
  17822. S("../enum/GLCubeFaces"),
  17823. 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");
  17824. (r.prototype = Object.create(C.prototype)).enter = (t = null,
  17825. function() {
  17826. this.setZoomed(!1),
  17827. this.emit("enter", {
  17828. oldPano: t,
  17829. newPano: this
  17830. }),
  17831. t = this
  17832. }
  17833. ),
  17834. r.prototype.exit = function() {
  17835. this.tiled ? (this.clearWaitDeferreds(),
  17836. this.minimumTiledPanoLoaded = !1,
  17837. this.tiledPanoRenderTarget = null,
  17838. this.setZoomed(!1),
  17839. this.panoRenderer.deactivateTiledPano(this),
  17840. this.highestPartialTileRenderOpCompleted = 0,
  17841. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  17842. this.solidSkybox.loaded = !1,
  17843. this.solidSkybox.version = 0),
  17844. this.emit("exit")
  17845. }
  17846. ,
  17847. r.prototype.hoverOn = function(e) {
  17848. this.marker && (o.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  17849. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  17850. }
  17851. ,
  17852. r.prototype.hoverOff = function(e) {
  17853. this.marker && o.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  17854. }
  17855. ,
  17856. r.prototype.build1 = function() {
  17857. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  17858. this.floor.addPano(this),
  17859. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  17860. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  17861. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  17862. this.neighbourUUIDs = this.neighbourUUIDs || [] //add
  17863. }
  17864. ,
  17865. r.prototype.build2 = function() {
  17866. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  17867. this.height = this.position.distanceTo(this.floorPosition),
  17868. this.placeMarker()
  17869. }
  17870. ,
  17871. r.prototype.interpolateFloorPosition = function() {
  17872. var e = this.model.panos.filter(r.filters.isNeighbourPanoTo(this)).filter(function(e) {
  17873. return !!e.floorPosition
  17874. }).sort(function(e, t) {
  17875. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  17876. }
  17877. .bind(this))
  17878. , t = this.position.clone();
  17879. return 2 <= e.length ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  17880. t
  17881. }
  17882. ,
  17883. r.prototype.raycastFloorPosition = function() {
  17884. I.warn("Performance warning: Raycasting to find floor position");
  17885. var e = new s.Raycaster(this.position,new s.Vector3(0,-1,0)).intersectObjects(this.model.colliders);
  17886. return e.length ? e[0].point : null
  17887. }
  17888. ,
  17889. 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)],
  17890. function() {
  17891. I.warn("Performance warning: Raycasting to find floor index");
  17892. for (var e = 0; e < i.length; e++) {
  17893. var t = new s.Raycaster(this.position.clone(),i[e].clone()).intersectObjects(this.model.colliders);
  17894. if (t.length)
  17895. return t[0].object.parent.parent
  17896. }
  17897. return null
  17898. }
  17899. ),
  17900. r.prototype.placeMarker = function() {
  17901. this.marker && (this.marker.position.copy(this.floorPosition),
  17902. this.marker.position.y += .05,
  17903. this.marker.lookAt(new s.Vector3(0,1,0).add(this.marker.position)))
  17904. }
  17905. ,
  17906. r.prototype.translate = function(e) {
  17907. this.position.add(e),
  17908. this.floorPosition.add(e)
  17909. }
  17910. ,
  17911. r.prototype.findClosestMidtpointPanoTo = function(e) {
  17912. return (new s.Vector3).addVectors(this.position, e.position).divideScalar(2),
  17913. this.model.panos.find([r.filters.notIn([this, e])], [r.sortFunctions.distanceToPoint(point)])
  17914. }
  17915. ,
  17916. r.prototype.attachToPanoRenderer = function(e) {
  17917. this.panoRenderer = e,
  17918. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  17919. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  17920. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  17921. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  17922. }
  17923. ;
  17924. var w, T, x = {};
  17925. r.prototype.getWaitDeferred = function(e) {
  17926. var t = x[this.id];
  17927. t || (t = {},
  17928. x[this.id] = t);
  17929. var i = t[e];
  17930. return i || (i = {
  17931. deferred: $.Deferred(),
  17932. active: !1
  17933. },
  17934. t[e] = i),
  17935. i
  17936. }
  17937. ,
  17938. r.prototype.resetWaitDeferred = function(e) {
  17939. var t = this.getWaitDeferred(e);
  17940. t.active = !1,
  17941. t.deferred = $.Deferred()
  17942. }
  17943. ,
  17944. r.prototype.clearWaitDeferreds = function() {
  17945. var e = x[this.id];
  17946. for (var t in e || (e = {},
  17947. x[this.id] = e),
  17948. e)
  17949. if (e.hasOwnProperty(t)) {
  17950. var i = e[t];
  17951. i.active = !1,
  17952. i.deferred = $.Deferred()
  17953. }
  17954. }
  17955. ,
  17956. r.prototype.loadTiledPano = (new s.Vector3,
  17957. w = [],
  17958. T = [],
  17959. function(e, t, i, n, r, o) {
  17960. null != n || (n = !0),
  17961. null != r || (r = !0);
  17962. var a = this.getWaitDeferred(e)
  17963. , s = a.deferred
  17964. , l = null
  17965. , c = null;
  17966. if (i && ("number" == typeof i ? l = i : (l = i.hFov,
  17967. c = i.vFov)),
  17968. !this.isLoaded(e)) {
  17969. if (!a.active) {
  17970. if (a.active = !0,
  17971. i) {
  17972. var h = A.matchingTilesInDirection(this, e, t, l, c);
  17973. w[this.id + ":" + e] = {
  17974. tileCount: 0,
  17975. targetTileCount: h
  17976. },
  17977. I.info("Loading partial pano: " + this.id + " with " + h + " tiles")
  17978. }
  17979. T[this.id] || (T[this.id] = !0,
  17980. this.on(f.LoadComplete, function(e, t) {
  17981. var i = this.getWaitDeferred(e).deferred;
  17982. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  17983. this.resetWaitDeferred(e))
  17984. }
  17985. .bind(this)),
  17986. this.on(f.LoadFailed, function(e) {
  17987. var t = this.getWaitDeferred(e).deferred;
  17988. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  17989. this.resetWaitDeferred(e))
  17990. }
  17991. .bind(this)),
  17992. this.on(f.TileLoaded, function(e, t, i) {
  17993. var n = this.getWaitDeferred(e).deferred;
  17994. if (n && "pending" === n.state()) {
  17995. n.notify(e, t, i);
  17996. var r = w[this.id + ":" + e];
  17997. r && (r.tileCount++,
  17998. r.tileCount === r.targetTileCount && (this.onPanoRendered(this.id, e, i, !0),
  17999. n.resolve(e, i),
  18000. this.resetWaitDeferred(e)))
  18001. }
  18002. }
  18003. .bind(this)))
  18004. }
  18005. this.tileDownloader.clearForceQueue(),
  18006. this.tileDownloader.forceQueueTilesForPano(this, e, t, l, c, o),
  18007. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), n),
  18008. this.panoRenderer.renderPanoTiles(this.id, t, r)
  18009. }
  18010. return s.promise()
  18011. }
  18012. ),
  18013. r.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  18014. e === this.id && t === this.qualityManager.getPanoSize(m.BASE) && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  18015. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  18016. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  18017. }
  18018. ,
  18019. r.prototype.onTileRendered = function(e, t, i, n) {
  18020. e === this.id && this.emit(f.TileLoaded, t, i, n)
  18021. }
  18022. ,
  18023. r.prototype.onPanoRendered = function(e, t, i, n) {
  18024. e === this.id && (this.minimumTiledPanoLoaded = !0,
  18025. this.updateSkyboxForZoomLevel(),
  18026. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  18027. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  18028. this.emit("load", t),
  18029. this.model.emit("load", this),
  18030. this.emit(f.LoadComplete, t, i))
  18031. }
  18032. ,
  18033. r.prototype.setZoomed = function(e) {
  18034. this.zoomed = e,
  18035. this.updateSkyboxForZoomLevel()
  18036. }
  18037. ,
  18038. r.prototype.ensureSkyboxReadyForRender = function() {
  18039. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  18040. this.solidSkybox.loaded = !0)
  18041. }
  18042. ,
  18043. r.prototype.updateSkyboxForZoomLevel = function() {
  18044. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  18045. }
  18046. ,
  18047. r.prototype.getSkyboxTexture = function() {
  18048. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  18049. }
  18050. ,
  18051. r.prototype.onTileRenderFail = function(e, t, i) {
  18052. e === this.id && this.emit(f.LoadFailed, t)
  18053. }
  18054. ,
  18055. r.prototype.isLoaded = function(e) {
  18056. if (this.tiled) {
  18057. if (e && "string" == typeof e)
  18058. throw new y("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  18059. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  18060. }
  18061. if (e && "number" == typeof e)
  18062. throw new y("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  18063. return !!this.solidSkybox.high || e in this.solidSkybox
  18064. }
  18065. ,
  18066. r.prototype.loadCube = function(a) {
  18067. if (this.isLoaded(a))
  18068. return I.info("Skipping load of pano, already loaded"),
  18069. $.when();
  18070. this.emit("loading", a),
  18071. this.model.emit("loading", this);
  18072. var n = p.getCubemapUrls(this.model.urls, this.id, a)
  18073. , e = n.filter(function(e) {
  18074. return !e
  18075. });
  18076. "low" === a && 0 < e.length && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  18077. a = "high",
  18078. n = p.getCubemapUrls(this.model.urls, this.id, a));
  18079. var t = 0
  18080. , i = [0, 1, 2, 3, 4, 5].map(function(e, t, i) {
  18081. return u.getImage(n[t])
  18082. }
  18083. .bind(this));
  18084. return $.when(i[0], i[1], i[2], i[3], i[4], i[5]).then(function(e, t, i, n, r, o) {
  18085. return this.solidSkybox[a] = [e, t, i, n, r, o],
  18086. "high" !== a && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[a],
  18087. this.solidSkybox.low = null),
  18088. this.solidSkybox.needsUpdate = !0,
  18089. this.emit("load", a),
  18090. this.model.emit("load", this),
  18091. this
  18092. }
  18093. .bind(this), function() {
  18094. I.error("Downloading cubemap for pano", this.id, "failed"),
  18095. this.failedLoadingAt = Date.now()
  18096. }
  18097. .bind(this), function() {
  18098. return $.when(++t, 6)
  18099. })
  18100. }
  18101. ,
  18102. r.raycastsSkipped = 0,
  18103. r.raycastsDone = 0,
  18104. r.prototype.findNeighourPanos = function() {
  18105. return this.model.panos.setNeighbour(this.id, this.id, !1),
  18106. this.model.panos.forEach(function(e) {
  18107. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18108. var t = this.position.distanceTo(e.position);
  18109. if (t > a.panoramaNeighbourMaxDistance)
  18110. return this.model.panos.setNeighbour(this, e, !1),
  18111. void r.raycastsSkipped++;
  18112. var i = e.position.clone().sub(this.position).normalize()
  18113. , n = new s.Raycaster(this.position,i.clone(),0,t).intersectObjects(this.model.colliders);
  18114. r.raycastsDone++,
  18115. this.model.panos.setNeighbour(this, e, 0 === n.length),
  18116. 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)))
  18117. }
  18118. }
  18119. .bind(this)),
  18120. this.model.panos.neighbourMap[this.id]
  18121. }
  18122. ,
  18123. r.prototype.worldPosition = function() {
  18124. return this.position
  18125. }
  18126. ,
  18127. r.prototype.addTextSprite = function(e, color, parent) {
  18128. this.removeTextSprite();
  18129. var ratio = 16;
  18130. var i = document.createElement("canvas")
  18131. , n = i.getContext("2d");
  18132. i.width = 1024,
  18133. i.height = i.width / ratio;
  18134. n.font = " 30px Arial",
  18135. n.fillStyle = "white";
  18136. var r = n.measureText(e).width;
  18137. n.fillText(e, (i.width - r) / 2, (i.height + 60) / 2);
  18138. var o = new s.Texture(i);
  18139. o.needsUpdate = !0;
  18140. var a = new s.SpriteMaterial({
  18141. map: o,
  18142. color: color || 16428055,
  18143. depthTest:false
  18144. });
  18145. this.text3d = new s.Sprite(a)
  18146. if(parent){
  18147. parent.add(this.text3d)
  18148. }else{
  18149. this.text3d.position.copy(this.skyboxMesh.position)
  18150. this.floor.add(this.text3d)
  18151. }
  18152. var scale = 5
  18153. this.text3d.scale.y = scale/ratio
  18154. this.text3d.scale.x = scale
  18155. }
  18156. ,
  18157. r.prototype.removeTextSprite = function() {
  18158. this.text3d && (this.text3d.parent.remove(this.text3d),
  18159. this.text3d.material.map.dispose(),
  18160. this.text3d = null)
  18161. }
  18162. ,
  18163. r.prototype.isAligned = function() {
  18164. return this.alignmentType === c.ALIGNED
  18165. }
  18166. ,
  18167. r.filters = {
  18168. inDirection: function(t, i, n) {
  18169. return function(e) {
  18170. return e.position.clone().sub(t).normalize().dot(i) > n
  18171. }
  18172. },
  18173. inFloorDirection: function(t, i, n) {
  18174. return function(e) {
  18175. return e.floorPosition.clone().sub(t).normalize().dot(i) > n
  18176. }
  18177. },
  18178. inPanoDirection: function(n, r, o) {
  18179. return o = a.navigation.panoScores ? a.navigation.filterStrictness : o,
  18180. function(e) {
  18181. var t = e.floorPosition.clone().sub(n).normalize()
  18182. , i = e.position.clone().sub(n).normalize();
  18183. return t.dot(r) > o || i.dot(r) > o
  18184. }
  18185. },
  18186. atFloor: function(t) {
  18187. return function(e) {
  18188. return !t || e.floor === t
  18189. }
  18190. },
  18191. not: function(t) {
  18192. return function(e) {
  18193. return e !== t
  18194. }
  18195. },
  18196. notIn: function(t) {
  18197. return function(e) {
  18198. return -1 === t.indexOf(e)
  18199. }
  18200. },
  18201. isLoaded: function() {
  18202. return function(e) {
  18203. return e.isLoaded()
  18204. }
  18205. },
  18206. isNotLoaded: function() {
  18207. return function(e) {
  18208. return !e.isLoaded()
  18209. }
  18210. },
  18211. isCloseEnoughTo: function(t, i) {
  18212. return function(e) {
  18213. return t.distanceTo(e.floorPosition) < i
  18214. }
  18215. },
  18216. hasMinimumHeightDifferenceTo: function(t, i) {
  18217. return function(e) {
  18218. return Math.abs(e.position.y - t.y) > i
  18219. }
  18220. },
  18221. isNotBehindNormal: function(t, i) {
  18222. var n = new s.Vector3;
  18223. return i = i.clone(),
  18224. function(e) {
  18225. return 0 < n.copy(e.position).sub(t).normalize().dot(i)
  18226. }
  18227. },
  18228. isNeighbourPanoTo: function(t) {
  18229. return function(e) {
  18230. return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id]
  18231. }
  18232. },
  18233. isNeighbourOfNeighbourTo: function(n) {
  18234. return function(i) {
  18235. return !!n.neighbourPanos[i.id] || n.neighbourUUIDs.some(function(e) {
  18236. var t = n.model.panos.get(e);
  18237. return !!t && t.neighbourPanos[i.id]
  18238. })
  18239. }
  18240. },
  18241. isNotRecentlyFailed: function(t) {
  18242. return function(e) {
  18243. return Date.now() - e.failedLoadingAt > t
  18244. }
  18245. },
  18246. isOnVisibleFloor: function() {
  18247. return function(e) {
  18248. return !e.floor.hidden
  18249. }
  18250. },
  18251. isPanoAligned: function() {
  18252. return function(e) {
  18253. return e.isAligned()
  18254. }
  18255. }
  18256. },
  18257. r.sortFunctions = {
  18258. distanceToPoint: function(i) {
  18259. return function(e, t) {
  18260. return e.position.distanceTo(i) - t.position.distanceTo(i)
  18261. }
  18262. },
  18263. floorDistanceToPoint: function(i) {
  18264. return function(e, t) {
  18265. return e.floorPosition.distanceTo(i) - t.floorPosition.distanceTo(i)
  18266. }
  18267. },
  18268. choose: function(i) {
  18269. return function(e, t) {
  18270. return i.id === e.id ? -1 : i.id === t.id ? 1 : 0
  18271. }
  18272. }
  18273. },
  18274. r.scoreFunctions = {
  18275. distance: function(t, i) {
  18276. return i = i || a.navigation.distanceFactor,
  18277. function(e) {
  18278. return t ? t.position.distanceTo(e.position) * i : 0
  18279. }
  18280. },
  18281. distanceSquared: function(t, i) {
  18282. return i = i || a.navigation.distanceFactor,
  18283. function(e) {
  18284. return t ? t.position.distanceToSquared(e.position) * i : 0
  18285. }
  18286. },
  18287. direction: function(t, i) {
  18288. return function(e) {
  18289. return e.position.clone().sub(t).normalize().dot(i) * a.navigation.directionFactor
  18290. }
  18291. },
  18292. angle: function(t, i) {
  18293. return function(e) {
  18294. return e.position.clone().sub(t).normalize().angleTo(i) * a.navigation.angleFactor
  18295. }
  18296. },
  18297. inFieldOfView: function(t, i) {
  18298. return function(e) {
  18299. return .75 < e.position.clone().sub(t).normalize().dot(i) ? 10 : -1
  18300. }
  18301. },
  18302. optionality: function(t) {
  18303. return function(e) {
  18304. return e.neighbourUUIDs.filter(function(e) {
  18305. return !(e in t.neighbourUUIDs) && e !== t.id
  18306. }).length * a.navigation.optionalityFactor
  18307. }
  18308. },
  18309. penalizeHeightDifferenceUnder: function(t, i) {
  18310. return function(e) {
  18311. return t.y - e.position.y < i ? -20 : 0
  18312. }
  18313. }
  18314. },
  18315. M.exports = r
  18316. }
  18317. ).call(this, "/js/objects/Panorama.js")
  18318. }
  18319. , {
  18320. "../enum/AlignmentType": 17,
  18321. "../enum/GLCubeFaces": 25,
  18322. "../enum/PanoRendererEvents": 35,
  18323. "../enum/PanoSizeClass": 36,
  18324. "../enum/PanoramaEvents": 37,
  18325. "../enum/RenderLayers": 41,
  18326. "../enum/RenderOrder": 42,
  18327. "../enum/TileDownloaderEvents": 45,
  18328. "../enum/Viewmode": 51,
  18329. "../exception/BasicException": 55,
  18330. "../scene/SceneRenderer": 158,
  18331. "../settings": 166,
  18332. "../tile/TileUtils": 174,
  18333. "../util/ajax": 181,
  18334. "../util/common": 185,
  18335. "../util/lerp": 188,
  18336. "../util/logger": 189,
  18337. "../util/panorama": 191,
  18338. "../util/texture": 194,
  18339. "../util/transitions": 195,
  18340. events: 202,
  18341. three: 217
  18342. }],
  18343. 149: [function(e, t, i) {
  18344. "use strict";
  18345. function n(e) {
  18346. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18347. t.map.value = d,
  18348. t.opacity.value = 0,
  18349. t.color.value.set(o.reticuleColor),
  18350. t.showMouseMarker = !window.DATA.hideMouseMarker;
  18351. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18352. side: r.DoubleSide,
  18353. depthWrite: !1,
  18354. depthTest: !1,
  18355. transparent: !0,
  18356. vertexShader: c.waypoint.vertexShader,
  18357. fragmentShader: c.waypoint.fragmentShader,
  18358. uniforms: t,
  18359. name: "waypoint",
  18360. opacity: 0,
  18361. visible: t.showMouseMarker
  18362. })),
  18363. this.layers.set(h.RETICULE),
  18364. this.renderOrder = u.reticule,
  18365. this.player = e,
  18366. this.direction = new r.Vector3,
  18367. this.hidden = !0,
  18368. this.mouseLastMoveTime = Date.now()
  18369. }
  18370. var r = e("three")
  18371. , o = e("../settings")
  18372. , a = e("../util/transitions")
  18373. , s = e("../util/texture")
  18374. , l = e("../util/lerp")
  18375. , c = e("../shaders")
  18376. , h = e("../enum/RenderLayers")
  18377. , u = e("../enum/RenderOrder")
  18378. , d = s.load("images/reticule-256x256.png");
  18379. (n.prototype = Object.create(r.Mesh.prototype)).move = function(e, t, i) {
  18380. this.hidden = i,
  18381. this.mouseLastMoveTime = Date.now()
  18382. }
  18383. ,
  18384. n.prototype.hide = function() {
  18385. this.hidden || (this.hidden = !0,
  18386. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18387. }
  18388. ,
  18389. n.prototype.show = function() {
  18390. this.hidden = !1,
  18391. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18392. }
  18393. ,
  18394. n.prototype.update = function() {
  18395. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18396. }
  18397. ,
  18398. n.prototype.updatePosition = function(e, t) {
  18399. if (!this.hidden) {
  18400. if (!t)
  18401. return this.hide();
  18402. var i = t.point
  18403. , n = e.distanceTo(i)
  18404. , r = 1 + .01 * n;
  18405. n < 1 && (r -= 1 - n),
  18406. this.show(),
  18407. this.scale.set(r, r, r),
  18408. this.direction = this.direction.multiplyScalar(.8),
  18409. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  18410. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  18411. this.lookAt(this.position.clone().add(this.direction))
  18412. }
  18413. }
  18414. ,
  18415. n.prototype.writeAstag = function() {
  18416. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  18417. , t = new Date;
  18418. this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1;
  18419. var i = {
  18420. enabled: !0,
  18421. version: "0",
  18422. created: t.toISOString(),
  18423. created_by: "APITest",
  18424. position: this.position.clone(),
  18425. stem: {
  18426. enabled: o.tags.pole.enabled,
  18427. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18428. },
  18429. label: "tag " + this.tagCount,
  18430. description: "Description " + e,
  18431. floor: function(e) {
  18432. if (e.currentFloor) {
  18433. var t = e.floors.indexOf(e.currentFloor);
  18434. return -1 < t ? t : void 0
  18435. }
  18436. }(this.player.model),
  18437. type: "info",
  18438. metadata: {
  18439. preferred_camera: {
  18440. mode: this.player.mode
  18441. }
  18442. }
  18443. };
  18444. console.log("--------------------------"),
  18445. console.log(JSON.stringify(i));
  18446. var n = this.player.model.addtag(e, i).build();
  18447. n && (n.disc && this.player.tagDiscs.push(n.disc),
  18448. n.visible || n.show(o.tags.startup.fadeInDuration))
  18449. }
  18450. ,
  18451. t.exports = n
  18452. }
  18453. , {
  18454. "../enum/RenderLayers": 41,
  18455. "../enum/RenderOrder": 42,
  18456. "../settings": 166,
  18457. "../shaders": 167,
  18458. "../util/lerp": 188,
  18459. "../util/texture": 194,
  18460. "../util/transitions": 195,
  18461. three: 217
  18462. }],
  18463. 150: [function(e, t, i) {
  18464. "use strict";
  18465. function n(e, t) {
  18466. this.chunks = [],
  18467. this.floorId = e,
  18468. this.roomId = t,
  18469. this.position = new l.Vector3
  18470. }
  18471. var l = e("three");
  18472. n.prototype.addChunk = function(e) {
  18473. this.chunks.push(e)
  18474. }
  18475. ,
  18476. n.prototype.calcBoundaries = function() {
  18477. 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++) {
  18478. var a = this.chunks[o].geometry.attributes.position;
  18479. if (a)
  18480. for (var s = 0; s < a.array.length; s += 3)
  18481. e.set(a.array[s], a.array[s + 1], a.array[s + 2]),
  18482. t.add(e),
  18483. 0 === s ? (i.copy(e),
  18484. n.copy(e)) : (i.max(e),
  18485. n.min(e)),
  18486. r++
  18487. }
  18488. 0 < r ? (t.multiplyScalar(1 / r),
  18489. this.average = t) : this.average = null,
  18490. this.boundsMax = i,
  18491. this.boundsMin = n,
  18492. this.center = new l.Vector3,
  18493. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  18494. }
  18495. ,
  18496. t.exports = n
  18497. }
  18498. , {
  18499. three: 217
  18500. }],
  18501. 151: [function(o, v, e) {
  18502. (function(e) {
  18503. "use strict";
  18504. function t(e, t, i) {
  18505. this.obj3d = null,
  18506. this.nodes = [],
  18507. this.colorHull = [],
  18508. this.shortPaths = {},
  18509. this.floorHull = null,
  18510. this.cameraHull = null,
  18511. this.floorPathDistance = 0,
  18512. this.floorCurvePoints = null,
  18513. this.floorCurveColors = null,
  18514. this.camCurvePoints = null,
  18515. this.warpDestHeroLoc = null,
  18516. this.warpDestPano = null,
  18517. this.warpPathPoints = null,
  18518. this.warpPathLengths = [0],
  18519. this.warpLength = 0,
  18520. this.closeWarpDistance = 4,
  18521. this.UP = U.UP.clone(),
  18522. this.longestStep = 0,
  18523. this.upcomingTransType = null,
  18524. this.burnsDir = 1,
  18525. this.prevNextDist = 0,
  18526. this.nextI = 0,
  18527. this.activeTransType = null,
  18528. this.lastTransType = null,
  18529. this.bunnyObj = null,
  18530. this.director = e,
  18531. this.player = t,
  18532. this.playerControls = i,
  18533. this.modelManager = t.modelManager,
  18534. this.updateModel(),
  18535. this.updateDefaultsFromModelData(),
  18536. this.bindEvents(),
  18537. this.warping = !1,
  18538. this.waitingToWarp = !1,
  18539. this.warpInterrupted = !1,
  18540. this.warpInterruptionBlackoutStyle = null,
  18541. this.warpInterruptionTravelTime = null
  18542. }
  18543. 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"),
  18544. o("../util/texture")), U = o("../enum/Vectors"), H = (o("../model/ModelManager"),
  18545. new i(e)), g = o("../enum/PlayerEvents"), z = o("../enum/BlackoutStyle"), r = o("../enum/ModelManagerEvents"), m = o("../constants"), I = {
  18546. 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"),
  18547. pathEnd: n.load("images/End.png"),
  18548. 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==")
  18549. };
  18550. t.prototype.setScene = function(e) {
  18551. this.createCpm(e),
  18552. this.createBunnyObj(e)
  18553. }
  18554. ,
  18555. t.prototype.updateModel = function() {
  18556. this.model = this.modelManager.getActiveModel()
  18557. }
  18558. ,
  18559. t.prototype.bindEvents = function() {
  18560. this.modelManager.on(r.ActiveModelChanged, this.updateModel.bind(this))
  18561. }
  18562. ,
  18563. t.prototype.updateDefaultsFromModelData = function() {
  18564. this.model.data
  18565. }
  18566. ,
  18567. t.prototype.pointPathDistance = function(e) {
  18568. for (var t = 0, i = 1; i < e.length; i += 1)
  18569. t += e[i - 1].distanceTo(e[i]);
  18570. return t
  18571. }
  18572. ,
  18573. t.prototype.pointPathLengths = function(e) {
  18574. for (var t = [0], i = 1; i < e.length; i += 1)
  18575. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  18576. return t
  18577. }
  18578. ,
  18579. t.prototype.interpAlongPath = function(e, t, i) {
  18580. var n, r = new P.Vector3, o = t[t.length - 1];
  18581. if (i < 1) {
  18582. n = i * o;
  18583. for (var a = 1; a < t.length; a += 1)
  18584. if (t[a] > n) {
  18585. var s = (n - t[a - 1]) / (t[a] - t[a - 1]);
  18586. return r.copy(e[a]),
  18587. r.sub(e[a - 1]),
  18588. r.multiplyScalar(s),
  18589. r.add(e[a - 1]),
  18590. r
  18591. }
  18592. } else
  18593. r.copy(e[e.length - 1]);
  18594. return r
  18595. }
  18596. ,
  18597. t.prototype.pathHeight = function() {
  18598. return this.player.mode !== O.FLOORPLAN ? D.path.height : D.path.outsideHeight
  18599. }
  18600. ,
  18601. t.prototype.createBunnyObj = function(e) {
  18602. this.bunnyObj || (this.bunnyObj = new P.AxisHelper(.1),
  18603. this.bunnyObj.visible = D.warp.showBunny),
  18604. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  18605. e.add(this.bunnyObj)
  18606. }
  18607. ,
  18608. t.prototype.createCpm = function(e) {
  18609. if (!this.currentPanoMarker) {
  18610. var t = this.makeWaypointObj(I.pathEnd, "Current");
  18611. t.material.uniforms.opacity.value = 0,
  18612. this.currentPanoMarker = {
  18613. mesh: t,
  18614. placed: !1
  18615. }
  18616. }
  18617. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18618. this.placeCpm(),
  18619. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  18620. }
  18621. ,
  18622. t.prototype.placeCpm = function() {
  18623. if (D.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  18624. var e = this.player.currentPano.floor;
  18625. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18626. e.add(this.currentPanoMarker.mesh)),
  18627. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  18628. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  18629. this.currentPanoMarker.placed = !0
  18630. } else
  18631. this.popOutCpm()
  18632. }
  18633. ,
  18634. t.prototype.fadeInCpm = function(e) {
  18635. 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)
  18636. }
  18637. ,
  18638. t.prototype.fadeOutCpm = function(e) {
  18639. V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  18640. }
  18641. ,
  18642. t.prototype.popInCpm = function() {
  18643. D.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  18644. }
  18645. ,
  18646. t.prototype.popOutCpm = function() {
  18647. this.fadeOutCpm(2)
  18648. }
  18649. ,
  18650. t.prototype.brushPrefs = {
  18651. linewidth: 7,
  18652. strokeWidth: 15,
  18653. cvSegments: 48,
  18654. paveStep: .1,
  18655. paveWidth: .2,
  18656. lookBlendDist: 3,
  18657. maxTurn: P.Math.degToRad(2)
  18658. },
  18659. t.prototype.panoPathDistance = function(e) {
  18660. var t = this.model.panos;
  18661. if (!e || e.length < 2)
  18662. return 0;
  18663. for (var i = [], n = 0; n < e.length; n += 1)
  18664. i.push(t.get(e[n]).floorPosition);
  18665. return this.pointPathDistance(i)
  18666. }
  18667. ,
  18668. t.prototype.loadTileTexture = function(t) {
  18669. var e = n.load(t, function(e) {
  18670. e.wrapS = P.RepeatWrapping,
  18671. e.wrapT = P.RepeatWrapping,
  18672. e.needsUpdate = !0,
  18673. H.debug('path texture "' + t + '" is ready')
  18674. }, function() {
  18675. H.error('path texture "' + t + '" failed')
  18676. });
  18677. return e.mapping = P.UVMapping,
  18678. e
  18679. }
  18680. ,
  18681. t.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  18682. return new l({
  18683. cameraMode: n,
  18684. position: e,
  18685. quaternion: t,
  18686. panoId: i,
  18687. orthoZoom: o,
  18688. floorVisibility: r,
  18689. thumbUrl: null,
  18690. name: null
  18691. })
  18692. }
  18693. ,
  18694. t.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  18695. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  18696. }
  18697. ,
  18698. t.prototype.setWarpDestination = function(e) {
  18699. this.warpDestHeroLoc = e
  18700. }
  18701. ,
  18702. t.prototype.setWarpDestinationByHeroIndex = function(e) {
  18703. var t = this.getHeroDescriptorByHeroIndex(e);
  18704. return null !== t && (this.setWarpDestination(t),
  18705. !0)
  18706. }
  18707. ,
  18708. t.prototype.setWarpDestinationByPano = function(e, t) {
  18709. return !!this.model.panos.get(e.id) && this.setWarpDestinationByPanoId(e.id, t)
  18710. }
  18711. ,
  18712. t.prototype.setWarpDestinationByPanoId = function(e, t) {
  18713. var i = this.model.panos.get(e);
  18714. if (i) {
  18715. t = t || new P.Quaternion;
  18716. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  18717. return this.setWarpDestination(n),
  18718. !0
  18719. }
  18720. return !1
  18721. }
  18722. ,
  18723. t.prototype.getHeroDescriptorByHeroIndex = function(e) {
  18724. var t = this.model.heroCount();
  18725. if (null !== this.warpDestHeroLoc && t < 1)
  18726. return H.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  18727. this.model.getHeroDescriptorByIndex(0);
  18728. var i = this.model.getHeroDescriptorByIndex(e);
  18729. if (i) {
  18730. var n = i.isPano() ? i.panoId : i.cameraMode;
  18731. H.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  18732. }
  18733. return i
  18734. }
  18735. ,
  18736. t.prototype.getHeroDescriptorByPano = function(e) {
  18737. return this.model.panos.get(e.id) ? this.getHeroDescriptorByPanoId(e.id) : null
  18738. }
  18739. ,
  18740. t.prototype.getHeroDescriptorByPanoId = function(e) {
  18741. var t = this.getHeroIndexFromPanoId(e);
  18742. return this.getHeroDescriptorByHeroIndex(t)
  18743. }
  18744. ,
  18745. t.prototype.getHeroIndexFromPanoId = function(e) {
  18746. for (var t = 0; t < this.model.heroLocations.length; t++) {
  18747. var i = this.model.heroLocations[t]
  18748. , n = this.getHeroId(i);
  18749. if (n && n === e)
  18750. return t
  18751. }
  18752. return -1
  18753. }
  18754. ,
  18755. t.prototype.getHeroPano = function(e) {
  18756. if (null === e)
  18757. return H.warn("getHeroPano(): no destination"),
  18758. null;
  18759. var t = this.getHeroId(e)
  18760. , i = this.model.panos.get(t);
  18761. return void 0 === i && (i = null,
  18762. "" !== t && H.debug('unable to find pano "' + t + '"')),
  18763. i
  18764. }
  18765. ,
  18766. t.prototype.getHeroId = function(e) {
  18767. return e.panoId
  18768. }
  18769. ,
  18770. t.prototype.setWarpDestPano = function() {
  18771. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  18772. this.warpDestPano
  18773. }
  18774. ,
  18775. t.prototype.brushToWarpPano = function(e, t) {
  18776. if (this.discardPathObject(),
  18777. !this.setWarpDestPano())
  18778. return !1;
  18779. if (this.warpDestHeroLoc.cameraMode !== O.PANORAMA && H.warn("Can only brush from pano to pano"),
  18780. !this.warpDestPano)
  18781. return H.info("No brush"),
  18782. !1;
  18783. if (!this.player.currentPano)
  18784. return H.debug("No current pano, visibility undefined"),
  18785. !1;
  18786. if (!this.warpDestPano)
  18787. return H.info("No wPano, visibility undefined"),
  18788. !1;
  18789. if (!this.warpDestPano.isAligned())
  18790. return H.debug("Cannot brush to unaligned pano"),
  18791. !1;
  18792. var i = (e === L.STD || e === L.WALK) && D.path.mapGuides
  18793. , n = !0;
  18794. if (this.player.currentPano.id === this.warpDestPano.id)
  18795. H.debug("Already at destination pano");
  18796. else {
  18797. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18798. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  18799. this.obj3d = new P.Object3D,
  18800. H.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  18801. n ? (H.info('No "walkable" route, using fall-back warp style transition'),
  18802. e = t) : (this.setPathHulls(this.nodes),
  18803. this.setFloorCurves(),
  18804. 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)))),
  18805. this.player.currentPano.floor.add(this.obj3d);
  18806. var r = this.player.mode === O.DOLLHOUSE || this.player.mode === O.FLOORPLAN
  18807. , o = e === L.STD;
  18808. if (!n && (i || o)) {
  18809. if (r) {
  18810. var a = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  18811. this.obj3d.add(a)
  18812. }
  18813. var s = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  18814. this.obj3d.add(s)
  18815. }
  18816. this.appearSlow()
  18817. }
  18818. return this.upcomingTransType = e,
  18819. !n
  18820. }
  18821. ,
  18822. t.prototype.findShortestPath = function(e, t) {
  18823. if (!e || !t)
  18824. return null;
  18825. var i = D.warp.walkExtraPanosDistance
  18826. , n = e.id + ":" + t.id + ":" + i;
  18827. if (this.shortPaths.hasOwnProperty(n))
  18828. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  18829. var r = t.id + ":" + e.id + ":" + i;
  18830. if (this.shortPaths.hasOwnProperty(r))
  18831. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  18832. var o = this.model.panos.aStarSearch(e, t);
  18833. return this.model.panos.includeNodesNearPath(o, i),
  18834. this.shortPaths[n] = o ? o.slice() : null,
  18835. o
  18836. }
  18837. ,
  18838. t.prototype.makePathHulls = function(e) {
  18839. var t, i, n, r, o, a = 0, s = [], l = [], c = [], h = this.model.panos;
  18840. r = (t = h.get(e[0])).floor.floorIndex;
  18841. for (var u = 0; u < e.length; u += 1)
  18842. (i = (t = h.get(e[u])).floorPosition.clone().sub(this.model.position)).y += this.pathHeight(),
  18843. s.push(i),
  18844. l.push(t.position.clone()),
  18845. n = t.floor.floorIndex,
  18846. c.push(r < n ? D.path.colorUp : n < r ? D.path.colorDown : D.path.color),
  18847. 0 < u && (a < (o = l[u].distanceTo(l[u - 1])) && (a = o));
  18848. return a > this.longestStep && (this.longestStep = a,
  18849. H.debug("path contains " + a + " meter segment")),
  18850. {
  18851. floor: s,
  18852. camera: l,
  18853. color: c
  18854. }
  18855. }
  18856. ,
  18857. t.prototype.makeFloorCurves = function(e, t, i) {
  18858. var n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  18859. , r = this.pointPathDistance(e) - 2 * n
  18860. , o = e.slice(0)
  18861. , a = o[1].clone().sub(o[0]);
  18862. a.y = 0,
  18863. a.normalize().multiplyScalar(n),
  18864. o[0] = (new P.Vector3).copy(o[0]).add(a),
  18865. (a = o[o.length - 2].clone().sub(o[o.length - 1])).y = 0,
  18866. a.normalize().multiplyScalar(n),
  18867. o[o.length - 1] = (new P.Vector3).copy(o[o.length - 1]).add(a);
  18868. var s = new P.CatmullRomCurve3(o)
  18869. , l = Math.floor(r / i);
  18870. l = 4 * Math.floor(l / 4),
  18871. l = Math.max(4, l);
  18872. for (var c, h, u = s.getSpacedPoints(l), d = [], p = new P.Vector3, f = 0; f < u.length; f += 1) {
  18873. h = 0,
  18874. c = u[f].distanceTo(e[0]);
  18875. for (var g = 1; g < e.length; g += 1)
  18876. p.copy(u[f]).sub(e[g]),
  18877. p.y *= 4,
  18878. p.length() < c && (h = g);
  18879. d.push(t[h])
  18880. }
  18881. return {
  18882. distance: r,
  18883. points: u,
  18884. colors: d
  18885. }
  18886. }
  18887. ,
  18888. t.prototype.makeCameraCurvePoints = function(e, t) {
  18889. var i = this.pointPathDistance(e);
  18890. return new P.CatmullRomCurve3(e).getSpacedPoints(Math.max(2, Math.floor(i / t)))
  18891. }
  18892. ,
  18893. t.prototype.makeCameraCurveTangents = function(e, t) {
  18894. var i = this.pointPathDistance(e)
  18895. , n = new P.CatmullRomCurve3(e)
  18896. , r = Math.max(2, Math.floor(i / t));
  18897. r = r || 5;
  18898. for (var o = [], a = 0; a <= r; a++)
  18899. o.push(n.getTangentAt(a / r));
  18900. return o
  18901. }
  18902. ,
  18903. t.prototype.setPathHulls = function(e) {
  18904. var t = this.makePathHulls(e);
  18905. this.floorHull = t.floor,
  18906. this.cameraHull = t.camera,
  18907. this.colorHull = t.color
  18908. }
  18909. ,
  18910. t.prototype.setFloorCurves = function() {
  18911. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  18912. this.floorPathDistance = e.distance,
  18913. this.floorCurvePoints = e.points,
  18914. this.floorCurveColors = e.colors
  18915. }
  18916. ,
  18917. t.prototype.setCameraCurvePoints = function() {
  18918. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, D.warp.stepFactor * this.brushPrefs.paveStep)
  18919. }
  18920. ,
  18921. t.prototype.chooseWarpPath = function(e) {
  18922. var t, i, n, r = this.playerControls.cameras[O.PANORAMA];
  18923. if (this.player.currentPano === this.warpDestPano || !e)
  18924. return this.warpPathPoints = null,
  18925. this.warpLength = 0,
  18926. !1;
  18927. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18928. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (H.debug("warp path to unreachable node"),
  18929. i = (t = this.warpDestPano.position.clone().sub(r.position)).clone().negate(),
  18930. t.multiplyScalar(.15).add(r.position),
  18931. i.multiplyScalar(.15).add(this.warpDestPano.position),
  18932. t.y = r.position.y,
  18933. i.y = this.warpDestPano.position.y,
  18934. n = new P.CubicBezierCurve3(r.position.clone(),t,i,this.warpDestPano.position.clone()),
  18935. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (H.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  18936. this.setCameraCurvePoints(),
  18937. this.warpPathPoints = this.camCurvePoints.slice(0)),
  18938. this.warpLength = 0,
  18939. this.warpPathLengths = [0];
  18940. 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) {
  18941. o.copy(this.warpPathPoints[c - 1]).sub(this.warpPathPoints[c]);
  18942. var h = o.length();
  18943. o.y *= D.warp.climbEffort;
  18944. var u = o.length() / h;
  18945. if (1 < c) {
  18946. o.setY(0).normalize(),
  18947. a.copy(this.warpPathPoints[c - 2]).sub(this.warpPathPoints[c - 1]).setY(0).normalize();
  18948. var d = Math.min(1, o.dot(a))
  18949. , p = 1 + (D.warp.brakeStrength - 1) * (1 - P.Math.smoothstep(d, l, s));
  18950. u = Math.max(p, u)
  18951. }
  18952. this.warpLength += h * u,
  18953. this.warpPathLengths[c] = this.warpLength
  18954. }
  18955. return !0
  18956. }
  18957. ,
  18958. t.prototype.drawPathRibbon = function(e, t) {
  18959. this.bunnyObj.visible = D.warp.showBunny;
  18960. 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) {
  18961. a.copy(e[s]),
  18962. 0 === s ? a.sub(e[s + 1]) : a.sub(e[s - 1]).negate(),
  18963. a.normalize(),
  18964. n.crossVectors(a, U.UP),
  18965. n.multiplyScalar(i);
  18966. var l = (new P.Vector3).copy(e[s]).add(r);
  18967. l.sub(n),
  18968. o.vertices.push(l),
  18969. (l = (new P.Vector3).copy(e[s]).add(r)).add(n),
  18970. o.vertices.push(l)
  18971. }
  18972. var c, h, u, d = 0;
  18973. for (s = 0; s < e.length - 1; s += 1) {
  18974. var p = 2 * s
  18975. , f = d
  18976. , g = d += e[s + 1].distanceTo(e[s])
  18977. , m = t[s]
  18978. , v = t[s + 1];
  18979. (c = new P.Face3(p,1 + p,2 + p)).vertexColors = [new P.Color(m), new P.Color(m), new P.Color(v)],
  18980. o.faces.push(c),
  18981. o.faceVertexUvs[0].push([new P.Vector2(0,f), new P.Vector2(1,f), new P.Vector2(0,g)]),
  18982. (c = new P.Face3(2 + p,1 + p,3 + p)).vertexColors = [new P.Color(v), new P.Color(m), new P.Color(v)],
  18983. o.faces.push(c),
  18984. o.faceVertexUvs[0].push([new P.Vector2(0,g), new P.Vector2(1,f), new P.Vector2(1,g)])
  18985. }
  18986. o.computeFaceNormals(),
  18987. o.computeVertexNormals(),
  18988. h = this.player.mode === O.PANORAMA ? ((u = P.UniformsUtils.clone(C.ribbon.uniforms)).map.value = I.path,
  18989. u.opacity.value = 0,
  18990. u.color.value.set(D.path.color),
  18991. new P.RawShaderMaterial({
  18992. side: P.DoubleSide,
  18993. depthWrite: !1,
  18994. transparent: !0,
  18995. vertexShader: C.ribbon.vertexShader,
  18996. fragmentShader: C.ribbon.fragmentShader,
  18997. uniforms: u,
  18998. name: "ribbonT",
  18999. opacity: 0
  19000. })) : new P.MeshBasicMaterial({
  19001. color: 16777215,
  19002. side: P.DoubleSide,
  19003. name: "ribbonOut",
  19004. vertexColors: P.VertexColors
  19005. });
  19006. var y = new P.Mesh(o,h);
  19007. return y.name = "ribbon",
  19008. this.player.mode === O.PANORAMA && (y.renderOrder = A.ribbon),
  19009. y
  19010. }
  19011. ,
  19012. t.prototype.drawPathPavement = function(e) {
  19013. for (var t, i = new P.Vector3, n = new P.Geometry, r = new P.Vector3, o = 0; o < e.length; o += 1)
  19014. r.copy(e[o]),
  19015. 0 === o ? r.sub(e[o + 1]).negate() : r.sub(e[o - 1]),
  19016. r.normalize(),
  19017. i.crossVectors(r, U.UP),
  19018. i.multiplyScalar(this.brushPrefs.paveWidth),
  19019. (t = (new P.Vector3).copy(e[o])).sub(i),
  19020. n.vertices.push(t),
  19021. n.vertices.push((new P.Vector3).copy(e[o])),
  19022. (t = (new P.Vector3).copy(e[o])).add(i),
  19023. n.vertices.push(t);
  19024. var a, s, l;
  19025. for (o = 0; o < e.length - 1; o += 1)
  19026. a = 3 * o + 1,
  19027. l = .25 + (s = .25 * o),
  19028. n.faces.push(new P.Face3(a - 1,a,3 + a)),
  19029. n.faceVertexUvs[0].push([new P.Vector2(0,s), new P.Vector2(.5,s), new P.Vector2(.5,l)]),
  19030. n.faces.push(new P.Face3(3 + a,2 + a,a - 1)),
  19031. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(0,l), new P.Vector2(0,s)]),
  19032. n.faces.push(new P.Face3(3 + a,a,1 + a)),
  19033. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(.5,s), new P.Vector2(1,s)]),
  19034. n.faces.push(new P.Face3(3 + a,1 + a,4 + a)),
  19035. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(1,s), new P.Vector2(1,l)]);
  19036. var c = this.player.mode === O.PANORAMA ? new P.MeshBasicMaterial({
  19037. color: D.path.color,
  19038. side: P.DoubleSide,
  19039. transparent: !0,
  19040. depthWrite: !1,
  19041. opacity: 0,
  19042. name: "paveT",
  19043. map: I.path
  19044. }) : new P.MeshBasicMaterial({
  19045. color: D.path.color,
  19046. side: P.DoubleSide,
  19047. transparent: !0,
  19048. depthWrite: !1,
  19049. opacity: 1,
  19050. name: "paveO",
  19051. map: I.path
  19052. });
  19053. return new P.Mesh(n,c)
  19054. }
  19055. ,
  19056. t.prototype.hintPrefs = {
  19057. rad: .18,
  19058. width: .0125,
  19059. depth: .0625,
  19060. setBack: -.04,
  19061. markRad: .25,
  19062. markInnerRad: .16
  19063. },
  19064. t.prototype.makeWaypointObj = function(e, t) {
  19065. var i = new P.Geometry
  19066. , n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  19067. , r = this.pathHeight();
  19068. 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)),
  19069. i.faces.push(new P.Face3(0,1,2), new P.Face3(2,3,0)),
  19070. i.faceVertexUvs[0].push([new P.Vector2(0,0), new P.Vector2(1,0), new P.Vector2(1,1)]),
  19071. i.faceVertexUvs[0].push([new P.Vector2(1,1), new P.Vector2(0,1), new P.Vector2(0,0)]);
  19072. var o = P.UniformsUtils.clone(C.waypoint.uniforms);
  19073. o.map.value = e,
  19074. o.opacity.value = 0,
  19075. o.color.value.set(D.path.color);
  19076. var a = {
  19077. side: P.DoubleSide,
  19078. depthWrite: !1,
  19079. transparent: !0,
  19080. vertexShader: C.waypoint.vertexShader,
  19081. fragmentShader: C.waypoint.fragmentShader,
  19082. uniforms: o,
  19083. name: "waypoint",
  19084. opacity: 0
  19085. };
  19086. this.player.mode !== O.PANORAMA && (a.depthTest = !1,
  19087. a.name = "wayPtOut");
  19088. var s = new P.RawShaderMaterial(a)
  19089. , l = new P.Mesh(i,s);
  19090. return l.name = t,
  19091. l
  19092. }
  19093. ,
  19094. t.prototype.makeStartMarker = function(e, t) {
  19095. var i = (new P.Vector3).copy(t[1]).sub(t[0]);
  19096. i.y = 0,
  19097. i.normalize();
  19098. var n = Math.acos(i.x)
  19099. , r = this.makeWaypointObj(I.pathStart, "Start");
  19100. return r.rotateOnAxis(new P.Vector3(0,1,0), n),
  19101. r.position.copy(e),
  19102. r
  19103. }
  19104. ,
  19105. t.prototype.makeEndMarker = function(e) {
  19106. var t = this.makeWaypointObj(I.pathEnd, "End")
  19107. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  19108. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  19109. return i < n ? t.material.uniforms.color.value.set(D.path.colorUp) : n < i && t.material.uniforms.color.value.set(D.path.colorDown),
  19110. t.position.copy(e),
  19111. t
  19112. }
  19113. ,
  19114. t.prototype.pathClean = function(e) {
  19115. if (e) {
  19116. for (var t in e.children)
  19117. this.pathClean(e.children[t]);
  19118. e.geometry && e.geometry.dispose(),
  19119. e.material && e.material.dispose()
  19120. }
  19121. }
  19122. ,
  19123. t.prototype.discardPathObject = function() {
  19124. if (this.obj3d) {
  19125. var e = this.obj3d.parent;
  19126. e && e.remove(this.obj3d),
  19127. this.pathClean(this.obj3d)
  19128. }
  19129. this.obj3d = null,
  19130. this.popInCpm()
  19131. }
  19132. ,
  19133. t.prototype.discardSlow = function() {
  19134. if (this.obj3d) {
  19135. if (this.player.mode !== O.PANORAMA)
  19136. return void this.discardPathObject();
  19137. for (var e, t = 0, i = function() {
  19138. this.discardPathObject()
  19139. }
  19140. .bind(this), n = 0; n < this.obj3d.children.length; n += 1)
  19141. 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]),
  19142. t += 1,
  19143. i = null);
  19144. 0 === t && this.discardPathObject(),
  19145. this.player.mode !== O.PANORAMA && this.fadeInCpm(D.path.fadeInTime - 3)
  19146. }
  19147. }
  19148. ,
  19149. t.prototype.appearSlow = function() {
  19150. var e;
  19151. this.fadeOutCpm(D.path.fadeInTime);
  19152. for (var t = this.player.mode === O.PANORAMA ? D.path.opacity : 1, i = 0; i < this.obj3d.children.length; i += 1)
  19153. 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]))
  19154. }
  19155. ,
  19156. t.prototype.update = function() {
  19157. this.obj3d && this.obj3d.updateMatrixWorld()
  19158. }
  19159. ,
  19160. t.prototype.calcBurnsAmount = function(e) {
  19161. var n = P.Math.degToRad(D.warp.burnsAngle);
  19162. if (this.player.mode !== O.PANORAMA)
  19163. return this.player.mode === O.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir;
  19164. var t = this.burnsDir * n;
  19165. if (this.upcomingTransType === L.BLACK)
  19166. return t;
  19167. var i = e;
  19168. if (null === i)
  19169. return H.warn("Transition request for non-highlight"),
  19170. t;
  19171. var r = this.getHeroDescriptorByHeroIndex(i);
  19172. if (null === r)
  19173. return t;
  19174. if (!r.isPano())
  19175. return t;
  19176. function o(e) {
  19177. var t = Math.acos(Math.min(1, e.dot(l)))
  19178. , i = (new P.Vector3).crossVectors(l, e);
  19179. return Math.max(c, Math.min(Math.abs(t), n)) * Math.sign(i.y)
  19180. }
  19181. var a = this.getHeroPano(r)
  19182. , s = this.playerControls.cameras[O.PANORAMA]
  19183. , l = U.FORWARD.clone().applyQuaternion(s.quaternion).setY(0).normalize()
  19184. , c = Math.min(P.Math.degToRad(D.warp.minBurnsAngle), n);
  19185. if (a === this.player.currentPano)
  19186. return o(U.FORWARD.clone().applyQuaternion(r.quaternion).setY(0).normalize());
  19187. var h = this.findShortestPath(this.player.currentPano, a);
  19188. if (null == h || h.length < 1)
  19189. return H.debug("Empty path ahead..."),
  19190. t;
  19191. var u = this.makePathHulls(h)
  19192. , d = new P.CatmullRomCurve3(u.camera)
  19193. , p = Math.min(.1, D.warp.lookAheadDist / d.getLength());
  19194. return o(d.getPointAt(p).clone().sub(s.position).setY(0).normalize())
  19195. }
  19196. ,
  19197. t.prototype.waitNextStep = function(e, t, i) {
  19198. var o = null == i ? D.warp.tourStepDelay : i;
  19199. o = o != void 0? o: (this.lastTransType === L.BLACK ? m.tourStepDelaySlideShow : m.tourStepDelayDefault);
  19200. var a = new P.Euler
  19201. , s = new P.Vector3;
  19202. H.debug("Starting wait: " + (void 0 !== t));
  19203. var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  19204. var l = currentLocation.dontRot || this.calcBurnsAmount(e)
  19205. , c = function() {
  19206. this.endWarpState(),
  19207. this.player.mode === O.DOLLHOUSE && (this.playerControls.cameras[O.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19208. t && t()
  19209. }
  19210. .bind(this)
  19211. , n = function(e, t) {
  19212. if (this.warpInterrupted)
  19213. return c(),
  19214. !0;
  19215. var i = t || 1e3 / 60;
  19216. if (D.warp.doBurns && !currentLocation.dontRot )
  19217. if (this.player.mode === O.PANORAMA) {
  19218. var n = this.playerControls.cameras[O.PANORAMA];
  19219. a.setFromQuaternion(n.quaternion, D.warp.eOrder);
  19220. var r = o == 0 ? l : i * l / o;
  19221. r = Math.sign(r) * Math.max(r, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  19222. a.y += r,
  19223. s.set(0, 0, -1),
  19224. s.applyEuler(a),
  19225. s.add(n.position),
  19226. n.controls.lookAt(s),
  19227. n.controls.lookVector.copy(s),
  19228. n.lookAt(s)
  19229. } else
  19230. this.player.mode === O.DOLLHOUSE ? this.playerControls.controls[O.DOLLHOUSE].rotationAcceleration.x = l : this.playerControls.controls[O.FLOORPLAN].absoluteScale *= .9996
  19231. }
  19232. .bind(this);
  19233. this.startWarpState(),
  19234. V.start(n, o, c, 0, B.easeInOutQuad, "wait");
  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])
  19325. , (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  19326. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  19327. )
  19328. : (H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim"),
  19329. void (t && t())) */
  19330. (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  19331. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  19332. return a > D.warp.minRotation ? V.start(d, e, t, 0, B[D.warp.movementEasing])
  19333. : (/* H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim") ,*/
  19334. void (t && t()))
  19335. }
  19336. ,
  19337. t.prototype._warpBendAim = function(e, t, i, n) {
  19338. var r = n || 0
  19339. , o = this.playerControls.cameras[O.PANORAMA]
  19340. , a = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19341. , s = (new P.Euler).setFromQuaternion(o.quaternion, D.warp.eOrder)
  19342. , l = new P.Euler(a.x - s.x,a.y - s.y,a.z - s.z,D.warp.eOrder);
  19343. l.y = N.constrainedTurn(l.y);
  19344. var c = Math.min(P.Math.degToRad(D.warp.softBendTilt), Math.abs(l.x));
  19345. l.x = c * Math.sign(l.x),
  19346. c = Math.min(P.Math.degToRad(Math.max(0, D.warp.softBendAngle)), c),
  19347. this.burnsDir = Math.sign(l.y),
  19348. c *= Math.sign(l.y),
  19349. l.y = c;
  19350. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19351. , u = new P.Vector3
  19352. , d = function(e, t) {
  19353. if (e < .5)
  19354. h.x = s.x + e * l.x,
  19355. h.y = s.y + e * l.y,
  19356. h.z = s.z + e * l.z;
  19357. else {
  19358. var i = (1 - e) * D.warp.softBendEnd;
  19359. h.x = a.x - i * l.x,
  19360. h.y = a.y - i * l.y,
  19361. h.z = a.z - i * l.z
  19362. }
  19363. u.set(0, 0, -1),
  19364. u.applyEuler(h),
  19365. u.add(o.position),
  19366. o.controls.lookAt(u),
  19367. o.controls.lookVector.copy(u),
  19368. o.lookAt(u)
  19369. }
  19370. .bind(this);
  19371. return V.start(d, t, i, r, B[D.warp.movementEasing])
  19372. }
  19373. ,
  19374. t.prototype._warpStepCameraAim = function(e, t, i) {
  19375. var n = this.playerControls.cameras[O.PANORAMA]
  19376. , r = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19377. , o = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19378. , a = new P.Euler(r.x - o.x,r.y - o.y,r.z - o.z,D.warp.eOrder);
  19379. a.y = N.constrainedTurn(a.y),
  19380. this.burnsDir = Math.sign(a.y);
  19381. var s = new P.Euler(0,0,0,D.warp.eOrder)
  19382. , l = new P.Vector3
  19383. , c = function(e, t) {
  19384. e < .5 ? s.copy(o) : s.copy(r),
  19385. l.set(0, 0, -1),
  19386. l.applyEuler(s),
  19387. l.add(n.position),
  19388. n.controls.lookAt(l),
  19389. n.controls.lookVector.copy(l),
  19390. n.lookAt(l)
  19391. }
  19392. .bind(this);
  19393. return V.start(c, t, i, 0, B[D.warp.movementEasing])
  19394. }
  19395. ,
  19396. t.prototype.setBurnsDir = function() {
  19397. var e = this.playerControls.cameras[O.PANORAMA]
  19398. , t = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19399. , i = (new P.Euler).setFromQuaternion(e.quaternion, D.warp.eOrder)
  19400. , n = new P.Euler(t.x - i.x,t.y - i.y,t.z - i.z,D.warp.eOrder);
  19401. n.y = N.constrainedTurn(n.y),
  19402. this.burnsDir = Math.sign(n.y)
  19403. }
  19404. ,
  19405. t.prototype.stepWarpPath = function(firstPos, e ) {
  19406. var i = this.playerControls.cameras[O.PANORAMA];
  19407. var n = this.warpPathPoints ? this.warpPathPoints[0] : firstPos
  19408. if (!n){
  19409. return i.position.copy(this.warpDestPano.position),
  19410. !0;
  19411. }
  19412. /* if (!this.warpPathPoints)
  19413. return i.position.copy(this.warpDestPano.position),
  19414. !0;
  19415. var n = this.warpPathPoints[0] */
  19416. var r = this.warpDestPano.position;
  19417. if (null !== this.nodes && this.cameraHull && this.cameraHull.length > 1) {
  19418. var o = new P.Vector3;
  19419. 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),
  19420. i.position.copy(o)
  19421. } else
  19422. e < .5 ? i.position.copy(n) : i.position.copy(r)
  19423. }
  19424. ,
  19425. t.prototype.interruptAndFastForward = function(e, t) {
  19426. this.warping && (this.warpInterrupted = !0,
  19427. this.warpInterruptionBlackoutStyle = e,
  19428. this.warpInterruptionTravelTime = t,
  19429. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = z.MIDDLE),
  19430. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = D.minWarpTime))
  19431. }
  19432. ,
  19433. t.prototype.warpCameraAim = function(e) {
  19434. var t = D.warp.minWarpTime;
  19435. if (this.upcomingTransType === L.BLACK)
  19436. t = D.warp.teleportTime;
  19437. else {
  19438. var i = this.playerControls.cameras[O.PANORAMA]
  19439. , n = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19440. , r = (new P.Euler).setFromQuaternion(i.quaternion, D.warp.eOrder)
  19441. , o = new P.Euler(n.x - r.x,n.y - r.y,n.z - r.z,D.warp.eOrder);
  19442. o.y = N.constrainedTurn(o.y);
  19443. var a = 1e3 * Math.abs(o.y) / P.Math.degToRad(D.warp.maxAimPerSec);
  19444. t = Math.max(t, a)
  19445. }
  19446. var s = function() {
  19447. this._warpStopFlying(),
  19448. this.discardSlow(),
  19449. e && e()
  19450. }
  19451. .bind(this);
  19452. this._warpCameraAim(t, s)
  19453. }
  19454. ,
  19455. t.prototype.warpCommonParameters = function(e, t, i, n) {
  19456. this.model.skybox.material.uniforms.blackout.value = n;
  19457. var r = F.uniform(this.model.skybox, "progress", 1)
  19458. , o = F.allUniforms(this.model.chunks, "progress", 1)
  19459. , a = !1
  19460. , s = function() {
  19461. if (this.warpInterrupted)
  19462. return a = !0
  19463. }
  19464. .bind(this)
  19465. , l = function(e, t) {
  19466. return i && a ? !(this.model.skybox.material.uniforms.progress.value = 0) : void r(e, t)
  19467. }
  19468. .bind(this)
  19469. , c = function(e, t) {
  19470. return i && a ? (o(0),
  19471. !0) : void o(e, t)
  19472. }
  19473. .bind(this);
  19474. V.start(s, e, null, t, null, "safeHaltWatch"),
  19475. V.start(l, e, null, t, B[D.warp.blendEasing], "skyboxProgress"),
  19476. V.start(c, e, null, t, B[D.warp.blendEasing], "chunkProgress")
  19477. }
  19478. ,
  19479. t.prototype.warpTravel_STD = function(e) {
  19480. 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),
  19481. 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;
  19482. t += this.warpLength * D.warp.timePerMeter,
  19483. .01 < D.warp.flySpeed && (t = 1e3 * this.warpLength / D.warp.flySpeed);
  19484. function n(e) {
  19485. var t = i;
  19486. return P.Math.smoothstep(e, 0, t) * (1 - P.Math.smoothstep(e, 1 - t, 1))
  19487. }
  19488. var y = !1
  19489. , r = this.warpDestHeroLoc.quaternion
  19490. , o = new P.Vector3(0,0,-1).applyQuaternion(r).normalize()
  19491. , A = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  19492. , a = A.dot(o)
  19493. , C = P.Math.radToDeg(Math.acos(a))
  19494. , s = function() {
  19495. return m.lookAt(g, l, U.UP),
  19496. u.setFromRotationMatrix(m, D.warp.eOrder),
  19497. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19498. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19499. N.constrainedTurn(v.y)
  19500. }
  19501. .bind(this)
  19502. , I = function(e, t) {
  19503. if (this.warpInterrupted)
  19504. return y = !0
  19505. }
  19506. .bind(this)
  19507. , E = function(e, t) {
  19508. return y || !this.warpPathPoints ? (k.blur(0),
  19509. !0) : void k.blur(e)
  19510. }
  19511. .bind(this)
  19512. , _ = F.allUniforms(this.model.chunks, "modelAlpha", 1)
  19513. , b = function(e, t) {
  19514. return y || !this.warpPathPoints ? (_(0),
  19515. !0) : void _(e, t)
  19516. }
  19517. .bind(this)
  19518. , w = function(e, t) {
  19519. if (!this.warpPathPoints)
  19520. return h.position.copy(this.warpDestPano.position),
  19521. !0;
  19522. if (y)
  19523. return !0;
  19524. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  19525. h.position.copy(i),
  19526. g = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  19527. }
  19528. .bind(this)
  19529. , T = function(e, t) {
  19530. return this.warpPathPoints ? !!y || void (l = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + c, 1))) : (H.debug("Lost bunny."),
  19531. !0)
  19532. }
  19533. .bind(this)
  19534. , x = function(e, t) {
  19535. if (y)
  19536. return H.debug(">>>> Walkthrough interupted at t=" + e),
  19537. !0;
  19538. if (!this.warpPathPoints)
  19539. return !0;
  19540. var i = this.warpLength * e
  19541. , n = P.Math.smoothstep(i, 0, this.brushPrefs.lookBlendDist)
  19542. , r = P.Math.smoothstep(i, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  19543. D.warp.matchCam && (n *= 1 - r),
  19544. m.lookAt(g, l, U.UP),
  19545. u.setFromRotationMatrix(m, D.warp.eOrder),
  19546. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19547. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19548. v.y = N.constrainedTurn(v.y),
  19549. u.x = p.x + n * v.x,
  19550. u.y = p.y + n * v.y,
  19551. u.z = p.z + n * v.z,
  19552. v.set(u.x - f.x, u.y - f.y, u.z - f.z, D.warp.eOrder),
  19553. v.y = N.constrainedTurn(v.y);
  19554. var o = P.Math.degToRad(D.warp.maxTurnPerSec) * t / 1e3;
  19555. v.y = Math.sign(v.y) * Math.min(o, Math.abs(v.y)),
  19556. f.x = f.x + v.x * D.warp.turnFriction,
  19557. f.y = f.y + v.y * D.warp.turnFriction,
  19558. f.z = f.z + v.z * D.warp.turnFriction,
  19559. f.x = Math.max(P.Math.degToRad(D.warp.minDownAngle), f.x);
  19560. var a = l.clone().sub(g).normalize();
  19561. if (C < D.warp.maxAimRotation && 0 < r) {
  19562. var s = 1 - r;
  19563. a.x = a.x * s + r * A.x,
  19564. a.y = a.y * s + r * A.y,
  19565. a.z = a.z * s + r * A.z,
  19566. a.normalize()
  19567. }
  19568. this.bunnyObj.position.copy(h.position).add(a),
  19569. d.set(0, 0, -1).applyEuler(f).normalize(),
  19570. d.multiplyScalar(8),
  19571. d.add(h.position),
  19572. 1 - c < e && D.warp.matchCam || (h.controls.lookAt(d),
  19573. h.controls.lookVector.copy(d),
  19574. h.lookAt(d))
  19575. }
  19576. .bind(this)
  19577. , S = function() {
  19578. y ? (this.discardSlow(),
  19579. this.upcomingTransType = L.BLACK,
  19580. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, z.BEGINNING, e)) : this._wrapupWarpShading(e)
  19581. }
  19582. .bind(this);
  19583. T(0);
  19584. var M = D.warp.motionLeadTime + 1e3 * Math.abs(s()) / P.Math.degToRad(D.warp.maxTurnPerSec)
  19585. , R = M / (t += M);
  19586. this.warpCommonParameters(t, R, !0, z.NONE),
  19587. V.start(I, t, null, 0, null, "_haltWatcher"),
  19588. 0 < D.warp.blur && (k.blurStrength = D.warp.blur,
  19589. V.start(E, t, null, R, n, "blurring")),
  19590. V.start(b, t, null, R, n, "modelAlpha"),
  19591. V.start(w, t, null, R, B[D.warp.blendEasing], "followPath"),
  19592. V.start(T, t, null, R, B[D.warp.blendEasing], "goBunny"),
  19593. V.start(x, t, S, 0, B[D.warp.blendEasing], "lookAtBunny")
  19594. }
  19595. ,
  19596. t.prototype.warpTravel_BLACK = function(e, t, i, n) {
  19597. var r = e || 0;
  19598. null != t || (t = D.warp.teleportTime),
  19599. this.warpCommonParameters(t, r, !1, i),
  19600. this.model.chunks.forEach(function(e) {
  19601. e.material.uniforms.blackout.value = i
  19602. }),
  19603. this._warpBendAim(null, t, null, r);
  19604. //add
  19605. var done = ()=>{
  19606. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  19607. this.player.transitionPos({type:"beforeFlytopano", pano:this.player.currentPano, dur:100})//add
  19608. //Overlay.updateVisibles([this.player.currentPano])
  19609. }
  19610. var o = function() {
  19611. this.wrapupWarpShadingOnly(n, i)
  19612. done()
  19613. }
  19614. .bind(this);
  19615. var firstPos = this.player.position.clone()//add
  19616. V.start(this.stepWarpPath.bind(this, firstPos), t, o, r, B[D.warp.blendEasing], "stepMotion")
  19617. }
  19618. ,
  19619. t.prototype.flightStepWalk = (a = new P.Vector3,
  19620. s = new P.Vector3,
  19621. function(e, t, i) {
  19622. if (this.warpInterrupted)
  19623. i && i();
  19624. else if (this.activeTransType !== L.WALK)
  19625. this._clearWarpShading(),
  19626. this._warpStopFlying(),
  19627. this.player.spider.draw(),
  19628. this.placeCpm(),
  19629. i && i();
  19630. else if (this.player.currentPano !== e) {
  19631. var n = {
  19632. pano: e,
  19633. lookAtPoint: t,
  19634. duration: null,
  19635. maxDistanceOverride: D.warp.walkMaxDist,
  19636. skipWarpingCheck: !1,
  19637. constantMoveSpeed: !0
  19638. };
  19639. if(e == this.warpDestPano){//到达终点前,放大到终点的zoom
  19640. n.zoomLevel = this.warpDestHeroLoc.zoom
  19641. }
  19642. n.duration = function(e, t) {
  19643. var i = Math.min(this.player.position.distanceTo(e.position), D.transition.flytimeMaxDistanceThreshold) * D.transition.flytimeDistanceMultiplier + D.transition.flyTime;
  19644. s.copy(U.FORWARD),
  19645. this.player.getDirection(s),
  19646. a.copy(t).sub(e.position).normalize();
  19647. var n = a.dot(s)
  19648. , r = Math.acos(n)
  19649. , o = r / i;
  19650. .001 < o && (i *= o / .001, //-----这是什么????
  19651. r < 1 && (i *= 1.2))
  19652. return i / DATA.tourWalkSpeed * 100
  19653. }
  19654. .call(this, e, t),
  19655. this.player.nonInterruptingFlyToPano(n, i)
  19656. } else
  19657. i && i()
  19658. }
  19659. ),
  19660. t.prototype.makeWalkFlightFunc = function(e, t, i) {
  19661. return this.flightStepWalk.bind(this, e, t, i)
  19662. }
  19663. ,
  19664. t.prototype.warpTravel_WALK = (f = [],
  19665. function(e) {
  19666. for (var t = this.player.model.panos, i = null, n = !1, r = f.length = 0; r < this.nodes.length; r++) {
  19667. var o = this.nodes[r]
  19668. , a = t.get(o);
  19669. this.nodes.length,
  19670. n = i && a.position.distanceTo(i.position) < D.warp.walkMinDist,
  19671. i && n || (f.push(o),
  19672. i = a)
  19673. }
  19674. n && 1 < this.nodes.length && (f[f.length - 1] = this.nodes[this.nodes.length - 1]);
  19675. var s = f.length
  19676. , l = t.get(f[s - 1])
  19677. , c = new Array(s + 1);
  19678. c[c.length - 1] = function() {
  19679. e && e()
  19680. }
  19681. .bind(this);
  19682. for (var h = s - 1, u = c.length - 1; 0 < u; u -= 1) {
  19683. var d = f[h];
  19684. l = t.get(d);
  19685. var p = new P.Vector3;
  19686. this.getLookAtForWalkingTourNode(f, h, p),
  19687. c[u - 1] = this.makeWalkFlightFunc(l, p, c[u]),
  19688. h--
  19689. }
  19690. c[0]()
  19691. }
  19692. ),
  19693. t.prototype.getLookAtForWalkingTourNode = (c = new P.Vector3,
  19694. h = new P.Vector3,
  19695. u = new P.Vector3,
  19696. d = new P.Vector3,
  19697. p = new P.Vector3,
  19698. function(e, t, i) {
  19699. var n = e.length;
  19700. if (n <= t)
  19701. return !1;
  19702. var r = 1
  19703. , o = 1;
  19704. h.set(0, 0, 0),
  19705. p.set(0, 0, 0);
  19706. for (var a = null, s = t; s < t + 3 && !(n <= s); s++) {
  19707. if (a = this.player.model.panos.get(e[s]),
  19708. this.getOrientationForWalkingTourNode(e, s, u),
  19709. s === t && c.copy(u),
  19710. d.copy(u),
  19711. t < s) {
  19712. var l = d.dot(c) < .65;
  19713. r *= l ? .2 : .75,
  19714. o *= l ? .2 : .4
  19715. }
  19716. u.multiplyScalar(r),
  19717. h.add(u),
  19718. p.lerp(a.position, o)
  19719. }
  19720. return h.normalize(),
  19721. i.copy(p),
  19722. i.add(h),
  19723. !0
  19724. }
  19725. ),
  19726. t.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  19727. var n = e.length;
  19728. if (n <= t)
  19729. return !1;
  19730. if (t === n - 1)
  19731. i.copy(U.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  19732. else {
  19733. var r = this.player.model.panos.get(e[t])
  19734. , o = this.player.model.panos.get(e[t + 1]);
  19735. i.copy(o.position).sub(r.position)
  19736. }
  19737. return i.normalize(),
  19738. !0
  19739. }
  19740. ,
  19741. t.prototype.warpCameraTravel = function(e, t, i, n) {
  19742. if (this.activeTransType = this.upcomingTransType,
  19743. this.lastTransType = this.activeTransType,
  19744. this.upcomingTransType = null,
  19745. e)
  19746. this.activeTransType === L.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === L.WALK ? this.warpTravel_WALK(function() {
  19747. this._clearWarpShading(),
  19748. this._warpStopFlying(),
  19749. this.player.spider.draw(),
  19750. this.placeCpm(),
  19751. n && n()
  19752. }
  19753. .bind(this)) : this.warpTravel_STD(n);
  19754. else {
  19755. var r = function() {
  19756. this._wrapupTravel(n)
  19757. }
  19758. .bind(this)
  19759. , o = {
  19760. pano: this.warpDestPano,
  19761. lookAtPoint: null,
  19762. duration: null,
  19763. maxDistanceOverride: null,
  19764. skipWarpingCheck: !1
  19765. };
  19766. this.player.flyToPano(o, r)
  19767. }
  19768. }
  19769. ,
  19770. t.prototype.startWarpState = function() {
  19771. this.warping = !0,
  19772. this.warpInterrupted = !1,
  19773. this.warpInterruptionBlackoutStyle = null,
  19774. this.warpInterruptionTravelTime = null
  19775. }
  19776. ,
  19777. t.prototype.endWarpState = function() {
  19778. this.warping = !1
  19779. }
  19780. ,
  19781. t.prototype.warpToPano = function(e, t, i, n) {
  19782. if (this.warping)
  19783. H.warn("Cannot warp when already warping");
  19784. else {
  19785. if (this.upcomingTransType = e,
  19786. this.activeTransType = null,
  19787. !this.setWarpDestPano())
  19788. return this.upcomingTransType = null,
  19789. void this.warpToNonPano(n);
  19790. if (this.player.mode !== O.PANORAMA)
  19791. return this.upcomingTransType = null,
  19792. this.discardSlow(),
  19793. void this.player.flyToNewMode({
  19794. mode: O.PANORAMA,
  19795. pano: this.warpDestPano,
  19796. duration: D.warp.outsideTime,
  19797. warpDest: this.warpDestHeroLoc,
  19798. callback: n,
  19799. force: !0
  19800. });
  19801. if (!this.warpDestPano)
  19802. return H.warn("no warp destination, callback dropped"),
  19803. void (this.upcomingTransType = null);
  19804. 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)
  19805. , o = this.chooseWarpPath(r);
  19806. if (o && this.upcomingTransType !== L.WALK) {
  19807. var a = function() {
  19808. this.waitingToWarp = !1,
  19809. this.warpToPano(e, t, i, n)
  19810. }
  19811. .bind(this);
  19812. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, a))
  19813. return void (this.waitingToWarp = !0)
  19814. }
  19815. this.player.currentPano || (H.warn("Arrived at a very strange spot!"),
  19816. this.player.currentPano = this.warpDestPano,
  19817. this.placeCpm(),
  19818. this.fadeOutCpm(D.path.fadeOutTime),
  19819. this.player.spider.draw()),
  19820. H.debug("Warping to pano ", this.warpDestPano.position),
  19821. this.upcomingTransType !== L.WALK && this.player.emit(g.PanoChosen, this.player.currentPano, this.warpDestPano),
  19822. this.startWarpState();
  19823. var s = function() {
  19824. this.endWarpState(),
  19825. n && n()
  19826. }
  19827. .bind(this);
  19828. o ? this.warpCameraTravel(r, t, i, s) : this.warpCameraAim(s)
  19829. }
  19830. }
  19831. ,
  19832. v.exports = t
  19833. }
  19834. ).call(this, "/js/objects/ShowPath.js")
  19835. }
  19836. , {
  19837. "../constants": 8,
  19838. "../effects": 16,
  19839. "../enum/BlackoutStyle": 18,
  19840. "../enum/ModelManagerEvents": 33,
  19841. "../enum/PlayerEvents": 40,
  19842. "../enum/RenderOrder": 42,
  19843. "../enum/Vectors": 50,
  19844. "../enum/Viewmode": 51,
  19845. "../enum/WarpStyle": 52,
  19846. "../gui/gui": 65,
  19847. "../model/ModelManager": 140,
  19848. "../objects/Snapshot": 153,
  19849. "../settings": 166,
  19850. "../shaders": 167,
  19851. "../util/easing": 186,
  19852. "../util/lerp": 188,
  19853. "../util/logger": 189,
  19854. "../util/math": 190,
  19855. "../util/texture": 194,
  19856. "../util/transitions": 195,
  19857. three: 217
  19858. }],
  19859. 152: [function(e, t, i) {
  19860. "use strict";
  19861. function n() {
  19862. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  19863. , t = new r.RawShaderMaterial({
  19864. fragmentShader: o.skysphere.fragmentShader,
  19865. vertexShader: o.skysphere.vertexShader,
  19866. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  19867. side: r.BackSide,
  19868. name: "skysphere"
  19869. });
  19870. t.uniforms.radius.value = e.parameters.radius,
  19871. r.Mesh.call(this, e, t)
  19872. }
  19873. var r = e("three")
  19874. , o = e("../shaders")
  19875. , a = e("../settings");
  19876. (n.prototype = Object.create(r.Mesh.prototype)).constructor = n,
  19877. t.exports = n
  19878. }
  19879. , {
  19880. "../settings": 166,
  19881. "../shaders": 167,
  19882. three: 217
  19883. }],
  19884. 153: [function(r, o, e) {
  19885. (function(e) {
  19886. "use strict";
  19887. function t(e) {
  19888. n.call(this, e),
  19889. this.sid = e.sid,
  19890. this.panoId = e.panoId,
  19891. this.orthoZoom = e.orthoZoom,
  19892. this.floorVisibility = e.floorVisibility,
  19893. this.thumbUrl = e.thumbUrl,
  19894. this.name = e.name,
  19895. this.zoom = e.zoom
  19896. }
  19897. var i = (r("three"),
  19898. r("../util/logger"))
  19899. , n = (r("../settings"),
  19900. r("../enum/Viewmode"),
  19901. r("../util/common"),
  19902. r("../util/transitions"),
  19903. r("../util/lerp"),
  19904. r("../util/ajax"),
  19905. r("../util/texture"),
  19906. r("./View"));
  19907. r("events").EventEmitter,
  19908. new i(e),
  19909. (t.prototype = Object.create(n.prototype)).isPano = function() {
  19910. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  19911. }
  19912. ,
  19913. o.exports = t
  19914. }
  19915. ).call(this, "/js/objects/Snapshot.js")
  19916. }
  19917. , {
  19918. "../enum/Viewmode": 51,
  19919. "../settings": 166,
  19920. "../util/ajax": 181,
  19921. "../util/common": 185,
  19922. "../util/lerp": 188,
  19923. "../util/logger": 189,
  19924. "../util/texture": 194,
  19925. "../util/transitions": 195,
  19926. "./View": 154,
  19927. events: 202,
  19928. three: 217
  19929. }],
  19930. 154: [function(o, a, e) {
  19931. (function(e) {
  19932. "use strict";
  19933. function t(e) {
  19934. e = e || {},
  19935. this.position = new i.Vector3,
  19936. this.quaternion = new i.Quaternion,
  19937. this.update(e)
  19938. }
  19939. var i = o("three")
  19940. , n = o("../util/logger")
  19941. , r = (o("../settings"),
  19942. o("../enum/Viewmode"),
  19943. o("../util/common"),
  19944. o("../util/transitions"),
  19945. o("../util/lerp"),
  19946. o("../util/ajax"),
  19947. o("../util/texture"),
  19948. o("events").EventEmitter);
  19949. new n(e),
  19950. (t.prototype = Object.create(r.prototype)).isValid = function() {
  19951. return !!this.cameraMode
  19952. }
  19953. ,
  19954. t.prototype.update = function(e) {
  19955. return this.cameraMode = e.cameraMode || this.cameraMode,
  19956. this.pano = e.pano || this.pano,
  19957. e.position && this.position.copy(e.position),
  19958. e.quaternion && this.quaternion.copy(e.quaternion),
  19959. this
  19960. }
  19961. ,
  19962. a.exports = t
  19963. }
  19964. ).call(this, "/js/objects/View.js")
  19965. }
  19966. , {
  19967. "../enum/Viewmode": 51,
  19968. "../settings": 166,
  19969. "../util/ajax": 181,
  19970. "../util/common": 185,
  19971. "../util/lerp": 188,
  19972. "../util/logger": 189,
  19973. "../util/texture": 194,
  19974. "../util/transitions": 195,
  19975. events: 202,
  19976. three: 217
  19977. }],
  19978. 155: [function(J, ee, e) {
  19979. (function(e) {
  19980. "use strict";
  19981. function t(e) {
  19982. this.currentPano = null,
  19983. this.nextPano = null,
  19984. this.camera = null,
  19985. this.paused = !1,
  19986. this.flying = !1,
  19987. this.sceneIntersectionPlane = null,
  19988. this.target = new B.Vector3,
  19989. this.mouse = new B.Vector3(1.1,1.1,.5),
  19990. this.mouseAtMouseDown = new B.Vector2,
  19991. this.mouseCouldBeClickToMove = !1,
  19992. this.mouseLastMoveTime = Date.now(),
  19993. this.mouseDown = !1,
  19994. this.mouseDownTimer = null,
  19995. this.couldBeLongTap = !1,
  19996. this.containsMouse = !0,
  19997. this.isTouchEvent = !1,
  19998. this.isPanoHover = !1,
  19999. this.reticule = new n(this),
  20000. this.panoMarkers = [],
  20001. this.spider = new s(this),
  20002. this.quaternion = new B.Quaternion,
  20003. this.position = new B.Vector3(15,10,15),
  20004. this.previousState = null,
  20005. this.lastInsideView = new o,
  20006. this.last360View = new o,
  20007. this.raycaster = new B.Raycaster,
  20008. this.intersect = null,
  20009. this.lastChangeTime = Date.now(),
  20010. this.history = new h,
  20011. this.cameraControls = null,
  20012. this.path = null,
  20013. this.model = null,
  20014. this.domElement = null,
  20015. this.cachedPanoCandidates = null,
  20016. this.basePanoSize = 0,
  20017. this.standardPanoSize = 0,
  20018. this.highPanoSize = 0,
  20019. this.ultraHighPanoSize = 0,
  20020. this.zoomLevel = 1,
  20021. this.zooming = 0,
  20022. this.zoomSpeed = .5,
  20023. this.scrollZoomSpeed = .06,
  20024. this.zoomSpeedAdjust = .05,
  20025. this.defaultZoomIncrement = .2,
  20026. this.baseFov = k.insideFOV,
  20027. this.zoomFov = this.baseFov,
  20028. this.zoomEnabled = !0,
  20029. this.preRenderingEnabled = !1,
  20030. this.setupCustomProperties(e),
  20031. this.zoomStats = new v,
  20032. this.modeTran = 'dollhouse-panorama'
  20033. this.currentCursor = '';
  20034. window.player = this
  20035. }
  20036. var B = J("three")
  20037. , i = J("./util/logger")
  20038. , n = J("./objects/Reticule")
  20039. , a = J("./objects/Panorama")
  20040. , r = J("./objects/ShowPath")
  20041. , o = J("./objects/View")
  20042. , s = (J("./objects/Snapshot"),
  20043. J("./objects/NSpider"))
  20044. , V = J("./enum/Viewmode")
  20045. , T = (J("./enum/TagStates"),
  20046. J("./enum/Vectors"))
  20047. , l = J("./enum/Keys")
  20048. , k = (J("./enum/AlignmentType"),
  20049. J("./settings"))
  20050. , x = J("./util/common")
  20051. , U = (J("./util/browser"),
  20052. J("./util/math"))
  20053. , H = J("./util/lerp")
  20054. , z = J("./util/easing")
  20055. , G = J("./util/transitions")
  20056. , c = J("events").EventEmitter
  20057. , h = (J("./shaders"),
  20058. J("./util/history"))
  20059. , S = (J("./util/camera"),
  20060. J("./model/ModelManager"),
  20061. J("./enum/PathDiscardMode"))
  20062. , M = J("./enum/PathDisplayMode")
  20063. , W = J("./enum/PlayerEvents")
  20064. , u = J("./enum/ControlEvents")
  20065. , d = J("./enum/ModelManagerEvents")
  20066. , R = J("./enum/WarpStyle")
  20067. , P = J("./enum/BlackoutStyle")
  20068. , p = J("./exception/BasicException")
  20069. , f = J("./enum/PanoSizeClass")
  20070. , g = (J("./tile/TileDownloader"),
  20071. J("./tile/TilePrioritizer"))
  20072. , m = (J("./enum/PanoramaEvents"),
  20073. J("./enum/ZoomEvents"))
  20074. , v = J("./util/ZoomStats")
  20075. , y = J("./constants")
  20076. , j = J("./util/common")
  20077. , A = J("./util/cameraLight")
  20078. //, C = J("hot")
  20079. , Y = new i(e)
  20080. , q = Object.freeze({
  20081. FlyToPano: G.getUniqueId(),
  20082. FlyToNewMode: G.getUniqueId(),
  20083. FlyToSameMode: G.getUniqueId(),
  20084. FlyToViewFloor: G.getUniqueId(),
  20085. LookTransition: G.getUniqueId(),
  20086. ZoomTransition: G.getUniqueId()
  20087. });
  20088. function I(e) {
  20089. for (var t = e.split(","), i = t[0].match(/:(.*?);/)[1], n = atob(t[1]), r = n.length, o = new Uint8Array(r); r--; )
  20090. o[r] = n.charCodeAt(r);
  20091. return new Blob([o],{
  20092. type: i
  20093. })
  20094. }
  20095. (t.prototype = Object.create(c.prototype)).init = function(e) {
  20096. this.modelManager = e.modelManager,
  20097. this.tileDownloader = e.tileDownloader,
  20098. this.panoRenderer = e.panoRenderer,
  20099. this.qualityManager = e.qualityManager,
  20100. this.domElement = e.container,
  20101. this.camera = e.camera,
  20102. this.tagManager = e.tagManager,
  20103. this.cameraControls = e.controls,
  20104. this.path = new r(e.director,this,e.controls),
  20105. this.basePanoSize = this.qualityManager.getPanoSize(f.BASE),
  20106. this.standardPanoSize = this.qualityManager.getPanoSize(f.STANDARD),
  20107. this.highPanoSize = this.qualityManager.getPanoSize(f.HIGH),
  20108. this.ultraHighPanoSize = this.qualityManager.getPanoSize(f.ULTRAHIGH),
  20109. this.tileDownloader.processPriorityQueue = !1,
  20110. this.tileDownloader.tilePrioritizer = new g(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  20111. this.bindEvents(e.container),
  20112. this.updateModel()
  20113. }
  20114. ,
  20115. t.prototype.screenShot = function(i) {
  20116. if (!this.flying && !this.flyingToTag) {
  20117. var n = this.sceneRenderer;
  20118. n.updateScreenSize(i)
  20119. this.model.panos.forEach(e=>{
  20120. if(e.marker){
  20121. e.marker.forceHide = e.marker.visible
  20122. e.marker.visible = !1;
  20123. }
  20124. })
  20125. /* for (var e in this.model.hots)
  20126. this.model.hots[e].mesh.visible = !1; */
  20127. player.model.hotGroup.visible = false
  20128. this.reticule.visible = !1,
  20129. this.reticule.forceUnvisible = !0,
  20130. this.path.currentPanoMarker.mesh.visible = !1,
  20131. setTimeout(function() {
  20132. n.renderer.clear(!0, !0, !0),
  20133. n.renderer.render(n.scene, n.camera);
  20134. var e = n.renderer.domElement.toDataURL(i.type, .9);
  20135. i.f && i.f(e)
  20136. n.updateScreenSize({
  20137. resize: !0
  20138. })
  20139. this.reticule.visible = !0
  20140. player.model.hotGroup.visible = true
  20141. this.model.panos.forEach(e=>{
  20142. e.marker && (e.marker.visible = e.marker.forceHide);
  20143. })
  20144. this.path.currentPanoMarker.mesh.visible = !0,
  20145. n.renderer.render(n.scene, n.camera)
  20146. }
  20147. .bind(this), 30)
  20148. }
  20149. }
  20150. ;
  20151. var E, _, b, w, O, L, D, N, F, X, Z, K, Q = J("scaleImg");
  20152. t.prototype.getWrapShot = function() {
  20153. var i = this.getSnapAngleInfo()
  20154. , n = ",{\r\t" + i
  20155. , r = arguments[0];
  20156. this.screenShot({
  20157. width: g_snapShotWidth,
  20158. height: g_snapShotHeight,
  20159. type: "image/jpeg",
  20160. f: function(e) {
  20161. if (r && r.__callback)
  20162. return r.__callback(e, i);
  20163. var t = new Image;
  20164. t.src = e,
  20165. t.onload = function() {
  20166. var e = function(r, i) {
  20167. function n(e, t) {
  20168. var i = o || r
  20169. , n = document.createElement("canvas");
  20170. n.width = i.width,
  20171. n.height = i.height,
  20172. n.getContext("2d").drawImage(i, 0, 0, i.width, i.height),
  20173. o = Q(e, n, t)
  20174. }
  20175. function e() {
  20176. var e = o || r
  20177. , t = I(e.src);
  20178. i.maxWeight && t.size > i.maxWeight && (n(i.maxWeight / t.size, "jpeg"),
  20179. t = I(e.src)),
  20180. (o = o || new Image).base64Src = e.src,
  20181. o.src = window.URL.createObjectURL(t)
  20182. }
  20183. var o, t = Math.max(r.width, r.height);
  20184. return "png" != i.toType && ("jpeg" == i.oldType ? (t > i.maxSize && n(i.maxSize / t, "jpeg"),
  20185. e()) : "png" == i.oldType && i.maxWeight && i.weight > i.maxWeight && (n(t > i.maxSize ? i.maxSize / t : 1, "jpeg"),
  20186. e())),
  20187. o || r
  20188. }(this, {
  20189. maxSize: g_snapShotWidth,
  20190. oldType: "jpeg"
  20191. });
  20192. e.src.replace(function(e) {
  20193. return "image/" + (e = e.toLowerCase().replace(/jpg/i, "jpeg")).match(/png|jpeg|bmp|gif/)[0]
  20194. }("image/jpeg"), "image/octet-stream");
  20195. var t = "snap" + (new Date).getTime();
  20196. !function(e, t) {
  20197. var i = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
  20198. i.href = e,
  20199. i.download = t;
  20200. var n = document.createEvent("MouseEvents");
  20201. n.initMouseEvent("click", !0, !1, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null),
  20202. i.dispatchEvent(n)
  20203. }(e.src, t + ".jpg"),
  20204. n += ',\r\t"thumbnail_signed_src":"' + t + '.jpg",',
  20205. n += '\r\t"sid":"' + t + '",',
  20206. n += '\r\t"name":"' + t + '"\r}',
  20207. logData(n)
  20208. }
  20209. }
  20210. })
  20211. }
  20212. /* ,
  20213. t.prototype.getSnapAngleInfo = function() {
  20214. var e = {}
  20215. , t = '"metadata":{'
  20216. , i = this.camera.quaternion.clone();
  20217. switch (this.mode) {
  20218. case "panorama":
  20219. e.scan_id = this.currentPano.id,
  20220. t += '"scan_id":"' + this.currentPano.id + '",';
  20221. break;
  20222. case "floorplan":
  20223. e.camera_mode = 1,
  20224. (i = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))).multiply(this.camera.quaternion),
  20225. t += '"camera_mode":1,',
  20226. t += '"ortho_zoom":' + U.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ",";
  20227. break;
  20228. case "dollhouse":
  20229. e.camera_mode = 2,
  20230. t += '"camera_mode":2,'
  20231. }
  20232. var n = new B.Quaternion(i.x,i.y,i.z,i.w);
  20233. return n.multiply(new B.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0).conjugate()),
  20234. n.x *= -1,
  20235. n.w *= -1,
  20236. e.camera_position = U.toPrecision(this.camera.position.toArray(), 4),
  20237. e.camera_quaternion = U.toPrecision(n.toArray(), 4),
  20238. e.zoom = this.zoomLevel,
  20239. t += '"camera_position":[' + e.camera_position + '],"camera_quaternion":[' + e.camera_quaternion + '], "zoom":' + e.zoom + "}"
  20240. }
  20241. , */
  20242. t.prototype.getSnapAngleInfo = function(){
  20243. var info = {};
  20244. var str = '"metadata":{';
  20245. var q = this.camera.quaternion.clone();
  20246. switch (this.mode) {
  20247. case "panorama":
  20248. info.scan_id = this.currentPano.id;
  20249. str += ('"scan_id":"'+this.currentPano.id+'",');
  20250. break;
  20251. case "floorplan":
  20252. info.camera_mode = 1;
  20253. q = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))
  20254. q.multiply(this.camera.quaternion);
  20255. str += ('"camera_mode":1,');
  20256. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  20257. str += ('"ortho_zoom":'+ U.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  20258. break;
  20259. case "dollhouse":
  20260. info.camera_mode = 2;
  20261. str += ('"camera_mode":2,');
  20262. break;
  20263. }
  20264. info.camera_position = U.toPrecision(this.camera.position.toArray(),4);
  20265. //console.log(info.camera_position)
  20266. info.camera_quaternion = U.toPrecision(q.toArray(),4);
  20267. /* if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的 fyz 对相机截屏的角度进行校对
  20268. var out = new B.Quaternion(q.x, q.y, q.z, q.w)
  20269. out.multiply(new B.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  20270. out.x *= -1;
  20271. out.w *= -1;
  20272. info.camera_quaternion = U.toPrecision(out.toArray(),4);
  20273. }else{
  20274. info.camera_quaternion = U.toPrecision(q.toArray(),4);;
  20275. } */
  20276. info.zoom = this.zoomLevel;
  20277. //console.log(info.camera_quaternion)
  20278. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  20279. // fyz 扩展编辑页面, 加上导览点缩放值
  20280. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  20281. console.log(str)
  20282. return str;
  20283. }
  20284. //------end
  20285. ,
  20286. t.prototype.setupCustomProperties = function(e) {
  20287. var i = e || V.PANORAMA;
  20288. Object.defineProperty(this, "mode", {
  20289. get: function() {
  20290. return i
  20291. },
  20292. set: function(e) {
  20293. var t = i;
  20294. i = e,
  20295. this.onModeUpdated(t, i)
  20296. }
  20297. })
  20298. }
  20299. ,
  20300. t.prototype.isInMode = function() {
  20301. for (var e = 0; e < arguments.length; e++)
  20302. if (this.mode === arguments[e])
  20303. return !0;
  20304. return !1
  20305. }
  20306. ,
  20307. t.prototype.isOutsideMode = function(e) {
  20308. return (e = e || this.mode) === V.DOLLHOUSE || e === V.FLOORPLAN
  20309. }
  20310. ,
  20311. t.prototype.is360View = function(e, t) {
  20312. return e === V.PANORAMA && t && !t.isAligned()
  20313. }
  20314. ,
  20315. t.prototype.setScene = function(e) {
  20316. this.sceneIntersectionPlane = e.plane,
  20317. this.path.setScene(e),
  20318. this.moveReticuleToScene(e)
  20319. }
  20320. ,
  20321. t.prototype.moveReticuleToScene = function(e) {
  20322. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20323. e.add(this.reticule)
  20324. }
  20325. ,
  20326. t.prototype.updateModel = function() {
  20327. function n(e) {
  20328. var t = this.cameraControls.cameras[V.DOLLHOUSE]
  20329. , i = this.cameraControls.controls[V.DOLLHOUSE]
  20330. , n = t.position.y + (e - i.target.y)
  20331. , r = k.showFloorDuration + k.showFloorDelay;
  20332. G.start(H.property(i.target, "y", e), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor),
  20333. G.start(H.property(t.position, "y", n), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor)
  20334. }
  20335. this.model = this.modelManager.getActiveModel(),
  20336. this.model.on("floor.changed", function(e, t, i) {
  20337. this.mode === V.DOLLHOUSE && e !== i && n.call(this, e.center.y)
  20338. }
  20339. .bind(this)),
  20340. this.model.on("allfloors.toggled", function(e, t) {
  20341. if (this.mode === V.DOLLHOUSE) {
  20342. var i = e ? this.model.center.y : i = t.center.y;
  20343. n.call(this, i)
  20344. }
  20345. }
  20346. .bind(this)),
  20347. this.on(W.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  20348. var t = this;
  20349. this.model.panos.list.forEach(function(e) {
  20350. e.vrMarker.addEventListener("click", function() {
  20351. t.flyToPano({
  20352. pano: e
  20353. })
  20354. })
  20355. })
  20356. }
  20357. ,
  20358. t.prototype.updateModelDependentData = function() {
  20359. this.cameraControls.setModelForControls(this.model),
  20360. this.getPanoMarkersFromModel(this.model)
  20361. }
  20362. ,
  20363. t.prototype.onModelChanged = function() {
  20364. this.updateModel(),
  20365. this.updateModelDependentData()
  20366. }
  20367. ,
  20368. t.prototype.getPanoMarkersFromModel = function(e) {
  20369. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  20370. return t.marker ? e.concat(t.marker) : e
  20371. }, [])
  20372. }
  20373. ,
  20374. t.prototype.handleControlMove = function(e) {
  20375. this.emit(W.Move, e)
  20376. }
  20377. ,
  20378. t.prototype.handleControlInputStart = function(e) {
  20379. this.emit(W.InputStart, e)
  20380. }
  20381. ,
  20382. t.prototype.onModeUpdated = function(e, t) {
  20383. this.cameraControls.activateControls(t),
  20384. this.emit(W.ModeChanged, e, t)
  20385. }
  20386. ,
  20387. t.prototype.isWarping = function() {
  20388. return this.path.warping
  20389. }
  20390. ,
  20391. t.prototype.isWaitingToWarp = function() {
  20392. return this.path.waitingToWarp
  20393. }
  20394. ,
  20395. t.prototype.getLabelScaleFactor = function() {
  20396. if (this.isOutsideMode()) {
  20397. return Math.sqrt(this.cameraControls.controls[V.FLOORPLAN].currentScale / 10)
  20398. }
  20399. return .5
  20400. }
  20401. ,
  20402. t.prototype.bindEvents = function(e) {
  20403. e !== document && e.setAttribute("tabindex", -1),
  20404. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  20405. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  20406. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  20407. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  20408. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  20409. this.modelManager.on(d.ActiveModelChanged, this.onModelChanged.bind(this)),
  20410. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  20411. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  20412. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  20413. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  20414. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  20415. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  20416. document.addEventListener("pointerup", ()=>{//add
  20417. window.transformControls && transformControls.onPointerUp()
  20418. }),
  20419. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  20420. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  20421. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  20422. this.cameraControls.on(u.Move, this.handleControlMove.bind(this)),
  20423. this.cameraControls.on(u.InputStart, this.handleControlInputStart.bind(this)),
  20424. this.cameraControls.on(u.Pinch, this.handleControlPinch.bind(this)),
  20425. this.cameraControls.on(u.Scroll, this.handleControlScroll.bind(this)),
  20426. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),
  20427. //window.addEventListener("tourAudioEnded", this.changeMusic.bind(this)),
  20428. window.getSeft && getSeft(this)
  20429. }
  20430. ,
  20431. t.prototype.onMouseDown = function(e) {
  20432. e.currentTarget !== document && e.currentTarget.focus(),
  20433. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  20434. this.updateIntersect())
  20435. }
  20436. ,
  20437. t.prototype.onMouseMove = function(e) {
  20438. this.isTouchEvent = !1,
  20439. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20440. }
  20441. ,
  20442. t.prototype.onMouseOver = function(e) {
  20443. this.containsMouse = !0,
  20444. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  20445. }
  20446. ,
  20447. t.prototype.onMouseOut = function(e) {
  20448. this.containsMouse = !1
  20449. }
  20450. ,
  20451. t.prototype.onMouseUp = function(e) {
  20452. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  20453. }
  20454. ,
  20455. t.prototype.onTouchStart = function(e) {
  20456. if (e.currentTarget !== document && e.currentTarget.focus(),
  20457. !this.mouseDown) {
  20458. this.couldBeLongTap = !0;
  20459. var t = x.average(e.changedTouches, "clientX")
  20460. , i = x.average(e.changedTouches, "clientY");
  20461. this.handleInputStart.call(this, t, i, !0),
  20462. this.mouseDownTimer = setTimeout(function() {
  20463. this.updateIntersect(),
  20464. this.handleInputEnd.call(this, t, i, !0)
  20465. }
  20466. .bind(this), k.input.longTapThreshold)
  20467. }
  20468. }
  20469. ,
  20470. t.prototype.onTouchMove = function(e) {
  20471. var t = x.average(e.changedTouches, "clientX")
  20472. , i = x.average(e.changedTouches, "clientY");
  20473. this.handleInputMove.call(this, t, i, !0)
  20474. }
  20475. ,
  20476. t.prototype.onTouchEnd = function(e) {
  20477. if (clearTimeout(this.mouseDownTimer),
  20478. this.mouseDown) {
  20479. this.couldBeLongTap = !1,
  20480. this.updateIntersect();
  20481. var t = x.average(e.changedTouches, "clientX")
  20482. , i = x.average(e.changedTouches, "clientY");
  20483. this.handleInputEnd.call(this, t, i, !0)
  20484. }
  20485. }
  20486. ,
  20487. t.prototype.onPointerDown = function(e) {
  20488. return e.currentTarget !== document && e.currentTarget.focus(),
  20489. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  20490. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20491. void (this.mouseDownTimer = setTimeout(function() {
  20492. this.updateIntersect(),
  20493. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20494. }
  20495. .bind(this), k.input.longTapThreshold)))
  20496. }
  20497. ,
  20498. t.prototype.onPointerMove = function(e) {
  20499. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  20500. }
  20501. ,
  20502. t.prototype.onPointerUp = function(e) {
  20503. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  20504. this.couldBeLongTap = !1,
  20505. this.updateIntersect(),
  20506. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  20507. }
  20508. ,
  20509. t.prototype.onPointerOut = function(e) {
  20510. this.mouseDown = !1
  20511. }
  20512. ,
  20513. t.prototype.onPointerCancel = function(e) {
  20514. this.mouseDown = !1
  20515. }
  20516. ,
  20517. t.prototype.onKeyDown = function(e) {
  20518. var t = function() {
  20519. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, "key")
  20520. }
  20521. .bind(this)
  20522. , i = e.which;
  20523. switch (i) {
  20524. case l.F:
  20525. t(),
  20526. this.changeFloor(-1);
  20527. break;
  20528. case l.R:
  20529. t(),
  20530. this.changeFloor(1)
  20531. }
  20532. if (this.mode === V.PANORAMA)
  20533. switch (i) {
  20534. case l.UPARROW:
  20535. case l.W:
  20536. this.flyLocalDirection(T.FORWARD.clone());
  20537. break;
  20538. case l.DOWNARROW:
  20539. case l.S:
  20540. this.flyLocalDirection(T.BACK.clone());
  20541. break;
  20542. case l.A:
  20543. this.flyLocalDirection(T.LEFT.clone());
  20544. break;
  20545. case l.D:
  20546. this.flyLocalDirection(T.RIGHT.clone())
  20547. }
  20548. }
  20549. ,
  20550. t.prototype.handleScrollPinchZoom = function(e) {
  20551. var t = e
  20552. , i = this.zoomLevel;
  20553. this.zoomBy(t),
  20554. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  20555. }
  20556. ,
  20557. t.prototype.handleControlPinch = function(e) {
  20558. k.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new B.Vector3(0,0,e).normalize())
  20559. }
  20560. ,
  20561. t.prototype.handleControlScroll = function(e) {
  20562. k.zoom.enabled ? (0 < e ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  20563. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new B.Vector3(0,0,-e).normalize())
  20564. }
  20565. ,
  20566. t.prototype.handleInputStart = function(e, t, i) {
  20567. var n = this.handelPadding(e, t);
  20568. e = n.x,
  20569. t = n.y,
  20570. this.isTouchEvent = i,
  20571. U.convertScreenPositionToNDC(e, t, this.mouse),
  20572. U.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  20573. this.mouseCouldBeClickToMove = !0,
  20574. this.mouseDown = !0
  20575. //this.mouseCouldBeClickToMove && window.Hotpoint && (new Hotpoint).state(this, C)
  20576. this.mouseCouldBeClickToMove && editTool.hotpoint.addHot()
  20577. window.transformControls && transformControls.onPointerDown()
  20578. }
  20579. ,
  20580. t.prototype.handelPadding = function(e, t) {
  20581. return this.pad || (this.pad = {
  20582. x: dom.getOffset("left", $("#player")[0]),
  20583. y: dom.getOffset("top", $("#player")[0])
  20584. }),
  20585. {
  20586. x: e - this.pad.x,
  20587. y: t - this.pad.y
  20588. }
  20589. }
  20590. ,
  20591. t.prototype.handleInputMove = function(e, t, i) {
  20592. var n = this.handelPadding(e, t);
  20593. e = n.x,
  20594. t = n.y,
  20595. this.isTouchEvent = i,
  20596. U.convertScreenPositionToNDC(e, t, this.mouse);
  20597. var moveToleranceNDC = (window.transformControls && transformControls.visible) ? 0.0000001 : k.input.moveToleranceNDC
  20598. this.mouseAtMouseDown.distanceTo(this.mouse) > moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  20599. this.couldBeLongTap = !1,
  20600. clearTimeout(this.mouseDownTimer)),
  20601. this.mouseLastMoveTime = Date.now(),
  20602. this.reticule.move(e, t, i)
  20603. window.transformControls && transformControls.onPointerMove()
  20604. }
  20605. ,
  20606. t.prototype.handleInputEnd = function(e, t, i) {
  20607. if (this.isTouchEvent = i,
  20608. this.mouseDown = !1,
  20609. this.cameraControls.controls[V.PANORAMA].emit("interaction.direct"),
  20610. !i && this.couldBeLongTap)
  20611. return !0;
  20612. if (this.handleLongTap())
  20613. return !0;
  20614. window.transformControls && transformControls.onPointerUp()
  20615. if (this.mouseCouldBeClickToMove) {
  20616. if (this.flying)
  20617. return this.path.activeTransType === R.WALK && this.emit(W.WarpInterruptedWithFlyTo, this.path.activeTransType),
  20618. !0;
  20619. //add----
  20620. if (this.checkHotClick())
  20621. return !0;
  20622. if (window.VisiSet && VisiSet.setPanoVisible) {//正在设置漫游可行
  20623. this.intersect && this.intersect.object.visible && VisiSet.dealPanoVisible(this.intersect.object.name);
  20624. return;
  20625. }
  20626. if (window.VisiSet && VisiSet.setTagVisible ) {
  20627. VisiSet.tagVsetting && this.intersect && this.intersect.object.visible && VisiSet.dealTagVisible(VisiSet.tagVsetting, this.intersect.object.name);
  20628. return;
  20629. }
  20630. if (window.VisiSet && VisiSet.setPanoLog ) {
  20631. this.intersect && this.intersect.object.visible && VisiSet.dealPanoLogClick( this.intersect.object);
  20632. return;
  20633. }
  20634. if(this.hoveringPlane){
  20635. this.clickOverlay(this.hoveringPlane)
  20636. return;
  20637. }
  20638. if(window.EditOverlay && EditOverlay.objCursorType == "overlay"){
  20639. return EditOverlay.addPlane({intersect:this.intersect});
  20640. }
  20641. /* if(objects.mainDesign && objects.mainDesign.editing && objects.mainDesign.handleClickEnd(this)){//许钟文加
  20642. if(objects.mainDesign.editType == "wallDesign" && this.mode == "panorama") return !0;
  20643. else if(objects.mainDesign.editType == "addOverlay")return !0;
  20644. } */
  20645. //----------
  20646. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, this.isTouchEvent ? "touch" : "mouse"),
  20647. this.history.invalidate(),
  20648. this.intersect)
  20649. return this.flyToPanoClosestToMouse();
  20650. if (this.mode === V.PANORAMA) {
  20651. var n = this.closestPanoInDirection(this.getMouseDirection());
  20652. return n ? this.flyToPano({
  20653. pano: n
  20654. }) : this.bump(this.getMouseDirection())
  20655. }
  20656. }
  20657. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  20658. }
  20659. ,
  20660. t.prototype.handleLongTap = function() {
  20661. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== V.PANORAMA))
  20662. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.LongTap, "touch"),
  20663. !0
  20664. }
  20665. ,
  20666. t.prototype.checktagClick = function() {
  20667. if (this.tagManager.intersectTag) {
  20668. var e = this.isTouchEvent
  20669. , t = this.tagManager.clickedOnTag(e, this);
  20670. return e || t || G.cancelById(q.LookTransition),
  20671. !0
  20672. }
  20673. if (this.tagManager.activeTag)
  20674. return this.tagManager.dismissActiveTag(),
  20675. !1
  20676. }
  20677. ,
  20678. t.prototype.rankedtagInDirection = function(e, t) {
  20679. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  20680. }
  20681. ,
  20682. t.prototype.start = function(e) {
  20683. $(".toolLeft").removeClass("unable");
  20684. $(".toolTop").removeClass("unable");
  20685. //-------------------
  20686. window.initTransformCtl(B)
  20687. //this.model.loadOverlays()
  20688. //window.EditOverlay && window.EditOverlay.init(B);
  20689. window.VisiSet && VisiSet.init()
  20690. //-------------------
  20691. var t = e.mode
  20692. , i = e.pano
  20693. , n = e.position
  20694. , r = e.quaternion
  20695. , o = e.tag
  20696. , a = e.quickstart
  20697. , s = $.Deferred();
  20698. this.updateModelDependentData(),
  20699. this.updateFromControls(),
  20700. this.findDefaultViews();
  20701. var l = this.is360View(t, i);
  20702. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  20703. s.done(function(e) {
  20704. this.emit(W.Ready, l, e, o)
  20705. }
  20706. .bind(this)),
  20707. s.promise()
  20708. }
  20709. ,
  20710. t.prototype.startOutside = function(e, t) {
  20711. var i = e.mode
  20712. , n = e.pano
  20713. , r = e.position
  20714. , o = e.quaternion
  20715. , a = e.zoom
  20716. , s = e.floorVisibility
  20717. , l = e.tag;
  20718. this.emit(W.StartOutside, k[i].transitionTime),
  20719. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  20720. G.cancelById(q.FlyToViewFloor),
  20721. i === V.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  20722. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  20723. }
  20724. ,
  20725. t.prototype.startInside = function(e, t, i, n, r) {
  20726. r = r || $.Deferred();
  20727. var o = (this.currentPano = e) && !e.isAligned();
  20728. if (t = o ? e.position : t || e.position,
  20729. i = i || e.quaternion,
  20730. e) {
  20731. var a = this.startInside.bind(this, e, t, i, n, r);
  20732. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  20733. return
  20734. }
  20735. //add
  20736. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  20737. //this.updateHotVisible()
  20738. //EditOverlay.updatePano()
  20739. editTool.hotpoint.updatePano()
  20740. Hot.updateVisibles([this.currentPano])
  20741. return this.mode = V.PANORAMA,
  20742. e.floor.enter(this.mode),
  20743. this.emit(W.PanoChosen, this.currentPano, this.currentPano),
  20744. this.switchCameraMode(this.mode, i),
  20745. this.emit(W.StartInside, o),
  20746. r.resolve(!0),
  20747. r
  20748. }
  20749. ,
  20750. t.prototype.startInsideWithFlyin = function(i, e, n, t, r) {
  20751. if (r = r || $.Deferred(),
  20752. this.dollhouseMode(),
  20753. !i)
  20754. return Y.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  20755. r.resolve(!1),
  20756. r;
  20757. e = e || i.position;
  20758. var o = n || this.cameraControls.activeControl.camera.quaternion
  20759. , a = i.position;
  20760. return this.fitDollhouse(a, e, o),
  20761. setTimeout(function(e) {
  20762. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = e);
  20763. var t = {
  20764. mode: V.PANORAMA,
  20765. pano: i,
  20766. quaternion: n,
  20767. callback: function() {
  20768. this.emit(W.FlyinFinished),
  20769. r.resolve(!0)
  20770. }
  20771. .bind(this)
  20772. };
  20773. this.flyToNewMode(t)
  20774. }
  20775. .bind(this, this.cameraControls.activeControl.maxDistance), k.startupFlyinDelay),
  20776. r
  20777. }
  20778. ,
  20779. t.prototype.checkAndWaitForPanoLoad = (Z = {},
  20780. K = {},
  20781. function(t, e, i, n, r, o, a, s, l, c) {
  20782. if (function() {
  20783. for (var e in Z)
  20784. if (Z.hasOwnProperty(e) && Z[e] && performance.now() - K[e] < 5e3)
  20785. return !0;
  20786. return !1
  20787. }())
  20788. return !0;
  20789. var h = function(e, t, i) {
  20790. j.delayOneFrame(function() {
  20791. Z[e] = !1,
  20792. r && r(t, i)
  20793. }
  20794. .bind(this))
  20795. }
  20796. .bind(this, t.id)
  20797. , u = function(e, t) {
  20798. j.delayOneFrame(function() {
  20799. Z[e] = !1,
  20800. o && o(t)
  20801. }
  20802. .bind(this))
  20803. }
  20804. .bind(this, t.id);
  20805. try {
  20806. return null != s || (s = !0),
  20807. 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),
  20808. Z[t.id] && (K[t.id] = performance.now()),
  20809. Z[t.id]
  20810. } catch (e) {
  20811. throw Z[t.id] = !1,
  20812. K[t.id] = performance.now() - 5e3,
  20813. e
  20814. }
  20815. }
  20816. ),
  20817. t.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  20818. if (!e)
  20819. throw new p("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  20820. return r && this.model.waitForLoad(e, function() {
  20821. return e.isLoaded(i)
  20822. }),
  20823. !e.isLoaded(t) && (e.loadCube(t).done(n),
  20824. !0)
  20825. }
  20826. ,
  20827. t.prototype.checkAndWaitForTiledPanoLoad = (X = new B.Vector3,
  20828. function(e, t, i, n, r, o, a, s) {
  20829. if (!e)
  20830. throw new p("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  20831. return X.copy(T.FORWARD),
  20832. this.getDirection(X),
  20833. !e.isLoaded(t) && (o && this.model.waitForLoad(e, function() {
  20834. return e.isLoaded(t)
  20835. }),
  20836. e.loadTiledPano(t, X, null, a, s).done(function(e, t) {
  20837. i && i(e, t)
  20838. }
  20839. .bind(this)).fail(function(e) {
  20840. n && n(e)
  20841. }
  20842. .bind(this)).progress(function(e, t, i) {
  20843. r && r(e, t, i)
  20844. }
  20845. .bind(this)),
  20846. !0)
  20847. }
  20848. ),
  20849. t.prototype.switchCameraMode = function(e, t) {
  20850. var i = this.cameraControls.controls[e]
  20851. , n = i.camera;
  20852. switch (e) {
  20853. case V.PANORAMA:
  20854. n.position.copy(this.currentPano.position);
  20855. var r = t ? T.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  20856. i.lookAt(r.add(n.position));
  20857. break;
  20858. case V.DOLLHOUSE:
  20859. var o = this.position.clone();
  20860. 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),
  20861. n.position.copy(o),
  20862. i.target.copy(this.target.clone().setY(this.model.center.y));
  20863. break;
  20864. //for多楼层 且 让模型刚好适应屏幕
  20865. /* var box = this.model.boundingBox.clone();
  20866. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  20867. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  20868. var fov = A.getHFOVFromVFOV(k.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  20869. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  20870. console.log(boxSize.x,distance, boxSize.length() / 2)
  20871. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  20872. if(this.mode === V.PANORAMA){
  20873. i.target.copy(this.model.center);
  20874. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  20875. }else{
  20876. i.target.copy(this.target.clone().setY(this.model.center.y))
  20877. var vec = T.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  20878. }
  20879. vec.multiplyScalar(distance )
  20880. n.position.copy(i.target.clone().add(vec)) */
  20881. break
  20882. case V.FLOORPLAN:
  20883. n.position.copy(this.model.center).setY(k.floorplan.cameraHeight),
  20884. i.target.copy(this.model.center).setY(0),
  20885. i.zoomToContain(this.model.size),
  20886. i.rotateToView(this.model.size, this.getDirection())
  20887. }
  20888. i.update(0)
  20889. }
  20890. ,
  20891. t.prototype.update = (new B.Vector3,
  20892. N = {},
  20893. F = [],
  20894. function(e) {
  20895. this.updatePersistentZooming(e),
  20896. this.updateFromControls(e),
  20897. this.getCurrentNodePanos(F)
  20898. if(this.hasChanged(N)){
  20899. this.lastChangeTime = Date.now(),
  20900. !this.mouseDown && this.containsMouse && this.updateIntersect()
  20901. this.emit(W.ViewChanged)
  20902. //add:
  20903. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog)) VisiSet.updateFootIconSize();
  20904. this.intersectHot && this.intersectHot.showTitle()
  20905. editTool.hotpoint.showTitileSpots && editTool.hotpoint.showTitileSpots.forEach(e=>e.showTitle())
  20906. for(var i in this.model.hots){
  20907. this.model.hots[i].update(this)
  20908. }
  20909. /* if(this.mode == 'panorama')this.model.hotGroup&&this.model.hotGroup.children.forEach(overlay=>{
  20910. overlay.update()
  20911. }) */
  20912. this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z },this.cameraControls.controls.panorama.lon);
  20913. }
  20914. this.model.supportsTiles && (this.updateTileDownloader(F),
  20915. this.updatePanoRenderer(F)),
  20916. this.updatePreRendering(F),
  20917. this.reticule.update(),
  20918. this.path.update(),
  20919. this.spider.update(),
  20920. this.cachedPanoCandidates && k.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  20921. this.updateControlLocks(),
  20922. this.model.supportsTiles && this.updateZoomPano()
  20923. }
  20924. ),
  20925. t.prototype.updatePersistentZooming = function(e) {
  20926. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : -1 === this.zooming && this.zoomBy(1 - this.zoomSpeed * e)
  20927. }
  20928. ,
  20929. t.prototype.updateControlLocks = function() {
  20930. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[V.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  20931. }
  20932. ,
  20933. t.prototype.updatePanoRenderer = (D = new B.Vector3,
  20934. function(e) {
  20935. var t = this.nextPano || this.currentPano;
  20936. this.panoRenderer.hasQueuedTiles() && t && (D.copy(T.FORWARD),
  20937. this.getDirection(D),
  20938. this.panoRenderer.updateDirection(D))
  20939. }
  20940. ),
  20941. t.prototype.cleanupInactivePanos = (O = [],
  20942. L = [],
  20943. function() {
  20944. O.length = 0,
  20945. O.push(this.currentPano),
  20946. this.nextPano && O.push(this.nextPano);
  20947. for (var e = L.length = 0; e < this.panoRenderer.activePanos.length; e++)
  20948. L.push(this.panoRenderer.activePanos[e]);
  20949. for (var t = 0; t < L.length; t++) {
  20950. for (var i = L[t], n = !0, r = 0; r < O.length; r++)
  20951. i.id === O[r].id && (n = !1);
  20952. n && i.exit()
  20953. }
  20954. }
  20955. ),
  20956. t.prototype.updatePreRendering = (w = {},
  20957. function(e) {
  20958. if (1 === k.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  20959. var t = this.nextPano || this.currentPano;
  20960. if (t && e && 1 < e.length) {
  20961. var i = e.findIndex(function(e) {
  20962. if (e.id === t.id)
  20963. return !0
  20964. });
  20965. if (0 <= i && i + 1 < e.length) {
  20966. var n = e[i + 1];
  20967. n.isLoaded(this.basePanoSize) || w[n.id] || (window.setTimeout(function(e) {
  20968. this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  20969. window.setTimeout(function(e) {
  20970. w[e.id] = !1
  20971. }
  20972. .bind(this, e), k.tiling.panoPreRenderRepeatDelay)
  20973. }
  20974. .bind(this, n), k.tiling.panoPreRenderDelay),
  20975. w[n.id] = !0)
  20976. }
  20977. }
  20978. }
  20979. }
  20980. ),
  20981. t.prototype.enablePreRendering = function() {
  20982. this.preRenderingEnabled = !0
  20983. }
  20984. ,
  20985. t.prototype.disablePreRendering = function() {
  20986. this.preRenderingEnabled = !1,
  20987. this.cleanupInactivePanos()
  20988. }
  20989. ,
  20990. t.prototype.updateTileDownloader = (b = new B.Vector3,
  20991. function(e) {
  20992. var t = this.nextPano || this.currentPano;
  20993. t && (b.copy(T.FORWARD),
  20994. this.getDirection(b),
  20995. this.tileDownloader.tilePrioritizer.updateCriteria(t, this.position, b, 0 < e.length ? e : null),
  20996. this.tileDownloader.processPriorityQueue = !0)
  20997. }
  20998. ),
  20999. t.prototype.updateFromControls = function(e) {
  21000. null != e || (e = 0),
  21001. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  21002. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  21003. this.position.copy(this.cameraControls.activeControl.camera.position),
  21004. this.target.copy(this.cameraControls.activeControl.target),
  21005. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  21006. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  21007. this.camera.position.copy(this.position),
  21008. this.camera.quaternion.copy(this.quaternion),
  21009. this.camera.updateMatrix(),
  21010. this.camera.updateMatrixWorld()
  21011. }
  21012. ,
  21013. t.prototype.hasChanged = function(e) {
  21014. if (!this.previousState)
  21015. return this.previousState = {
  21016. allFloorsVisible: this.model.allFloorsVisible,
  21017. position: this.position.clone(),
  21018. quaternion: this.quaternion.clone(),
  21019. mouse: this.mouse.clone(),
  21020. labelScaleFactor: this.getLabelScaleFactor(),
  21021. currentFloor: this.model.currentFloor,
  21022. projectionMatrix: this.camera.projectionMatrix.clone(),
  21023. worldMatrix: this.camera.matrixWorld.clone(),
  21024. mode: this.mode,
  21025. modelPosition: this.model.position.clone(),
  21026. modelCenter: this.model.center.clone(),
  21027. zoomLevel: this.zoomLevel
  21028. },
  21029. !0;
  21030. 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;
  21031. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  21032. e.moved = !this.position.equals(this.previousState.position),
  21033. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  21034. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  21035. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  21036. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  21037. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  21038. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  21039. e.modeChanged = this.mode !== this.previousState.mode,
  21040. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  21041. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  21042. e.nextPanoActive = null !== this.nextPano,
  21043. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  21044. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  21045. this.previousState.position.copy(this.position),
  21046. this.previousState.quaternion.copy(this.quaternion),
  21047. this.previousState.mouse.copy(this.mouse),
  21048. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  21049. this.previousState.currentFloor = this.model.currentFloor,
  21050. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21051. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21052. this.previousState.mode = this.mode,
  21053. this.previousState.modelPosition.copy(this.model.position),
  21054. this.previousState.modelCenter.copy(this.model.center),
  21055. this.previousState.zoomLevel = this.zoomLevel,
  21056. !t
  21057. }
  21058. ,
  21059. t.prototype.updateIntersect = function() {
  21060. var e = this.flying || this.isWarping()
  21061. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  21062. , i = G.getById(q.LookTransition);
  21063. e || t || this.isTouchEvent || i.length && i[0].running;
  21064. {//clear:
  21065. if(this.intersectHot) this.intersectHot.hideTitle()
  21066. this.intersectHot = null
  21067. $("#player").css("cursor", "")
  21068. $(".toolRight .spotList ul li").removeClass("active")
  21069. }
  21070. var deal = ()=>{
  21071. if(this.intersect && this.intersect.object.visible ){
  21072. if("hotSprite" == this.intersect.object.type){
  21073. this.intersectHot = this.intersect.object
  21074. while(!(this.intersectHot instanceof Hot)){
  21075. this.intersectHot = this.intersectHot.parent
  21076. }
  21077. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active")
  21078. this.intersectHot.showTitle()
  21079. }
  21080. }
  21081. }
  21082. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog)) {
  21083. this.intersect = this.getMouseIntersect(null, this.model.hotGroup.children.concat(VisiSet.footIcons||[]) );
  21084. deal()
  21085. if(this.intersect){
  21086. $("#player").css("cursor", "pointer");
  21087. }
  21088. if(this.intersectHot){
  21089. this.intersect = null
  21090. }
  21091. return
  21092. }else if (g_HotStatus) {//加热点
  21093. this.intersect = this.getMouseIntersect(null, this.model.colliders.concat(this.model.skybox));
  21094. if(this.intersect){
  21095. $("#player").css("cursor", "cell")
  21096. }else{
  21097. $("#player").css("cursor", "not-allowed")
  21098. }
  21099. return;
  21100. }else{
  21101. if(this.model.hotGroup){
  21102. if(editTool.atPanel == 'hotpoint'){
  21103. var hots = this.model.hotGroup.children
  21104. }else{
  21105. var hots = this.model.hotGroup.children.filter(e=> e.info.actionType.examine || e.info.actionType.openHot || e.info.actionType.playAndPause)
  21106. }
  21107. this.intersect = this.getMouseIntersect(null, hots.concat(this.model.colliders));
  21108. if(this.intersect){
  21109. deal()
  21110. this.intersectHot && $("#player").css("cursor", "pointer");
  21111. }
  21112. }
  21113. }
  21114. this.intersect = this.getMouseIntersect(),
  21115. this.intersect && this.updateClosestPano(this.intersect),
  21116. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  21117. k.navigation.panoScores && !k.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  21118. }
  21119. ,
  21120. t.prototype.checkHotClick = function() {
  21121. if (this.intersectHot){
  21122. if (window.VisiSet && VisiSet.setTagVisible ) {
  21123. VisiSet.SetOneTagVisible(this.intersectHot); //设置这个热点的可见性
  21124. return;
  21125. }else if(editTool.atPanel == 'hotpoint'){
  21126. if(editTool.hotpoint.editSpot && this.intersectHot != editTool.hotpoint.editSpot){
  21127. var sure = confirm("是否保存当前热点?")
  21128. if(sure){
  21129. editTool.hotpoint.saveHot().then(()=>{
  21130. editTool.hotpoint.editHot(this.intersectHot)
  21131. })
  21132. }else{
  21133. editTool.hotpoint.editHot(this.intersectHot)
  21134. }
  21135. }else{
  21136. editTool.hotpoint.editHot(this.intersectHot)
  21137. }
  21138. }else{
  21139. if(this.intersectHot.texType == "video" && this.intersectHot.info.actionType.playAndPause){
  21140. this.intersectHot.switchPlay(!!this.intersectHot.pausedByUser)
  21141. }
  21142. this.intersectHot.examine()
  21143. }
  21144. return !0
  21145. }
  21146. }
  21147. ,
  21148. t.prototype.getMouseDirection = function(e) {
  21149. e = e || this.mouse;
  21150. var t = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21151. return new B.Vector3(e.x,e.y,1).unproject(this.camera).sub(t).normalize()
  21152. }
  21153. ,
  21154. t.prototype.hoverOverlay = function(mesh){
  21155. if(!mesh){
  21156. this.hoveringPlane = null;
  21157. $("#player").css("cursor",this.currentCursor || "" );
  21158. }else{
  21159. var overlay = mesh.parent;
  21160. $("#player").css("cursor","pointer");
  21161. this.hoveringPlane = overlay;
  21162. return true;
  21163. }
  21164. },
  21165. t.prototype.clickOverlay = function(overlay){
  21166. if(this.openOverlay && !overlay)return;
  21167. var plane = overlay.plane;
  21168. if(overlay.texType == "video"){
  21169. overlay.switchPlay(!!overlay.pausedByUser)
  21170. }
  21171. if(window.EditOverlay && EditOverlay.editing){
  21172. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane){
  21173. var sure = confirm("是否保存当前展览?")
  21174. if(sure){
  21175. $("#overlayProp button.submit").click()
  21176. }else{
  21177. EditOverlay.closeOverlayPanel('cancel')
  21178. }
  21179. }
  21180. EditOverlay.beginEdit(overlay);
  21181. return;
  21182. }
  21183. },
  21184. t.prototype.getMouseIntersect = function(e, t1) {
  21185. e = e || this.mouse.clone()
  21186. var t = t1 || this.model.floors.reduce(function(e, t) {
  21187. return t.hidden ? e : e.concat(t.collider.children)
  21188. }, this.mode === V.PANORAMA ? this.panoMarkers : []),
  21189. t = t.slice(0)
  21190. i = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21191. this.raycaster.set(i, this.getMouseDirection(e));
  21192. var n = this.raycaster.intersectObjects(t , true );//add true
  21193. var o = n[0];
  21194. if(o){
  21195. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  21196. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  21197. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  21198. o.horizontal = .8 < o.normal.y);
  21199. return o
  21200. }
  21201. }
  21202. ,
  21203. t.prototype.updateClosestPano = function(e) {
  21204. var t = [a.filters.isPanoAligned()];
  21205. if (this.mode === V.PANORAMA) {
  21206. if (!this.currentPano)
  21207. return;
  21208. t.push(a.filters.not(this.currentPano)),
  21209. t.push(a.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  21210. t.push(a.filters.isNeighbourPanoTo(this.currentPano)),
  21211. t.push(a.filters.isCloseEnoughTo(e.point, k.panoFloorClickRadius)),
  21212. t.push(a.filters.isNotBehindNormal(e.point, e.normal))
  21213. } else{
  21214. t.push((pano)=>{ // add
  21215. return this.checkHasNeighbor(pano)
  21216. })
  21217. t.push(a.filters.isOnVisibleFloor()),
  21218. this.mode !== V.FLOORPLAN && t.push(a.filters.inDirection(this.position, this.getDirection(), .25));
  21219. }
  21220. var i = this.model.panos.find(t, [a.sortFunctions.floorDistanceToPoint(e.point)]);
  21221. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  21222. this.emit(W.ClosestPanoChanging, this.closestPano, i, this.mode),
  21223. this.closestPano = i) : this.isPanoHover = !1
  21224. }
  21225. ,
  21226. t.prototype.dollhouseMode = function(e, t) {
  21227. this.emit(W.ModeChanging, this.mode, V.DOLLHOUSE),
  21228. this.mode = V.DOLLHOUSE,
  21229. this.cameraControls.controls[V.DOLLHOUSE].reset();
  21230. var i = new B.Vector3(this.model.center.x,0,this.model.center.z)
  21231. , n = new B.Vector3(15,10,15);
  21232. if (e && t) {
  21233. var r = T.FORWARD.clone().applyQuaternion(t)
  21234. , o = this.model.center.clone().sub(e).dot(r);
  21235. 0 < o ? (i = r.clone().multiplyScalar(o).add(e),
  21236. n.copy(e)) : Y.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  21237. }
  21238. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(0, !0),
  21239. this.cameraControls.controls[V.DOLLHOUSE].target.copy(i),
  21240. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(n),
  21241. this.updateFromControls(),
  21242. this.model.alpha = 1,
  21243. this.model.skybox.material.uniforms.opacity.value = 0
  21244. }
  21245. ,
  21246. t.prototype.insideMode = function(e, t) {
  21247. var i = $.Deferred()
  21248. , n = t || null;
  21249. if (this.mode !== V.PANORAMA && this.mode !== V.TRANSITIONING) {
  21250. var r = [a.filters.isPanoAligned()];
  21251. this.model.currentFloor && r.push(a.filters.atFloor(this.model.currentFloor)),
  21252. e = e || this.currentPano || this.model.panos.find(r, [a.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  21253. this.flyToNewMode({
  21254. mode: V.PANORAMA,
  21255. pano: e,
  21256. callback: n
  21257. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  21258. } else {
  21259. var o = this.mode === V.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  21260. i.reject(o)
  21261. }
  21262. return i.promise()
  21263. }
  21264. ,
  21265. t.prototype.fitDollhouse = function(e, t, i) {
  21266. var maxY = this.model.boundingBox.max.y;//add
  21267. var n = T.FORWARD.clone().applyQuaternion(i);
  21268. i = n.clone().add(e);
  21269. this.cameraControls.activeControl.target.copy(i),
  21270. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  21271. }
  21272. ,
  21273. t.prototype.floorplanMode = function(e, t, i) {
  21274. this.mode = V.FLOORPLAN;
  21275. var n = this.cameraControls.controls[V.FLOORPLAN];
  21276. n.reset();
  21277. var r = e || this.model.center;
  21278. if (n.target.copy(r).setY(0),
  21279. n.camera.position.copy(r).setY(k.floorplan.cameraHeight),
  21280. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  21281. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  21282. t) {
  21283. var o = T.LEFT.clone().applyQuaternion(t);
  21284. n.rotateLeft(-Math.atan2(o.x, o.z))
  21285. } else
  21286. n.rotateToView(this.model.size, this.getDirection());
  21287. n.update(0)
  21288. }
  21289. ,
  21290. t.prototype.nonInterruptingFlyToPano = function(e, t) {
  21291. return e.skipWarpingCheck = !0,
  21292. this.flyToPano(e, t)
  21293. }
  21294. ,
  21295. t.prototype.updateMarkerVisi = function() {//加
  21296. if(this.mode != "panorama")return;
  21297. this.model.panos.list.forEach((pano)=>{
  21298. if(!pano.marker)return;
  21299. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  21300. })
  21301. }
  21302. ,
  21303. /* t.prototype.updateHotVisible = function(pano){
  21304. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setPanoLog))return
  21305. var hots = this.model.hots;
  21306. pano = pano || this.currentPano;
  21307. for (var index in hots){
  21308. var visible;
  21309. if(this.mode != "panorama"){
  21310. visible = true;
  21311. }else{
  21312. //hots[index].mesh.material.depthTest = false;
  21313. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  21314. }
  21315. hots[index].mesh.visible = visible;
  21316. }
  21317. }
  21318. */
  21319. t.prototype.flyToPano = function(e, t) {
  21320. var i, n = e.pano, aim = e.lookAtPoint, aimQua = e.quaternion,//ADD
  21321. o = e.duration, a = e.aimDuration, s = e.maxDistanceOverride,
  21322. l = e.skipWarpingCheck, c = e.constantMoveSpeed, h = null, u = null
  21323. if (aim){
  21324. var m = (new B.Matrix4).lookAt(n.position, aim, T.UP)
  21325. aimQua = (new B.Quaternion).setFromRotationMatrix(m)
  21326. }
  21327. else aimQua = aimQua
  21328. var zoomLevel = e.zoomLevel || 1 //add
  21329. if(this.flying) return t && t(e)
  21330. if (window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(n),
  21331. this.isWarping() && !l && (this.path.activeTransType === R.BLACK || this.path.activeTransType === R.STD))
  21332. return Y.warn("Player.flyToPano() -> Cannot fly when warping"),
  21333. t && t(),
  21334. !1;
  21335. this.updateLastView()
  21336. if (this.mode !== V.PANORAMA)
  21337. return void this.flyToNewMode({
  21338. mode: V.PANORAMA,
  21339. pano: n,
  21340. duration: o,
  21341. quaternion: aimQua,
  21342. callback: t
  21343. });
  21344. if (!n || (h = x.deepExtend(e), u = function() {
  21345. j.delayOneFrame(function() {
  21346. this.flyToPano(h, t)
  21347. }.bind(this))
  21348. }.bind(this),
  21349. !this.checkAndWaitForPanoLoad(n, "high", "low", this.basePanoSize, u))) {
  21350. var d = function(e) {
  21351. t && t(e)
  21352. }
  21353. .bind(this);
  21354. this.currentPano || (this.currentPano = n,
  21355. this.path.placeCpm(),
  21356. this.path.fadeOutCpm(k.path.fadeOutTime),
  21357. this.spider.draw());
  21358. var p = o;
  21359. if ("number" != typeof o) {
  21360. var f = s || k.transition.flytimeMaxDistanceThreshold;
  21361. p = Math.min(this.currentPano.position.distanceTo(n.position), f) * k.transition.flytimeDistanceMultiplier + k.transition.flyTime
  21362. }
  21363. if (.01 < k.transition.flySpeed && (p = 1e3 * this.currentPano.position.distanceTo(n.position) / k.transition.flySpeed),
  21364. zoomLevel !== this.zoomLevel)
  21365. switch (k.zoom.transitionStyle) {
  21366. case 1:
  21367. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? p / 2 : p); //改
  21368. break;
  21369. case 2:
  21370. return h = x.deepExtend(e),
  21371. u = this.flyToPano.bind(this, h, t),
  21372. void this.smoothZoomFovTo(null, zoomLevel, k.zoom.restoreTime * (this.zoomLevel - 1), u)
  21373. }
  21374. if (aimQua) {
  21375. G.cancelById(q.LookTransition),
  21376. p *= k.transition.aimSlowFactor;
  21377. var g = this.cameraControls.activeControl.camera.quaternion.clone()
  21378. , y = g.clone()
  21379. , A = new B.Vector3;
  21380. if (n === this.currentPano) {
  21381. var C = T.FORWARD.clone().applyQuaternion(g)
  21382. , I = T.FORWARD.clone().applyQuaternion(aimQua)
  21383. , E = C.angleTo(I);
  21384. return null != a || (a = 1 * Math.sqrt(E) / k.tags.navigate.rotateSpeedFactor * 1e3),
  21385. void G.start(function(e) {
  21386. y.copy(g),
  21387. H.quaternion(y, aimQua)(e),
  21388. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21389. this.cameraControls.activeControl.lookAt(A)
  21390. }
  21391. .bind(this), a, d, 0, z[k.transition.movementEasing], null, q.LookTransition)
  21392. }
  21393. }
  21394. if (n === this.currentPano )
  21395. return void d();
  21396. this.flying = !0;
  21397. var _ = this.position.clone()
  21398. , b = this.currentPano;
  21399. Y.debug("Flying to pano ", n.position);
  21400. this.emit(W.PanoChosen, this.currentPano, n);
  21401. this.emit(W.FlyingStarted, n.position, _, n, b);
  21402. //this.updateHotVisible(n); //更新热点显示
  21403. this.transitionPos({type:"beforeFlytopano", pano:n, dur:p})//add
  21404. Hot.updateVisibles([this.currentPano, n])
  21405. aimQua && G.start(function(e) {
  21406. y.copy(g),
  21407. H.quaternion(y, aimQua)(e),
  21408. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21409. this.cameraControls.activeControl.lookAt(A)
  21410. }
  21411. .bind(this), p, null, 0, z[k.transition.movementEasing], null, q.LookTransition);
  21412. var w = c ? null : z[k.transition.movementEasing];
  21413. this.nextPano = n;
  21414. G.start(H.uniform(this.model.skybox, "progress", 1), p, null, 0, z[k.transition.blendEasing], "skyFly", q.FlyToPano),
  21415. G.start(H.allUniforms(this.model.chunks, "progress", 1), p, null, 0, z[k.transition.blendEasing], "chunkFly", q.FlyToPano),
  21416. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, n.position), p, function(e) {
  21417. this.flying = !1,
  21418. this.currentPano !== n && this.currentPano.exit(),
  21419. n.enter(),
  21420. this.currentPano = n,
  21421. this.nextPano = null,
  21422. this.path.placeCpm(),
  21423. this.path.fadeOutCpm(k.path.fadeOutTime),
  21424. this.spider.draw(),
  21425. this.emit(W.FlyingEnded, n.position, _, n, b),
  21426. this.updateMarkerVisi();//add
  21427. d(e)
  21428. if(this.mode == "panorama" ){
  21429. //EditOverlay.updatePano()
  21430. editTool.hotpoint.updatePano()
  21431. Hot.updateVisibles([this.currentPano])
  21432. }
  21433. }
  21434. .bind(this), 0, w, "camFly", q.FlyToPano)
  21435. }
  21436. }
  21437. ,
  21438. window._transitionPosId = 9999
  21439. t.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  21440. G.cancelById(_transitionPosId)
  21441. var begin = function(object, pos, qua, scale){
  21442. if(pos){
  21443. if(!same(object.position, pos, 0.01)){
  21444. G.start(H.vector(object.position, pos), o.dur, (e)=>{
  21445. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21446. }
  21447. if(qua && !same(object.quaternion, qua, 1e-6)){
  21448. G.start(H.quaternion(object.quaternion, qua), o.dur, (e)=>{
  21449. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21450. }
  21451. if(scale && !same(object.scale, scale, 0.001)){
  21452. G.start(H.vector(object.scale, scale), o.dur, (e)=>{
  21453. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21454. }
  21455. }
  21456. }
  21457. var same = function(vec1, vec2, diff){
  21458. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  21459. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  21460. return s
  21461. }
  21462. var sid = o.pano != void 0 ? o.pano.id : "outside";
  21463. /* this.model.hotGroup.children.forEach(overlay=>{
  21464. var panoData = overlay.transformAtPanos[sid]
  21465. var useCustom = !panoData
  21466. //if(overlay.usingTransformData || !useCustom){
  21467. var pos = useCustom ? overlay.posCustom : panoData.pos;
  21468. var qua = useCustom ? overlay.quaCustom : panoData.qua;
  21469. var scale = useCustom ? overlay.getScaleBySize(overlay.widthCustom, overlay.heightCustom) :
  21470. overlay.getScaleBySize(panoData.width , panoData.height)
  21471. scale = new THREE.Vector3(scale.x, scale.y, overlay.scale.z)
  21472. begin(overlay, pos, qua, scale )
  21473. //}
  21474. overlay.usingTransformData = !useCustom
  21475. }) */
  21476. for(let i in this.model.hots){//是否判断visible?
  21477. var hot = this.model.hots[i];
  21478. var panoData = hot.info.transformAtPanos[sid];
  21479. var useCustom = !panoData
  21480. //if(hot.usingTransformData || !useCustom){
  21481. var pos = useCustom ? hot.info.position : panoData.pos;
  21482. //var qua = hot.isSprite ? null : (useCustom ? hot.quaternion : panoData.qua);
  21483. begin(hot, pos/* , qua */ )
  21484. //}
  21485. //hot.usingTransformData = !useCustom;
  21486. }
  21487. }
  21488. window._tranOutsideFocus = 4399
  21489. t.prototype.focusPoint = function(o={}){//当在外时,聚焦相机到这一点
  21490. console.log("focusPoint")
  21491. if(this.mode == "floorplan"){
  21492. var modelSize = o.modelSize || new THREE.Vector3(8,8,8);//可视范围
  21493. var control = player.cameraControls.controls.floorplan;
  21494. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  21495. var currentScale = control.absoluteScale;
  21496. var currentTarget = control.target.clone()
  21497. G.cancelById(window._tranOutsideFocus, true);
  21498. G.start(function(progress){
  21499. control.absoluteScale = absoluteScale*progress + currentScale*(1-progress);
  21500. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  21501. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  21502. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, z[k.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  21503. }else if(player.mode == "dollhouse"){
  21504. var control = player.cameraControls.controls.dollhouse;
  21505. var radius = o.radius || 8;
  21506. var currentTarget = control.target.clone()
  21507. var dir = control.offset.clone().normalize()
  21508. var currentRadius = control.offset.length();
  21509. G.cancelById(window._tranOutsideFocus, true);
  21510. G.start(function(progress){
  21511. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  21512. let radius_ = radius*progress+currentRadius*(1-progress)
  21513. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  21514. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, z[k.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  21515. }else if(this.mode == 'panorama'){
  21516. this.flyToPano({
  21517. lookAtPoint: o.aim.clone() ,
  21518. pano: this.currentPano,
  21519. aimDuration: o.dur || 600
  21520. })
  21521. }
  21522. }
  21523. t.prototype.fastForwardActivePanoFlight = function(e) {
  21524. e = e || k.transition.fastForwardFactor / 10 * 4 + 1,
  21525. G.adjustSpeed(q.FlyToPano, e),
  21526. G.adjustSpeed(q.LookTransition, e)
  21527. }
  21528. ,
  21529. t.prototype.flyToPanoClosestToMouse = function() {
  21530. if (50 < Date.now() - this.mouseLastMoveTime && (this.intersect = this.getMouseIntersect(),
  21531. this.intersect && this.updateClosestPano(this.intersect)),
  21532. this.closestPano)
  21533. return this.flyToPano({
  21534. pano: this.closestPano
  21535. });
  21536. var e = this.getMouseDirection();
  21537. this.flyDirection(e) || this.flyToPano({
  21538. pano: this.currentPano
  21539. })
  21540. }
  21541. ,
  21542. t.prototype.flyLocalDirection = function(e) {
  21543. var t = this.getDirection(e)
  21544. , i = 1 === e.z ? .4 : .75
  21545. , n = 1 === Math.abs(e.x);
  21546. return this.flyDirection(t, i, n)
  21547. }
  21548. ,
  21549. t.prototype.flyDirection = function(e, t, i) {
  21550. Hot.closePopup();//xzw add
  21551. var n = $.Deferred();
  21552. this.history.invalidate();
  21553. var r = this.closestPanoInDirection(e, t, i);
  21554. return r ? this.flyToPano({
  21555. pano: r
  21556. }, n.resolve.bind(n, !0)) : (this.bump(e),
  21557. n.resolve(!1)),
  21558. n.promise()
  21559. }
  21560. ,
  21561. t.prototype.closestPanoInDirection = function(e, t, i) {
  21562. return this.rankedPanoInDirection(0, e, t, i)
  21563. }
  21564. ,
  21565. t.prototype.rankedPanoInDirection = (_ = {
  21566. pano: null,
  21567. candidates: []
  21568. },
  21569. function(e, t, i, n) {
  21570. e = e || 0,
  21571. i = void 0 !== i ? i : .75;
  21572. var r = n ? "angle" : "direction";
  21573. 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)], _),
  21574. this.cachedPanoCandidates = _.candidates,
  21575. _.pano
  21576. }
  21577. ),
  21578. t.prototype.bump = function(e) {
  21579. if (this.mode === V.PANORAMA && !this.flying && !this.isWarping()) {
  21580. var t, i, n, r = k.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e);
  21581. if (.5 < Math.abs(a))
  21582. t = function() {
  21583. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 0 < a ? 1.04 : .96), o, i, 0, z.easeInOutSine, "bumpZStart")
  21584. }
  21585. .bind(this),
  21586. i = function() {
  21587. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 1), 5 * o, n, 0, z.easeInOutSine, "bumpZRelax")
  21588. }
  21589. .bind(this);
  21590. else {
  21591. var s = this.camera.position.clone()
  21592. , l = e.clone();
  21593. this.raycaster.set(s, l);
  21594. var c = this.model.floors.reduce(function(e, t) {
  21595. return e.concat(t.collider.children)
  21596. }, [])
  21597. , h = this.raycaster.intersectObjects(c)
  21598. , u = 0 < h.length ? h[0].distance / 25 : .04
  21599. , d = s.clone().add(l.multiplyScalar(u));
  21600. t = function() {
  21601. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, d), o, i, 0, z.easeInOutSine, "bumpTStart")
  21602. }
  21603. .bind(this),
  21604. i = function() {
  21605. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, s), 5 * o, n, 0, z.easeInOutSine, "bumpTRelax")
  21606. }
  21607. .bind(this)
  21608. }
  21609. n = function() {
  21610. this.flying = !1
  21611. }
  21612. .bind(this),
  21613. this.flying = !0,
  21614. t()
  21615. }
  21616. }
  21617. ,
  21618. t.prototype.changeFloor = function(e) {
  21619. if (!this.is360View(this.mode, this.currentPano))
  21620. if (this.mode === V.PANORAMA) {
  21621. var t = this.history.reversePano(e);
  21622. t && t.isAligned() ? this.flyToPano({
  21623. pano: t
  21624. }) : this.changeFloorByScore(e)
  21625. } else
  21626. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  21627. }
  21628. ,
  21629. t.prototype.changeFloorByScore = (E = {
  21630. pano: null,
  21631. candidates: []
  21632. },
  21633. function(e) {
  21634. var t = this.model.nextFloor(e);
  21635. 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),
  21636. void (E.pano ? (this.cachedPanoCandidates = E.candidates,
  21637. this.history.push(e, this.currentPano),
  21638. this.flyToPano({
  21639. pano: E.pano
  21640. })) : Y.warn("No pano found on selected floor, not moving there."))) : void Y.debug("player.changeFloor(" + e + "): no such floor")
  21641. }
  21642. ),
  21643. t.prototype.gotoFloor = function(e) {
  21644. var t = e - this.model.currentFloor.floorIndex;
  21645. this.changeFloor(t)
  21646. }
  21647. ,
  21648. t.prototype.getDirection = function(e) {
  21649. return (e = e || (new B.Vector3).copy(T.FORWARD)).applyQuaternion(this.camera.quaternion)
  21650. }
  21651. ,
  21652. t.prototype.flyToSameMode = function(e, t, i, n, r) {
  21653. if (r = r || $.Deferred(),
  21654. this.mode === V.TRANSITIONING)
  21655. return Y.warn("should not be transitioning here"),
  21656. n && n(!1),
  21657. r.reject().promise();
  21658. var o = i || !1
  21659. , a = i ? i.position : this.position
  21660. , s = this.position.clone()
  21661. , l = this.currentPano;
  21662. if (Y.debug("New pose in mode " + this.mode),
  21663. !e || (retryCallback = function() {
  21664. j.delayOneFrame(function() {
  21665. this.flyToSameMode(e, t, i, n, r)
  21666. }
  21667. .bind(this))
  21668. }
  21669. .bind(this),
  21670. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  21671. var c = function() {
  21672. this.emit(W.FlyingEnded, a, s, e, l),
  21673. n && n(!0)
  21674. }
  21675. .bind(this)
  21676. , h = k[this.mode]
  21677. , u = void 0 !== t ? t : h.transitionTime
  21678. , d = new B.Vector3
  21679. , p = new B.Vector3;
  21680. if (this.emit(W.FlyingStarted, a, s, e, l),
  21681. this.mode === V.PANORAMA)
  21682. Y.warn("we should not be here for panorama views");
  21683. else if (this.mode === V.DOLLHOUSE)
  21684. if (o) {
  21685. var f = new B.Vector3(0,1,0);
  21686. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21687. this.model.warpDestFloors(i.floorVisibility),
  21688. p.copy(i.position);
  21689. var g = new B.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  21690. , m = new B.Raycaster(p.clone(),g.clone(),0,1 / 0).intersectObjects(this.model.colliders)
  21691. , v = 3;
  21692. m.length ? (d.copy(m[0].point),
  21693. v = .75 * p.distanceTo(d)) : (d.copy(g).multiplyScalar(3).add(p),
  21694. Y.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  21695. var y = (new B.Matrix4).lookAt(p, d, f)
  21696. , A = (new B.Euler).setFromRotationMatrix(y, k.warp.eOrder)
  21697. , C = d.distanceTo(p)
  21698. , I = (new B.Matrix4).lookAt(this.cameraControls.cameras[V.DOLLHOUSE].position, this.cameraControls.controls[V.DOLLHOUSE].target, f)
  21699. , E = (new B.Euler).setFromRotationMatrix(I, k.warp.eOrder)
  21700. , _ = this.cameraControls.cameras[V.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[V.DOLLHOUSE].target);
  21701. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(Math.min(_, v), !0);
  21702. var b = new B.Euler(A.x - E.x,A.y - E.y,A.z - E.z,k.warp.eOrder);
  21703. b.y = b.y > Math.PI ? b.y -= 2 * Math.PI : b.y < -Math.PI ? b.y += 2 * Math.PI : b.y,
  21704. this.path.burnsDir = Math.sign(b.y);
  21705. var w = new B.Euler(0,0,0,k.warp.eOrder)
  21706. , T = new B.Vector3;
  21707. G.start(H.vector(this.cameraControls.controls[V.DOLLHOUSE].target, d), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21708. G.start(function(e, t) {
  21709. w.x = E.x + e * b.x,
  21710. w.y = E.y + e * b.y,
  21711. w.z = E.z + e * b.z;
  21712. var i = _ + e * (C - _);
  21713. T.set(0, 0, i).applyEuler(w).add(this.cameraControls.controls[V.DOLLHOUSE].target),
  21714. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(T).add(this.model.position)
  21715. }
  21716. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21717. G.start(function(e, t) {
  21718. this.cameraControls.controls[V.DOLLHOUSE].update(),
  21719. this.quaternion.copy(this.cameraControls.cameras[V.DOLLHOUSE].quaternion),
  21720. this.position.copy(this.cameraControls.cameras[V.DOLLHOUSE].position)
  21721. }
  21722. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21723. } else
  21724. Y.warn("invalid warp destination in flyToSameMode()? ignore it then");
  21725. else if (this.path.placeCpm(),
  21726. this.path.fadeInCpm(k.path.fadeInTime),
  21727. i) {
  21728. this.model.warpDestFloors(i.floorVisibility);
  21729. var x = this.cameraControls.cameras[V.FLOORPLAN]
  21730. , S = this.cameraControls.controls[V.FLOORPLAN]
  21731. , M = S.target.clone()
  21732. , R = i.position.clone().sub(M)
  21733. , P = x.position.clone().sub(S.target).length()
  21734. , O = new B.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  21735. , L = Math.atan2(S.offset.x, S.offset.z)
  21736. , D = Math.atan2(O.x, O.z)
  21737. , N = S.absoluteScale
  21738. , F = U.convertWorkshopOrthoZoom(i.orthoZoom);
  21739. G.start(function(e, t) {
  21740. S.target.copy(R).multiplyScalar(e).add(M);
  21741. var i = L + (D - L) * e;
  21742. S.offset.x = P * Math.sin(i),
  21743. S.offset.z = P * Math.cos(i),
  21744. x.position.copy(S.target).add(S.offset),
  21745. S.absoluteScale = N + e * (F - N),
  21746. S.update(),
  21747. this.quaternion.copy(x.quaternion),
  21748. this.position.copy(x.position),
  21749. this.target.copy(S.target),
  21750. this.camera.projectionMatrix.copy(x.projectionMatrix)
  21751. }
  21752. .bind(this), u, null, 0, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21753. } else
  21754. Y.info("flyToSameMode() funny floorplan view? skipping");
  21755. return G.setTimeout(function(e) {
  21756. this.mode = e,
  21757. c(),
  21758. r.resolve(!0)
  21759. }
  21760. .bind(this, this.mode), u, q.FlyToSameMode),
  21761. this.mode = V.TRANSITIONING,
  21762. r.promise()
  21763. }
  21764. }
  21765. ,
  21766. t.prototype.flyToNewMode = function(e, t) {
  21767. Hot.closePopup();//xzw add
  21768. var i = (e = e || {}).mode
  21769. , n = e.pano
  21770. , r = e.duration
  21771. , o = e.warpDest
  21772. , a = e.callback
  21773. , s = e.force
  21774. , l = e.quaternion;
  21775. if (t = t || $.Deferred(),
  21776. this.isWarping())
  21777. return Y.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  21778. a && a(!1),
  21779. t.reject("Cannot change mode during tour transition").promise();
  21780. if (this.mode === V.TRANSITIONING)
  21781. return a && a(!1),
  21782. t.reject("Cannot change mode during mode transition").promise();
  21783. if (i === this.mode)
  21784. return s ? (this.flyToSameMode(n, r, o, a).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  21785. t.promise()) : (a && a(!1),
  21786. t.reject("Already in " + i + " mode").promise());
  21787. var c = o || !1;
  21788. Y.debug("Switching mode to " + i);
  21789. var h = function() {
  21790. j.delayOneFrame(function() {
  21791. this.flyToNewMode(e, t)
  21792. }
  21793. .bind(this))
  21794. }
  21795. .bind(this);
  21796. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, h))
  21797. return t.promise();
  21798. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  21799. return Y.info("Waiting for model textures to be loaded before going out to dollhouse"),
  21800. this.model.waitForLoad(this.model, function() {
  21801. return this.model.meshTexturesLoaded
  21802. }
  21803. .bind(this)),
  21804. this.model.loadMeshTextures().done(h),
  21805. t.promise();
  21806. this.history.invalidate(),
  21807. this.updateLastView();
  21808. var u = this.mode
  21809. , d = this.cameraControls.cameras[i];
  21810. e = x.deepExtend({}, k[i], k[u + "-" + i]);
  21811. var p = void 0 !== r ? r : e.transitionTime;
  21812. this.emit(W.ModeChanging, u, i, n),
  21813. n && (this.currentPano = n),
  21814. this.switchCameraMode(i, l),
  21815. G.cancelById(q.LookTransition);
  21816. var f = (new B.Vector3).copy(this.position);
  21817. this.modeTran = this.mode + "-" + i;
  21818. if(this.mode == "floorplan" && window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog)){
  21819. VisiSet.finishSetPanoVisible()
  21820. VisiSet.finishSetTagVisible()
  21821. VisiSet.finishSetPanoLog()
  21822. }
  21823. if(editTool.atPanel == "screen"){
  21824. if(this.mode == "panorama") $(".confirmSnap").addClass("unable")
  21825. else if(i == "panorama") $(".confirmSnap").removeClass("unable")
  21826. }
  21827. if(i == "panorama"){
  21828. this.transitionPos({type:"beforeFlyIn", pano:n, dur:p})//add
  21829. }else{
  21830. this.transitionPos({type:"beforeFlyOut", dur:p/2})//add
  21831. }
  21832. if (i === V.PANORAMA)
  21833. this.emit(W.PanoChosen, n, n),
  21834. setTimeout(function() {
  21835. n.floor.enter(i)
  21836. }
  21837. .bind(this), p / 2),
  21838. this.path.fadeOutCpm(k.path.fadeOutTime);
  21839. else if (i === V.DOLLHOUSE) {
  21840. if (c && (this.model.stayPut = !0),
  21841. o ? (this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21842. this.model.warpDestFloors(o.floorVisibility)) : this.model.toggleAllFloors(!0),
  21843. this.path.placeCpm(),
  21844. this.path.fadeInCpm(k.path.fadeInTime),
  21845. c) {
  21846. var g = new B.Vector3(this.model.center.x,0,this.model.center.z);
  21847. f.set(15, 10, 15);
  21848. var m = new B.Vector3(0,0,-1).applyQuaternion(o.quaternion)
  21849. , v = new B.Raycaster(o.position.clone(),m.clone(),0,1 / 0).intersectObjects([this.sceneIntersectionPlane]);
  21850. v.length ? (g.copy(v[0].point),
  21851. f.copy(o.position),
  21852. 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),
  21853. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(3, !0)),
  21854. this.cameraControls.controls[V.DOLLHOUSE].target.copy(g),
  21855. f.add(this.model.position),
  21856. d.position.copy(f),
  21857. this.cameraControls.controls[V.DOLLHOUSE].update()
  21858. }
  21859. } else if (this.path.placeCpm(),
  21860. this.path.fadeInCpm(k.path.fadeInTime),
  21861. o) {
  21862. this.model.warpDestFloors(o.floorVisibility);
  21863. var y = this.cameraControls.cameras[V.FLOORPLAN]
  21864. , A = this.cameraControls.controls[V.FLOORPLAN]
  21865. , C = y.position.clone().sub(A.target)
  21866. , I = new B.Vector3(-1,0,0).applyQuaternion(o.quaternion).normalize()
  21867. , E = Math.atan2(I.x, I.z);
  21868. A.target.copy(o.position);
  21869. var _ = C.length();
  21870. A.offset.x = _ * Math.sin(E),
  21871. A.offset.y = 0,
  21872. A.offset.z = _ * Math.cos(E),
  21873. y.position.copy(A.target).add(A.offset),
  21874. A.target.clone().sub(d.position),
  21875. d.quaternion.copy(o.quaternion),
  21876. A.currentScale = U.convertWorkshopOrthoZoom(o.orthoZoom),
  21877. A.absoluteScale = A.currentScale,
  21878. A.update()
  21879. } else
  21880. this.model.currentFloor.enter(i);
  21881. var b = this.currentPano
  21882. , w = this.position.clone();
  21883. return this.emit(W.FlyingStarted, f, w, n, this.currentPano),
  21884. this.flying = !0,
  21885. this.isOutsideMode(i) && this.is360View(u, b) ? (c || i !== V.DOLLHOUSE || (d.position.set(15, 10, 15),
  21886. d.controls.target.set(this.model.center.x, 0, this.model.center.z),
  21887. d.controls.update()),
  21888. e.blackoutStyle = P.FADEIN,
  21889. p = k.show360Views.transitionTime,
  21890. this.fade360View(p, d, e)) : this.isOutsideMode(u) && this.is360View(i, n) ? (c && this.switchCameraMode(i, c.quaternion),
  21891. this.mode = i,
  21892. this.path && this.path.popOutCpm(),
  21893. e.blackoutStyle = P.END,
  21894. p = k.show360Views.transitionTime,
  21895. this.fade360View(p, d, e)) : (G.start(H.property(this.model, "alpha", e.modelAlpha, null), p * e.modelAlphaLength, null, e.modelAlphaDelay, null, q.FlyToNewMode),
  21896. G.start(H.vector(this.position, d.position), p, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToNewMode),
  21897. G.start(H.quaternion(this.quaternion, d.quaternion), p * e.rotationDuration, null, e.rotationDelay, z[k.flydown.rotationEasing], null, q.FlyToNewMode),
  21898. G.start(H.matrix4(this.camera.projectionMatrix, d.projectionMatrix), p * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, q.FlyToNewMode),
  21899. G.start(H.uniform(this.model.skybox, "opacity", e.skyboxOpacity), p * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, q.FlyToNewMode),
  21900. G.start(H.property(this.reticule.material.uniforms.opacity, "value", 0), p, null, q.FlyToNewMode)),
  21901. G.setTimeout(function() {
  21902. this.flying = !1,
  21903. u === V.PANORAMA && i !== V.PANORAMA ? this.currentPano.exit() : u !== V.PANORAMA && i === V.PANORAMA && (this.currentPano !== b && b.exit(),
  21904. this.currentPano.enter(),
  21905. this.path.placeCpm(),
  21906. this.path.fadeOutCpm(k.path.fadeOutTime),
  21907. this.spider.draw()),
  21908. u === V.DOLLHOUSE && this.cameraControls.controls[V.DOLLHOUSE].resetRanges(),
  21909. this.mode = i,
  21910. this.emit(W.FlyingEnded, f, w, this.currentPano, b)
  21911. if (this.afterCModeFuc) {
  21912. //手动加的函数
  21913. var cf = this.afterCModeFuc;
  21914. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  21915. cf();
  21916. }
  21917. this.updateMarkerVisi();//add
  21918. //(this.mode == u.PANORAMA) && this.updateHotVisible()//add
  21919. if(this.mode == "panorama" ){
  21920. //EditOverlay.updatePano()
  21921. editTool.hotpoint.updatePano()
  21922. }
  21923. //this.mode == u.PANORAMA && this.transitionPos({type:"flyDone", this.currentPano})//add
  21924. if(this.mode == V.PANORAMA){
  21925. Hot.updateVisibles([this.currentPano])
  21926. }else{
  21927. Hot.updateVisibles(true)
  21928. this.model.hotGroup.children.forEach(overlay=>{
  21929. if(overlay.animateInfo){
  21930. GifTexDeal.start(overlay.animation)
  21931. }
  21932. })
  21933. }
  21934. c && u !== V.PANORAMA && i === V.PANORAMA ? this.startWarp(M.Retain, S.Retain, R.BLACK, null, null, a) : (a && a(),
  21935. t.resolve())
  21936. }
  21937. .bind(this), p, q.FlyToNewMode),
  21938. this.mode = V.TRANSITIONING,
  21939. //EditOverlay.updatePano(),//add
  21940. editTool.hotpoint.updatePano(),//add
  21941. //u == "panorama" && this.updateHotVisible(),
  21942. t.promise()
  21943. }
  21944. ,
  21945. t.prototype.fade360View = function(e, t, i) {
  21946. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  21947. $(this.domElement).fadeOut(.5 * e, function() {
  21948. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  21949. this.model.alpha = i.modelAlpha,
  21950. this.position.copy(t.position),
  21951. this.quaternion.copy(t.quaternion),
  21952. this.camera.projectionMatrix.copy(t.projectionMatrix),
  21953. $(this.domElement).fadeIn(.5 * e)
  21954. }
  21955. .bind(this))
  21956. }
  21957. ,
  21958. t.prototype.findDefaultViews = function() {
  21959. this.findDefaultView(this.lastInsideView, !0),
  21960. this.findDefaultView(this.last360View, !1)
  21961. }
  21962. ,
  21963. t.prototype.findDefaultView = function(e, i) {
  21964. var t, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  21965. if (e.cameraMode !== V.PANORAMA)
  21966. return !1;
  21967. var t = r.get(e.panoId);
  21968. return t && t.isAligned() === i
  21969. });
  21970. 0 <= o ? (t = r.get(n[o].panoId),
  21971. e.update({
  21972. cameraMode: V.PANORAMA,
  21973. pano: t,
  21974. position: n[o].position,
  21975. quaternion: n[o].quaternion
  21976. })) : 0 <= (o = r.list.findIndex(function(e) {
  21977. return e.isAligned() === i
  21978. })) ? (t = r.list[o],
  21979. e.update({
  21980. cameraMode: V.PANORAMA,
  21981. pano: t,
  21982. position: t.position
  21983. })) : Y.warn("There are no", i ? "inside" : "360º", "views in this model")
  21984. }
  21985. ,
  21986. t.prototype.updateLastView = function() {
  21987. this.mode === V.PANORAMA && (this.currentPano.isAligned() ? this.lastInsideView : this.last360View).update({
  21988. pano: this.currentPano,
  21989. position: this.position,
  21990. quaternion: this.quaternion
  21991. })
  21992. }
  21993. ,
  21994. t.prototype.goToLastView = function(e, t) {
  21995. var i = $.Deferred()
  21996. , n = i.resolve.bind(i)
  21997. , r = i.reject.bind(i)
  21998. , o = e ? this.lastInsideView : this.last360View;
  21999. return this.isInMode(V.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  22000. this.isInMode(V.PANORAMA) ? (this.path && this.path.popOutCpm(),
  22001. this.fadeToView(e, o, k.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  22002. mode: o.cameraMode,
  22003. pano: o.pano,
  22004. quaternion: o.quaternion,
  22005. callback: t
  22006. }).done(n).fail(r),
  22007. i.promise()
  22008. }
  22009. ,
  22010. t.prototype.fadeToView = function(e, t, i, n) {
  22011. var r = $.Deferred()
  22012. , o = r.resolve.bind(r)
  22013. , a = r.reject.bind(r);
  22014. if (!t.isValid() || t.cameraMode === V.PANORAMA && !t.pano)
  22015. return Y.warn("Tried to fade to an illegal view", t.cameraMode),
  22016. a("Cannot go to illegal view"),
  22017. r.promise();
  22018. var s = (k[t.cameraMode],
  22019. function() {
  22020. $(this.domElement).fadeIn(.5 * i),
  22021. n && n(),
  22022. o()
  22023. }
  22024. .bind(this))
  22025. , l = e ? P.FADEIN : P.END;
  22026. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  22027. $(this.domElement).fadeOut(.5 * i, function() {
  22028. this.model.fadePanoMarkers(e ? k.panorama.markerOpacity : 0),
  22029. t.cameraMode === V.PANORAMA ? this.flyToPano({
  22030. pano: t.pano,
  22031. lookAtPoint: T.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  22032. duration: 0
  22033. }, s) : this.flyToNewMode({
  22034. mode: t.cameraMode,
  22035. quaternion: t.quaternion,
  22036. duration: 0,
  22037. callback: s
  22038. })
  22039. }
  22040. .bind(this)),
  22041. r.promise()
  22042. }
  22043. ,
  22044. t.prototype.startWarp = function(e, t, i, n, r, o) {
  22045. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  22046. this.flying)
  22047. return Y.warn("Player.startWarp() -> Cannot warp when flying"),
  22048. o && o(),
  22049. !1;
  22050. null != e || (e = M.Show),
  22051. this.history.invalidate(),
  22052. e !== M.Retain ? this.path.brushToWarpPano(i, R.BLACK) || (i = R.BLACK) : i = this.path.upcomingTransType;
  22053. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  22054. return this.emit(W.WarpStarted, a, i, n, r),
  22055. n = n || P.MIDDLE,
  22056. this.path.warpToPano(i, n, r, function() {
  22057. t === S.Slow ? this.path.discardSlow() : t === S.Standard && this.path.discardPathObject(),
  22058. this.emit(W.WarpEnded, i),
  22059. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  22060. o && o()
  22061. }
  22062. .bind(this)),
  22063. e === M.Hide && this.path.discardPathObject(),
  22064. !0
  22065. }
  22066. ,
  22067. t.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  22068. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (Y.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  22069. s && s(),
  22070. !1)
  22071. }
  22072. ,
  22073. t.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  22074. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (Y.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22075. a && a(),
  22076. !1)
  22077. }
  22078. ,
  22079. t.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  22080. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  22081. }
  22082. ,
  22083. t.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  22084. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  22085. !0) : (Y.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22086. t && t(),
  22087. !1)
  22088. }
  22089. ,
  22090. t.prototype.aimTourCamera = function(e, t, i, n) {
  22091. return Y.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  22092. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  22093. }
  22094. ,
  22095. t.prototype.showPathToHeroLocation = function(e) {
  22096. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(R.STD, R.BLACK)
  22097. }
  22098. ,
  22099. t.prototype.tourInterlude = function(e, t) {
  22100. this.history.invalidate(),
  22101. this.path.discardSlow();
  22102. var timeEachItem = 2e3 / (DATA.tourWalkSpeed + DATA.tourBlackSpeed) * 200 //预估时间假设每个item飞的时间
  22103. var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  22104. var rotTime
  22105. if(currentLocation.rotTime == void 0 || currentLocation.rotTime == ''){
  22106. var restChildCount = currentLocation.heroLocations ? (currentLocation.heroLocations.length-this.director.currentItem[1]-1) : 0
  22107. var audioObj = SoundManager.list.find(e=>e.name == 'tour')
  22108. var current = audioObj.audio.currentTime * 1e3 // || 0 //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  22109. rotTime = currentLocation && currentLocation.musicInfo.music ? currentLocation.musicInfo.time - current : timeEachItem;
  22110. if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
  22111. var rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
  22112. }
  22113. rotTime = Math.max(0, rotTime)
  22114. console.log("rotTime "+rotTime +" at item "+this.director.currentItem + ",musicCurrentTime:"+current)
  22115. }else{
  22116. rotTime = currentLocation.rotTime * 1000
  22117. console.log("rotTime "+rotTime +" at item "+this.director.currentItem)
  22118. }
  22119. this.path.waitNextStep(e, function() {//等待音乐播放一段时间再下一步,此时镜头会缓慢旋转
  22120. t && t()
  22121. }
  22122. .bind(this), rotTime)
  22123. }
  22124. ,
  22125. t.prototype.stopInterlude = function() {
  22126. this.interruptAndFastForward(null, 0)
  22127. }
  22128. ,
  22129. t.prototype.interruptAndFastForward = function(e, t) {
  22130. this.isWarping() && this.emit(W.WarpInterrupted, this.path.activeTransType, e, t),
  22131. this.flying && this.emit(W.FlyingInterrupted),
  22132. this.path.interruptAndFastForward(e, t)
  22133. }
  22134. ,
  22135. t.prototype.setSize = function(e, t) {
  22136. var i = e / t;
  22137. this.baseFov = A.clampVFOV(k.insideFOV, k.insideFOVMax, e, t);
  22138. var n = A.getHFOVFromVFOV(k.insideFOV, e, t);
  22139. for (var r in n > k.insideFOVMax ? this.baseFov = A.getVFOVFromHFOV(k.insideFOVMax, e, t) : this.baseFov = k.insideFOV,
  22140. this.cameraControls.cameras) {
  22141. var o = this.cameraControls.cameras[r];
  22142. o.fov = this.baseFov * (1 / this.zoomLevel),
  22143. o.updateAspect(i)
  22144. }
  22145. }
  22146. ,
  22147. t.prototype.toJSON = function() {
  22148. var e = {};
  22149. return this.cameraControls.activeControl && ((e = this.cameraControls.activeControl.toJSON()).camera_mode = V.toInt(this.mode),
  22150. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  22151. return e.hidden ? 0 : 1
  22152. }) : V.PANORAMA && (e.scan_id = this.currentPano.id)),
  22153. e
  22154. }
  22155. ,
  22156. t.prototype.getCurrentNodePanos = function(e) {
  22157. if (this.model.panos.map,
  22158. e.length = 0,
  22159. this.path.nodes)
  22160. for (var t = 0; t < this.path.nodes.length; t++) {
  22161. var i = this.path.nodes[t];
  22162. e.push(this.model.panos.get(i))
  22163. }
  22164. }
  22165. ,
  22166. t.prototype.zoomIncrementally = function(e) {
  22167. var t = this.zoomLevel;
  22168. this.zoomTo(this.zoomLevel + e),
  22169. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  22170. }
  22171. ,
  22172. t.prototype.zoomInIncrementally = function(e) {
  22173. e = e || this.defaultZoomIncrement,
  22174. this.zoomIncrementally(e)
  22175. }
  22176. ,
  22177. t.prototype.zoomOutIncrementally = function(e) {
  22178. e = e || -this.defaultZoomIncrement,
  22179. this.zoomIncrementally(e)
  22180. }
  22181. ,
  22182. t.prototype.zoomBy = function(e) {
  22183. this.zoomTo(this.zoomLevel * e)
  22184. }
  22185. ,
  22186. t.prototype.zoomIn = function() {
  22187. this.zoomBy(1 + this.zoomSpeed)
  22188. }
  22189. ,
  22190. t.prototype.zoomOut = function() {
  22191. this.zoomBy(1 - this.zoomSpeed)
  22192. }
  22193. ,
  22194. t.prototype.zoomTo = function(e, t) {
  22195. if ((t || k.zoom.enabled && this.mode === V.PANORAMA && this.zoomEnabled) && (e < k.zoom.min && (e = k.zoom.min),
  22196. e > k.zoom.max && (e = k.zoom.max),
  22197. e > this.zoomLevel ? (this.emit(m.ZoomIn),
  22198. e === k.zoom.max && this.emit(m.ZoomMax)) : e < this.zoomLevel && (this.emit(m.ZoomOut),
  22199. e === k.zoom.min && this.emit(m.ZoomMin)),
  22200. this.cameraControls.activeControl)) {
  22201. var i = this.cameraControls.activeControl.camera;
  22202. this.zoomLevel = e,
  22203. i.fov = this.baseFov * (1 / this.zoomLevel),
  22204. i.updateProjectionMatrix(),
  22205. this.zoomFov = i.fov
  22206. }
  22207. }
  22208. ,
  22209. t.prototype.increaseZoomSpeed = function() {
  22210. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  22211. }
  22212. ,
  22213. t.prototype.decreaseZoomSpeed = function() {
  22214. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  22215. }
  22216. ,
  22217. t.prototype.clampZoomSpeed = function(e) {
  22218. return e < 0 ? 0 : e
  22219. }
  22220. ,
  22221. t.prototype.activatePersistentZooming = function(e) {
  22222. this.zooming = e ? 1 : -1
  22223. }
  22224. ,
  22225. t.prototype.deactivatePersistentZooming = function() {
  22226. this.zooming = 0
  22227. }
  22228. ,
  22229. t.prototype.zoomDefault = function() {
  22230. this.zoomTo(1, !0)
  22231. }
  22232. window.fovTranId = 333;//add
  22233. t.prototype.smoothZoomToDefault = function(e, t) {
  22234. G.cancelById(window.fovTranId)
  22235. var i, n = this.zoomLevel, r = function(e) {
  22236. 1 < e && (e = 1),
  22237. i = n * (1 - e) + e,
  22238. this.zoomTo(i, !0)
  22239. }
  22240. .bind(this), o = function() {
  22241. this.zoomDefault(),
  22242. t && window.setTimeout(t, 50)
  22243. }
  22244. .bind(this);
  22245. G.start(r, e, o, null, 0, z[k.transition.blendEasing], null, window.fovTranId)
  22246. }
  22247. ,
  22248. t.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {//add
  22249. G.cancelById(window.fovTranId)
  22250. var i,
  22251. n = this.zoomLevel,
  22252. aimLevel = zoomLevel || this.baseFov / fov
  22253. if (n == aimLevel) return
  22254. var fun = function (e) {
  22255. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel), this.zoomTo(i, !0)
  22256. }.bind(this)
  22257. G.start(fun, dur, callback, null, 0, z[k.transition.easeInCubic], null, window.fovTranId)
  22258. }
  22259. ,
  22260. t.prototype.updateZoomPano = function() {
  22261. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === V.PANORAMA) {
  22262. var e = this.currentPano;
  22263. if (e) {
  22264. var t = this.zoomLevel > k.zoom.activationThreshold
  22265. , i = (this.flying && this.nextPano && this.nextPano !== this.currentPano || this.isWarping(),
  22266. t);
  22267. this.tileDownloader.tilePrioritizer.setZoomingActive(i),
  22268. this.panoRenderer.setZoomingActive(i, e, !0);
  22269. var n = function(e, t) {
  22270. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  22271. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  22272. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  22273. e.setZoomed(t)
  22274. }
  22275. .bind(this);
  22276. i && !e.zoomed ? (n(e, !0),
  22277. this.panoRenderer.enableUltraHighQualityMode(function() {
  22278. this.qualityManager.useUltraHighResolutionPanos && !k.zoom.overridemax && (k.zoom.max = y.ultraHighQualityMaxZoom),
  22279. i && n(e, !0)
  22280. }
  22281. .bind(this))) : !t && e.zoomed && n(e, !1)
  22282. }
  22283. }
  22284. },
  22285. //--------
  22286. t.prototype.flyToMode = function(mode, f1){ //飞到某个模式后再执行f1函数
  22287. var f2;
  22288. if (this.mode == mode) {
  22289. f1 && f1()
  22290. } else {
  22291. f2 = f1;
  22292. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  22293. this.afterCModeFuc = function() {
  22294. this.afterCModeFuc = f2
  22295. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano });
  22296. }.bind(this)
  22297. } else {
  22298. this.afterCModeFuc = f2;//飞入后执行
  22299. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  22300. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano});
  22301. }catch(e){}
  22302. }
  22303. }
  22304. }
  22305. ,
  22306. t.prototype.checkHasNeighbor = function(pano){//add
  22307. for(var i in pano.neighbourPanos ){
  22308. if(i == pano.id)continue;
  22309. if(pano.neighbourPanos[i]){
  22310. return true;
  22311. }
  22312. }
  22313. }
  22314. ,
  22315. ee.exports = t
  22316. }
  22317. ).call(this, "/js/player.js")
  22318. }
  22319. , {
  22320. "./constants": 8,
  22321. "./enum/AlignmentType": 17,
  22322. "./enum/BlackoutStyle": 18,
  22323. "./enum/ControlEvents": 21,
  22324. "./enum/Keys": 30,
  22325. "./enum/ModelManagerEvents": 33,
  22326. "./enum/PanoSizeClass": 36,
  22327. "./enum/PanoramaEvents": 37,
  22328. "./enum/PathDiscardMode": 38,
  22329. "./enum/PathDisplayMode": 39,
  22330. "./enum/PlayerEvents": 40,
  22331. "./enum/TagStates": 44,
  22332. "./enum/Vectors": 50,
  22333. "./enum/Viewmode": 51,
  22334. "./enum/WarpStyle": 52,
  22335. "./enum/ZoomEvents": 53,
  22336. "./exception/BasicException": 55,
  22337. "./model/ModelManager": 140,
  22338. "./objects/NSpider": 147,
  22339. "./objects/Panorama": 148,
  22340. "./objects/Reticule": 149,
  22341. "./objects/ShowPath": 151,
  22342. "./objects/Snapshot": 153,
  22343. "./objects/View": 154,
  22344. "./settings": 166,
  22345. "./shaders": 167,
  22346. "./tile/TileDownloader": 171,
  22347. "./tile/TilePrioritizer": 172,
  22348. "./util/ZoomStats": 179,
  22349. "./util/browser": 182,
  22350. "./util/camera": 183,
  22351. "./util/cameraLight": 184,
  22352. "./util/common": 185,
  22353. "./util/easing": 186,
  22354. "./util/history": 187,
  22355. "./util/lerp": 188,
  22356. "./util/logger": 189,
  22357. "./util/math": 190,
  22358. "./util/transitions": 195,
  22359. // hot: "hot",
  22360. scaleImg: "scaleImg",
  22361. events: 202,
  22362. three: 217
  22363. }],
  22364. scaleImg: [function(e, t) {
  22365. var i = t;
  22366. (function() {
  22367. function e(e, t, i, n) {
  22368. function r() {
  22369. (U = "object" == typeof i ? i : t.src || n ? s : document.createElement("canvas")).width = d,
  22370. U.height = p,
  22371. H = U.getContext("2d")
  22372. }
  22373. function o(e) {
  22374. if (e) {
  22375. var t, i = H.getImageData(0, 0, d, p), n = i.data;
  22376. for (t = 0; t < ie; t += 4)
  22377. n[t] = e[t] * ne | 0,
  22378. n[t + 1] = e[t + 1] * ne | 0,
  22379. n[t + 2] = e[t + 2] * ne | 0,
  22380. n[t + 3] = e[t + 3] * ne | 0;
  22381. return delete e,
  22382. i
  22383. }
  22384. return H.getImageData(0, 0, d, p)
  22385. }
  22386. function a(e, t, i, n, r) {
  22387. return .5 * (n - t + (2 * t - 5 * i + 4 * n - r + (3 * (i - n) + r - t) * e) * e) * e + i
  22388. }
  22389. var s, l;
  22390. if (t || (t = e.input,
  22391. i = e.output,
  22392. n = e.inputRemovable,
  22393. e.scale && (e = e.scale)),
  22394. t.src)
  22395. if (s = document.createElement("canvas"),
  22396. null != t.naturalWidth)
  22397. s.width = t.naturalWidth,
  22398. s.height = t.naturalHeight;
  22399. else if (null != t.runtimeStyle) {
  22400. var c = t.runtimeStyle
  22401. , h = c.width
  22402. , u = c.height;
  22403. c.width = "auto",
  22404. c.height = "auto",
  22405. s.width = t.width,
  22406. s.height = t.height,
  22407. c.width = h,
  22408. c.height = u
  22409. } else {
  22410. h = t.width,
  22411. u = t.height;
  22412. t.removeAttribute && (t.removeAttribute("width"),
  22413. t.removeAttribute("height")),
  22414. s.width = t.width,
  22415. s.height = t.height,
  22416. t.width = h,
  22417. t.height = u
  22418. }
  22419. else
  22420. s = t;
  22421. l = s.getContext("2d"),
  22422. t.src && l.drawImage(t, 0, 0);
  22423. var d, p, f = s.width, g = s.height, m = l.getImageData(0, 0, f, g).data;
  22424. if (!f || !g)
  22425. return !1;
  22426. (t.src || n) && s.clearRect(0, 0, f, g),
  22427. p = "object" == typeof e ? e.width ? (d = e.width + .5 | 0,
  22428. e.height + .5 | 0) : (d = f * e.scaleX + .5 | 0,
  22429. g * e.scaleY + .5 | 0) : (d = e * f + .5 | 0,
  22430. e * g + .5 | 0);
  22431. 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;
  22432. if (1 < re || 1 < oe)
  22433. for (r(),
  22434. G = (z = o()).data,
  22435. C = 0; C < p; C++)
  22436. for (V = (y = C / oe) - (w = 0 | y),
  22437. j = w * $,
  22438. W = w < 1 ? j : j - $,
  22439. w < g - 2 ? (Y = j + $,
  22440. q = (2 + w) * $) : Y = q = g - 2 < w ? j : j + $,
  22441. A = 0; A < d; A++,
  22442. te += 4)
  22443. Z = (b = 0 | (v = A / re)) << 2,
  22444. b < f - 2 ? (K = Z + 4,
  22445. Q = Z + 8) : K = Q = f - 2 < b ? Z : Z + 4,
  22446. 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,
  22447. ++Z,
  22448. ++K,
  22449. ++Q,
  22450. 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,
  22451. ++Z,
  22452. ++K,
  22453. ++Q,
  22454. 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,
  22455. ++Z,
  22456. ++K,
  22457. ++Q,
  22458. 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,
  22459. G[te] = 0 <= D ? D < 256 ? D : 255 : 0,
  22460. G[te + 1] = 0 <= F ? F < 256 ? F : 255 : 0,
  22461. G[te + 2] = 0 <= B ? B < 256 ? B : 255 : 0,
  22462. G[te + 3] = 0 <= N ? N < 256 ? N : 255 : 0;
  22463. else {
  22464. if (le.Float32Array)
  22465. L = new Float32Array(ie);
  22466. else
  22467. for (L = [],
  22468. te = 0; te < ie; ++te)
  22469. L[te] = 0;
  22470. for (y = 0; y < g; y++)
  22471. for (I = (_ = 0 | (C = y * oe)) * J,
  22472. (O = !!((_ - (C + oe | 0)) * (g - 1 - y)) << 1) && (M = 1 + _ - C,
  22473. R = C + oe - _ - 1),
  22474. v = 0; v < f; v++,
  22475. ee += 4)
  22476. switch (A = v * re,
  22477. E = 0 | A,
  22478. te = I + (E << 2),
  22479. P = !!((E - (A + re | 0)) * (f - 1 - v)),
  22480. P && (x = 1 + E - A,
  22481. S = A + re - E - 1),
  22482. D = m[ee],
  22483. F = m[ee + 1],
  22484. B = m[ee + 2],
  22485. N = m[ee + 3],
  22486. P + O) {
  22487. case 0:
  22488. L[te] += D * ae,
  22489. L[te + 1] += F * ae,
  22490. L[te + 2] += B * ae,
  22491. L[te + 3] += N * ae;
  22492. break;
  22493. case 1:
  22494. T = x * oe,
  22495. L[te] += D * T,
  22496. L[te + 1] += F * T,
  22497. L[te + 2] += B * T,
  22498. L[te + 3] += N * T,
  22499. T = S * oe,
  22500. L[te + 4] += D * T,
  22501. L[te + 5] += F * T,
  22502. L[te + 6] += B * T,
  22503. L[te + 7] += N * T;
  22504. break;
  22505. case 2:
  22506. T = re * M,
  22507. L[te] += D * T,
  22508. L[te + 1] += F * T,
  22509. L[te + 2] += B * T,
  22510. L[te + 3] += N * T,
  22511. T = re * R,
  22512. L[te += J] += D * T,
  22513. L[te + 1] += F * T,
  22514. L[te + 2] += B * T,
  22515. L[te + 3] += N * T;
  22516. break;
  22517. default:
  22518. T = x * M,
  22519. L[te] += D * T,
  22520. L[te + 1] += F * T,
  22521. L[te + 2] += B * T,
  22522. L[te + 3] += N * T,
  22523. T = S * M,
  22524. L[te + 4] += D * T,
  22525. L[te + 5] += F * T,
  22526. L[te + 6] += B * T,
  22527. L[te + 7] += N * T,
  22528. T = x * R,
  22529. L[te += J] += D * T,
  22530. L[te + 1] += F * T,
  22531. L[te + 2] += B * T,
  22532. L[te + 3] += N * T,
  22533. T = S * R,
  22534. L[te + 4] += D * T,
  22535. L[te + 5] += F * T,
  22536. L[te + 6] += B * T,
  22537. L[te + 7] += N * T
  22538. }
  22539. delete m,
  22540. r(),
  22541. z = o(L)
  22542. }
  22543. if (H.putImageData(z, 0, 0),
  22544. "string" == typeof i) {
  22545. var se;
  22546. if ("png" === i || "jpeg" === i)
  22547. return (se = n && t.src ? t : new Image).width = d,
  22548. se.height = p,
  22549. se.src = U.toDataURL("image/" + i, .85),
  22550. se;
  22551. if ("png-src" === i || "jpeg-src" === i)
  22552. return U.toDataURL("image/" + i.split("-")[0], .85)
  22553. }
  22554. return U
  22555. }
  22556. var le = this;
  22557. "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = e),
  22558. exports.scale = e) : c = e
  22559. }
  22560. ).call(this),
  22561. i.exports = c
  22562. }
  22563. , {}],
  22564. 156: [function(i, n, e) {
  22565. (function(e) {
  22566. "use strict";
  22567. function t(e, t) {
  22568. this.model = e,
  22569. this.panos = e.panos,
  22570. this.player = t,
  22571. this.imagePanos = this.listImagePanos(),
  22572. this.retryMinimumTime = 1e4
  22573. }
  22574. var r = (i("three"),
  22575. i("./enum/Viewmode"))
  22576. , o = (i("./settings"),
  22577. i("./objects/Panorama"))
  22578. , a = new (i("./util/logger"))(e);
  22579. t.prototype.start = function() {
  22580. this.loadNextPano(function(e) {
  22581. e ? this.start() : (a.debug("No suitable pano loaded, waiting a little while before looking again"),
  22582. setTimeout(function() {
  22583. this.start()
  22584. }
  22585. .bind(this), 1e3))
  22586. }
  22587. .bind(this))
  22588. }
  22589. ,
  22590. t.prototype.validLoadTarget = function(e) {
  22591. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  22592. }
  22593. ,
  22594. t.prototype.listImagePanos = function() {
  22595. var i = []
  22596. , n = this;
  22597. return this.model.images.forEach(function(e) {
  22598. if (e.metadata && e.metadata.scan_id) {
  22599. var t = n.model.panos.get(e.metadata.scan_id);
  22600. t && !t.isLoaded("high") && i.push(t)
  22601. }
  22602. }),
  22603. i
  22604. }
  22605. ,
  22606. t.prototype.nextNotLoadedImage = function() {
  22607. for (; 0 < this.imagePanos.length; ) {
  22608. var e = this.imagePanos[0];
  22609. if (!e.isLoaded("high"))
  22610. return e;
  22611. this.imagePanos.shift()
  22612. }
  22613. return null
  22614. }
  22615. ,
  22616. t.prototype.loadNextPano = function(e) {
  22617. var t, i, n = this.model.waitQueue.filter(function(e) {
  22618. return e.object instanceof o
  22619. });
  22620. 0 < n.length ? (t = n[0].object,
  22621. a.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  22622. a.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  22623. a.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  22624. t = this.imagePanos[0],
  22625. 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),
  22626. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  22627. a.debug("Preloading " + i + "-res pano " + t.id),
  22628. t.loadCube(i).done(e).fail(function() {
  22629. a.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  22630. e()
  22631. })) : e && e(null)
  22632. }
  22633. ,
  22634. n.exports = t
  22635. }
  22636. ).call(this, "/js/preloaders.js")
  22637. }
  22638. , {
  22639. "./enum/Viewmode": 51,
  22640. "./objects/Panorama": 148,
  22641. "./settings": 166,
  22642. "./util/logger": 189,
  22643. three: 217
  22644. }],
  22645. 157: [function(a, s, e) {
  22646. (function(e) {
  22647. "use strict";
  22648. function t(e, t, i, n, r) {
  22649. this.qualityManager = e,
  22650. this.scene = t,
  22651. this.camera = i,
  22652. this.container = r,
  22653. this.controls = n,
  22654. this.controls.enabled = !0,
  22655. this.controls.locked = !0,
  22656. this.quickstartCamera = n.camera,
  22657. this.quickstartCamera.fov = d.clampVFOV(o.insideFOV, o.insideFOVMax, $("#player").width(), $("#player").height()),
  22658. this.skybox = null
  22659. }
  22660. var i = a("three")
  22661. , n = a("../util/logger")
  22662. , o = a("../constants")
  22663. , h = (a("../util/transitions"),
  22664. a("../util/lerp"),
  22665. a("../util/easing"),
  22666. a("../enum/Vectors"))
  22667. , u = a("../enum/PanoSizeClass")
  22668. , r = (a("../materials/ModelTextureMaterial"),
  22669. a("../materials/CubemapMaterial"))
  22670. , d = (a("../cameras/PanoramaCamera"),
  22671. a("../controls/PanoramaControls"),
  22672. a("../tile/TileUtils"),
  22673. a("../util/camera"),
  22674. a("../util/cameraLight"))
  22675. , p = (a("../util/browser"),
  22676. a("../settings"),
  22677. a("../gui/helpManager"),
  22678. new n(e));
  22679. t.prototype.load = function(e) {
  22680. e.pano.shouldRedrawOnBaseLoaded = !0;
  22681. var t, i, n = this, r = h.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  22682. this.controls.lookAt(r.add(this.quickstartCamera.position));
  22683. var a = this.qualityManager.getPanoSize(u.BASE)
  22684. , s = this.qualityManager.getPanoSize(u.STANDARD);
  22685. if (e.pano.tiled) {
  22686. p.warn("Loading startPano, TILED", e.pano.id);
  22687. var l = d.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  22688. , c = this.quickstartCamera.fov;
  22689. p.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + l + ", vertical FOV: " + c + "]"),
  22690. t = e.pano.loadTiledPano(s, r, {
  22691. hFov: l,
  22692. vFov: c
  22693. }, !1, !1, !0),
  22694. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  22695. } else
  22696. p.warn("Loading startPano", e.pano.id),
  22697. t = e.pano.loadCube("high");
  22698. return $.when(t).then(function() {
  22699. n.init(e.pano, e.quaternion),
  22700. e.pano.tiled ? i.done(function() {
  22701. e.pano.lockUntilRenderingComplete = !1,
  22702. this.controls.locked = !1
  22703. }
  22704. .bind(this)) : this.controls.locked = !1
  22705. }
  22706. .bind(this))
  22707. }
  22708. ,
  22709. t.prototype.init = function(e, t) {
  22710. p.info("Quickstart done loading, adding scene objects"),
  22711. e.lockUntilRenderingComplete = !0,
  22712. this.skybox = new i.Mesh(new i.CubeGeometry(1,1,1),new r({
  22713. side: i.BackSide
  22714. })),
  22715. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  22716. this.skybox.quaternion.copy(e.quaternion),
  22717. this.scene.add(this.skybox),
  22718. $(this.container).show()
  22719. }
  22720. ,
  22721. t.prototype.update = function(e) {
  22722. this.controls.update(e),
  22723. this.camera.copy(this.quickstartCamera)
  22724. }
  22725. ,
  22726. t.prototype.setSize = function(e, t) {
  22727. this.quickstartCamera.updateAspect(e / t)
  22728. }
  22729. ,
  22730. t.prototype.destroy = function() {
  22731. this.scene.remove(this.skybox)
  22732. }
  22733. ,
  22734. s.exports = t
  22735. }
  22736. ).call(this, "/js/scene/QuickstartManager.js")
  22737. }
  22738. , {
  22739. "../cameras/PanoramaCamera": 7,
  22740. "../constants": 8,
  22741. "../controls/PanoramaControls": 13,
  22742. "../enum/PanoSizeClass": 36,
  22743. "../enum/Vectors": 50,
  22744. "../gui/helpManager": 68,
  22745. "../materials/CubemapMaterial": 117,
  22746. "../materials/ModelTextureMaterial": 118,
  22747. "../settings": 166,
  22748. "../tile/TileUtils": 174,
  22749. "../util/browser": 182,
  22750. "../util/camera": 183,
  22751. "../util/cameraLight": 184,
  22752. "../util/easing": 186,
  22753. "../util/lerp": 188,
  22754. "../util/logger": 189,
  22755. "../util/transitions": 195,
  22756. three: 217
  22757. }],
  22758. 158: [function(e, t, i) {
  22759. "use strict";
  22760. function h(e, t, i) {
  22761. this.scene = e,
  22762. this.camera = t,
  22763. this.renderer = null,
  22764. this.effects = i,
  22765. this.animateCallback = null,
  22766. this.composer = null,
  22767. this.qualityManager = null,
  22768. e.renderWidth = 0,
  22769. e.renderHeight = 0,
  22770. this.updateClock = new M.Clock,
  22771. this.components = [],
  22772. this.updateListeners = [],
  22773. this.resizeListeners = [],
  22774. this.forceUpdateSize = !1,
  22775. this.started = !1,
  22776. this.textures = {},
  22777. this.suspendedObjects = []
  22778. }
  22779. 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;
  22780. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  22781. (h.prototype = Object.create(p.prototype)).addComponent = function(e) {
  22782. this.components.push(e),
  22783. e.update && this.updateListeners.push(e),
  22784. e.setSize && (this.resizeListeners.push(e),
  22785. this.forceUpdateSize = !0)
  22786. }
  22787. ,
  22788. h.prototype.removeComponent = function(t) {
  22789. function e(e) {
  22790. return e !== t
  22791. }
  22792. this.components = this.components.filter(e),
  22793. this.updateListeners = this.updateListeners.filter(e),
  22794. this.resizeListeners = this.resizeListeners.filter(e)
  22795. }
  22796. ,
  22797. h.prototype.start = function(e) {
  22798. if (this.started)
  22799. throw new l("Can't start SceneRenderer, already started");
  22800. this.createContext(e),
  22801. //u.isMobile() && this.boluoVrInit(),
  22802. this.initComposer(),
  22803. this.started = !0,
  22804. (b = b.bind(this))()
  22805. }
  22806. ,
  22807. h.prototype.createContext = function(e) {
  22808. try {
  22809. this.renderer = new M.WebGLRenderer({antialias: !u.isMobile()}),
  22810. this.renderer.autoClear = !0,
  22811. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  22812. this.renderer.setSize($("#player").width(), $("#player").height(), !1),
  22813. this.emit(r.ContextCreated)
  22814. } catch (e) {
  22815. throw new c("Unable to create a WebGL rendering context")
  22816. }
  22817. d.profiling.enabled && this.overrideTextures(),
  22818. e.appendChild(this.renderer.domElement)
  22819. }
  22820. ,
  22821. h.prototype.overrideTextures = function() {
  22822. var d = this.renderer.context
  22823. , t = 0
  22824. , i = d.createTexture;
  22825. d.createTexture = function() {
  22826. var e = i.call(d);
  22827. return e.id = t++,
  22828. this.textures[e.id] = e
  22829. }
  22830. .bind(this);
  22831. var p = d.texImage2D;
  22832. d.texImage2D = function(e, t, i, n, r, o, a, s, l) {
  22833. var c, h = this.getTextureTypeFromTarget(d, e);
  22834. c = h === f.TextureCube ? d.getParameter(d.TEXTURE_BINDING_CUBE_MAP) : d.getParameter(d.TEXTURE_BINDING_2D),
  22835. void 0 !== a ? p.call(d, e, t, i, n, r, o, a, s, l) : (a = n,
  22836. s = r,
  22837. n = (l = o).naturalWidth,
  22838. r = l.naturalHeight,
  22839. p.call(d, e, t, i, a, s, l));
  22840. var u = this.textures[c.id];
  22841. u.width = h === f.TextureCube ? 6 * n : n,
  22842. u.height = r
  22843. }
  22844. .bind(this);
  22845. var n = d.deleteTexture;
  22846. d.deleteTexture = function(e) {
  22847. delete this.textures[e.id],
  22848. n.call(d, e)
  22849. }
  22850. .bind(this)
  22851. }
  22852. ,
  22853. h.prototype.updateTextureMemory = (n = null,
  22854. function() {
  22855. var e = 0;
  22856. for (var t in this.textures) {
  22857. var i = this.textures[t];
  22858. i.width && i.height && (e += i.width * i.height * 4)
  22859. }
  22860. e !== n && this.emit(r.MemoryUsageUpdated, e),
  22861. n = e
  22862. }
  22863. ),
  22864. h.prototype.getTextureTypeFromTarget = function(e, t) {
  22865. switch (t) {
  22866. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  22867. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  22868. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  22869. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  22870. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  22871. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  22872. return f.TextureCube;
  22873. case e.TEXTURE_2D:
  22874. return f.Texture2D;
  22875. default:
  22876. return null
  22877. }
  22878. }
  22879. ,
  22880. h.prototype.initComposer = function() {
  22881. this.composer = new M.EffectComposer(this.renderer),
  22882. this.composer.addPass(new M.RenderPass(this.scene,this.camera)),
  22883. this.composer.addPass(this.effects.hblurPass),
  22884. this.composer.addPass(this.effects.vblurPass)
  22885. }
  22886. ,
  22887. h.prototype.setSize = function(e, t, i) {
  22888. this.renderWidth = e,
  22889. this.renderHeight = t,
  22890. this.effects.aspect = e / t,
  22891. this.renderer.setSize(e, t, !1, i),
  22892. this.composer.setSize(e, t);
  22893. for (var n = 0; n < this.resizeListeners.length; n++)
  22894. this.resizeListeners[n].setSize(e, t)
  22895. }
  22896. ,
  22897. h.prototype.render = function() {
  22898. 0 < this.effects.currentBlur ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  22899. }
  22900. ,
  22901. h.prototype.boluoVrInit = function() {
  22902. console.log("boluoVrInit"),
  22903. this.isHuawei5X = u.detectHUAWEI5X(),
  22904. this.oldRenderer = this.renderer,
  22905. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera),
  22906. window.panoCamera = this.camera;
  22907. var i = this;
  22908. window._vrEnabled = !1,
  22909. Object.defineProperty(window, "vrEnabled", {
  22910. get: function() {
  22911. return window._vrEnabled
  22912. },
  22913. set: function(e) {
  22914. (e = !!e) ? (i.renderer = i.newRenderer,
  22915. window.vrMarkers.forEach(function(e) {
  22916. e.visible = !0
  22917. })) : (i.renderer = i.oldRenderer,
  22918. window.vrMarkers.forEach(function(e) {
  22919. e.visible = !1
  22920. })),
  22921. i.cursor.visible = e,
  22922. i.setSize($("#player").width(), $("#player").height()),
  22923. window._vrEnabled = e,
  22924. setTimeout(function() {
  22925. console.log(player.cameraControls.activeControl.camera.fov)
  22926. }, 500)
  22927. }
  22928. }),
  22929. this.createCursor(.5, !1, 1, 16777215, 0);
  22930. var e = {
  22931. setSize: function(e, t) {
  22932. i.camera.aspect = e / t
  22933. }
  22934. };
  22935. this.resizeListeners.push(e),
  22936. this.vrLoadingInit()
  22937. }
  22938. ,
  22939. h.prototype.vrLoadingInit = function() {
  22940. var e = new (e = function(camera) {
  22941. var t = this
  22942. , e = new M.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  22943. , i = new M.MeshBasicMaterial({
  22944. color: 4967932,
  22945. side: M.DoubleSide
  22946. })
  22947. , n = new M.Mesh(e,i);
  22948. (this.mesh = n).position.z = -2,
  22949. n.scale.set(.08, .08, .08),
  22950. n.visible = !1,
  22951. //window.player.camera.add(n),
  22952. camera.add(n),
  22953. t.enabled = !1,
  22954. this.update = function(e) {
  22955. 1 == t.enabled && (n.rotation.z += 15 * e)
  22956. }
  22957. }
  22958. )(this.camera);
  22959. window.Loading = e,
  22960. this.updateListeners.push(e)
  22961. }
  22962. ,
  22963. h.prototype.createCursor = function(e, t, i, n, r) {
  22964. var o, a = new M.SpriteMaterial({
  22965. opacity: i,
  22966. color: n,
  22967. transparent: t,
  22968. map: this.boluoGetTexture("images/cursor.png"),
  22969. needsUpdate: !0,
  22970. side: M.DoubleSide
  22971. });
  22972. a.map.offset = new M.Vector2(1 / 17 * r,0),
  22973. a.map.repeat = new M.Vector2(1 / 17,1),
  22974. a.depthTest = !1,
  22975. a.blending = M.AdditiveBlending,
  22976. (o = new M.Sprite(a)).scale.set(.3, .3, .3),
  22977. o.position.z = -2,
  22978. o.visible = !1,
  22979. o.name = "cursor",
  22980. this.camera.add(o),
  22981. this.scene.add(this.camera),
  22982. this.cursor = o;
  22983. var s = new this.CursorAnimation(this.scene,o,this.camera);
  22984. this.cursor.triggerTargetEvent = s.triggerTargetEvent,
  22985. this.updateListeners.push(s)
  22986. }
  22987. ,
  22988. h.prototype.CursorAnimation = function(e, t, o) {
  22989. this.cursor = t,
  22990. this.raycaster = new M.Raycaster,
  22991. this.targetEventObj = {},
  22992. this.type = 1,
  22993. this.tweenFlag = !0;
  22994. var s = this;
  22995. this.target = o,
  22996. console.log(o.uuid),
  22997. this.euler = new M.Euler,
  22998. this.q0 = new M.Quaternion,
  22999. this.q1 = new M.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  23000. this.zee = new M.Vector3(0,0,1),
  23001. this.alpha = -1e3,
  23002. this.beta = -1e3,
  23003. this.gamma = -1e3,
  23004. this.orient = M.Math.degToRad(window.orientation || 0),
  23005. window.addEventListener("orientationchange", function() {
  23006. s.orient = M.Math.degToRad(window.orientation || 0)
  23007. }),
  23008. window.addEventListener("deviceorientation", function(e) {
  23009. var t = M.Math.degToRad(e.alpha)
  23010. , i = M.Math.degToRad(e.beta)
  23011. , n = M.Math.degToRad(e.gamma);
  23012. if (this.isHuawei5X ? (-1e3 === s.alpha && (s.alpha = t),
  23013. -1e3 === s.beta && (s.beta = i),
  23014. -1e3 === s.gamma && (s.gamma = n),
  23015. .06 < Math.abs(t - s.alpha) && (s.alpha = t),
  23016. .006 < Math.abs(i - s.beta) && (s.beta = i),
  23017. .006 < Math.abs(n - s.gamma) && (s.gamma = n)) : (s.alpha = t,
  23018. s.beta = i,
  23019. s.gamma = n),
  23020. h.vrDebug) {
  23021. $("#info-device-orientation").css("display", "block");
  23022. var r = "";
  23023. r += "alpha=(" + s.alpha + ")<BR/>",
  23024. r += "beta=(" + s.beta + ")<BR/>",
  23025. r += "gamma=" + s.gamma + "<BR/>",
  23026. document.getElementById("info-device-orientation").innerHTML = r
  23027. }
  23028. }),
  23029. this.setObjectQuaternion = function(e, t, i, n, r) {
  23030. s.euler.set(i, t, -n, "YXZ"),
  23031. e.setFromEuler(s.euler),
  23032. e.multiply(s.q1),
  23033. e.multiply(s.q0.setFromAxisAngle(s.zee, -r)),
  23034. o.updateMatrixWorld()
  23035. }
  23036. ,
  23037. parent !== window && window.addEventListener("message", function(e) {
  23038. var t, i, n, r, o = JSON.parse(e.data), a = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  23039. o && o.alpha && o.beta && o.gamma && (t = a,
  23040. i = M.Math.degToRad(o.alpha),
  23041. n = M.Math.degToRad(o.beta),
  23042. r = M.Math.degToRad(o.gamma),
  23043. t ? (-1e3 === s.alpha && (s.alpha = i),
  23044. -1e3 === s.beta && (s.beta = n),
  23045. -1e3 === s.gamma && (s.gamma = r),
  23046. .06 < Math.abs(i - s.alpha) && (s.alpha = i),
  23047. .006 < Math.abs(n - s.beta) && (s.beta = n),
  23048. .006 < Math.abs(r - s.gamma) && (s.gamma = r)) : (s.alpha = i,
  23049. s.beta = n,
  23050. s.gamma = r))
  23051. }),
  23052. this.update = function(e) {
  23053. TWEEN.update(),
  23054. window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient),
  23055. this.triggerTargetEvent())
  23056. }
  23057. ,
  23058. this.triggerTargetEvent = function() {
  23059. var e = this.choseObj()
  23060. , t = e ? e.object : void 0;
  23061. (this.targetEventObj.currentObj = t) !== this.targetEventObj.lastObj && (t && this.autoCursorPosition(e),
  23062. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  23063. t && t.enabled && this.startAnimate(function() {
  23064. this.clickCallback(t)
  23065. }
  23066. .bind(this))) : this.type,
  23067. this.targetEventObj.lastObj = t)
  23068. }
  23069. ,
  23070. this.choseObj = function() {
  23071. this.raycaster.setFromCamera({
  23072. x: 0,
  23073. y: 0
  23074. }, o);
  23075. var e = (this.raycaster.ray,
  23076. window.vrMarkers)
  23077. , t = this.raycaster.intersectObjects(e);
  23078. if (0 < t.length)
  23079. return t[0]
  23080. }
  23081. ,
  23082. this.clickCallback = function(e) {
  23083. this.runTHREEAction(e, "onclick")
  23084. }
  23085. ,
  23086. this.runTHREEAction = function(e, t) {
  23087. switch (t) {
  23088. case "onclick":
  23089. e._listeners && e._listeners.click && e._listeners.click.forEach(function(e) {
  23090. e()
  23091. });
  23092. break;
  23093. case "onhover":
  23094. e._listeners && e._listeners.hover && e._listeners.hover.forEach(function(e) {
  23095. e()
  23096. });
  23097. break;
  23098. case "onout":
  23099. e._listeners && e._listeners.out && e._listeners.out.forEach(function(e) {
  23100. e()
  23101. })
  23102. }
  23103. }
  23104. ,
  23105. this.startAnimate = function(e) {
  23106. this.tweenFlag && this.initAnimation(e)
  23107. }
  23108. ,
  23109. this.initAnimation = function(e) {
  23110. var t = this
  23111. , i = this.cursor.material.map.offset;
  23112. t.tweenFlag = !1,
  23113. this.cursorAnimate = new TWEEN.Tween(i).to({
  23114. x: 1
  23115. }, 1e3).onStart(function() {
  23116. t.tweenFlag = !1
  23117. }).onStop(function() {
  23118. t.tweenFlag = !0,
  23119. this.x = 0,
  23120. i.x = 0
  23121. }).onUpdate(function() {}).onComplete(function() {
  23122. e(),
  23123. i.x = 0,
  23124. setTimeout(function() {
  23125. t.tweenFlag = !0
  23126. }, 1500)
  23127. }),
  23128. this.cursorAnimate.easing(function(e) {
  23129. return Math.floor(17 * e) / 17
  23130. }),
  23131. this.cursorAnimate.start()
  23132. }
  23133. ,
  23134. this.autoCursorPosition = function(e) {
  23135. this.cursor.scale.set(.3, .3, .3)
  23136. }
  23137. }
  23138. ,
  23139. h.prototype.vrRenderer = function(a, i, e) {
  23140. var s = new i.vrCamera(e);
  23141. s.bananaAspect = .8,
  23142. this.width,
  23143. this.height;
  23144. i = this;
  23145. this.setSize = function(e, t) {
  23146. a.setSize.call(this, e, t),
  23147. i.width = e,
  23148. i.height = t
  23149. }
  23150. ,
  23151. this.render = function(e, t, i, n) {
  23152. var r, o;
  23153. if (window.cameraQua = t.quaternion.clone(),
  23154. t.__RESS__SKIP__STEREO__)
  23155. return a.render(e, t, i, n);
  23156. if ("PerspectiveCamera" === t.type)
  23157. r = s.cameraL,
  23158. o = s.cameraR,
  23159. e.updateMatrixWorld(),
  23160. null === t.parent && t.updateMatrixWorld(),
  23161. s.vrCameraUpdate(t);
  23162. else {
  23163. if ("OrthographicCamera" !== t.type)
  23164. return DEBUG && console.error("Unsupported renderer: ", t.type);
  23165. r = o = t
  23166. }
  23167. a.setScissorTest(!0),
  23168. a.setScissor(0, 0, this.width / 2, this.height),
  23169. a.setViewport(0, 0, this.width / 2, this.height),
  23170. a.render.call(this, e, r, i, n),
  23171. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  23172. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  23173. a.render.call(this, e, o, i, n),
  23174. a.setScissorTest(!1)
  23175. }
  23176. ,
  23177. this.__proto__ = {
  23178. __proto__: a
  23179. }
  23180. }
  23181. ,
  23182. h.prototype.vrCamera = function(e) {
  23183. this.type = "StereoCamera",
  23184. this._aspect = 1,
  23185. this._overlap = .064,
  23186. this.cameraL = new M.PerspectiveCamera,
  23187. this.cameraL.layers.enable(1),
  23188. this.cameraL.matrixAutoUpdate = !1,
  23189. this.cameraR = new M.PerspectiveCamera,
  23190. this.cameraR.layers.enable(2),
  23191. this.cameraR.matrixAutoUpdate = !1,
  23192. this.eyeRight = new M.Matrix4,
  23193. this.eyeLeft = new M.Matrix4,
  23194. this.vrCameraNeedsUpdate = !0,
  23195. window.vrCameraL = this.cameraL,
  23196. Object.defineProperty(this, "bananaAspect", {
  23197. get: function() {
  23198. return this._aspect
  23199. },
  23200. set: function(e) {
  23201. this._aspect !== e && (this.vrCameraNeedsUpdate = !0),
  23202. this._aspect = e
  23203. }
  23204. }),
  23205. Object.defineProperty(this, "overlap", {
  23206. get: function() {
  23207. return this._overlap
  23208. },
  23209. set: function(e) {
  23210. this._overlap !== e && (this.vrCameraNeedsUpdate = !0),
  23211. this._overlap = e
  23212. }
  23213. }),
  23214. this.vrCameraUpdate = function(e) {
  23215. if (this.vrCameraNeedsUpdate = !0,
  23216. this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== e.fov || this.bananaReal_aspect !== e.aspect * this.bananaAspect || this.bananaNear !== e.near || this.bananaFar !== e.far,
  23217. this.vrCameraNeedsUpdate) {
  23218. this.vrCameraNeedsUpdate = !1,
  23219. console.debug("vrCameraUpdate"),
  23220. this.bananaFocus = e.focus,
  23221. this.bananaFov = e.fov,
  23222. this.bananaReal_aspect = e.aspect * this.bananaAspect,
  23223. this.bananaNear = e.near,
  23224. this.bananaFar = e.far,
  23225. console.debug(e.aspect),
  23226. this.bananaFocus = 10;
  23227. 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);
  23228. this.eyeLeft.elements[12] = -r,
  23229. this.eyeRight.elements[12] = r,
  23230. t = -a * this.bananaReal_aspect + o,
  23231. i = a * this.bananaReal_aspect + o,
  23232. n.elements[0] = 2 * this.bananaNear / (i - t),
  23233. n.elements[8] = (i + t) / (i - t),
  23234. this.cameraL.projectionMatrix.copy(n),
  23235. t = -a * this.bananaReal_aspect - o,
  23236. i = a * this.bananaReal_aspect - o,
  23237. n.elements[0] = 2 * this.bananaNear / (i - t),
  23238. n.elements[8] = (i + t) / (i - t),
  23239. this.cameraR.projectionMatrix.copy(n)
  23240. }
  23241. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(this.eyeLeft),
  23242. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(this.eyeRight)
  23243. }
  23244. }
  23245. ,
  23246. h.prototype.boluoGetTexture = function(e) {
  23247. var t = new M.TextureLoader;
  23248. return t.crossOrigin = "anonymous",
  23249. t.load(e)
  23250. }
  23251. ,
  23252. h.prototype.updateScreenSize = function(e) {
  23253. var t, i, n, r = !1;
  23254. e && !e.resize && null != e.width && null != e.height ? (i = e.width,
  23255. n = e.height,
  23256. r = !0,
  23257. t = 1) : (i = $("#player").width(),
  23258. n = $("#player").height(),
  23259. e && e.resize && (o = this.renderWidth,
  23260. a = this.renderHeight),
  23261. i === o && n === a && !this.forceUpdateSize || (o = i,
  23262. a = n,
  23263. r = !0,
  23264. t = window.devicePixelRatio)),
  23265. r && (this.setSize(i, n, t),
  23266. this.forceUpdateSize = !1)
  23267. }
  23268. ,
  23269. h.prototype.updateComponents = function() {
  23270. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  23271. this.updateListeners[t].update(e)
  23272. }
  23273. ,
  23274. h.prototype.suspend = function() {
  23275. this.started = !1,
  23276. this.suspendedObjects = this.scene.children.map(function(e) {
  23277. return this.scene.remove(e),
  23278. e
  23279. }
  23280. .bind(this)),
  23281. this.render()
  23282. }
  23283. ,
  23284. h.prototype.resume = function() {
  23285. this.suspendedObjects.forEach(function(e) {
  23286. this.scene.add(e)
  23287. }
  23288. .bind(this)),
  23289. this.suspendedObjects = [],
  23290. this.started = !0,
  23291. b()
  23292. }
  23293. ;
  23294. var g, m, v, y, A, C, I, P, O, L, D, N, F, E, _, b = function() {
  23295. this.started && (window.requestAnimationFrame(b),
  23296. this.updateScreenSize(),
  23297. this.updateComponents(),
  23298. this.updateTextureMemory(),
  23299. this.render(),
  23300. this.emit(r.AfterRender))
  23301. };
  23302. h.prototype.getImageData = (E = document.createElement("canvas"),
  23303. _ = E.getContext("2d"),
  23304. function(e, t, i) {
  23305. return E.width === t && E.height === i || (E.width = t,
  23306. E.height = i),
  23307. _.drawImage(e, 0, 0, t, i),
  23308. _.getImageData(0, 0, t, i)
  23309. }
  23310. ),
  23311. h.prototype.initSizedTexture2D = function(e, t, i) {
  23312. var n = this.renderer
  23313. , r = n.context
  23314. , o = n.state
  23315. , a = new M.Texture(null);
  23316. !(a.flipY = !1) !== i && (i = !1),
  23317. a.generateMipmaps = i;
  23318. var s = n.paramThreeToGL(a.format)
  23319. , l = n.paramThreeToGL(a.type)
  23320. , c = n.properties.get(a)
  23321. , h = r.createTexture();
  23322. o.bindTexture(r.TEXTURE_2D, h),
  23323. r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, a.flipY),
  23324. r.texImage2D(r.TEXTURE_2D, 0, s, e, e, 0, s, l, null),
  23325. a.wrapS = t,
  23326. a.wrapT = t;
  23327. var u = n.paramThreeToGL(t);
  23328. return r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, u),
  23329. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, u),
  23330. i ? (a.magFilter = M.LinearFilter,
  23331. a.minFilter = M.LinearMipMapLinearFilter,
  23332. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23333. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_NEAREST),
  23334. r.generateMipmap(r.TEXTURE_2D)) : (a.magFilter = M.LinearFilter,
  23335. a.minFilter = M.LinearFilter,
  23336. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23337. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR)),
  23338. o.bindTexture(r.TEXTURE_2D, null),
  23339. c.__webglTexture = h,
  23340. a
  23341. }
  23342. ,
  23343. h.prototype.initSizedCubeMap = function(e, t) {
  23344. var i = this.renderer
  23345. , n = i.context
  23346. , r = i.state
  23347. , o = new M.CubeTexture([null, null, null, null, null, null]);
  23348. o.flipY = !1,
  23349. o.generateMipmaps = t;
  23350. var a = i.paramThreeToGL(o.format)
  23351. , s = i.paramThreeToGL(o.type)
  23352. , l = i.properties.get(o)
  23353. , c = n.createTexture();
  23354. r.bindTexture(n.TEXTURE_CUBE_MAP, c),
  23355. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, o.flipY);
  23356. for (var h = 0; h < 6; h++)
  23357. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + h, 0, a, e, e, 0, a, s, null);
  23358. return t ? (o.magFilter = M.LinearFilter,
  23359. o.minFilter = M.LinearMipMapLinearFilter,
  23360. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23361. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  23362. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  23363. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (o.magFilter = M.LinearFilter,
  23364. o.minFilter = M.LinearFilter,
  23365. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23366. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  23367. r.bindTexture(n.TEXTURE_CUBE_MAP, null),
  23368. l.__image__webglTextureCube = c,
  23369. o
  23370. }
  23371. ,
  23372. h.prototype.deallocateCubeTexture = function(e) {
  23373. var t = this.renderer
  23374. , i = t.context
  23375. , n = t.properties.get(e);
  23376. i.deleteTexture(n.__image__webglTextureCube)
  23377. }
  23378. ,
  23379. h.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  23380. var a = this.renderer
  23381. , s = a.context
  23382. , l = a.state
  23383. , c = a.properties.get(t);
  23384. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  23385. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23386. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  23387. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  23388. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  23389. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  23390. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  23391. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  23392. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  23393. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  23394. l.bindTexture(s.TEXTURE_2D, null)
  23395. }
  23396. ,
  23397. h.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  23398. var s = this.renderer
  23399. , l = s.context
  23400. , c = s.state
  23401. , h = s.properties.get(t);
  23402. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  23403. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23404. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  23405. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  23406. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  23407. }
  23408. ,
  23409. h.prototype.rebuildMipMaps2D = function(e) {
  23410. var t = this.renderer
  23411. , i = t.context
  23412. , n = t.state;
  23413. t.properties.get(e),
  23414. i.generateMipmap(i.TEXTURE_2D),
  23415. n.bindTexture(i.TEXTURE_2D, null)
  23416. }
  23417. ,
  23418. h.prototype.rebuildMipMaps3D = function(e) {
  23419. var t = this.renderer
  23420. , i = t.context
  23421. , n = t.state
  23422. , r = t.properties.get(e);
  23423. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  23424. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  23425. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  23426. }
  23427. ,
  23428. h.prototype.renderToCubeMap = (P = !1,
  23429. F = N = D = L = O = null,
  23430. function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  23431. this.renderer.context,
  23432. P || ((L = new M.OrthographicCamera(-.5,.5,.5,-.5,-200,200)).position.z = 150,
  23433. (O = new M.Scene).add(L),
  23434. D = new M.ShaderMaterial({
  23435. uniforms: {
  23436. tDiffuse: {
  23437. type: "t",
  23438. value: null
  23439. },
  23440. alpha: {
  23441. type: "f",
  23442. value: 1
  23443. }
  23444. },
  23445. vertexShader: R.basicTextured.vertexShader,
  23446. fragmentShader: R.basicTextured.fragmentShader,
  23447. depthWrite: !1,
  23448. depthTest: !1,
  23449. side: M.DoubleSide
  23450. }),
  23451. N = new M.PlaneBufferGeometry(1,1),
  23452. (F = new M.Mesh(N,D)).position.z = 0,
  23453. O.add(F),
  23454. P = !0);
  23455. var m = N.getAttribute("uv");
  23456. m.setDynamic(!0),
  23457. m.needsUpdate = !0;
  23458. var v = m.array
  23459. , y = r / i
  23460. , A = o / n
  23461. , C = a / i
  23462. , I = s / n;
  23463. v[0] = y,
  23464. v[1] = A + I,
  23465. v[2] = y + C,
  23466. v[3] = A + I,
  23467. v[4] = y,
  23468. v[5] = A,
  23469. v[6] = y + C,
  23470. v[7] = A;
  23471. var E = N.getAttribute("position");
  23472. E.setDynamic(!0),
  23473. E.needsUpdate = !0;
  23474. var _ = E.array
  23475. , b = l / t.width - .5
  23476. , w = c / t.height - .5
  23477. , T = h / t.width
  23478. , x = u / t.height;
  23479. _[0] = b,
  23480. _[1] = w + x,
  23481. _[3] = b + T,
  23482. _[4] = w + x,
  23483. _[6] = b,
  23484. _[7] = w,
  23485. _[9] = b + T,
  23486. _[10] = w,
  23487. this.renderer.properties.get(e),
  23488. D.uniforms.tDiffuse.value = e,
  23489. D.blending = p || M.NoBlending,
  23490. D.transparent = !!f,
  23491. null != g || (g = 1),
  23492. D.uniforms.alpha.value = g,
  23493. D.needUpdate = !0,
  23494. t.activeCubeFace = d,
  23495. t.viewport.set(0, 0, t.width, t.height);
  23496. var S = this.renderer.autoClear;
  23497. this.renderer.autoClear = !1,
  23498. this.renderer.render(O, L, t, !1),
  23499. this.renderer.autoClear = S
  23500. }
  23501. ),
  23502. h.prototype.copyCubeMap = (g = !1,
  23503. C = A = y = v = m = null,
  23504. I = new M.Euler,
  23505. new M.Vector3,
  23506. function(e, t, i, n, r, o, a, s, l) {
  23507. this.renderer,
  23508. g || ((v = new M.OrthographicCamera(-1,1,1,-1,0,200)).position.set(0, 0, 0),
  23509. (m = new M.Scene).add(v),
  23510. y = new M.ShaderMaterial({
  23511. uniforms: {
  23512. tDiffuse: {
  23513. type: "t",
  23514. value: null
  23515. },
  23516. alpha: {
  23517. type: "f",
  23518. value: 1
  23519. }
  23520. },
  23521. vertexShader: R.copyCubeMap.vertexShader,
  23522. fragmentShader: R.copyCubeMap.fragmentShader,
  23523. depthWrite: !1,
  23524. depthTest: !1,
  23525. side: M.DoubleSide
  23526. }),
  23527. A = new M.BoxGeometry(2,2,2),
  23528. C = new M.Mesh(A,y),
  23529. m.add(C),
  23530. g = !0);
  23531. for (var c = 0; c < 6; c++)
  23532. h.getCubeOrientationForCubeFace(c, I),
  23533. C.rotation.copy(I),
  23534. C.matrixWorldNeedsUpdate = !0,
  23535. C.updateMatrixWorld(),
  23536. y.uniforms.tDiffuse.value = e,
  23537. y.blending = a || M.NoBlending,
  23538. y.transparent = !!s,
  23539. null != l || (l = 1),
  23540. y.uniforms.alpha.value = l,
  23541. y.needUpdate = !0,
  23542. t.activeCubeFace = c,
  23543. t.viewport.set(0, 0, r, o),
  23544. this.renderer.render(m, v, t, !1)
  23545. }
  23546. ),
  23547. h.getLookAtForCubeFace = function(e, t) {
  23548. switch (e) {
  23549. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23550. t.set(1, 0, 0);
  23551. break;
  23552. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23553. t.set(-1, 0, 0);
  23554. break;
  23555. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23556. t.set(0, 1, 0);
  23557. break;
  23558. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23559. t.set(0, -1, 0);
  23560. break;
  23561. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23562. t.set(0, 0, 1);
  23563. break;
  23564. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23565. t.set(0, 0, -1)
  23566. }
  23567. }
  23568. ,
  23569. h.getCubeOrientationForCubeFace = function(e, t) {
  23570. switch (e) {
  23571. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23572. t.set(0, -Math.PI / 2, 0);
  23573. break;
  23574. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23575. t.set(0, Math.PI / 2, 0);
  23576. break;
  23577. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23578. t.set(Math.PI / 2, Math.PI, 0);
  23579. break;
  23580. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23581. t.set(-Math.PI / 2, Math.PI, 0);
  23582. break;
  23583. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23584. t.set(0, -Math.PI, 0);
  23585. break;
  23586. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23587. t.set(0, 0, 0)
  23588. }
  23589. }
  23590. ,
  23591. t.exports = h
  23592. }
  23593. , {
  23594. "../enum/GLCubeFaces": 25,
  23595. "../enum/GLTextureType": 26,
  23596. "../enum/SceneRendererEvents": 43,
  23597. "../exception/BasicException": 55,
  23598. "../exception/RendererCreationException": 57,
  23599. "../settings": 166,
  23600. "../shaders": 167,
  23601. "../util/browser": 182,
  23602. events: 202,
  23603. three: 217
  23604. }],
  23605. 159: [function(e, t, i) {
  23606. "use strict";
  23607. function n(e) {
  23608. this.messenger = new a(e),
  23609. this.clientKey = null
  23610. }
  23611. var o = e("../util/ajax")
  23612. , r = e("./PostMessageType")
  23613. , a = e("./postmessage")
  23614. , s = e("./VersionInfo")
  23615. , l = e("events").EventEmitter
  23616. , c = window.location.origin + "/api/v1/user/";
  23617. (n.prototype = Object.create(l.prototype)).bindEvents = function() {
  23618. this.messenger.on(r.ACTION, this.onMessageReceived.bind(this))
  23619. }
  23620. ,
  23621. n.prototype.waitForConnection = function() {
  23622. return new Promise(function(t, i) {
  23623. this.messenger.on(r.CONNECT, function(e) {
  23624. this.onConnectionReceived(e).then(t.bind(this, e.sdkVersion), i.bind())
  23625. }
  23626. .bind(this))
  23627. }
  23628. .bind(this))
  23629. }
  23630. ,
  23631. n.prototype.onConnectionReceived = function(i) {
  23632. return this.messenger.setTarget(i.source, i.origin),
  23633. this.verifyConnection(i).then(function(e, t) {
  23634. this.messenger.send({
  23635. type: r.ACCEPT,
  23636. toId: i.fromId,
  23637. warning: t
  23638. }),
  23639. this.clientKey = e,
  23640. this.messenger.removeAllListeners(r.CONNECT),
  23641. this.bindEvents()
  23642. }
  23643. .bind(this), function(e) {
  23644. this.messenger.send({
  23645. type: r.REJECT,
  23646. toId: i.fromId,
  23647. reason: e
  23648. }),
  23649. this.messenger.setTarget()
  23650. }
  23651. .bind(this))
  23652. }
  23653. ,
  23654. n.prototype.verifyConnection = function(r) {
  23655. return new Promise(function(e, t) {
  23656. var i;
  23657. if (s.isDeprecated(r.sdkVersion))
  23658. i = "这个版本正在被弃用";
  23659. else if (!s.isSupported(r.sdkVersion))
  23660. return t("不支持此版本的SDK");
  23661. var n = {
  23662. cache: !1,
  23663. headers: {
  23664. "X-port-Application-Key": r.applicationKey,
  23665. "X-port-Referrer": r.origin
  23666. }
  23667. };
  23668. o.get(c, n).done(e.bind(this, r.applicationKey, i)).fail(t.bind(this, "key/referrer mismatch"))
  23669. }
  23670. )
  23671. }
  23672. ,
  23673. n.prototype.onMessageReceived = function(t) {
  23674. if (this.validateClientApplicationKey(t.applicationKey)) {
  23675. var i = this;
  23676. t.onDone = function(e) {
  23677. e.toId = t.fromId,
  23678. e.uid = t.uid,
  23679. e.type = r.RESPONSE,
  23680. i.messenger.send(e)
  23681. }
  23682. ,
  23683. this.emit(r.ACTION, t)
  23684. }
  23685. }
  23686. ,
  23687. n.prototype.validateClientApplicationKey = function(e) {
  23688. return this.clientKey === e
  23689. }
  23690. ,
  23691. n.prototype.sendEvent = function(e, t) {
  23692. this.messenger.send({
  23693. type: r.EVENT,
  23694. eventType: e,
  23695. eventData: t
  23696. })
  23697. }
  23698. ,
  23699. t.exports = n
  23700. }
  23701. , {
  23702. "../util/ajax": 181,
  23703. "./PostMessageType": 160,
  23704. "./VersionInfo": 163,
  23705. "./postmessage": 165,
  23706. events: 202
  23707. }],
  23708. 160: [function(e, t, i) {
  23709. "use strict";
  23710. t.exports = Object.freeze({
  23711. CONNECT: "postmessage.connect",
  23712. ACCEPT: "postmessage.accept",
  23713. REJECT: "postmessage.reject",
  23714. ACTION: "postmessage.action",
  23715. RESPONSE: "postmessage.response",
  23716. EVENT: "postmessage.event"
  23717. })
  23718. }
  23719. , {}],
  23720. 161: [function(e, t, i) {
  23721. "use strict";
  23722. t.exports = Object.freeze({
  23723. MOVE: "sdk.move",
  23724. ENTER_PANO: "sdk.enterpano",
  23725. MODEL_LOADED: "sdk.modelloaded"
  23726. })
  23727. }
  23728. , {}],
  23729. 162: [function(e, t, i) {
  23730. "use strict";
  23731. t.exports = Object.freeze({
  23732. FLY: "transition.fly",
  23733. FADEOUT: "transition.fade",
  23734. INSTANT: "transition.instant"
  23735. })
  23736. }
  23737. , {}],
  23738. 163: [function(e, t, i) {
  23739. "use strict";
  23740. t.exports = {
  23741. current: "1.0",
  23742. supported: ["1.0"],
  23743. deprecated: [],
  23744. isSupported: function(e) {
  23745. return -1 !== this.supported.indexOf(e)
  23746. },
  23747. isDeprecated: function(e) {
  23748. return -1 !== this.deprecated.indexOf(e)
  23749. },
  23750. isValid: function(e) {
  23751. return this.isSupported(e) || this.isDeprecated(e)
  23752. }
  23753. }
  23754. }
  23755. , {}],
  23756. 164: [function(q, X, e) {
  23757. (function(e) {
  23758. "use strict";
  23759. function r(e, t, i) {
  23760. e = e && e.toLowerCase().trim();
  23761. var n = new C.UP.clone
  23762. , r = Math.PI / 3
  23763. , o = Math.PI / 2;
  23764. switch (e) {
  23765. case "left":
  23766. i.copy(t),
  23767. i.applyAxisAngle(n, o);
  23768. break;
  23769. case "right":
  23770. i.copy(t),
  23771. i.applyAxisAngle(n, -o);
  23772. break;
  23773. case "forwardleft":
  23774. i.copy(t),
  23775. i.applyAxisAngle(n, r);
  23776. break;
  23777. case "forwardright":
  23778. i.copy(t),
  23779. i.applyAxisAngle(n, -r);
  23780. break;
  23781. case "forward":
  23782. default:
  23783. i.copy(t)
  23784. }
  23785. return i
  23786. }
  23787. function o(e, t) {
  23788. if (e) {
  23789. var i = {
  23790. pano: e,
  23791. lookAtPoint: null,
  23792. duration: null,
  23793. maxDistanceOverride: null,
  23794. skipWarpingCheck: !1
  23795. };
  23796. this.player.flyToPano(i, function() {
  23797. t && t({
  23798. success: !0,
  23799. message: "Transition complete."
  23800. })
  23801. })
  23802. } else
  23803. M.warn("Showcase -> clickPanoObject: Unable to find pano."),
  23804. t && t({
  23805. success: !1,
  23806. error: "Unable to find pano."
  23807. })
  23808. }
  23809. function a(e, t) {
  23810. t.copy(C.FORWARD),
  23811. e.getDirection(t)
  23812. }
  23813. function c(i) {
  23814. return {
  23815. panos: i.panos.list.map(function(e) {
  23816. var t = y.getCubemapUrls(i.urls, e.id, "high")[A.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  23817. return {
  23818. uuid: e.id,
  23819. aligned: e.alignmentType === g.ALIGNED,
  23820. neighbourUUIDs: e.neighbourUUIDs.slice(),
  23821. position: function(e) {
  23822. return e.alignmentType !== g.ALIGNED ? null : {
  23823. x: e.position.x,
  23824. y: e.position.y,
  23825. z: e.position.z
  23826. }
  23827. }(e),
  23828. rotation: function(e) {
  23829. var t = (new h.Euler).setFromQuaternion(e.quaternion, "YXZ");
  23830. return {
  23831. x: h.Math.radToDeg(t._x),
  23832. y: h.Math.radToDeg(t._y),
  23833. z: h.Math.radToDeg(t._z)
  23834. }
  23835. }(e),
  23836. thumbnail: t
  23837. }
  23838. })
  23839. }
  23840. }
  23841. 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"),
  23842. q("../enum/PlayerEvents")), b = q("../sdk/SdkEvents"), w = (C = q("../enum/Vectors"),
  23843. q("../enum/ControlEvents")), T = q("../enum/RenderLayers"), x = (q("../constants"),
  23844. q("../settings")), S = q("../lib/jpeg_encoder"), M = new n(e), R = (N.active = !1,
  23845. N.angle = 0,
  23846. N.angleTravelled = 0,
  23847. N.playerDirection = new h.Vector3,
  23848. N.lastFacingDirection = new h.Vector3,
  23849. N.onDone = null,
  23850. N.player = null,
  23851. N.start = function(e, t, i, n) {
  23852. N.active = !0,
  23853. e && t && (t = 0),
  23854. N.angle = e || t,
  23855. N.xAngle = e,
  23856. N.yAngle = t,
  23857. N.angleTravelled = 0,
  23858. N.playerDirection.copy(i.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23859. i.getDirection(N.playerDirection),
  23860. N.lastFacingDirection.copy(N.playerDirection),
  23861. N.projectVectors(),
  23862. N.onDone = n,
  23863. N.player = i,
  23864. N()
  23865. }
  23866. ,
  23867. N.projectVectors = function() {
  23868. N.xAngle && (N.playerDirection.projectOnPlane(C.UP),
  23869. N.lastFacingDirection.projectOnPlane(C.UP))
  23870. }
  23871. ,
  23872. N), P = (i = new h.Vector3,
  23873. function(e) {
  23874. e ? (i.copy(e.position),
  23875. i.add(e.discPosition),
  23876. s.projectPositionToCanvas(i, this.player.camera, i),
  23877. this.click(i.x, i.y)) : M.warn("Showcase -> clicktagObject: Unable to find tag.")
  23878. }
  23879. ), O = (l = new h.Vector3,
  23880. function(e) {
  23881. var t = this.player.getDirection();
  23882. l.copy(t);
  23883. var i = l.y;
  23884. l.y = 0,
  23885. l.normalize();
  23886. var n = h.Math.radToDeg(l.angleTo(t)) * (i < 0 ? -1 : 1);
  23887. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.PANORAMA)
  23888. return 0 !== e && M.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  23889. 0;
  23890. this.player.mode === I.DOLLHOUSE && (n = -n);
  23891. var r = function() {
  23892. return this.player.mode === I.PANORAMA ? x.insideLookLimitUp : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.minPolarAngle) : null
  23893. }
  23894. .call(this) - .1
  23895. , o = function() {
  23896. return this.player.mode === I.PANORAMA ? x.insideLookLimitDown : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.maxPolarAngle) : null
  23897. }
  23898. .call(this) + .1
  23899. , a = n + e;
  23900. r < a ? a = r : a < o && (a = o);
  23901. var s = a - n;
  23902. return 0 < e && s < .01 && (s = 0),
  23903. e < 0 && -.01 < s && (s = 0),
  23904. s
  23905. }
  23906. ), L = (t = new h.Euler,
  23907. function(e) {
  23908. return t.setFromQuaternion(e.quaternion, "YXZ"),
  23909. {
  23910. position: {
  23911. x: e.position.x,
  23912. y: e.position.y,
  23913. z: e.position.z
  23914. },
  23915. rotation: {
  23916. x: h.Math.radToDeg(t.x),
  23917. y: h.Math.radToDeg(t.y),
  23918. z: 0
  23919. },
  23920. pano: e.currentPano ? e.currentPano.id : null,
  23921. mode: e.mode
  23922. }
  23923. }
  23924. ), D = null;
  23925. function N() {
  23926. N.playerDirection.copy(N.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23927. N.player.getDirection(N.playerDirection),
  23928. N.projectVectors();
  23929. var e = N.playerDirection.angleTo(N.lastFacingDirection);
  23930. (N.angleTravelled += Math.abs(e)) >= Math.abs(N.angle) ? (N.active = !1,
  23931. N.onDone && (0,
  23932. N.onDone)()) : (N.lastFacingDirection.copy(N.playerDirection),
  23933. window.setTimeout(N, 4))
  23934. }
  23935. X.exports = {
  23936. init: function(e, t, i, n, r) {
  23937. Y.init(e, t, i, r),
  23938. D = new Promise(function(e, t) {
  23939. i.on(_.Ready, function() {
  23940. e()
  23941. })
  23942. }
  23943. .bind(this));
  23944. var o = new u(window)
  23945. , a = o.waitForConnection();
  23946. a.then(function(e) {
  23947. o.on(f.ACTION, Y.onMessageReceive.bind(Y))
  23948. });
  23949. var s, l = (s = Date.now(),
  23950. function() {
  23951. if (!(Date.now() - s < 100)) {
  23952. var e = L(i);
  23953. o.sendEvent(b.MOVE, {
  23954. state: e
  23955. }),
  23956. s = Date.now()
  23957. }
  23958. }
  23959. );
  23960. i.on(_.Move, l),
  23961. i.on(_.ViewChanged, l),
  23962. n.on(p.ActiveModelChanged, function(e) {
  23963. function t(e) {
  23964. var t, i = e.newPano.id;
  23965. e.oldPano && (t = e.oldPano.id),
  23966. i !== t && o.sendEvent(b.ENTER_PANO, {
  23967. oldPano: t,
  23968. newPano: i
  23969. })
  23970. }
  23971. var i = e.model
  23972. , n = e.oldModel;
  23973. Y.model = i,
  23974. a.then(function() {
  23975. o.sendEvent(b.MODEL_LOADED, {
  23976. metadata: c(i)
  23977. })
  23978. }),
  23979. n && n.panos.forEach(function(e) {
  23980. e.removeEventListener("enter", t)
  23981. }),
  23982. i.panos.forEach(function(e) {
  23983. e.on("enter", t)
  23984. })
  23985. })
  23986. }
  23987. };
  23988. var F, B, V, k, U, H, z, G, W, j, Y = {
  23989. director: null,
  23990. player: null,
  23991. controls: null,
  23992. sceneRenderer: null,
  23993. model: null,
  23994. init: function(e, t, i, n) {
  23995. this.director = e,
  23996. this.player = i,
  23997. this.controls = t,
  23998. this.sceneRenderer = n
  23999. },
  24000. handleToObject: {},
  24001. objectToHandle: {},
  24002. handleCount: 0,
  24003. onMessageReceive: function(e) {
  24004. if (e) {
  24005. var t = e.targetFunction
  24006. , i = e.params
  24007. , n = e.onDone;
  24008. t && this[t] && this[t](i, n)
  24009. }
  24010. },
  24011. waitForInit: function(e, t) {
  24012. D.then(t.bind({
  24013. success: !0,
  24014. message: "Init complete."
  24015. }))
  24016. },
  24017. moveToPano: (W = new h.Euler(0,0,0,"YXZ"),
  24018. j = new h.Quaternion,
  24019. function(e, t) {
  24020. var i = e.pano
  24021. , n = e.rotation
  24022. , r = e.transition;
  24023. if (!this.model)
  24024. return t({
  24025. success: !1,
  24026. error: "The model has not been loaded yet"
  24027. });
  24028. var o = this.model.panos.get(i);
  24029. if (!o)
  24030. return t({
  24031. success: !1,
  24032. error: i + " does not exist in this model"
  24033. });
  24034. if (!n)
  24035. return t({
  24036. sucess: !1,
  24037. erorr: n + " is not a valid rotation"
  24038. });
  24039. W.set(h.Math.degToRad(n.x || 0), h.Math.degToRad(n.y || 0), h.Math.degToRad(n.z || 0), "YXZ"),
  24040. console.log(n.z);
  24041. var a = {
  24042. success: !0,
  24043. message: i
  24044. };
  24045. if (r === v.FADEOUT)
  24046. j.setFromEuler(W),
  24047. this.player.warpToPano(o, j, null, null, E.BLACK, null, null, t.bind(this, a));
  24048. else {
  24049. var s, l;
  24050. r === v.INSTANT && (l = s = 0);
  24051. var c = C.FORWARD.clone().applyEuler(W).add(o.position);
  24052. this.player.flyToPano({
  24053. pano: o,
  24054. lookAtPoint: c,
  24055. duration: s,
  24056. aimDuration: l
  24057. }, t.bind(this, a))
  24058. }
  24059. }
  24060. ),
  24061. moveInDirection: function(e, t) {
  24062. var i = e.direction;
  24063. return void 0 === m[i] ? (M.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  24064. void (t && t({
  24065. success: !1,
  24066. error: "Invalid direction."
  24067. }))) : void this.player.flyLocalDirection(C[i].clone()).then(function(e) {
  24068. t(e ? {
  24069. success: !0,
  24070. message: "moved " + i
  24071. } : {
  24072. success: !1,
  24073. error: "Cannot move in direction: " + i
  24074. })
  24075. })
  24076. },
  24077. getPose: function(e, t) {
  24078. return this.player.camera.position,
  24079. (new h.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ"),
  24080. t({
  24081. success: !0,
  24082. message: L(this.player)
  24083. })
  24084. },
  24085. takeScreenShot: (z = new h.PerspectiveCamera,
  24086. G = new h.WebGLRenderTarget,
  24087. function(e, t) {
  24088. if (!e.resolution)
  24089. return t({
  24090. success: !1,
  24091. error: "An invalid resolution was specified"
  24092. });
  24093. if (-1 === e.resolution.width || -1 === e.resolution.height) {
  24094. var i = this.sceneRenderer.renderer.getSize();
  24095. e.resolution.width = i.width,
  24096. e.resolution.height = i.height
  24097. }
  24098. z.layers.set(T.DEFAULT),
  24099. e.visibleObjects && (e.visibleObjects.showtags && z.layers.enable(T.TAG),
  24100. e.visibleObjects.showPucks && z.layers.enable(T.PANOMARKERS),
  24101. e.visibleObjects.showReticule && z.layers.enable(T.RETICULE));
  24102. var n = e.resolution.width
  24103. , r = e.resolution.height
  24104. , o = n / r;
  24105. z.position.copy(this.sceneRenderer.camera.position),
  24106. z.quaternion.copy(this.sceneRenderer.camera.quaternion),
  24107. z.projectionMatrix.copy(this.player.camera.projectionMatrix),
  24108. z.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / o,
  24109. G.setSize(n, r),
  24110. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, z, G);
  24111. var a = new Uint8Array(n * r * 4);
  24112. this.sceneRenderer.renderer.readRenderTargetPixels(G, 0, 0, n, r, a);
  24113. var s = S.encode({
  24114. data: a,
  24115. width: n,
  24116. height: r,
  24117. heading: 180,
  24118. pitch: 0
  24119. }, {
  24120. quality: 75,
  24121. flipY: !0
  24122. });
  24123. t({
  24124. success: !0,
  24125. message: "data:image/jpg;base64," + d.uint8ToBase64(s.data)
  24126. })
  24127. }
  24128. ),
  24129. findRankedPano: (U = new h.Vector3,
  24130. H = new h.Vector3,
  24131. function(e, t) {
  24132. a(this.player, H),
  24133. r(t, H, U);
  24134. var i = this.player.rankedPanoInDirection(e, U);
  24135. if (i) {
  24136. var n = this.objectToHandle[i.id];
  24137. return n || (this.objectToHandle[i.id] = n = this.handleCount++,
  24138. this.handleToObject[n] = i),
  24139. n
  24140. }
  24141. return M.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  24142. -1
  24143. }
  24144. ),
  24145. findRankedtag: (V = new h.Vector3,
  24146. k = new h.Vector3,
  24147. function(e, t) {
  24148. a(this.player, k),
  24149. r(t, k, V);
  24150. var i = this.player.rankedtagInDirection(e, V);
  24151. if (i) {
  24152. var n = this.objectToHandle[i.sid];
  24153. return n || (this.objectToHandle[i.sid] = n = this.handleCount++,
  24154. this.handleToObject[n] = i),
  24155. n
  24156. }
  24157. return M.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  24158. -1
  24159. }
  24160. ),
  24161. clickNearesttag: function(e) {
  24162. this.clickRankedtag(0, e)
  24163. },
  24164. clickRankedtag: function(e, t) {
  24165. var i = function(e, t) {
  24166. var i = this.findRankedtag(e, t);
  24167. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  24168. null)
  24169. }
  24170. .call(this, e, t);
  24171. i && P.call(this, i)
  24172. },
  24173. clickNearestPano: function(e, t) {
  24174. this.clickRankedPano(0, e, t)
  24175. },
  24176. clickRankedPano: function(e, t, i) {
  24177. var n = function(e, t) {
  24178. var i = this.findRankedPano(e, t);
  24179. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  24180. null)
  24181. }
  24182. .call(this, e, t);
  24183. n ? o.call(this, n, i) : i(null)
  24184. },
  24185. clickPano: function(e, t) {
  24186. var i = this.handleTable[e];
  24187. i ? o.call(this, i, t) : t(null)
  24188. },
  24189. rotateDirection: function(e, t) {
  24190. var i = e.direction
  24191. , n = e.angle;
  24192. if (!R.active) {
  24193. var r = 0
  24194. , o = 0
  24195. , a = 0
  24196. , s = 0;
  24197. if (!n || isNaN(n))
  24198. return M.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  24199. void (t && t({
  24200. success: !1,
  24201. error: "Invalid rotation angle."
  24202. }));
  24203. if (this.player.mode === I.TRANSITIONING)
  24204. return M.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  24205. void (t && t({
  24206. success: !1,
  24207. error: "Cannot rotate while transitioning"
  24208. }));
  24209. if (i === m.RIGHT || i === m.LEFT)
  24210. i === m.RIGHT && (n = -n),
  24211. r = 0 < n ? -1 : 1,
  24212. a = n;
  24213. else {
  24214. if (i !== m.UP && i !== m.DOWN)
  24215. return M.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  24216. void (t && t({
  24217. success: !1,
  24218. error: "Invalid direction for rotation."
  24219. }));
  24220. if (this.player.mode === I.FLOORPLAN)
  24221. return M.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  24222. void (t && t({
  24223. success: !1,
  24224. error: "Cannot rotate " + i + " in floorplan mode"
  24225. }));
  24226. if (i === m.DOWN && (n = -n),
  24227. 0 === (n = O.call(this, n)))
  24228. return M.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  24229. void (t && t({
  24230. success: !1,
  24231. error: "Already at maximum rotation in direction: " + i
  24232. }));
  24233. o = 0 < n ? 1 : -1,
  24234. s = n
  24235. }
  24236. var l = n;
  24237. n = h.Math.degToRad(n),
  24238. a = h.Math.degToRad(a),
  24239. s = h.Math.degToRad(s);
  24240. var c = this.controls.activeControl;
  24241. c.startRotating(r, o),
  24242. R.start(a, s, this.player, function() {
  24243. c.stopRotating(!0),
  24244. t && t({
  24245. success: !0,
  24246. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  24247. })
  24248. })
  24249. }
  24250. },
  24251. rotate: (F = new h.Vector3,
  24252. B = new h.Vector3,
  24253. function(e, t) {
  24254. var i = e.xAngle
  24255. , n = e.yAngle;
  24256. if (!R.active) {
  24257. if (i = i || 0,
  24258. n = n || 0,
  24259. isNaN(i) || isNaN(n))
  24260. return M.warn("Showcase -> rotate: Invalid rotation angle."),
  24261. void (t && t({
  24262. success: !1,
  24263. error: "Invalid rotation angle."
  24264. }));
  24265. if (this.player.mode === I.TRANSITIONING)
  24266. return M.warn("Automation -> rotate: Cannot rotate while transitioning"),
  24267. void (t && t({
  24268. success: !1,
  24269. error: "Cannot rotate while transitioning"
  24270. }));
  24271. Math.abs(i) < .01 && (i = 0),
  24272. Math.abs(n) < .01 && (n = 0);
  24273. var r = n;
  24274. n = O.call(this, n);
  24275. var o = 0 < r ? "UP" : "DOWN";
  24276. if (!(i = -i) && r && !n)
  24277. return M.warn("Showcase -> rotate: Already at maximum rotation in direction: " + o),
  24278. void (t && t({
  24279. success: !1,
  24280. error: "Already at maximum rotation in direction: " + o
  24281. }));
  24282. n < r && M.warn("Showcase -> rotate: Reached maximum rotation in direction: " + o);
  24283. var a = n;
  24284. n = h.Math.degToRad(n),
  24285. i = h.Math.degToRad(i),
  24286. F.copy(this.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24287. this.player.getDirection(F),
  24288. B.copy(F).applyAxisAngle(C.UP, i),
  24289. B.applyAxisAngle(C.RIGHT, n);
  24290. var s = (F.angleTo(B),
  24291. 0 < i ? -1 : i < 0 ? 1 : 0)
  24292. , l = 0 < n ? 1 : n < 0 ? -1 : 0;
  24293. Math.abs(i) > Math.abs(n) ? l *= Math.abs(n / i) : Math.abs(n) > Math.abs(i) && (s *= Math.abs(i / n));
  24294. var c = this.controls.activeControl;
  24295. c.startRotating(s, l),
  24296. R.start(i, n, this.player, function() {
  24297. c.stopRotating(!0),
  24298. t && t({
  24299. success: !0,
  24300. message: "Rotated " + e.xAngle.toFixed(2) + "° horizontally, " + a.toFixed(2) + "° vertically"
  24301. })
  24302. })
  24303. }
  24304. }
  24305. ),
  24306. panCamera: function(e, i) {
  24307. function t(e) {
  24308. switch (r.removeAllListeners(w.AutoPanComplete),
  24309. r.removeAllListeners(w.AutoPanInterrupt),
  24310. r.removeAllListeners(w.AutoPanClamped),
  24311. e) {
  24312. case w.AutoPanInterrupt:
  24313. i({
  24314. success: !0,
  24315. message: "Camera panning interrupted."
  24316. });
  24317. break;
  24318. case w.AutoPanClamped:
  24319. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  24320. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  24321. return void i({
  24322. success: !1,
  24323. error: "Already at edge of current model bounds."
  24324. });
  24325. var t = "The view point is outside the bounds for the current model. ";
  24326. t += "The view point was clamped to " + o(r.target.x, r.target.z),
  24327. console.warn(t)
  24328. }
  24329. case w.AutoPanComplete:
  24330. i({
  24331. success: !0,
  24332. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  24333. })
  24334. }
  24335. }
  24336. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.FLOORPLAN)
  24337. return i({
  24338. success: !1,
  24339. error: "Camera panning is not available in the current mode: " + this.player.mode
  24340. });
  24341. var n = e.position
  24342. , r = this.player.control;
  24343. r.setAutoPanPosition(n.x, n.z),
  24344. r.autoPan = !0;
  24345. var o = function(e, t) {
  24346. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  24347. };
  24348. r.on(w.AutoPanComplete, t.bind(this, w.AutoPanComplete)),
  24349. r.on(w.AutoPanInterrupt, t.bind(this, w.AutoPanInterrupt)),
  24350. r.on(w.AutoPanClamped, t.bind(this, w.AutoPanClamped))
  24351. },
  24352. click: function(e, t) {
  24353. var i = e.x
  24354. , n = e.y;
  24355. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24356. n = n / 100 * $("#player").height()),
  24357. this.player.handleInputStart(i, n),
  24358. this.player.updateIntersect(),
  24359. this.player.handleInputEnd(i, n)
  24360. },
  24361. mouseOver: function(e, t) {
  24362. var i = e.x
  24363. , n = e.y;
  24364. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24365. n = n / 100 * $("#player").height()),
  24366. this.player.handleInputMove(i, n),
  24367. this.player.updateIntersect()
  24368. },
  24369. moveToMode: function(e, t) {
  24370. function i(e) {
  24371. t(e ? {
  24372. success: !1,
  24373. error: "Failed to load new mode: " + e
  24374. } : {
  24375. success: !0,
  24376. message: "Moved to new mode: " + n
  24377. })
  24378. }
  24379. var n = e.mode;
  24380. n === I.PANORAMA || n === I.DOLLHOUSE || n === I.FLOORPLAN ? this.director.changeMode(n).then(function() {
  24381. i()
  24382. }, function(e) {
  24383. i(e)
  24384. }) : t({
  24385. success: !1,
  24386. error: "Invalid mode selection"
  24387. })
  24388. }
  24389. }
  24390. }
  24391. ).call(this, "/js/sdk/automation.js")
  24392. }
  24393. , {
  24394. "../constants": 8,
  24395. "../enum/AlignmentType": 17,
  24396. "../enum/ControlEvents": 21,
  24397. "../enum/Direction": 22,
  24398. "../enum/GLCubeFaces": 25,
  24399. "../enum/Keys": 30,
  24400. "../enum/ModelManagerEvents": 33,
  24401. "../enum/PlayerEvents": 40,
  24402. "../enum/RenderLayers": 41,
  24403. "../enum/Vectors": 50,
  24404. "../enum/Viewmode": 51,
  24405. "../enum/WarpStyle": 52,
  24406. "../lib/jpeg_encoder": 94,
  24407. "../sdk/SdkEvents": 161,
  24408. "../settings": 166,
  24409. "../util/common": 185,
  24410. "../util/logger": 189,
  24411. "../util/math": 190,
  24412. "../util/panorama": 191,
  24413. "./ApiHost": 159,
  24414. "./PostMessageType": 160,
  24415. "./TransitionStyles": 162,
  24416. three: 217
  24417. }],
  24418. 165: [function(e, t, i) {
  24419. "use strict";
  24420. function n(e) {
  24421. this.sourceWindow = e,
  24422. this.targetWindow = null,
  24423. this.targetOrigin = null,
  24424. this.id = Math.floor(1e5 * Math.random()),
  24425. this.bindEvents()
  24426. }
  24427. var r = e("./PostMessageType")
  24428. , o = e("events").EventEmitter;
  24429. (n.prototype = Object.create(o.prototype)).bindEvents = function() {
  24430. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  24431. }
  24432. ,
  24433. n.prototype.setTarget = function(e, t) {
  24434. this.targetWindow = e,
  24435. this.targetOrigin = t
  24436. }
  24437. ,
  24438. n.prototype.onPostmessageReceived = function(e) {
  24439. var t = e.origin || e.originalEvent.origin
  24440. , i = e.source;
  24441. switch (e.data.type) {
  24442. case r.CONNECT:
  24443. break;
  24444. case r.RESPONSE:
  24445. if (this.id !== e.data.toId)
  24446. return;
  24447. default:
  24448. if (!this.validateMessageOrigin(t))
  24449. return
  24450. }
  24451. var n = e.data;
  24452. n.source = i,
  24453. n.origin = t,
  24454. n.timestamp = Date.now(),
  24455. this.emit(e.data.type, n)
  24456. }
  24457. ,
  24458. n.prototype.validateMessageOrigin = function(e) {
  24459. return "*" === this.targetOrigin || e === this.targetOrigin
  24460. }
  24461. ,
  24462. n.prototype.send = function(e) {
  24463. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  24464. this.targetWindow.postMessage(e, this.targetOrigin))
  24465. }
  24466. ,
  24467. t.exports = n
  24468. }
  24469. , {
  24470. "./PostMessageType": 160,
  24471. events: 202
  24472. }],
  24473. 166: [function(e, t, i) {
  24474. "use strict";
  24475. var n = e("three")
  24476. , r = e("./util/browser")
  24477. , o = e("./enum/Viewmode")
  24478. , a = e("./enum/VROption")
  24479. , s = e("./enum/Colors")
  24480. , l = e("./enum/WarpStyle")
  24481. , c = e("./util/easing")
  24482. , h = e("./util/common")
  24483. , u = e("./util/showcase")
  24484. , d = e("./constants")
  24485. , p = {
  24486. debug: !1,
  24487. version: "2.25.6-0-gd87e5b1",
  24488. languageTag: r.valueFromHash("lang", null),
  24489. pageTitle: "四维虚拟漫游",
  24490. authorizationHeader: u.getAuthorizationHeader(),
  24491. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  24492. logLevel: r.valueFromHash("log", 2),
  24493. skyboxRadius: 2500,
  24494. modelBoundsPadding: 5,
  24495. showNeighbors: !1,
  24496. brand: r.valueFromHash("brand", !0),
  24497. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  24498. startHighlights: r.valueFromHash("hl", -1),
  24499. specialEdition: r.valueFromHash("bn", 0),
  24500. useWheel: r.valueFromHash("wh", !0),
  24501. crossOrigin: "anonymous",
  24502. fancierTransition: !1,
  24503. wireframe: !1,
  24504. skyboxWireframe: !1,
  24505. modelAlpha: 1,
  24506. highlightPanoSelection: !1,
  24507. showSweeps: !0,
  24508. showSkyboxes: !1,
  24509. showMesh: !0,
  24510. showFloors: !1,
  24511. showFloorDuration: 300,
  24512. showFloorDelay: 300,
  24513. hideFloorDuration: 300,
  24514. hideFloorDelay: 0,
  24515. reticuleOpacityTransitionTime: 250,
  24516. reticuleColor: window.DATA.mouseMarkerColor || s.newBlue,
  24517. markerOpacityTransitionTime: 500,
  24518. guiAnimationSpeed: 250,
  24519. highlightAnimationDuration: 500,
  24520. modelComponentLoadSpinnerDelay: 150,
  24521. captureErrors: !1,
  24522. maxMobileTextures: 6,
  24523. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  24524. startupFlyinDelay: 3e3,
  24525. dollhouseDefault: {
  24526. minDistance: 1,//15, //编辑页面给近一些
  24527. maxDistance: 50,
  24528. minPolarAngle: n.Math.degToRad(10),
  24529. maxPolarAngle: n.Math.degToRad(90)
  24530. },
  24531. hideReticuleTimeout: 1e3,
  24532. analytics: {
  24533. inactivityThreshold: 30,
  24534. sessionTrackingRate: .15,
  24535. maxTrackedErrors: 20,
  24536. sessionDurationPingFrequency: 10,
  24537. sessionDurationTimeout: 15
  24538. },
  24539. flydown: {
  24540. movementEasing: "easeInOutQuad",
  24541. movementDelay: .001,
  24542. rotationEasing: "easeInOutQuad",
  24543. rotationDelay: .5,
  24544. modelTextureDelay: .75,
  24545. skyboxDelay: .75
  24546. },
  24547. transition: {
  24548. flySpeed: .001,
  24549. flyTime: 750,
  24550. flytimeMaxDistanceThreshold: 5,
  24551. flytimeDistanceMultiplier: 150,
  24552. aimTime: 1500,
  24553. aimSlowFactor: 1.5,
  24554. blur: .8,
  24555. movementEasing: "easeInOutQuad",
  24556. blendEasing: "easeInOutQuad",
  24557. fastForwardFactor: 3
  24558. },
  24559. show360Views: {
  24560. enabled: !0,
  24561. transitionTime: 1e3
  24562. },
  24563. quickstart: {
  24564. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  24565. animation: 1400,
  24566. showTextDelay: 500,
  24567. fadeOutDelay: 3e3,
  24568. fovChange: 10
  24569. },
  24570. appConfig: {
  24571. webvr_version: null,
  24572. segment_key: null,
  24573. embedly_key: null,
  24574. branch_key: null,
  24575. keen_write_key: null,
  24576. keen_project_id: null
  24577. },
  24578. vr: {
  24579. enabled: !0,
  24580. allowWebVR: !1,
  24581. option: r.valueFromHash("vr", a.CONTEXTUAL)
  24582. },
  24583. share: {
  24584. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  24585. },
  24586. input: {
  24587. longTapThreshold: 200,
  24588. moveToleranceNDC: .08,
  24589. touchMoveThreshold: 25
  24590. },
  24591. help: {
  24592. modalStayDuration: 600
  24593. },
  24594. immersive: {
  24595. timeToShowAgain: 1250,
  24596. uiStayDuration: 600
  24597. },
  24598. tourInteraction: {
  24599. disabled: "0" === r.valueFromHash("tourcta", null),
  24600. showPauseButton: 1e3,
  24601. showModal: 1500,
  24602. allowNextClick: 200,
  24603. largeModal: "1" === r.valueFromHash("tourcta", null),
  24604. smallModal: "2" === r.valueFromHash("tourcta", null)
  24605. },
  24606. labels: {
  24607. enabled: !1,
  24608. hideUntilStart: !0,
  24609. fadeInDuration: 250,
  24610. fadeInDelay: 250,
  24611. fadeOutDuration: 250,
  24612. fadeOutDelay: 0,
  24613. zoomHideThreshhold: {
  24614. mobile: r.isSmallScreen() ? .45 : .6,
  24615. desktop: 2
  24616. },
  24617. zoomTruncateThreshhold: {
  24618. mobile: r.isSmallScreen() ? .35 : .45,
  24619. desktop: .85
  24620. },
  24621. minLengthForTruncate: 16,
  24622. truncateLength: 12,
  24623. truncateSuffix: "..."
  24624. },
  24625. tags: {
  24626. enabled: r.valueFromHash("mt", 1),
  24627. startup: {
  24628. hideUntilStart: !0,
  24629. fadeInDuration: 500,
  24630. fadeInDelay: 100
  24631. },
  24632. visibility: {
  24633. anyDistance: !0,
  24634. visibleDistance: 8,
  24635. cameraClearance: .1,
  24636. alphaTestLevel: .05,
  24637. hideViaFloor: !0,
  24638. hideOffScreenDisc: !1,
  24639. hideOffScreenObject: !1
  24640. },
  24641. disc: {
  24642. opacity: 1,
  24643. disabledOpacity: .5,
  24644. scale: {
  24645. nearBound: 1.5,
  24646. farBound: 4.8,
  24647. linkFarBound: !1,
  24648. linkPercent: 40,
  24649. maxSize: 80,
  24650. minSize: 40,
  24651. baseViewportSize: 800,
  24652. responsiveness: 100
  24653. }
  24654. },
  24655. pole: {
  24656. enabled: !0,
  24657. height: .5,
  24658. width: 2,
  24659. opacity: .5,
  24660. color: "white"
  24661. },
  24662. navigate: {
  24663. nearestPano: !0,
  24664. lineOfSight: !0,
  24665. reactivate: !0,
  24666. aimAt: "disc",
  24667. tiltTolerance: 25,
  24668. rotateSpeedFactor: .6
  24669. }
  24670. },
  24671. path: {
  24672. color: window.DATA.floorMarkerColor || s.newBlue,
  24673. colorUp: s._desat(s.newBlue, .5),
  24674. colorDown: s._darken(s.newBlue, .35),
  24675. opacity: .5,
  24676. style: "ribbon",
  24677. height: .025,
  24678. ribbonWidth: .24,
  24679. outsideHeight: .5,
  24680. waypointRadius: .5,
  24681. waypointIndoorRadius: .24,
  24682. waypointPulse: 1e3,
  24683. typ: l.BLACK,
  24684. meshFree: r.valueFromHash("mf", 1),
  24685. mapGuides: r.valueFromHash("guides", !0),
  24686. fadeInTime: 400,
  24687. fadeOutTime: 300
  24688. },
  24689. warp: {
  24690. nearPanoDist: .1,
  24691. matchCam: !1,
  24692. blur: .33,
  24693. fastTime: 1500,
  24694. teleportTime: 1500,//瞬间过渡的时间
  24695. flytimeDistanceMultiplier:150,//add
  24696. flyTime:750,//add
  24697. outsideTime: 2e3,
  24698. lookAheadMax: .3,
  24699. lookAheadDist: 2.5,
  24700. softPushDist: .37,
  24701. softPushEnd: .3,
  24702. softBendAngle: 8,
  24703. softBendTilt: 4,
  24704. softBendEnd: .3,
  24705. doBurns: !0,
  24706. burnsAngle: 8,
  24707. minBurnsAngle: 35,
  24708. minDownAngle: -35,
  24709. maxTurnPerSec: 280,
  24710. maxAimPerSec: 35,
  24711. minRotation: 12,
  24712. maxAimRotation: 33.2,
  24713. turnFriction: .2,
  24714. flySpeed: .01,
  24715. minWarpTime: 1200,
  24716. warpInterruptionRedirectTime: 500,
  24717. tourStepDelay: r.valueFromHash("st", 0),
  24718. walkDelay: 0,
  24719. walkMaxDist: 50,
  24720. walkMinDist: .8,
  24721. walkSlideShowThreshhold: 3e3,
  24722. walkExtraPanosDistance: .4,
  24723. timePerMeter: 1200,
  24724. motionLeadTime: 5e3,
  24725. movementEasing: "easeInOutQuad",
  24726. blendEasing: "easeInOutQuad",
  24727. showBunny: !1,
  24728. loop: r.valueFromHash("lp", !1),
  24729. auto: r.valueFromHash("ts", -1),
  24730. eOrder: "YXZ",
  24731. stepFactor: .25,
  24732. brakeStrength: 2,
  24733. minBrakeAngle: .1,
  24734. maxBrakeAngle: 1.8,
  24735. climbEffort: 4
  24736. },
  24737. rotationFriction: .05,
  24738. rotationAccelerationInside: 4.5,
  24739. rotationAccelerationOutside: .15,
  24740. rotationAfterMoveMultiplier: 40,
  24741. rotationAfterMoveHistoryCount: 5,
  24742. panFriction: .09,
  24743. panAccelerationOutside: 60,
  24744. onload: r.valueFromHash("onload", o.PANORAMA),
  24745. zoomNearLimit: .1,
  24746. zoomFarLimit: 50,
  24747. navigation: {
  24748. panoScores: !1,
  24749. mouseDirection: !0,
  24750. filterStrictness: .75,
  24751. angleFactor: -30,
  24752. directionFactor: 10,
  24753. distanceFactor: -1,
  24754. optionalityFactor: 3
  24755. },
  24756. sdkInit: !1,
  24757. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  24758. console: r.valueFromHash("console", !1),
  24759. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  24760. panoramaNeighbourMaxDistance: 5,
  24761. panoFloorClickRadius: .35,
  24762. showScreenshotLocations: !1,
  24763. showAxis: !1,
  24764. showNeighbourRaycasts: !1,
  24765. colorMarkerOnLoad: !1,
  24766. colorMarkerByFloor: !1,
  24767. tiling: {
  24768. panoPreRenderRepeatDelay: 2500,
  24769. panoPreRenderDelay: 500,
  24770. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  24771. tilingFlagNames: ["usetiles", "tiles"],
  24772. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  24773. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  24774. overlayStyle: r.valueFromHash("tileoverlay", 0),
  24775. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  24776. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  24777. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  24778. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  24779. customCompression: r.valueFromHash("tilecustcomp", 0),
  24780. mobileHighQualityOverride: 1,
  24781. allowUltraHighResolution: !0
  24782. },
  24783. zoom: {
  24784. enabled: !0,
  24785. forceOff: r.valueFromHash("nozoom", 0),
  24786. overridemax: r.valueFromHash("maxzoom", null),
  24787. overridemin: r.valueFromHash("minzoom", null),
  24788. max: d.highQualityMaxZoom,
  24789. min: 1,
  24790. transitionStyle: r.valueFromHash("zoomtrans", 1),
  24791. activationThreshold: 1.1,
  24792. restoreTime: 500
  24793. },
  24794. profiling: {
  24795. enabled: r.valueFromHash("mem", !1)
  24796. }
  24797. };
  24798. (p = h.deepExtend(p, d, {
  24799. insideFOV: r.valueFromHash("fov", d.insideFOV),
  24800. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  24801. panorama: {
  24802. transitionTime: 1e3,
  24803. modelAlpha: 0,
  24804. modelAlphaDelay: p.flydown.modelTextureDelay,
  24805. modelAlphaLength: 1,
  24806. skyboxOpacity: 1,
  24807. skyboxOpacityDelay: p.flydown.skyboxDelay,
  24808. skyboxOpacityLength: .9,
  24809. fovLength: 1,
  24810. fovDelay: 0,
  24811. cameraMatrixDuration: .8,
  24812. cameraMatrixDelay: 0,
  24813. cameraMatrixEase: c.easeInCubic,
  24814. reticuleOpacity: 1,
  24815. markerOpacity: .3,
  24816. markerOpacityOnHover: 1
  24817. },
  24818. dollhouse: {
  24819. transitionTime: 1e3,
  24820. modelAlpha: 1,
  24821. modelAlphaDelay: 0,
  24822. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24823. skyboxOpacity: 0,
  24824. skyboxOpacityDelay: 0,
  24825. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24826. fovLength: 1,
  24827. fovDelay: 0,
  24828. cameraMatrixDuration: .8,
  24829. cameraMatrixDelay: .3,
  24830. cameraMatrixEase: c.easeInCubic,
  24831. reticuleOpacity: 1,
  24832. markerOpacity: 0,
  24833. markerOpacityOnHover: 0
  24834. },
  24835. floorplan: {
  24836. transitionTime: 1e3,
  24837. modelAlpha: 1,
  24838. modelAlphaDelay: 0,
  24839. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24840. skyboxOpacity: 0,
  24841. skyboxOpacityDelay: 0,
  24842. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24843. fovLength: 1,
  24844. fovDelay: 0,
  24845. cameraMatrixDuration: .5,
  24846. cameraMatrixDelay: 0,
  24847. cameraMatrixEase: c.easeOutCubic,
  24848. reticuleOpacity: 1,
  24849. markerOpacity: 0,
  24850. markerOpacityOnHover: 0,
  24851. cameraHeight: 50
  24852. },
  24853. transitioning: {
  24854. reticuleOpacity: 0,
  24855. markerOpacity: .3,
  24856. markerOpacityOnHover: 1
  24857. },
  24858. "floorplan-dollhouse": {
  24859. rotationDelay: 0,
  24860. rotationDuration: 1
  24861. },
  24862. "floorplan-panorama": {
  24863. rotationDelay: .5,
  24864. rotationDuration: 1
  24865. },
  24866. "dollhouse-panorama": {
  24867. rotationDelay: .5,
  24868. rotationDuration: 1
  24869. },
  24870. "dollhouse-floorplan": {
  24871. rotationDelay: 0,
  24872. rotationDuration: 1,
  24873. cameraMatrixDuration: 1.05,
  24874. cameraMatrixDelay: .5
  24875. },
  24876. "panorama-dollhouse": {
  24877. rotationDelay: 0,
  24878. rotationDuration: .5
  24879. },
  24880. "panorama-floorplan": {
  24881. transitionTime: 1500,
  24882. rotationDelay: 0,
  24883. rotationDuration: .5
  24884. }
  24885. })).path.meshFree && (p.path.typ = l.WALK),
  24886. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  24887. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  24888. window._settings = t.exports = p
  24889. }
  24890. , {
  24891. "./constants": 8,
  24892. "./enum/Colors": 19,
  24893. "./enum/VROption": 47,
  24894. "./enum/Viewmode": 51,
  24895. "./enum/WarpStyle": 52,
  24896. "./util/browser": 182,
  24897. "./util/common": 185,
  24898. "./util/easing": 186,
  24899. "./util/showcase": 193,
  24900. three: 217
  24901. }],
  24902. 167: [function(e, t, i) {
  24903. "use strict";
  24904. var n = e("three")
  24905. , r = e("./settings")
  24906. , 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"
  24907. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  24908. t.exports = {
  24909. basicTextured: {
  24910. uniforms: {
  24911. tDiffuse: {
  24912. type: "t",
  24913. value: null
  24914. },
  24915. alpha: {
  24916. type: "f",
  24917. value: 1
  24918. }
  24919. },
  24920. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24921. 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}"
  24922. },
  24923. copyCubeMap: {
  24924. uniforms: {
  24925. tDiffuse: {
  24926. type: "t",
  24927. value: null
  24928. },
  24929. alpha: {
  24930. type: "f",
  24931. value: 1
  24932. }
  24933. },
  24934. 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}",
  24935. 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}"
  24936. },
  24937. cube: {
  24938. uniforms: {
  24939. map: {
  24940. type: "t",
  24941. value: null
  24942. },
  24943. opacity: {
  24944. type: "f",
  24945. value: 1
  24946. }
  24947. },
  24948. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  24949. 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"
  24950. },
  24951. model: {
  24952. uniforms: {
  24953. map: {
  24954. type: "t",
  24955. value: null
  24956. },
  24957. modelAlpha: {
  24958. type: "f",
  24959. value: r.modelAlpha
  24960. },
  24961. opacity: {
  24962. type: "f",
  24963. value: 1
  24964. },
  24965. progress: {
  24966. type: "f",
  24967. value: 0
  24968. },
  24969. blackout: {
  24970. type: "i",
  24971. value: 0
  24972. },
  24973. pano0Map: {
  24974. type: "t",
  24975. value: null
  24976. },
  24977. pano0Position: {
  24978. type: "v3",
  24979. value: new n.Vector3
  24980. },
  24981. pano0Matrix: {
  24982. type: "m4",
  24983. value: new n.Matrix4
  24984. },
  24985. pano1Map: {
  24986. type: "t",
  24987. value: null
  24988. },
  24989. pano1Position: {
  24990. type: "v3",
  24991. value: new n.Vector3
  24992. },
  24993. pano1Matrix: {
  24994. type: "m4",
  24995. value: new n.Matrix4
  24996. }
  24997. },
  24998. 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",
  24999. 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"
  25000. },
  25001. hot: {
  25002. uniforms: {
  25003. color: {
  25004. type: "c",
  25005. value: new n.Color(16720384)
  25006. },
  25007. opac: {
  25008. type: "f",
  25009. value: 0
  25010. },
  25011. texture1: {
  25012. type: "t",
  25013. value: null
  25014. },
  25015. texture2: {
  25016. type: "t",
  25017. value: null
  25018. }
  25019. },
  25020. vertexShader: "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25021. 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"
  25022. },
  25023. modelOutside: {
  25024. uniforms: {
  25025. map: {
  25026. type: "t",
  25027. value: null
  25028. },
  25029. opacity: {
  25030. type: "f",
  25031. value: 1
  25032. }
  25033. },
  25034. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25035. 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"
  25036. },
  25037. ribbon: {
  25038. uniforms: {
  25039. map: {
  25040. type: "t",
  25041. value: null
  25042. },
  25043. opacity: {
  25044. type: "f",
  25045. value: 1
  25046. },
  25047. color: {
  25048. type: "c",
  25049. value: new n.Color(r.path.color)
  25050. }
  25051. },
  25052. 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",
  25053. 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"
  25054. },
  25055. waypoint: {
  25056. uniforms: {
  25057. map: {
  25058. type: "t",
  25059. value: null
  25060. },
  25061. opacity: {
  25062. type: "f",
  25063. value: 1
  25064. },
  25065. pulse: {
  25066. type: "f",
  25067. value: 1
  25068. },
  25069. nearFade: {
  25070. type: "v2",
  25071. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  25072. },
  25073. color: {
  25074. type: "c",
  25075. value: new n.Color(r.reticuleColor)
  25076. }
  25077. },
  25078. 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",
  25079. 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"
  25080. },
  25081. modelDebug: {
  25082. uniforms: {
  25083. map: {
  25084. type: "t",
  25085. value: null
  25086. },
  25087. modelAlpha: {
  25088. type: "f",
  25089. value: r.modelAlpha
  25090. },
  25091. depthmapRatio: {
  25092. type: "f",
  25093. value: 0
  25094. },
  25095. opacity: {
  25096. type: "f",
  25097. value: 1
  25098. },
  25099. progress: {
  25100. type: "f",
  25101. value: 0
  25102. },
  25103. considerOcclusion: {
  25104. type: "i",
  25105. value: r.fancierTransition
  25106. },
  25107. highlightPanoSelection: {
  25108. type: "i",
  25109. value: 0
  25110. },
  25111. useThirdPano: {
  25112. type: "i",
  25113. value: r.useThirdPano
  25114. },
  25115. pano0Map: {
  25116. type: "t",
  25117. value: null
  25118. },
  25119. pano0Depth: {
  25120. type: "t",
  25121. value: null
  25122. },
  25123. pano0Position: {
  25124. type: "v3",
  25125. value: new n.Vector3
  25126. },
  25127. pano0Matrix: {
  25128. type: "m4",
  25129. value: new n.Matrix4
  25130. },
  25131. pano0Weight: {
  25132. type: "f",
  25133. value: r.transition.pano0Weight
  25134. },
  25135. pano1Map: {
  25136. type: "t",
  25137. value: null
  25138. },
  25139. pano1Depth: {
  25140. type: "t",
  25141. value: null
  25142. },
  25143. pano1Position: {
  25144. type: "v3",
  25145. value: new n.Vector3
  25146. },
  25147. pano1Matrix: {
  25148. type: "m4",
  25149. value: new n.Matrix4
  25150. },
  25151. pano1Weight: {
  25152. type: "f",
  25153. value: r.transition.pano1Weight
  25154. },
  25155. pano2Map: {
  25156. type: "t",
  25157. value: null
  25158. },
  25159. pano2Depth: {
  25160. type: "t",
  25161. value: null
  25162. },
  25163. pano2Position: {
  25164. type: "v3",
  25165. value: new n.Vector3
  25166. },
  25167. pano2Matrix: {
  25168. type: "m4",
  25169. value: new n.Matrix4
  25170. },
  25171. pano2Weight: {
  25172. type: "f",
  25173. value: r.transition.pano2Weight
  25174. }
  25175. },
  25176. 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",
  25177. 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"
  25178. },
  25179. customDepth: {
  25180. uniforms: {
  25181. panoPosition: {
  25182. type: "v3",
  25183. value: new n.Vector3
  25184. }
  25185. },
  25186. 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",
  25187. 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"
  25188. },
  25189. skysphere: {
  25190. uniforms: {
  25191. radius: {
  25192. type: "f",
  25193. value: 0
  25194. }
  25195. },
  25196. 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",
  25197. 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"
  25198. },
  25199. tagDisc: {
  25200. uniforms: {
  25201. opacity: {
  25202. type: "f",
  25203. value: 0
  25204. },
  25205. color: {
  25206. type: "c",
  25207. value: new n.Color
  25208. },
  25209. bg: {
  25210. type: "t",
  25211. value: null
  25212. },
  25213. mask: {
  25214. type: "t",
  25215. value: null
  25216. }
  25217. },
  25218. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25219. 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"
  25220. }
  25221. }
  25222. window.shaders = t.exports;
  25223. }
  25224. , {
  25225. "./settings": 166,
  25226. three: 217
  25227. }],
  25228. 168: [function(E, _, e) {
  25229. (function(e) {
  25230. "use strict";
  25231. var t = E("three")
  25232. , i = (E("url"),
  25233. E("./util/ajax"))
  25234. , n = E("./settings")
  25235. , r = E("./util/logger")
  25236. , o = E("./util/math")
  25237. , a = E("./util/showcase")
  25238. , s = E("./objects/Panorama")
  25239. , l = new r(e)
  25240. , c = E("./model/Model")
  25241. , h = E("./shaders")
  25242. , u = E("./util/transitions")
  25243. , d = E("./objects/Chunk")
  25244. , p = E("./objects/Reticule")
  25245. , f = E("./objects/Skybox")
  25246. , g = E("./objects/Floor")
  25247. , m = E("./cameras/DollhouseCamera")
  25248. , v = E("./cameras/FloorplanCamera")
  25249. , y = E("./cameras/PanoramaCamera")
  25250. , A = E("./controls/DollhouseControls")
  25251. , C = E("./controls/FloorplanControls")
  25252. , I = E("./controls/PanoramaControls");
  25253. t.ImageUtils.crossOrigin = n.crossOrigin,
  25254. _.exports = {
  25255. shaders: h,
  25256. transitions: u,
  25257. Model: c,
  25258. Chunk: d,
  25259. Floor: g,
  25260. Skybox: f,
  25261. Reticule: p,
  25262. Panorama: s,
  25263. DollhouseCamera: m,
  25264. FloorplanCamera: v,
  25265. PanoramaCamera: y,
  25266. DollhouseControls: A,
  25267. FloorplanControls: C,
  25268. PanoramaControls: I,
  25269. getModel: function(e) {
  25270. if (!e.url)
  25271. throw 'getModel(): missing parameter "url"';
  25272. e.autoload = void 0 === e.autoload || e.autoload;
  25273. var t = a.parseSidUrl(e.url);
  25274. e.urlBase = t.urlBase,
  25275. e.urlModel = t.urlModel,
  25276. e.urlFiles = t.urlFiles;
  25277. var i = this._getPlatformError();
  25278. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  25279. this._loadModel().then(this._buildModel.bind(this)))
  25280. },
  25281. _getPlatformError: function() {
  25282. 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"
  25283. },
  25284. _loadModel: function() {
  25285. return i.get(this.options.urlModel, {
  25286. responseType: "json",
  25287. prefetchFrom: "model",
  25288. auth: a.getAuthorizationHeader()
  25289. }).then(null, function() {
  25290. return l.warn("Model loading failed at initial metadata load"),
  25291. "loading-failed"
  25292. })
  25293. },
  25294. _buildModel: function(e) {
  25295. e = a.normalizeModeldata(e, o);
  25296. var t = new c(this.options,e);
  25297. return this.options.autoload ? t.load(!0) : $.when(t)
  25298. }
  25299. }
  25300. }
  25301. ).call(this, "/js/showcase.js")
  25302. }
  25303. , {
  25304. "./cameras/DollhouseCamera": 5,
  25305. "./cameras/FloorplanCamera": 6,
  25306. "./cameras/PanoramaCamera": 7,
  25307. "./controls/DollhouseControls": 10,
  25308. "./controls/FloorplanControls": 11,
  25309. "./controls/PanoramaControls": 13,
  25310. "./model/Model": 139,
  25311. "./objects/Chunk": 144,
  25312. "./objects/Floor": 146,
  25313. "./objects/Panorama": 148,
  25314. "./objects/Reticule": 149,
  25315. "./objects/Skybox": 152,
  25316. "./settings": 166,
  25317. "./shaders": 167,
  25318. "./util/ajax": 181,
  25319. "./util/logger": 189,
  25320. "./util/math": 190,
  25321. "./util/showcase": 193,
  25322. "./util/transitions": 195,
  25323. three: 217,
  25324. url: 208
  25325. }],
  25326. 169: [function(e, t, i) {
  25327. "use strict";
  25328. function l(e) {
  25329. var t = {
  25330. renderTarget: null,
  25331. inUse: !1,
  25332. size: -1,
  25333. pano: null
  25334. };
  25335. return t.inUse = !0,
  25336. t.size = e,
  25337. function(e) {
  25338. O.push(e)
  25339. }(t),
  25340. t
  25341. }
  25342. function c(e) {
  25343. for (var t = 0; t < O.length; t++) {
  25344. var i = O[t];
  25345. if (i.renderTarget === e)
  25346. return !(i.inUse = !1)
  25347. }
  25348. return !1
  25349. }
  25350. function n() {
  25351. this.tileDirectory = {},
  25352. this.activeRenderTargetDescriptors = {},
  25353. this.activePanos = [],
  25354. this.panoLODDescriptors = {},
  25355. this.panoDescriptors = {},
  25356. this.tileTrees = {},
  25357. this.sceneRenderer = null,
  25358. this.tileDownloader = null,
  25359. this.forceQueue = [],
  25360. this.uploadQueues = {},
  25361. this.uploadInterval = null,
  25362. this.uploadIntervalCancelled = !1,
  25363. this.usingTileOverlay = !1,
  25364. this.overlayTilesLoaded = !1,
  25365. this.overlayTileBase = null,
  25366. this.overlayTilesBasic = {},
  25367. this.overlayTilesEnhanced = {},
  25368. this.zoomRenderTarget = null,
  25369. this.zoomPano = null,
  25370. this.zoomingActive = !1,
  25371. this.zoomPanoId = null,
  25372. this.zoomPanoRenderingDisabled = !1,
  25373. this.direction = new _.Vector3,
  25374. this.initTime = -1,
  25375. this.maxBaseUploadsPerFrame = R,
  25376. this.maxNonBaseUploadsPerFrame = M
  25377. }
  25378. 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"),
  25379. e("../enum/PanoRendererEvents")), f = e("../enum/SceneRendererEvents"), g = e("../enum/TileDownloaderEvents"), m = e("../enum/Vectors"), v = (e("../enum/GLCubeFaces"),
  25380. e("../objects/Panorama"),
  25381. e("./TileTree")), y = (e("./TileDownloader"),
  25382. e("./TilePrioritizer")), A = e("./TileUtils"), C = (p = e("../enum/PanoSizeClass"),
  25383. e("../util/browser"),
  25384. 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 = {
  25385. Base: 0,
  25386. Remaining: 1
  25387. }, O = [];
  25388. function L(e) {
  25389. var t = e.shift();
  25390. return t.uploadQueued = !1,
  25391. t
  25392. }
  25393. (n.prototype = Object.create(w.prototype)).init = function(e, t, i) {
  25394. this.sceneRenderer = e,
  25395. this.tileDownloader = t,
  25396. this.qualityManager = i,
  25397. this.bindEvents(),
  25398. this.sceneRenderer.on(f.ContextCreated, this.loadOverlayTiles.bind(this)),
  25399. this.initTime = performance.now()
  25400. }
  25401. ,
  25402. n.prototype.getActivePanoTextures = function(e) {
  25403. e = e || [];
  25404. for (var t = 0; t < O.length; t++) {
  25405. var i = O[t];
  25406. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  25407. }
  25408. }
  25409. ,
  25410. n.prototype.hasQueuedTiles = function() {
  25411. var e = this.peekNextFromUploadQueue();
  25412. return null != e
  25413. }
  25414. ,
  25415. n.prototype.getActiveRenderTargetDescriptor = function(e) {
  25416. return this.activeRenderTargetDescriptors[e]
  25417. }
  25418. ,
  25419. n.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  25420. this.activeRenderTargetDescriptors[e] = t
  25421. }
  25422. ,
  25423. n.prototype.loadOverlayTiles = function() {
  25424. if (0 !== d.tiling.overlayStyle) {
  25425. var n = 0
  25426. , e = function(e, t, i) {
  25427. e = t ? e[t] = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping),
  25428. this.sceneRenderer.uploadTexture2D(i, e, 0, 0, A.TILE_SIZE, A.TILE_SIZE),
  25429. ++n === r.length && (this.overlayTilesLoaded = !0)
  25430. }
  25431. .bind(this)
  25432. , 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)]];
  25433. r.forEach(function(e) {
  25434. this.tileDownloader.loadImage(e[0], 0, e[1])
  25435. }
  25436. .bind(this)),
  25437. this.usingTileOverlay = !0
  25438. } else
  25439. this.usingTileOverlay = !1
  25440. }
  25441. ,
  25442. n.prototype.bindEvents = function() {
  25443. this.tileDownloader.on(g.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  25444. }
  25445. ,
  25446. n.prototype.setupZoomRenderTarget = function() {
  25447. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  25448. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  25449. return;
  25450. var e = this.zoomRenderTarget;
  25451. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  25452. e) {
  25453. var t = e.width
  25454. , i = this.zoomRenderTarget.width;
  25455. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  25456. e.texture.dispose(),
  25457. e.texture.loaded = !1,
  25458. e.texture.version = 0,
  25459. this.sceneRenderer.deallocateCubeTexture(e.texture),
  25460. e.texture = null
  25461. }
  25462. this.zoomPanoRenderingDisabled = !1
  25463. } else
  25464. this.zoomPanoRenderingDisabled = !0
  25465. }
  25466. ,
  25467. n.prototype.enableUltraHighQualityMode = function(t) {
  25468. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  25469. var e = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  25470. this.tileDownloader.testDownload(e, A.TILE_SIZE, function(e) {
  25471. e && (this.qualityManager.enableUltraHighQualityMode(),
  25472. this.setupZoomRenderTarget(),
  25473. t())
  25474. }
  25475. .bind(this))
  25476. }
  25477. }
  25478. ,
  25479. n.prototype.activateTiledPano = function(e, t, i) {
  25480. i && this.clearAllQueuedUploads();
  25481. for (var n = 0; n < A.FACES_PER_PANO; n++)
  25482. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  25483. this.linkAllTilesAndNodes(e);
  25484. var r = this.getActiveRenderTargetDescriptor(e.id)
  25485. , o = t;
  25486. if (o > this.qualityManager.getMaxNavPanoSize() && (o = this.qualityManager.getMaxNavPanoSize()),
  25487. !r || o !== r.size) {
  25488. if (r && c(r.renderTarget),
  25489. !(r = function(e) {
  25490. for (var t = 0; t < O.length; t++) {
  25491. var i = O[t];
  25492. if (!i.inUse && i.size === e)
  25493. return i.inUse = !0,
  25494. i
  25495. }
  25496. return null
  25497. }(o))) {
  25498. var a = this.initTiledPano(o, !1);
  25499. (r = l(a.width)).renderTarget = a
  25500. }
  25501. r.pano = e,
  25502. this.resetPanoDescriptor(e.id),
  25503. this.resetPanoLODDescriptors(e.id),
  25504. this.resetRenderStatus(e.id, !0, !0)
  25505. }
  25506. this.setActiveRenderTargetDescriptor(e.id, r);
  25507. var s = i ? 0 : 1;
  25508. return this.updateActivePanos(e, s),
  25509. r.renderTarget
  25510. }
  25511. ,
  25512. n.prototype.deactivateTiledPano = function(e) {
  25513. var t = this.getActiveRenderTargetDescriptor(e.id);
  25514. this.isRenderTargetDescriptorValid(t) && c(t.renderTarget),
  25515. this.setActiveRenderTargetDescriptor(e.id, null);
  25516. var i = this.getUploadQueueForPano(e.id);
  25517. this.clearUploadQueue(i),
  25518. this.updateActivePanos()
  25519. }
  25520. ,
  25521. n.prototype.updateActivePanos = (s = [],
  25522. function(e, t) {
  25523. for (var i = s.length = 0; i < this.activePanos.length; i++) {
  25524. e && s.length === t && s.push(e);
  25525. var n = this.activePanos[i]
  25526. , r = this.getActiveRenderTargetDescriptor(n.id);
  25527. e && n.id === e.id || !this.isRenderTargetDescriptorValid(r) || s.push(n)
  25528. }
  25529. e && t >= s.length && s.push(e),
  25530. this.activePanos.length = 0,
  25531. this.activePanos.push.apply(this.activePanos, s)
  25532. }
  25533. ),
  25534. n.prototype.getActivePanoCount = function() {
  25535. return this.activePanos.length
  25536. }
  25537. ,
  25538. n.prototype.resetRenderStatus = function(e, r, o, t) {
  25539. var i = null;
  25540. t && (i = v.getLevelCountForSize(A.TILE_SIZE, t) + 1);
  25541. for (var n = function(e, t, i, n) {
  25542. o && (t.tile.zoomUploaded = !1),
  25543. r && (t.tile.uploaded = !1)
  25544. }, a = 0; a < A.FACES_PER_PANO; a++) {
  25545. this.getTileTree(e, a).breadthFirst({
  25546. callback: n.bind(this, a),
  25547. minLevel: i
  25548. })
  25549. }
  25550. }
  25551. ,
  25552. n.prototype.copyBaseRenderStatusToZoomed = function(e) {
  25553. for (var t = v.getLevelCountForSize(A.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  25554. t.tile.zoomUploaded = t.tile.uploaded,
  25555. t.zoomCovered = t.covered
  25556. }, n = 0; n < A.FACES_PER_PANO; n++) {
  25557. this.getTileTree(e, n).breadthFirst({
  25558. callback: i.bind(this, n),
  25559. maxLevel: t
  25560. })
  25561. }
  25562. }
  25563. ,
  25564. n.prototype.renderPanoTiles = (h = [],
  25565. function(e, t, i, n) {
  25566. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  25567. t = t || this.direction || m.FORWARD;
  25568. var r = this.getActiveRenderTargetDescriptor(e);
  25569. if (!this.isRenderTargetDescriptorValid(r))
  25570. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  25571. for (var o = 0; o < A.FACES_PER_PANO; o++) {
  25572. var a = this.getTileTree(e, o);
  25573. h.length = 0,
  25574. a.breadthFirst({
  25575. saveVisited: h
  25576. });
  25577. for (var s = 0; s < h.length; s++) {
  25578. var l = h[s];
  25579. this.queueTileUpload(l.tile, !1, n || 0 === s && i)
  25580. }
  25581. }
  25582. this.updateDirection(t)
  25583. }
  25584. ),
  25585. n.prototype.isRenderTargetDescriptorValid = function(e) {
  25586. return e && e.renderTarget
  25587. }
  25588. ,
  25589. n.prototype.isPanoActive = function(e) {
  25590. var t = this.getActiveRenderTargetDescriptor(e);
  25591. return this.isRenderTargetDescriptorValid(t)
  25592. }
  25593. ,
  25594. n.prototype.isPanoZoomed = function(e) {
  25595. return this.zoomingActive && this.zoomPanoId === e
  25596. }
  25597. ,
  25598. n.prototype.initTileTree = function(e, t, i) {
  25599. var n = this.tileTrees[e];
  25600. n || (n = [],
  25601. this.tileTrees[e] = n);
  25602. var r = n[t];
  25603. if (!r) {
  25604. var o = v.getLevelCountForSize(A.TILE_SIZE, i);
  25605. r = new v(A.TILE_SIZE,o),
  25606. n[t] = r
  25607. }
  25608. }
  25609. ,
  25610. n.prototype.getTileTree = function(e, t) {
  25611. var i = this.tileTrees[e];
  25612. if (!i)
  25613. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  25614. var n = i[t];
  25615. if (!n)
  25616. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  25617. return n
  25618. }
  25619. ,
  25620. n.prototype.initTiledPano = function(e, t) {
  25621. var i = this.sceneRenderer.renderer
  25622. , n = (i.context,
  25623. new _.WebGLRenderTargetCube(e,e,{
  25624. stencilBuffer: !1
  25625. }))
  25626. , r = new _.CubeTexture([]);
  25627. (n.texture = r).image = [null, null, null, null, null, null],
  25628. r.flipY = !0,
  25629. t ? (r.generateMipmaps = !0,
  25630. r.magFilter = _.LinearFilter,
  25631. r.minFilter = _.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  25632. r.magFilter = _.LinearFilter,
  25633. r.minFilter = _.LinearFilter),
  25634. r.format = _.RGBAFormat,
  25635. i.setRenderTarget(n),
  25636. i.setRenderTarget(null);
  25637. var o = i.properties.get(r);
  25638. return o.__image__webglTextureCube = o.__webglTexture,
  25639. n
  25640. }
  25641. ,
  25642. n.prototype.getUploadQueueForPano = function(e) {
  25643. var t = this.uploadQueues[e];
  25644. return t || (t = [],
  25645. this.uploadQueues[e] = t),
  25646. t
  25647. }
  25648. ,
  25649. n.prototype.isTileUploaded = function(e) {
  25650. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  25651. }
  25652. ,
  25653. n.prototype.setUploaded = function(e, t) {
  25654. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  25655. }
  25656. ,
  25657. n.prototype.queueTileUpload = function(e, t, i) {
  25658. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  25659. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  25660. var r = this.getUploadQueueForPano(e.panoId);
  25661. 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),
  25662. e.uploadQueued = !0,
  25663. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  25664. }
  25665. }
  25666. ,
  25667. n.prototype.shoulPushToFrontOfQueue = function(e) {
  25668. return 0 === v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25669. }
  25670. ,
  25671. n.prototype.getTopUploadQueue = function() {
  25672. for (var e = null, t = null, i = P.Base; i <= P.Remaining; i++)
  25673. for (var n = 0; n < this.activePanos.length; n++)
  25674. if (e = this.activePanos[n],
  25675. 0 < (t = this.getUploadQueueForPano(e.id)).length)
  25676. switch (i) {
  25677. case P.Base:
  25678. if (0 === t[0].level)
  25679. return t;
  25680. break;
  25681. case P.Remaining:
  25682. return t
  25683. }
  25684. return null
  25685. }
  25686. ,
  25687. n.prototype.getNextFromUploadQueue = function() {
  25688. if (0 < this.forceQueue.length)
  25689. return L(this.forceQueue);
  25690. var e = this.getTopUploadQueue();
  25691. return e && 0 < e.length ? L(e) : null
  25692. }
  25693. ,
  25694. n.prototype.peekNextFromUploadQueue = function() {
  25695. if (0 < this.forceQueue.length)
  25696. return this.forceQueue[0];
  25697. var e = this.getTopUploadQueue();
  25698. return e && 0 < e.length ? e[0] : null
  25699. }
  25700. ,
  25701. n.prototype.clearAllQueuedUploads = function() {
  25702. this.clearAllUploadQueues(null, 0)
  25703. }
  25704. ,
  25705. n.prototype.clearAllQueuedUploadsForPano = function(e) {
  25706. this.clearAllUploadQueues(e, 0)
  25707. }
  25708. ,
  25709. n.prototype.clearAllUploadQueues = function(e, t) {
  25710. if (e)
  25711. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  25712. this.clearUploadQueue(this.forceQueue, t, e);
  25713. else {
  25714. for (var i = 0; i < this.activePanos.length; i++) {
  25715. var n = this.activePanos[i];
  25716. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  25717. }
  25718. this.clearUploadQueue(this.forceQueue, t)
  25719. }
  25720. }
  25721. ,
  25722. n.prototype.clearUploadQueue = function(e, t, i) {
  25723. null != t || (t = 0);
  25724. for (var n = 0; n < e.length; ) {
  25725. var r = e[n];
  25726. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  25727. e.splice(n, 1)) : n++
  25728. }
  25729. }
  25730. ,
  25731. n.prototype.refreshUploadInterval = (a = null,
  25732. function(e) {
  25733. this.uploadIntervalCancelled || (a = a || function() {
  25734. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (T = !0,
  25735. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25736. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(x) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  25737. }
  25738. .bind(this),
  25739. null != e || (e = x),
  25740. T || (e = S),
  25741. this.uploadInterval = window.setTimeout(a, e),
  25742. this.uploadIntervalDelay = e)
  25743. }
  25744. ),
  25745. n.prototype.update = (r = performance.now(),
  25746. o = 0,
  25747. function() {
  25748. this.uploadIntervalCancelled = !0,
  25749. window.clearTimeout(this.uploadInterval),
  25750. this.uploadInterval = null;
  25751. var e = performance.now() - r;
  25752. !(x < e || 0 === o) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25753. r = performance.now()),
  25754. o++
  25755. }
  25756. ),
  25757. n.prototype.updateUploadQueue = function(e, t) {
  25758. e = e || 1;
  25759. for (var i = 0, n = 0; !(t <= n || e <= i); ) {
  25760. var r = this.getNextFromUploadQueue();
  25761. if (!r)
  25762. break;
  25763. if (0 !== r.level ? i++ : n++,
  25764. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  25765. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  25766. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  25767. }
  25768. }
  25769. }
  25770. ,
  25771. n.prototype.updateDirection = function(e) {
  25772. if (e = e || this.direction) {
  25773. this.direction = e;
  25774. for (var t = 0; t < this.activePanos.length; t++) {
  25775. var i = this.activePanos[t]
  25776. , n = this.getUploadQueueForPano(i.id);
  25777. y.sortPanoTiles(n, i, this.direction)
  25778. }
  25779. }
  25780. }
  25781. ,
  25782. n.prototype.uploadTile = (I = {},
  25783. new _.Vector4,
  25784. E = d.tiling.overlayStyle,
  25785. function(e, t) {
  25786. var i = e.panoId
  25787. , n = e.image
  25788. , r = e.tileSize
  25789. , o = e.panoSize
  25790. , a = e.tileIndex
  25791. , s = (e.faceTileIndex,
  25792. e.totalTiles)
  25793. , l = (e.face,
  25794. e.tileX)
  25795. , c = e.tileY
  25796. , h = !0
  25797. , u = !1
  25798. , d = (this.getPanoDescriptor(i),
  25799. this.getPanoLODDescriptor(i, o))
  25800. , p = this.getActiveRenderTargetDescriptor(i)
  25801. , f = p.renderTarget
  25802. , g = p.size;
  25803. if (this.isPanoZoomed(i) && (f = this.zoomRenderTarget,
  25804. g = this.qualityManager.getMaxZoomPanoSize()),
  25805. this.isRenderTargetDescriptorValid(p) || (u = h = !1),
  25806. t || (this.anyUploaded(e.node) && (u = !(h = !1)),
  25807. this.isTileUploaded(e) && (u = h = !1)),
  25808. h) {
  25809. var m = r / o * g
  25810. , v = l * r / o * g
  25811. , y = c * r / o * g;
  25812. I[r] || (I[r] = this.sceneRenderer.initSizedTexture2D(r, _.ClampToEdgeWrapping));
  25813. var A = I[r];
  25814. if (this.sceneRenderer.uploadTexture2D(n, A, 0, 0, r, r),
  25815. 1 === E || 2 === E) {
  25816. var C = 1 === E ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  25817. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace),
  25818. this.sceneRenderer.renderToCubeMap(C[o], f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace, _.NormalBlending, !0, .5)
  25819. } else
  25820. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace);
  25821. d.uploadCount++,
  25822. this.emit(b.TileRenderSuccess, i, o, a, s),
  25823. d.uploadCount === s && this.emit(b.PanoRenderComplete, i, o, s),
  25824. this.setUploaded(e, !0),
  25825. this.addCoverageForNode(e.node)
  25826. } else
  25827. this.setUploaded(e, !1);
  25828. return e.uploadAttempted || (d.uploadAttempts++,
  25829. this.emit(b.TileUploadAttempted, i, o, a, s)),
  25830. e.uploadAttempted = !0,
  25831. d.uploadAttempts === s && this.emit(b.UploadAttemptedForAllTiles, i, o, s),
  25832. u
  25833. }
  25834. ),
  25835. n.prototype.linkTileAndNode = function(e, t) {
  25836. (t.tile = e).node = t
  25837. }
  25838. ,
  25839. n.prototype.linkAllTilesAndNodes = function(a) {
  25840. for (var e = function(e, t, i, n, r) {
  25841. var o = this.getTileDirectoryEntry(a.id, t, n, r);
  25842. this.linkTileAndNode(o, i)
  25843. }, t = 0; t < A.FACES_PER_PANO; t++) {
  25844. var i = this.getTileTree(a.id, t);
  25845. i.breadthFirst({
  25846. callback: e.bind(this, i, t)
  25847. })
  25848. }
  25849. }
  25850. ,
  25851. n.prototype.anyUploaded = function(e) {
  25852. if (!e)
  25853. return !1;
  25854. if (e.tile && this.isTileUploaded(e.tile))
  25855. return !0;
  25856. if (e.children)
  25857. for (var t = 0; t < e.children.length; t++) {
  25858. var i = e.children[t];
  25859. if (this.anyUploaded(i))
  25860. return !0
  25861. }
  25862. return !1
  25863. }
  25864. ,
  25865. n.prototype.setNodeCovered = function(e, t) {
  25866. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  25867. }
  25868. ,
  25869. n.prototype.isNodeCovered = function(e) {
  25870. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  25871. }
  25872. ,
  25873. n.prototype.addCoverageForNode = function(e) {
  25874. if (this.setNodeCovered(e, !0),
  25875. e.parent && e.covered) {
  25876. var t = e.parent;
  25877. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  25878. }
  25879. }
  25880. ,
  25881. n.prototype.calcFullCoverage = function(e) {
  25882. var t = !1;
  25883. if (e.children)
  25884. for (var i = 0; i < e.children.length; i++) {
  25885. var n = e.children[i];
  25886. t = t || this.calcFullCoverage(n)
  25887. }
  25888. e.covered = e.tile.uploaded || t
  25889. }
  25890. ,
  25891. n.prototype.nodeSubcovered = function(e) {
  25892. if (!e.children)
  25893. return !1;
  25894. for (var t = 0; t < e.children.length; t++)
  25895. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  25896. return !1;
  25897. return !0
  25898. }
  25899. ,
  25900. n.prototype.resetPanoDescriptor = function(e) {
  25901. this.getPanoDescriptor(e)
  25902. }
  25903. ,
  25904. n.prototype.getPanoDescriptor = function(e) {
  25905. var t = this.panoDescriptors[e];
  25906. return t || (t = {},
  25907. this.panoDescriptors[e] = t),
  25908. t
  25909. }
  25910. ,
  25911. n.prototype.resetPanoLODDescriptors = function(e) {
  25912. var t = this.getPanoLODDescriptors(e);
  25913. for (var i in t)
  25914. if (t.hasOwnProperty(i)) {
  25915. var n = t[i];
  25916. n.uploadCount = 0,
  25917. n.uploadAttempts = 0
  25918. }
  25919. }
  25920. ,
  25921. n.prototype.getPanoLODDescriptor = function(e, t) {
  25922. var i = this.getPanoLODDescriptors(e)
  25923. , n = i[t];
  25924. return n || (n = {
  25925. uploadCount: 0,
  25926. uploadAttempts: 0
  25927. },
  25928. i[t] = n),
  25929. n
  25930. }
  25931. ,
  25932. n.prototype.getPanoLODDescriptors = function(e) {
  25933. var t = this.panoLODDescriptors[e];
  25934. return t || (t = {},
  25935. this.panoLODDescriptors[e] = t),
  25936. t
  25937. }
  25938. ,
  25939. n.prototype.onTileDownloaded = function(e) {
  25940. var t = v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25941. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  25942. if (i.downloaded = !0,
  25943. i.image = e.image,
  25944. i.panoSize = e.panoSize,
  25945. i.tileX = e.tileX,
  25946. i.tileY = e.tileY,
  25947. i.totalTiles = e.totalTiles,
  25948. i.tileIndex = e.tileIndex,
  25949. i.faceTileIndex = e.faceTileIndex,
  25950. i.face = e.face,
  25951. i.cubeFace = C.mapFaceToCubemapFace(e.face),
  25952. i.panoId = e.panoId,
  25953. i.tileSize = e.tileSize,
  25954. i.direction = (new _.Vector3).copy(e.direction),
  25955. i.node = null,
  25956. i.level = v.getLevelCountForSize(A.TILE_SIZE, i.panoSize),
  25957. this.isPanoActive(i.panoId)) {
  25958. var n = this.getTileTree(i.panoId, i.face).getSubNode(i.panoSize, i.tileX, i.tileY);
  25959. this.linkTileAndNode(i, n),
  25960. this.queueTileUpload(i, !0)
  25961. }
  25962. }
  25963. ,
  25964. n.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  25965. var r = this.tileDirectory[e];
  25966. r || (r = {},
  25967. this.tileDirectory[e] = r);
  25968. var o = 16384 * t + 1024 * i + n
  25969. , a = r[o];
  25970. return a || (a = {
  25971. downloaded: !1,
  25972. uploaded: !1,
  25973. zoomUploaded: !1
  25974. },
  25975. r[o] = a),
  25976. a._key = e + ":" + t + ":" + i + ":" + n,
  25977. a._tileKey = o,
  25978. a
  25979. }
  25980. ,
  25981. n.prototype.setZoomingActive = function(e, t, i) {
  25982. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  25983. this.zoomPanoId = t.id,
  25984. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  25985. }
  25986. ,
  25987. n.prototype.updateZoomedPanoFromBase = function(e) {
  25988. if (!this.zoomPanoRenderingDisabled) {
  25989. var t = this.getActiveRenderTargetDescriptor(e.id);
  25990. if (t && t.renderTarget) {
  25991. var i = this.qualityManager.getMaxZoomPanoSize()
  25992. , n = t.renderTarget
  25993. , r = t.size;
  25994. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  25995. this.copyBaseRenderStatusToZoomed(e.id)
  25996. }
  25997. }
  25998. }
  25999. ,
  26000. t.exports = n
  26001. }
  26002. , {
  26003. "../enum/GLCubeFaces": 25,
  26004. "../enum/PanoRendererEvents": 35,
  26005. "../enum/PanoSizeClass": 36,
  26006. "../enum/SceneRendererEvents": 43,
  26007. "../enum/TileDownloaderEvents": 45,
  26008. "../enum/Vectors": 50,
  26009. "../exception/BasicException": 55,
  26010. "../objects/Panorama": 148,
  26011. "../settings": 166,
  26012. "../util/browser": 182,
  26013. "../util/panorama": 191,
  26014. "./TileDownloader": 171,
  26015. "./TilePrioritizer": 172,
  26016. "./TileTree": 173,
  26017. "./TileUtils": 174,
  26018. events: 202,
  26019. three: 217
  26020. }],
  26021. 170: [function(e, t, i) {
  26022. "use strict";
  26023. function n(e, t, i) {
  26024. this.maxNavPanoSize = -1,
  26025. this.maxZoomPanoSize = -1,
  26026. this.devicePixelDensity = e,
  26027. this.deviceScreenSize = t,
  26028. this.clientBandwidth = i,
  26029. this.panoSizeClassMap = {},
  26030. this.useHighResolutionPanos = !0,
  26031. this.useUltraHighResolutionPanos = !1,
  26032. this.modelHasUltraHighPanos = !1
  26033. }
  26034. var r = e("../enum/PanoSizeClass")
  26035. , o = e("../settings")
  26036. , a = e("../util/browser")
  26037. , s = e("../constants")
  26038. , l = e("../util/showcase")
  26039. , c = e("../enum/ModelManagerEvents");
  26040. n.prototype.init = function(e) {
  26041. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  26042. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  26043. this.highSize = this.getPanoSize(r.HIGH),
  26044. this.standardSize = this.getPanoSize(r.STANDARD),
  26045. this.baseSize = this.getPanoSize(r.BASE),
  26046. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  26047. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  26048. this.updateMaximums(),
  26049. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  26050. }
  26051. ,
  26052. n.prototype.updateFromModel = function(e) {
  26053. this.updateHighResolutionSettings(e),
  26054. this.updateUltraHighResolutionSettings(e)
  26055. }
  26056. ,
  26057. n.prototype.updateHighResolutionSettings = function(e) {
  26058. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  26059. this.updateMaximums()
  26060. }
  26061. ,
  26062. n.prototype.updateUltraHighResolutionSettings = function(e) {
  26063. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  26064. this.updateMaximums()
  26065. }
  26066. ,
  26067. n.prototype.enableUltraHighQualityMode = function() {
  26068. this.modelHasUltraHighPanos = !0,
  26069. this.updateUltraHighResolutionSettings(null)
  26070. }
  26071. ,
  26072. n.prototype.ultraHighQualityModeEnabled = function() {
  26073. return this.modelHasUltraHighPanos
  26074. }
  26075. ,
  26076. n.prototype.onModelChanged = function(e) {
  26077. this.updateFromModel(e.model),
  26078. this.updateMaximums()
  26079. }
  26080. ,
  26081. n.prototype.updateMaximums = function() {
  26082. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  26083. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  26084. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  26085. }
  26086. ,
  26087. n.prototype.buildPanoSizeClassMap = function() {
  26088. this.panoSizeClassMap[r.BASE] = 512,
  26089. this.panoSizeClassMap[r.STANDARD] = 1024,
  26090. this.panoSizeClassMap[r.HIGH] = 2048,
  26091. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  26092. }
  26093. ,
  26094. n.prototype.getPanoSize = function(e) {
  26095. return this.panoSizeClassMap[e]
  26096. }
  26097. ,
  26098. n.prototype.getMaxPossiblePanoSize = function() {
  26099. return this.getPanoSize(r.ULTRAHIGH)
  26100. }
  26101. ,
  26102. n.prototype.getMaxPanoSize = function() {
  26103. return this.maxZoomPanoSize
  26104. }
  26105. ,
  26106. n.prototype.getMaxNavPanoSize = function() {
  26107. return this.maxNavPanoSize
  26108. }
  26109. ,
  26110. n.prototype.getMaxZoomPanoSize = function() {
  26111. return this.maxZoomPanoSize
  26112. }
  26113. ,
  26114. n.prototype.detectMaxNavPanoSizeClass = function() {
  26115. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  26116. }
  26117. ,
  26118. n.prototype.detectMaxNavPanoSize = function() {
  26119. var e = this.detectMaxNavPanoSizeClass();
  26120. return this.getPanoSize(e)
  26121. }
  26122. ,
  26123. n.prototype.detectMaxZoomPanoSize = function() {
  26124. 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)
  26125. }
  26126. ,
  26127. t.exports = n
  26128. }
  26129. , {
  26130. "../constants": 8,
  26131. "../enum/ModelManagerEvents": 33,
  26132. "../enum/PanoSizeClass": 36,
  26133. "../settings": 166,
  26134. "../util/browser": 182,
  26135. "../util/showcase": 193
  26136. }],
  26137. 171: [function(A, C, e) {
  26138. (function(e) {
  26139. "use strict";
  26140. function i(e) {
  26141. this.panos = null,
  26142. this.retryMinimumTime = 1e4,
  26143. this.urls = null,
  26144. this.panoLoadCallbacks = {},
  26145. this.downloadDescriptors = {},
  26146. this.priorityQueue = [],
  26147. this.forceQueue = [],
  26148. this.activeDownloads = [],
  26149. this.qualityManager = null,
  26150. this.tilePrioritizer = null,
  26151. this.refreshInterval = null,
  26152. this.processPriorityQueue = !1,
  26153. this.concurrentDownloads = e.concurrentDownloads || 1,
  26154. this.downloadTestResults = {}
  26155. }
  26156. var c, h, n, p, f, t = A("three"), u = (A("../enum/Viewmode"),
  26157. A("../settings")), r = (A("../objects/Panorama"),
  26158. A("../util/logger")), o = (A("../enum/Vectors"),
  26159. A("../enum/PanoSizeClass"),
  26160. A("../enum/TileDownloaderEvents")), g = A("./TilePrioritizer"), m = A("./TileUtils"), v = (A("../enum/GLCubeFaces"),
  26161. A("../enum/DownloadStatus")), a = A("../util/panorama"), s = A("../util/ajax"), d = A("../ab"), l = A("events").EventEmitter, y = (new r(e),
  26162. Object.freeze({
  26163. Testing: 1,
  26164. Success: 2,
  26165. Fail: 3
  26166. }));
  26167. i.prototype = Object.create(l.prototype),
  26168. i.IDLE_REFRESH_DELAY = 500,
  26169. i.ACTIVE_REFRESH_DELAY = 16,
  26170. i.DOWNLOAD_RETRIES = 4,
  26171. i.prototype.init = function(e) {
  26172. this.qualityManager = e
  26173. }
  26174. ,
  26175. i.prototype.setUrls = function(e) {
  26176. this.urls = e
  26177. }
  26178. ,
  26179. i.prototype.setPanoData = function(e, t, i) {
  26180. this.panos = e,
  26181. this.imagePanos = t,
  26182. this.panoGroupId = i
  26183. }
  26184. ,
  26185. i.prototype.start = function() {
  26186. this.refreshUpdateInterval(0)
  26187. }
  26188. ,
  26189. i.prototype.stop = function() {
  26190. window.cancel(this.refreshInterval)
  26191. }
  26192. ,
  26193. i.prototype.refreshUpdateInterval = function(e) {
  26194. e = e || 0,
  26195. this.refreshInterval = window.setTimeout(function() {
  26196. this.update() ? this.refreshUpdateInterval(i.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(i.IDLE_REFRESH_DELAY)
  26197. }
  26198. .bind(this), e)
  26199. }
  26200. ,
  26201. i.prototype.update = function() {
  26202. var e = 0 < this.forceQueue.length;
  26203. return this.processQueueForDownloading(this.forceQueue),
  26204. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  26205. 0 < this.priorityQueue.length && (e = !0),
  26206. this.processQueueForDownloading(this.priorityQueue)),
  26207. e
  26208. }
  26209. ,
  26210. i.prototype.forceQueueTilesForPano = (p = [],
  26211. f = [],
  26212. function(e, t, i, n, r, o) {
  26213. p.length = 0;
  26214. for (var a = this.getTileDownloadDescriptors(e, t), s = 0; s < a.length; s++) {
  26215. var l = a[s];
  26216. l.status !== v.None && l.status !== v.Queued || p.push(l)
  26217. }
  26218. if (i && 0 < p.length) {
  26219. g.sortPanoTiles(p, e, i),
  26220. f.length = 0,
  26221. m.matchingTilesInDirection(e, t, i, n, r, f);
  26222. for (var c = 0, h = function(e) {
  26223. return e.face === u.face && e.faceTileIndex === u.faceTileIndex
  26224. }; c < p.length; ) {
  26225. var u = p[c];
  26226. f.findIndex(h) < 0 ? p.splice(c, 1) : c++
  26227. }
  26228. }
  26229. for (var d = 0; d < p.length; d++)
  26230. this.forceQueue.push(p[d]);
  26231. this.setStatusForAllDescriptors(this.forceQueue, v.ForceQueued),
  26232. this.clearFromQueue(this.priorityQueue, v.ForceQueued, !1),
  26233. o && this.processQueueForDownloading(this.forceQueue, !0)
  26234. }
  26235. ),
  26236. i.prototype.clearForceQueue = function() {
  26237. this.clearQueue(this.forceQueue)
  26238. }
  26239. ,
  26240. i.prototype.queuePrioritizedTilesForPanos = function(e) {
  26241. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  26242. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  26243. this.clearFromQueue(this.priorityQueue, v.None, !0),
  26244. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, v.Queued))
  26245. }
  26246. ,
  26247. i.prototype.clearQueue = function(e) {
  26248. this.setStatusForAllDescriptors(e, v.None),
  26249. e.length = 0
  26250. }
  26251. ,
  26252. i.prototype.clearFromQueue = function(e, t, i) {
  26253. for (var n = 0; n < e.length; n++) {
  26254. var r = e[n];
  26255. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  26256. }
  26257. }
  26258. ,
  26259. i.prototype.setStatusForAllDescriptors = function(e, t) {
  26260. for (var i = 0; i < e.length; i++) {
  26261. var n = e[i];
  26262. n && (n.status = t)
  26263. }
  26264. }
  26265. ,
  26266. i.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  26267. for (var i = 0; i < e.length; i++) {
  26268. var n = e[i];
  26269. n && (n.status !== t ? n.status = t : e[i] = null)
  26270. }
  26271. }
  26272. ,
  26273. i.prototype.getTileDownloadDescriptors = function(e, t) {
  26274. var i = this.getAllTileDownloadDescriptorsForPano(e)
  26275. , n = i[t];
  26276. return n || (n = this.buildDownloadDescriptorArray(t),
  26277. i[t] = n,
  26278. this.initTileDownloadDescriptors(n, e, t)),
  26279. n
  26280. }
  26281. ,
  26282. i.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  26283. var t = this.downloadDescriptors[e.id];
  26284. return t || (t = {},
  26285. this.downloadDescriptors[e.id] = t),
  26286. t
  26287. }
  26288. ,
  26289. i.prototype.processQueueForDownloading = function(e, t) {
  26290. if (this.cleanupActiveDownloads(),
  26291. this.activeDownloads.length < this.concurrentDownloads || t)
  26292. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0; n < i && 0 < e.length; 0) {
  26293. var r = e.shift();
  26294. r && (this.startDownload(r),
  26295. n++)
  26296. }
  26297. }
  26298. ,
  26299. i.prototype.testDownload = function(t, e, i) {
  26300. var n = this.downloadTestResults[t];
  26301. if (n)
  26302. n === y.Success ? i(!0) : n === y.Fail && i(!1);
  26303. else {
  26304. this.downloadTestResults[t] = y.Testing;
  26305. var r = this.panos.list[0]
  26306. , o = this.getTileUrl(r.id, t, e, 0)
  26307. , a = function(e) {
  26308. this.downloadTestResults[t] = y.Success,
  26309. i(!0)
  26310. }
  26311. .bind(this)
  26312. , s = function() {
  26313. this.downloadTestResults[t] = y.Fail,
  26314. i(!1)
  26315. }
  26316. .bind(this);
  26317. this.loadImage(o, 0, a, s)
  26318. }
  26319. }
  26320. ,
  26321. i.prototype.startDownload = function(e) {
  26322. e.status = v.Downloading;
  26323. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  26324. this.activeDownloads.push(e),
  26325. this.loadImage(t, i.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  26326. }
  26327. ,
  26328. i.prototype.downloadFailed = function(e, t) {}
  26329. ,
  26330. i.prototype.downloadComplete = function(e, t) {
  26331. if (e.panoGroupId === this.panoGroupId) {
  26332. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  26333. e.status = v.Downloaded,
  26334. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  26335. var n = {
  26336. panoId: e.pano.id,
  26337. image: t,
  26338. tileSize: e.tileSize,
  26339. panoSize: e.panoSize,
  26340. tileIndex: e.tileIndex,
  26341. faceTileIndex: e.faceTileIndex,
  26342. totalTiles: e.totalTiles,
  26343. face: e.face,
  26344. tileX: e.tileX,
  26345. tileY: e.tileY,
  26346. direction: e.direction
  26347. };
  26348. e.image = t,
  26349. this.emit(o.TileDownloadSuccess, n),
  26350. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  26351. panoId: e.pano.id,
  26352. tileSize: e.tileSize,
  26353. panoSize: e.panoSize
  26354. },
  26355. this.emit(o.PanoDownloadComplete, n),
  26356. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  26357. }
  26358. }
  26359. ,
  26360. i.prototype.cleanupActiveDownloads = (n = [],
  26361. function() {
  26362. for (var e = n.length = 0; e < this.activeDownloads.length; e++) {
  26363. var t = this.activeDownloads[e];
  26364. t.status !== v.Downloaded && t.status !== v.Failed && n.push(t)
  26365. }
  26366. this.activeDownloads.length = 0,
  26367. this.activeDownloads.push.apply(this.activeDownloads, n)
  26368. }
  26369. ),
  26370. i.prototype.isPanoDownloaded = function(e, t) {
  26371. var i = this.getTileDownloadDescriptors(e, t);
  26372. if (i.length <= 0)
  26373. return !1;
  26374. for (var n = 0; n < i.length; n++) {
  26375. if (i[n].status !== v.Downloaded)
  26376. return !1
  26377. }
  26378. return !0
  26379. }
  26380. ,
  26381. i.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  26382. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  26383. this.panoLoadCallbacks[o] = {
  26384. onLoad: i,
  26385. onFail: n,
  26386. onProgress: r
  26387. }
  26388. }
  26389. ,
  26390. i.prototype.getPanoLoadCallbacks = function(e, t) {
  26391. var i = e.id + ":" + t;
  26392. return this.panoLoadCallbacks[i]
  26393. }
  26394. ,
  26395. i.prototype.buildDownloadDescriptorArray = function(e) {
  26396. for (var t = m.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  26397. var r = this.buildDownloadDescriptor();
  26398. i.push(r)
  26399. }
  26400. return i
  26401. }
  26402. ,
  26403. i.prototype.buildDownloadDescriptor = function() {
  26404. return {
  26405. panoGroupId: null,
  26406. pano: null,
  26407. panoSize: -1,
  26408. tileSize: -1,
  26409. tileIndex: -1,
  26410. totalTiles: -1,
  26411. faceTileIndex: -1,
  26412. status: v.None,
  26413. url: null,
  26414. image: null,
  26415. direction: new t.Vector3,
  26416. face: -1,
  26417. cubeFace: -1,
  26418. tileX: -1,
  26419. tileY: -1
  26420. }
  26421. }
  26422. ,
  26423. i.prototype.initTileDownloadDescriptors = function(e, t, i) {
  26424. for (var n = 0; n < e.length; n++) {
  26425. var r = e[n];
  26426. this.initTileDownloadDescriptor(r, t, i, n)
  26427. }
  26428. }
  26429. ,
  26430. i.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  26431. var r = i >= m.TILE_SIZE ? m.TILE_SIZE : i;
  26432. e.face = m.getFaceForTile(i, n),
  26433. e.cubeFace = a.mapFaceToCubemapFace(e.face),
  26434. e.panoGroupId = this.panoGroupId,
  26435. e.pano = t,
  26436. e.panoSize = i,
  26437. e.tileSize = r,
  26438. e.tileIndex = n,
  26439. e.totalTiles = m.getTileCountForSize(i),
  26440. e.status = v.None,
  26441. e.image = null,
  26442. m.getTileLocation(e.panoSize, e.tileIndex, e),
  26443. m.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, m.LocationOnTile.Center, 0, e.direction)
  26444. }
  26445. ,
  26446. i.prototype.getTileUrl = (c = {
  26447. 256: "256",
  26448. 512: "512",
  26449. 1024: "1k",
  26450. 2048: "2k",
  26451. 4096: "4k"
  26452. },
  26453. h = {
  26454. face: -1,
  26455. faceTileIndex: -1,
  26456. tileX: -1,
  26457. tileY: -1
  26458. },
  26459. function(e, t, i, n) {
  26460. m.getTileLocation(t, n, h);
  26461. var r = Math.floor(t / i)
  26462. , o = r * r
  26463. , a = Math.floor(n / o)
  26464. , s = "";
  26465. 1 === u.tiling.customCompression && (s = "_" + u.tiling["q" + c[t]]);
  26466. var l = this.urls.get("tiles/" + e + "/" + c[t] + s + "_face" + a + "_" + h.tileX + "_" + h.tileY + ".jpg");
  26467. return d.changeIfTileGenerating(l)
  26468. }
  26469. ),
  26470. i.prototype.loadImage = function(e, t, i, n) {
  26471. s.getImage(e, t).then(function(e) {
  26472. i(e)
  26473. }).fail(n)
  26474. }
  26475. ,
  26476. C.exports = i
  26477. }
  26478. ).call(this, "/js/tile/TileDownloader.js")
  26479. }
  26480. , {
  26481. "../ab": 3,
  26482. "../enum/DownloadStatus": 24,
  26483. "../enum/GLCubeFaces": 25,
  26484. "../enum/PanoSizeClass": 36,
  26485. "../enum/TileDownloaderEvents": 45,
  26486. "../enum/Vectors": 50,
  26487. "../enum/Viewmode": 51,
  26488. "../objects/Panorama": 148,
  26489. "../settings": 166,
  26490. "../util/ajax": 181,
  26491. "../util/logger": 189,
  26492. "../util/panorama": 191,
  26493. "./TilePrioritizer": 172,
  26494. "./TileUtils": 174,
  26495. events: 202,
  26496. three: 217
  26497. }],
  26498. 172: [function(n, C, e) {
  26499. (function(e) {
  26500. "use strict";
  26501. function h(e, t, i, n, r) {
  26502. this.qualityManager = e,
  26503. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26504. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  26505. this.baseSize = t,
  26506. this.standardSize = i,
  26507. this.highSize = n,
  26508. this.ultraHighSize = r,
  26509. this.priorityCriteria = new h.PriorityCriteria(null,new o.Vector3(0,0,0),new o.Vector3(0,0,-1),new o.Vector3(0,0,-1))
  26510. }
  26511. var c, s, l, d, r, u, p, f, o = n("three"), g = (n("../enum/Viewmode"),
  26512. n("../settings"),
  26513. n("../settings"),
  26514. n("../objects/Panorama")), t = n("../util/logger"), i = (n("../enum/Vectors"),
  26515. n("../enum/PanoSizeClass"),
  26516. n("../enum/ModelManagerEvents"),
  26517. n("../enum/GLCubeFaces"),
  26518. n("../enum/DownloadStatus")), m = (n("../util/browser"),
  26519. n("./TileUtils")), v = n("../util/math"), a = (n("events").EventEmitter,
  26520. new t(e),
  26521. Object.freeze({
  26522. None: 0,
  26523. DirectionalFOV: 1
  26524. }));
  26525. h.PriorityCriteria = function(e, t, i, n, r) {
  26526. this.pano = e,
  26527. this.cameraPosition = (new o.Vector3).copy(t),
  26528. this.cameraDir = (new o.Vector3).copy(i),
  26529. this.panoSpaceDir = (new o.Vector3).copy(n),
  26530. this.upcomingPanos = r,
  26531. this.copy = function(e) {
  26532. this.pano = e.pano,
  26533. this.cameraPosition.copy(e.cameraPosition),
  26534. this.cameraDir.copy(e.cameraDir),
  26535. this.panoSpaceDir.copy(e.panoSpaceDir),
  26536. this.upcomingPanos = r
  26537. }
  26538. ,
  26539. this.zoomingActive = !1
  26540. }
  26541. ,
  26542. h.DIRECTIONAL_FOV = 180,
  26543. h.DIRECTIONAL_FOV_NARROW = 120,
  26544. h.MAX_SCORED_PANOS_TOCONSIDER = 6,
  26545. h.MAX_SCORED_PANOS_TOADD = 2,
  26546. h.MAX_UPCOMING_PANOS_TOADD = 3,
  26547. h.DIRECTION_SCORE_STRICTNESS = .75,
  26548. h.appendQueue = function(e, t) {
  26549. if (e && t)
  26550. for (var i = 0; i < t.length; i++)
  26551. e.push(t[i])
  26552. }
  26553. ,
  26554. h.prototype.updateCriteria = function(e, t, i, n) {
  26555. this.priorityCriteria.pano = e,
  26556. this.priorityCriteria.cameraPosition.copy(t),
  26557. this.priorityCriteria.cameraDir.copy(i),
  26558. this.priorityCriteria.upcomingPanos = n,
  26559. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26560. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  26561. }
  26562. ,
  26563. h.prototype.filterAndPrioritize = (u = [],
  26564. p = [],
  26565. f = [],
  26566. function(e, t, i) {
  26567. this.populateNeighborPanos(this.priorityCriteria.pano, t, u),
  26568. this.populateScoredPanos(this.priorityCriteria.pano, t, p, this.priorityCriteria.cameraDir, h.MAX_SCORED_PANOS_TOCONSIDER);
  26569. var n = this.baseSize
  26570. , r = this.standardSize
  26571. , o = this.highSize
  26572. , a = this.ultraHighSize;
  26573. this.queueTilesForPano(e, i, this.priorityCriteria.pano, n),
  26574. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(e, this.priorityCriteria.upcomingPanos, i, n, h.MAX_UPCOMING_PANOS_TOADD),
  26575. f.length = 0,
  26576. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26577. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26578. h.appendQueue(e, f),
  26579. this.queueTilesForPanos(e, p, i, n, h.MAX_SCORED_PANOS_TOADD),
  26580. f.length = 0,
  26581. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26582. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26583. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26584. h.appendQueue(e, f),
  26585. f.length = 0,
  26586. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26587. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26588. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26589. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26590. h.appendQueue(e, f),
  26591. this.queueTilesForPanos(e, u, i, n)
  26592. }
  26593. ),
  26594. h.prototype.canDownloadSize = function(e) {
  26595. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  26596. }
  26597. ,
  26598. h.prototype.populateNeighborPanos = function(e, t, i) {
  26599. (i = i || []).length = 0;
  26600. var n = t.getNeighbours(e);
  26601. for (var r in n)
  26602. if (n.hasOwnProperty(r)) {
  26603. var o = t.get(r);
  26604. i.push(o)
  26605. }
  26606. return i
  26607. }
  26608. ,
  26609. h.prototype.populateScoredPanos = function(e, t, i, n, r) {
  26610. (i = i || []).length = 0;
  26611. var o = [g.filters.inPanoDirection(e.position, n, h.DIRECTION_SCORE_STRICTNESS), g.filters.not(e)]
  26612. , a = [g.scoreFunctions.distanceSquared(e), g.scoreFunctions.direction(e.position, n)]
  26613. , s = t.sortByScore(o, a);
  26614. if (s)
  26615. for (var l = 0; l < s.length && l < r; l++) {
  26616. var c = s[l].pano;
  26617. i.push(c)
  26618. }
  26619. return i
  26620. }
  26621. ,
  26622. h.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  26623. for (var o = 0, a = 0; a < t.length; a++) {
  26624. var s = t[a];
  26625. if (o += 0 < this.queueTilesForPano(e, i, s, n) ? 1 : 0,
  26626. r && r <= o)
  26627. break
  26628. }
  26629. return o
  26630. }
  26631. ,
  26632. h.prototype.queueTilesForPano = (r = {
  26633. filter: a.None
  26634. },
  26635. function(e, t, i, n) {
  26636. return this.filterAndQueueTileDownloadDescriptors(e, t, i, n, r)
  26637. }
  26638. ),
  26639. h.prototype.queueTilesForPanosInDirection = (d = new o.Vector3,
  26640. function(e, t, i, n, r, o, a, s) {
  26641. for (var l = 0, c = 0; c < i.length; c++) {
  26642. var h = i[c];
  26643. d.copy(h.position),
  26644. d.sub(r),
  26645. d.normalize();
  26646. var u = Math.max(Math.min(o.dot(d), 1), -1);
  26647. if (v.getFOVDotThreshold(a) <= u && (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, r, o, a) ? 1 : 0,
  26648. s && s <= l))
  26649. break
  26650. }
  26651. return l
  26652. }
  26653. ),
  26654. h.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  26655. for (var l = 0, c = 0; c < i.length; c++) {
  26656. var h = i[c];
  26657. if (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, o, a) ? 1 : 0,
  26658. s && s <= l)
  26659. break
  26660. }
  26661. return l
  26662. }
  26663. ,
  26664. h.prototype.queueTilesInDirectionForPano = (s = {
  26665. filter: a.DirectionalFOV,
  26666. direction: new o.Vector3,
  26667. fov: 60
  26668. },
  26669. l = new o.Vector3,
  26670. function(e, t, i, n, r, o, a) {
  26671. return l.copy(o),
  26672. m.getRelativeDirection(i.quaternion, l),
  26673. s.direction.copy(l),
  26674. s.fov = a,
  26675. this.filterAndQueueTileDownloadDescriptors(e, t, i, n, s)
  26676. }
  26677. ),
  26678. h.prototype.filterAndQueueTileDownloadDescriptors = (c = [],
  26679. function(e, t, i, n, r) {
  26680. var o = t.getTileDownloadDescriptors(i, n);
  26681. c.length = 0,
  26682. this.filterTileDownloadDescriptors(i, o, c, r);
  26683. for (var a = 0, s = 0; s < c.length; s++) {
  26684. var l = c[s];
  26685. l && (e.push(l),
  26686. a++)
  26687. }
  26688. return a
  26689. }
  26690. ),
  26691. h.prototype.filterTileDownloadDescriptors = (new o.Vector3,
  26692. function(e, t, i, n) {
  26693. var r, o;
  26694. switch (n.filter) {
  26695. case a.DirectionalFOV:
  26696. for (r = 0; r < t.length; r++)
  26697. o = t[r],
  26698. m.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  26699. break;
  26700. default:
  26701. for (r = 0; r < t.length; r++)
  26702. o = t[r],
  26703. i.push(o)
  26704. }
  26705. for (r = 0; r < i.length; r++)
  26706. o = i[r],
  26707. this.canIncludeDescriptor(o) || (i[r] = null)
  26708. }
  26709. ),
  26710. h.prototype.canIncludeDescriptor = function(e) {
  26711. return e.status !== i.Downloading && e.status !== i.Downloaded
  26712. }
  26713. ,
  26714. h.prototype.canIncludePano = function(e, t) {
  26715. return !e.isLoaded(t)
  26716. }
  26717. ,
  26718. h.getFOVDotThreshold = function(e) {
  26719. return Math.cos(o.Math.degToRad(e / 2))
  26720. }
  26721. ;
  26722. var y = (A._panoSpaceDir = new o.Vector3,
  26723. A._fovThreshold = -1,
  26724. A._fovThresholdNarrow = -1,
  26725. A);
  26726. function A(e, t) {
  26727. var i = A._panoSpaceDir
  26728. , n = A._fovThreshold
  26729. , r = A._fovThresholdNarrow
  26730. , o = Math.max(Math.min(i.dot(e.direction), 1), -1)
  26731. , a = Math.max(Math.min(i.dot(t.direction), 1), -1);
  26732. return e._dot = o,
  26733. t._dot = a,
  26734. 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)
  26735. }
  26736. h.sortPanoTiles = function(e, t, i) {
  26737. y._panoSpaceDir.copy(i),
  26738. m.getRelativeDirection(t.quaternion, y._panoSpaceDir),
  26739. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26740. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV),
  26741. e.sort(y)
  26742. }
  26743. ,
  26744. h.insertSortedPanoTile = function(e, t, i, n) {
  26745. y._panoSpaceDir.copy(n),
  26746. m.getRelativeDirection(i.quaternion, y._panoSpaceDir),
  26747. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26748. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV);
  26749. for (var r = -1, o = 0; o < e.length; o++) {
  26750. if (y(t, e[o]) <= 0) {
  26751. r = o;
  26752. break
  26753. }
  26754. }
  26755. if (-1 === r)
  26756. e[e.length] = t;
  26757. else {
  26758. for (var a = e.length; r < a; a--)
  26759. e[a] = e[a - 1];
  26760. e[r] = t
  26761. }
  26762. }
  26763. ,
  26764. h.prototype.setZoomingActive = function(e) {
  26765. e !== this.zoomingActive && (this.zoomingActive = e)
  26766. }
  26767. ,
  26768. C.exports = h
  26769. }
  26770. ).call(this, "/js/tile/TilePrioritizer.js")
  26771. }
  26772. , {
  26773. "../enum/DownloadStatus": 24,
  26774. "../enum/GLCubeFaces": 25,
  26775. "../enum/ModelManagerEvents": 33,
  26776. "../enum/PanoSizeClass": 36,
  26777. "../enum/Vectors": 50,
  26778. "../enum/Viewmode": 51,
  26779. "../objects/Panorama": 148,
  26780. "../settings": 166,
  26781. "../util/browser": 182,
  26782. "../util/logger": 189,
  26783. "../util/math": 190,
  26784. "./TileUtils": 174,
  26785. events: 202,
  26786. three: 217
  26787. }],
  26788. 173: [function(e, t, i) {
  26789. "use strict";
  26790. function f(e, t) {
  26791. this.levels = t,
  26792. this.tileSize = e,
  26793. this.root = null,
  26794. this.allNodes = [],
  26795. function(e) {
  26796. e.root = function e(t, i, n) {
  26797. if (n > t.levels)
  26798. return null;
  26799. var r = new a(t,i);
  26800. t.allNodes.push(r);
  26801. for (var o = 0; o < s; o++)
  26802. r.children[o] = e(t, r, n + 1);
  26803. return r
  26804. }(e, null, 0)
  26805. }(this)
  26806. }
  26807. function a(e, t) {
  26808. this.tree = e,
  26809. this.parent = t,
  26810. this.children = [],
  26811. this.id = ++n
  26812. }
  26813. var g = (e("three"),
  26814. e("./TileUtils"),
  26815. e("../objects/Panorama"),
  26816. e("../util/panorama"),
  26817. e("events").EventEmitter,
  26818. 2)
  26819. , s = g * g;
  26820. f.TraversalType = Object.freeze({
  26821. PreOrder: 0,
  26822. PostOrder: 1
  26823. });
  26824. var n = 0;
  26825. f.getLevelCountForSize = function(e, t) {
  26826. var i = 0;
  26827. for (t < e && (t = e); !((t /= g) < e); )
  26828. i++;
  26829. return i
  26830. }
  26831. ,
  26832. f.getSizeForLevel = function(e, t) {
  26833. return Math.pow(g, t) * e
  26834. }
  26835. ,
  26836. f.prototype.getSubNode = function(e, t, i) {
  26837. (!t || e < this.tileSize) && (t = 0),
  26838. (!i || e < this.tileSize) && (i = 0),
  26839. e < this.tileSize && (e = this.tileSize);
  26840. var n = f.getLevelCountForSize(this.tileSize, e);
  26841. return function e(t, i, n, r, o) {
  26842. if (!t)
  26843. return null;
  26844. if (0 === n)
  26845. return t;
  26846. if (!t.children || 0 === t.children.length)
  26847. return null;
  26848. var a = Math.pow(g, n) / g
  26849. , s = r % a
  26850. , l = o % a
  26851. , c = Math.floor(o / a)
  26852. , h = Math.floor(r / a)
  26853. , u = c * g + h;
  26854. return e(t.children[u], i + 1, n - 1, s, l)
  26855. }(this.root, 0, n, t, i)
  26856. }
  26857. ,
  26858. f.prototype.breadthFirst = function(e) {
  26859. var t = !!(e = e || {}).nullLevelEnd
  26860. , i = e.maxLevel
  26861. , n = e.minLevel
  26862. , r = e.callback
  26863. , o = e.saveVisited
  26864. , a = []
  26865. , s = {}
  26866. , l = 0;
  26867. for (a.push(this.root),
  26868. a.push(s); 0 < a.length && !(i && i < l); ) {
  26869. var c = a.shift();
  26870. if (c === s)
  26871. (!n || n <= l) && (r && t && r(null),
  26872. o && t && o.push(null)),
  26873. 0 < a.length && a.push(s),
  26874. l++,
  26875. 0;
  26876. else {
  26877. if (c.children)
  26878. for (var h = 0; h < c.children.length; h++) {
  26879. c.children[h] && a.push(c.children[h])
  26880. }
  26881. var u = this.getFaceIndexFromNode(c);
  26882. (!n || n <= l) && (r && r(c, l, u),
  26883. o && o.push(c)),
  26884. 0
  26885. }
  26886. }
  26887. }
  26888. ,
  26889. f.prototype.getFaceIndexFromNode = function(e) {
  26890. if (!e)
  26891. return -1;
  26892. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  26893. var o = i.parent;
  26894. if (!o)
  26895. break;
  26896. for (var a = -1, s = 0; s < o.children.length; s++)
  26897. o.children[s] === i && (a = s);
  26898. n = a % g * t + n,
  26899. r = Math.floor(a / g) * t + r,
  26900. t *= g,
  26901. i = o
  26902. }
  26903. return r * t + n
  26904. }
  26905. ,
  26906. f.prototype.depthFirst = function(e, t, i) {
  26907. !function e(t, i, n, r, o, a, s, l) {
  26908. if (t) {
  26909. s = s || f.TraversalType.PreOrder;
  26910. var c = r * g + n;
  26911. if (s === f.TraversalType.PreOrder && (o && o(t, i, c, n, r),
  26912. a && a.push(t)),
  26913. t.children && 0 !== t.children.length) {
  26914. for (var h = r * g, u = n * g, d = 0; d < g; d++)
  26915. for (var p = 0; p < g; p++)
  26916. e(t.children[p * g + d], i + 1, u + d, h + p, o, a, s, l);
  26917. s === f.TraversalType.PostOrder && (o && o(t, i, c, n, r),
  26918. a && a.push(t))
  26919. }
  26920. }
  26921. }(this.root, 0, 0, 0, e, t, i, this.tileSize)
  26922. }
  26923. ,
  26924. t.exports = f
  26925. }
  26926. , {
  26927. "../objects/Panorama": 148,
  26928. "../util/panorama": 191,
  26929. "./TileUtils": 174,
  26930. events: 202,
  26931. three: 217
  26932. }],
  26933. 174: [function(e, t, i) {
  26934. "use strict";
  26935. var n, a, s, p, f, g, E, l, c, h, u, d, r, o, m = e("../enum/GLCubeFaces"), _ = e("../util/MathLight"), b = {};
  26936. b.TILE_SIZE = 512,
  26937. b.FACES_PER_PANO = 6,
  26938. b.LocationOnTile = {
  26939. Center: 0,
  26940. UpperLeft: 1,
  26941. UpperRight: 2,
  26942. LowerRight: 3,
  26943. LowerLeft: 4
  26944. },
  26945. b.getTileVector = function(e, t, i, n, r, o, a, s) {
  26946. var l = e / t
  26947. , c = t / e * 2
  26948. , h = c / 2
  26949. , u = n / l * 2 - 1 + h
  26950. , d = (r = l - 1 - r) / l * 2 - 1 + h;
  26951. switch (o = o || b.LocationOnTile.Center) {
  26952. case b.LocationOnTile.UpperLeft:
  26953. u -= h,
  26954. d += h,
  26955. u += a * c;
  26956. break;
  26957. case b.LocationOnTile.UpperRight:
  26958. u += h,
  26959. d += h,
  26960. d -= a * c;
  26961. break;
  26962. case b.LocationOnTile.LowerRight:
  26963. u += h,
  26964. d -= h,
  26965. u -= a * c;
  26966. break;
  26967. case b.LocationOnTile.LowerLeft:
  26968. u -= h,
  26969. d -= h,
  26970. d += a * c;
  26971. break;
  26972. case b.LocationOnTile.Center:
  26973. }
  26974. switch (i) {
  26975. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  26976. _.setVector(s, -1, d, -u);
  26977. break;
  26978. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  26979. _.setVector(s, 1, d, u);
  26980. break;
  26981. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  26982. _.setVector(s, -u, 1, -d);
  26983. break;
  26984. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  26985. _.setVector(s, -u, -1, d);
  26986. break;
  26987. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  26988. _.setVector(s, -u, d, 1);
  26989. break;
  26990. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  26991. _.setVector(s, u, d, -1)
  26992. }
  26993. _.normalize(s)
  26994. }
  26995. ,
  26996. b.getFaceForTile = function(e, t) {
  26997. var i = b.TILE_SIZE;
  26998. e < b.TILE_SIZE && (i = e);
  26999. var n = Math.floor(e / i)
  27000. , r = n * n;
  27001. return Math.floor(t / r)
  27002. }
  27003. ,
  27004. b.getTileLocation = function(e, t, i) {
  27005. var n = b.TILE_SIZE;
  27006. e < b.TILE_SIZE && (n = e);
  27007. var r = b.getFaceForTile(e, t)
  27008. , o = Math.floor(e / n)
  27009. , a = t - r * (o * o);
  27010. i.tileX = a % o,
  27011. i.tileY = Math.floor(a / o),
  27012. i.face = r,
  27013. i.faceTileIndex = a
  27014. }
  27015. ,
  27016. b.getTileCountForSize = function(e) {
  27017. if (e <= b.TILE_SIZE)
  27018. return b.FACES_PER_PANO;
  27019. var t = Math.floor(e / b.TILE_SIZE);
  27020. return t * t * b.FACES_PER_PANO
  27021. }
  27022. ,
  27023. b.getRelativeDirection = (r = new _.Matrix4,
  27024. o = new _.Quaternion,
  27025. function(e, t) {
  27026. o.copy(e),
  27027. o.inverse(),
  27028. r.makeRotationFromQuaternion(o),
  27029. r.applyToVector3(t),
  27030. _.normalize(t)
  27031. }
  27032. ),
  27033. b.matchingTilesInDirection = (c = new _.Vector3,
  27034. h = new _.Vector3(0,0,-1),
  27035. u = new _.Quaternion,
  27036. l = {
  27037. face: -1,
  27038. faceTileIndex: -1,
  27039. tileX: -1,
  27040. tileY: -1
  27041. },
  27042. d = function(e, t, i) {
  27043. for (var n = b.getTileCountForSize(e), r = 0, o = 0; o < n; o++)
  27044. b.getTileLocation(e, o, l),
  27045. t && !t(l) || (r++,
  27046. i && (a = l,
  27047. i.push({
  27048. face: a.face,
  27049. faceTileIndex: a.faceTileIndex,
  27050. tileX: a.tileX,
  27051. tileY: a.tileY
  27052. })));
  27053. var a;
  27054. return r
  27055. }
  27056. ,
  27057. function(e, t, i, n, r, o) {
  27058. var a = t < b.TILE_SIZE ? t : b.TILE_SIZE;
  27059. if (b.getTileCountForSize(t),
  27060. !n && !r)
  27061. return d(t, null, o);
  27062. var s = !!r;
  27063. return r = r || n,
  27064. r = Math.max(0, Math.min(r, 360)),
  27065. n = Math.max(0, Math.min(n, 360)),
  27066. _.copyVector(i, c),
  27067. b.getRelativeDirection(e.quaternion, c),
  27068. s ? (u.setFromUnitVectors(c, h),
  27069. d(t, function(e) {
  27070. return b.isTileWithinFrustum(t, a, e.face, e.tileX, e.tileY, u, n, r)
  27071. }, o)) : d(t, function(e) {
  27072. return b.isTileWithinFOV(t, a, e.face, e.tileX, e.tileY, c, n)
  27073. }, o)
  27074. }
  27075. ),
  27076. b.isTileWithinFrustum = (E = new _.Vector3,
  27077. function(e, t, i, n, r, o, a, s) {
  27078. 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++)
  27079. if (b.getTileVector(e, t, d, n, r, y, 0, E),
  27080. _.applyQuaternionToVector(o, E),
  27081. -1e-5 <= E.z)
  27082. ;
  27083. else {
  27084. var A = -1 / E.z
  27085. , C = E.x * A
  27086. , I = E.y * A;
  27087. l < I ? p++ : I < c && f++,
  27088. h < C ? g++ : C < u && m++,
  27089. v++
  27090. }
  27091. return f !== v && p !== v && g !== v && m !== v
  27092. }
  27093. ),
  27094. b.isTileWithinFOV = (p = new _.Vector3,
  27095. f = new _.Vector3(0,1,0),
  27096. g = new _.Vector3(1,0,0),
  27097. function(e, t, i, n, r, o, a) {
  27098. var s = b.mapFaceToCubemapFace(i);
  27099. if (_.cross(o, f, g),
  27100. b.getTileVector(e, t, s, n, r, b.LocationOnTile.Center, 0, p),
  27101. b.isWithinFOV(p, o, a, null))
  27102. return !0;
  27103. for (var l = a / 360, c = Math.floor(1 / l), h = 0, u = 0; u < c; u++) {
  27104. for (var d = b.LocationOnTile.UpperLeft; d <= b.LocationOnTile.LowerLeft; d++)
  27105. if (b.getTileVector(e, t, s, n, r, d, h, p),
  27106. b.isWithinFOV(p, o, a, null))
  27107. return !0;
  27108. h += l
  27109. }
  27110. return !1
  27111. }
  27112. ),
  27113. b.isWithinFOV = (a = new _.Vector3,
  27114. s = new _.Vector3,
  27115. function(e, t, i, n) {
  27116. if (_.copyVector(e, s),
  27117. n) {
  27118. _.copyVector(n, a),
  27119. _.normalize(a);
  27120. var r = _.dot(a, e);
  27121. a.x *= r,
  27122. a.y *= r,
  27123. a.z *= r,
  27124. _.subVector(s, a)
  27125. }
  27126. var o = i / 2 * _.RADIANS_PER_DEGREE;
  27127. return Math.cos(o) <= _.dot(s, t)
  27128. }
  27129. ),
  27130. b.mapFaceToCubemapFace = (n = {
  27131. 0: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  27132. 1: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  27133. 2: m.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  27134. 3: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  27135. 4: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  27136. 5: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  27137. },
  27138. function(e) {
  27139. return n[e]
  27140. }
  27141. ),
  27142. t.exports = b
  27143. }
  27144. , {
  27145. "../enum/GLCubeFaces": 25,
  27146. "../util/MathLight": 176
  27147. }],
  27148. 175: [function(i, n, e) {
  27149. (function(e) {
  27150. "use strict";
  27151. function t() {
  27152. this.list = [],
  27153. this.index = {},
  27154. Object.defineProperty(this, "length", {
  27155. get: function() {
  27156. return this.list.length
  27157. }
  27158. })
  27159. }
  27160. new (i("./common"),
  27161. i("./logger"))(e),
  27162. t.prototype.forEach = function(e) {
  27163. this.list.forEach(e)
  27164. }
  27165. ,
  27166. t.prototype.add = function(e) {
  27167. this.list.push(e),
  27168. this.index[this.getIndex(e)] = e
  27169. }
  27170. ,
  27171. t.prototype.getIndex = function(e) {
  27172. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  27173. }
  27174. ,
  27175. t.prototype.extend = function(e) {
  27176. for (var t = 0; t < e.length; t++)
  27177. this.add(e[t])
  27178. }
  27179. ,
  27180. t.prototype.get = function(e) {
  27181. return this.index[e]
  27182. }
  27183. ,
  27184. t.prototype.first = function() {
  27185. return this.list[0]
  27186. }
  27187. ,
  27188. t.prototype.last = function() {
  27189. return this.list[this.list.length - 1]
  27190. }
  27191. ,
  27192. t.prototype.reIndex = function() {
  27193. this.index = {};
  27194. var t = this;
  27195. this.forEach(function(e) {
  27196. t.index[t.getIndex(e)] = e
  27197. })
  27198. }
  27199. ,
  27200. t.prototype.filter = function(e) {
  27201. var t = this.list.filter(e);
  27202. return this.reIndex(),
  27203. t
  27204. }
  27205. ,
  27206. t.prototype.reduce = function(e, t) {
  27207. return this.list.reduce(e, t)
  27208. }
  27209. ,
  27210. t.prototype.sort = function(e) {
  27211. return this.list.sort(e)
  27212. }
  27213. ,
  27214. t.prototype.indexOf = function(e) {
  27215. for (var t = 0; t < this.list.length; ++t)
  27216. if (this.list[t] === e)
  27217. return t;
  27218. return -1
  27219. }
  27220. ,
  27221. n.exports = t
  27222. }
  27223. ).call(this, "/js/util/IndexedCollection.js")
  27224. }
  27225. , {
  27226. "./common": 185,
  27227. "./logger": 189
  27228. }],
  27229. 176: [function(e, t, i) {
  27230. "use strict";
  27231. e("../constants");
  27232. var n, r, o = {};
  27233. o.RADIANS_PER_DEGREE = Math.PI / 180,
  27234. o.DEGREES_PER_RADIAN = 180 / Math.PI,
  27235. o.Vector3 = function(e, t, i) {
  27236. this.x = e || 0,
  27237. this.y = t || 0,
  27238. this.z = i || 0
  27239. }
  27240. ,
  27241. o.Matrix4 = function() {
  27242. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  27243. 0 < arguments.length && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  27244. }
  27245. ,
  27246. o.Matrix4.prototype = {
  27247. identity: function() {
  27248. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  27249. this
  27250. },
  27251. copy: function(e) {
  27252. return this.elements.set(e.elements),
  27253. this
  27254. },
  27255. applyToVector3: function(e) {
  27256. var t = e.x
  27257. , i = e.y
  27258. , n = e.z
  27259. , r = this.elements;
  27260. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  27261. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  27262. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  27263. this
  27264. },
  27265. getInverse: function(e, t) {
  27266. var i = this.elements
  27267. , n = e.elements
  27268. , r = n[0]
  27269. , o = n[1]
  27270. , a = n[2]
  27271. , s = n[3]
  27272. , l = n[4]
  27273. , c = n[5]
  27274. , h = n[6]
  27275. , u = n[7]
  27276. , d = n[8]
  27277. , p = n[9]
  27278. , f = n[10]
  27279. , g = n[11]
  27280. , m = n[12]
  27281. , v = n[13]
  27282. , y = n[14]
  27283. , A = n[15]
  27284. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  27285. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  27286. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  27287. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  27288. , b = r * C + o * I + a * E + s * _;
  27289. if (0 == b) {
  27290. var w = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  27291. if (t)
  27292. throw new Error(w);
  27293. return console.warn(w),
  27294. this.identity()
  27295. }
  27296. var T = 1 / b;
  27297. return i[0] = C * T,
  27298. i[1] = (v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A) * T,
  27299. i[2] = (c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A) * T,
  27300. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  27301. i[4] = I * T,
  27302. i[5] = (d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A) * T,
  27303. i[6] = (m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A) * T,
  27304. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  27305. i[8] = E * T,
  27306. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A) * T,
  27307. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A) * T,
  27308. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  27309. i[12] = _ * T,
  27310. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y) * T,
  27311. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y) * T,
  27312. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  27313. this
  27314. },
  27315. makeRotationFromQuaternion: function(e) {
  27316. var t = this.elements
  27317. , i = e.x
  27318. , n = e.y
  27319. , r = e.z
  27320. , o = e.w
  27321. , a = i + i
  27322. , s = n + n
  27323. , l = r + r
  27324. , c = i * a
  27325. , h = i * s
  27326. , u = i * l
  27327. , d = n * s
  27328. , p = n * l
  27329. , f = r * l
  27330. , g = o * a
  27331. , m = o * s
  27332. , v = o * l;
  27333. return t[0] = 1 - (d + f),
  27334. t[4] = h - v,
  27335. t[8] = u + m,
  27336. t[1] = h + v,
  27337. t[5] = 1 - (c + f),
  27338. t[9] = p - g,
  27339. t[2] = u - m,
  27340. t[6] = p + g,
  27341. t[10] = 1 - (c + d),
  27342. t[3] = 0,
  27343. t[7] = 0,
  27344. t[11] = 0,
  27345. t[12] = 0,
  27346. t[13] = 0,
  27347. t[14] = 0,
  27348. t[15] = 1,
  27349. this
  27350. }
  27351. },
  27352. o.Quaternion = function(e, t, i, n) {
  27353. this._x = e || 0,
  27354. this._y = t || 0,
  27355. this._z = i || 0,
  27356. this._w = void 0 !== n ? n : 1
  27357. }
  27358. ,
  27359. o.Quaternion.prototype = {
  27360. get x() {
  27361. return this._x
  27362. },
  27363. set x(e) {
  27364. this._x = e
  27365. },
  27366. get y() {
  27367. return this._y
  27368. },
  27369. set y(e) {
  27370. this._y = e
  27371. },
  27372. get z() {
  27373. return this._z
  27374. },
  27375. set z(e) {
  27376. this._z = e
  27377. },
  27378. get w() {
  27379. return this._w
  27380. },
  27381. set w(e) {
  27382. this._w = e
  27383. },
  27384. copy: function(e) {
  27385. this._x = e.x,
  27386. this._y = e.y,
  27387. this._z = e.z,
  27388. this._w = e.w
  27389. },
  27390. inverse: function() {
  27391. return this.conjugate().normalize()
  27392. },
  27393. conjugate: function() {
  27394. return this._x *= -1,
  27395. this._y *= -1,
  27396. this._z *= -1,
  27397. this
  27398. },
  27399. length: function() {
  27400. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  27401. },
  27402. normalize: function() {
  27403. var e = this.length();
  27404. return 0 === e ? (this._x = 0,
  27405. this._y = 0,
  27406. this._z = 0,
  27407. this._w = 1) : (e = 1 / e,
  27408. this._x = this._x * e,
  27409. this._y = this._y * e,
  27410. this._z = this._z * e,
  27411. this._w = this._w * e),
  27412. this
  27413. },
  27414. setFromAxisAngle: function(e, t) {
  27415. var i = t / 2
  27416. , n = Math.sin(i);
  27417. return this._x = e.x * n,
  27418. this._y = e.y * n,
  27419. this._z = e.z * n,
  27420. this._w = Math.cos(i),
  27421. this
  27422. },
  27423. setFromUnitVectors: function(e, t) {
  27424. return void 0 === n && (n = new o.Vector3),
  27425. (r = o.dot(e, t) + 1) < 1e-6 ? (r = 0,
  27426. 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),
  27427. this._x = n.x,
  27428. this._y = n.y,
  27429. this._z = n.z,
  27430. this._w = r,
  27431. this.normalize()
  27432. },
  27433. multiply: function(e) {
  27434. return this.multiplyQuaternions(this, e)
  27435. },
  27436. premultiply: function(e) {
  27437. return this.multiplyQuaternions(e, this)
  27438. },
  27439. multiplyQuaternions: function(e, t) {
  27440. var i = e._x
  27441. , n = e._y
  27442. , r = e._z
  27443. , o = e._w
  27444. , a = t._x
  27445. , s = t._y
  27446. , l = t._z
  27447. , c = t._w;
  27448. return this._x = i * c + o * a + n * l - r * s,
  27449. this._y = n * c + o * s + r * a - i * l,
  27450. this._z = r * c + o * l + i * s - n * a,
  27451. this._w = o * c - i * a - n * s - r * l,
  27452. this
  27453. }
  27454. },
  27455. o.convertWorkshopVector = function(e) {
  27456. return new o.Vector3(-e.x,e.y,e.z)
  27457. }
  27458. ,
  27459. o.convertWorkshopQuaternion = function(e) {
  27460. 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))
  27461. }
  27462. ,
  27463. o.convertWorkshopOrthoZoom = function(e) {
  27464. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  27465. }
  27466. ,
  27467. o.convertWorkshopPanoramaQuaternion = function(e) {
  27468. 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))
  27469. }
  27470. ,
  27471. o.normalize = function(e) {
  27472. var t = e.x * e.x + e.y * e.y + e.z * e.z
  27473. , i = Math.sqrt(t);
  27474. e.x /= i,
  27475. e.y /= i,
  27476. e.z /= i
  27477. }
  27478. ,
  27479. o.dot = function(e, t) {
  27480. return e.x * t.x + e.y * t.y + e.z * t.z
  27481. }
  27482. ,
  27483. o.cross = function(e, t, i) {
  27484. var n = e.x
  27485. , r = e.y
  27486. , o = e.z;
  27487. i.x = r * t.z - o * t.y,
  27488. i.y = o * t.x - n * t.z,
  27489. i.z = n * t.y - r * t.x
  27490. }
  27491. ,
  27492. o.setVector = function(e, t, i, n) {
  27493. e.x = t,
  27494. e.y = i,
  27495. e.z = n
  27496. }
  27497. ,
  27498. o.copyVector = function(e, t) {
  27499. t.x = e.x,
  27500. t.y = e.y,
  27501. t.z = e.z
  27502. }
  27503. ,
  27504. o.addVector = function(e, t) {
  27505. e.x += t.x,
  27506. e.y += t.y,
  27507. e.z += t.z
  27508. }
  27509. ,
  27510. o.subVector = function(e, t) {
  27511. e.x -= t.x,
  27512. e.y -= t.y,
  27513. e.z -= t.z
  27514. }
  27515. ,
  27516. o.applyQuaternionToVector = function(e, t) {
  27517. var i = t.x
  27518. , n = t.y
  27519. , r = t.z
  27520. , o = e.x
  27521. , a = e.y
  27522. , s = e.z
  27523. , l = e.w
  27524. , c = l * i + a * r - s * n
  27525. , h = l * n + s * i - o * r
  27526. , u = l * r + o * n - a * i
  27527. , d = -o * i - a * n - s * r;
  27528. t.x = c * l + d * -o + h * -s - u * -a,
  27529. t.y = h * l + d * -a + u * -o - c * -s,
  27530. t.z = u * l + d * -s + c * -a - h * -o
  27531. }
  27532. ,
  27533. o.angleBetweenVectors = function(e, t) {
  27534. return Math.acos(o.dot(e, t))
  27535. }
  27536. ,
  27537. t.exports = o
  27538. }
  27539. , {
  27540. "../constants": 8
  27541. }],
  27542. 177: [function(c, h, e) {
  27543. (function(e) {
  27544. "use strict";
  27545. function t(e) {
  27546. this.cache = null,
  27547. this.expires = 0
  27548. }
  27549. function i() {
  27550. this.baseUrl = null,
  27551. this.cache = null,
  27552. this.expires = 0
  27553. }
  27554. function n() {
  27555. this.baseUrl = null,
  27556. this.expires = 0
  27557. }
  27558. function r(e) {
  27559. this.initialLoadingPromise = null,
  27560. this.endpoint = e + "?type=3",
  27561. this.urlContainer = null,
  27562. this.authorizationHeader = s.getAuthorizationHeader(),
  27563. this.containerClasses = [n, i, t]
  27564. }
  27565. c("./ajax");
  27566. var o = c("./logger")
  27567. , a = c("../constants")
  27568. , s = c("./showcase")
  27569. , l = (c("../ab"),
  27570. new o(e));
  27571. t.prototype = {
  27572. version: 1,
  27573. validate: function(e) {
  27574. return "catalog.json"in e && 0 < Object.keys(e).length
  27575. },
  27576. update: function(e) {
  27577. return this.cache = e,
  27578. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27579. $.when()
  27580. },
  27581. get: function(e) {
  27582. return this.cache[e]
  27583. }
  27584. },
  27585. i.prototype = {
  27586. version: 2,
  27587. validate: function(e) {
  27588. return "catalog.json"in e && "base.url"in e && 1 < Object.keys(e).length
  27589. },
  27590. update: function(e) {
  27591. return this.baseUrl = e["base.url"],
  27592. this.cache = e,
  27593. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27594. $.when()
  27595. },
  27596. get: function(e) {
  27597. var t = this.cache[e];
  27598. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  27599. }
  27600. },
  27601. n.prototype = {
  27602. version: 3,
  27603. validate: function(e) {
  27604. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  27605. },
  27606. update: function(e) {
  27607. return this.baseUrl = e.templates[0],
  27608. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27609. $.when()
  27610. },
  27611. get: function(e) {
  27612. return this.baseUrl.replace("{{filename}}", e)
  27613. }
  27614. },
  27615. r.prototype = {
  27616. init: function() {
  27617. return this.initialLoadingPromise || (setInterval(function() {
  27618. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  27619. Date.now() + a.signedUrlRefreshBuffer > e && (l.debug("Refreshing urls..."),
  27620. this.refresh().done(function() {
  27621. l.debug("Refreshed")
  27622. }).fail(function() {
  27623. l.error("Failed url refresh, urls might go stale soon")
  27624. }))
  27625. }
  27626. .bind(this), a.signedUrlCheckInterval),
  27627. this.initialLoadingPromise = this.refresh()),
  27628. this.initialLoadingPromise
  27629. },
  27630. refresh: function(e) {
  27631. return {},
  27632. $.Deferred().resolve()
  27633. },
  27634. get: function(e) {
  27635. return window.DATA.files.templates[0].replace("{{filename}}", e)
  27636. }
  27637. },
  27638. h.exports = r
  27639. }
  27640. ).call(this, "/js/util/ModelUrls.js")
  27641. }
  27642. , {
  27643. "../ab": 3,
  27644. "../constants": 8,
  27645. "./ajax": 181,
  27646. "./logger": 189,
  27647. "./showcase": 193
  27648. }],
  27649. 178: [function(l, c, e) {
  27650. (function(e) {
  27651. "use strict";
  27652. function t() {
  27653. i.call(this),
  27654. this.neighbourMap = {},
  27655. this.map = null
  27656. }
  27657. 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"),
  27658. l("./aStar")), T = new (l("./logger"))(e), i = l("./IndexedCollection"), s = l("./transitions");
  27659. n.inherit(t, i),
  27660. t.prototype.getIndex = function(e) {
  27661. return e.id
  27662. }
  27663. ,
  27664. t.prototype.find = function(e, t) {
  27665. var i = n.filterAll(this.list, e);
  27666. return 0 === i.length ? null : (t && t.forEach(function(e) {
  27667. i = n.stableSort(i, e)
  27668. }),
  27669. i[0])
  27670. }
  27671. ,
  27672. t.prototype.sortByScore = function(e, t) {
  27673. var i = n.filterAll(this.list, e);
  27674. return 0 === i.length ? null : i = i.map(function(i) {
  27675. return {
  27676. pano: i,
  27677. score: t.reduce(function(e, t) {
  27678. return e + t(i)
  27679. }, 0)
  27680. }
  27681. }).sort(function(e, t) {
  27682. return t.score - e.score
  27683. })
  27684. }
  27685. ,
  27686. t.prototype.lowestByScore = function(e, t, i) {
  27687. return this.findRankedByScore(0, e, t, i)
  27688. }
  27689. ,
  27690. t.prototype.findRankedByScore = function(e, t, i, n) {
  27691. n && (n.candidates = null,
  27692. n.pano = null),
  27693. e = e || 0;
  27694. var r = this.sortByScore(t, i);
  27695. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  27696. n.pano = r[e].pano),
  27697. r[e].pano)
  27698. }
  27699. ,
  27700. t.prototype.showPanoScores = function(e) {
  27701. this.list.forEach(function(e) {
  27702. e.removeTextSprite()
  27703. });
  27704. var t = 6344768;
  27705. e.forEach(function(e) {
  27706. e.pano.addTextSprite(e.score.toFixed(2), t),
  27707. t = 16428055
  27708. })
  27709. }
  27710. ,
  27711. t.prototype.isNeighbour = function(e, t) {
  27712. return this.neighbourMap[e.id][t.id]
  27713. }
  27714. ,
  27715. t.prototype.getNeighbours = function(e) {
  27716. return this.neighbourMap[e.id]
  27717. }
  27718. ,
  27719. t.prototype.setNeighbour = function(e, t, i) {
  27720. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  27721. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  27722. this.neighbourMap[e.id][e.id] = !0,
  27723. this.neighbourMap[t.id][t.id] = !0,
  27724. this.neighbourMap[e.id][t.id] = i,
  27725. this.neighbourMap[t.id][e.id] = i,
  27726. this.neighbourMap[e.id]
  27727. }
  27728. ,
  27729. t.prototype.findClosest = function(e, t) {
  27730. var i = [r.filters.isPanoAligned()];
  27731. return t && i.push(r.filters.inDirection(e, t, .75)),
  27732. this.find(i, [r.sortFunctions.distanceToPoint(e)])
  27733. }
  27734. ,
  27735. t.prototype.dualNeighbors = function(e, t) {
  27736. var i, n = [];
  27737. for (i in this.neighbourMap[e.id])
  27738. this.neighbourMap[t.id][i] && n.push(i);
  27739. return n
  27740. }
  27741. ,
  27742. t.prototype.populate_path_graph = function() {
  27743. var e, t, i, n, r, o, a, s, l = Date.now(), c = {}, h = 0, u = new w.Vector3(0,0,0);
  27744. for (e = 0; e < this.list.length; e += 1) {
  27745. for (t in s = !(a = {}),
  27746. i = (r = this.list[e]).neighbourPanos || r.findNeighourPanos())
  27747. if (i[t]) {
  27748. o = this.index[t],
  27749. u.copy(r.floorPosition),
  27750. u.sub(o.floorPosition);
  27751. var d = Math.sqrt(u.x * u.x + u.z * u.z)
  27752. , p = (Math.abs(u.y),
  27753. Math.max(d, .01),
  27754. Math.max(0, Math.abs(u.y) - .2));
  27755. n = 0 < p ? (1,
  27756. p = Math.pow(4 * p, 2),
  27757. d = Math.pow(d, 2),
  27758. Math.sqrt(p * p + d * d)) : (1,
  27759. u.length()),
  27760. a[o.id] = n,
  27761. s = !0
  27762. }
  27763. s ? c[r.id] = a : h += 1
  27764. }
  27765. this.map = c,
  27766. T.info("graph ready in " + (Date.now() - l) + "ms, " + h + " had no neighbors")
  27767. }
  27768. ,
  27769. t.prototype.aStarSearch = function(e, t) {
  27770. var i = Date.now()
  27771. , n = new o({
  27772. start: e,
  27773. isEnd: function(e) {
  27774. return e === t
  27775. },
  27776. neighbor: function(e) {
  27777. var t = e.neighbourPanos || e.findNeighourPanos()
  27778. , i = [];
  27779. for (var n in t)
  27780. t[n] && i.push(this.index[n]); //add: t[n] &&
  27781. return i
  27782. }
  27783. .bind(this),
  27784. distance: function(e, t) {
  27785. return this.map[e.id][t.id]
  27786. }
  27787. .bind(this),
  27788. heuristic: function(e, t) {
  27789. return 1
  27790. }
  27791. .bind(this),
  27792. hash: function(e) {
  27793. return e.id
  27794. },
  27795. timeout: 5e3
  27796. });
  27797. if (T.debug("A* search in " + (Date.now() - i) + "ms"),
  27798. "success" !== n.status)
  27799. return T.debug("Did not find A* path from " + e + " to " + t),
  27800. null;
  27801. T.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  27802. var r = [];
  27803. return n.path.forEach(function(e) {
  27804. r.push(e.id)
  27805. }),
  27806. r
  27807. }
  27808. ,
  27809. t.prototype.includeNodesNearPath = (f = new w.Vector3,
  27810. g = new w.Vector3,
  27811. m = new w.Vector3,
  27812. v = new w.Vector3,
  27813. y = new w.Vector3,
  27814. A = new w.Vector3,
  27815. C = new w.Vector3,
  27816. I = new w.Vector3,
  27817. E = [],
  27818. _ = new w.Vector3,
  27819. b = new w.Vector3,
  27820. function(e, t) {
  27821. if (e)
  27822. for (var i = function(e, t, i) {
  27823. return y.copy(t).sub(e),
  27824. y.dot(i)
  27825. }, n = function(e, t) {
  27826. return i(_, e.position, m) - i(_, t.position, m)
  27827. }, r = 0; r < e.length - 1; ) {
  27828. var o = e[r]
  27829. , a = e[r + 1]
  27830. , s = this.index[o]
  27831. , l = this.index[a];
  27832. _.copy(s.position),
  27833. b.copy(l.position),
  27834. E.length = 0,
  27835. f.copy(b).sub(_),
  27836. m.copy(f).normalize();
  27837. for (var c = 0; c < this.list.length; c++) {
  27838. var h = this.list[c];
  27839. y.copy(h.position).sub(_);
  27840. var u = y.dot(m);
  27841. 0 < u && (C.copy(m),
  27842. C.multiplyScalar(u),
  27843. A.copy(y),
  27844. A.sub(C),
  27845. A.length() < t && (g.copy(f).negate(),
  27846. v.copy(g).normalize(),
  27847. I.copy(h.position).sub(b),
  27848. 0 < I.dot(v) && E.push(h)))
  27849. }
  27850. if (0 < E.length) {
  27851. E.sort(n);
  27852. for (var d = e.length + E.length - 1; d >= r + E.length; d--)
  27853. e[d] = e[d - E.length];
  27854. for (var p = 0; p < E.length; p++)
  27855. e[p + r + 1] = E[p].id
  27856. }
  27857. r += E.length + 1
  27858. }
  27859. }
  27860. ),
  27861. t.prototype.fadeMarkerOpacity = function(e, t) {
  27862. var i = void 0 === e ? a.panorama.markerOpacity : e
  27863. , n = this.list.findIndex(function(e) {
  27864. return e.marker
  27865. });
  27866. if (!(n < 0)) {
  27867. var r = this.list[n].marker.material.opacity;
  27868. if (r !== e) {
  27869. var o = i - r;
  27870. s.trigger({
  27871. func: function(e, t) {
  27872. var i = r + e * o;
  27873. this.forEach(function(e) {
  27874. e.marker && (e.marker.material.opacity = i)
  27875. })
  27876. }
  27877. .bind(this),
  27878. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  27879. name: "_fpm"
  27880. })
  27881. }
  27882. }
  27883. }
  27884. ,
  27885. c.exports = t
  27886. }
  27887. ).call(this, "/js/util/PanoramaCollection.js")
  27888. }
  27889. , {
  27890. "../objects/Panorama": 148,
  27891. "../settings": 166,
  27892. "./IndexedCollection": 175,
  27893. "./aStar": 180,
  27894. "./common": 185,
  27895. "./logger": 189,
  27896. "./transitions": 195,
  27897. three: 217
  27898. }],
  27899. 179: [function(e, t, i) {
  27900. "use strict";
  27901. function n() {
  27902. this.actionSequence = [],
  27903. this.actionSequenceInProgress = !1
  27904. }
  27905. function r(e, t, i, n) {
  27906. c.trackAlways("zoom_" + e, {
  27907. from: t,
  27908. to: i,
  27909. pano: n
  27910. })
  27911. }
  27912. var o, a, s, l, c = e("../analytics");
  27913. n.prototype.reset = function(e) {
  27914. this.actionSequenceInProgress = !1,
  27915. this.actionSequence.length = 0
  27916. }
  27917. ,
  27918. n.prototype.addZoomAction = (a = o = null,
  27919. s = !1,
  27920. l = function() {
  27921. if (o = null,
  27922. 0 < this.actionSequence.length) {
  27923. var e = this.actionSequence[0].start
  27924. , t = this.actionSequence[this.actionSequence.length - 1].end;
  27925. 1 === e ? function(e, t) {
  27926. r("initial", 1, e, t)
  27927. }(t, a) : function(e, t, i) {
  27928. r("followup", e, t, i)
  27929. }(e, t, a)
  27930. }
  27931. this.reset()
  27932. }
  27933. ,
  27934. function(e, t, i) {
  27935. if (e !== t) {
  27936. s || (l = l.bind(this),
  27937. s = !0),
  27938. o && (window.clearTimeout(o),
  27939. o = null),
  27940. i === a && this.actionSequenceInProgress || (this.reset(),
  27941. a = i),
  27942. this.actionSequenceInProgress = !0;
  27943. var n = {
  27944. start: e,
  27945. end: t
  27946. };
  27947. this.actionSequence.push(n),
  27948. o = window.setTimeout(l, 150)
  27949. }
  27950. }
  27951. ),
  27952. t.exports = n
  27953. }
  27954. , {
  27955. "../analytics": 4
  27956. }],
  27957. 180: [function(e, t, i) {
  27958. "use strict";
  27959. function g(e) {
  27960. if (void 0 === e.parent)
  27961. return [e.data];
  27962. var t = g(e.parent);
  27963. return t.push(e.data),
  27964. t
  27965. }
  27966. function m(e) {
  27967. return e.toString()
  27968. }
  27969. function v(e, t) {
  27970. return e.f - t.f
  27971. }
  27972. var y = e("Set")
  27973. , A = e("heap")
  27974. , C = e("dict");
  27975. t.exports = function(e) {
  27976. void 0 === e.timeout && (e.timeout = 1 / 0);
  27977. var t = e.hash || m
  27978. , i = {
  27979. data: e.start,
  27980. g: 0,
  27981. h: e.heuristic(e.start)
  27982. }
  27983. , n = i;
  27984. i.f = i.h;
  27985. var r = new y
  27986. , o = new A(v)
  27987. , a = C();
  27988. o.push(i),
  27989. a.set(t(i.data), i);
  27990. for (var s = new Date; o.size(); ) {
  27991. if (new Date - s > e.timeout)
  27992. return {
  27993. status: "timeout",
  27994. cost: n.g,
  27995. path: g(n)
  27996. };
  27997. var l = o.pop();
  27998. if (a.delete(t(l.data)),
  27999. e.isEnd(l.data))
  28000. return {
  28001. status: "success",
  28002. cost: l.g,
  28003. path: g(l)
  28004. };
  28005. r.add(t(l.data));
  28006. for (var c = e.neighbor(l.data), h = 0; h < c.length; h++) {
  28007. var u = c[h];
  28008. if (!r.contains(t(u))) {
  28009. var d = l.g + e.distance(l.data, u)
  28010. , p = a.get(t(u))
  28011. , f = !1;
  28012. if (void 0 === p)
  28013. p = {
  28014. data: u
  28015. },
  28016. a.set(t(u), p);
  28017. else {
  28018. if (p.g < d)
  28019. continue;
  28020. f = !0
  28021. }
  28022. p.parent = l,
  28023. p.g = d,
  28024. p.h = e.heuristic(u),
  28025. p.f = d + p.h,
  28026. p.h < n.h && (n = p),
  28027. f ? o.heapify() : o.push(p)
  28028. }
  28029. }
  28030. }
  28031. return {
  28032. status: "noPath",
  28033. cost: n.g,
  28034. path: g(n)
  28035. }
  28036. }
  28037. }
  28038. , {
  28039. Set: 196,
  28040. dict: 210,
  28041. heap: 211
  28042. }],
  28043. 181: [function(i, n, e) {
  28044. (function(e) {
  28045. "use strict";
  28046. function s(e, t, i) {
  28047. function n() {
  28048. l.warn("Retrying ", t),
  28049. s(e, t, i).done(a.resolve.bind(a)).progress(a.notify.bind(a)).fail(a.reject.bind(a))
  28050. }
  28051. var r = function(e, t, i) {
  28052. var n = new XMLHttpRequest;
  28053. if (i && "withCredentials"in n)
  28054. n.open(e, t, i);
  28055. else if ("undefined" != typeof XDomainRequest)
  28056. (n = new XDomainRequest).open(e, t);
  28057. else {
  28058. if (i)
  28059. throw "Browser does not support CORS!";
  28060. n.open(e, t)
  28061. }
  28062. return n
  28063. }(e, t, !1);
  28064. if ((i = i || {}).retries = void 0 !== i.retries ? i.retries : 0,
  28065. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  28066. i.responseType)
  28067. if (-1 < ["arraybuffer", "text", "json"].indexOf(i.responseType))
  28068. r.responseType = i.responseType;
  28069. else {
  28070. if ("image/jpeg" !== i.responseType)
  28071. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  28072. r.responseType = "arraybuffer"
  28073. }
  28074. if ("json" === i.responseType && r.setRequestHeader("Accept", "application/json"),
  28075. i.auth && r.setRequestHeader("Authorization", i.auth),
  28076. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  28077. r.setRequestHeader("Content-Type", "application/json")),
  28078. "object" == typeof i.headers)
  28079. for (var o in i.headers)
  28080. r.setRequestHeader(o, i.headers[o]);
  28081. var a = $.Deferred();
  28082. return r.onreadystatechange = function(e) {
  28083. if (4 === this.readyState)
  28084. if (500 <= this.status && this.status <= 600 && i.retry && i.retries < 3)
  28085. i.retries++,
  28086. setTimeout(n, 1e3);
  28087. else if (200 === this.status) {
  28088. var t = function(e, t) {
  28089. var i = e.response;
  28090. if ("json" === t && "object" != typeof i)
  28091. try {
  28092. i = JSON.parse(e.responseText)
  28093. } catch (e) {
  28094. return void a.reject({
  28095. error: "Failed parsing JSON"
  28096. })
  28097. }
  28098. else if ("image/jpeg" === t) {
  28099. var n = new Uint8Array(e.response)
  28100. , r = new Blob([n],{
  28101. type: "image/jpeg"
  28102. })
  28103. , o = URL.createObjectURL(r);
  28104. (i = new Image).src = o,
  28105. i.crossOrigin = "Anonymous",
  28106. i.onload = function() {
  28107. URL.revokeObjectURL(o)
  28108. }
  28109. }
  28110. return i
  28111. }(this, i.responseType);
  28112. a.resolve(t)
  28113. } else
  28114. a.reject(this)
  28115. }
  28116. ,
  28117. r.onprogress = function(e) {
  28118. a.notify(e)
  28119. }
  28120. ,
  28121. r.send(i.data),
  28122. a.promise()
  28123. }
  28124. function o(e, t) {
  28125. var i = e + "__" + (t.responseType || null) + "__" + (t.auth || null) + "__" + (t.prefetchFrom || null);
  28126. return t.headers && function(t) {
  28127. return Object.keys(t).sort().map(function(e) {
  28128. return {
  28129. key: e,
  28130. value: t[e]
  28131. }
  28132. })
  28133. }(t.headers).forEach(function(e) {
  28134. i += "__" + e.key + ":" + e.value
  28135. }),
  28136. i
  28137. }
  28138. var t = i("./logger")
  28139. , a = i("../ab")
  28140. , l = new t(e);
  28141. window.URL = window.URL || window.webkitURL,
  28142. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  28143. window.DATA = window.DATA || {},
  28144. n.exports = {
  28145. get: function(e, t) {
  28146. var i, n = void 0 === (t = t || {}).cache || t.cache;
  28147. if (n) {
  28148. var r = function(e, t) {
  28149. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[o(e, t)] : null
  28150. }(e, t);
  28151. if (r)
  28152. return r
  28153. }
  28154. return i = t.prefetchFrom && window.DATA[t.prefetchFrom] ? $.when(window.DATA[t.prefetchFrom]) : s("GET", e, t),
  28155. n && function(e, t, i) {
  28156. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[o(e, t)] = i)
  28157. }(e, t, i),
  28158. i
  28159. },
  28160. post: function(e, t) {
  28161. return s("POST", e, t)
  28162. },
  28163. patch: function(e, t) {
  28164. return s("PATCH", e, t)
  28165. },
  28166. getImage: function(e, t) {
  28167. function i() {
  28168. l.warn("Retrying ", e),
  28169. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  28170. }
  28171. var n = $.Deferred()
  28172. , r = new Image
  28173. , o = this;
  28174. return e = a.changeIfImageOptimzing(e),
  28175. null != t || (t = 3),
  28176. r.onerror = function() {
  28177. 0 < t ? setTimeout(i, 1e3) : n.reject()
  28178. }
  28179. ,
  28180. r.onload = function() {
  28181. n.resolve(r)
  28182. }
  28183. ,
  28184. r.crossOrigin = "anonymous",
  28185. r.src = e,
  28186. n
  28187. }
  28188. }
  28189. }
  28190. ).call(this, "/js/util/ajax.js")
  28191. }
  28192. , {
  28193. "../ab": 3,
  28194. "./logger": 189
  28195. }],
  28196. 182: [function(e, t, i) {
  28197. "use strict";
  28198. function n(e, t) {
  28199. var i = window.navigator.userAgent.match(e);
  28200. return i = i ? i[1].split(t) : [],
  28201. {
  28202. major: parseInt(i[0]) || 0,
  28203. minor: parseInt(i[1]) || 0,
  28204. patch: parseInt(i[2]) || 0
  28205. }
  28206. }
  28207. var r = e("../exception/DeviceMismatchException");
  28208. window.browser = t.exports = {
  28209. isFullscreen: function() {
  28210. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  28211. },
  28212. supportsFullscreen: function() {
  28213. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  28214. },
  28215. isPointerLocked: function() {
  28216. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  28217. },
  28218. requestFullscreen: function(e, t) {
  28219. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  28220. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  28221. },
  28222. requestPointerLock: function() {
  28223. var e;
  28224. if (document.fullscreenElement)
  28225. e = document.fullscreenElement();
  28226. else if (document.mozFullscreenElement)
  28227. e = document.mozFullscreenElement();
  28228. else if (document.mozFullScreenElement)
  28229. e = document.mozFullScreenElement();
  28230. else {
  28231. if (!document.webkitFullscreenElement)
  28232. return;
  28233. e = document.webkitFullscreenElement()
  28234. }
  28235. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  28236. e.requestPointerLock(),
  28237. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  28238. },
  28239. exitPointerLock: function() {
  28240. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  28241. document.exitPointerLock()
  28242. },
  28243. exitFullscreen: function() {
  28244. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  28245. },
  28246. details: function() {
  28247. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  28248. return e ? {
  28249. name: e[1],
  28250. version: parseInt(e[2]),
  28251. platform: navigator.platform
  28252. } : {}
  28253. },
  28254. is: function(e) {
  28255. return this.details() && this.details().name === e
  28256. },
  28257. inIframe: function() {
  28258. return window.parent !== window
  28259. },
  28260. aspectRatio: function() {
  28261. var e = $("#player").width() / $("#player").height();
  28262. return isFinite(e) ? e : 0
  28263. },
  28264. userAgent: function() {
  28265. return window.navigator.userAgent
  28266. },
  28267. isMobile: function() {
  28268. var e = navigator.userAgent || navigator.vendor || window.opera;
  28269. 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))
  28270. },
  28271. isLandscape: function() {
  28272. return this.isMobile && 1 < this.aspectRatio()
  28273. },
  28274. isSmallScreen: function() {
  28275. return screen.width / window.devicePixelRatio < 240
  28276. },
  28277. detectIE: function() {
  28278. return -1 !== window.navigator.userAgent.indexOf("MSIE ") || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  28279. },
  28280. detectSafari: function() {
  28281. return -1 !== window.navigator.userAgent.indexOf("Safari") && !this.detectChrome()
  28282. },
  28283. detectFirefox: function() {
  28284. return -1 !== window.navigator.userAgent.indexOf("Firefox")
  28285. },
  28286. detectChrome: function() {
  28287. return -1 !== window.navigator.userAgent.indexOf("Chrome") && !this.detectOpera()
  28288. },
  28289. detectOpera: function() {
  28290. return -1 !== window.navigator.userAgent.indexOf("OPR")
  28291. },
  28292. detectIOS: function() {
  28293. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  28294. },
  28295. detectIPad: function() {
  28296. var e = window.navigator.userAgent;
  28297. return /iPad/.test(e)
  28298. },
  28299. detectIPod: function() {
  28300. var e = window.navigator.userAgent;
  28301. return /iPod/.test(e)
  28302. },
  28303. detectIPhone: function() {
  28304. var e = window.navigator.userAgent;
  28305. return /iPhone/.test(e)
  28306. },
  28307. detectAndroid: function() {
  28308. return -1 !== window.navigator.userAgent.indexOf("Android")
  28309. },
  28310. detectAndroidMobile: function() {
  28311. var e = window.navigator.userAgent;
  28312. return this.detectAndroid() && -1 !== e.indexOf("Mobile")
  28313. },
  28314. detectSamsungNative: function() {
  28315. var e = window.navigator.userAgent;
  28316. return -1 !== e.indexOf("SM-G900H") || -1 !== e.indexOf("GT-I9500") || -1 !== e.indexOf("SM-N900")
  28317. },
  28318. detectSamsungS6: function() {
  28319. return -1 !== window.navigator.userAgent.indexOf("SM-G92")
  28320. },
  28321. detectHUAWEI5X: function() {
  28322. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  28323. },
  28324. detectWebVR: function() {
  28325. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  28326. },
  28327. getVRDisplay: function() {
  28328. var t = $.Deferred();
  28329. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(e) {
  28330. 1 <= e.length && t.resolve(e[0]),
  28331. t.reject(null)
  28332. }),
  28333. t) : t.reject(null)
  28334. },
  28335. iosVersion: function() {
  28336. if (!this.detectIOS())
  28337. throw new r("Did not detect an iDevice");
  28338. return n(/((?:\d+\_?){1,3}) like Mac OS/, "_")
  28339. },
  28340. androidVersion: function() {
  28341. if (!this.detectAndroid())
  28342. throw new r("Did not detect an Android based device");
  28343. return n(/Android ((?:\d+\.?){1,3})/, ".")
  28344. },
  28345. valueFromCookie: function(e, t) {
  28346. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  28347. if (!i)
  28348. return t;
  28349. var n = i[1];
  28350. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  28351. },
  28352. valueFromHash: function(e, t) {
  28353. var i = new RegExp("[#&?]" + e + "=([^#&?]*)").exec(window.location.href);
  28354. if (!i)
  28355. return t;
  28356. var n = i[1];
  28357. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : window.decodeURIComponent(n)
  28358. }
  28359. }
  28360. }
  28361. , {
  28362. "../exception/DeviceMismatchException": 56
  28363. }],
  28364. 183: [function(i, n, e) {
  28365. (function(e) {
  28366. "use strict";
  28367. var o = i("../controls/serializer")
  28368. , a = i("../util/math")
  28369. , s = i("./browser")
  28370. , l = i("../enum/Viewmode")
  28371. , t = i("../util/logger")
  28372. , c = i("three")
  28373. , h = new t(e);
  28374. n.exports = {
  28375. getStartCameraOptions: function(e, t) {
  28376. var i = function(e) {
  28377. var t = s.valueFromHash("start", "")
  28378. , i = {};
  28379. if ("" !== t) {
  28380. h.debug("Start override found in parameters, trying to parse..."),
  28381. i = function(e) {
  28382. return o.deserialize(e)
  28383. }(t) || {};
  28384. var n = s.valueFromHash("tag", null);
  28385. n && (i.tag = n),
  28386. i.panoId && (i.pano = e.get(i.panoId))
  28387. }
  28388. return i
  28389. }(t);
  28390. if (0 < Object.keys(i).length)
  28391. return i;
  28392. if (e.heroImage)
  28393. i = function(e, t) {
  28394. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  28395. return {};
  28396. var i = {}
  28397. , n = e.heroImage.metadata;
  28398. h.debug("Using start position from thumbnail image"),
  28399. i.position = n.camera_position,
  28400. i.quaternion = n.camera_quaternion;
  28401. try {
  28402. i.mode = l.convertWorkshopModeInt(n.camera_mode),
  28403. i.mode === l.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  28404. } catch (e) {
  28405. h.debug(e.message)
  28406. }
  28407. return i
  28408. }(e, t);
  28409. else if (window.DATA.camera_start) {
  28410. var n = window.DATA.camera_start;
  28411. try {
  28412. 0 < Object.keys(n).length && !a.isEmptyQuaternion(n.camera.quaternion) && (i.mode = l.convertWorkshopModeInt(n.mode),
  28413. i.position = (new c.Vector3).fromArray(n.camera.position),
  28414. i.quaternion = (new c.Quaternion).fromArray(n.camera.quaternion),
  28415. i.zoom = a.convertWorkshopOrthoZoom(n.camera.zoom),
  28416. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  28417. h.debug("Using camera_start"),
  28418. h.debug("Modeldata pano: ", i.pano.quaternion),
  28419. h.debug("Camera start pano: ", n.pano.quaternion)),
  28420. i.mode !== l.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility));
  28421. } catch (e) {
  28422. h.warn(e.message)
  28423. if(i.mode == "panorama" && !i.pano){
  28424. i.pano = t.list[0]
  28425. }
  28426. }
  28427. }
  28428. if (e.outsideAllowed() || i.mode === l.PANORAMA || (i = {}),
  28429. i.mode === l.MESH && i.position && (i.mode = l.PANORAMA,
  28430. i.pano = t.findClosest(i.position) ,
  28431. i.quaternion = i.pano.quaternion),
  28432. 0 === Object.keys(i).length) {
  28433. var r = t.list[0];
  28434. r && (i.mode = l.PANORAMA,
  28435. i.pano = r,
  28436. i.position = r.position,
  28437. i.quaternion = r.quaternion,
  28438. h.info("Starting at 1st pano " + r.id))
  28439. }
  28440. return i.mode = i.mode || l.DOLLHOUSE,
  28441. i
  28442. }
  28443. }
  28444. }
  28445. ).call(this, "/js/util/camera.js")
  28446. }
  28447. , {
  28448. "../controls/serializer": 14,
  28449. "../enum/Viewmode": 51,
  28450. "../util/logger": 189,
  28451. "../util/math": 190,
  28452. "./browser": 182,
  28453. three: 217
  28454. }],
  28455. 184: [function(e, t, i) {
  28456. "use strict";
  28457. function r(e, t, i) {
  28458. var n = t
  28459. , r = i;
  28460. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (n / r)) * a.DEGREES_PER_RADIAN
  28461. }
  28462. function o(e, t, i) {
  28463. var n = t
  28464. , r = i;
  28465. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (r / n)) * a.DEGREES_PER_RADIAN
  28466. }
  28467. var a = e("./MathLight");
  28468. t.exports = {
  28469. clampVFOV: function(e, t, i, n) {
  28470. return t < r(e, i, n) ? o(t, i, n) : e
  28471. },
  28472. getHFOVForCamera: function(e, t, i) {
  28473. return r(e.fov, t, i)
  28474. },
  28475. getHFOVFromVFOV: r,
  28476. getVFOVFromHFOV: o
  28477. }
  28478. window.MathLight = t.exports
  28479. MathLight.closeTo = function(e1,e2, precision){//xzw add 判断e1,e2是否接近
  28480. var prec = Math.pow(10, - (precision || 4));
  28481. var s1 = Math.abs(e1.x - e2.x) < prec && Math.abs(e1.y - e2.y) < prec && Math.abs(e1.z - e2.z) < prec
  28482. if(e1.w){
  28483. return s1 && Math.abs(e1.w - e2.w) < prec
  28484. }else return s1
  28485. }
  28486. }
  28487. , {
  28488. "./MathLight": 176
  28489. }],
  28490. 185: [function(e, t, i) {
  28491. "use strict";
  28492. var a = e("three");
  28493. t.exports = {
  28494. delayOneFrame: function(e) {
  28495. window.setTimeout(e, 1)
  28496. },
  28497. normalizeUrl: function(e) {
  28498. return e.replace("https://", "http://")
  28499. },
  28500. domainFromUrl: function(e) {
  28501. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  28502. return t ? t[3] : e
  28503. },
  28504. average: function(e, t) {
  28505. if (0 === e.length)
  28506. return null;
  28507. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  28508. i += t ? e[r][t] : e[r],
  28509. n++
  28510. }
  28511. return i / n
  28512. },
  28513. countUnique: function(e) {
  28514. for (var t = {}, i = 0; i < e.length; i++)
  28515. t[e[i]] = 1 + (t[e[i]] || 0);
  28516. return Object.keys(t).length
  28517. },
  28518. averageVectors: function(e, t) {
  28519. var i = new a.Vector3;
  28520. if (0 === e.length)
  28521. return i;
  28522. for (var n = 0, r = 0; r < e.length; r++) {
  28523. var o = t ? e[r][t] : e[r];
  28524. i.add(o),
  28525. n++
  28526. }
  28527. return i.divideScalar(n)
  28528. },
  28529. equalLists: function(e, t) {
  28530. if (e.length !== t.length)
  28531. return !1;
  28532. for (var i = 0; i < e.length; i++)
  28533. if (e[i] !== t[i])
  28534. return !1;
  28535. return !0
  28536. },
  28537. lowerMedian: function(e, t) {
  28538. return 0 === e.length ? null : (t = t || 2,
  28539. e.sort(function(e, t) {
  28540. return e - t
  28541. }),
  28542. e[Math.floor(e.length / t)])
  28543. },
  28544. stableSort: function(e, n) {
  28545. return e.map(function(e, t) {
  28546. return {
  28547. value: e,
  28548. index: t
  28549. }
  28550. }).sort(function(e, t) {
  28551. var i = n(e.value, t.value);
  28552. return 0 !== i ? i : e.index - t.index
  28553. }).map(function(e) {
  28554. return e.value
  28555. })
  28556. },
  28557. filterAll: function(e, i) {
  28558. return e.filter(function(t) {
  28559. return i.every(function(e) {
  28560. return e(t)
  28561. })
  28562. })
  28563. },
  28564. formatDate: function(e) {
  28565. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  28566. },
  28567. formatDatetime: function(e) {
  28568. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  28569. },
  28570. randomString: function(e) {
  28571. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  28572. t += i.charAt(Math.floor(Math.random() * i.length));
  28573. return t
  28574. },
  28575. uint8ToBase64: function(e, t) {
  28576. t && "number" == typeof t || (t = 8192);
  28577. for (var i = [], n = 0; n < e.length; n += t)
  28578. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  28579. return btoa(i.join(""))
  28580. },
  28581. uuid4: function e(t) {
  28582. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  28583. },
  28584. nth: function(e) {
  28585. return 1 === (e %= 10) ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  28586. },
  28587. extendObject: function(t, i) {
  28588. return Object.keys(i).forEach(function(e) {
  28589. t[e] = i[e]
  28590. }),
  28591. t
  28592. },
  28593. deepExtend: function e(t) {
  28594. t = t || {};
  28595. for (var i = 1; i < arguments.length; i++) {
  28596. var n = arguments[i];
  28597. if (n)
  28598. for (var r in n)
  28599. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  28600. }
  28601. return t
  28602. },
  28603. inherit: function(e, t) {
  28604. e.prototype = Object.create(t.prototype),
  28605. e.prototype.constructor = e
  28606. },
  28607. extend: function(e, t) {
  28608. for (var i in t.prototype)
  28609. e.prototype[i] = t.prototype[i]
  28610. },
  28611. getVisiblePano : function(positions = [], panos, options={}){//add
  28612. var visiblePanos = [];
  28613. options.posAtPanos = options.posAtPanos || {}//在不同漫游点的positions
  28614. panos.forEach((pano)=>{
  28615. if(!pano.isAligned())return;
  28616. var A = pano.position.clone();
  28617. var posB = options.posAtPanos[pano.id] || positions;
  28618. var posLength = posB.length
  28619. for(let i=0;i<posLength;i++){
  28620. var B = posB[i];
  28621. var ray = new THREE.Raycaster(A.clone(), B.clone().sub(A).normalize(), 0, A.distanceTo(B) - (options.tolerance||0) )
  28622. var o = ray.intersectObjects(options.model || player.model.colliders, true);
  28623. if (!o || !o.length){ //只要有一点可见,就算整体可见
  28624. visiblePanos.push(pano.id);
  28625. break;
  28626. }
  28627. }
  28628. })
  28629. return visiblePanos
  28630. }
  28631. ,
  28632. sortByScore : function(list, request, rank) {
  28633. var i = this.filterAll(list, request);
  28634. return 0 === i.length ? null : i = i.map(function(e) {
  28635. return {
  28636. item: e,
  28637. score: rank.reduce(function(t, i) {
  28638. return t + i(e);
  28639. }, 0)
  28640. };
  28641. }).sort(function(e, t) {
  28642. return t.score - e.score;
  28643. });
  28644. }
  28645. ,
  28646. getFileNameFromUrl:function(url){
  28647. return url.split('/').pop();
  28648. }
  28649. },
  28650. Math.sign = function(e) {
  28651. return e < 0 ? -1 : 1
  28652. }
  28653. window.common = t.exports
  28654. }
  28655. , {
  28656. three: 217
  28657. }],
  28658. 186: [function(e, t, i) {
  28659. "use strict";
  28660. var r = {
  28661. linearTween: function(e, t, i, n) {
  28662. return i * e / n + t
  28663. },
  28664. easeInQuad: function(e, t, i, n) {
  28665. return i * (e /= n) * e + t
  28666. },
  28667. easeOutQuad: function(e, t, i, n) {
  28668. return -i * (e /= n) * (e - 2) + t
  28669. },
  28670. easeInOutQuad: function(e, t, i, n) {
  28671. return (e /= n / 2) < 1 ? i / 2 * e * e + t : -i / 2 * (--e * (e - 2) - 1) + t
  28672. },
  28673. easeInCubic: function(e, t, i, n) {
  28674. return i * (e /= n) * e * e + t
  28675. },
  28676. easeOutCubic: function(e, t, i, n) {
  28677. return e /= n,
  28678. i * (--e * e * e + 1) + t
  28679. },
  28680. easeInOutCubic: function(e, t, i, n) {
  28681. return (e /= n / 2) < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t
  28682. },
  28683. easeInQuart: function(e, t, i, n) {
  28684. return i * (e /= n) * e * e * e + t
  28685. },
  28686. easeOutQuart: function(e, t, i, n) {
  28687. return e /= n,
  28688. -i * (--e * e * e * e - 1) + t
  28689. },
  28690. easeInOutQuart: function(e, t, i, n) {
  28691. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e + t : -i / 2 * ((e -= 2) * e * e * e - 2) + t
  28692. },
  28693. easeInQuint: function(e, t, i, n) {
  28694. return i * (e /= n) * e * e * e * e + t
  28695. },
  28696. easeOutQuint: function(e, t, i, n) {
  28697. return e /= n,
  28698. i * (--e * e * e * e * e + 1) + t
  28699. },
  28700. easeInOutQuint: function(e, t, i, n) {
  28701. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e * e + t : i / 2 * ((e -= 2) * e * e * e * e + 2) + t
  28702. },
  28703. easeInSine: function(e, t, i, n) {
  28704. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  28705. },
  28706. easeOutSine: function(e, t, i, n) {
  28707. return i * Math.sin(e / n * (Math.PI / 2)) + t
  28708. },
  28709. easeInOutSine: function(e, t, i, n) {
  28710. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  28711. },
  28712. easeInExpo: function(e, t, i, n) {
  28713. return i * Math.pow(2, 10 * (e / n - 1)) + t
  28714. },
  28715. easeOutExpo: function(e, t, i, n) {
  28716. return i * (1 - Math.pow(2, -10 * e / n)) + t
  28717. },
  28718. easeInOutExpo: function(e, t, i, n) {
  28719. return (e /= n / 2) < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  28720. i / 2 * (2 - Math.pow(2, -10 * e)) + t)
  28721. },
  28722. easeInCirc: function(e, t, i, n) {
  28723. return e /= n,
  28724. -i * (Math.sqrt(1 - e * e) - 1) + t
  28725. },
  28726. easeOutCirc: function(e, t, i, n) {
  28727. return e /= n,
  28728. e--,
  28729. i * Math.sqrt(1 - e * e) + t
  28730. },
  28731. easeInOutCirc: function(e, t, i, n) {
  28732. return (e /= n / 2) < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  28733. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  28734. },
  28735. easeInElastic: function(e, t, i, n) {
  28736. var r = 1.70158
  28737. , o = 0
  28738. , a = i;
  28739. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28740. r = a < Math.abs(i) ? (a = i,
  28741. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28742. -a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) + t)
  28743. },
  28744. easeOutElastic: function(e, t, i, n) {
  28745. var r = 1.70158
  28746. , o = 0
  28747. , a = i;
  28748. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28749. r = a < Math.abs(i) ? (a = i,
  28750. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28751. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  28752. },
  28753. easeInOutElastic: function(e, t, i, n) {
  28754. var r = 1.70158
  28755. , o = 0
  28756. , a = i;
  28757. return 0 === e ? t : 2 == (e /= n / 2) ? t + i : (o = o || n * (.3 * 1.5),
  28758. r = a < Math.abs(i) ? (a = i,
  28759. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28760. 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)
  28761. },
  28762. easeInBack: function(e, t, i, n, r) {
  28763. return void 0 === r && (r = 1.70158),
  28764. i * (e /= n) * e * ((r + 1) * e - r) + t
  28765. },
  28766. easeOutBack: function(e, t, i, n, r) {
  28767. return void 0 === r && (r = 1.70158),
  28768. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  28769. },
  28770. easeInOutBack: function(e, t, i, n, r) {
  28771. return void 0 === r && (r = 1.70158),
  28772. (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
  28773. },
  28774. easeOutBounce: function(e, t, i, n) {
  28775. 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
  28776. },
  28777. easeInBounce: function(e, t, i, n) {
  28778. return i - r.easeOutBounce(n - e, 0, i, n) + t
  28779. },
  28780. easeInOutBounce: function(e, t, i, n) {
  28781. 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
  28782. }
  28783. };
  28784. window.easing = t.exports = r
  28785. }
  28786. , {}],
  28787. 187: [function(e, t, i) {
  28788. "use strict";
  28789. function n() {
  28790. this.events = [],
  28791. this.valid = !1
  28792. }
  28793. var r = e("../enum/Joystick");
  28794. n.prototype.push = function(e, t) {
  28795. this.events.push({
  28796. direction: e,
  28797. pano: t
  28798. }),
  28799. this.valid = !0
  28800. }
  28801. ,
  28802. n.prototype.pop = function(e) {
  28803. var t = this.events.pop();
  28804. return this.events.length < 1 && (this.valid = !1),
  28805. t
  28806. }
  28807. ,
  28808. n.prototype.peek = function() {
  28809. return this.events.length ? this.events[this.events.length - 1] : {
  28810. direction: null,
  28811. pano: null
  28812. }
  28813. }
  28814. ,
  28815. n.prototype.invalidate = function() {
  28816. this.events = [],
  28817. this.valid = !1
  28818. }
  28819. ,
  28820. n.prototype.reversePano = function(e) {
  28821. if (!this.valid)
  28822. return null;
  28823. var t = this.peek();
  28824. return r.opposite(e) === t.direction ? (this.pop(),
  28825. t.pano) : null
  28826. }
  28827. ,
  28828. t.exports = n
  28829. }
  28830. , {
  28831. "../enum/Joystick": 29
  28832. }],
  28833. 188: [function(e, t, i) {
  28834. "use strict";
  28835. t.exports = {
  28836. vector: function(t, i) {
  28837. var n = t.clone();
  28838. return i = i.clone(),
  28839. function(e) {
  28840. t.set(n.x * (1 - e) + i.x * e, n.y * (1 - e) + i.y * e, n.z * (1 - e) + i.z * e)
  28841. }
  28842. },
  28843. quaternion: function(t, i) {
  28844. var n = t.clone();
  28845. return function(e) {
  28846. t.copy(n).slerp(i, e)
  28847. }
  28848. },
  28849. property: function(t, i, n, r) {
  28850. var o = t[i];
  28851. return function(e) {
  28852. t[i] = o * (1 - e) + n * e,
  28853. r && r(t[i])
  28854. }
  28855. },
  28856. uniform: function(t, i, n) {
  28857. var r = t.material.uniforms[i].value;
  28858. return function(e) {
  28859. t.material.uniforms[i] && (t.material.uniforms[i].value = r * (1 - e) + n * e)
  28860. }
  28861. },
  28862. matrix4: function(o, a) {
  28863. var s = o.clone();
  28864. return function(e) {
  28865. for (var t = o.elements, i = s.elements, n = a.elements, r = 0; r < 16; r++)
  28866. t[r] = i[r] * (1 - e) + n[r] * e
  28867. }
  28868. },
  28869. allUniforms: function(e, t, i) {
  28870. var n = e.map(function(e) {
  28871. return this.uniform(e, t, i)
  28872. }
  28873. .bind(this));
  28874. return function(t) {
  28875. n.forEach(function(e) {
  28876. e(t)
  28877. })
  28878. }
  28879. }
  28880. }
  28881. }
  28882. , {}],
  28883. 189: [function(e, t, i) {
  28884. "use strict";
  28885. function h(n) {
  28886. var e, t, i, r, o = n.split("/"), a = "[" + o[o.length - 1].replace(".js", "") + "]", s = {};
  28887. if (h.consoleEnabled) {
  28888. var l = function(e) {
  28889. $("#debug-console").append("<p>" + e + "</p>"),
  28890. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  28891. };
  28892. e = function(e) {
  28893. l(Array.prototype.slice.call(arguments).join(" "))
  28894. }
  28895. ,
  28896. t = function(e) {
  28897. l(Array.prototype.slice.call(arguments).join(" "))
  28898. }
  28899. ,
  28900. i = function(e) {
  28901. l("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  28902. }
  28903. ,
  28904. r = function(e) {
  28905. l("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  28906. }
  28907. } else
  28908. console.log ? (e = console.log,
  28909. t = console.info ? console.info : console.log,
  28910. i = console.warn ? console.warn : console.log,
  28911. r = console.error ? console.error : console.log) : e = t = i = r = function() {}
  28912. ;
  28913. function c(e) {
  28914. return [a, h.timestamp()].concat(Array.prototype.slice.call(e))
  28915. }
  28916. return {
  28917. debug: function() {
  28918. h.level >= h.levels.debug && e.apply(console, c(arguments))
  28919. },
  28920. info: function() {
  28921. h.level >= h.levels.info && t.apply(console, c(arguments))
  28922. },
  28923. warn: function() {
  28924. (function(e, t) {
  28925. if (u) {
  28926. var i = Array.prototype.slice.call(e).join(" ");
  28927. u.captureMessage(i, {
  28928. level: t,
  28929. path: n,
  28930. timestamp: h.timestamp()
  28931. })
  28932. }
  28933. }
  28934. )(arguments, "warn"),
  28935. h.level >= h.levels.warn && i.apply(console, c(arguments))
  28936. },
  28937. error: function() {
  28938. (function(e, t) {
  28939. if (u) {
  28940. var i = Array.prototype.slice.call(e).join(" ");
  28941. u.captureException(new Error(i), {
  28942. level: t,
  28943. path: n,
  28944. timestamp: h.timestamp()
  28945. })
  28946. }
  28947. }
  28948. )(arguments, "error"),
  28949. h.level >= h.levels.error && r.apply(console, c(arguments))
  28950. },
  28951. v3str: function(e, t) {
  28952. var i = void 0 === t ? 2 : t;
  28953. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  28954. },
  28955. eulstr: function(e, t) {
  28956. var i = void 0 === t ? 2 : t;
  28957. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  28958. },
  28959. time: function(e) {
  28960. h.level >= h.levels.debug && (s[e] = Date.now())
  28961. },
  28962. timeEnd: function(e) {
  28963. if (h.level >= h.levels.debug) {
  28964. var t = s[e];
  28965. if (!t)
  28966. return;
  28967. var i = (Date.now() - t) / 1e3;
  28968. this.debug(e, i + "s")
  28969. }
  28970. }
  28971. }
  28972. }
  28973. var u = window.Raven;
  28974. h.timestamp = function() {
  28975. return (Date.now() - window.navigationStart) / 1e3 + "s"
  28976. }
  28977. ,
  28978. h.level = (h.levels = {
  28979. debug: 3,
  28980. info: 2,
  28981. warn: 1,
  28982. error: 0
  28983. }).info,
  28984. t.exports = h
  28985. }
  28986. , {}],
  28987. 190: [function(e, t, i) {
  28988. "use strict";
  28989. var o = e("three")
  28990. , r = e("../enum/GLCubeFaces");
  28991. e("../constants");
  28992. t.exports = {
  28993. convertVisionVector: function(e) {
  28994. return new o.Vector3(e.x,e.z,-e.y)
  28995. },
  28996. convertVisionQuaternion: function(e) {
  28997. 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)))
  28998. },
  28999. convertWorkshopVector: function(e) {
  29000. return new o.Vector3(-e.x,e.y,e.z)
  29001. },
  29002. convertWorkshopQuaternion: function(e) {
  29003. 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))
  29004. },
  29005. convertWorkshopPanoramaQuaternion: function(e) {
  29006. 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)))
  29007. },
  29008. convertWorkshopOrthoZoom: function(e) {
  29009. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  29010. },
  29011. toPrecision: function(e, t) {
  29012. function i(e, t) {
  29013. var i = Math.pow(10, t);
  29014. return Math.round(e * i) / i
  29015. }
  29016. if (e instanceof Array) {
  29017. for (var n = 0; n < e.length; n++)
  29018. e[n] = i(e[n], t);
  29019. return e
  29020. }
  29021. return i(e, t)
  29022. },
  29023. isEmptyQuaternion: function(e) {
  29024. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  29025. },
  29026. projectPositionToCanvas: function(e, t, i) {
  29027. (i = i || new o.Vector3).copy(e);
  29028. var n = .5 * $("#player").width()
  29029. , r = .5 * $("#player").height();
  29030. return i.project(t),
  29031. i.x = i.x * n + n,
  29032. i.y = -i.y * r + r,
  29033. i
  29034. },
  29035. convertScreenPositionToNDC: function(e, t, i) {
  29036. return (i = i || new o.Vector2).x = e / $("#player").width() * 2 - 1,
  29037. i.y = -t / $("#player").height() * 2 + 1,
  29038. i
  29039. },
  29040. constrainedTurn: function(e) {
  29041. var t = e % (2 * Math.PI);
  29042. return t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  29043. },
  29044. getFOVDotThreshold: function(e) {
  29045. return Math.cos(o.Math.degToRad(e / 2))
  29046. },
  29047. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  29048. switch (e) {
  29049. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  29050. i.set(1, t.y, t.x);
  29051. break;
  29052. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  29053. i.set(-1, t.y, -t.x);
  29054. break;
  29055. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  29056. i.set(-t.x, 1, -t.y);
  29057. break;
  29058. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  29059. i.set(-t.x, -1, t.y);
  29060. break;
  29061. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  29062. i.set(-t.x, t.y, 1);
  29063. break;
  29064. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  29065. i.set(t.x, t.y, -1)
  29066. }
  29067. n && i.normalize()
  29068. },
  29069. //add:
  29070. getPos2d : function(point, camera, dom){
  29071. var camera = camera ;
  29072. var dom = dom;
  29073. 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);
  29074. var x,y;
  29075. x = (pos.x + 1) / 2 * dom.clientWidth;
  29076. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  29077. var inSight = x <= dom.clientWidth && x >= 0
  29078. && y <= dom.clientHeight && y >= 0
  29079. return {
  29080. pos: new THREE.Vector2(x,y),
  29081. vector: pos,
  29082. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  29083. inSight : inSight //在屏幕范围内可见
  29084. };
  29085. },
  29086. getDirByLonLat: function(lon, lat) {
  29087. var dir = new THREE.Vector3();
  29088. var phi = THREE.Math.degToRad(90 - lat);
  29089. var theta = THREE.Math.degToRad(lon);
  29090. dir.x = Math.sin(phi) * Math.cos(theta);
  29091. dir.y = Math.cos(phi);
  29092. dir.z = Math.sin(phi) * Math.sin(theta);
  29093. return dir.negate();
  29094. }
  29095. }
  29096. window.math = t.exports
  29097. }
  29098. , {
  29099. "../constants": 8,
  29100. "../enum/GLCubeFaces": 25,
  29101. three: 217
  29102. }],
  29103. 191: [function(e, t, i) {
  29104. "use strict";
  29105. function o(e) {
  29106. return r[e]
  29107. }
  29108. var n = e("../enum/GLCubeFaces")
  29109. , a = [0, 1, 2, 3, 4, 5]
  29110. , r = {
  29111. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  29112. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  29113. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  29114. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  29115. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  29116. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  29117. };
  29118. t.exports = {
  29119. mapFaceToCubemapFace: o,
  29120. getCubemapUrls: function(i, n, r) {
  29121. return a.map(function(e, t) {
  29122. return i.get("pan/" + r + "/" + n + "_skybox" + o(e) + ".jpg")
  29123. }
  29124. .bind(this))
  29125. }
  29126. }
  29127. }
  29128. , {
  29129. "../enum/GLCubeFaces": 25
  29130. }],
  29131. 192: [function(e, t, i) {
  29132. "use strict";
  29133. t.exports = {
  29134. captureErrors: function(e, t, i) {
  29135. if ("Raven"in window) {
  29136. Raven.config(e, t).install(),
  29137. i && Raven.setTagsContext(i);
  29138. var n = console.warn
  29139. , r = console.error;
  29140. console.warn = function() {
  29141. var e = Array.prototype.slice.call(arguments);
  29142. Raven.captureMessage(e.join(" "), {
  29143. level: "warning"
  29144. }),
  29145. n.apply(console, e)
  29146. }
  29147. ,
  29148. console.error = function() {
  29149. var e = Array.prototype.slice.call(arguments);
  29150. Raven.captureException(new Error(e.join(" ")), {
  29151. level: "error"
  29152. }),
  29153. r.apply(console, e)
  29154. }
  29155. } else
  29156. console.error("Raven not found, not capturing errors.")
  29157. }
  29158. }
  29159. }
  29160. , {}],
  29161. 193: [function(c, h, e) {
  29162. (function(e) {
  29163. "use strict";
  29164. var i, n = c("./browser"), r = c("../constants"), o = c("url"), t = c("./logger"), a = c("three"), s = new t(e), l = {
  29165. getAuthorizationHeader: function() {
  29166. var e = n.valueFromHash("auth");
  29167. if (e)
  29168. return e.replace(",", " ");
  29169. var t = n.valueFromCookie("token");
  29170. return t ? "Token " + t : null
  29171. },
  29172. parseSidUrl: function(e) {
  29173. var t, i;
  29174. if (t = g_Prefix,
  29175. (e = e || "").match(/^https?/)) {
  29176. o.parse(e);
  29177. t = g_Prefix,
  29178. i = e
  29179. } else
  29180. i = (t = g_Prefix) + "data/" + e;
  29181. return {
  29182. urlBase: t,
  29183. urlModel: i,
  29184. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  29185. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  29186. }
  29187. },
  29188. getModelIDFromQueryString: function() {
  29189. return n.valueFromHash("model") || n.valueFromHash("m")
  29190. },
  29191. /* normalizeModeldata: function(e, i) {
  29192. e = JSON.parse(JSON.stringify(e));
  29193. var n = null;
  29194. if (e.images.forEach(function(t) {
  29195. if (t.metadata) {
  29196. if ("string" == typeof t.metadata)
  29197. try {
  29198. t.metadata = JSON.parse(t.metadata)
  29199. } catch (e) {
  29200. s.warn("Unable to parse image metadata"),
  29201. t.metadata = null
  29202. }
  29203. else
  29204. "object" == typeof t.metadata && s.debug("image.metadata already a JSON object");
  29205. t.metadata.camera_position instanceof Array ? (t.metadata.camera_position = (new a.Vector3).fromArray(t.metadata.camera_position),
  29206. 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)),
  29207. t.metadata.camera_position && (t.metadata.camera_position = i.convertWorkshopVector(t.metadata.camera_position)),
  29208. t.metadata.zoom = t.metadata.zoom || 1),
  29209. !n && e.icon && e.icon === t.sid && (n = t.metadata)
  29210. }
  29211. }),
  29212. n && n.camera_quaternion && n.camera_position && n.scan_position && n.scan_quaternion) {
  29213. var t = {};
  29214. t.pano = {
  29215. quaternion: i.convertWorkshopPanoramaQuaternion(n.scan_quaternion),
  29216. position: i.convertWorkshopVector(n.scan_position),
  29217. uuid: n.scan_id
  29218. },
  29219. t.camera = {
  29220. quaternion: n.camera_quaternion,
  29221. position: n.camera_position
  29222. },
  29223. e.startPano = t
  29224. }
  29225. return e
  29226. }, */
  29227. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  29228. e = JSON.parse(JSON.stringify(e));
  29229. var i = null;
  29230. var deal = function(n) {
  29231. if(!n.metadata) return;
  29232. if ("string" == typeof n.metadata)
  29233. try {
  29234. n.metadata = JSON.parse(n.metadata)
  29235. } catch (e) {
  29236. s.warn("Unable to parse image metadata"),
  29237. n.metadata = null
  29238. }
  29239. else{
  29240. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  29241. }
  29242. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  29243. n.metadata.camera_position = new a.Vector3().fromArray(n.metadata.camera_position);
  29244. n.metadata.camera_quaternion = new a.Quaternion().fromArray(n.metadata.camera_quaternion);
  29245. }else{
  29246. n.metadata.camera_position = new a.Vector3().copy(n.metadata.camera_position)
  29247. n.metadata.camera_quaternion = new a.Quaternion().copy(n.metadata.camera_quaternion)
  29248. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  29249. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  29250. }
  29251. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  29252. }
  29253. //改
  29254. e.images.forEach(info=>{
  29255. if(info.locations){
  29256. info.locations.forEach(a=>deal(a))
  29257. }else{
  29258. deal(info)
  29259. }
  29260. })
  29261. //icon初始视角的:
  29262. if(i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  29263. var n = {};
  29264. n.pano = {
  29265. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  29266. position: t.convertWorkshopVector(i.scan_position),
  29267. uuid: i.scan_id
  29268. },
  29269. n.camera = {
  29270. quaternion: i.camera_quaternion,
  29271. position: i.camera_position
  29272. },
  29273. e.startPano = n
  29274. }
  29275. return e
  29276. },
  29277. visionVersionToInt: (i = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")),
  29278. function(e) {
  29279. if (!e)
  29280. throw new Error("Vision version is required");
  29281. var t = i.exec(e);
  29282. if (null === t)
  29283. throw new Error("String is not a vision version: " + e);
  29284. return parseInt(t[1])
  29285. }
  29286. ),
  29287. modelDataPromisesTiles: function(e) {
  29288. var t = e.vision_version || window.DATA.vision_version;
  29289. if (t)
  29290. try {
  29291. return l.visionVersionToInt(t) >= l.visionVersionToInt(r.visionTilingStartVersion)
  29292. } catch (e) {
  29293. s.warn("Invalid vision version: " + t)
  29294. }
  29295. return !1
  29296. }
  29297. };
  29298. h.exports = l
  29299. }
  29300. ).call(this, "/js/util/showcase.js")
  29301. }
  29302. , {
  29303. "../constants": 8,
  29304. "./browser": 182,
  29305. "./logger": 189,
  29306. three: 217,
  29307. url: 208
  29308. }],
  29309. 194: [function(e, t, i) {
  29310. "use strict";
  29311. var r = e("../util/ajax")
  29312. , o = e("three")
  29313. , a = e("../settings")
  29314. , s = {};
  29315. t.exports = {
  29316. load: function(e, t, i) {
  29317. var n = s[e];
  29318. return n ? t && setTimeout(function() {
  29319. t(n)
  29320. }, 1) : (n = new o.Texture,
  29321. a.minimalMemoryMode && (n.minFilter = o.LinearFilter,
  29322. n.magFilter = o.LinearFilter,
  29323. n.generateMipmaps = !1),
  29324. n.sourceFile = e,
  29325. s[e] = n,
  29326. r.getImage(e).then(function(e) {
  29327. n.image = e,
  29328. n.needsUpdate = !0,
  29329. t && t(n)
  29330. }).fail(i)),
  29331. n
  29332. },
  29333. loadBase64: function(e, t) {
  29334. t = t || "png";
  29335. var i = new o.Texture;
  29336. return i.image = document.createElement("img"),
  29337. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  29338. a.minimalMemoryMode && (i.minFilter = o.LinearFilter,
  29339. i.magFilter = o.LinearFilter,
  29340. i.generateMipmaps = !1),
  29341. i.needsUpdate = !0,
  29342. i
  29343. },
  29344. isLoaded: function(e) {
  29345. return !!s[e]
  29346. }
  29347. }
  29348. window.Texture = t.exports
  29349. }
  29350. , {
  29351. "../settings": 166,
  29352. "../util/ajax": 181,
  29353. three: 217
  29354. }],
  29355. 195: [function(e, t, i) {
  29356. "use strict";
  29357. var l = e("./easing");
  29358. window.transitions = t.exports = {
  29359. globalDone: null,
  29360. funcs: [],
  29361. counter: 0,
  29362. uniqueID: 0,
  29363. start: function(e, t, i, n, r, o, a) {
  29364. return n = n || 0,
  29365. this.funcs.push({
  29366. func: e,
  29367. current: -n * Math.abs(t),
  29368. duration: (1 - Math.max(n, 0)) * Math.abs(t),
  29369. done: i,
  29370. easing: r || l.linearTween,
  29371. cycling: t < 0,
  29372. running: !0,
  29373. debug: n < 0,
  29374. name: o || "T" + this.counter,
  29375. id: void 0 === a ? this.counter : a,
  29376. paused: !1
  29377. }),
  29378. e(0, 16),
  29379. this.counter += 1,
  29380. e
  29381. },
  29382. trigger: function(e) {
  29383. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  29384. , i = e.func || function() {}
  29385. , n = void 0 === e.duration ? 0 : e.duration;
  29386. void 0 !== e.cycling && e.cycling && (n = -Math.abs(n));
  29387. var r = e.done || null
  29388. , o = e.easing || l.linearTween
  29389. , a = e.name || "R" + this.counter
  29390. , s = void 0 === e.id ? this.counter : e.id;
  29391. return this.start(i, n, r, t, o, a, s)
  29392. },
  29393. setTimeout: function(e, t, i) {
  29394. var n = void 0 === i ? this.counter : i;
  29395. return this.trigger({
  29396. done: e,
  29397. duration: void 0 === t ? 0 : t,
  29398. name: "O" + this.counter,
  29399. id: n
  29400. })
  29401. },
  29402. pause: function() {
  29403. this.paused = !0
  29404. },
  29405. resume: function() {
  29406. this.paused = !1
  29407. },
  29408. update: function(n) {
  29409. this.funcs.forEach(function(e) {
  29410. if (!(e.paused || (e.current += 1e3 * n,
  29411. e.current < 0)))
  29412. if (e.current >= e.duration && !e.cycling) {
  29413. var t = e.easing(1, 0, 1, 1);
  29414. e.func(t, 1e3 * n),
  29415. e.done && e.done(),
  29416. e.running = !1
  29417. } else {
  29418. var i = e.easing(e.current % e.duration / e.duration, 0, 1, 1);
  29419. (e.func(i, 1e3 * n) || !1) && (e.done && e.done(),
  29420. e.running = !1)
  29421. }
  29422. });
  29423. var e = this.funcs.length;
  29424. this.funcs = this.funcs.filter(function(e) {
  29425. return e.running
  29426. });
  29427. var t = this.funcs.length;
  29428. if (0 < e && 0 === t && this.globalDone) {
  29429. var i = this.globalDone;
  29430. this.globalDone = null,
  29431. i()
  29432. }
  29433. },
  29434. adjustSpeed: function(e, t) {
  29435. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  29436. var r = i[n];
  29437. r.duration /= t,
  29438. r.current /= t
  29439. }
  29440. },
  29441. getById: function(t) {
  29442. return this.funcs.filter(function(e) {
  29443. return t === e.id
  29444. })
  29445. },
  29446. get: function(e) {
  29447. for (var t = 0; t < this.funcs.length; t += 1)
  29448. if (this.funcs[t].func === e)
  29449. return this.funcs[t];
  29450. return null
  29451. },
  29452. isRunning: function(e) {
  29453. var t = this.get(e);
  29454. return null !== t && t.running
  29455. },
  29456. countActive: function() {
  29457. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  29458. e += this.funcs[t].running;
  29459. return e
  29460. },
  29461. listActive: function() {
  29462. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  29463. this.funcs[t].running && e.push(this.funcs[t].name);
  29464. return e
  29465. },
  29466. done: function(e) {
  29467. this.globalDone = e
  29468. },
  29469. cancelById: function(e) {
  29470. var t = void 0 === e ? 0 : e;
  29471. this.funcs = this.funcs.filter(function(e) {
  29472. return e.id !== t
  29473. })
  29474. },
  29475. cancel: function(t) {
  29476. this.funcs = this.funcs.filter(function(e) {
  29477. return e.func !== t
  29478. })
  29479. },
  29480. getUniqueId: function() {
  29481. return this.uniqueID -= 1,
  29482. this.uniqueID
  29483. }
  29484. }
  29485. }
  29486. , {
  29487. "./easing": 186
  29488. }],
  29489. 196: [function(e, t, i) {
  29490. function n(e) {
  29491. if (this.set = {},
  29492. this.infContains = function() {
  29493. return !0
  29494. }
  29495. ,
  29496. "object" == typeof e)
  29497. if (e instanceof Array)
  29498. for (var t = 0; t < e.length; t++)
  29499. this.set[e[t]] = !0;
  29500. else
  29501. this.set = e;
  29502. else if ("function" == typeof e)
  29503. this.infContains = e;
  29504. else if (void 0 !== e)
  29505. throw new Error("set must be either an array or an object.")
  29506. }
  29507. (t.exports = n).prototype.has = n.prototype.contains = function(e) {
  29508. return !!this.set[e]
  29509. }
  29510. ,
  29511. n.prototype.add = function(e) {
  29512. if (1 == arguments.length)
  29513. this.set[e] = !0;
  29514. else
  29515. for (var t = 0; t < arguments.length; t++)
  29516. this.set[arguments[t]] = !0
  29517. }
  29518. ,
  29519. n.prototype.addAll = function(e) {
  29520. if ("object" != typeof e && !(e instanceof Array))
  29521. throw new Error("arr must be an array.");
  29522. for (var t = 0; t < e.length; t++)
  29523. this.add(e[t])
  29524. }
  29525. ,
  29526. n.prototype.delete = n.prototype.remove = function(e) {
  29527. if (1 == arguments.length)
  29528. delete this.set[e];
  29529. else
  29530. for (var t = 0; t < arguments.length; t++)
  29531. delete this.set[arguments[t]]
  29532. }
  29533. ,
  29534. n.prototype.clear = function() {
  29535. this.set = {}
  29536. }
  29537. ,
  29538. n.prototype.size = function() {
  29539. return Object.keys(this.set).length
  29540. }
  29541. ,
  29542. n.prototype.toString = function() {
  29543. return "{" + Object.keys(this.set).toString() + "}"
  29544. }
  29545. ,
  29546. n.prototype["*values"] = n.prototype.toArray = function() {
  29547. return void 0 === this.set ? [] : Object.keys(this.set)
  29548. }
  29549. }
  29550. , {}],
  29551. 197: [function(e, t, i) {}
  29552. , {}],
  29553. 198: [function(N, e, F) {
  29554. (function(e) {
  29555. "use strict";
  29556. function i() {
  29557. return u.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  29558. }
  29559. function o(e, t) {
  29560. if (i() < t)
  29561. throw new RangeError("Invalid typed array length");
  29562. return u.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t)).__proto__ = u.prototype : (null === e && (e = new u(t)),
  29563. e.length = t),
  29564. e
  29565. }
  29566. function u(e, t, i) {
  29567. if (!(u.TYPED_ARRAY_SUPPORT || this instanceof u))
  29568. return new u(e,t,i);
  29569. if ("number" != typeof e)
  29570. return n(this, e, t, i);
  29571. if ("string" == typeof t)
  29572. throw new Error("If encoding is specified then the first argument must be a string");
  29573. return a(this, e)
  29574. }
  29575. function n(e, t, i, n) {
  29576. if ("number" == typeof t)
  29577. throw new TypeError('"value" argument must not be a number');
  29578. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? function(e, t, i, n) {
  29579. if (t.byteLength,
  29580. i < 0 || t.byteLength < i)
  29581. throw new RangeError("'offset' is out of bounds");
  29582. if (t.byteLength < i + (n || 0))
  29583. throw new RangeError("'length' is out of bounds");
  29584. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  29585. u.TYPED_ARRAY_SUPPORT ? (e = t).__proto__ = u.prototype : e = s(e, t),
  29586. e
  29587. }(e, t, i, n) : "string" == typeof t ? function(e, t, i) {
  29588. if ("string" == typeof i && "" !== i || (i = "utf8"),
  29589. !u.isEncoding(i))
  29590. throw new TypeError('"encoding" must be a valid string encoding');
  29591. var n = 0 | c(t, i)
  29592. , r = (e = o(e, n)).write(t, i);
  29593. return r !== n && (e = e.slice(0, r)),
  29594. e
  29595. }(e, t, i) : function(e, t) {
  29596. if (u.isBuffer(t)) {
  29597. var i = 0 | l(t.length);
  29598. return 0 === (e = o(e, i)).length || t.copy(e, 0, 0, i),
  29599. e
  29600. }
  29601. if (t) {
  29602. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  29603. return "number" != typeof t.length || function(e) {
  29604. return e != e
  29605. }(t.length) ? o(e, 0) : s(e, t);
  29606. if ("Buffer" === t.type && L(t.data))
  29607. return s(e, t.data)
  29608. }
  29609. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  29610. }(e, t)
  29611. }
  29612. function r(e) {
  29613. if ("number" != typeof e)
  29614. throw new TypeError('"size" argument must be a number');
  29615. if (e < 0)
  29616. throw new RangeError('"size" argument must not be negative')
  29617. }
  29618. function a(e, t) {
  29619. if (r(t),
  29620. e = o(e, t < 0 ? 0 : 0 | l(t)),
  29621. !u.TYPED_ARRAY_SUPPORT)
  29622. for (var i = 0; i < t; ++i)
  29623. e[i] = 0;
  29624. return e
  29625. }
  29626. function s(e, t) {
  29627. var i = t.length < 0 ? 0 : 0 | l(t.length);
  29628. e = o(e, i);
  29629. for (var n = 0; n < i; n += 1)
  29630. e[n] = 255 & t[n];
  29631. return e
  29632. }
  29633. function l(e) {
  29634. if (e >= i())
  29635. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i().toString(16) + " bytes");
  29636. return 0 | e
  29637. }
  29638. function c(e, t) {
  29639. if (u.isBuffer(e))
  29640. return e.length;
  29641. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  29642. return e.byteLength;
  29643. "string" != typeof e && (e = "" + e);
  29644. var i = e.length;
  29645. if (0 === i)
  29646. return 0;
  29647. for (var n = !1; ; )
  29648. switch (t) {
  29649. case "ascii":
  29650. case "latin1":
  29651. case "binary":
  29652. return i;
  29653. case "utf8":
  29654. case "utf-8":
  29655. case void 0:
  29656. return S(e).length;
  29657. case "ucs2":
  29658. case "ucs-2":
  29659. case "utf16le":
  29660. case "utf-16le":
  29661. return 2 * i;
  29662. case "hex":
  29663. return i >>> 1;
  29664. case "base64":
  29665. return M(e).length;
  29666. default:
  29667. if (n)
  29668. return S(e).length;
  29669. t = ("" + t).toLowerCase(),
  29670. n = !0
  29671. }
  29672. }
  29673. function h(e, t, i) {
  29674. var n = e[t];
  29675. e[t] = e[i],
  29676. e[i] = n
  29677. }
  29678. function d(e, t, i, n, r) {
  29679. if (0 === e.length)
  29680. return -1;
  29681. if ("string" == typeof i ? (n = i,
  29682. i = 0) : 2147483647 < i ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  29683. i = +i,
  29684. isNaN(i) && (i = r ? 0 : e.length - 1),
  29685. i < 0 && (i = e.length + i),
  29686. i >= e.length) {
  29687. if (r)
  29688. return -1;
  29689. i = e.length - 1
  29690. } else if (i < 0) {
  29691. if (!r)
  29692. return -1;
  29693. i = 0
  29694. }
  29695. if ("string" == typeof t && (t = u.from(t, n)),
  29696. u.isBuffer(t))
  29697. return 0 === t.length ? -1 : p(e, t, i, n, r);
  29698. if ("number" == typeof t)
  29699. return t &= 255,
  29700. 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);
  29701. throw new TypeError("val must be string, number or Buffer")
  29702. }
  29703. function p(e, t, i, n, r) {
  29704. function o(e, t) {
  29705. return 1 === s ? e[t] : e.readUInt16BE(t * s)
  29706. }
  29707. var a, s = 1, l = e.length, c = t.length;
  29708. if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  29709. if (e.length < 2 || t.length < 2)
  29710. return -1;
  29711. l /= s = 2,
  29712. c /= 2,
  29713. i /= 2
  29714. }
  29715. if (r) {
  29716. var h = -1;
  29717. for (a = i; a < l; a++)
  29718. if (o(e, a) === o(t, -1 === h ? 0 : a - h)) {
  29719. if (-1 === h && (h = a),
  29720. a - h + 1 === c)
  29721. return h * s
  29722. } else
  29723. -1 !== h && (a -= a - h),
  29724. h = -1
  29725. } else
  29726. for (l < i + c && (i = l - c),
  29727. a = i; 0 <= a; a--) {
  29728. for (var u = !0, d = 0; d < c; d++)
  29729. if (o(e, a + d) !== o(t, d)) {
  29730. u = !1;
  29731. break
  29732. }
  29733. if (u)
  29734. return a
  29735. }
  29736. return -1
  29737. }
  29738. function g(e, t, i, n) {
  29739. i = Number(i) || 0;
  29740. var r = e.length - i;
  29741. n ? r < (n = Number(n)) && (n = r) : n = r;
  29742. var o = t.length;
  29743. if (o % 2 != 0)
  29744. throw new TypeError("Invalid hex string");
  29745. o / 2 < n && (n = o / 2);
  29746. for (var a = 0; a < n; ++a) {
  29747. var s = parseInt(t.substr(2 * a, 2), 16);
  29748. if (isNaN(s))
  29749. return a;
  29750. e[i + a] = s
  29751. }
  29752. return a
  29753. }
  29754. function m(e, t, i, n) {
  29755. return R(function(e) {
  29756. for (var t = [], i = 0; i < e.length; ++i)
  29757. t.push(255 & e.charCodeAt(i));
  29758. return t
  29759. }(t), e, i, n)
  29760. }
  29761. function f(e, t, i) {
  29762. i = Math.min(e.length, i);
  29763. for (var n = [], r = t; r < i; ) {
  29764. var o, a, s, l, c = e[r], h = null, u = 239 < c ? 4 : 223 < c ? 3 : 191 < c ? 2 : 1;
  29765. if (r + u <= i)
  29766. switch (u) {
  29767. case 1:
  29768. c < 128 && (h = c);
  29769. break;
  29770. case 2:
  29771. 128 == (192 & (o = e[r + 1])) && (127 < (l = (31 & c) << 6 | 63 & o) && (h = l));
  29772. break;
  29773. case 3:
  29774. o = e[r + 1],
  29775. a = e[r + 2],
  29776. 128 == (192 & o) && 128 == (192 & a) && (2047 < (l = (15 & c) << 12 | (63 & o) << 6 | 63 & a) && (l < 55296 || 57343 < l) && (h = l));
  29777. break;
  29778. case 4:
  29779. o = e[r + 1],
  29780. a = e[r + 2],
  29781. s = e[r + 3],
  29782. 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))
  29783. }
  29784. null === h ? (h = 65533,
  29785. u = 1) : 65535 < h && (h -= 65536,
  29786. n.push(h >>> 10 & 1023 | 55296),
  29787. h = 56320 | 1023 & h),
  29788. n.push(h),
  29789. r += u
  29790. }
  29791. return function(e) {
  29792. var t = e.length;
  29793. if (t <= D)
  29794. return String.fromCharCode.apply(String, e);
  29795. for (var i = "", n = 0; n < t; )
  29796. i += String.fromCharCode.apply(String, e.slice(n, n += D));
  29797. return i
  29798. }(n)
  29799. }
  29800. function v(e, t, i) {
  29801. var n = "";
  29802. i = Math.min(e.length, i);
  29803. for (var r = t; r < i; ++r)
  29804. n += String.fromCharCode(127 & e[r]);
  29805. return n
  29806. }
  29807. function y(e, t, i) {
  29808. var n = "";
  29809. i = Math.min(e.length, i);
  29810. for (var r = t; r < i; ++r)
  29811. n += String.fromCharCode(e[r]);
  29812. return n
  29813. }
  29814. function A(e, t, i) {
  29815. var n, r = e.length;
  29816. (!t || t < 0) && (t = 0),
  29817. (!i || i < 0 || r < i) && (i = r);
  29818. for (var o = "", a = t; a < i; ++a)
  29819. o += (n = e[a]) < 16 ? "0" + n.toString(16) : n.toString(16);
  29820. return o
  29821. }
  29822. function C(e, t, i) {
  29823. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  29824. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  29825. return r
  29826. }
  29827. function I(e, t, i) {
  29828. if (e % 1 != 0 || e < 0)
  29829. throw new RangeError("offset is not uint");
  29830. if (i < e + t)
  29831. throw new RangeError("Trying to access beyond buffer length")
  29832. }
  29833. function E(e, t, i, n, r, o) {
  29834. if (!u.isBuffer(e))
  29835. throw new TypeError('"buffer" argument must be a Buffer instance');
  29836. if (r < t || t < o)
  29837. throw new RangeError('"value" argument is out of bounds');
  29838. if (i + n > e.length)
  29839. throw new RangeError("Index out of range")
  29840. }
  29841. function _(e, t, i, n) {
  29842. t < 0 && (t = 65535 + t + 1);
  29843. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  29844. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  29845. }
  29846. function b(e, t, i, n) {
  29847. t < 0 && (t = 4294967295 + t + 1);
  29848. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  29849. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  29850. }
  29851. function w(e, t, i, n) {
  29852. if (i + n > e.length)
  29853. throw new RangeError("Index out of range");
  29854. if (i < 0)
  29855. throw new RangeError("Index out of range")
  29856. }
  29857. function T(e, t, i, n, r) {
  29858. return r || w(e, 0, i, 4),
  29859. O.write(e, t, i, n, 23, 4),
  29860. i + 4
  29861. }
  29862. function x(e, t, i, n, r) {
  29863. return r || w(e, 0, i, 8),
  29864. O.write(e, t, i, n, 52, 8),
  29865. i + 8
  29866. }
  29867. function S(e, t) {
  29868. t = t || 1 / 0;
  29869. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  29870. if (55295 < (i = e.charCodeAt(a)) && i < 57344) {
  29871. if (!r) {
  29872. if (56319 < i) {
  29873. -1 < (t -= 3) && o.push(239, 191, 189);
  29874. continue
  29875. }
  29876. if (a + 1 === n) {
  29877. -1 < (t -= 3) && o.push(239, 191, 189);
  29878. continue
  29879. }
  29880. r = i;
  29881. continue
  29882. }
  29883. if (i < 56320) {
  29884. -1 < (t -= 3) && o.push(239, 191, 189),
  29885. r = i;
  29886. continue
  29887. }
  29888. i = 65536 + (r - 55296 << 10 | i - 56320)
  29889. } else
  29890. r && -1 < (t -= 3) && o.push(239, 191, 189);
  29891. if (r = null,
  29892. i < 128) {
  29893. if ((t -= 1) < 0)
  29894. break;
  29895. o.push(i)
  29896. } else if (i < 2048) {
  29897. if ((t -= 2) < 0)
  29898. break;
  29899. o.push(i >> 6 | 192, 63 & i | 128)
  29900. } else if (i < 65536) {
  29901. if ((t -= 3) < 0)
  29902. break;
  29903. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  29904. } else {
  29905. if (!(i < 1114112))
  29906. throw new Error("Invalid code point");
  29907. if ((t -= 4) < 0)
  29908. break;
  29909. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  29910. }
  29911. }
  29912. return o
  29913. }
  29914. function M(e) {
  29915. return P.toByteArray(function(e) {
  29916. if ((e = function(e) {
  29917. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  29918. }(e).replace(t, "")).length < 2)
  29919. return "";
  29920. for (; e.length % 4 != 0; )
  29921. e += "=";
  29922. return e
  29923. }(e))
  29924. }
  29925. function R(e, t, i, n) {
  29926. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  29927. t[r + i] = e[r];
  29928. return r
  29929. }
  29930. var P = N("base64-js")
  29931. , O = N("ieee754")
  29932. , L = N("isarray");
  29933. F.Buffer = u,
  29934. F.SlowBuffer = function(e) {
  29935. return +e != e && (e = 0),
  29936. u.alloc(+e)
  29937. }
  29938. ,
  29939. F.INSPECT_MAX_BYTES = 50,
  29940. u.TYPED_ARRAY_SUPPORT = void 0 !== e.TYPED_ARRAY_SUPPORT ? e.TYPED_ARRAY_SUPPORT : function() {
  29941. try {
  29942. var e = new Uint8Array(1);
  29943. return e.__proto__ = {
  29944. __proto__: Uint8Array.prototype,
  29945. foo: function() {
  29946. return 42
  29947. }
  29948. },
  29949. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  29950. } catch (e) {
  29951. return !1
  29952. }
  29953. }(),
  29954. F.kMaxLength = i(),
  29955. u.poolSize = 8192,
  29956. u._augment = function(e) {
  29957. return e.__proto__ = u.prototype,
  29958. e
  29959. }
  29960. ,
  29961. u.from = function(e, t, i) {
  29962. return n(null, e, t, i)
  29963. }
  29964. ,
  29965. u.TYPED_ARRAY_SUPPORT && (u.prototype.__proto__ = Uint8Array.prototype,
  29966. u.__proto__ = Uint8Array,
  29967. "undefined" != typeof Symbol && Symbol.species && u[Symbol.species] === u && Object.defineProperty(u, Symbol.species, {
  29968. value: null,
  29969. configurable: !0
  29970. })),
  29971. u.alloc = function(e, t, i) {
  29972. return function(e, t, i, n) {
  29973. return r(t),
  29974. 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)
  29975. }(null, e, t, i)
  29976. }
  29977. ,
  29978. u.allocUnsafe = function(e) {
  29979. return a(null, e)
  29980. }
  29981. ,
  29982. u.allocUnsafeSlow = function(e) {
  29983. return a(null, e)
  29984. }
  29985. ,
  29986. u.isBuffer = function(e) {
  29987. return !(null == e || !e._isBuffer)
  29988. }
  29989. ,
  29990. u.compare = function(e, t) {
  29991. if (!u.isBuffer(e) || !u.isBuffer(t))
  29992. throw new TypeError("Arguments must be Buffers");
  29993. if (e === t)
  29994. return 0;
  29995. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  29996. if (e[r] !== t[r]) {
  29997. i = e[r],
  29998. n = t[r];
  29999. break
  30000. }
  30001. return i < n ? -1 : n < i ? 1 : 0
  30002. }
  30003. ,
  30004. u.isEncoding = function(e) {
  30005. switch (String(e).toLowerCase()) {
  30006. case "hex":
  30007. case "utf8":
  30008. case "utf-8":
  30009. case "ascii":
  30010. case "latin1":
  30011. case "binary":
  30012. case "base64":
  30013. case "ucs2":
  30014. case "ucs-2":
  30015. case "utf16le":
  30016. case "utf-16le":
  30017. return !0;
  30018. default:
  30019. return !1
  30020. }
  30021. }
  30022. ,
  30023. u.concat = function(e, t) {
  30024. if (!L(e))
  30025. throw new TypeError('"list" argument must be an Array of Buffers');
  30026. if (0 === e.length)
  30027. return u.alloc(0);
  30028. var i;
  30029. if (void 0 === t)
  30030. for (i = t = 0; i < e.length; ++i)
  30031. t += e[i].length;
  30032. var n = u.allocUnsafe(t)
  30033. , r = 0;
  30034. for (i = 0; i < e.length; ++i) {
  30035. var o = e[i];
  30036. if (!u.isBuffer(o))
  30037. throw new TypeError('"list" argument must be an Array of Buffers');
  30038. o.copy(n, r),
  30039. r += o.length
  30040. }
  30041. return n
  30042. }
  30043. ,
  30044. u.byteLength = c,
  30045. u.prototype._isBuffer = !0,
  30046. u.prototype.swap16 = function() {
  30047. var e = this.length;
  30048. if (e % 2 != 0)
  30049. throw new RangeError("Buffer size must be a multiple of 16-bits");
  30050. for (var t = 0; t < e; t += 2)
  30051. h(this, t, t + 1);
  30052. return this
  30053. }
  30054. ,
  30055. u.prototype.swap32 = function() {
  30056. var e = this.length;
  30057. if (e % 4 != 0)
  30058. throw new RangeError("Buffer size must be a multiple of 32-bits");
  30059. for (var t = 0; t < e; t += 4)
  30060. h(this, t, t + 3),
  30061. h(this, t + 1, t + 2);
  30062. return this
  30063. }
  30064. ,
  30065. u.prototype.swap64 = function() {
  30066. var e = this.length;
  30067. if (e % 8 != 0)
  30068. throw new RangeError("Buffer size must be a multiple of 64-bits");
  30069. for (var t = 0; t < e; t += 8)
  30070. h(this, t, t + 7),
  30071. h(this, t + 1, t + 6),
  30072. h(this, t + 2, t + 5),
  30073. h(this, t + 3, t + 4);
  30074. return this
  30075. }
  30076. ,
  30077. u.prototype.toString = function() {
  30078. var e = 0 | this.length;
  30079. return 0 == e ? "" : 0 === arguments.length ? f(this, 0, e) : function(e, t, i) {
  30080. var n, r, o, a = !1;
  30081. if ((void 0 === t || t < 0) && (t = 0),
  30082. t > this.length)
  30083. return "";
  30084. if ((void 0 === i || i > this.length) && (i = this.length),
  30085. i <= 0)
  30086. return "";
  30087. if ((i >>>= 0) <= (t >>>= 0))
  30088. return "";
  30089. for (e = e || "utf8"; ; )
  30090. switch (e) {
  30091. case "hex":
  30092. return A(this, t, i);
  30093. case "utf8":
  30094. case "utf-8":
  30095. return f(this, t, i);
  30096. case "ascii":
  30097. return v(this, t, i);
  30098. case "latin1":
  30099. case "binary":
  30100. return y(this, t, i);
  30101. case "base64":
  30102. return n = this,
  30103. o = i,
  30104. 0 === (r = t) && o === n.length ? P.fromByteArray(n) : P.fromByteArray(n.slice(r, o));
  30105. case "ucs2":
  30106. case "ucs-2":
  30107. case "utf16le":
  30108. case "utf-16le":
  30109. return C(this, t, i);
  30110. default:
  30111. if (a)
  30112. throw new TypeError("Unknown encoding: " + e);
  30113. e = (e + "").toLowerCase(),
  30114. a = !0
  30115. }
  30116. }
  30117. .apply(this, arguments)
  30118. }
  30119. ,
  30120. u.prototype.equals = function(e) {
  30121. if (!u.isBuffer(e))
  30122. throw new TypeError("Argument must be a Buffer");
  30123. return this === e || 0 === u.compare(this, e)
  30124. }
  30125. ,
  30126. u.prototype.inspect = function() {
  30127. var e = ""
  30128. , t = F.INSPECT_MAX_BYTES;
  30129. return 0 < this.length && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  30130. this.length > t && (e += " ... ")),
  30131. "<Buffer " + e + ">"
  30132. }
  30133. ,
  30134. u.prototype.compare = function(e, t, i, n, r) {
  30135. if (!u.isBuffer(e))
  30136. throw new TypeError("Argument must be a Buffer");
  30137. if (void 0 === t && (t = 0),
  30138. void 0 === i && (i = e ? e.length : 0),
  30139. void 0 === n && (n = 0),
  30140. void 0 === r && (r = this.length),
  30141. t < 0 || i > e.length || n < 0 || r > this.length)
  30142. throw new RangeError("out of range index");
  30143. if (r <= n && i <= t)
  30144. return 0;
  30145. if (r <= n)
  30146. return -1;
  30147. if (i <= t)
  30148. return 1;
  30149. if (this === e)
  30150. return 0;
  30151. 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)
  30152. if (l[h] !== c[h]) {
  30153. o = l[h],
  30154. a = c[h];
  30155. break
  30156. }
  30157. return o < a ? -1 : a < o ? 1 : 0
  30158. }
  30159. ,
  30160. u.prototype.includes = function(e, t, i) {
  30161. return -1 !== this.indexOf(e, t, i)
  30162. }
  30163. ,
  30164. u.prototype.indexOf = function(e, t, i) {
  30165. return d(this, e, t, i, !0)
  30166. }
  30167. ,
  30168. u.prototype.lastIndexOf = function(e, t, i) {
  30169. return d(this, e, t, i, !1)
  30170. }
  30171. ,
  30172. u.prototype.write = function(e, t, i, n) {
  30173. if (void 0 === t)
  30174. n = "utf8",
  30175. i = this.length,
  30176. t = 0;
  30177. else if (void 0 === i && "string" == typeof t)
  30178. n = t,
  30179. i = this.length,
  30180. t = 0;
  30181. else {
  30182. if (!isFinite(t))
  30183. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  30184. t |= 0,
  30185. isFinite(i) ? (i |= 0,
  30186. void 0 === n && (n = "utf8")) : (n = i,
  30187. i = void 0)
  30188. }
  30189. var r, o, a, s, l, c, h, u, d, p = this.length - t;
  30190. if ((void 0 === i || p < i) && (i = p),
  30191. 0 < e.length && (i < 0 || t < 0) || t > this.length)
  30192. throw new RangeError("Attempt to write outside buffer bounds");
  30193. n = n || "utf8";
  30194. for (var f = !1; ; )
  30195. switch (n) {
  30196. case "hex":
  30197. return g(this, e, t, i);
  30198. case "utf8":
  30199. case "utf-8":
  30200. return u = t,
  30201. d = i,
  30202. R(S(e, (h = this).length - u), h, u, d);
  30203. case "ascii":
  30204. return m(this, e, t, i);
  30205. case "latin1":
  30206. case "binary":
  30207. return m(this, e, t, i);
  30208. case "base64":
  30209. return s = this,
  30210. l = t,
  30211. c = i,
  30212. R(M(e), s, l, c);
  30213. case "ucs2":
  30214. case "ucs-2":
  30215. case "utf16le":
  30216. case "utf-16le":
  30217. return o = t,
  30218. a = i,
  30219. R(function(e, t) {
  30220. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  30221. i = e.charCodeAt(a),
  30222. n = i >> 8,
  30223. r = i % 256,
  30224. o.push(r),
  30225. o.push(n);
  30226. return o
  30227. }(e, (r = this).length - o), r, o, a);
  30228. default:
  30229. if (f)
  30230. throw new TypeError("Unknown encoding: " + n);
  30231. n = ("" + n).toLowerCase(),
  30232. f = !0
  30233. }
  30234. }
  30235. ,
  30236. u.prototype.toJSON = function() {
  30237. return {
  30238. type: "Buffer",
  30239. data: Array.prototype.slice.call(this._arr || this, 0)
  30240. }
  30241. }
  30242. ;
  30243. var D = 4096;
  30244. u.prototype.slice = function(e, t) {
  30245. var i, n = this.length;
  30246. if ((e = ~~e) < 0 ? (e += n) < 0 && (e = 0) : n < e && (e = n),
  30247. (t = void 0 === t ? n : ~~t) < 0 ? (t += n) < 0 && (t = 0) : n < t && (t = n),
  30248. t < e && (t = e),
  30249. u.TYPED_ARRAY_SUPPORT)
  30250. (i = this.subarray(e, t)).__proto__ = u.prototype;
  30251. else {
  30252. var r = t - e;
  30253. i = new u(r,void 0);
  30254. for (var o = 0; o < r; ++o)
  30255. i[o] = this[o + e]
  30256. }
  30257. return i
  30258. }
  30259. ,
  30260. u.prototype.readUIntLE = function(e, t, i) {
  30261. e |= 0,
  30262. t |= 0,
  30263. i || I(e, t, this.length);
  30264. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30265. n += this[e + o] * r;
  30266. return n
  30267. }
  30268. ,
  30269. u.prototype.readUIntBE = function(e, t, i) {
  30270. e |= 0,
  30271. t |= 0,
  30272. i || I(e, t, this.length);
  30273. for (var n = this[e + --t], r = 1; 0 < t && (r *= 256); )
  30274. n += this[e + --t] * r;
  30275. return n
  30276. }
  30277. ,
  30278. u.prototype.readUInt8 = function(e, t) {
  30279. return t || I(e, 1, this.length),
  30280. this[e]
  30281. }
  30282. ,
  30283. u.prototype.readUInt16LE = function(e, t) {
  30284. return t || I(e, 2, this.length),
  30285. this[e] | this[e + 1] << 8
  30286. }
  30287. ,
  30288. u.prototype.readUInt16BE = function(e, t) {
  30289. return t || I(e, 2, this.length),
  30290. this[e] << 8 | this[e + 1]
  30291. }
  30292. ,
  30293. u.prototype.readUInt32LE = function(e, t) {
  30294. return t || I(e, 4, this.length),
  30295. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  30296. }
  30297. ,
  30298. u.prototype.readUInt32BE = function(e, t) {
  30299. return t || I(e, 4, this.length),
  30300. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  30301. }
  30302. ,
  30303. u.prototype.readIntLE = function(e, t, i) {
  30304. e |= 0,
  30305. t |= 0,
  30306. i || I(e, t, this.length);
  30307. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30308. n += this[e + o] * r;
  30309. return (r *= 128) <= n && (n -= Math.pow(2, 8 * t)),
  30310. n
  30311. }
  30312. ,
  30313. u.prototype.readIntBE = function(e, t, i) {
  30314. e |= 0,
  30315. t |= 0,
  30316. i || I(e, t, this.length);
  30317. for (var n = t, r = 1, o = this[e + --n]; 0 < n && (r *= 256); )
  30318. o += this[e + --n] * r;
  30319. return (r *= 128) <= o && (o -= Math.pow(2, 8 * t)),
  30320. o
  30321. }
  30322. ,
  30323. u.prototype.readInt8 = function(e, t) {
  30324. return t || I(e, 1, this.length),
  30325. 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
  30326. }
  30327. ,
  30328. u.prototype.readInt16LE = function(e, t) {
  30329. t || I(e, 2, this.length);
  30330. var i = this[e] | this[e + 1] << 8;
  30331. return 32768 & i ? 4294901760 | i : i
  30332. }
  30333. ,
  30334. u.prototype.readInt16BE = function(e, t) {
  30335. t || I(e, 2, this.length);
  30336. var i = this[e + 1] | this[e] << 8;
  30337. return 32768 & i ? 4294901760 | i : i
  30338. }
  30339. ,
  30340. u.prototype.readInt32LE = function(e, t) {
  30341. return t || I(e, 4, this.length),
  30342. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  30343. }
  30344. ,
  30345. u.prototype.readInt32BE = function(e, t) {
  30346. return t || I(e, 4, this.length),
  30347. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  30348. }
  30349. ,
  30350. u.prototype.readFloatLE = function(e, t) {
  30351. return t || I(e, 4, this.length),
  30352. O.read(this, e, !0, 23, 4)
  30353. }
  30354. ,
  30355. u.prototype.readFloatBE = function(e, t) {
  30356. return t || I(e, 4, this.length),
  30357. O.read(this, e, !1, 23, 4)
  30358. }
  30359. ,
  30360. u.prototype.readDoubleLE = function(e, t) {
  30361. return t || I(e, 8, this.length),
  30362. O.read(this, e, !0, 52, 8)
  30363. }
  30364. ,
  30365. u.prototype.readDoubleBE = function(e, t) {
  30366. return t || I(e, 8, this.length),
  30367. O.read(this, e, !1, 52, 8)
  30368. }
  30369. ,
  30370. u.prototype.writeUIntLE = function(e, t, i, n) {
  30371. e = +e,
  30372. t |= 0,
  30373. i |= 0,
  30374. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30375. var r = 1
  30376. , o = 0;
  30377. for (this[t] = 255 & e; ++o < i && (r *= 256); )
  30378. this[t + o] = e / r & 255;
  30379. return t + i
  30380. }
  30381. ,
  30382. u.prototype.writeUIntBE = function(e, t, i, n) {
  30383. e = +e,
  30384. t |= 0,
  30385. i |= 0,
  30386. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30387. var r = i - 1
  30388. , o = 1;
  30389. for (this[t + r] = 255 & e; 0 <= --r && (o *= 256); )
  30390. this[t + r] = e / o & 255;
  30391. return t + i
  30392. }
  30393. ,
  30394. u.prototype.writeUInt8 = function(e, t, i) {
  30395. return e = +e,
  30396. t |= 0,
  30397. i || E(this, e, t, 1, 255, 0),
  30398. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30399. this[t] = 255 & e,
  30400. t + 1
  30401. }
  30402. ,
  30403. u.prototype.writeUInt16LE = function(e, t, i) {
  30404. return e = +e,
  30405. t |= 0,
  30406. i || E(this, e, t, 2, 65535, 0),
  30407. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30408. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30409. t + 2
  30410. }
  30411. ,
  30412. u.prototype.writeUInt16BE = function(e, t, i) {
  30413. return e = +e,
  30414. t |= 0,
  30415. i || E(this, e, t, 2, 65535, 0),
  30416. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30417. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30418. t + 2
  30419. }
  30420. ,
  30421. u.prototype.writeUInt32LE = function(e, t, i) {
  30422. return e = +e,
  30423. t |= 0,
  30424. i || E(this, e, t, 4, 4294967295, 0),
  30425. u.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  30426. this[t + 2] = e >>> 16,
  30427. this[t + 1] = e >>> 8,
  30428. this[t] = 255 & e) : b(this, e, t, !0),
  30429. t + 4
  30430. }
  30431. ,
  30432. u.prototype.writeUInt32BE = function(e, t, i) {
  30433. return e = +e,
  30434. t |= 0,
  30435. i || E(this, e, t, 4, 4294967295, 0),
  30436. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30437. this[t + 1] = e >>> 16,
  30438. this[t + 2] = e >>> 8,
  30439. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30440. t + 4
  30441. }
  30442. ,
  30443. u.prototype.writeIntLE = function(e, t, i, n) {
  30444. if (e = +e,
  30445. t |= 0,
  30446. !n) {
  30447. var r = Math.pow(2, 8 * i - 1);
  30448. E(this, e, t, i, r - 1, -r)
  30449. }
  30450. var o = 0
  30451. , a = 1
  30452. , s = 0;
  30453. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  30454. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  30455. this[t + o] = (e / a >> 0) - s & 255;
  30456. return t + i
  30457. }
  30458. ,
  30459. u.prototype.writeIntBE = function(e, t, i, n) {
  30460. if (e = +e,
  30461. t |= 0,
  30462. !n) {
  30463. var r = Math.pow(2, 8 * i - 1);
  30464. E(this, e, t, i, r - 1, -r)
  30465. }
  30466. var o = i - 1
  30467. , a = 1
  30468. , s = 0;
  30469. for (this[t + o] = 255 & e; 0 <= --o && (a *= 256); )
  30470. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  30471. this[t + o] = (e / a >> 0) - s & 255;
  30472. return t + i
  30473. }
  30474. ,
  30475. u.prototype.writeInt8 = function(e, t, i) {
  30476. return e = +e,
  30477. t |= 0,
  30478. i || E(this, e, t, 1, 127, -128),
  30479. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30480. e < 0 && (e = 255 + e + 1),
  30481. this[t] = 255 & e,
  30482. t + 1
  30483. }
  30484. ,
  30485. u.prototype.writeInt16LE = function(e, t, i) {
  30486. return e = +e,
  30487. t |= 0,
  30488. i || E(this, e, t, 2, 32767, -32768),
  30489. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30490. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30491. t + 2
  30492. }
  30493. ,
  30494. u.prototype.writeInt16BE = function(e, t, i) {
  30495. return e = +e,
  30496. t |= 0,
  30497. i || E(this, e, t, 2, 32767, -32768),
  30498. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30499. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30500. t + 2
  30501. }
  30502. ,
  30503. u.prototype.writeInt32LE = function(e, t, i) {
  30504. return e = +e,
  30505. t |= 0,
  30506. i || E(this, e, t, 4, 2147483647, -2147483648),
  30507. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30508. this[t + 1] = e >>> 8,
  30509. this[t + 2] = e >>> 16,
  30510. this[t + 3] = e >>> 24) : b(this, e, t, !0),
  30511. t + 4
  30512. }
  30513. ,
  30514. u.prototype.writeInt32BE = function(e, t, i) {
  30515. return e = +e,
  30516. t |= 0,
  30517. i || E(this, e, t, 4, 2147483647, -2147483648),
  30518. e < 0 && (e = 4294967295 + e + 1),
  30519. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30520. this[t + 1] = e >>> 16,
  30521. this[t + 2] = e >>> 8,
  30522. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30523. t + 4
  30524. }
  30525. ,
  30526. u.prototype.writeFloatLE = function(e, t, i) {
  30527. return T(this, e, t, !0, i)
  30528. }
  30529. ,
  30530. u.prototype.writeFloatBE = function(e, t, i) {
  30531. return T(this, e, t, !1, i)
  30532. }
  30533. ,
  30534. u.prototype.writeDoubleLE = function(e, t, i) {
  30535. return x(this, e, t, !0, i)
  30536. }
  30537. ,
  30538. u.prototype.writeDoubleBE = function(e, t, i) {
  30539. return x(this, e, t, !1, i)
  30540. }
  30541. ,
  30542. u.prototype.copy = function(e, t, i, n) {
  30543. if (i = i || 0,
  30544. n || 0 === n || (n = this.length),
  30545. t >= e.length && (t = e.length),
  30546. t = t || 0,
  30547. 0 < n && n < i && (n = i),
  30548. n === i)
  30549. return 0;
  30550. if (0 === e.length || 0 === this.length)
  30551. return 0;
  30552. if (t < 0)
  30553. throw new RangeError("targetStart out of bounds");
  30554. if (i < 0 || i >= this.length)
  30555. throw new RangeError("sourceStart out of bounds");
  30556. if (n < 0)
  30557. throw new RangeError("sourceEnd out of bounds");
  30558. n > this.length && (n = this.length),
  30559. e.length - t < n - i && (n = e.length - t + i);
  30560. var r, o = n - i;
  30561. if (this === e && i < t && t < n)
  30562. for (r = o - 1; 0 <= r; --r)
  30563. e[r + t] = this[r + i];
  30564. else if (o < 1e3 || !u.TYPED_ARRAY_SUPPORT)
  30565. for (r = 0; r < o; ++r)
  30566. e[r + t] = this[r + i];
  30567. else
  30568. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  30569. return o
  30570. }
  30571. ,
  30572. u.prototype.fill = function(e, t, i, n) {
  30573. if ("string" == typeof e) {
  30574. if ("string" == typeof t ? (n = t,
  30575. t = 0,
  30576. i = this.length) : "string" == typeof i && (n = i,
  30577. i = this.length),
  30578. 1 === e.length) {
  30579. var r = e.charCodeAt(0);
  30580. r < 256 && (e = r)
  30581. }
  30582. if (void 0 !== n && "string" != typeof n)
  30583. throw new TypeError("encoding must be a string");
  30584. if ("string" == typeof n && !u.isEncoding(n))
  30585. throw new TypeError("Unknown encoding: " + n)
  30586. } else
  30587. "number" == typeof e && (e &= 255);
  30588. if (t < 0 || this.length < t || this.length < i)
  30589. throw new RangeError("Out of range index");
  30590. if (i <= t)
  30591. return this;
  30592. var o;
  30593. if (t >>>= 0,
  30594. i = void 0 === i ? this.length : i >>> 0,
  30595. "number" == typeof (e = e || 0))
  30596. for (o = t; o < i; ++o)
  30597. this[o] = e;
  30598. else {
  30599. var a = u.isBuffer(e) ? e : S(new u(e,n).toString())
  30600. , s = a.length;
  30601. for (o = 0; o < i - t; ++o)
  30602. this[o + t] = a[o % s]
  30603. }
  30604. return this
  30605. }
  30606. ;
  30607. var t = /[^+\/0-9A-Za-z-_]/g
  30608. }
  30609. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30610. }
  30611. , {
  30612. "base64-js": 199,
  30613. ieee754: 200,
  30614. isarray: 201
  30615. }],
  30616. 199: [function(e, t, i) {
  30617. "use strict";
  30618. function l(e) {
  30619. var t = e.length;
  30620. if (0 < t % 4)
  30621. throw new Error("Invalid string. Length must be a multiple of 4");
  30622. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  30623. }
  30624. function c(e, t, i) {
  30625. for (var n, r = [], o = t; o < i; o += 3)
  30626. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  30627. r.push(h[(a = n) >> 18 & 63] + h[a >> 12 & 63] + h[a >> 6 & 63] + h[63 & a]);
  30628. var a;
  30629. return r.join("")
  30630. }
  30631. i.byteLength = function(e) {
  30632. return 3 * e.length / 4 - l(e)
  30633. }
  30634. ,
  30635. i.toByteArray = function(e) {
  30636. var t, i, n, r, o, a = e.length;
  30637. r = l(e),
  30638. o = new d(3 * a / 4 - r),
  30639. i = 0 < r ? a - 4 : a;
  30640. var s = 0;
  30641. for (t = 0; t < i; t += 4,
  30642. 3)
  30643. n = u[e.charCodeAt(t)] << 18 | u[e.charCodeAt(t + 1)] << 12 | u[e.charCodeAt(t + 2)] << 6 | u[e.charCodeAt(t + 3)],
  30644. o[s++] = n >> 16 & 255,
  30645. o[s++] = n >> 8 & 255,
  30646. o[s++] = 255 & n;
  30647. return 2 === r ? (n = u[e.charCodeAt(t)] << 2 | u[e.charCodeAt(t + 1)] >> 4,
  30648. o[s++] = 255 & n) : 1 === r && (n = u[e.charCodeAt(t)] << 10 | u[e.charCodeAt(t + 1)] << 4 | u[e.charCodeAt(t + 2)] >> 2,
  30649. o[s++] = n >> 8 & 255,
  30650. o[s++] = 255 & n),
  30651. o
  30652. }
  30653. ,
  30654. i.fromByteArray = function(e) {
  30655. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 0, s = i - n; a < s; a += 16383)
  30656. o.push(c(e, a, s < a + 16383 ? s : a + 16383));
  30657. return 1 == n ? (t = e[i - 1],
  30658. r += h[t >> 2],
  30659. r += h[t << 4 & 63],
  30660. r += "==") : 2 == n && (t = (e[i - 2] << 8) + e[i - 1],
  30661. r += h[t >> 10],
  30662. r += h[t >> 4 & 63],
  30663. r += h[t << 2 & 63],
  30664. r += "="),
  30665. o.push(r),
  30666. o.join("")
  30667. }
  30668. ;
  30669. for (var h = [], u = [], d = "undefined" != typeof Uint8Array ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = 0, o = n.length; r < o; ++r)
  30670. h[r] = n[r],
  30671. u[n.charCodeAt(r)] = r;
  30672. u["-".charCodeAt(0)] = 62,
  30673. u["_".charCodeAt(0)] = 63
  30674. }
  30675. , {}],
  30676. 200: [function(e, t, i) {
  30677. i.read = function(e, t, i, n, r) {
  30678. 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];
  30679. for (u += d,
  30680. o = p & (1 << -h) - 1,
  30681. p >>= -h,
  30682. h += s; 0 < h; o = 256 * o + e[t + u],
  30683. u += d,
  30684. h -= 8)
  30685. ;
  30686. for (a = o & (1 << -h) - 1,
  30687. o >>= -h,
  30688. h += n; 0 < h; a = 256 * a + e[t + u],
  30689. u += d,
  30690. h -= 8)
  30691. ;
  30692. if (0 === o)
  30693. o = 1 - c;
  30694. else {
  30695. if (o === l)
  30696. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  30697. a += Math.pow(2, n),
  30698. o -= c
  30699. }
  30700. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  30701. }
  30702. ,
  30703. i.write = function(e, t, i, n, r, o) {
  30704. 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;
  30705. for (t = Math.abs(t),
  30706. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  30707. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  30708. t * (l = Math.pow(2, -a)) < 1 && (a--,
  30709. l *= 2),
  30710. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  30711. l /= 2),
  30712. h <= a + u ? (s = 0,
  30713. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  30714. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  30715. a = 0)); 8 <= r; e[i + p] = 255 & s,
  30716. p += f,
  30717. s /= 256,
  30718. r -= 8)
  30719. ;
  30720. for (a = a << r | s,
  30721. c += r; 0 < c; e[i + p] = 255 & a,
  30722. p += f,
  30723. a /= 256,
  30724. c -= 8)
  30725. ;
  30726. e[i + p - f] |= 128 * g
  30727. }
  30728. }
  30729. , {}],
  30730. 201: [function(e, t, i) {
  30731. var n = {}.toString;
  30732. t.exports = Array.isArray || function(e) {
  30733. return "[object Array]" == n.call(e)
  30734. }
  30735. }
  30736. , {}],
  30737. 202: [function(e, t, i) {
  30738. function n() {
  30739. this._events = this._events || {},
  30740. this._maxListeners = this._maxListeners || void 0
  30741. }
  30742. function l(e) {
  30743. return "function" == typeof e
  30744. }
  30745. function c(e) {
  30746. return "object" == typeof e && null !== e
  30747. }
  30748. function h(e) {
  30749. return void 0 === e
  30750. }
  30751. ((t.exports = n).EventEmitter = n).prototype._events = void 0,
  30752. n.prototype._maxListeners = void 0,
  30753. n.defaultMaxListeners = 10,
  30754. n.prototype.setMaxListeners = function(e) {
  30755. if (!function(e) {
  30756. return "number" == typeof e
  30757. }(e) || e < 0 || isNaN(e))
  30758. throw TypeError("n must be a positive number");
  30759. return this._maxListeners = e,
  30760. this
  30761. }
  30762. ,
  30763. n.prototype.emit = function(e) {
  30764. var t, i, n, r, o, a;
  30765. if (this._events || (this._events = {}),
  30766. "error" === e && (!this._events.error || c(this._events.error) && !this._events.error.length)) {
  30767. if ((t = arguments[1])instanceof Error)
  30768. throw t;
  30769. var s = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  30770. throw s.context = t,
  30771. s
  30772. }
  30773. if (h(i = this._events[e]))
  30774. return !1;
  30775. if (l(i))
  30776. switch (arguments.length) {
  30777. case 1:
  30778. i.call(this);
  30779. break;
  30780. case 2:
  30781. i.call(this, arguments[1]);
  30782. break;
  30783. case 3:
  30784. i.call(this, arguments[1], arguments[2]);
  30785. break;
  30786. default:
  30787. r = Array.prototype.slice.call(arguments, 1),
  30788. i.apply(this, r)
  30789. }
  30790. else if (c(i))
  30791. for (r = Array.prototype.slice.call(arguments, 1),
  30792. n = (a = i.slice()).length,
  30793. o = 0; o < n; o++)
  30794. a[o].apply(this, r);
  30795. return !0
  30796. }
  30797. ,
  30798. n.prototype.on = n.prototype.addListener = function(e, t) {
  30799. var i;
  30800. if (!l(t))
  30801. throw TypeError("listener must be a function");
  30802. return this._events || (this._events = {}),
  30803. this._events.newListener && this.emit("newListener", e, l(t.listener) ? t.listener : t),
  30804. this._events[e] ? c(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  30805. 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,
  30806. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  30807. "function" == typeof console.trace && console.trace())),
  30808. this
  30809. }
  30810. ,
  30811. n.prototype.once = function(e, t) {
  30812. function i() {
  30813. this.removeListener(e, i),
  30814. n || (n = !0,
  30815. t.apply(this, arguments))
  30816. }
  30817. if (!l(t))
  30818. throw TypeError("listener must be a function");
  30819. var n = !1;
  30820. return i.listener = t,
  30821. this.on(e, i),
  30822. this
  30823. }
  30824. ,
  30825. n.prototype.removeListener = function(e, t) {
  30826. var i, n, r, o;
  30827. if (!l(t))
  30828. throw TypeError("listener must be a function");
  30829. if (!this._events || !this._events[e])
  30830. return this;
  30831. if (r = (i = this._events[e]).length,
  30832. n = -1,
  30833. i === t || l(i.listener) && i.listener === t)
  30834. delete this._events[e],
  30835. this._events.removeListener && this.emit("removeListener", e, t);
  30836. else if (c(i)) {
  30837. for (o = r; 0 < o--; )
  30838. if (i[o] === t || i[o].listener && i[o].listener === t) {
  30839. n = o;
  30840. break
  30841. }
  30842. if (n < 0)
  30843. return this;
  30844. 1 === i.length ? (i.length = 0,
  30845. delete this._events[e]) : i.splice(n, 1),
  30846. this._events.removeListener && this.emit("removeListener", e, t)
  30847. }
  30848. return this
  30849. }
  30850. ,
  30851. n.prototype.removeAllListeners = function(e) {
  30852. var t, i;
  30853. if (!this._events)
  30854. return this;
  30855. if (!this._events.removeListener)
  30856. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  30857. this;
  30858. if (0 === arguments.length) {
  30859. for (t in this._events)
  30860. "removeListener" !== t && this.removeAllListeners(t);
  30861. return this.removeAllListeners("removeListener"),
  30862. this._events = {},
  30863. this
  30864. }
  30865. if (l(i = this._events[e]))
  30866. this.removeListener(e, i);
  30867. else if (i)
  30868. for (; i.length; )
  30869. this.removeListener(e, i[i.length - 1]);
  30870. return delete this._events[e],
  30871. this
  30872. }
  30873. ,
  30874. n.prototype.listeners = function(e) {
  30875. return this._events && this._events[e] ? l(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  30876. }
  30877. ,
  30878. n.prototype.listenerCount = function(e) {
  30879. if (this._events) {
  30880. var t = this._events[e];
  30881. if (l(t))
  30882. return 1;
  30883. if (t)
  30884. return t.length
  30885. }
  30886. return 0
  30887. }
  30888. ,
  30889. n.listenerCount = function(e, t) {
  30890. return e.listenerCount(t)
  30891. }
  30892. }
  30893. , {}],
  30894. 203: [function(e, t, i) {
  30895. function n() {
  30896. throw new Error("setTimeout has not been defined")
  30897. }
  30898. function r() {
  30899. throw new Error("clearTimeout has not been defined")
  30900. }
  30901. function o(t) {
  30902. if (h === setTimeout)
  30903. return setTimeout(t, 0);
  30904. if ((h === n || !h) && setTimeout)
  30905. return h = setTimeout,
  30906. setTimeout(t, 0);
  30907. try {
  30908. return h(t, 0)
  30909. } catch (e) {
  30910. try {
  30911. return h.call(null, t, 0)
  30912. } catch (e) {
  30913. return h.call(this, t, 0)
  30914. }
  30915. }
  30916. }
  30917. function a() {
  30918. g && p && (g = !1,
  30919. p.length ? f = p.concat(f) : m = -1,
  30920. f.length && s())
  30921. }
  30922. function s() {
  30923. if (!g) {
  30924. var e = o(a);
  30925. g = !0;
  30926. for (var t = f.length; t; ) {
  30927. for (p = f,
  30928. f = []; ++m < t; )
  30929. p && p[m].run();
  30930. m = -1,
  30931. t = f.length
  30932. }
  30933. p = null,
  30934. g = !1,
  30935. function(t) {
  30936. if (u === clearTimeout)
  30937. return clearTimeout(t);
  30938. if ((u === r || !u) && clearTimeout)
  30939. return u = clearTimeout,
  30940. clearTimeout(t);
  30941. try {
  30942. u(t)
  30943. } catch (e) {
  30944. try {
  30945. return u.call(null, t)
  30946. } catch (e) {
  30947. return u.call(this, t)
  30948. }
  30949. }
  30950. }(e)
  30951. }
  30952. }
  30953. function l(e, t) {
  30954. this.fun = e,
  30955. this.array = t
  30956. }
  30957. function c() {}
  30958. var h, u, d = t.exports = {};
  30959. !function() {
  30960. try {
  30961. h = "function" == typeof setTimeout ? setTimeout : n
  30962. } catch (e) {
  30963. h = n
  30964. }
  30965. try {
  30966. u = "function" == typeof clearTimeout ? clearTimeout : r
  30967. } catch (e) {
  30968. u = r
  30969. }
  30970. }();
  30971. var p, f = [], g = !1, m = -1;
  30972. d.nextTick = function(e) {
  30973. var t = new Array(arguments.length - 1);
  30974. if (1 < arguments.length)
  30975. for (var i = 1; i < arguments.length; i++)
  30976. t[i - 1] = arguments[i];
  30977. f.push(new l(e,t)),
  30978. 1 !== f.length || g || o(s)
  30979. }
  30980. ,
  30981. l.prototype.run = function() {
  30982. this.fun.apply(null, this.array)
  30983. }
  30984. ,
  30985. d.title = "browser",
  30986. d.browser = !0,
  30987. d.env = {},
  30988. d.argv = [],
  30989. d.version = "",
  30990. d.versions = {},
  30991. d.on = c,
  30992. d.addListener = c,
  30993. d.once = c,
  30994. d.off = c,
  30995. d.removeListener = c,
  30996. d.removeAllListeners = c,
  30997. d.emit = c,
  30998. d.binding = function(e) {
  30999. throw new Error("process.binding is not supported")
  31000. }
  31001. ,
  31002. d.cwd = function() {
  31003. return "/"
  31004. }
  31005. ,
  31006. d.chdir = function(e) {
  31007. throw new Error("process.chdir is not supported")
  31008. }
  31009. ,
  31010. d.umask = function() {
  31011. return 0
  31012. }
  31013. }
  31014. , {}],
  31015. 204: [function(e, O, L) {
  31016. (function(P) {
  31017. !function(e) {
  31018. function v(e) {
  31019. throw new RangeError(g[e])
  31020. }
  31021. function r(e, t) {
  31022. for (var i = e.length, n = []; i--; )
  31023. n[i] = t(e[i]);
  31024. return n
  31025. }
  31026. function t(e, t) {
  31027. var i = e.split("@")
  31028. , n = "";
  31029. return 1 < i.length && (n = i[0] + "@",
  31030. e = i[1]),
  31031. n + r((e = e.replace(f, ".")).split("."), t).join(".")
  31032. }
  31033. function y(e) {
  31034. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  31035. 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),
  31036. r--) : n.push(t);
  31037. return n
  31038. }
  31039. function A(e) {
  31040. return r(e, function(e) {
  31041. var t = "";
  31042. return 65535 < e && (t += R((e -= 65536) >>> 10 & 1023 | 55296),
  31043. e = 56320 | 1023 & e),
  31044. t + R(e)
  31045. }).join("")
  31046. }
  31047. function C(e, t) {
  31048. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  31049. }
  31050. function I(e, t, i) {
  31051. var n = 0;
  31052. for (e = i ? M(e / u) : e >> 1,
  31053. e += M(e / t); m * w >> 1 < e; n += _)
  31054. e = M(e / m);
  31055. return M(n + (m + 1) * e / (e + h))
  31056. }
  31057. function i(e) {
  31058. var t, i, n, r, o, a, s, l, c, h, u, d = [], p = e.length, f = 0, g = x, m = T;
  31059. for ((i = e.lastIndexOf(S)) < 0 && (i = 0),
  31060. n = 0; n < i; ++n)
  31061. 128 <= e.charCodeAt(n) && v("not-basic"),
  31062. d.push(e.charCodeAt(n));
  31063. for (r = 0 < i ? i + 1 : 0; r < p; ) {
  31064. for (o = f,
  31065. a = 1,
  31066. s = _; p <= r && v("invalid-input"),
  31067. u = e.charCodeAt(r++),
  31068. (_ <= (l = u - 48 < 10 ? u - 22 : u - 65 < 26 ? u - 65 : u - 97 < 26 ? u - 97 : _) || l > M((E - f) / a)) && v("overflow"),
  31069. f += l * a,
  31070. !(l < (c = s <= m ? b : m + w <= s ? w : s - m)); s += _)
  31071. a > M(E / (h = _ - c)) && v("overflow"),
  31072. a *= h;
  31073. m = I(f - o, t = d.length + 1, 0 == o),
  31074. M(f / t) > E - g && v("overflow"),
  31075. g += M(f / t),
  31076. f %= t,
  31077. d.splice(f++, 0, g)
  31078. }
  31079. return A(d)
  31080. }
  31081. function n(e) {
  31082. var t, i, n, r, o, a, s, l, c, h, u, d, p, f, g, m = [];
  31083. for (d = (e = y(e)).length,
  31084. t = x,
  31085. o = T,
  31086. a = i = 0; a < d; ++a)
  31087. (u = e[a]) < 128 && m.push(R(u));
  31088. for (n = r = m.length,
  31089. r && m.push(S); n < d; ) {
  31090. for (s = E,
  31091. a = 0; a < d; ++a)
  31092. t <= (u = e[a]) && u < s && (s = u);
  31093. for (s - t > M((E - i) / (p = n + 1)) && v("overflow"),
  31094. i += (s - t) * p,
  31095. t = s,
  31096. a = 0; a < d; ++a)
  31097. if ((u = e[a]) < t && ++i > E && v("overflow"),
  31098. u == t) {
  31099. for (l = i,
  31100. c = _; !(l < (h = c <= o ? b : o + w <= c ? w : c - o)); c += _)
  31101. g = l - h,
  31102. f = _ - h,
  31103. m.push(R(C(h + g % f, 0))),
  31104. l = M(g / f);
  31105. m.push(R(C(l, 0))),
  31106. o = I(i, p, n == r),
  31107. i = 0,
  31108. ++n
  31109. }
  31110. ++i,
  31111. ++t
  31112. }
  31113. return m.join("")
  31114. }
  31115. var o = "object" == typeof L && L && !L.nodeType && L
  31116. , a = "object" == typeof O && O && !O.nodeType && O
  31117. , s = "object" == typeof P && P;
  31118. s.global !== s && s.window !== s && s.self !== s || (e = s);
  31119. 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 = {
  31120. overflow: "Overflow: input needs wider integers to process",
  31121. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  31122. "invalid-input": "Invalid input"
  31123. }, m = _ - b, M = Math.floor, R = String.fromCharCode;
  31124. if (l = {
  31125. version: "1.4.1",
  31126. ucs2: {
  31127. decode: y,
  31128. encode: A
  31129. },
  31130. decode: i,
  31131. encode: n,
  31132. toASCII: function(e) {
  31133. return t(e, function(e) {
  31134. return p.test(e) ? "xn--" + n(e) : e
  31135. })
  31136. },
  31137. toUnicode: function(e) {
  31138. return t(e, function(e) {
  31139. return d.test(e) ? i(e.slice(4).toLowerCase()) : e
  31140. })
  31141. }
  31142. },
  31143. "function" == typeof define && "object" == typeof define.amd && define.amd)
  31144. define("punycode", function() {
  31145. return l
  31146. });
  31147. else if (o && a)
  31148. if (O.exports == o)
  31149. a.exports = l;
  31150. else
  31151. for (c in l)
  31152. l.hasOwnProperty(c) && (o[c] = l[c]);
  31153. else
  31154. e.punycode = l
  31155. }(this)
  31156. }
  31157. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  31158. }
  31159. , {}],
  31160. 205: [function(e, t, i) {
  31161. "use strict";
  31162. t.exports = function(e, t, i, n) {
  31163. t = t || "&",
  31164. i = i || "=";
  31165. var r = {};
  31166. if ("string" != typeof e || 0 === e.length)
  31167. return r;
  31168. var o = /\+/g;
  31169. e = e.split(t);
  31170. var a = 1e3;
  31171. n && "number" == typeof n.maxKeys && (a = n.maxKeys);
  31172. var s, l, c = e.length;
  31173. 0 < a && a < c && (c = a);
  31174. for (var h = 0; h < c; ++h) {
  31175. var u, d, p, f, g = e[h].replace(o, "%20"), m = g.indexOf(i);
  31176. d = 0 <= m ? (u = g.substr(0, m),
  31177. g.substr(m + 1)) : (u = g,
  31178. ""),
  31179. p = decodeURIComponent(u),
  31180. f = decodeURIComponent(d),
  31181. s = r,
  31182. l = p,
  31183. Object.prototype.hasOwnProperty.call(s, l) ? v(r[p]) ? r[p].push(f) : r[p] = [r[p], f] : r[p] = f
  31184. }
  31185. return r
  31186. }
  31187. ;
  31188. var v = Array.isArray || function(e) {
  31189. return "[object Array]" === Object.prototype.toString.call(e)
  31190. }
  31191. }
  31192. , {}],
  31193. 206: [function(e, t, i) {
  31194. "use strict";
  31195. function o(e, t) {
  31196. if (e.map)
  31197. return e.map(t);
  31198. for (var i = [], n = 0; n < e.length; n++)
  31199. i.push(t(e[n], n));
  31200. return i
  31201. }
  31202. function a(e) {
  31203. switch (typeof e) {
  31204. case "string":
  31205. return e;
  31206. case "boolean":
  31207. return e ? "true" : "false";
  31208. case "number":
  31209. return isFinite(e) ? e : "";
  31210. default:
  31211. return ""
  31212. }
  31213. }
  31214. t.exports = function(i, n, r, e) {
  31215. return n = n || "&",
  31216. r = r || "=",
  31217. null === i && (i = void 0),
  31218. "object" == typeof i ? o(l(i), function(e) {
  31219. var t = encodeURIComponent(a(e)) + r;
  31220. return s(i[e]) ? o(i[e], function(e) {
  31221. return t + encodeURIComponent(a(e))
  31222. }).join(n) : t + encodeURIComponent(a(i[e]))
  31223. }).join(n) : e ? encodeURIComponent(a(e)) + r + encodeURIComponent(a(i)) : ""
  31224. }
  31225. ;
  31226. var s = Array.isArray || function(e) {
  31227. return "[object Array]" === Object.prototype.toString.call(e)
  31228. }
  31229. , l = Object.keys || function(e) {
  31230. var t = [];
  31231. for (var i in e)
  31232. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  31233. return t
  31234. }
  31235. }
  31236. , {}],
  31237. 207: [function(e, t, i) {
  31238. "use strict";
  31239. i.decode = i.parse = e("./decode"),
  31240. i.encode = i.stringify = e("./encode")
  31241. }
  31242. , {
  31243. "./decode": 205,
  31244. "./encode": 206
  31245. }],
  31246. 208: [function(e, t, i) {
  31247. "use strict";
  31248. function x() {
  31249. this.protocol = null,
  31250. this.slashes = null,
  31251. this.auth = null,
  31252. this.host = null,
  31253. this.port = null,
  31254. this.hostname = null,
  31255. this.hash = null,
  31256. this.search = null,
  31257. this.query = null,
  31258. this.pathname = null,
  31259. this.path = null,
  31260. this.href = null
  31261. }
  31262. function n(e, t, i) {
  31263. if (e && D.isObject(e) && e instanceof x)
  31264. return e;
  31265. var n = new x;
  31266. return n.parse(e, t, i),
  31267. n
  31268. }
  31269. var L = e("punycode")
  31270. , D = e("./util");
  31271. i.parse = n,
  31272. i.resolve = function(e, t) {
  31273. return n(e, !1, !0).resolve(t)
  31274. }
  31275. ,
  31276. i.resolveObject = function(e, t) {
  31277. return e ? n(e, !1, !0).resolveObject(t) : t
  31278. }
  31279. ,
  31280. i.format = function(e) {
  31281. return D.isString(e) && (e = n(e)),
  31282. e instanceof x ? e.format() : x.prototype.format.call(e)
  31283. }
  31284. ,
  31285. i.Url = x;
  31286. var N = /^([a-z0-9.+-]+:)/i
  31287. , r = /:[0-9]*$/
  31288. , F = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  31289. , o = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"])
  31290. , B = ["'"].concat(o)
  31291. , V = ["%", "/", "?", ";", "#"].concat(B)
  31292. , k = ["/", "?", "#"]
  31293. , U = /^[+a-z0-9A-Z_-]{0,63}$/
  31294. , H = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  31295. , z = {
  31296. javascript: !0,
  31297. "javascript:": !0
  31298. }
  31299. , G = {
  31300. javascript: !0,
  31301. "javascript:": !0
  31302. }
  31303. , W = {
  31304. http: !0,
  31305. https: !0,
  31306. ftp: !0,
  31307. gopher: !0,
  31308. file: !0,
  31309. "http:": !0,
  31310. "https:": !0,
  31311. "ftp:": !0,
  31312. "gopher:": !0,
  31313. "file:": !0
  31314. }
  31315. , j = e("querystring");
  31316. x.prototype.parse = function(e, t, i) {
  31317. if (!D.isString(e))
  31318. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  31319. var n = e.indexOf("?")
  31320. , r = -1 !== n && n < e.indexOf("#") ? "?" : "#"
  31321. , o = e.split(r);
  31322. o[0] = o[0].replace(/\\/g, "/");
  31323. var a = e = o.join(r);
  31324. if (a = a.trim(),
  31325. !i && 1 === e.split("#").length) {
  31326. var s = F.exec(a);
  31327. if (s)
  31328. return this.path = a,
  31329. this.href = a,
  31330. this.pathname = s[1],
  31331. s[2] ? (this.search = s[2],
  31332. this.query = t ? j.parse(this.search.substr(1)) : this.search.substr(1)) : t && (this.search = "",
  31333. this.query = {}),
  31334. this
  31335. }
  31336. var l = N.exec(a);
  31337. if (l) {
  31338. var c = (l = l[0]).toLowerCase();
  31339. this.protocol = c,
  31340. a = a.substr(l.length)
  31341. }
  31342. if (i || l || a.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  31343. var h = "//" === a.substr(0, 2);
  31344. !h || l && G[l] || (a = a.substr(2),
  31345. this.slashes = !0)
  31346. }
  31347. if (!G[l] && (h || l && !W[l])) {
  31348. for (var u = -1, d = 0; d < k.length; d++) {
  31349. -1 !== (g = a.indexOf(k[d])) && (-1 === u || g < u) && (u = g)
  31350. }
  31351. var p, f;
  31352. -1 !== (f = -1 === u ? a.lastIndexOf("@") : a.lastIndexOf("@", u)) && (p = a.slice(0, f),
  31353. a = a.slice(f + 1),
  31354. this.auth = decodeURIComponent(p)),
  31355. u = -1;
  31356. for (d = 0; d < V.length; d++) {
  31357. var g;
  31358. -1 !== (g = a.indexOf(V[d])) && (-1 === u || g < u) && (u = g)
  31359. }
  31360. -1 === u && (u = a.length),
  31361. this.host = a.slice(0, u),
  31362. a = a.slice(u),
  31363. this.parseHost(),
  31364. this.hostname = this.hostname || "";
  31365. var m = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  31366. if (!m)
  31367. for (var v = this.hostname.split(/\./), y = (d = 0,
  31368. v.length); d < y; d++) {
  31369. var A = v[d];
  31370. if (A && !A.match(U)) {
  31371. for (var C = "", I = 0, E = A.length; I < E; I++)
  31372. C += 127 < A.charCodeAt(I) ? "x" : A[I];
  31373. if (!C.match(U)) {
  31374. var _ = v.slice(0, d)
  31375. , b = v.slice(d + 1)
  31376. , w = A.match(H);
  31377. w && (_.push(w[1]),
  31378. b.unshift(w[2])),
  31379. b.length && (a = "/" + b.join(".") + a),
  31380. this.hostname = _.join(".");
  31381. break
  31382. }
  31383. }
  31384. }
  31385. 255 < this.hostname.length ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  31386. m || (this.hostname = L.toASCII(this.hostname));
  31387. var T = this.port ? ":" + this.port : ""
  31388. , x = this.hostname || "";
  31389. this.host = x + T,
  31390. this.href += this.host,
  31391. m && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  31392. "/" !== a[0] && (a = "/" + a))
  31393. }
  31394. if (!z[c])
  31395. for (d = 0,
  31396. y = B.length; d < y; d++) {
  31397. var S = B[d];
  31398. if (-1 !== a.indexOf(S)) {
  31399. var M = encodeURIComponent(S);
  31400. M === S && (M = escape(S)),
  31401. a = a.split(S).join(M)
  31402. }
  31403. }
  31404. var R = a.indexOf("#");
  31405. -1 !== R && (this.hash = a.substr(R),
  31406. a = a.slice(0, R));
  31407. var P = a.indexOf("?");
  31408. if (-1 !== P ? (this.search = a.substr(P),
  31409. this.query = a.substr(P + 1),
  31410. t && (this.query = j.parse(this.query)),
  31411. a = a.slice(0, P)) : t && (this.search = "",
  31412. this.query = {}),
  31413. a && (this.pathname = a),
  31414. W[c] && this.hostname && !this.pathname && (this.pathname = "/"),
  31415. this.pathname || this.search) {
  31416. T = this.pathname || "";
  31417. var O = this.search || "";
  31418. this.path = T + O
  31419. }
  31420. return this.href = this.format(),
  31421. this
  31422. }
  31423. ,
  31424. x.prototype.format = function() {
  31425. var e = this.auth || "";
  31426. e && (e = (e = encodeURIComponent(e)).replace(/%3A/i, ":"),
  31427. e += "@");
  31428. var t = this.protocol || ""
  31429. , i = this.pathname || ""
  31430. , n = this.hash || ""
  31431. , r = !1
  31432. , o = "";
  31433. this.host ? r = e + this.host : this.hostname && (r = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"),
  31434. this.port && (r += ":" + this.port)),
  31435. this.query && D.isObject(this.query) && Object.keys(this.query).length && (o = j.stringify(this.query));
  31436. var a = this.search || o && "?" + o || "";
  31437. return t && ":" !== t.substr(-1) && (t += ":"),
  31438. this.slashes || (!t || W[t]) && !1 !== r ? (r = "//" + (r || ""),
  31439. i && "/" !== i.charAt(0) && (i = "/" + i)) : r = r || "",
  31440. n && "#" !== n.charAt(0) && (n = "#" + n),
  31441. a && "?" !== a.charAt(0) && (a = "?" + a),
  31442. t + r + (i = i.replace(/[?#]/g, function(e) {
  31443. return encodeURIComponent(e)
  31444. })) + (a = a.replace("#", "%23")) + n
  31445. }
  31446. ,
  31447. x.prototype.resolve = function(e) {
  31448. return this.resolveObject(n(e, !1, !0)).format()
  31449. }
  31450. ,
  31451. x.prototype.resolveObject = function(e) {
  31452. if (D.isString(e)) {
  31453. var t = new x;
  31454. t.parse(e, !1, !0),
  31455. e = t
  31456. }
  31457. for (var i = new x, n = Object.keys(this), r = 0; r < n.length; r++) {
  31458. var o = n[r];
  31459. i[o] = this[o]
  31460. }
  31461. if (i.hash = e.hash,
  31462. "" === e.href)
  31463. return i.href = i.format(),
  31464. i;
  31465. if (e.slashes && !e.protocol) {
  31466. for (var a = Object.keys(e), s = 0; s < a.length; s++) {
  31467. var l = a[s];
  31468. "protocol" !== l && (i[l] = e[l])
  31469. }
  31470. return W[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  31471. i.href = i.format(),
  31472. i
  31473. }
  31474. if (e.protocol && e.protocol !== i.protocol) {
  31475. if (!W[e.protocol]) {
  31476. for (var c = Object.keys(e), h = 0; h < c.length; h++) {
  31477. var u = c[h];
  31478. i[u] = e[u]
  31479. }
  31480. return i.href = i.format(),
  31481. i
  31482. }
  31483. if (i.protocol = e.protocol,
  31484. e.host || G[e.protocol])
  31485. i.pathname = e.pathname;
  31486. else {
  31487. for (var d = (e.pathname || "").split("/"); d.length && !(e.host = d.shift()); )
  31488. ;
  31489. e.host || (e.host = ""),
  31490. e.hostname || (e.hostname = ""),
  31491. "" !== d[0] && d.unshift(""),
  31492. d.length < 2 && d.unshift(""),
  31493. i.pathname = d.join("/")
  31494. }
  31495. if (i.search = e.search,
  31496. i.query = e.query,
  31497. i.host = e.host || "",
  31498. i.auth = e.auth,
  31499. i.hostname = e.hostname || e.host,
  31500. i.port = e.port,
  31501. i.pathname || i.search) {
  31502. var p = i.pathname || ""
  31503. , f = i.search || "";
  31504. i.path = p + f
  31505. }
  31506. return i.slashes = i.slashes || e.slashes,
  31507. i.href = i.format(),
  31508. i
  31509. }
  31510. var g = i.pathname && "/" === i.pathname.charAt(0)
  31511. , m = e.host || e.pathname && "/" === e.pathname.charAt(0)
  31512. , v = m || g || i.host && e.pathname
  31513. , y = v
  31514. , A = i.pathname && i.pathname.split("/") || []
  31515. , C = (d = e.pathname && e.pathname.split("/") || [],
  31516. i.protocol && !W[i.protocol]);
  31517. if (C && (i.hostname = "",
  31518. i.port = null,
  31519. i.host && ("" === A[0] ? A[0] = i.host : A.unshift(i.host)),
  31520. i.host = "",
  31521. e.protocol && (e.hostname = null,
  31522. e.port = null,
  31523. e.host && ("" === d[0] ? d[0] = e.host : d.unshift(e.host)),
  31524. e.host = null),
  31525. v = v && ("" === d[0] || "" === A[0])),
  31526. m)
  31527. i.host = e.host || "" === e.host ? e.host : i.host,
  31528. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  31529. i.search = e.search,
  31530. i.query = e.query,
  31531. A = d;
  31532. else if (d.length)
  31533. (A = A || []).pop(),
  31534. A = A.concat(d),
  31535. i.search = e.search,
  31536. i.query = e.query;
  31537. else if (!D.isNullOrUndefined(e.search)) {
  31538. if (C)
  31539. i.hostname = i.host = A.shift(),
  31540. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31541. i.host = i.hostname = w.shift());
  31542. return i.search = e.search,
  31543. i.query = e.query,
  31544. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31545. i.href = i.format(),
  31546. i
  31547. }
  31548. if (!A.length)
  31549. return i.pathname = null,
  31550. i.search ? i.path = "/" + i.search : i.path = null,
  31551. i.href = i.format(),
  31552. i;
  31553. 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--)
  31554. "." === (I = A[b]) ? A.splice(b, 1) : ".." === I ? (A.splice(b, 1),
  31555. _++) : _ && (A.splice(b, 1),
  31556. _--);
  31557. if (!v && !y)
  31558. for (; _--; )
  31559. A.unshift("..");
  31560. !v || "" === A[0] || A[0] && "/" === A[0].charAt(0) || A.unshift(""),
  31561. E && "/" !== A.join("/").substr(-1) && A.push("");
  31562. var w, T = "" === A[0] || A[0] && "/" === A[0].charAt(0);
  31563. C && (i.hostname = i.host = T ? "" : A.length ? A.shift() : "",
  31564. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31565. i.host = i.hostname = w.shift()));
  31566. return (v = v || i.host && A.length) && !T && A.unshift(""),
  31567. A.length ? i.pathname = A.join("/") : (i.pathname = null,
  31568. i.path = null),
  31569. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31570. i.auth = e.auth || i.auth,
  31571. i.slashes = i.slashes || e.slashes,
  31572. i.href = i.format(),
  31573. i
  31574. }
  31575. ,
  31576. x.prototype.parseHost = function() {
  31577. var e = this.host
  31578. , t = r.exec(e);
  31579. t && (":" !== (t = t[0]) && (this.port = t.substr(1)),
  31580. e = e.substr(0, e.length - t.length)),
  31581. e && (this.hostname = e)
  31582. }
  31583. }
  31584. , {
  31585. "./util": 209,
  31586. punycode: 204,
  31587. querystring: 207
  31588. }],
  31589. 209: [function(e, t, i) {
  31590. "use strict";
  31591. t.exports = {
  31592. isString: function(e) {
  31593. return "string" == typeof e
  31594. },
  31595. isObject: function(e) {
  31596. return "object" == typeof e && null !== e
  31597. },
  31598. isNull: function(e) {
  31599. return null === e
  31600. },
  31601. isNullOrUndefined: function(e) {
  31602. return null == e
  31603. }
  31604. }
  31605. }
  31606. , {}],
  31607. 210: [function(e, t, i) {
  31608. "use strict";
  31609. function r(e) {
  31610. return c + e
  31611. }
  31612. function s(e) {
  31613. if ("string" != typeof e)
  31614. throw new TypeError("key must be a string.")
  31615. }
  31616. var l = Object.prototype.hasOwnProperty
  31617. , c = "~";
  31618. t.exports = function(t) {
  31619. var o = Object.create(null)
  31620. , n = 0
  31621. , a = {};
  31622. return function(e, t) {
  31623. for (var i in t)
  31624. Object.defineProperty(e, i, {
  31625. value: t[i],
  31626. configurable: !0,
  31627. writable: !0
  31628. })
  31629. }(a, {
  31630. get: function(e, t) {
  31631. s(e);
  31632. var i = r(e);
  31633. return i in o ? o[i] : t
  31634. },
  31635. set: function(e, t) {
  31636. s(e);
  31637. var i = r(e);
  31638. return i in o || ++n,
  31639. o[i] = t
  31640. },
  31641. has: function(e) {
  31642. return s(e),
  31643. r(e)in o
  31644. },
  31645. delete: function(e) {
  31646. s(e);
  31647. var t = r(e);
  31648. return t in o && (--n,
  31649. delete o[t],
  31650. !0)
  31651. },
  31652. clear: function() {
  31653. o = Object.create(null),
  31654. n = 0
  31655. },
  31656. forEach: function(e, t) {
  31657. if ("function" != typeof e)
  31658. throw new TypeError("`callback` must be a function");
  31659. for (var i in o)
  31660. if (l.call(o, i)) {
  31661. var n = i.substring(c.length)
  31662. , r = o[i];
  31663. e.call(t, r, n, a)
  31664. }
  31665. }
  31666. }),
  31667. Object.defineProperty(a, "size", {
  31668. get: function() {
  31669. return n
  31670. },
  31671. configurable: !0
  31672. }),
  31673. "object" == typeof t && null !== t && Object.keys(t).forEach(function(e) {
  31674. a.set(e, t[e])
  31675. }),
  31676. a
  31677. }
  31678. }
  31679. , {}],
  31680. 211: [function(e, t, i) {
  31681. t.exports = e("./lib/heap")
  31682. }
  31683. , {
  31684. "./lib/heap": 212
  31685. }],
  31686. 212: [function(e, y, A) {
  31687. (function() {
  31688. var e, d, l, p, f, t, c, i, g, m, n, r, o, h, u, a, s;
  31689. function v(e) {
  31690. this.cmp = null != e ? e : d,
  31691. this.nodes = []
  31692. }
  31693. l = Math.floor,
  31694. m = Math.min,
  31695. d = function(e, t) {
  31696. return e < t ? -1 : t < e ? 1 : 0
  31697. }
  31698. ,
  31699. g = function(e, t, i, n, r) {
  31700. var o;
  31701. if (null == i && (i = 0),
  31702. null == r && (r = d),
  31703. i < 0)
  31704. throw new Error("lo must be non-negative");
  31705. for (null == n && (n = e.length); i < n; )
  31706. r(t, e[o = l((i + n) / 2)]) < 0 ? n = o : i = o + 1;
  31707. return [].splice.apply(e, [i, i - i].concat(t)),
  31708. t
  31709. }
  31710. ,
  31711. t = function(e, t, i) {
  31712. return null == i && (i = d),
  31713. e.push(t),
  31714. h(e, 0, e.length - 1, i)
  31715. }
  31716. ,
  31717. f = function(e, t) {
  31718. var i, n;
  31719. return null == t && (t = d),
  31720. i = e.pop(),
  31721. e.length ? (n = e[0],
  31722. e[0] = i,
  31723. u(e, 0, t)) : n = i,
  31724. n
  31725. }
  31726. ,
  31727. i = function(e, t, i) {
  31728. var n;
  31729. return null == i && (i = d),
  31730. n = e[0],
  31731. e[0] = t,
  31732. u(e, 0, i),
  31733. n
  31734. }
  31735. ,
  31736. c = function(e, t, i) {
  31737. var n;
  31738. return null == i && (i = d),
  31739. e.length && i(e[0], t) < 0 && (t = (n = [e[0], t])[0],
  31740. e[0] = n[1],
  31741. u(e, 0, i)),
  31742. t
  31743. }
  31744. ,
  31745. p = function(i, e) {
  31746. var t, n, r, o, a, s;
  31747. for (null == e && (e = d),
  31748. a = [],
  31749. n = 0,
  31750. r = (o = function() {
  31751. s = [];
  31752. for (var e = 0, t = l(i.length / 2); 0 <= t ? e < t : t < e; 0 <= t ? e++ : e--)
  31753. s.push(e);
  31754. return s
  31755. }
  31756. .apply(this).reverse()).length; n < r; n++)
  31757. t = o[n],
  31758. a.push(u(i, t, e));
  31759. return a
  31760. }
  31761. ,
  31762. o = function(e, t, i) {
  31763. var n;
  31764. if (null == i && (i = d),
  31765. -1 !== (n = e.indexOf(t)))
  31766. return h(e, 0, n, i),
  31767. u(e, n, i)
  31768. }
  31769. ,
  31770. n = function(e, t, i) {
  31771. var n, r, o, a, s;
  31772. if (null == i && (i = d),
  31773. !(r = e.slice(0, t)).length)
  31774. return r;
  31775. for (p(r, i),
  31776. o = 0,
  31777. a = (s = e.slice(t)).length; o < a; o++)
  31778. n = s[o],
  31779. c(r, n, i);
  31780. return r.sort(i).reverse()
  31781. }
  31782. ,
  31783. r = function(e, t, i) {
  31784. var n, r, o, a, s, l, c, h, u;
  31785. if (null == i && (i = d),
  31786. 10 * t <= e.length) {
  31787. if (!(o = e.slice(0, t).sort(i)).length)
  31788. return o;
  31789. for (r = o[o.length - 1],
  31790. a = 0,
  31791. l = (c = e.slice(t)).length; a < l; a++)
  31792. i(n = c[a], r) < 0 && (g(o, n, 0, null, i),
  31793. o.pop(),
  31794. r = o[o.length - 1]);
  31795. return o
  31796. }
  31797. for (p(e, i),
  31798. u = [],
  31799. s = 0,
  31800. h = m(t, e.length); 0 <= h ? s < h : h < s; 0 <= h ? ++s : --s)
  31801. u.push(f(e, i));
  31802. return u
  31803. }
  31804. ,
  31805. h = function(e, t, i, n) {
  31806. var r, o, a;
  31807. for (null == n && (n = d),
  31808. r = e[i]; t < i && n(r, o = e[a = i - 1 >> 1]) < 0; )
  31809. e[i] = o,
  31810. i = a;
  31811. return e[i] = r
  31812. }
  31813. ,
  31814. u = function(e, t, i) {
  31815. var n, r, o, a, s;
  31816. for (null == i && (i = d),
  31817. r = e.length,
  31818. o = e[s = t],
  31819. n = 2 * t + 1; n < r; )
  31820. (a = n + 1) < r && !(i(e[n], e[a]) < 0) && (n = a),
  31821. e[t] = e[n],
  31822. n = 2 * (t = n) + 1;
  31823. return e[t] = o,
  31824. h(e, s, t, i)
  31825. }
  31826. ,
  31827. v.push = t,
  31828. v.pop = f,
  31829. v.replace = i,
  31830. v.pushpop = c,
  31831. v.heapify = p,
  31832. v.updateItem = o,
  31833. v.nlargest = n,
  31834. v.nsmallest = r,
  31835. v.prototype.push = function(e) {
  31836. return t(this.nodes, e, this.cmp)
  31837. }
  31838. ,
  31839. v.prototype.pop = function() {
  31840. return f(this.nodes, this.cmp)
  31841. }
  31842. ,
  31843. v.prototype.peek = function() {
  31844. return this.nodes[0]
  31845. }
  31846. ,
  31847. v.prototype.contains = function(e) {
  31848. return -1 !== this.nodes.indexOf(e)
  31849. }
  31850. ,
  31851. v.prototype.replace = function(e) {
  31852. return i(this.nodes, e, this.cmp)
  31853. }
  31854. ,
  31855. v.prototype.pushpop = function(e) {
  31856. return c(this.nodes, e, this.cmp)
  31857. }
  31858. ,
  31859. v.prototype.heapify = function() {
  31860. return p(this.nodes, this.cmp)
  31861. }
  31862. ,
  31863. v.prototype.updateItem = function(e) {
  31864. return o(this.nodes, e, this.cmp)
  31865. }
  31866. ,
  31867. v.prototype.clear = function() {
  31868. return this.nodes = []
  31869. }
  31870. ,
  31871. v.prototype.empty = function() {
  31872. return 0 === this.nodes.length
  31873. }
  31874. ,
  31875. v.prototype.size = function() {
  31876. return this.nodes.length
  31877. }
  31878. ,
  31879. v.prototype.clone = function() {
  31880. var e;
  31881. return (e = new v).nodes = this.nodes.slice(0),
  31882. e
  31883. }
  31884. ,
  31885. v.prototype.toArray = function() {
  31886. return this.nodes.slice(0)
  31887. }
  31888. ,
  31889. v.prototype.insert = v.prototype.push,
  31890. v.prototype.top = v.prototype.peek,
  31891. v.prototype.front = v.prototype.peek,
  31892. v.prototype.has = v.prototype.contains,
  31893. v.prototype.copy = v.prototype.clone,
  31894. e = v,
  31895. a = this,
  31896. s = function() {
  31897. return e
  31898. }
  31899. ,
  31900. "function" == typeof define && define.amd ? define([], s) : "object" == typeof A ? y.exports = s() : a.Heap = s()
  31901. }
  31902. ).call(this)
  31903. }
  31904. , {}],
  31905. 213: [function(e, t, i) {
  31906. function n() {}
  31907. function o(e) {
  31908. if ("object" != typeof this)
  31909. throw new TypeError("Promises must be constructed via new");
  31910. if ("function" != typeof e)
  31911. throw new TypeError("not a function");
  31912. this._state = 0,
  31913. this._handled = !1,
  31914. this._value = void 0,
  31915. this._deferreds = [],
  31916. h(e, this)
  31917. }
  31918. function r(i, n) {
  31919. for (; 3 === i._state; )
  31920. i = i._value;
  31921. return 0 === i._state ? void i._deferreds.push(n) : (i._handled = !0,
  31922. void o._immediateFn(function() {
  31923. var e = 1 === i._state ? n.onFulfilled : n.onRejected;
  31924. if (null !== e) {
  31925. var t;
  31926. try {
  31927. t = e(i._value)
  31928. } catch (e) {
  31929. return void s(n.promise, e)
  31930. }
  31931. a(n.promise, t)
  31932. } else
  31933. (1 === i._state ? a : s)(n.promise, i._value)
  31934. }))
  31935. }
  31936. function a(e, t) {
  31937. try {
  31938. if (t === e)
  31939. throw new TypeError("A promise cannot be resolved with itself.");
  31940. if (t && ("object" == typeof t || "function" == typeof t)) {
  31941. var i = t.then;
  31942. if (t instanceof o)
  31943. return e._state = 3,
  31944. e._value = t,
  31945. void l(e);
  31946. if ("function" == typeof i)
  31947. return void h(function(e, t) {
  31948. return function() {
  31949. e.apply(t, arguments)
  31950. }
  31951. }(i, t), e)
  31952. }
  31953. e._state = 1,
  31954. e._value = t,
  31955. l(e)
  31956. } catch (t) {
  31957. s(e, t)
  31958. }
  31959. }
  31960. function s(e, t) {
  31961. e._state = 2,
  31962. e._value = t,
  31963. l(e)
  31964. }
  31965. function l(e) {
  31966. 2 === e._state && 0 === e._deferreds.length && o._immediateFn(function() {
  31967. e._handled || o._unhandledRejectionFn(e._value)
  31968. });
  31969. for (var t = 0, i = e._deferreds.length; t < i; t++)
  31970. r(e, e._deferreds[t]);
  31971. e._deferreds = null
  31972. }
  31973. function c(e, t, i) {
  31974. this.onFulfilled = "function" == typeof e ? e : null,
  31975. this.onRejected = "function" == typeof t ? t : null,
  31976. this.promise = i
  31977. }
  31978. function h(e, t) {
  31979. var i = !1;
  31980. try {
  31981. e(function(e) {
  31982. i || (i = !0,
  31983. a(t, e))
  31984. }, function(e) {
  31985. i || (i = !0,
  31986. s(t, e))
  31987. })
  31988. } catch (e) {
  31989. if (i)
  31990. return;
  31991. i = !0,
  31992. s(t, e)
  31993. }
  31994. }
  31995. var u, d;
  31996. u = this,
  31997. d = setTimeout,
  31998. o.prototype.catch = function(e) {
  31999. return this.then(null, e)
  32000. }
  32001. ,
  32002. o.prototype.then = function(e, t) {
  32003. var i = new this.constructor(n);
  32004. return r(this, new c(e,t,i)),
  32005. i
  32006. }
  32007. ,
  32008. o.all = function(e) {
  32009. var s = Array.prototype.slice.call(e);
  32010. return new o(function(n, r) {
  32011. function o(t, e) {
  32012. try {
  32013. if (e && ("object" == typeof e || "function" == typeof e)) {
  32014. var i = e.then;
  32015. if ("function" == typeof i)
  32016. return void i.call(e, function(e) {
  32017. o(t, e)
  32018. }, r)
  32019. }
  32020. s[t] = e,
  32021. 0 == --a && n(s)
  32022. } catch (e) {
  32023. r(e)
  32024. }
  32025. }
  32026. if (0 === s.length)
  32027. return n([]);
  32028. for (var a = s.length, e = 0; e < s.length; e++)
  32029. o(e, s[e])
  32030. }
  32031. )
  32032. }
  32033. ,
  32034. o.resolve = function(t) {
  32035. return t && "object" == typeof t && t.constructor === o ? t : new o(function(e) {
  32036. e(t)
  32037. }
  32038. )
  32039. }
  32040. ,
  32041. o.reject = function(i) {
  32042. return new o(function(e, t) {
  32043. t(i)
  32044. }
  32045. )
  32046. }
  32047. ,
  32048. o.race = function(r) {
  32049. return new o(function(e, t) {
  32050. for (var i = 0, n = r.length; i < n; i++)
  32051. r[i].then(e, t)
  32052. }
  32053. )
  32054. }
  32055. ,
  32056. o._immediateFn = "function" == typeof setImmediate && function(e) {
  32057. setImmediate(e)
  32058. }
  32059. || function(e) {
  32060. d(e, 0)
  32061. }
  32062. ,
  32063. o._unhandledRejectionFn = function(e) {
  32064. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  32065. }
  32066. ,
  32067. o._setImmediateFn = function(e) {
  32068. o._immediateFn = e
  32069. }
  32070. ,
  32071. o._setUnhandledRejectionFn = function(e) {
  32072. o._unhandledRejectionFn = e
  32073. }
  32074. ,
  32075. void 0 !== t && t.exports ? t.exports = o : u.Promise || (u.Promise = o)
  32076. }
  32077. , {}],
  32078. 214: [function(p, i, e) {
  32079. (function(d) {
  32080. var e, t;
  32081. e = this,
  32082. t = function(I, e) {
  32083. "use strict";
  32084. var a, t, u, i, s, n, r, o = {};
  32085. return o.ByteBuffer = I,
  32086. o.Long = I.Long || null,
  32087. o.VERSION = "5.0.1",
  32088. o.WIRE_TYPES = {},
  32089. o.WIRE_TYPES.VARINT = 0,
  32090. o.WIRE_TYPES.BITS64 = 1,
  32091. o.WIRE_TYPES.LDELIM = 2,
  32092. o.WIRE_TYPES.STARTGROUP = 3,
  32093. o.WIRE_TYPES.ENDGROUP = 4,
  32094. o.WIRE_TYPES.BITS32 = 5,
  32095. o.PACKABLE_WIRE_TYPES = [o.WIRE_TYPES.VARINT, o.WIRE_TYPES.BITS64, o.WIRE_TYPES.BITS32],
  32096. o.TYPES = {
  32097. int32: {
  32098. name: "int32",
  32099. wireType: o.WIRE_TYPES.VARINT,
  32100. defaultValue: 0
  32101. },
  32102. uint32: {
  32103. name: "uint32",
  32104. wireType: o.WIRE_TYPES.VARINT,
  32105. defaultValue: 0
  32106. },
  32107. sint32: {
  32108. name: "sint32",
  32109. wireType: o.WIRE_TYPES.VARINT,
  32110. defaultValue: 0
  32111. },
  32112. int64: {
  32113. name: "int64",
  32114. wireType: o.WIRE_TYPES.VARINT,
  32115. defaultValue: o.Long ? o.Long.ZERO : void 0
  32116. },
  32117. uint64: {
  32118. name: "uint64",
  32119. wireType: o.WIRE_TYPES.VARINT,
  32120. defaultValue: o.Long ? o.Long.UZERO : void 0
  32121. },
  32122. sint64: {
  32123. name: "sint64",
  32124. wireType: o.WIRE_TYPES.VARINT,
  32125. defaultValue: o.Long ? o.Long.ZERO : void 0
  32126. },
  32127. bool: {
  32128. name: "bool",
  32129. wireType: o.WIRE_TYPES.VARINT,
  32130. defaultValue: !1
  32131. },
  32132. double: {
  32133. name: "double",
  32134. wireType: o.WIRE_TYPES.BITS64,
  32135. defaultValue: 0
  32136. },
  32137. string: {
  32138. name: "string",
  32139. wireType: o.WIRE_TYPES.LDELIM,
  32140. defaultValue: ""
  32141. },
  32142. bytes: {
  32143. name: "bytes",
  32144. wireType: o.WIRE_TYPES.LDELIM,
  32145. defaultValue: null
  32146. },
  32147. fixed32: {
  32148. name: "fixed32",
  32149. wireType: o.WIRE_TYPES.BITS32,
  32150. defaultValue: 0
  32151. },
  32152. sfixed32: {
  32153. name: "sfixed32",
  32154. wireType: o.WIRE_TYPES.BITS32,
  32155. defaultValue: 0
  32156. },
  32157. fixed64: {
  32158. name: "fixed64",
  32159. wireType: o.WIRE_TYPES.BITS64,
  32160. defaultValue: o.Long ? o.Long.UZERO : void 0
  32161. },
  32162. sfixed64: {
  32163. name: "sfixed64",
  32164. wireType: o.WIRE_TYPES.BITS64,
  32165. defaultValue: o.Long ? o.Long.ZERO : void 0
  32166. },
  32167. float: {
  32168. name: "float",
  32169. wireType: o.WIRE_TYPES.BITS32,
  32170. defaultValue: 0
  32171. },
  32172. enum: {
  32173. name: "enum",
  32174. wireType: o.WIRE_TYPES.VARINT,
  32175. defaultValue: 0
  32176. },
  32177. message: {
  32178. name: "message",
  32179. wireType: o.WIRE_TYPES.LDELIM,
  32180. defaultValue: null
  32181. },
  32182. group: {
  32183. name: "group",
  32184. wireType: o.WIRE_TYPES.STARTGROUP,
  32185. defaultValue: null
  32186. }
  32187. },
  32188. 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],
  32189. o.ID_MIN = 1,
  32190. o.ID_MAX = 536870911,
  32191. o.convertFieldsToCamelCase = !1,
  32192. o.populateAccessors = !0,
  32193. o.populateDefaults = !0,
  32194. o.Util = ((r = {}).IS_NODE = !("object" != typeof d || d + "" != "[object process]" || d.browser),
  32195. r.XHR = function() {
  32196. for (var e = [function() {
  32197. return new XMLHttpRequest
  32198. }
  32199. , function() {
  32200. return new ActiveXObject("Msxml2.XMLHTTP")
  32201. }
  32202. , function() {
  32203. return new ActiveXObject("Msxml3.XMLHTTP")
  32204. }
  32205. , function() {
  32206. return new ActiveXObject("Microsoft.XMLHTTP")
  32207. }
  32208. ], t = null, i = 0; i < e.length; i++) {
  32209. try {
  32210. t = e[i]()
  32211. } catch (e) {
  32212. continue
  32213. }
  32214. break
  32215. }
  32216. if (!t)
  32217. throw Error("XMLHttpRequest is not supported");
  32218. return t
  32219. }
  32220. ,
  32221. r.fetch = function(e, i) {
  32222. if (i && "function" != typeof i && (i = null),
  32223. r.IS_NODE) {
  32224. var t = p("fs");
  32225. if (i)
  32226. t.readFile(e, function(e, t) {
  32227. i(e ? null : "" + t)
  32228. });
  32229. else
  32230. try {
  32231. return t.readFileSync(e)
  32232. } catch (e) {
  32233. return null
  32234. }
  32235. } else {
  32236. var n = r.XHR();
  32237. if (n.open("GET", e, !!i),
  32238. n.setRequestHeader("Accept", "text/plain"),
  32239. "function" == typeof n.overrideMimeType && n.overrideMimeType("text/plain"),
  32240. !i)
  32241. return n.send(null),
  32242. 200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null;
  32243. if (n.onreadystatechange = function() {
  32244. 4 == n.readyState && i(200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null)
  32245. }
  32246. ,
  32247. 4 == n.readyState)
  32248. return;
  32249. n.send(null)
  32250. }
  32251. }
  32252. ,
  32253. r.toCamelCase = function(e) {
  32254. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  32255. return t.toUpperCase()
  32256. })
  32257. }
  32258. ,
  32259. r),
  32260. o.Lang = {
  32261. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  32262. RULE: /^(?:required|optional|repeated|map)$/,
  32263. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  32264. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  32265. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  32266. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  32267. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  32268. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  32269. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  32270. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  32271. NUMBER_OCT: /^0[0-7]+$/,
  32272. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  32273. BOOL: /^(?:true|false)$/i,
  32274. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32275. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32276. WHITESPACE: /\s/,
  32277. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  32278. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  32279. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  32280. },
  32281. o.DotProto = function(r, a) {
  32282. function s(e, t) {
  32283. var i = -1
  32284. , n = 1;
  32285. if ("-" == e.charAt(0) && (n = -1,
  32286. e = e.substring(1)),
  32287. a.NUMBER_DEC.test(e))
  32288. i = parseInt(e);
  32289. else if (a.NUMBER_HEX.test(e))
  32290. i = parseInt(e.substring(2), 16);
  32291. else {
  32292. if (!a.NUMBER_OCT.test(e))
  32293. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32294. i = parseInt(e.substring(1), 8)
  32295. }
  32296. if (i = n * i | 0,
  32297. !t && i < 0)
  32298. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32299. return i
  32300. }
  32301. function o(e) {
  32302. var t = 1;
  32303. if ("-" == e.charAt(0) && (t = -1,
  32304. e = e.substring(1)),
  32305. a.NUMBER_DEC.test(e))
  32306. return t * parseInt(e, 10);
  32307. if (a.NUMBER_HEX.test(e))
  32308. return t * parseInt(e.substring(2), 16);
  32309. if (a.NUMBER_OCT.test(e))
  32310. return t * parseInt(e.substring(1), 8);
  32311. if ("inf" === e)
  32312. return t * (1 / 0);
  32313. if ("nan" === e)
  32314. return NaN;
  32315. if (a.NUMBER_FLT.test(e))
  32316. return t * parseFloat(e);
  32317. throw Error("illegal number value: " + (t < 0 ? "-" : "") + e)
  32318. }
  32319. function n(e, t, i) {
  32320. void 0 === e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  32321. e[t].push(i))
  32322. }
  32323. function t(e) {
  32324. this.source = e + "",
  32325. this.index = 0,
  32326. this.line = 1,
  32327. this.stack = [],
  32328. this._stringOpen = null
  32329. }
  32330. var e = {}
  32331. , i = t.prototype;
  32332. i._readString = function() {
  32333. var e = '"' === this._stringOpen ? a.STRING_DQ : a.STRING_SQ;
  32334. e.lastIndex = this.index - 1;
  32335. var t = e.exec(this.source);
  32336. if (!t)
  32337. throw Error("unterminated string");
  32338. return this.index = e.lastIndex,
  32339. this.stack.push(this._stringOpen),
  32340. this._stringOpen = null,
  32341. t[1]
  32342. }
  32343. ,
  32344. i.next = function() {
  32345. if (0 < this.stack.length)
  32346. return this.stack.shift();
  32347. if (this.index >= this.source.length)
  32348. return null;
  32349. if (null !== this._stringOpen)
  32350. return this._readString();
  32351. var e, t, i;
  32352. do {
  32353. for (e = !1; a.WHITESPACE.test(i = this.source.charAt(this.index)); )
  32354. if ("\n" === i && ++this.line,
  32355. ++this.index === this.source.length)
  32356. return null;
  32357. if ("/" === this.source.charAt(this.index))
  32358. if (++this.index,
  32359. "/" === this.source.charAt(this.index)) {
  32360. for (; "\n" !== this.source.charAt(++this.index); )
  32361. if (this.index == this.source.length)
  32362. return null;
  32363. ++this.index,
  32364. ++this.line,
  32365. e = !0
  32366. } else {
  32367. if ("*" !== (i = this.source.charAt(this.index)))
  32368. return "/";
  32369. do {
  32370. if ("\n" === i && ++this.line,
  32371. ++this.index === this.source.length)
  32372. return null;
  32373. t = i,
  32374. i = this.source.charAt(this.index)
  32375. } while ("*" !== t || "/" !== i);++this.index,
  32376. e = !0
  32377. }
  32378. } while (e);if (this.index === this.source.length)
  32379. return null;
  32380. var n = this.index;
  32381. if (a.DELIM.lastIndex = 0,
  32382. !a.DELIM.test(this.source.charAt(n++)))
  32383. for (; n < this.source.length && !a.DELIM.test(this.source.charAt(n)); )
  32384. ++n;
  32385. var r = this.source.substring(this.index, this.index = n);
  32386. return '"' !== r && "'" !== r || (this._stringOpen = r),
  32387. r
  32388. }
  32389. ,
  32390. i.peek = function() {
  32391. if (0 === this.stack.length) {
  32392. var e = this.next();
  32393. if (null === e)
  32394. return null;
  32395. this.stack.push(e)
  32396. }
  32397. return this.stack[0]
  32398. }
  32399. ,
  32400. i.skip = function(e) {
  32401. var t = this.next();
  32402. if (t !== e)
  32403. throw Error("illegal '" + t + "', '" + e + "' expected")
  32404. }
  32405. ,
  32406. i.omit = function(e) {
  32407. return this.peek() === e && (this.next(),
  32408. !0)
  32409. }
  32410. ,
  32411. i.toString = function() {
  32412. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  32413. }
  32414. ,
  32415. e.Tokenizer = t;
  32416. function l(e) {
  32417. this.tn = new t(e),
  32418. this.proto3 = !1
  32419. }
  32420. var c = l.prototype;
  32421. return c.parse = function() {
  32422. var e, t, i = {
  32423. name: "[ROOT]",
  32424. package: null,
  32425. messages: [],
  32426. enums: [],
  32427. imports: [],
  32428. options: {},
  32429. services: []
  32430. }, n = !0;
  32431. try {
  32432. for (; e = this.tn.next(); )
  32433. switch (e) {
  32434. case "package":
  32435. if (!n || null !== i.package)
  32436. throw Error("unexpected 'package'");
  32437. if (e = this.tn.next(),
  32438. !a.TYPEREF.test(e))
  32439. throw Error("illegal package name: " + e);
  32440. this.tn.skip(";"),
  32441. i.package = e;
  32442. break;
  32443. case "import":
  32444. if (!n)
  32445. throw Error("unexpected 'import'");
  32446. "public" !== (e = this.tn.peek()) && !(t = "weak" === e) || this.tn.next(),
  32447. e = this._readString(),
  32448. this.tn.skip(";"),
  32449. t || i.imports.push(e);
  32450. break;
  32451. case "syntax":
  32452. if (!n)
  32453. throw Error("unexpected 'syntax'");
  32454. this.tn.skip("="),
  32455. "proto3" === (i.syntax = this._readString()) && (this.proto3 = !0),
  32456. this.tn.skip(";");
  32457. break;
  32458. case "message":
  32459. this._parseMessage(i, null),
  32460. n = !1;
  32461. break;
  32462. case "enum":
  32463. this._parseEnum(i),
  32464. n = !1;
  32465. break;
  32466. case "option":
  32467. this._parseOption(i);
  32468. break;
  32469. case "service":
  32470. this._parseService(i);
  32471. break;
  32472. case "extend":
  32473. this._parseExtend(i);
  32474. break;
  32475. default:
  32476. throw Error("unexpected '" + e + "'")
  32477. }
  32478. } catch (e) {
  32479. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  32480. e
  32481. }
  32482. return delete i.name,
  32483. i
  32484. }
  32485. ,
  32486. l.parse = function(e) {
  32487. return new l(e).parse()
  32488. }
  32489. ,
  32490. c._readString = function() {
  32491. var e, t, i = "";
  32492. do {
  32493. if ("'" !== (t = this.tn.next()) && '"' !== t)
  32494. throw Error("illegal string delimiter: " + t);
  32495. i += this.tn.next(),
  32496. this.tn.skip(t),
  32497. e = this.tn.peek()
  32498. } while ('"' === e || '"' === e);return i
  32499. }
  32500. ,
  32501. c._readValue = function(e) {
  32502. var t = this.tn.peek();
  32503. if ('"' === t || "'" === t)
  32504. return this._readString();
  32505. if (this.tn.next(),
  32506. a.NUMBER.test(t))
  32507. return o(t);
  32508. if (a.BOOL.test(t))
  32509. return "true" === t.toLowerCase();
  32510. if (e && a.TYPEREF.test(t))
  32511. return t;
  32512. throw Error("illegal value: " + t)
  32513. }
  32514. ,
  32515. c._parseOption = function(e, t) {
  32516. var i = this.tn.next()
  32517. , n = !1;
  32518. if ("(" === i && (n = !0,
  32519. i = this.tn.next()),
  32520. !a.TYPEREF.test(i))
  32521. throw Error("illegal option name: " + i);
  32522. var r = i;
  32523. n && (this.tn.skip(")"),
  32524. r = "(" + r + ")",
  32525. i = this.tn.peek(),
  32526. a.FQTYPEREF.test(i) && (r += i,
  32527. this.tn.next())),
  32528. this.tn.skip("="),
  32529. this._parseOptionValue(e, r),
  32530. t || this.tn.skip(";")
  32531. }
  32532. ,
  32533. c._parseOptionValue = function(e, t) {
  32534. var i = this.tn.peek();
  32535. if ("{" !== i)
  32536. n(e.options, t, this._readValue(!0));
  32537. else
  32538. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); ) {
  32539. if (!a.NAME.test(i))
  32540. throw Error("illegal option name: " + t + "." + i);
  32541. this.tn.omit(":") ? n(e.options, t + "." + i, this._readValue(!0)) : this._parseOptionValue(e, t + "." + i)
  32542. }
  32543. }
  32544. ,
  32545. c._parseService = function(e) {
  32546. var t = this.tn.next();
  32547. if (!a.NAME.test(t))
  32548. throw Error("illegal service name at line " + this.tn.line + ": " + t);
  32549. var i = {
  32550. name: t,
  32551. rpc: {},
  32552. options: {}
  32553. };
  32554. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32555. if ("option" === t)
  32556. this._parseOption(i);
  32557. else {
  32558. if ("rpc" !== t)
  32559. throw Error("illegal service token: " + t);
  32560. this._parseServiceRPC(i)
  32561. }
  32562. this.tn.omit(";"),
  32563. e.services.push(i)
  32564. }
  32565. ,
  32566. c._parseServiceRPC = function(e) {
  32567. var t = this.tn.next();
  32568. if (!a.NAME.test(t))
  32569. throw Error("illegal rpc service method name: " + t);
  32570. var i = t
  32571. , n = {
  32572. request: null,
  32573. response: null,
  32574. request_stream: !1,
  32575. response_stream: !1,
  32576. options: {}
  32577. };
  32578. if (this.tn.skip("("),
  32579. "stream" === (t = this.tn.next()).toLowerCase() && (n.request_stream = !0,
  32580. t = this.tn.next()),
  32581. !a.TYPEREF.test(t))
  32582. throw Error("illegal rpc service request type: " + t);
  32583. if (n.request = t,
  32584. this.tn.skip(")"),
  32585. "returns" !== (t = this.tn.next()).toLowerCase())
  32586. throw Error("illegal rpc service request type delimiter: " + t);
  32587. if (this.tn.skip("("),
  32588. "stream" === (t = this.tn.next()).toLowerCase() && (n.response_stream = !0,
  32589. t = this.tn.next()),
  32590. n.response = t,
  32591. this.tn.skip(")"),
  32592. "{" === (t = this.tn.peek())) {
  32593. for (this.tn.next(); "}" !== (t = this.tn.next()); ) {
  32594. if ("option" !== t)
  32595. throw Error("illegal rpc service token: " + t);
  32596. this._parseOption(n)
  32597. }
  32598. this.tn.omit(";")
  32599. } else
  32600. this.tn.skip(";");
  32601. void 0 === e.rpc && (e.rpc = {}),
  32602. e.rpc[i] = n
  32603. }
  32604. ,
  32605. c._parseMessage = function(e, t) {
  32606. var i = !!t
  32607. , n = this.tn.next()
  32608. , r = {
  32609. name: "",
  32610. fields: [],
  32611. enums: [],
  32612. messages: [],
  32613. options: {},
  32614. services: [],
  32615. oneofs: {}
  32616. };
  32617. if (!a.NAME.test(n))
  32618. throw Error("illegal " + (i ? "group" : "message") + " name: " + n);
  32619. for (r.name = n,
  32620. i && (this.tn.skip("="),
  32621. t.id = s(this.tn.next()),
  32622. r.isGroup = !0),
  32623. "[" === (n = this.tn.peek()) && t && this._parseFieldOptions(t),
  32624. this.tn.skip("{"); "}" !== (n = this.tn.next()); )
  32625. if (a.RULE.test(n))
  32626. this._parseMessageField(r, n);
  32627. else if ("oneof" === n)
  32628. this._parseMessageOneOf(r);
  32629. else if ("enum" === n)
  32630. this._parseEnum(r);
  32631. else if ("message" === n)
  32632. this._parseMessage(r);
  32633. else if ("option" === n)
  32634. this._parseOption(r);
  32635. else if ("service" === n)
  32636. this._parseService(r);
  32637. else if ("extensions" === n)
  32638. r.extensions = this._parseExtensionRanges();
  32639. else if ("reserved" === n)
  32640. this._parseIgnored();
  32641. else if ("extend" === n)
  32642. this._parseExtend(r);
  32643. else {
  32644. if (!a.TYPEREF.test(n))
  32645. throw Error("illegal message token: " + n);
  32646. if (!this.proto3)
  32647. throw Error("illegal field rule: " + n);
  32648. this._parseMessageField(r, "optional", n)
  32649. }
  32650. return this.tn.omit(";"),
  32651. e.messages.push(r),
  32652. r
  32653. }
  32654. ,
  32655. c._parseIgnored = function() {
  32656. for (; ";" !== this.tn.peek(); )
  32657. this.tn.next();
  32658. this.tn.skip(";")
  32659. }
  32660. ,
  32661. c._parseMessageField = function(e, t, i) {
  32662. if (!a.RULE.test(t))
  32663. throw Error("illegal message field rule: " + t);
  32664. var n, r = {
  32665. rule: t,
  32666. type: "",
  32667. name: "",
  32668. options: {},
  32669. id: 0
  32670. };
  32671. if ("map" === t) {
  32672. if (i)
  32673. throw Error("illegal type: " + i);
  32674. if (this.tn.skip("<"),
  32675. n = this.tn.next(),
  32676. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32677. throw Error("illegal message field type: " + n);
  32678. if (r.keytype = n,
  32679. this.tn.skip(","),
  32680. n = this.tn.next(),
  32681. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32682. throw Error("illegal message field: " + n);
  32683. if (r.type = n,
  32684. this.tn.skip(">"),
  32685. n = this.tn.next(),
  32686. !a.NAME.test(n))
  32687. throw Error("illegal message field name: " + n);
  32688. r.name = n,
  32689. this.tn.skip("="),
  32690. r.id = s(this.tn.next()),
  32691. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32692. this.tn.skip(";")
  32693. } else if ("group" === (i = void 0 !== i ? i : this.tn.next())) {
  32694. var o = this._parseMessage(e, r);
  32695. if (!/^[A-Z]/.test(o.name))
  32696. throw Error("illegal group name: " + o.name);
  32697. r.type = o.name,
  32698. r.name = o.name.toLowerCase(),
  32699. this.tn.omit(";")
  32700. } else {
  32701. if (!a.TYPE.test(i) && !a.TYPEREF.test(i))
  32702. throw Error("illegal message field type: " + i);
  32703. if (r.type = i,
  32704. n = this.tn.next(),
  32705. !a.NAME.test(n))
  32706. throw Error("illegal message field name: " + n);
  32707. r.name = n,
  32708. this.tn.skip("="),
  32709. r.id = s(this.tn.next()),
  32710. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32711. this.tn.skip(";")
  32712. }
  32713. return e.fields.push(r),
  32714. r
  32715. }
  32716. ,
  32717. c._parseMessageOneOf = function(e) {
  32718. var t = this.tn.next();
  32719. if (!a.NAME.test(t))
  32720. throw Error("illegal oneof name: " + t);
  32721. var i, n = t, r = [];
  32722. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32723. (i = this._parseMessageField(e, "optional", t)).oneof = n,
  32724. r.push(i.id);
  32725. this.tn.omit(";"),
  32726. e.oneofs[n] = r
  32727. }
  32728. ,
  32729. c._parseFieldOptions = function(e) {
  32730. this.tn.skip("[");
  32731. for (var t = !0; "]" !== this.tn.peek(); )
  32732. t || this.tn.skip(","),
  32733. this._parseOption(e, !0),
  32734. t = !1;
  32735. this.tn.next()
  32736. }
  32737. ,
  32738. c._parseEnum = function(e) {
  32739. var t = {
  32740. name: "",
  32741. values: [],
  32742. options: {}
  32743. }
  32744. , i = this.tn.next();
  32745. if (!a.NAME.test(i))
  32746. throw Error("illegal name: " + i);
  32747. for (t.name = i,
  32748. this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32749. if ("option" === i)
  32750. this._parseOption(t);
  32751. else {
  32752. if (!a.NAME.test(i))
  32753. throw Error("illegal name: " + i);
  32754. this.tn.skip("=");
  32755. var n = {
  32756. name: i,
  32757. id: s(this.tn.next(), !0)
  32758. };
  32759. "[" === (i = this.tn.peek()) && this._parseFieldOptions({
  32760. options: {}
  32761. }),
  32762. this.tn.skip(";"),
  32763. t.values.push(n)
  32764. }
  32765. this.tn.omit(";"),
  32766. e.enums.push(t)
  32767. }
  32768. ,
  32769. c._parseExtensionRanges = function() {
  32770. var e, t, i, n = [];
  32771. do {
  32772. for (t = []; ; ) {
  32773. switch (e = this.tn.next()) {
  32774. case "min":
  32775. i = r.ID_MIN;
  32776. break;
  32777. case "max":
  32778. i = r.ID_MAX;
  32779. break;
  32780. default:
  32781. i = o(e)
  32782. }
  32783. if (t.push(i),
  32784. 2 === t.length)
  32785. break;
  32786. if ("to" !== this.tn.peek()) {
  32787. t.push(i);
  32788. break
  32789. }
  32790. this.tn.next()
  32791. }
  32792. n.push(t)
  32793. } while (this.tn.omit(","));return this.tn.skip(";"),
  32794. n
  32795. }
  32796. ,
  32797. c._parseExtend = function(e) {
  32798. var t = this.tn.next();
  32799. if (!a.TYPEREF.test(t))
  32800. throw Error("illegal extend reference: " + t);
  32801. var i = {
  32802. ref: t,
  32803. fields: []
  32804. };
  32805. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32806. if (a.RULE.test(t))
  32807. this._parseMessageField(i, t);
  32808. else {
  32809. if (!a.TYPEREF.test(t))
  32810. throw Error("illegal extend token: " + t);
  32811. if (!this.proto3)
  32812. throw Error("illegal field rule: " + t);
  32813. this._parseMessageField(i, "optional", t)
  32814. }
  32815. return this.tn.omit(";"),
  32816. e.messages.push(i),
  32817. i
  32818. }
  32819. ,
  32820. c.toString = function() {
  32821. return "Parser at line " + this.tn.line
  32822. }
  32823. ,
  32824. e.Parser = l,
  32825. e
  32826. }(o, o.Lang),
  32827. o.Reflect = function(g) {
  32828. function a(e, t) {
  32829. if (e && "number" == typeof e.low && "number" == typeof e.high && "boolean" == typeof e.unsigned && e.low == e.low && e.high == e.high)
  32830. return new g.Long(e.low,e.high,void 0 === t ? e.unsigned : t);
  32831. if ("string" == typeof e)
  32832. return g.Long.fromString(e, t || !1, 10);
  32833. if ("number" == typeof e)
  32834. return g.Long.fromNumber(e, t || !1);
  32835. throw Error("not convertible to Long")
  32836. }
  32837. function m(e, t) {
  32838. var i = t.readVarint32()
  32839. , n = 7 & i
  32840. , r = i >>> 3;
  32841. switch (n) {
  32842. case g.WIRE_TYPES.VARINT:
  32843. for (; 128 == (128 & (i = t.readUint8())); )
  32844. ;
  32845. break;
  32846. case g.WIRE_TYPES.BITS64:
  32847. t.offset += 8;
  32848. break;
  32849. case g.WIRE_TYPES.LDELIM:
  32850. i = t.readVarint32(),
  32851. t.offset += i;
  32852. break;
  32853. case g.WIRE_TYPES.STARTGROUP:
  32854. m(r, t);
  32855. break;
  32856. case g.WIRE_TYPES.ENDGROUP:
  32857. if (r === e)
  32858. return !1;
  32859. throw Error("Illegal GROUPEND after unknown group: " + r + " (" + e + " expected)");
  32860. case g.WIRE_TYPES.BITS32:
  32861. t.offset += 4;
  32862. break;
  32863. default:
  32864. throw Error("Illegal wire type in unknown group " + e + ": " + n)
  32865. }
  32866. return !0
  32867. }
  32868. function h(e, t, i) {
  32869. this.builder = e,
  32870. this.parent = t,
  32871. this.name = i,
  32872. this.className
  32873. }
  32874. var s = {}
  32875. , e = h.prototype;
  32876. e.fqn = function() {
  32877. for (var e = this.name, t = this; null != (t = t.parent); )
  32878. e = t.name + "." + e;
  32879. return e
  32880. }
  32881. ,
  32882. e.toString = function(e) {
  32883. return (e ? this.className + " " : "") + this.fqn()
  32884. }
  32885. ,
  32886. e.build = function() {
  32887. throw Error(this.toString(!0) + " cannot be built directly")
  32888. }
  32889. ,
  32890. s.T = h;
  32891. function l(e, t, i, n, r) {
  32892. h.call(this, e, t, i),
  32893. this.className = "Namespace",
  32894. this.children = [],
  32895. this.options = n || {},
  32896. this.syntax = r || "proto2"
  32897. }
  32898. var t = l.prototype = Object.create(h.prototype);
  32899. t.getChildren = function(e) {
  32900. if (null == (e = e || null))
  32901. return this.children.slice();
  32902. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  32903. this.children[i]instanceof e && t.push(this.children[i]);
  32904. return t
  32905. }
  32906. ,
  32907. t.addChild = function(e) {
  32908. var t;
  32909. if (t = this.getChild(e.name))
  32910. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  32911. t.name = t.originalName;
  32912. else {
  32913. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  32914. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  32915. e.name = e.originalName
  32916. }
  32917. this.children.push(e)
  32918. }
  32919. ,
  32920. t.getChild = function(e) {
  32921. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  32922. if (this.children[i][t] === e)
  32923. return this.children[i];
  32924. return null
  32925. }
  32926. ,
  32927. t.resolve = function(e, t) {
  32928. var i, n = "string" == typeof e ? e.split(".") : e, r = this, o = 0;
  32929. if ("" === n[o]) {
  32930. for (; null !== r.parent; )
  32931. r = r.parent;
  32932. o++
  32933. }
  32934. do {
  32935. do {
  32936. if (!(r instanceof s.Namespace)) {
  32937. r = null;
  32938. break
  32939. }
  32940. if (!(i = r.getChild(n[o])) || !(i instanceof s.T) || t && !(i instanceof s.Namespace)) {
  32941. r = null;
  32942. break
  32943. }
  32944. r = i,
  32945. o++
  32946. } while (o < n.length);if (null != r)
  32947. break;
  32948. if (null !== this.parent)
  32949. return this.parent.resolve(e, t)
  32950. } while (null != r);return r
  32951. }
  32952. ,
  32953. t.qn = function(e) {
  32954. for (var t = [], i = e; t.unshift(i.name),
  32955. null !== (i = i.parent); )
  32956. ;
  32957. for (var n = 1; n <= t.length; n++) {
  32958. var r = t.slice(t.length - n);
  32959. if (e === this.resolve(r, e instanceof s.Namespace))
  32960. return r.join(".")
  32961. }
  32962. return e.fqn()
  32963. }
  32964. ,
  32965. t.build = function() {
  32966. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  32967. (e = i[n])instanceof l && (t[e.name] = e.build());
  32968. return Object.defineProperty && Object.defineProperty(t, "$options", {
  32969. value: this.buildOpt()
  32970. }),
  32971. t
  32972. }
  32973. ,
  32974. t.buildOpt = function() {
  32975. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  32976. var r = t[i]
  32977. , o = this.options[t[i]];
  32978. e[r] = o
  32979. }
  32980. return e
  32981. }
  32982. ,
  32983. t.getOption = function(e) {
  32984. return void 0 === e ? this.options : void 0 !== this.options[e] ? this.options[e] : null
  32985. }
  32986. ,
  32987. s.Namespace = l;
  32988. function u(e, t, i, n) {
  32989. if (this.type = e,
  32990. this.resolvedType = t,
  32991. this.isMapKey = i,
  32992. this.syntax = n,
  32993. i && g.MAP_KEY_TYPES.indexOf(e) < 0)
  32994. throw Error("Invalid map key type: " + e.name)
  32995. }
  32996. var i = u.prototype;
  32997. u.defaultFieldValue = function(e) {
  32998. if ("string" == typeof e && (e = g.TYPES[e]),
  32999. void 0 === e.defaultValue)
  33000. throw Error("default value for type " + e.name + " is not supported");
  33001. return e == g.TYPES.bytes ? new I(0) : e.defaultValue
  33002. }
  33003. ,
  33004. i.verifyValue = function(t) {
  33005. function i(e, t) {
  33006. throw Error("Illegal value for " + n.toString(!0) + " of type " + n.type.name + ": " + e + " (" + t + ")")
  33007. }
  33008. var n = this;
  33009. switch (this.type) {
  33010. case g.TYPES.int32:
  33011. case g.TYPES.sint32:
  33012. case g.TYPES.sfixed32:
  33013. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33014. 4294967295 < t ? 0 | t : t;
  33015. case g.TYPES.uint32:
  33016. case g.TYPES.fixed32:
  33017. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33018. t < 0 ? t >>> 0 : t;
  33019. case g.TYPES.int64:
  33020. case g.TYPES.sint64:
  33021. case g.TYPES.sfixed64:
  33022. if (g.Long)
  33023. try {
  33024. return a(t, !1)
  33025. } catch (e) {
  33026. i(typeof t, e.message)
  33027. }
  33028. else
  33029. i(typeof t, "requires Long.js");
  33030. case g.TYPES.uint64:
  33031. case g.TYPES.fixed64:
  33032. if (g.Long)
  33033. try {
  33034. return a(t, !0)
  33035. } catch (e) {
  33036. i(typeof t, e.message)
  33037. }
  33038. else
  33039. i(typeof t, "requires Long.js");
  33040. case g.TYPES.bool:
  33041. return "boolean" != typeof t && i(typeof t, "not a boolean"),
  33042. t;
  33043. case g.TYPES.float:
  33044. case g.TYPES.double:
  33045. return "number" != typeof t && i(typeof t, "not a number"),
  33046. t;
  33047. case g.TYPES.string:
  33048. return "string" == typeof t || t && t instanceof String || i(typeof t, "not a string"),
  33049. "" + t;
  33050. case g.TYPES.bytes:
  33051. return I.isByteBuffer(t) ? t : I.wrap(t, "base64");
  33052. case g.TYPES.enum:
  33053. var e = this.resolvedType.getChildren(g.Reflect.Enum.Value);
  33054. for (o = 0; o < e.length; o++) {
  33055. if (e[o].name == t)
  33056. return e[o].id;
  33057. if (e[o].id == t)
  33058. return e[o].id
  33059. }
  33060. if ("proto3" === this.syntax)
  33061. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33062. (4294967295 < t || t < 0) && i(typeof t, "not in range for uint32"),
  33063. t;
  33064. i(t, "not a valid enum value");
  33065. case g.TYPES.group:
  33066. case g.TYPES.message:
  33067. if (t && "object" == typeof t || i(typeof t, "object expected"),
  33068. t instanceof this.resolvedType.clazz)
  33069. return t;
  33070. if (t instanceof g.Builder.Message) {
  33071. var r = {};
  33072. for (var o in t)
  33073. t.hasOwnProperty(o) && (r[o] = t[o]);
  33074. t = r
  33075. }
  33076. return new this.resolvedType.clazz(t)
  33077. }
  33078. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + t + " (undefined type " + this.type + ")")
  33079. }
  33080. ,
  33081. i.calculateLength = function(e, t) {
  33082. if (null === t)
  33083. return 0;
  33084. var i;
  33085. switch (this.type) {
  33086. case g.TYPES.int32:
  33087. return t < 0 ? I.calculateVarint64(t) : I.calculateVarint32(t);
  33088. case g.TYPES.uint32:
  33089. return I.calculateVarint32(t);
  33090. case g.TYPES.sint32:
  33091. return I.calculateVarint32(I.zigZagEncode32(t));
  33092. case g.TYPES.fixed32:
  33093. case g.TYPES.sfixed32:
  33094. case g.TYPES.float:
  33095. return 4;
  33096. case g.TYPES.int64:
  33097. case g.TYPES.uint64:
  33098. return I.calculateVarint64(t);
  33099. case g.TYPES.sint64:
  33100. return I.calculateVarint64(I.zigZagEncode64(t));
  33101. case g.TYPES.fixed64:
  33102. case g.TYPES.sfixed64:
  33103. return 8;
  33104. case g.TYPES.bool:
  33105. return 1;
  33106. case g.TYPES.enum:
  33107. return I.calculateVarint32(t);
  33108. case g.TYPES.double:
  33109. return 8;
  33110. case g.TYPES.string:
  33111. return i = I.calculateUTF8Bytes(t),
  33112. I.calculateVarint32(i) + i;
  33113. case g.TYPES.bytes:
  33114. if (t.remaining() < 0)
  33115. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33116. return I.calculateVarint32(t.remaining()) + t.remaining();
  33117. case g.TYPES.message:
  33118. return i = this.resolvedType.calculate(t),
  33119. I.calculateVarint32(i) + i;
  33120. case g.TYPES.group:
  33121. return (i = this.resolvedType.calculate(t)) + I.calculateVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP)
  33122. }
  33123. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33124. }
  33125. ,
  33126. i.encodeValue = function(e, t, i) {
  33127. if (null === t)
  33128. return i;
  33129. switch (this.type) {
  33130. case g.TYPES.int32:
  33131. t < 0 ? i.writeVarint64(t) : i.writeVarint32(t);
  33132. break;
  33133. case g.TYPES.uint32:
  33134. i.writeVarint32(t);
  33135. break;
  33136. case g.TYPES.sint32:
  33137. i.writeVarint32ZigZag(t);
  33138. break;
  33139. case g.TYPES.fixed32:
  33140. i.writeUint32(t);
  33141. break;
  33142. case g.TYPES.sfixed32:
  33143. i.writeInt32(t);
  33144. break;
  33145. case g.TYPES.int64:
  33146. case g.TYPES.uint64:
  33147. i.writeVarint64(t);
  33148. break;
  33149. case g.TYPES.sint64:
  33150. i.writeVarint64ZigZag(t);
  33151. break;
  33152. case g.TYPES.fixed64:
  33153. i.writeUint64(t);
  33154. break;
  33155. case g.TYPES.sfixed64:
  33156. i.writeInt64(t);
  33157. break;
  33158. case g.TYPES.bool:
  33159. "string" == typeof t ? i.writeVarint32("false" === t.toLowerCase() ? 0 : !!t) : i.writeVarint32(t ? 1 : 0);
  33160. break;
  33161. case g.TYPES.enum:
  33162. i.writeVarint32(t);
  33163. break;
  33164. case g.TYPES.float:
  33165. i.writeFloat32(t);
  33166. break;
  33167. case g.TYPES.double:
  33168. i.writeFloat64(t);
  33169. break;
  33170. case g.TYPES.string:
  33171. i.writeVString(t);
  33172. break;
  33173. case g.TYPES.bytes:
  33174. if (t.remaining() < 0)
  33175. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33176. var n = t.offset;
  33177. i.writeVarint32(t.remaining()),
  33178. i.append(t),
  33179. t.offset = n;
  33180. break;
  33181. case g.TYPES.message:
  33182. var r = (new I).LE();
  33183. this.resolvedType.encode(t, r),
  33184. i.writeVarint32(r.offset),
  33185. i.append(r.flip());
  33186. break;
  33187. case g.TYPES.group:
  33188. this.resolvedType.encode(t, i),
  33189. i.writeVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP);
  33190. break;
  33191. default:
  33192. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33193. }
  33194. return i
  33195. }
  33196. ,
  33197. i.decode = function(e, t, i) {
  33198. if (t != this.type.wireType)
  33199. throw Error("Unexpected wire type for element");
  33200. var n, r;
  33201. switch (this.type) {
  33202. case g.TYPES.int32:
  33203. return 0 | e.readVarint32();
  33204. case g.TYPES.uint32:
  33205. return e.readVarint32() >>> 0;
  33206. case g.TYPES.sint32:
  33207. return 0 | e.readVarint32ZigZag();
  33208. case g.TYPES.fixed32:
  33209. return e.readUint32() >>> 0;
  33210. case g.TYPES.sfixed32:
  33211. return 0 | e.readInt32();
  33212. case g.TYPES.int64:
  33213. return e.readVarint64();
  33214. case g.TYPES.uint64:
  33215. return e.readVarint64().toUnsigned();
  33216. case g.TYPES.sint64:
  33217. return e.readVarint64ZigZag();
  33218. case g.TYPES.fixed64:
  33219. return e.readUint64();
  33220. case g.TYPES.sfixed64:
  33221. return e.readInt64();
  33222. case g.TYPES.bool:
  33223. return !!e.readVarint32();
  33224. case g.TYPES.enum:
  33225. return e.readVarint32();
  33226. case g.TYPES.float:
  33227. return e.readFloat();
  33228. case g.TYPES.double:
  33229. return e.readDouble();
  33230. case g.TYPES.string:
  33231. return e.readVString();
  33232. case g.TYPES.bytes:
  33233. if (r = e.readVarint32(),
  33234. e.remaining() < r)
  33235. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + e.remaining());
  33236. return (n = e.clone()).limit = n.offset + r,
  33237. e.offset += r,
  33238. n;
  33239. case g.TYPES.message:
  33240. return r = e.readVarint32(),
  33241. this.resolvedType.decode(e, r);
  33242. case g.TYPES.group:
  33243. return this.resolvedType.decode(e, -1, i)
  33244. }
  33245. throw Error("[INTERNAL] Illegal decode type")
  33246. }
  33247. ,
  33248. i.valueFromString = function(e) {
  33249. if (!this.isMapKey)
  33250. throw Error("valueFromString() called on non-map-key element");
  33251. switch (this.type) {
  33252. case g.TYPES.int32:
  33253. case g.TYPES.sint32:
  33254. case g.TYPES.sfixed32:
  33255. case g.TYPES.uint32:
  33256. case g.TYPES.fixed32:
  33257. return this.verifyValue(parseInt(e));
  33258. case g.TYPES.int64:
  33259. case g.TYPES.sint64:
  33260. case g.TYPES.sfixed64:
  33261. case g.TYPES.uint64:
  33262. case g.TYPES.fixed64:
  33263. return this.verifyValue(e);
  33264. case g.TYPES.bool:
  33265. return "true" === e;
  33266. case g.TYPES.string:
  33267. return this.verifyValue(e);
  33268. case g.TYPES.bytes:
  33269. return I.fromBinary(e)
  33270. }
  33271. }
  33272. ,
  33273. i.valueToString = function(e) {
  33274. if (!this.isMapKey)
  33275. throw Error("valueToString() called on non-map-key element");
  33276. return this.type === g.TYPES.bytes ? e.toString("binary") : e.toString()
  33277. }
  33278. ,
  33279. s.Element = u;
  33280. var d = function(e, t, i, n, r, o) {
  33281. l.call(this, e, t, i, n, o),
  33282. this.className = "Message",
  33283. this.extensions = void 0,
  33284. this.clazz = null,
  33285. this.isGroup = !!r,
  33286. this._fields = null,
  33287. this._fieldsById = null,
  33288. this._fieldsByName = null
  33289. }
  33290. , n = d.prototype = Object.create(l.prototype);
  33291. n.build = function(e) {
  33292. if (this.clazz && !e)
  33293. return this.clazz;
  33294. var t = function(u, a) {
  33295. function d(e, i, n, r) {
  33296. if (null === e || "object" != typeof e) {
  33297. if (r && r instanceof u.Reflect.Enum) {
  33298. var t = u.Reflect.Enum.getName(r.object, e);
  33299. if (null !== t)
  33300. return t
  33301. }
  33302. return e
  33303. }
  33304. if (I.isByteBuffer(e))
  33305. return i ? e.toBase64() : e.toBuffer();
  33306. if (u.Long.isLong(e))
  33307. return n ? e.toString() : u.Long.fromValue(e);
  33308. var o;
  33309. if (Array.isArray(e))
  33310. return o = [],
  33311. e.forEach(function(e, t) {
  33312. o[t] = d(e, i, n, r)
  33313. }),
  33314. o;
  33315. if (o = {},
  33316. e instanceof u.Map) {
  33317. for (var a = e.entries(), s = a.next(); !s.done; s = a.next())
  33318. o[e.keyElem.valueToString(s.value[0])] = d(s.value[1], i, n, e.valueElem.resolvedType);
  33319. return o
  33320. }
  33321. var l = e.$type
  33322. , c = void 0;
  33323. for (var h in e)
  33324. e.hasOwnProperty(h) && (l && (c = l.getChild(h)) ? o[h] = d(e[h], i, n, c.resolvedType) : o[h] = d(e[h], i, n));
  33325. return o
  33326. }
  33327. var s = a.getChildren(u.Reflect.Message.Field)
  33328. , l = a.getChildren(u.Reflect.Message.OneOf)
  33329. , c = function(e, t) {
  33330. u.Builder.Message.call(this);
  33331. for (var i = 0, n = l.length; i < n; ++i)
  33332. this[l[i].name] = null;
  33333. for (i = 0,
  33334. n = s.length; i < n; ++i) {
  33335. var r = s[i];
  33336. this[r.name] = r.repeated ? [] : r.map ? new u.Map(r) : null,
  33337. !r.required && "proto3" !== a.syntax || null === r.defaultValue || (this[r.name] = r.defaultValue)
  33338. }
  33339. var o;
  33340. if (0 < arguments.length)
  33341. 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)
  33342. for (i = 0,
  33343. n = arguments.length; i < n; ++i)
  33344. void 0 !== (o = arguments[i]) && this.$set(s[i].name, o);
  33345. else
  33346. this.$set(e)
  33347. }
  33348. , o = c.prototype = Object.create(u.Builder.Message.prototype);
  33349. o.add = function(e, t, i) {
  33350. var n = a._fieldsByName[e];
  33351. if (!i) {
  33352. if (!n)
  33353. throw Error(this + "#" + e + " is undefined");
  33354. if (!(n instanceof u.Reflect.Message.Field))
  33355. throw Error(this + "#" + e + " is not a field: " + n.toString(!0));
  33356. if (!n.repeated)
  33357. throw Error(this + "#" + e + " is not a repeated field");
  33358. t = n.verifyValue(t, !0)
  33359. }
  33360. return null === this[e] && (this[e] = []),
  33361. this[e].push(t),
  33362. this
  33363. }
  33364. ,
  33365. o.$add = o.add,
  33366. o.set = function(e, t, i) {
  33367. if (e && "object" == typeof e) {
  33368. for (var n in i = t,
  33369. e)
  33370. e.hasOwnProperty(n) && void 0 !== (t = e[n]) && this.$set(n, t, i);
  33371. return this
  33372. }
  33373. var r = a._fieldsByName[e];
  33374. if (i)
  33375. this[e] = t;
  33376. else {
  33377. if (!r)
  33378. throw Error(this + "#" + e + " is not a field: undefined");
  33379. if (!(r instanceof u.Reflect.Message.Field))
  33380. throw Error(this + "#" + e + " is not a field: " + r.toString(!0));
  33381. this[r.name] = t = r.verifyValue(t)
  33382. }
  33383. if (r && r.oneof) {
  33384. var o = this[r.oneof.name];
  33385. null !== t ? (null !== o && o !== r.name && (this[o] = null),
  33386. this[r.oneof.name] = r.name) : o === e && (this[r.oneof.name] = null)
  33387. }
  33388. return this
  33389. }
  33390. ,
  33391. o.$set = o.set,
  33392. o.get = function(e, t) {
  33393. if (t)
  33394. return this[e];
  33395. var i = a._fieldsByName[e];
  33396. if (!(i && i instanceof u.Reflect.Message.Field))
  33397. throw Error(this + "#" + e + " is not a field: undefined");
  33398. if (!(i instanceof u.Reflect.Message.Field))
  33399. throw Error(this + "#" + e + " is not a field: " + i.toString(!0));
  33400. return this[i.name]
  33401. }
  33402. ,
  33403. o.$get = o.get;
  33404. for (var e = 0; e < s.length; e++) {
  33405. var t = s[e];
  33406. t instanceof u.Reflect.Message.ExtensionField || a.builder.options.populateAccessors && function(i) {
  33407. var e = i.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  33408. return e.toUpperCase().replace("_", "")
  33409. });
  33410. e = e.substring(0, 1).toUpperCase() + e.substring(1);
  33411. function t(e, t) {
  33412. return this[i.name] = t ? e : i.verifyValue(e),
  33413. this
  33414. }
  33415. function n() {
  33416. return this[i.name]
  33417. }
  33418. var r = i.originalName.replace(/([A-Z])/g, function(e) {
  33419. return "_" + e
  33420. });
  33421. null === a.getChild("set" + e) && (o["set" + e] = t),
  33422. null === a.getChild("set_" + r) && (o["set_" + r] = t),
  33423. null === a.getChild("get" + e) && (o["get" + e] = n),
  33424. null === a.getChild("get_" + r) && (o["get_" + r] = n)
  33425. }(t)
  33426. }
  33427. return o.encode = function(t, e) {
  33428. "boolean" == typeof t && (e = t,
  33429. t = void 0);
  33430. var i = !1;
  33431. t || (t = new I,
  33432. i = !0);
  33433. var n = t.littleEndian;
  33434. try {
  33435. return a.encode(this, t.LE(), e),
  33436. (i ? t.flip() : t).LE(n)
  33437. } catch (e) {
  33438. throw t.LE(n),
  33439. e
  33440. }
  33441. }
  33442. ,
  33443. c.encode = function(e, t, i) {
  33444. return new c(e).encode(t, i)
  33445. }
  33446. ,
  33447. o.calculate = function() {
  33448. return a.calculate(this)
  33449. }
  33450. ,
  33451. o.encodeDelimited = function(e, t) {
  33452. var i = !1;
  33453. e || (e = new I,
  33454. i = !0);
  33455. var n = (new I).LE();
  33456. return a.encode(this, n, t).flip(),
  33457. e.writeVarint32(n.remaining()),
  33458. e.append(n),
  33459. i ? e.flip() : e
  33460. }
  33461. ,
  33462. o.encodeAB = function() {
  33463. try {
  33464. return this.encode().toArrayBuffer()
  33465. } catch (e) {
  33466. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  33467. e
  33468. }
  33469. }
  33470. ,
  33471. o.toArrayBuffer = o.encodeAB,
  33472. o.encodeNB = function() {
  33473. try {
  33474. return this.encode().toBuffer()
  33475. } catch (e) {
  33476. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  33477. e
  33478. }
  33479. }
  33480. ,
  33481. o.toBuffer = o.encodeNB,
  33482. o.encode64 = function() {
  33483. try {
  33484. return this.encode().toBase64()
  33485. } catch (e) {
  33486. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  33487. e
  33488. }
  33489. }
  33490. ,
  33491. o.toBase64 = o.encode64,
  33492. o.encodeHex = function() {
  33493. try {
  33494. return this.encode().toHex()
  33495. } catch (e) {
  33496. throw e.encoded && (e.encoded = e.encoded.toHex()),
  33497. e
  33498. }
  33499. }
  33500. ,
  33501. o.toHex = o.encodeHex,
  33502. o.toRaw = function(e, t) {
  33503. return d(this, !!e, !!t, this.$type)
  33504. }
  33505. ,
  33506. o.encodeJSON = function() {
  33507. return JSON.stringify(d(this, !0, !0, this.$type))
  33508. }
  33509. ,
  33510. c.decode = function(t, e, i) {
  33511. "string" == typeof e && (i = e,
  33512. e = -1),
  33513. "string" == typeof t && (t = I.wrap(t, i || "base64"));
  33514. var n = (t = I.isByteBuffer(t) ? t : I.wrap(t)).littleEndian;
  33515. try {
  33516. var r = a.decode(t.LE());
  33517. return t.LE(n),
  33518. r
  33519. } catch (e) {
  33520. throw t.LE(n),
  33521. e
  33522. }
  33523. }
  33524. ,
  33525. c.decodeDelimited = function(t, e) {
  33526. if ("string" == typeof t && (t = I.wrap(t, e || "base64")),
  33527. (t = I.isByteBuffer(t) ? t : I.wrap(t)).remaining() < 1)
  33528. return null;
  33529. var i = t.offset
  33530. , n = t.readVarint32();
  33531. if (t.remaining() < n)
  33532. return t.offset = i,
  33533. null;
  33534. try {
  33535. var r = a.decode(t.slice(t.offset, t.offset + n).LE());
  33536. return t.offset += n,
  33537. r
  33538. } catch (e) {
  33539. throw t.offset += n,
  33540. e
  33541. }
  33542. }
  33543. ,
  33544. c.decode64 = function(e) {
  33545. return c.decode(e, "base64")
  33546. }
  33547. ,
  33548. c.decodeHex = function(e) {
  33549. return c.decode(e, "hex")
  33550. }
  33551. ,
  33552. c.decodeJSON = function(e) {
  33553. return new c(JSON.parse(e))
  33554. }
  33555. ,
  33556. o.toString = function() {
  33557. return a.toString()
  33558. }
  33559. ,
  33560. Object.defineProperty && (Object.defineProperty(c, "$options", {
  33561. value: a.buildOpt()
  33562. }),
  33563. Object.defineProperty(o, "$options", {
  33564. value: c.$options
  33565. }),
  33566. Object.defineProperty(c, "$type", {
  33567. value: a
  33568. }),
  33569. Object.defineProperty(o, "$type", {
  33570. value: a
  33571. })),
  33572. c
  33573. }(g, this);
  33574. this._fields = [],
  33575. this._fieldsById = {},
  33576. this._fieldsByName = {};
  33577. for (var i, n = 0, r = this.children.length; n < r; n++)
  33578. if ((i = this.children[n])instanceof p || i instanceof d || i instanceof y) {
  33579. if (t.hasOwnProperty(i.name))
  33580. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + i.toString(!0) + " cannot override static property '" + i.name + "'");
  33581. t[i.name] = i.build()
  33582. } else if (i instanceof d.Field)
  33583. i.build(),
  33584. this._fields.push(i),
  33585. this._fieldsById[i.id] = i,
  33586. this._fieldsByName[i.name] = i;
  33587. else if (!(i instanceof d.OneOf || i instanceof v))
  33588. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[n].toString(!0));
  33589. return this.clazz = t
  33590. }
  33591. ,
  33592. n.encode = function(e, t, i) {
  33593. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  33594. r = e[(n = this._fields[a]).name],
  33595. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  33596. if (null === o)
  33597. return t;
  33598. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  33599. throw l.encoded = t,
  33600. l
  33601. }
  33602. ,
  33603. n.calculate = function(e) {
  33604. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  33605. if (i = e[(t = this._fields[r]).name],
  33606. t.required && null === i)
  33607. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  33608. n += t.calculate(i, e)
  33609. }
  33610. return n
  33611. }
  33612. ,
  33613. n.decode = function(e, t, i) {
  33614. t = "number" == typeof t ? t : -1;
  33615. for (var n, r, o, a, s = e.offset, l = new this.clazz; e.offset < s + t || -1 === t && 0 < e.remaining(); ) {
  33616. if (o = (n = e.readVarint32()) >>> 3,
  33617. (r = 7 & n) === g.WIRE_TYPES.ENDGROUP) {
  33618. if (o !== i)
  33619. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + o + " (" + (i ? i + " expected" : "not a group") + ")");
  33620. break
  33621. }
  33622. if (a = this._fieldsById[o]) {
  33623. if (a.repeated && !a.options.packed)
  33624. l[a.name].push(a.decode(r, e));
  33625. else if (a.map) {
  33626. var c = a.decode(r, e);
  33627. l[a.name].set(c[0], c[1])
  33628. } else if (l[a.name] = a.decode(r, e),
  33629. a.oneof) {
  33630. var h = l[a.oneof.name];
  33631. null !== h && h !== a.name && (l[h] = null),
  33632. l[a.oneof.name] = a.name
  33633. }
  33634. } else
  33635. switch (r) {
  33636. case g.WIRE_TYPES.VARINT:
  33637. e.readVarint32();
  33638. break;
  33639. case g.WIRE_TYPES.BITS32:
  33640. e.offset += 4;
  33641. break;
  33642. case g.WIRE_TYPES.BITS64:
  33643. e.offset += 8;
  33644. break;
  33645. case g.WIRE_TYPES.LDELIM:
  33646. var u = e.readVarint32();
  33647. e.offset += u;
  33648. break;
  33649. case g.WIRE_TYPES.STARTGROUP:
  33650. for (; m(o, e); )
  33651. ;
  33652. break;
  33653. default:
  33654. throw Error("Illegal wire type for unknown field " + o + " in " + this.toString(!0) + "#decode: " + r)
  33655. }
  33656. }
  33657. for (var d = 0, p = this._fields.length; d < p; ++d)
  33658. if (null === l[(a = this._fields[d]).name])
  33659. if ("proto3" === this.syntax)
  33660. l[a.name] = a.defaultValue;
  33661. else {
  33662. if (a.required) {
  33663. var f = Error("Missing at least one required field for " + this.toString(!0) + ": " + a.name);
  33664. throw f.decoded = l,
  33665. f
  33666. }
  33667. g.populateDefaults && null !== a.defaultValue && (l[a.name] = a.defaultValue)
  33668. }
  33669. return l
  33670. }
  33671. ,
  33672. s.Message = d;
  33673. function c(e, t, i, n, r, o, a, s, l, c) {
  33674. h.call(this, e, t, o),
  33675. this.className = "Message.Field",
  33676. this.required = "required" === i,
  33677. this.repeated = "repeated" === i,
  33678. this.map = "map" === i,
  33679. this.keyType = n || null,
  33680. this.type = r,
  33681. this.resolvedType = null,
  33682. this.id = a,
  33683. this.options = s || {},
  33684. this.defaultValue = null,
  33685. this.oneof = l || null,
  33686. this.syntax = c || "proto2",
  33687. this.originalName = this.name,
  33688. this.element = null,
  33689. this.keyElement = null,
  33690. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = g.Util.toCamelCase(this.name))
  33691. }
  33692. var r = c.prototype = Object.create(h.prototype);
  33693. r.build = function() {
  33694. this.element = new u(this.type,this.resolvedType,!1,this.syntax),
  33695. this.map && (this.keyElement = new u(this.keyType,void 0,!0,this.syntax)),
  33696. "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)
  33697. }
  33698. ,
  33699. r.verifyValue = function(e, t) {
  33700. function i(e, t) {
  33701. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  33702. }
  33703. t = t || !1;
  33704. var n, r = this;
  33705. if (null === e)
  33706. return this.required && i(typeof e, "required"),
  33707. "proto3" === this.syntax && this.type !== g.TYPES.message && i(typeof e, "proto3 field without field presence cannot be null"),
  33708. null;
  33709. if (!this.repeated || t)
  33710. return this.map && !t ? e instanceof g.Map ? e : (e instanceof Object || i(typeof e, "expected ProtoBuf.Map or raw object for map field"),
  33711. new g.Map(this,e)) : (!this.repeated && Array.isArray(e) && i(typeof e, "no array expected"),
  33712. this.element.verifyValue(e));
  33713. Array.isArray(e) || (e = [e]);
  33714. var o = [];
  33715. for (n = 0; n < e.length; n++)
  33716. o.push(this.element.verifyValue(e[n]));
  33717. return o
  33718. }
  33719. ,
  33720. r.hasWirePresence = function(e, t) {
  33721. if ("proto3" !== this.syntax)
  33722. return null !== e;
  33723. if (this.oneof && t[this.oneof.name] === this.name)
  33724. return !0;
  33725. switch (this.type) {
  33726. case g.TYPES.int32:
  33727. case g.TYPES.sint32:
  33728. case g.TYPES.sfixed32:
  33729. case g.TYPES.uint32:
  33730. case g.TYPES.fixed32:
  33731. return 0 !== e;
  33732. case g.TYPES.int64:
  33733. case g.TYPES.sint64:
  33734. case g.TYPES.sfixed64:
  33735. case g.TYPES.uint64:
  33736. case g.TYPES.fixed64:
  33737. return 0 !== e.low || 0 !== e.high;
  33738. case g.TYPES.bool:
  33739. return e;
  33740. case g.TYPES.float:
  33741. case g.TYPES.double:
  33742. return 0 !== e;
  33743. case g.TYPES.string:
  33744. return 0 < e.length;
  33745. case g.TYPES.bytes:
  33746. return 0 < e.remaining();
  33747. case g.TYPES.enum:
  33748. return 0 !== e;
  33749. case g.TYPES.message:
  33750. return null !== e;
  33751. default:
  33752. return !0
  33753. }
  33754. }
  33755. ,
  33756. r.encode = function(t, r, e) {
  33757. if (null === this.type || "object" != typeof this.type)
  33758. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33759. if (null === t || this.repeated && 0 == t.length)
  33760. return r;
  33761. try {
  33762. var i;
  33763. if (this.repeated)
  33764. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33765. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33766. r.ensureCapacity(r.offset += 1);
  33767. var n = r.offset;
  33768. for (i = 0; i < t.length; i++)
  33769. this.element.encodeValue(this.id, t[i], r);
  33770. var o = r.offset - n
  33771. , a = I.calculateVarint32(o);
  33772. if (1 < a) {
  33773. var s = r.slice(n, r.offset);
  33774. n += a - 1,
  33775. r.offset = n,
  33776. r.append(s)
  33777. }
  33778. r.writeVarint32(o, n - a)
  33779. } else
  33780. for (i = 0; i < t.length; i++)
  33781. r.writeVarint32(this.id << 3 | this.type.wireType),
  33782. this.element.encodeValue(this.id, t[i], r);
  33783. else
  33784. this.map ? t.forEach(function(e, t, i) {
  33785. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33786. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33787. r.writeVarint32(n),
  33788. r.writeVarint32(8 | this.keyType.wireType),
  33789. this.keyElement.encodeValue(1, t, r),
  33790. r.writeVarint32(16 | this.type.wireType),
  33791. this.element.encodeValue(2, e, r)
  33792. }, this) : this.hasWirePresence(t, e) && (r.writeVarint32(this.id << 3 | this.type.wireType),
  33793. this.element.encodeValue(this.id, t, r))
  33794. } catch (e) {
  33795. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33796. }
  33797. return r
  33798. }
  33799. ,
  33800. r.calculate = function(t, e) {
  33801. if (t = this.verifyValue(t),
  33802. null === this.type || "object" != typeof this.type)
  33803. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33804. if (null === t || this.repeated && 0 == t.length)
  33805. return 0;
  33806. var r = 0;
  33807. try {
  33808. var i, n;
  33809. if (this.repeated)
  33810. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33811. for (r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33812. i = n = 0; i < t.length; i++)
  33813. n += this.element.calculateLength(this.id, t[i]);
  33814. r += I.calculateVarint32(n),
  33815. r += n
  33816. } else
  33817. for (i = 0; i < t.length; i++)
  33818. r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33819. r += this.element.calculateLength(this.id, t[i]);
  33820. else
  33821. this.map ? t.forEach(function(e, t, i) {
  33822. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33823. r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33824. r += I.calculateVarint32(n),
  33825. r += n
  33826. }, this) : this.hasWirePresence(t, e) && (r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33827. r += this.element.calculateLength(this.id, t))
  33828. } catch (e) {
  33829. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33830. }
  33831. return r
  33832. }
  33833. ,
  33834. r.decode = function(e, t, i) {
  33835. var n, r;
  33836. 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))
  33837. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + e + " (" + this.type.wireType + " expected)");
  33838. if (e == g.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) && !i) {
  33839. r = t.readVarint32(),
  33840. r = t.offset + r;
  33841. for (var o = []; t.offset < r; )
  33842. o.push(this.decode(this.type.wireType, t, !0));
  33843. return o
  33844. }
  33845. if (this.map) {
  33846. var a = u.defaultFieldValue(this.keyType);
  33847. if (n = u.defaultFieldValue(this.type),
  33848. r = t.readVarint32(),
  33849. t.remaining() < r)
  33850. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + t.remaining());
  33851. var s = t.clone();
  33852. for (s.limit = s.offset + r,
  33853. t.offset += r; 0 < s.remaining(); ) {
  33854. var l = s.readVarint32();
  33855. e = 7 & l;
  33856. var c = l >>> 3;
  33857. if (1 == c)
  33858. a = this.keyElement.decode(s, e, c);
  33859. else {
  33860. if (2 != c)
  33861. throw Error("Unexpected tag in map field key/value submessage");
  33862. n = this.element.decode(s, e, c)
  33863. }
  33864. }
  33865. return [a, n]
  33866. }
  33867. return this.element.decode(t, e, this.id)
  33868. }
  33869. ,
  33870. s.Message.Field = c;
  33871. function o(e, t, i, n, r, o, a) {
  33872. c.call(this, e, t, i, null, n, r, o, a),
  33873. this.extension
  33874. }
  33875. o.prototype = Object.create(c.prototype),
  33876. s.Message.ExtensionField = o;
  33877. s.Message.OneOf = function(e, t, i) {
  33878. h.call(this, e, t, i),
  33879. this.fields = []
  33880. }
  33881. ;
  33882. var p = function(e, t, i, n, r) {
  33883. l.call(this, e, t, i, n, r),
  33884. this.className = "Enum",
  33885. this.object = null
  33886. };
  33887. p.getName = function(e, t) {
  33888. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  33889. if (e[i = n[r]] === t)
  33890. return i;
  33891. return null
  33892. }
  33893. ,
  33894. (p.prototype = Object.create(l.prototype)).build = function(e) {
  33895. if (this.object && !e)
  33896. return this.object;
  33897. for (var t = new g.Builder.Enum, i = this.getChildren(p.Value), n = 0, r = i.length; n < r; ++n)
  33898. t[i[n].name] = i[n].id;
  33899. return Object.defineProperty && Object.defineProperty(t, "$options", {
  33900. value: this.buildOpt(),
  33901. enumerable: !1
  33902. }),
  33903. this.object = t
  33904. }
  33905. ,
  33906. s.Enum = p;
  33907. function f(e, t, i, n) {
  33908. h.call(this, e, t, i),
  33909. this.className = "Enum.Value",
  33910. this.id = n
  33911. }
  33912. f.prototype = Object.create(h.prototype),
  33913. s.Enum.Value = f;
  33914. var v = function(e, t, i, n) {
  33915. h.call(this, e, t, i),
  33916. this.field = n
  33917. };
  33918. v.prototype = Object.create(h.prototype),
  33919. s.Extension = v;
  33920. var y = function(e, t, i, n) {
  33921. l.call(this, e, t, i, n),
  33922. this.className = "Service",
  33923. this.clazz = null
  33924. };
  33925. (y.prototype = Object.create(l.prototype)).build = function(e) {
  33926. return this.clazz && !e ? this.clazz : this.clazz = function(t, r) {
  33927. for (var o = function(e) {
  33928. t.Builder.Service.call(this),
  33929. this.rpcImpl = e || function(e, t, i) {
  33930. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  33931. }
  33932. }, e = o.prototype = Object.create(t.Builder.Service.prototype), i = r.getChildren(t.Reflect.Service.RPCMethod), n = 0; n < i.length; n++)
  33933. !function(n) {
  33934. e[n.name] = function(e, i) {
  33935. try {
  33936. try {
  33937. e = n.resolvedRequestType.clazz.decode(I.wrap(e))
  33938. } catch (e) {
  33939. if (!(e instanceof TypeError))
  33940. throw e
  33941. }
  33942. if (null === e || "object" != typeof e)
  33943. throw Error("Illegal arguments");
  33944. e instanceof n.resolvedRequestType.clazz || (e = new n.resolvedRequestType.clazz(e)),
  33945. this.rpcImpl(n.fqn(), e, function(e, t) {
  33946. if (!e) {
  33947. null === t && (t = "");
  33948. try {
  33949. t = n.resolvedResponseType.clazz.decode(t)
  33950. } catch (e) {}
  33951. 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))
  33952. }
  33953. i(e)
  33954. })
  33955. } catch (e) {
  33956. setTimeout(i.bind(this, e), 0)
  33957. }
  33958. }
  33959. ,
  33960. o[n.name] = function(e, t, i) {
  33961. new o(e)[n.name](t, i)
  33962. }
  33963. ,
  33964. Object.defineProperty && (Object.defineProperty(o[n.name], "$options", {
  33965. value: n.buildOpt()
  33966. }),
  33967. Object.defineProperty(e[n.name], "$options", {
  33968. value: o[n.name].$options
  33969. }))
  33970. }(i[n]);
  33971. return Object.defineProperty && (Object.defineProperty(o, "$options", {
  33972. value: r.buildOpt()
  33973. }),
  33974. Object.defineProperty(e, "$options", {
  33975. value: o.$options
  33976. }),
  33977. Object.defineProperty(o, "$type", {
  33978. value: r
  33979. }),
  33980. Object.defineProperty(e, "$type", {
  33981. value: r
  33982. })),
  33983. o
  33984. }(g, this)
  33985. }
  33986. ,
  33987. s.Service = y;
  33988. function A(e, t, i, n) {
  33989. h.call(this, e, t, i),
  33990. this.className = "Service.Method",
  33991. this.options = n || {}
  33992. }
  33993. (A.prototype = Object.create(h.prototype)).buildOpt = t.buildOpt,
  33994. s.Service.Method = A;
  33995. function C(e, t, i, n, r, o, a, s) {
  33996. A.call(this, e, t, i, s),
  33997. this.className = "Service.RPCMethod",
  33998. this.requestName = n,
  33999. this.responseName = r,
  34000. this.requestStream = o,
  34001. this.responseStream = a,
  34002. this.resolvedRequestType = null,
  34003. this.resolvedResponseType = null
  34004. }
  34005. return C.prototype = Object.create(A.prototype),
  34006. s.Service.RPCMethod = C,
  34007. s
  34008. }(o),
  34009. o.Builder = (i = (u = o).Lang,
  34010. s = o.Reflect,
  34011. n = h.prototype,
  34012. h.isMessage = function(e) {
  34013. return "string" == typeof e.name && void 0 === e.values && void 0 === e.rpc
  34014. }
  34015. ,
  34016. h.isMessageField = function(e) {
  34017. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && void 0 !== e.id
  34018. }
  34019. ,
  34020. h.isEnum = function(e) {
  34021. return "string" == typeof e.name && !(void 0 === e.values || !Array.isArray(e.values) || 0 === e.values.length)
  34022. }
  34023. ,
  34024. h.isService = function(e) {
  34025. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  34026. }
  34027. ,
  34028. h.isExtend = function(e) {
  34029. return "string" == typeof e.ref
  34030. }
  34031. ,
  34032. n.reset = function() {
  34033. return this.ptr = this.ns,
  34034. this
  34035. }
  34036. ,
  34037. n.define = function(e) {
  34038. if ("string" != typeof e || !i.TYPEREF.test(e))
  34039. throw Error("illegal namespace: " + e);
  34040. return e.split(".").forEach(function(e) {
  34041. var t = this.ptr.getChild(e);
  34042. null === t && this.ptr.addChild(t = new s.Namespace(this,this.ptr,e)),
  34043. this.ptr = t
  34044. }, this),
  34045. this
  34046. }
  34047. ,
  34048. n.create = function(e) {
  34049. if (!e)
  34050. return this;
  34051. if (Array.isArray(e)) {
  34052. if (0 === e.length)
  34053. return this;
  34054. e = e.slice()
  34055. } else
  34056. e = [e];
  34057. for (var t = [e]; 0 < t.length; ) {
  34058. if (e = t.pop(),
  34059. !Array.isArray(e))
  34060. throw Error("not a valid namespace: " + JSON.stringify(e));
  34061. for (; 0 < e.length; ) {
  34062. var i = e.shift();
  34063. if (h.isMessage(i)) {
  34064. var o = new s.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax)
  34065. , n = {};
  34066. i.oneofs && Object.keys(i.oneofs).forEach(function(e) {
  34067. o.addChild(n[e] = new s.Message.OneOf(this,o,e))
  34068. }, this),
  34069. i.fields && i.fields.forEach(function(e) {
  34070. if (null !== o.getChild(0 | e.id))
  34071. throw Error("duplicate or invalid field id in " + o.name + ": " + e.id);
  34072. if (e.options && "object" != typeof e.options)
  34073. throw Error("illegal field options in " + o.name + "#" + e.name);
  34074. var t = null;
  34075. if ("string" == typeof e.oneof && !(t = n[e.oneof]))
  34076. throw Error("illegal oneof in " + o.name + "#" + e.name + ": " + e.oneof);
  34077. e = new s.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),
  34078. t && t.fields.push(e),
  34079. o.addChild(e)
  34080. }, this);
  34081. var r = [];
  34082. if (i.enums && i.enums.forEach(function(e) {
  34083. r.push(e)
  34084. }),
  34085. i.messages && i.messages.forEach(function(e) {
  34086. r.push(e)
  34087. }),
  34088. i.services && i.services.forEach(function(e) {
  34089. r.push(e)
  34090. }),
  34091. i.extensions && ("number" == typeof i.extensions[0] ? o.extensions = [i.extensions] : o.extensions = i.extensions),
  34092. this.ptr.addChild(o),
  34093. 0 < r.length) {
  34094. t.push(e),
  34095. e = r,
  34096. r = null,
  34097. this.ptr = o,
  34098. o = null;
  34099. continue
  34100. }
  34101. r = null
  34102. } else if (h.isEnum(i))
  34103. o = new s.Enum(this,this.ptr,i.name,i.options,i.syntax),
  34104. i.values.forEach(function(e) {
  34105. o.addChild(new s.Enum.Value(this,o,e.name,e.id))
  34106. }, this),
  34107. this.ptr.addChild(o);
  34108. else if (h.isService(i))
  34109. o = new s.Service(this,this.ptr,i.name,i.options),
  34110. Object.keys(i.rpc).forEach(function(e) {
  34111. var t = i.rpc[e];
  34112. o.addChild(new s.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  34113. }, this),
  34114. this.ptr.addChild(o);
  34115. else {
  34116. if (!h.isExtend(i))
  34117. throw Error("not a valid definition: " + JSON.stringify(i));
  34118. if (o = this.ptr.resolve(i.ref, !0))
  34119. i.fields.forEach(function(t) {
  34120. if (null !== o.getChild(0 | t.id))
  34121. throw Error("duplicate extended field id in " + o.name + ": " + t.id);
  34122. if (o.extensions) {
  34123. var i = !1;
  34124. if (o.extensions.forEach(function(e) {
  34125. t.id >= e[0] && t.id <= e[1] && (i = !0)
  34126. }),
  34127. !i)
  34128. throw Error("illegal extended field id in " + o.name + ": " + t.id + " (not within valid ranges)")
  34129. }
  34130. var e = t.name;
  34131. this.options.convertFieldsToCamelCase && (e = u.Util.toCamelCase(e));
  34132. var n = new s.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn() + "." + e,t.id,t.options)
  34133. , r = new s.Extension(this,this.ptr,t.name,n);
  34134. n.extension = r,
  34135. this.ptr.addChild(r),
  34136. o.addChild(n)
  34137. }, this);
  34138. else if (!/\.?google\.protobuf\./.test(i.ref))
  34139. throw Error("extended message " + i.ref + " is not defined")
  34140. }
  34141. o = i = null
  34142. }
  34143. e = null,
  34144. this.ptr = this.ptr.parent
  34145. }
  34146. return this.resolved = !1,
  34147. this.result = null,
  34148. this
  34149. }
  34150. ,
  34151. n.import = function(t, e) {
  34152. var i = "/";
  34153. if ("string" == typeof e) {
  34154. if (u.Util.IS_NODE && (e = p("path").resolve(e)),
  34155. !0 === this.files[e])
  34156. return this.reset();
  34157. this.files[e] = !0
  34158. } else if ("object" == typeof e) {
  34159. var n = e.root;
  34160. u.Util.IS_NODE && (n = p("path").resolve(n)),
  34161. (0 <= n.indexOf("\\") || 0 <= e.file.indexOf("\\")) && (i = "\\");
  34162. var r = n + i + e.file;
  34163. if (!0 === this.files[r])
  34164. return this.reset();
  34165. this.files[r] = !0
  34166. }
  34167. if (t.imports && 0 < t.imports.length) {
  34168. var o, a = !1;
  34169. "object" == typeof e ? (this.importRoot = e.root,
  34170. a = !0,
  34171. o = this.importRoot,
  34172. e = e.file,
  34173. (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(/\\[^\\]*$/, ""),
  34174. i = "\\") : o = "." : o = null;
  34175. for (var s = 0; s < t.imports.length; s++)
  34176. if ("string" == typeof t.imports[s]) {
  34177. if (!o)
  34178. throw Error("cannot determine import root");
  34179. var l = t.imports[s];
  34180. if ("google/protobuf/descriptor.proto" === l)
  34181. continue;
  34182. if (l = o + i + l,
  34183. !0 === this.files[l])
  34184. continue;
  34185. /\.proto$/i.test(l) && !u.DotProto && (l = l.replace(/\.proto$/, ".json"));
  34186. var c = u.Util.fetch(l);
  34187. if (null === c)
  34188. throw Error("failed to import '" + l + "' in '" + e + "': file not found");
  34189. /\.json$/i.test(l) ? this.import(JSON.parse(c + ""), l) : this.import(u.DotProto.Parser.parse(c), l)
  34190. } else
  34191. e ? /\.(\w+)$/.test(e) ? this.import(t.imports[s], e.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  34192. return t + "_import" + s + "." + i
  34193. })) : this.import(t.imports[s], e + "_import" + s) : this.import(t.imports[s]);
  34194. a && (this.importRoot = null)
  34195. }
  34196. t.package && this.define(t.package),
  34197. t.syntax && function t(i) {
  34198. i.messages && i.messages.forEach(function(e) {
  34199. e.syntax = i.syntax,
  34200. t(e)
  34201. }),
  34202. i.enums && i.enums.forEach(function(e) {
  34203. e.syntax = i.syntax
  34204. })
  34205. }(t);
  34206. var h = this.ptr;
  34207. return t.options && Object.keys(t.options).forEach(function(e) {
  34208. h.options[e] = t.options[e]
  34209. }),
  34210. t.messages && (this.create(t.messages),
  34211. this.ptr = h),
  34212. t.enums && (this.create(t.enums),
  34213. this.ptr = h),
  34214. t.services && (this.create(t.services),
  34215. this.ptr = h),
  34216. t.extends && this.create(t.extends),
  34217. this.reset()
  34218. }
  34219. ,
  34220. n.resolveAll = function() {
  34221. var e;
  34222. if (null == this.ptr || "object" == typeof this.ptr.type)
  34223. return this;
  34224. if (this.ptr instanceof s.Namespace)
  34225. this.ptr.children.forEach(function(e) {
  34226. this.ptr = e,
  34227. this.resolveAll()
  34228. }, this);
  34229. else if (this.ptr instanceof s.Message.Field) {
  34230. if (i.TYPE.test(this.ptr.type))
  34231. this.ptr.type = u.TYPES[this.ptr.type];
  34232. else {
  34233. if (!i.TYPEREF.test(this.ptr.type))
  34234. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34235. if (!(e = (this.ptr instanceof s.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0)))
  34236. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34237. if ((this.ptr.resolvedType = e)instanceof s.Enum) {
  34238. if (this.ptr.type = u.TYPES.enum,
  34239. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  34240. throw Error("proto3 message cannot reference proto2 enum")
  34241. } else {
  34242. if (!(e instanceof s.Message))
  34243. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34244. this.ptr.type = e.isGroup ? u.TYPES.group : u.TYPES.message
  34245. }
  34246. }
  34247. if (this.ptr.map) {
  34248. if (!i.TYPE.test(this.ptr.keyType))
  34249. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  34250. this.ptr.keyType = u.TYPES[this.ptr.keyType]
  34251. }
  34252. } else if (this.ptr instanceof u.Reflect.Service.Method) {
  34253. if (!(this.ptr instanceof u.Reflect.Service.RPCMethod))
  34254. throw Error("illegal service type in " + this.ptr.toString(!0));
  34255. if (!((e = this.ptr.parent.resolve(this.ptr.requestName, !0)) && e instanceof u.Reflect.Message))
  34256. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  34257. if (this.ptr.resolvedRequestType = e,
  34258. !((e = this.ptr.parent.resolve(this.ptr.responseName, !0)) && e instanceof u.Reflect.Message))
  34259. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  34260. this.ptr.resolvedResponseType = e
  34261. } else if (!(this.ptr instanceof u.Reflect.Message.OneOf || this.ptr instanceof u.Reflect.Extension || this.ptr instanceof u.Reflect.Enum.Value))
  34262. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  34263. return this.reset()
  34264. }
  34265. ,
  34266. n.build = function(e) {
  34267. if (this.reset(),
  34268. this.resolved || (this.resolveAll(),
  34269. this.resolved = !0,
  34270. this.result = null),
  34271. null === this.result && (this.result = this.ns.build()),
  34272. !e)
  34273. return this.result;
  34274. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  34275. if (!i[t[n]]) {
  34276. i = null;
  34277. break
  34278. }
  34279. i = i[t[n]]
  34280. }
  34281. return i
  34282. }
  34283. ,
  34284. n.lookup = function(e, t) {
  34285. return e ? this.ns.resolve(e, t) : this.ns
  34286. }
  34287. ,
  34288. n.toString = function() {
  34289. return "Builder"
  34290. }
  34291. ,
  34292. h.Message = function() {}
  34293. ,
  34294. h.Enum = function() {}
  34295. ,
  34296. h.Service = function() {}
  34297. ,
  34298. h),
  34299. o.Map = (a = o.Reflect,
  34300. (t = c.prototype).clear = function() {
  34301. this.map = {}
  34302. }
  34303. ,
  34304. t.delete = function(e) {
  34305. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  34306. , i = t in this.map;
  34307. return delete this.map[t],
  34308. i
  34309. }
  34310. ,
  34311. t.entries = function() {
  34312. for (var e, t = [], i = Object.keys(this.map), n = 0; n < i.length; n++)
  34313. t.push([(e = this.map[i[n]]).key, e.value]);
  34314. return l(t)
  34315. }
  34316. ,
  34317. t.keys = function() {
  34318. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34319. e.push(this.map[t[i]].key);
  34320. return l(e)
  34321. }
  34322. ,
  34323. t.values = function() {
  34324. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34325. e.push(this.map[t[i]].value);
  34326. return l(e)
  34327. }
  34328. ,
  34329. t.forEach = function(e, t) {
  34330. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  34331. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  34332. }
  34333. ,
  34334. t.set = function(e, t) {
  34335. var i = this.keyElem.verifyValue(e)
  34336. , n = this.valueElem.verifyValue(t);
  34337. return this.map[this.keyElem.valueToString(i)] = {
  34338. key: i,
  34339. value: n
  34340. },
  34341. this
  34342. }
  34343. ,
  34344. t.get = function(e) {
  34345. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34346. if (t in this.map)
  34347. return this.map[t].value
  34348. }
  34349. ,
  34350. t.has = function(e) {
  34351. return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map
  34352. }
  34353. ,
  34354. c),
  34355. o.loadProto = function(e, t, i) {
  34356. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34357. t = void 0),
  34358. o.loadJson(o.DotProto.Parser.parse(e), t, i)
  34359. }
  34360. ,
  34361. o.protoFromString = o.loadProto,
  34362. o.loadProtoFile = function(t, i, n) {
  34363. if (i && "object" == typeof i ? (n = i,
  34364. i = null) : i && "function" == typeof i || (i = null),
  34365. i)
  34366. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34367. if (null !== e)
  34368. try {
  34369. i(null, o.loadProto(e, n, t))
  34370. } catch (e) {
  34371. i(e)
  34372. }
  34373. else
  34374. i(Error("Failed to fetch file"))
  34375. });
  34376. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34377. return null === e ? null : o.loadProto(e, n, t)
  34378. }
  34379. ,
  34380. o.protoFromFile = o.loadProtoFile,
  34381. o.newBuilder = function(e) {
  34382. return void 0 === (e = e || {}).convertFieldsToCamelCase && (e.convertFieldsToCamelCase = o.convertFieldsToCamelCase),
  34383. void 0 === e.populateAccessors && (e.populateAccessors = o.populateAccessors),
  34384. new o.Builder(e)
  34385. }
  34386. ,
  34387. o.loadJson = function(e, t, i) {
  34388. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34389. t = null),
  34390. t && "object" == typeof t || (t = o.newBuilder()),
  34391. "string" == typeof e && (e = JSON.parse(e)),
  34392. t.import(e, i),
  34393. t.resolveAll(),
  34394. t
  34395. }
  34396. ,
  34397. o.loadJsonFile = function(t, i, n) {
  34398. if (i && "object" == typeof i ? (n = i,
  34399. i = null) : i && "function" == typeof i || (i = null),
  34400. i)
  34401. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34402. if (null !== e)
  34403. try {
  34404. i(null, o.loadJson(JSON.parse(e), n, t))
  34405. } catch (e) {
  34406. i(e)
  34407. }
  34408. else
  34409. i(Error("Failed to fetch file"))
  34410. });
  34411. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34412. return null === e ? null : o.loadJson(JSON.parse(e), n, t)
  34413. }
  34414. ,
  34415. o;
  34416. function l(e) {
  34417. var t = 0;
  34418. return {
  34419. next: function() {
  34420. return t < e.length ? {
  34421. done: !1,
  34422. value: e[t++]
  34423. } : {
  34424. done: !0
  34425. }
  34426. }
  34427. }
  34428. }
  34429. function c(e, t) {
  34430. if (!e.map)
  34431. throw Error("field is not a map");
  34432. if (this.field = e,
  34433. this.keyElem = new a.Element(e.keyType,null,!0,e.syntax),
  34434. this.valueElem = new a.Element(e.type,e.resolvedType,!1,e.syntax),
  34435. this.map = {},
  34436. Object.defineProperty(this, "size", {
  34437. get: function() {
  34438. return Object.keys(this.map).length
  34439. }
  34440. }),
  34441. t)
  34442. for (var i = Object.keys(t), n = 0; n < i.length; n++) {
  34443. var r = this.keyElem.valueFromString(i[n])
  34444. , o = this.valueElem.verifyValue(t[i[n]]);
  34445. this.map[this.keyElem.valueToString(r)] = {
  34446. key: r,
  34447. value: o
  34448. }
  34449. }
  34450. }
  34451. function h(e) {
  34452. this.ns = new s.Namespace(this,null,""),
  34453. this.ptr = this.ns,
  34454. this.resolved = !1,
  34455. this.result = null,
  34456. this.files = {},
  34457. this.importRoot = null,
  34458. this.options = e || {}
  34459. }
  34460. }
  34461. ,
  34462. "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)
  34463. }
  34464. ).call(this, p("_process"))
  34465. }
  34466. , {
  34467. _process: 203,
  34468. bytebuffer: 215,
  34469. fs: 197,
  34470. path: 197
  34471. }],
  34472. 215: [function(t, e, i) {
  34473. var n, r;
  34474. n = this,
  34475. r = function(l) {
  34476. "use strict";
  34477. function s(e) {
  34478. var t = 0;
  34479. return function() {
  34480. return t < e.length ? e.charCodeAt(t++) : null
  34481. }
  34482. }
  34483. function c() {
  34484. var e = []
  34485. , t = [];
  34486. return function() {
  34487. return 0 === arguments.length ? t.join("") + i.apply(String, e) : (1024 < e.length + arguments.length && (t.push(i.apply(String, e)),
  34488. e.length = 0),
  34489. void Array.prototype.push.apply(e, arguments))
  34490. }
  34491. }
  34492. function n(e, t, i, n, r) {
  34493. 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];
  34494. for (u += d,
  34495. o = p & (1 << -h) - 1,
  34496. p >>= -h,
  34497. h += s; 0 < h; o = 256 * o + e[t + u],
  34498. u += d,
  34499. h -= 8)
  34500. ;
  34501. for (a = o & (1 << -h) - 1,
  34502. o >>= -h,
  34503. h += n; 0 < h; a = 256 * a + e[t + u],
  34504. u += d,
  34505. h -= 8)
  34506. ;
  34507. if (0 === o)
  34508. o = 1 - c;
  34509. else {
  34510. if (o === l)
  34511. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  34512. a += Math.pow(2, n),
  34513. o -= c
  34514. }
  34515. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  34516. }
  34517. function r(e, t, i, n, r, o) {
  34518. 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;
  34519. for (t = Math.abs(t),
  34520. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  34521. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  34522. t * (l = Math.pow(2, -a)) < 1 && (a--,
  34523. l *= 2),
  34524. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  34525. l /= 2),
  34526. h <= a + u ? (s = 0,
  34527. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  34528. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  34529. a = 0)); 8 <= r; e[i + p] = 255 & s,
  34530. p += f,
  34531. s /= 256,
  34532. r -= 8)
  34533. ;
  34534. for (a = a << r | s,
  34535. c += r; 0 < c; e[i + p] = 255 & a,
  34536. p += f,
  34537. a /= 256,
  34538. c -= 8)
  34539. ;
  34540. e[i + p - f] |= 128 * g
  34541. }
  34542. var f = function(e, t, i) {
  34543. if (void 0 === e && (e = f.DEFAULT_CAPACITY),
  34544. void 0 === t && (t = f.DEFAULT_ENDIAN),
  34545. void 0 === i && (i = f.DEFAULT_NOASSERT),
  34546. !i) {
  34547. if ((e |= 0) < 0)
  34548. throw RangeError("Illegal capacity");
  34549. t = !!t,
  34550. i = !!i
  34551. }
  34552. this.buffer = 0 === e ? o : new ArrayBuffer(e),
  34553. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  34554. this.offset = 0,
  34555. this.markedOffset = -1,
  34556. this.limit = e,
  34557. this.littleEndian = t,
  34558. this.noAssert = i
  34559. };
  34560. f.VERSION = "5.0.1",
  34561. f.LITTLE_ENDIAN = !0,
  34562. f.BIG_ENDIAN = !1,
  34563. f.DEFAULT_CAPACITY = 16,
  34564. f.DEFAULT_ENDIAN = f.BIG_ENDIAN,
  34565. f.DEFAULT_NOASSERT = !1,
  34566. f.Long = l || null;
  34567. var a = f.prototype;
  34568. a.__isByteBuffer__,
  34569. Object.defineProperty(a, "__isByteBuffer__", {
  34570. value: !0,
  34571. enumerable: !1,
  34572. configurable: !1
  34573. });
  34574. var o = new ArrayBuffer(0)
  34575. , i = String.fromCharCode;
  34576. f.accessor = function() {
  34577. return Uint8Array
  34578. }
  34579. ,
  34580. f.allocate = function(e, t, i) {
  34581. return new f(e,t,i)
  34582. }
  34583. ,
  34584. f.concat = function(e, t, i, n) {
  34585. "boolean" != typeof t && "string" == typeof t || (n = i,
  34586. i = t,
  34587. t = void 0);
  34588. for (var r, o = 0, a = 0, s = e.length; a < s; ++a)
  34589. f.isByteBuffer(e[a]) || (e[a] = f.wrap(e[a], t)),
  34590. 0 < (r = e[a].limit - e[a].offset) && (o += r);
  34591. if (0 === o)
  34592. return new f(0,i,n);
  34593. var l, c = new f(o,i,n);
  34594. for (a = 0; a < s; )
  34595. (r = (l = e[a++]).limit - l.offset) <= 0 || (c.view.set(l.view.subarray(l.offset, l.limit), c.offset),
  34596. c.offset += r);
  34597. return c.limit = c.offset,
  34598. c.offset = 0,
  34599. c
  34600. }
  34601. ,
  34602. f.isByteBuffer = function(e) {
  34603. return !0 === (e && e.__isByteBuffer__)
  34604. }
  34605. ,
  34606. f.type = function() {
  34607. return ArrayBuffer
  34608. }
  34609. ,
  34610. f.wrap = function(e, t, i, n) {
  34611. if ("string" != typeof t && (n = i,
  34612. i = t,
  34613. t = void 0),
  34614. "string" == typeof e)
  34615. switch (void 0 === t && (t = "utf8"),
  34616. t) {
  34617. case "base64":
  34618. return f.fromBase64(e, i);
  34619. case "hex":
  34620. return f.fromHex(e, i);
  34621. case "binary":
  34622. return f.fromBinary(e, i);
  34623. case "utf8":
  34624. return f.fromUTF8(e, i);
  34625. case "debug":
  34626. return f.fromDebug(e, i);
  34627. default:
  34628. throw Error("Unsupported encoding: " + t)
  34629. }
  34630. if (null === e || "object" != typeof e)
  34631. throw TypeError("Illegal buffer");
  34632. var r;
  34633. if (f.isByteBuffer(e))
  34634. return (r = a.clone.call(e)).markedOffset = -1,
  34635. r;
  34636. if (e instanceof Uint8Array)
  34637. r = new f(0,i,n),
  34638. 0 < e.length && (r.buffer = e.buffer,
  34639. r.offset = e.byteOffset,
  34640. r.limit = e.byteOffset + e.byteLength,
  34641. r.view = new Uint8Array(e.buffer));
  34642. else if (e instanceof ArrayBuffer)
  34643. r = new f(0,i,n),
  34644. 0 < e.byteLength && (r.buffer = e,
  34645. r.offset = 0,
  34646. r.limit = e.byteLength,
  34647. r.view = 0 < e.byteLength ? new Uint8Array(e) : null);
  34648. else {
  34649. if ("[object Array]" !== Object.prototype.toString.call(e))
  34650. throw TypeError("Illegal buffer");
  34651. (r = new f(e.length,i,n)).limit = e.length;
  34652. for (var o = 0; o < e.length; ++o)
  34653. r.view[o] = e[o]
  34654. }
  34655. return r
  34656. }
  34657. ,
  34658. a.writeBitSet = function(e, t) {
  34659. var i = void 0 === t;
  34660. if (i && (t = this.offset),
  34661. !this.noAssert) {
  34662. if (!(e instanceof Array))
  34663. throw TypeError("Illegal BitSet: Not an array");
  34664. if ("number" != typeof t || t % 1 != 0)
  34665. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34666. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34667. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34668. }
  34669. var n, r = t, o = e.length, a = o >> 3, s = 0;
  34670. for (t += this.writeVarint32(o, t); a--; )
  34671. 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,
  34672. this.writeByte(n, t++);
  34673. if (s < o) {
  34674. var l = 0;
  34675. for (n = 0; s < o; )
  34676. n |= (1 & !!e[s++]) << l++;
  34677. this.writeByte(n, t++)
  34678. }
  34679. return i ? (this.offset = t,
  34680. this) : t - r
  34681. }
  34682. ,
  34683. a.readBitSet = function(e) {
  34684. var t = void 0 === e;
  34685. t && (e = this.offset);
  34686. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  34687. for (e += n.length; o--; )
  34688. i = this.readByte(e++),
  34689. s[a++] = !!(1 & i),
  34690. s[a++] = !!(2 & i),
  34691. s[a++] = !!(4 & i),
  34692. s[a++] = !!(8 & i),
  34693. s[a++] = !!(16 & i),
  34694. s[a++] = !!(32 & i),
  34695. s[a++] = !!(64 & i),
  34696. s[a++] = !!(128 & i);
  34697. if (a < r) {
  34698. var l = 0;
  34699. for (i = this.readByte(e++); a < r; )
  34700. s[a++] = !!(i >> l++ & 1)
  34701. }
  34702. return t && (this.offset = e),
  34703. s
  34704. }
  34705. ,
  34706. a.readBytes = function(e, t) {
  34707. var i = void 0 === t;
  34708. if (i && (t = this.offset),
  34709. !this.noAssert) {
  34710. if ("number" != typeof t || t % 1 != 0)
  34711. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34712. if ((t >>>= 0) < 0 || t + e > this.buffer.byteLength)
  34713. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  34714. }
  34715. var n = this.slice(t, t + e);
  34716. return i && (this.offset += e),
  34717. n
  34718. }
  34719. ,
  34720. a.writeBytes = a.append,
  34721. a.writeInt8 = function(e, t) {
  34722. var i = void 0 === t;
  34723. if (i && (t = this.offset),
  34724. !this.noAssert) {
  34725. if ("number" != typeof e || e % 1 != 0)
  34726. throw TypeError("Illegal value: " + e + " (not an integer)");
  34727. if (e |= 0,
  34728. "number" != typeof t || t % 1 != 0)
  34729. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34730. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34731. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34732. }
  34733. t += 1;
  34734. var n = this.buffer.byteLength;
  34735. return n < t && this.resize((n *= 2) > t ? n : t),
  34736. t -= 1,
  34737. this.view[t] = e,
  34738. i && (this.offset += 1),
  34739. this
  34740. }
  34741. ,
  34742. a.writeByte = a.writeInt8,
  34743. a.readInt8 = 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 + 1 > this.buffer.byteLength)
  34750. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34751. }
  34752. var i = this.view[e];
  34753. return 128 == (128 & i) && (i = -(255 - i + 1)),
  34754. t && (this.offset += 1),
  34755. i
  34756. }
  34757. ,
  34758. a.readByte = a.readInt8,
  34759. a.writeUint8 = function(e, t) {
  34760. var i = void 0 === t;
  34761. if (i && (t = this.offset),
  34762. !this.noAssert) {
  34763. if ("number" != typeof e || e % 1 != 0)
  34764. throw TypeError("Illegal value: " + e + " (not an integer)");
  34765. if (e >>>= 0,
  34766. "number" != typeof t || t % 1 != 0)
  34767. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34768. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34769. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34770. }
  34771. t += 1;
  34772. var n = this.buffer.byteLength;
  34773. return n < t && this.resize((n *= 2) > t ? n : t),
  34774. t -= 1,
  34775. this.view[t] = e,
  34776. i && (this.offset += 1),
  34777. this
  34778. }
  34779. ,
  34780. a.writeUInt8 = a.writeUint8,
  34781. a.readUint8 = function(e) {
  34782. var t = void 0 === e;
  34783. if (t && (e = this.offset),
  34784. !this.noAssert) {
  34785. if ("number" != typeof e || e % 1 != 0)
  34786. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34787. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34788. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34789. }
  34790. var i = this.view[e];
  34791. return t && (this.offset += 1),
  34792. i
  34793. }
  34794. ,
  34795. a.readUInt8 = a.readUint8,
  34796. a.writeInt16 = function(e, t) {
  34797. var i = void 0 === t;
  34798. if (i && (t = this.offset),
  34799. !this.noAssert) {
  34800. if ("number" != typeof e || e % 1 != 0)
  34801. throw TypeError("Illegal value: " + e + " (not an integer)");
  34802. if (e |= 0,
  34803. "number" != typeof t || t % 1 != 0)
  34804. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34805. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34806. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34807. }
  34808. t += 2;
  34809. var n = this.buffer.byteLength;
  34810. return n < t && this.resize((n *= 2) > t ? n : t),
  34811. t -= 2,
  34812. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34813. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34814. this.view[t + 1] = 255 & e),
  34815. i && (this.offset += 2),
  34816. this
  34817. }
  34818. ,
  34819. a.writeShort = a.writeInt16,
  34820. a.readInt16 = function(e) {
  34821. var t = void 0 === e;
  34822. if (t && (e = this.offset),
  34823. !this.noAssert) {
  34824. if ("number" != typeof e || e % 1 != 0)
  34825. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34826. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34827. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34828. }
  34829. var i = 0;
  34830. return this.littleEndian ? (i = this.view[e],
  34831. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34832. i |= this.view[e + 1]),
  34833. 32768 == (32768 & i) && (i = -(65535 - i + 1)),
  34834. t && (this.offset += 2),
  34835. i
  34836. }
  34837. ,
  34838. a.readShort = a.readInt16,
  34839. a.writeUint16 = function(e, t) {
  34840. var i = void 0 === t;
  34841. if (i && (t = this.offset),
  34842. !this.noAssert) {
  34843. if ("number" != typeof e || e % 1 != 0)
  34844. throw TypeError("Illegal value: " + e + " (not an integer)");
  34845. if (e >>>= 0,
  34846. "number" != typeof t || t % 1 != 0)
  34847. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34848. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34849. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34850. }
  34851. t += 2;
  34852. var n = this.buffer.byteLength;
  34853. return n < t && this.resize((n *= 2) > t ? n : t),
  34854. t -= 2,
  34855. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34856. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34857. this.view[t + 1] = 255 & e),
  34858. i && (this.offset += 2),
  34859. this
  34860. }
  34861. ,
  34862. a.writeUInt16 = a.writeUint16,
  34863. a.readUint16 = function(e) {
  34864. var t = void 0 === e;
  34865. if (t && (e = this.offset),
  34866. !this.noAssert) {
  34867. if ("number" != typeof e || e % 1 != 0)
  34868. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34869. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34870. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34871. }
  34872. var i = 0;
  34873. return this.littleEndian ? (i = this.view[e],
  34874. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34875. i |= this.view[e + 1]),
  34876. t && (this.offset += 2),
  34877. i
  34878. }
  34879. ,
  34880. a.readUInt16 = a.readUint16,
  34881. a.writeInt32 = function(e, t) {
  34882. var i = void 0 === t;
  34883. if (i && (t = this.offset),
  34884. !this.noAssert) {
  34885. if ("number" != typeof e || e % 1 != 0)
  34886. throw TypeError("Illegal value: " + e + " (not an integer)");
  34887. if (e |= 0,
  34888. "number" != typeof t || t % 1 != 0)
  34889. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34890. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34891. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34892. }
  34893. t += 4;
  34894. var n = this.buffer.byteLength;
  34895. return n < t && this.resize((n *= 2) > t ? n : t),
  34896. t -= 4,
  34897. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34898. this.view[t + 2] = e >>> 16 & 255,
  34899. this.view[t + 1] = e >>> 8 & 255,
  34900. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34901. this.view[t + 1] = e >>> 16 & 255,
  34902. this.view[t + 2] = e >>> 8 & 255,
  34903. this.view[t + 3] = 255 & e),
  34904. i && (this.offset += 4),
  34905. this
  34906. }
  34907. ,
  34908. a.writeInt = a.writeInt32,
  34909. a.readInt32 = function(e) {
  34910. var t = void 0 === e;
  34911. if (t && (e = this.offset),
  34912. !this.noAssert) {
  34913. if ("number" != typeof e || e % 1 != 0)
  34914. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34915. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34916. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34917. }
  34918. var i = 0;
  34919. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34920. i |= this.view[e + 1] << 8,
  34921. i |= this.view[e],
  34922. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34923. i |= this.view[e + 2] << 8,
  34924. i |= this.view[e + 3],
  34925. i += this.view[e] << 24 >>> 0),
  34926. i |= 0,
  34927. t && (this.offset += 4),
  34928. i
  34929. }
  34930. ,
  34931. a.readInt = a.readInt32,
  34932. a.writeUint32 = function(e, t) {
  34933. var i = void 0 === t;
  34934. if (i && (t = this.offset),
  34935. !this.noAssert) {
  34936. if ("number" != typeof e || e % 1 != 0)
  34937. throw TypeError("Illegal value: " + e + " (not an integer)");
  34938. if (e >>>= 0,
  34939. "number" != typeof t || t % 1 != 0)
  34940. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34941. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34942. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34943. }
  34944. t += 4;
  34945. var n = this.buffer.byteLength;
  34946. return n < t && this.resize((n *= 2) > t ? n : t),
  34947. t -= 4,
  34948. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34949. this.view[t + 2] = e >>> 16 & 255,
  34950. this.view[t + 1] = e >>> 8 & 255,
  34951. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34952. this.view[t + 1] = e >>> 16 & 255,
  34953. this.view[t + 2] = e >>> 8 & 255,
  34954. this.view[t + 3] = 255 & e),
  34955. i && (this.offset += 4),
  34956. this
  34957. }
  34958. ,
  34959. a.writeUInt32 = a.writeUint32,
  34960. a.readUint32 = function(e) {
  34961. var t = void 0 === e;
  34962. if (t && (e = this.offset),
  34963. !this.noAssert) {
  34964. if ("number" != typeof e || e % 1 != 0)
  34965. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34966. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34967. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34968. }
  34969. var i = 0;
  34970. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34971. i |= this.view[e + 1] << 8,
  34972. i |= this.view[e],
  34973. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34974. i |= this.view[e + 2] << 8,
  34975. i |= this.view[e + 3],
  34976. i += this.view[e] << 24 >>> 0),
  34977. t && (this.offset += 4),
  34978. i
  34979. }
  34980. ,
  34981. a.readUInt32 = a.readUint32,
  34982. l && (a.writeInt64 = function(e, t) {
  34983. var i = void 0 === t;
  34984. if (i && (t = this.offset),
  34985. !this.noAssert) {
  34986. if ("number" == typeof e)
  34987. e = l.fromNumber(e);
  34988. else if ("string" == typeof e)
  34989. e = l.fromString(e);
  34990. else if (!(e && e instanceof l))
  34991. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  34992. if ("number" != typeof t || t % 1 != 0)
  34993. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34994. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34995. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34996. }
  34997. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  34998. t += 8;
  34999. var n = this.buffer.byteLength;
  35000. n < t && this.resize((n *= 2) > t ? n : t),
  35001. t -= 8;
  35002. var r = e.low
  35003. , o = e.high;
  35004. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  35005. this.view[t + 2] = r >>> 16 & 255,
  35006. this.view[t + 1] = r >>> 8 & 255,
  35007. this.view[t] = 255 & r,
  35008. t += 4,
  35009. this.view[t + 3] = o >>> 24 & 255,
  35010. this.view[t + 2] = o >>> 16 & 255,
  35011. this.view[t + 1] = o >>> 8 & 255,
  35012. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  35013. this.view[t + 1] = o >>> 16 & 255,
  35014. this.view[t + 2] = o >>> 8 & 255,
  35015. this.view[t + 3] = 255 & o,
  35016. t += 4,
  35017. this.view[t] = r >>> 24 & 255,
  35018. this.view[t + 1] = r >>> 16 & 255,
  35019. this.view[t + 2] = r >>> 8 & 255,
  35020. this.view[t + 3] = 255 & r),
  35021. i && (this.offset += 8),
  35022. this
  35023. }
  35024. ,
  35025. a.writeLong = a.writeInt64,
  35026. a.readInt64 = function(e) {
  35027. var t = void 0 === e;
  35028. if (t && (e = this.offset),
  35029. !this.noAssert) {
  35030. if ("number" != typeof e || e % 1 != 0)
  35031. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35032. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35033. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35034. }
  35035. var i = 0
  35036. , n = 0;
  35037. this.littleEndian ? (i = this.view[e + 2] << 16,
  35038. i |= this.view[e + 1] << 8,
  35039. i |= this.view[e],
  35040. i += this.view[e + 3] << 24 >>> 0,
  35041. e += 4,
  35042. n = this.view[e + 2] << 16,
  35043. n |= this.view[e + 1] << 8,
  35044. n |= this.view[e],
  35045. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  35046. n |= this.view[e + 2] << 8,
  35047. n |= this.view[e + 3],
  35048. n += this.view[e] << 24 >>> 0,
  35049. e += 4,
  35050. i = this.view[e + 1] << 16,
  35051. i |= this.view[e + 2] << 8,
  35052. i |= this.view[e + 3],
  35053. i += this.view[e] << 24 >>> 0);
  35054. var r = new l(i,n,!1);
  35055. return t && (this.offset += 8),
  35056. r
  35057. }
  35058. ,
  35059. a.readLong = a.readInt64,
  35060. a.writeUint64 = function(e, t) {
  35061. var i = void 0 === t;
  35062. if (i && (t = this.offset),
  35063. !this.noAssert) {
  35064. if ("number" == typeof e)
  35065. e = l.fromNumber(e);
  35066. else if ("string" == typeof e)
  35067. e = l.fromString(e);
  35068. else if (!(e && e instanceof l))
  35069. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35070. if ("number" != typeof t || t % 1 != 0)
  35071. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35072. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35073. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35074. }
  35075. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  35076. t += 8;
  35077. var n = this.buffer.byteLength;
  35078. n < t && this.resize((n *= 2) > t ? n : t),
  35079. t -= 8;
  35080. var r = e.low
  35081. , o = e.high;
  35082. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  35083. this.view[t + 2] = r >>> 16 & 255,
  35084. this.view[t + 1] = r >>> 8 & 255,
  35085. this.view[t] = 255 & r,
  35086. t += 4,
  35087. this.view[t + 3] = o >>> 24 & 255,
  35088. this.view[t + 2] = o >>> 16 & 255,
  35089. this.view[t + 1] = o >>> 8 & 255,
  35090. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  35091. this.view[t + 1] = o >>> 16 & 255,
  35092. this.view[t + 2] = o >>> 8 & 255,
  35093. this.view[t + 3] = 255 & o,
  35094. t += 4,
  35095. this.view[t] = r >>> 24 & 255,
  35096. this.view[t + 1] = r >>> 16 & 255,
  35097. this.view[t + 2] = r >>> 8 & 255,
  35098. this.view[t + 3] = 255 & r),
  35099. i && (this.offset += 8),
  35100. this
  35101. }
  35102. ,
  35103. a.writeUInt64 = a.writeUint64,
  35104. a.readUint64 = function(e) {
  35105. var t = void 0 === e;
  35106. if (t && (e = this.offset),
  35107. !this.noAssert) {
  35108. if ("number" != typeof e || e % 1 != 0)
  35109. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35110. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35111. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35112. }
  35113. var i = 0
  35114. , n = 0;
  35115. this.littleEndian ? (i = this.view[e + 2] << 16,
  35116. i |= this.view[e + 1] << 8,
  35117. i |= this.view[e],
  35118. i += this.view[e + 3] << 24 >>> 0,
  35119. e += 4,
  35120. n = this.view[e + 2] << 16,
  35121. n |= this.view[e + 1] << 8,
  35122. n |= this.view[e],
  35123. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  35124. n |= this.view[e + 2] << 8,
  35125. n |= this.view[e + 3],
  35126. n += this.view[e] << 24 >>> 0,
  35127. e += 4,
  35128. i = this.view[e + 1] << 16,
  35129. i |= this.view[e + 2] << 8,
  35130. i |= this.view[e + 3],
  35131. i += this.view[e] << 24 >>> 0);
  35132. var r = new l(i,n,!0);
  35133. return t && (this.offset += 8),
  35134. r
  35135. }
  35136. ,
  35137. a.readUInt64 = a.readUint64),
  35138. a.writeFloat32 = function(e, t) {
  35139. var i = void 0 === t;
  35140. if (i && (t = this.offset),
  35141. !this.noAssert) {
  35142. if ("number" != typeof e)
  35143. throw TypeError("Illegal value: " + e + " (not a number)");
  35144. if ("number" != typeof t || t % 1 != 0)
  35145. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35146. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35147. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35148. }
  35149. t += 4;
  35150. var n = this.buffer.byteLength;
  35151. return n < t && this.resize((n *= 2) > t ? n : t),
  35152. t -= 4,
  35153. r(this.view, e, t, this.littleEndian, 23, 4),
  35154. i && (this.offset += 4),
  35155. this
  35156. }
  35157. ,
  35158. a.writeFloat = a.writeFloat32,
  35159. a.readFloat32 = function(e) {
  35160. var t = void 0 === e;
  35161. if (t && (e = this.offset),
  35162. !this.noAssert) {
  35163. if ("number" != typeof e || e % 1 != 0)
  35164. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35165. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35166. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35167. }
  35168. var i = n(this.view, e, this.littleEndian, 23, 4);
  35169. return t && (this.offset += 4),
  35170. i
  35171. }
  35172. ,
  35173. a.readFloat = a.readFloat32,
  35174. a.writeFloat64 = function(e, t) {
  35175. var i = void 0 === t;
  35176. if (i && (t = this.offset),
  35177. !this.noAssert) {
  35178. if ("number" != typeof e)
  35179. throw TypeError("Illegal value: " + e + " (not a number)");
  35180. if ("number" != typeof t || t % 1 != 0)
  35181. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35182. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35183. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35184. }
  35185. t += 8;
  35186. var n = this.buffer.byteLength;
  35187. return n < t && this.resize((n *= 2) > t ? n : t),
  35188. t -= 8,
  35189. r(this.view, e, t, this.littleEndian, 52, 8),
  35190. i && (this.offset += 8),
  35191. this
  35192. }
  35193. ,
  35194. a.writeDouble = a.writeFloat64,
  35195. a.readFloat64 = function(e) {
  35196. var t = void 0 === e;
  35197. if (t && (e = this.offset),
  35198. !this.noAssert) {
  35199. if ("number" != typeof e || e % 1 != 0)
  35200. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35201. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35202. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35203. }
  35204. var i = n(this.view, e, this.littleEndian, 52, 8);
  35205. return t && (this.offset += 8),
  35206. i
  35207. }
  35208. ,
  35209. a.readDouble = a.readFloat64,
  35210. f.MAX_VARINT32_BYTES = 5,
  35211. f.calculateVarint32 = function(e) {
  35212. return (e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  35213. }
  35214. ,
  35215. f.zigZagEncode32 = function(e) {
  35216. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  35217. }
  35218. ,
  35219. f.zigZagDecode32 = function(e) {
  35220. return e >>> 1 ^ -(1 & e) | 0
  35221. }
  35222. ,
  35223. a.writeVarint32 = function(e, t) {
  35224. var i = void 0 === t;
  35225. if (i && (t = this.offset),
  35226. !this.noAssert) {
  35227. if ("number" != typeof e || e % 1 != 0)
  35228. throw TypeError("Illegal value: " + e + " (not an integer)");
  35229. if (e |= 0,
  35230. "number" != typeof t || t % 1 != 0)
  35231. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35232. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35233. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35234. }
  35235. var n, r = f.calculateVarint32(e);
  35236. t += r;
  35237. var o = this.buffer.byteLength;
  35238. for (o < t && this.resize((o *= 2) > t ? o : t),
  35239. t -= r,
  35240. e >>>= 0; 128 <= e; )
  35241. n = 127 & e | 128,
  35242. this.view[t++] = n,
  35243. e >>>= 7;
  35244. return this.view[t++] = e,
  35245. i ? (this.offset = t,
  35246. this) : r
  35247. }
  35248. ,
  35249. a.writeVarint32ZigZag = function(e, t) {
  35250. return this.writeVarint32(f.zigZagEncode32(e), t)
  35251. }
  35252. ,
  35253. a.readVarint32 = function(e) {
  35254. var t = void 0 === e;
  35255. if (t && (e = this.offset),
  35256. !this.noAssert) {
  35257. if ("number" != typeof e || e % 1 != 0)
  35258. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35259. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35260. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35261. }
  35262. var i, n = 0, r = 0;
  35263. do {
  35264. if (!this.noAssert && e > this.limit) {
  35265. var o = Error("Truncated");
  35266. throw o.truncated = !0,
  35267. o
  35268. }
  35269. i = this.view[e++],
  35270. n < 5 && (r |= (127 & i) << 7 * n),
  35271. ++n
  35272. } while (0 != (128 & i));return r |= 0,
  35273. t ? (this.offset = e,
  35274. r) : {
  35275. value: r,
  35276. length: n
  35277. }
  35278. }
  35279. ,
  35280. a.readVarint32ZigZag = function(e) {
  35281. var t = this.readVarint32(e);
  35282. return "object" == typeof t ? t.value = f.zigZagDecode32(t.value) : t = f.zigZagDecode32(t),
  35283. t
  35284. }
  35285. ,
  35286. l && (f.MAX_VARINT64_BYTES = 10,
  35287. f.calculateVarint64 = function(e) {
  35288. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e));
  35289. var t = e.toInt() >>> 0
  35290. , i = e.shiftRightUnsigned(28).toInt() >>> 0
  35291. , n = e.shiftRightUnsigned(56).toInt() >>> 0;
  35292. 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
  35293. }
  35294. ,
  35295. f.zigZagEncode64 = function(e) {
  35296. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35297. e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()
  35298. }
  35299. ,
  35300. f.zigZagDecode64 = function(e) {
  35301. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35302. e.shiftRightUnsigned(1).xor(e.and(l.ONE).toSigned().negate()).toSigned()
  35303. }
  35304. ,
  35305. a.writeVarint64 = function(e, t) {
  35306. var i = void 0 === t;
  35307. if (i && (t = this.offset),
  35308. !this.noAssert) {
  35309. if ("number" == typeof e)
  35310. e = l.fromNumber(e);
  35311. else if ("string" == typeof e)
  35312. e = l.fromString(e);
  35313. else if (!(e && e instanceof l))
  35314. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35315. if ("number" != typeof t || t % 1 != 0)
  35316. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35317. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35318. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35319. }
  35320. "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned());
  35321. var n = f.calculateVarint64(e)
  35322. , r = e.toInt() >>> 0
  35323. , o = e.shiftRightUnsigned(28).toInt() >>> 0
  35324. , a = e.shiftRightUnsigned(56).toInt() >>> 0;
  35325. t += n;
  35326. var s = this.buffer.byteLength;
  35327. switch (s < t && this.resize((s *= 2) > t ? s : t),
  35328. t -= n,
  35329. n) {
  35330. case 10:
  35331. this.view[t + 9] = a >>> 7 & 1;
  35332. case 9:
  35333. this.view[t + 8] = 9 !== n ? 128 | a : 127 & a;
  35334. case 8:
  35335. this.view[t + 7] = 8 !== n ? o >>> 21 | 128 : o >>> 21 & 127;
  35336. case 7:
  35337. this.view[t + 6] = 7 !== n ? o >>> 14 | 128 : o >>> 14 & 127;
  35338. case 6:
  35339. this.view[t + 5] = 6 !== n ? o >>> 7 | 128 : o >>> 7 & 127;
  35340. case 5:
  35341. this.view[t + 4] = 5 !== n ? 128 | o : 127 & o;
  35342. case 4:
  35343. this.view[t + 3] = 4 !== n ? r >>> 21 | 128 : r >>> 21 & 127;
  35344. case 3:
  35345. this.view[t + 2] = 3 !== n ? r >>> 14 | 128 : r >>> 14 & 127;
  35346. case 2:
  35347. this.view[t + 1] = 2 !== n ? r >>> 7 | 128 : r >>> 7 & 127;
  35348. case 1:
  35349. this.view[t] = 1 !== n ? 128 | r : 127 & r
  35350. }
  35351. return i ? (this.offset += n,
  35352. this) : n
  35353. }
  35354. ,
  35355. a.writeVarint64ZigZag = function(e, t) {
  35356. return this.writeVarint64(f.zigZagEncode64(e), t)
  35357. }
  35358. ,
  35359. a.readVarint64 = function(e) {
  35360. var t = void 0 === e;
  35361. if (t && (e = this.offset),
  35362. !this.noAssert) {
  35363. if ("number" != typeof e || e % 1 != 0)
  35364. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35365. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35366. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35367. }
  35368. var i = e
  35369. , n = 0
  35370. , r = 0
  35371. , o = 0
  35372. , a = 0;
  35373. if (n = 127 & (a = this.view[e++]),
  35374. 128 & a && (n |= (127 & (a = this.view[e++])) << 7,
  35375. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 14,
  35376. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 21,
  35377. (128 & a || this.noAssert && void 0 === a) && (r = 127 & (a = this.view[e++]),
  35378. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 7,
  35379. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 14,
  35380. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 21,
  35381. (128 & a || this.noAssert && void 0 === a) && (o = 127 & (a = this.view[e++]),
  35382. (128 & a || this.noAssert && void 0 === a) && (o |= (127 & (a = this.view[e++])) << 7,
  35383. 128 & a || this.noAssert && void 0 === a))))))))))
  35384. throw Error("Buffer overrun");
  35385. var s = l.fromBits(n | r << 28, r >>> 4 | o << 24, !1);
  35386. return t ? (this.offset = e,
  35387. s) : {
  35388. value: s,
  35389. length: e - i
  35390. }
  35391. }
  35392. ,
  35393. a.readVarint64ZigZag = function(e) {
  35394. var t = this.readVarint64(e);
  35395. return t && t.value instanceof l ? t.value = f.zigZagDecode64(t.value) : t = f.zigZagDecode64(t),
  35396. t
  35397. }
  35398. ),
  35399. a.writeCString = function(e, t) {
  35400. var i = void 0 === t;
  35401. i && (t = this.offset);
  35402. var n, r = e.length;
  35403. if (!this.noAssert) {
  35404. if ("string" != typeof e)
  35405. throw TypeError("Illegal str: Not a string");
  35406. for (n = 0; n < r; ++n)
  35407. if (0 === e.charCodeAt(n))
  35408. throw RangeError("Illegal str: Contains NULL-characters");
  35409. if ("number" != typeof t || t % 1 != 0)
  35410. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35411. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35412. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35413. }
  35414. r = d.calculateUTF16asUTF8(s(e))[1],
  35415. t += r + 1;
  35416. var o = this.buffer.byteLength;
  35417. return o < t && this.resize((o *= 2) > t ? o : t),
  35418. t -= r + 1,
  35419. d.encodeUTF16toUTF8(s(e), function(e) {
  35420. this.view[t++] = e
  35421. }
  35422. .bind(this)),
  35423. this.view[t++] = 0,
  35424. i ? (this.offset = t,
  35425. this) : r
  35426. }
  35427. ,
  35428. a.readCString = function(e) {
  35429. var t = void 0 === e;
  35430. if (t && (e = this.offset),
  35431. !this.noAssert) {
  35432. if ("number" != typeof e || e % 1 != 0)
  35433. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35434. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35435. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35436. }
  35437. var i, n = e, r = -1;
  35438. return d.decodeUTF8toUTF16(function() {
  35439. if (0 === r)
  35440. return null;
  35441. if (e >= this.limit)
  35442. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  35443. return 0 === (r = this.view[e++]) ? null : r
  35444. }
  35445. .bind(this), i = c(), !0),
  35446. t ? (this.offset = e,
  35447. i()) : {
  35448. string: i(),
  35449. length: e - n
  35450. }
  35451. }
  35452. ,
  35453. a.writeIString = function(e, t) {
  35454. var i = void 0 === t;
  35455. if (i && (t = this.offset),
  35456. !this.noAssert) {
  35457. if ("string" != typeof e)
  35458. throw TypeError("Illegal str: Not a string");
  35459. if ("number" != typeof t || t % 1 != 0)
  35460. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35461. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35462. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35463. }
  35464. var n, r = t;
  35465. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35466. t += 4 + n;
  35467. var o = this.buffer.byteLength;
  35468. if (o < t && this.resize((o *= 2) > t ? o : t),
  35469. t -= 4 + n,
  35470. this.littleEndian ? (this.view[t + 3] = n >>> 24 & 255,
  35471. this.view[t + 2] = n >>> 16 & 255,
  35472. this.view[t + 1] = n >>> 8 & 255,
  35473. this.view[t] = 255 & n) : (this.view[t] = n >>> 24 & 255,
  35474. this.view[t + 1] = n >>> 16 & 255,
  35475. this.view[t + 2] = n >>> 8 & 255,
  35476. this.view[t + 3] = 255 & n),
  35477. t += 4,
  35478. d.encodeUTF16toUTF8(s(e), function(e) {
  35479. this.view[t++] = e
  35480. }
  35481. .bind(this)),
  35482. t !== r + 4 + n)
  35483. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + 4 + n));
  35484. return i ? (this.offset = t,
  35485. this) : t - r
  35486. }
  35487. ,
  35488. a.readIString = function(e) {
  35489. var t = void 0 === e;
  35490. if (t && (e = this.offset),
  35491. !this.noAssert) {
  35492. if ("number" != typeof e || e % 1 != 0)
  35493. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35494. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35495. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35496. }
  35497. var i = e
  35498. , n = this.readUint32(e)
  35499. , r = this.readUTF8String(n, f.METRICS_BYTES, e += 4);
  35500. return e += r.length,
  35501. t ? (this.offset = e,
  35502. r.string) : {
  35503. string: r.string,
  35504. length: e - i
  35505. }
  35506. }
  35507. ,
  35508. f.METRICS_CHARS = "c",
  35509. f.METRICS_BYTES = "b",
  35510. a.writeUTF8String = function(e, t) {
  35511. var i = void 0 === t;
  35512. if (i && (t = this.offset),
  35513. !this.noAssert) {
  35514. if ("number" != typeof t || t % 1 != 0)
  35515. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35516. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35517. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35518. }
  35519. var n, r = t;
  35520. n = d.calculateUTF16asUTF8(s(e))[1],
  35521. t += n;
  35522. var o = this.buffer.byteLength;
  35523. return o < t && this.resize((o *= 2) > t ? o : t),
  35524. t -= n,
  35525. d.encodeUTF16toUTF8(s(e), function(e) {
  35526. this.view[t++] = e
  35527. }
  35528. .bind(this)),
  35529. i ? (this.offset = t,
  35530. this) : t - r
  35531. }
  35532. ,
  35533. a.writeString = a.writeUTF8String,
  35534. f.calculateUTF8Chars = function(e) {
  35535. return d.calculateUTF16asUTF8(s(e))[0]
  35536. }
  35537. ,
  35538. f.calculateUTF8Bytes = function(e) {
  35539. return d.calculateUTF16asUTF8(s(e))[1]
  35540. }
  35541. ,
  35542. f.calculateString = f.calculateUTF8Bytes,
  35543. a.readUTF8String = function(e, t, i) {
  35544. "number" == typeof t && (i = t,
  35545. t = void 0);
  35546. var n = void 0 === i;
  35547. if (n && (i = this.offset),
  35548. void 0 === t && (t = f.METRICS_CHARS),
  35549. !this.noAssert) {
  35550. if ("number" != typeof e || e % 1 != 0)
  35551. throw TypeError("Illegal length: " + e + " (not an integer)");
  35552. if (e |= 0,
  35553. "number" != typeof i || i % 1 != 0)
  35554. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35555. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35556. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35557. }
  35558. var r, o = 0, a = i;
  35559. if (t === f.METRICS_CHARS) {
  35560. if (r = c(),
  35561. d.decodeUTF8(function() {
  35562. return o < e && i < this.limit ? this.view[i++] : null
  35563. }
  35564. .bind(this), function(e) {
  35565. ++o,
  35566. d.UTF8toUTF16(e, r)
  35567. }),
  35568. o !== e)
  35569. throw RangeError("Illegal range: Truncated data, " + o + " == " + e);
  35570. return n ? (this.offset = i,
  35571. r()) : {
  35572. string: r(),
  35573. length: i - a
  35574. }
  35575. }
  35576. if (t !== f.METRICS_BYTES)
  35577. throw TypeError("Unsupported metrics: " + t);
  35578. if (!this.noAssert) {
  35579. if ("number" != typeof i || i % 1 != 0)
  35580. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35581. if ((i >>>= 0) < 0 || i + e > this.buffer.byteLength)
  35582. throw RangeError("Illegal offset: 0 <= " + i + " (+" + e + ") <= " + this.buffer.byteLength)
  35583. }
  35584. var s = i + e;
  35585. if (d.decodeUTF8toUTF16(function() {
  35586. return i < s ? this.view[i++] : null
  35587. }
  35588. .bind(this), r = c(), this.noAssert),
  35589. i !== s)
  35590. throw RangeError("Illegal range: Truncated data, " + i + " == " + s);
  35591. return n ? (this.offset = i,
  35592. r()) : {
  35593. string: r(),
  35594. length: i - a
  35595. }
  35596. }
  35597. ,
  35598. a.readString = a.readUTF8String,
  35599. a.writeVString = function(e, t) {
  35600. var i = void 0 === t;
  35601. if (i && (t = this.offset),
  35602. !this.noAssert) {
  35603. if ("string" != typeof e)
  35604. throw TypeError("Illegal str: Not a string");
  35605. if ("number" != typeof t || t % 1 != 0)
  35606. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35607. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35608. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35609. }
  35610. var n, r, o = t;
  35611. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35612. r = f.calculateVarint32(n),
  35613. t += r + n;
  35614. var a = this.buffer.byteLength;
  35615. if (a < t && this.resize((a *= 2) > t ? a : t),
  35616. t -= r + n,
  35617. t += this.writeVarint32(n, t),
  35618. d.encodeUTF16toUTF8(s(e), function(e) {
  35619. this.view[t++] = e
  35620. }
  35621. .bind(this)),
  35622. t !== o + n + r)
  35623. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + n + r));
  35624. return i ? (this.offset = t,
  35625. this) : t - o
  35626. }
  35627. ,
  35628. a.readVString = function(e) {
  35629. var t = void 0 === e;
  35630. if (t && (e = this.offset),
  35631. !this.noAssert) {
  35632. if ("number" != typeof e || e % 1 != 0)
  35633. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35634. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35635. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35636. }
  35637. var i = e
  35638. , n = this.readVarint32(e)
  35639. , r = this.readUTF8String(n.value, f.METRICS_BYTES, e += n.length);
  35640. return e += r.length,
  35641. t ? (this.offset = e,
  35642. r.string) : {
  35643. string: r.string,
  35644. length: e - i
  35645. }
  35646. }
  35647. ,
  35648. a.append = function(e, t, i) {
  35649. "number" != typeof t && "string" == typeof t || (i = t,
  35650. t = void 0);
  35651. var n = void 0 === i;
  35652. if (n && (i = this.offset),
  35653. !this.noAssert) {
  35654. if ("number" != typeof i || i % 1 != 0)
  35655. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35656. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35657. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35658. }
  35659. e instanceof f || (e = f.wrap(e, t));
  35660. var r = e.limit - e.offset;
  35661. if (r <= 0)
  35662. return this;
  35663. i += r;
  35664. var o = this.buffer.byteLength;
  35665. return o < i && this.resize((o *= 2) > i ? o : i),
  35666. i -= r,
  35667. this.view.set(e.view.subarray(e.offset, e.limit), i),
  35668. e.offset += r,
  35669. n && (this.offset += r),
  35670. this
  35671. }
  35672. ,
  35673. a.appendTo = function(e, t) {
  35674. return e.append(this, t),
  35675. this
  35676. }
  35677. ,
  35678. a.assert = function(e) {
  35679. return this.noAssert = !e,
  35680. this
  35681. }
  35682. ,
  35683. a.capacity = function() {
  35684. return this.buffer.byteLength
  35685. }
  35686. ,
  35687. a.clear = function() {
  35688. return this.offset = 0,
  35689. this.limit = this.buffer.byteLength,
  35690. this.markedOffset = -1,
  35691. this
  35692. }
  35693. ,
  35694. a.clone = function(e) {
  35695. var t = new f(0,this.littleEndian,this.noAssert);
  35696. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  35697. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  35698. t.view = this.view),
  35699. t.offset = this.offset,
  35700. t.markedOffset = this.markedOffset,
  35701. t.limit = this.limit,
  35702. t
  35703. }
  35704. ,
  35705. a.compact = function(e, t) {
  35706. if (void 0 === e && (e = this.offset),
  35707. void 0 === t && (t = this.limit),
  35708. !this.noAssert) {
  35709. if ("number" != typeof e || e % 1 != 0)
  35710. throw TypeError("Illegal begin: Not an integer");
  35711. if (e >>>= 0,
  35712. "number" != typeof t || t % 1 != 0)
  35713. throw TypeError("Illegal end: Not an integer");
  35714. if (t >>>= 0,
  35715. e < 0 || t < e || t > this.buffer.byteLength)
  35716. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35717. }
  35718. if (0 === e && t === this.buffer.byteLength)
  35719. return this;
  35720. var i = t - e;
  35721. if (0 == i)
  35722. return this.buffer = o,
  35723. this.view = null,
  35724. 0 <= this.markedOffset && (this.markedOffset -= e),
  35725. this.offset = 0,
  35726. this.limit = 0,
  35727. this;
  35728. var n = new ArrayBuffer(i)
  35729. , r = new Uint8Array(n);
  35730. return r.set(this.view.subarray(e, t)),
  35731. this.buffer = n,
  35732. this.view = r,
  35733. 0 <= this.markedOffset && (this.markedOffset -= e),
  35734. this.offset = 0,
  35735. this.limit = i,
  35736. this
  35737. }
  35738. ,
  35739. a.copy = function(e, t) {
  35740. if (void 0 === e && (e = this.offset),
  35741. void 0 === t && (t = this.limit),
  35742. !this.noAssert) {
  35743. if ("number" != typeof e || e % 1 != 0)
  35744. throw TypeError("Illegal begin: Not an integer");
  35745. if (e >>>= 0,
  35746. "number" != typeof t || t % 1 != 0)
  35747. throw TypeError("Illegal end: Not an integer");
  35748. if (t >>>= 0,
  35749. e < 0 || t < e || t > this.buffer.byteLength)
  35750. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35751. }
  35752. if (e === t)
  35753. return new f(0,this.littleEndian,this.noAssert);
  35754. var i = t - e
  35755. , n = new f(i,this.littleEndian,this.noAssert);
  35756. return n.offset = 0,
  35757. n.limit = i,
  35758. 0 <= n.markedOffset && (n.markedOffset -= e),
  35759. this.copyTo(n, 0, e, t),
  35760. n
  35761. }
  35762. ,
  35763. a.copyTo = function(e, t, i, n) {
  35764. var r, o;
  35765. if (!this.noAssert && !f.isByteBuffer(e))
  35766. throw TypeError("Illegal target: Not a ByteBuffer");
  35767. if (t = (o = void 0 === t) ? e.offset : 0 | t,
  35768. i = (r = void 0 === i) ? this.offset : 0 | i,
  35769. n = void 0 === n ? this.limit : 0 | n,
  35770. t < 0 || t > e.buffer.byteLength)
  35771. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  35772. if (i < 0 || n > this.buffer.byteLength)
  35773. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  35774. var a = n - i;
  35775. return 0 == a ? e : (e.ensureCapacity(t + a),
  35776. e.view.set(this.view.subarray(i, n), t),
  35777. r && (this.offset += a),
  35778. o && (e.offset += a),
  35779. this)
  35780. }
  35781. ,
  35782. a.ensureCapacity = function(e) {
  35783. var t = this.buffer.byteLength;
  35784. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  35785. }
  35786. ,
  35787. a.fill = function(e, t, i) {
  35788. var n = void 0 === t;
  35789. if (n && (t = this.offset),
  35790. "string" == typeof e && 0 < e.length && (e = e.charCodeAt(0)),
  35791. void 0 === t && (t = this.offset),
  35792. void 0 === i && (i = this.limit),
  35793. !this.noAssert) {
  35794. if ("number" != typeof e || e % 1 != 0)
  35795. throw TypeError("Illegal value: " + e + " (not an integer)");
  35796. if (e |= 0,
  35797. "number" != typeof t || t % 1 != 0)
  35798. throw TypeError("Illegal begin: Not an integer");
  35799. if (t >>>= 0,
  35800. "number" != typeof i || i % 1 != 0)
  35801. throw TypeError("Illegal end: Not an integer");
  35802. if (i >>>= 0,
  35803. t < 0 || i < t || i > this.buffer.byteLength)
  35804. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35805. }
  35806. if (i <= t)
  35807. return this;
  35808. for (; t < i; )
  35809. this.view[t++] = e;
  35810. return n && (this.offset = t),
  35811. this
  35812. }
  35813. ,
  35814. a.flip = function() {
  35815. return this.limit = this.offset,
  35816. this.offset = 0,
  35817. this
  35818. }
  35819. ,
  35820. a.mark = function(e) {
  35821. if (e = void 0 === e ? this.offset : e,
  35822. !this.noAssert) {
  35823. if ("number" != typeof e || e % 1 != 0)
  35824. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35825. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength)
  35826. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  35827. }
  35828. return this.markedOffset = e,
  35829. this
  35830. }
  35831. ,
  35832. a.order = function(e) {
  35833. if (!this.noAssert && "boolean" != typeof e)
  35834. throw TypeError("Illegal littleEndian: Not a boolean");
  35835. return this.littleEndian = !!e,
  35836. this
  35837. }
  35838. ,
  35839. a.LE = function(e) {
  35840. return this.littleEndian = void 0 === e || !!e,
  35841. this
  35842. }
  35843. ,
  35844. a.BE = function(e) {
  35845. return this.littleEndian = void 0 !== e && !e,
  35846. this
  35847. }
  35848. ,
  35849. a.prepend = function(e, t, i) {
  35850. "number" != typeof t && "string" == typeof t || (i = t,
  35851. t = void 0);
  35852. var n = void 0 === i;
  35853. if (n && (i = this.offset),
  35854. !this.noAssert) {
  35855. if ("number" != typeof i || i % 1 != 0)
  35856. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35857. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35858. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35859. }
  35860. e instanceof f || (e = f.wrap(e, t));
  35861. var r = e.limit - e.offset;
  35862. if (r <= 0)
  35863. return this;
  35864. var o = r - i;
  35865. if (0 < o) {
  35866. var a = new ArrayBuffer(this.buffer.byteLength + o)
  35867. , s = new Uint8Array(a);
  35868. s.set(this.view.subarray(i, this.buffer.byteLength), r),
  35869. this.buffer = a,
  35870. this.view = s,
  35871. this.offset += o,
  35872. 0 <= this.markedOffset && (this.markedOffset += o),
  35873. this.limit += o,
  35874. i += o
  35875. } else
  35876. new Uint8Array(this.buffer);
  35877. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  35878. e.offset = e.limit,
  35879. n && (this.offset -= r),
  35880. this
  35881. }
  35882. ,
  35883. a.prependTo = function(e, t) {
  35884. return e.prepend(this, t),
  35885. this
  35886. }
  35887. ,
  35888. a.printDebug = function(e) {
  35889. "function" != typeof e && (e = console.log.bind(console)),
  35890. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  35891. }
  35892. ,
  35893. a.remaining = function() {
  35894. return this.limit - this.offset
  35895. }
  35896. ,
  35897. a.reset = function() {
  35898. return 0 <= this.markedOffset ? (this.offset = this.markedOffset,
  35899. this.markedOffset = -1) : this.offset = 0,
  35900. this
  35901. }
  35902. ,
  35903. a.resize = function(e) {
  35904. if (!this.noAssert) {
  35905. if ("number" != typeof e || e % 1 != 0)
  35906. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  35907. if ((e |= 0) < 0)
  35908. throw RangeError("Illegal capacity: 0 <= " + e)
  35909. }
  35910. if (this.buffer.byteLength < e) {
  35911. var t = new ArrayBuffer(e)
  35912. , i = new Uint8Array(t);
  35913. i.set(this.view),
  35914. this.buffer = t,
  35915. this.view = i
  35916. }
  35917. return this
  35918. }
  35919. ,
  35920. a.reverse = function(e, t) {
  35921. if (void 0 === e && (e = this.offset),
  35922. void 0 === t && (t = this.limit),
  35923. !this.noAssert) {
  35924. if ("number" != typeof e || e % 1 != 0)
  35925. throw TypeError("Illegal begin: Not an integer");
  35926. if (e >>>= 0,
  35927. "number" != typeof t || t % 1 != 0)
  35928. throw TypeError("Illegal end: Not an integer");
  35929. if (t >>>= 0,
  35930. e < 0 || t < e || t > this.buffer.byteLength)
  35931. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35932. }
  35933. return e === t || Array.prototype.reverse.call(this.view.subarray(e, t)),
  35934. this
  35935. }
  35936. ,
  35937. a.skip = function(e) {
  35938. if (!this.noAssert) {
  35939. if ("number" != typeof e || e % 1 != 0)
  35940. throw TypeError("Illegal length: " + e + " (not an integer)");
  35941. e |= 0
  35942. }
  35943. var t = this.offset + e;
  35944. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  35945. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  35946. return this.offset = t,
  35947. this
  35948. }
  35949. ,
  35950. a.slice = function(e, t) {
  35951. if (void 0 === e && (e = this.offset),
  35952. void 0 === t && (t = this.limit),
  35953. !this.noAssert) {
  35954. if ("number" != typeof e || e % 1 != 0)
  35955. throw TypeError("Illegal begin: Not an integer");
  35956. if (e >>>= 0,
  35957. "number" != typeof t || t % 1 != 0)
  35958. throw TypeError("Illegal end: Not an integer");
  35959. if (t >>>= 0,
  35960. e < 0 || t < e || t > this.buffer.byteLength)
  35961. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35962. }
  35963. var i = this.clone();
  35964. return i.offset = e,
  35965. i.limit = t,
  35966. i
  35967. }
  35968. ,
  35969. a.toBuffer = function(e) {
  35970. var t = this.offset
  35971. , i = this.limit;
  35972. if (!this.noAssert) {
  35973. if ("number" != typeof t || t % 1 != 0)
  35974. throw TypeError("Illegal offset: Not an integer");
  35975. if (t >>>= 0,
  35976. "number" != typeof i || i % 1 != 0)
  35977. throw TypeError("Illegal limit: Not an integer");
  35978. if (i >>>= 0,
  35979. t < 0 || i < t || i > this.buffer.byteLength)
  35980. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35981. }
  35982. if (!e && 0 === t && i === this.buffer.byteLength)
  35983. return this.buffer;
  35984. if (t === i)
  35985. return o;
  35986. var n = new ArrayBuffer(i - t);
  35987. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  35988. n
  35989. }
  35990. ,
  35991. a.toArrayBuffer = a.toBuffer,
  35992. a.toString = function(e, t, i) {
  35993. if (void 0 === e)
  35994. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  35995. switch ("number" == typeof e && (i = t = e = "utf8"),
  35996. e) {
  35997. case "utf8":
  35998. return this.toUTF8(t, i);
  35999. case "base64":
  36000. return this.toBase64(t, i);
  36001. case "hex":
  36002. return this.toHex(t, i);
  36003. case "binary":
  36004. return this.toBinary(t, i);
  36005. case "debug":
  36006. return this.toDebug();
  36007. case "columns":
  36008. return this.toColumns();
  36009. default:
  36010. throw Error("Unsupported encoding: " + e)
  36011. }
  36012. }
  36013. ;
  36014. var h = function() {
  36015. 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)
  36016. a[r[t]] = t;
  36017. return e.encode = function(e, t) {
  36018. for (var i, n; null !== (i = e()); )
  36019. t(r[i >> 2 & 63]),
  36020. n = (3 & i) << 4,
  36021. null !== (i = e()) ? (t(r[63 & ((n |= i >> 4 & 15) | i >> 4 & 15)]),
  36022. n = (15 & i) << 2,
  36023. null !== (i = e()) ? (t(r[63 & (n | i >> 6 & 3)]),
  36024. t(r[63 & i])) : (t(r[63 & n]),
  36025. t(61))) : (t(r[63 & n]),
  36026. t(61),
  36027. t(61))
  36028. }
  36029. ,
  36030. e.decode = function(e, t) {
  36031. function i(e) {
  36032. throw Error("Illegal character code: " + e)
  36033. }
  36034. for (var n, r, o; null !== (n = e()); )
  36035. if (void 0 === (r = a[n]) && i(n),
  36036. null !== (n = e()) && (void 0 === (o = a[n]) && i(n),
  36037. t(r << 2 >>> 0 | (48 & o) >> 4),
  36038. null !== (n = e()))) {
  36039. if (void 0 === (r = a[n])) {
  36040. if (61 === n)
  36041. break;
  36042. i(n)
  36043. }
  36044. if (t((15 & o) << 4 >>> 0 | (60 & r) >> 2),
  36045. null !== (n = e())) {
  36046. if (void 0 === (o = a[n])) {
  36047. if (61 === n)
  36048. break;
  36049. i(n)
  36050. }
  36051. t((3 & r) << 6 >>> 0 | o)
  36052. }
  36053. }
  36054. }
  36055. ,
  36056. e.test = function(e) {
  36057. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  36058. }
  36059. ,
  36060. e
  36061. }();
  36062. a.toBase64 = function(e, t) {
  36063. if (void 0 === e && (e = this.offset),
  36064. void 0 === t && (t = this.limit),
  36065. t |= 0,
  36066. (e |= 0) < 0 || t > this.capacity || t < e)
  36067. throw RangeError("begin, end");
  36068. var i;
  36069. return h.encode(function() {
  36070. return e < t ? this.view[e++] : null
  36071. }
  36072. .bind(this), i = c()),
  36073. i()
  36074. }
  36075. ,
  36076. f.fromBase64 = function(e, t) {
  36077. if ("string" != typeof e)
  36078. throw TypeError("str");
  36079. var i = new f(e.length / 4 * 3,t)
  36080. , n = 0;
  36081. return h.decode(s(e), function(e) {
  36082. i.view[n++] = e
  36083. }),
  36084. i.limit = n,
  36085. i
  36086. }
  36087. ,
  36088. f.btoa = function(e) {
  36089. return f.fromBinary(e).toBase64()
  36090. }
  36091. ,
  36092. f.atob = function(e) {
  36093. return f.fromBase64(e).toBinary()
  36094. }
  36095. ,
  36096. a.toBinary = function(e, t) {
  36097. if (void 0 === e && (e = this.offset),
  36098. void 0 === t && (t = this.limit),
  36099. t |= 0,
  36100. (e |= 0) < 0 || t > this.capacity() || t < e)
  36101. throw RangeError("begin, end");
  36102. if (e === t)
  36103. return "";
  36104. for (var i = [], n = []; e < t; )
  36105. i.push(this.view[e++]),
  36106. 1024 <= i.length && (n.push(String.fromCharCode.apply(String, i)),
  36107. i = []);
  36108. return n.join("") + String.fromCharCode.apply(String, i)
  36109. }
  36110. ,
  36111. f.fromBinary = function(e, t) {
  36112. if ("string" != typeof e)
  36113. throw TypeError("str");
  36114. for (var i, n = 0, r = e.length, o = new f(r,t); n < r; ) {
  36115. if (255 < (i = e.charCodeAt(n)))
  36116. throw RangeError("illegal char code: " + i);
  36117. o.view[n++] = i
  36118. }
  36119. return o.limit = r,
  36120. o
  36121. }
  36122. ,
  36123. a.toDebug = function(e) {
  36124. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  36125. if (-1 !== i && (r += (t = this.view[i]) < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  36126. e && (o += 32 < t && t < 127 ? String.fromCharCode(t) : ".")),
  36127. ++i,
  36128. e && 0 < i && i % 16 == 0 && i !== n) {
  36129. for (; r.length < 51; )
  36130. r += " ";
  36131. a += r + o + "\n",
  36132. r = o = ""
  36133. }
  36134. 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 ? " " : ""
  36135. }
  36136. if (e && " " !== r) {
  36137. for (; r.length < 51; )
  36138. r += " ";
  36139. a += r + o + "\n"
  36140. }
  36141. return e ? a : r
  36142. }
  36143. ,
  36144. f.fromDebug = function(e, t, i) {
  36145. 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; ) {
  36146. switch (n = e.charAt(s++)) {
  36147. case "!":
  36148. if (!i) {
  36149. if (h || u || d) {
  36150. p = !0;
  36151. break
  36152. }
  36153. h = u = d = !0
  36154. }
  36155. a.offset = a.markedOffset = a.limit = l,
  36156. c = !1;
  36157. break;
  36158. case "|":
  36159. if (!i) {
  36160. if (h || d) {
  36161. p = !0;
  36162. break
  36163. }
  36164. h = d = !0
  36165. }
  36166. a.offset = a.limit = l,
  36167. c = !1;
  36168. break;
  36169. case "[":
  36170. if (!i) {
  36171. if (h || u) {
  36172. p = !0;
  36173. break
  36174. }
  36175. h = u = !0
  36176. }
  36177. a.offset = a.markedOffset = l,
  36178. c = !1;
  36179. break;
  36180. case "<":
  36181. if (!i) {
  36182. if (h) {
  36183. p = !0;
  36184. break
  36185. }
  36186. h = !0
  36187. }
  36188. a.offset = l,
  36189. c = !1;
  36190. break;
  36191. case "]":
  36192. if (!i) {
  36193. if (d || u) {
  36194. p = !0;
  36195. break
  36196. }
  36197. d = u = !0
  36198. }
  36199. a.limit = a.markedOffset = l,
  36200. c = !1;
  36201. break;
  36202. case ">":
  36203. if (!i) {
  36204. if (d) {
  36205. p = !0;
  36206. break
  36207. }
  36208. d = !0
  36209. }
  36210. a.limit = l,
  36211. c = !1;
  36212. break;
  36213. case "'":
  36214. if (!i) {
  36215. if (u) {
  36216. p = !0;
  36217. break
  36218. }
  36219. u = !0
  36220. }
  36221. a.markedOffset = l,
  36222. c = !1;
  36223. break;
  36224. case " ":
  36225. c = !1;
  36226. break;
  36227. default:
  36228. if (!i && c) {
  36229. p = !0;
  36230. break
  36231. }
  36232. if (r = parseInt(n + e.charAt(s++), 16),
  36233. !i && (isNaN(r) || r < 0 || 255 < r))
  36234. throw TypeError("Illegal str: Not a debug encoded string");
  36235. a.view[l++] = r,
  36236. c = !0
  36237. }
  36238. if (p)
  36239. throw TypeError("Illegal str: Invalid symbol at " + s)
  36240. }
  36241. if (!i) {
  36242. if (!h || !d)
  36243. throw TypeError("Illegal str: Missing offset or limit");
  36244. if (l < a.buffer.byteLength)
  36245. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + l + " < " + o)
  36246. }
  36247. return a
  36248. }
  36249. ,
  36250. a.toHex = function(e, t) {
  36251. if (e = void 0 === e ? this.offset : e,
  36252. t = void 0 === t ? this.limit : t,
  36253. !this.noAssert) {
  36254. if ("number" != typeof e || e % 1 != 0)
  36255. throw TypeError("Illegal begin: Not an integer");
  36256. if (e >>>= 0,
  36257. "number" != typeof t || t % 1 != 0)
  36258. throw TypeError("Illegal end: Not an integer");
  36259. if (t >>>= 0,
  36260. e < 0 || t < e || t > this.buffer.byteLength)
  36261. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36262. }
  36263. for (var i, n = new Array(t - e); e < t; )
  36264. (i = this.view[e++]) < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  36265. return n.join("")
  36266. }
  36267. ,
  36268. f.fromHex = function(e, t, i) {
  36269. if (!i) {
  36270. if ("string" != typeof e)
  36271. throw TypeError("Illegal str: Not a string");
  36272. if (e.length % 2 != 0)
  36273. throw TypeError("Illegal str: Length not a multiple of 2")
  36274. }
  36275. for (var n, r = e.length, o = new f(r / 2 | 0,t), a = 0, s = 0; a < r; a += 2) {
  36276. if (n = parseInt(e.substring(a, a + 2), 16),
  36277. !i && (!isFinite(n) || n < 0 || 255 < n))
  36278. throw TypeError("Illegal str: Contains non-hex characters");
  36279. o.view[s++] = n
  36280. }
  36281. return o.limit = s,
  36282. o
  36283. }
  36284. ;
  36285. var u, d = u = {
  36286. MAX_CODEPOINT: 1114111,
  36287. encodeUTF8: function(e, t) {
  36288. var i = null;
  36289. for ("number" == typeof e && (i = e,
  36290. e = function() {
  36291. return null
  36292. }
  36293. ); null !== i || null !== (i = e()); )
  36294. i < 128 ? t(127 & i) : (i < 2048 ? t(i >> 6 & 31 | 192) : (i < 65536 ? t(i >> 12 & 15 | 224) : (t(i >> 18 & 7 | 240),
  36295. t(i >> 12 & 63 | 128)),
  36296. t(i >> 6 & 63 | 128)),
  36297. t(63 & i | 128)),
  36298. i = null
  36299. },
  36300. decodeUTF8: function(e, t) {
  36301. for (var i, n, r, o, a = function(e) {
  36302. e = e.slice(0, e.indexOf(null));
  36303. var t = Error(e.toString());
  36304. throw t.name = "TruncatedError",
  36305. t.bytes = e,
  36306. t
  36307. }; null !== (i = e()); )
  36308. if (0 == (128 & i))
  36309. t(i);
  36310. else if (192 == (224 & i))
  36311. null === (n = e()) && a([i, n]),
  36312. t((31 & i) << 6 | 63 & n);
  36313. else if (224 == (240 & i))
  36314. null !== (n = e()) && null !== (r = e()) || a([i, n, r]),
  36315. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  36316. else {
  36317. if (240 != (248 & i))
  36318. throw RangeError("Illegal starting byte: " + i);
  36319. null !== (n = e()) && null !== (r = e()) && null !== (o = e()) || a([i, n, r, o]),
  36320. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  36321. }
  36322. },
  36323. UTF16toUTF8: function(e, t) {
  36324. for (var i, n = null; null !== (i = null !== n ? n : e()); )
  36325. 55296 <= i && i <= 57343 && null !== (n = e()) && 56320 <= n && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  36326. n = null) : t(i);
  36327. null !== n && t(n)
  36328. },
  36329. UTF8toUTF16: function(e, t) {
  36330. var i = null;
  36331. for ("number" == typeof e && (i = e,
  36332. e = function() {
  36333. return null
  36334. }
  36335. ); null !== i || null !== (i = e()); )
  36336. i <= 65535 ? t(i) : (t(55296 + ((i -= 65536) >> 10)),
  36337. t(i % 1024 + 56320)),
  36338. i = null
  36339. },
  36340. encodeUTF16toUTF8: function(e, t) {
  36341. u.UTF16toUTF8(e, function(e) {
  36342. u.encodeUTF8(e, t)
  36343. })
  36344. },
  36345. decodeUTF8toUTF16: function(e, t) {
  36346. u.decodeUTF8(e, function(e) {
  36347. u.UTF8toUTF16(e, t)
  36348. })
  36349. },
  36350. calculateCodePoint: function(e) {
  36351. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36352. },
  36353. calculateUTF8: function(e) {
  36354. for (var t, i = 0; null !== (t = e()); )
  36355. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  36356. return i
  36357. },
  36358. calculateUTF16asUTF8: function(e) {
  36359. var t = 0
  36360. , i = 0;
  36361. return u.UTF16toUTF8(e, function(e) {
  36362. ++t,
  36363. i += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36364. }),
  36365. [t, i]
  36366. }
  36367. };
  36368. return a.toUTF8 = function(t, i) {
  36369. if (void 0 === t && (t = this.offset),
  36370. void 0 === i && (i = this.limit),
  36371. !this.noAssert) {
  36372. if ("number" != typeof t || t % 1 != 0)
  36373. throw TypeError("Illegal begin: Not an integer");
  36374. if (t >>>= 0,
  36375. "number" != typeof i || i % 1 != 0)
  36376. throw TypeError("Illegal end: Not an integer");
  36377. if (i >>>= 0,
  36378. t < 0 || i < t || i > this.buffer.byteLength)
  36379. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36380. }
  36381. var e;
  36382. try {
  36383. d.decodeUTF8toUTF16(function() {
  36384. return t < i ? this.view[t++] : null
  36385. }
  36386. .bind(this), e = c())
  36387. } catch (e) {
  36388. if (t !== i)
  36389. throw RangeError("Illegal range: Truncated data, " + t + " != " + i)
  36390. }
  36391. return e()
  36392. }
  36393. ,
  36394. f.fromUTF8 = function(e, t, i) {
  36395. if (!i && "string" != typeof e)
  36396. throw TypeError("Illegal str: Not a string");
  36397. var n = new f(d.calculateUTF16asUTF8(s(e), !0)[1],t,i)
  36398. , r = 0;
  36399. return d.encodeUTF16toUTF8(s(e), function(e) {
  36400. n.view[r++] = e
  36401. }),
  36402. n.limit = r,
  36403. n
  36404. }
  36405. ,
  36406. f
  36407. }
  36408. ,
  36409. "function" == typeof define && define.amd ? define(["long"], r) : "function" == typeof t && "object" == typeof e && e && e.exports ? e.exports = function() {
  36410. var e;
  36411. try {
  36412. e = t("long")
  36413. } catch (e) {}
  36414. return r(e)
  36415. }() : (n.dcodeIO = n.dcodeIO || {}).ByteBuffer = r(n.dcodeIO.Long)
  36416. }
  36417. , {
  36418. long: 216
  36419. }],
  36420. 216: [function(e, t, i) {
  36421. var n, r;
  36422. n = this,
  36423. r = function() {
  36424. "use strict";
  36425. function n(e, t, i) {
  36426. this.low = 0 | e,
  36427. this.high = 0 | t,
  36428. this.unsigned = !!i
  36429. }
  36430. function p(e) {
  36431. return !0 === (e && e.__isLong__)
  36432. }
  36433. function e(e, t) {
  36434. var i, n, r;
  36435. return t ? (r = 0 <= (e >>>= 0) && e < 256) && (n = a[e]) ? n : (i = g(e, (0 | e) < 0 ? -1 : 0, !0),
  36436. r && (a[e] = i),
  36437. i) : (r = -128 <= (e |= 0) && e < 128) && (n = o[e]) ? n : (i = g(e, e < 0 ? -1 : 0, !1),
  36438. r && (o[e] = i),
  36439. i)
  36440. }
  36441. function f(e, t) {
  36442. if (isNaN(e) || !isFinite(e))
  36443. return t ? l : y;
  36444. if (t) {
  36445. if (e < 0)
  36446. return l;
  36447. if (r <= e)
  36448. return I
  36449. } else {
  36450. if (e <= -s)
  36451. return E;
  36452. if (s <= e + 1)
  36453. return C
  36454. }
  36455. return e < 0 ? f(-e, t).neg() : g(e % i | 0, e / i | 0, t)
  36456. }
  36457. function g(e, t, i) {
  36458. return new n(e,t,i)
  36459. }
  36460. function h(e, t, i) {
  36461. if (0 === e.length)
  36462. throw Error("empty string");
  36463. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  36464. return y;
  36465. if (t = "number" == typeof t ? (i = t,
  36466. !1) : !!t,
  36467. (i = i || 10) < 2 || 36 < i)
  36468. throw RangeError("radix");
  36469. var n;
  36470. if (0 < (n = e.indexOf("-")))
  36471. throw Error("interior hyphen");
  36472. if (0 === n)
  36473. return h(e.substring(1), t, i).neg();
  36474. for (var r = f(u(i, 8)), o = y, a = 0; a < e.length; a += 8) {
  36475. var s = Math.min(8, e.length - a)
  36476. , l = parseInt(e.substring(a, a + s), i);
  36477. if (s < 8) {
  36478. var c = f(u(i, s));
  36479. o = o.mul(c).add(f(l))
  36480. } else
  36481. o = (o = o.mul(r)).add(f(l))
  36482. }
  36483. return o.unsigned = t,
  36484. o
  36485. }
  36486. function m(e) {
  36487. return e instanceof n ? e : "number" == typeof e ? f(e) : "string" == typeof e ? h(e) : g(e.low, e.high, e.unsigned)
  36488. }
  36489. Object.defineProperty(n.prototype, "__isLong__", {
  36490. value: !0,
  36491. enumerable: !1,
  36492. configurable: !1
  36493. }),
  36494. n.isLong = p;
  36495. var o = {}
  36496. , a = {};
  36497. n.fromInt = e,
  36498. n.fromNumber = f,
  36499. n.fromBits = g;
  36500. var u = Math.pow;
  36501. n.fromString = h,
  36502. n.fromValue = m;
  36503. var i = 4294967296
  36504. , r = 0x10000000000000000
  36505. , s = r / 2
  36506. , v = e(1 << 24)
  36507. , y = e(0);
  36508. n.ZERO = y;
  36509. var l = e(0, !0);
  36510. n.UZERO = l;
  36511. var c = e(1);
  36512. n.ONE = c;
  36513. var d = e(1, !0);
  36514. n.UONE = d;
  36515. var A = e(-1);
  36516. n.NEG_ONE = A;
  36517. var C = g(-1, 2147483647, !1);
  36518. n.MAX_VALUE = C;
  36519. var I = g(-1, -1, !0);
  36520. n.MAX_UNSIGNED_VALUE = I;
  36521. var E = g(0, -2147483648, !1);
  36522. n.MIN_VALUE = E;
  36523. var t = n.prototype;
  36524. return t.toInt = function() {
  36525. return this.unsigned ? this.low >>> 0 : this.low
  36526. }
  36527. ,
  36528. t.toNumber = function() {
  36529. return this.unsigned ? (this.high >>> 0) * i + (this.low >>> 0) : this.high * i + (this.low >>> 0)
  36530. }
  36531. ,
  36532. t.toString = function(e) {
  36533. if ((e = e || 10) < 2 || 36 < e)
  36534. throw RangeError("radix");
  36535. if (this.isZero())
  36536. return "0";
  36537. if (this.isNegative()) {
  36538. if (this.eq(E)) {
  36539. var t = f(e)
  36540. , i = this.div(t)
  36541. , n = i.mul(t).sub(this);
  36542. return i.toString(e) + n.toInt().toString(e)
  36543. }
  36544. return "-" + this.neg().toString(e)
  36545. }
  36546. for (var r = f(u(e, 6), this.unsigned), o = this, a = ""; ; ) {
  36547. var s = o.div(r)
  36548. , l = (o.sub(s.mul(r)).toInt() >>> 0).toString(e);
  36549. if ((o = s).isZero())
  36550. return l + a;
  36551. for (; l.length < 6; )
  36552. l = "0" + l;
  36553. a = "" + l + a
  36554. }
  36555. }
  36556. ,
  36557. t.getHighBits = function() {
  36558. return this.high
  36559. }
  36560. ,
  36561. t.getHighBitsUnsigned = function() {
  36562. return this.high >>> 0
  36563. }
  36564. ,
  36565. t.getLowBits = function() {
  36566. return this.low
  36567. }
  36568. ,
  36569. t.getLowBitsUnsigned = function() {
  36570. return this.low >>> 0
  36571. }
  36572. ,
  36573. t.getNumBitsAbs = function() {
  36574. if (this.isNegative())
  36575. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  36576. for (var e = 0 != this.high ? this.high : this.low, t = 31; 0 < t && 0 == (e & 1 << t); t--)
  36577. ;
  36578. return 0 != this.high ? t + 33 : t + 1
  36579. }
  36580. ,
  36581. t.isZero = function() {
  36582. return 0 === this.high && 0 === this.low
  36583. }
  36584. ,
  36585. t.isNegative = function() {
  36586. return !this.unsigned && this.high < 0
  36587. }
  36588. ,
  36589. t.isPositive = function() {
  36590. return this.unsigned || 0 <= this.high
  36591. }
  36592. ,
  36593. t.isOdd = function() {
  36594. return 1 == (1 & this.low)
  36595. }
  36596. ,
  36597. t.isEven = function() {
  36598. return 0 == (1 & this.low)
  36599. }
  36600. ,
  36601. t.equals = function(e) {
  36602. return p(e) || (e = m(e)),
  36603. (this.unsigned === e.unsigned || this.high >>> 31 != 1 || e.high >>> 31 != 1) && this.high === e.high && this.low === e.low
  36604. }
  36605. ,
  36606. t.eq = t.equals,
  36607. t.notEquals = function(e) {
  36608. return !this.eq(e)
  36609. }
  36610. ,
  36611. t.neq = t.notEquals,
  36612. t.lessThan = function(e) {
  36613. return this.comp(e) < 0
  36614. }
  36615. ,
  36616. t.lt = t.lessThan,
  36617. t.lessThanOrEqual = function(e) {
  36618. return this.comp(e) <= 0
  36619. }
  36620. ,
  36621. t.lte = t.lessThanOrEqual,
  36622. t.greaterThan = function(e) {
  36623. return 0 < this.comp(e)
  36624. }
  36625. ,
  36626. t.gt = t.greaterThan,
  36627. t.greaterThanOrEqual = function(e) {
  36628. return 0 <= this.comp(e)
  36629. }
  36630. ,
  36631. t.gte = t.greaterThanOrEqual,
  36632. t.compare = function(e) {
  36633. if (p(e) || (e = m(e)),
  36634. this.eq(e))
  36635. return 0;
  36636. var t = this.isNegative()
  36637. , i = e.isNegative();
  36638. 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
  36639. }
  36640. ,
  36641. t.comp = t.compare,
  36642. t.negate = function() {
  36643. return !this.unsigned && this.eq(E) ? E : this.not().add(c)
  36644. }
  36645. ,
  36646. t.neg = t.negate,
  36647. t.add = function(e) {
  36648. p(e) || (e = m(e));
  36649. var t = this.high >>> 16
  36650. , i = 65535 & this.high
  36651. , n = this.low >>> 16
  36652. , r = 65535 & this.low
  36653. , o = e.high >>> 16
  36654. , a = 65535 & e.high
  36655. , s = e.low >>> 16
  36656. , l = 0
  36657. , c = 0
  36658. , h = 0
  36659. , u = 0;
  36660. return h += (u += r + (65535 & e.low)) >>> 16,
  36661. c += (h += n + s) >>> 16,
  36662. l += (c += i + a) >>> 16,
  36663. l += t + o,
  36664. g((h &= 65535) << 16 | (u &= 65535), (l &= 65535) << 16 | (c &= 65535), this.unsigned)
  36665. }
  36666. ,
  36667. t.subtract = function(e) {
  36668. return p(e) || (e = m(e)),
  36669. this.add(e.neg())
  36670. }
  36671. ,
  36672. t.sub = t.subtract,
  36673. t.multiply = function(e) {
  36674. if (this.isZero())
  36675. return y;
  36676. if (p(e) || (e = m(e)),
  36677. e.isZero())
  36678. return y;
  36679. if (this.eq(E))
  36680. return e.isOdd() ? E : y;
  36681. if (e.eq(E))
  36682. return this.isOdd() ? E : y;
  36683. if (this.isNegative())
  36684. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  36685. if (e.isNegative())
  36686. return this.mul(e.neg()).neg();
  36687. if (this.lt(v) && e.lt(v))
  36688. return f(this.toNumber() * e.toNumber(), this.unsigned);
  36689. var t = this.high >>> 16
  36690. , i = 65535 & this.high
  36691. , n = this.low >>> 16
  36692. , r = 65535 & this.low
  36693. , o = e.high >>> 16
  36694. , a = 65535 & e.high
  36695. , s = e.low >>> 16
  36696. , l = 65535 & e.low
  36697. , c = 0
  36698. , h = 0
  36699. , u = 0
  36700. , d = 0;
  36701. return u += (d += r * l) >>> 16,
  36702. h += (u += n * l) >>> 16,
  36703. u &= 65535,
  36704. h += (u += r * s) >>> 16,
  36705. c += (h += i * l) >>> 16,
  36706. h &= 65535,
  36707. c += (h += n * s) >>> 16,
  36708. h &= 65535,
  36709. c += (h += r * a) >>> 16,
  36710. c += t * l + i * s + n * a + r * o,
  36711. g((u &= 65535) << 16 | (d &= 65535), (c &= 65535) << 16 | (h &= 65535), this.unsigned)
  36712. }
  36713. ,
  36714. t.mul = t.multiply,
  36715. t.divide = function(e) {
  36716. if (p(e) || (e = m(e)),
  36717. e.isZero())
  36718. throw Error("division by zero");
  36719. if (this.isZero())
  36720. return this.unsigned ? l : y;
  36721. var t, i, n;
  36722. if (this.unsigned) {
  36723. if (e.unsigned || (e = e.toUnsigned()),
  36724. e.gt(this))
  36725. return l;
  36726. if (e.gt(this.shru(1)))
  36727. return d;
  36728. n = l
  36729. } else {
  36730. if (this.eq(E))
  36731. 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)),
  36732. n = t.add(i.div(e)));
  36733. if (e.eq(E))
  36734. return this.unsigned ? l : y;
  36735. if (this.isNegative())
  36736. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  36737. if (e.isNegative())
  36738. return this.div(e.neg()).neg();
  36739. n = y
  36740. }
  36741. for (i = this; i.gte(e); ) {
  36742. t = Math.max(1, Math.floor(i.toNumber() / e.toNumber()));
  36743. 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); )
  36744. s = (a = f(t -= o, this.unsigned)).mul(e);
  36745. a.isZero() && (a = c),
  36746. n = n.add(a),
  36747. i = i.sub(s)
  36748. }
  36749. return n
  36750. }
  36751. ,
  36752. t.div = t.divide,
  36753. t.modulo = function(e) {
  36754. return p(e) || (e = m(e)),
  36755. this.sub(this.div(e).mul(e))
  36756. }
  36757. ,
  36758. t.mod = t.modulo,
  36759. t.not = function() {
  36760. return g(~this.low, ~this.high, this.unsigned)
  36761. }
  36762. ,
  36763. t.and = function(e) {
  36764. return p(e) || (e = m(e)),
  36765. g(this.low & e.low, this.high & e.high, this.unsigned)
  36766. }
  36767. ,
  36768. t.or = function(e) {
  36769. return p(e) || (e = m(e)),
  36770. g(this.low | e.low, this.high | e.high, this.unsigned)
  36771. }
  36772. ,
  36773. t.xor = function(e) {
  36774. return p(e) || (e = m(e)),
  36775. g(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  36776. }
  36777. ,
  36778. t.shiftLeft = function(e) {
  36779. return p(e) && (e = e.toInt()),
  36780. 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)
  36781. }
  36782. ,
  36783. t.shl = t.shiftLeft,
  36784. t.shiftRight = function(e) {
  36785. return p(e) && (e = e.toInt()),
  36786. 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)
  36787. }
  36788. ,
  36789. t.shr = t.shiftRight,
  36790. t.shiftRightUnsigned = function(e) {
  36791. if (p(e) && (e = e.toInt()),
  36792. 0 === (e &= 63))
  36793. return this;
  36794. var t = this.high;
  36795. return e < 32 ? g(this.low >>> e | t << 32 - e, t >>> e, this.unsigned) : g(32 === e ? t : t >>> e - 32, 0, this.unsigned)
  36796. }
  36797. ,
  36798. t.shru = t.shiftRightUnsigned,
  36799. t.toSigned = function() {
  36800. return this.unsigned ? g(this.low, this.high, !1) : this
  36801. }
  36802. ,
  36803. t.toUnsigned = function() {
  36804. return this.unsigned ? this : g(this.low, this.high, !0)
  36805. }
  36806. ,
  36807. t.toBytes = function(e) {
  36808. return e ? this.toBytesLE() : this.toBytesBE()
  36809. }
  36810. ,
  36811. t.toBytesLE = function() {
  36812. var e = this.high
  36813. , t = this.low;
  36814. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  36815. }
  36816. ,
  36817. t.toBytesBE = function() {
  36818. var e = this.high
  36819. , t = this.low;
  36820. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  36821. }
  36822. ,
  36823. n
  36824. }
  36825. ,
  36826. "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()
  36827. }
  36828. , {}],
  36829. 217: [function(e, t, i) {
  36830. 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 = {
  36831. REVISION: "75"
  36832. };
  36833. function Ii(e, t) {
  36834. return e.distance - t.distance
  36835. }
  36836. function Ei(e, t, i, n) {
  36837. if (!1 !== e.visible && (e.raycast(t, i),
  36838. !0 === n))
  36839. for (var r = e.children, o = 0, a = r.length; o < a; o++)
  36840. Ei(r[o], t, i, !0)
  36841. }
  36842. function _i(e, t, i) {
  36843. return i < 0 && (i += 1),
  36844. 1 < i && (i -= 1),
  36845. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  36846. }
  36847. function bi(e, t, i, n, r, o, a) {
  36848. return Ci.Triangle.barycoordFromPoint(e, t, i, n, Vt),
  36849. r.multiplyScalar(Vt.x),
  36850. o.multiplyScalar(Vt.y),
  36851. a.multiplyScalar(Vt.z),
  36852. r.add(o).add(a),
  36853. r.clone()
  36854. }
  36855. function wi(e, t, i, n, r, o, a) {
  36856. var s = e.material;
  36857. if (null === (s.side === Ci.BackSide ? i.intersectTriangle(o, r, n, !0, a) : i.intersectTriangle(n, r, o, s.side !== Ci.DoubleSide, a)))
  36858. return null;
  36859. Ut.copy(a),
  36860. Ut.applyMatrix4(e.matrixWorld);
  36861. var l = t.ray.origin.distanceTo(Ut);
  36862. return l < t.near || l > t.far ? null : {
  36863. distance: l,
  36864. point: Ut.clone(),
  36865. object: e
  36866. }
  36867. }
  36868. function Ti(e, t, i, n, r, o, a, s) {
  36869. Mt.fromArray(n, 3 * o),
  36870. Rt.fromArray(n, 3 * a),
  36871. Pt.fromArray(n, 3 * s);
  36872. var l = wi(e, t, i, Mt, Rt, Pt, kt);
  36873. return l && (r && (Nt.fromArray(r, 2 * o),
  36874. Ft.fromArray(r, 2 * a),
  36875. Bt.fromArray(r, 2 * s),
  36876. l.uv = bi(kt, Mt, Rt, Pt, Nt, Ft, Bt)),
  36877. l.face = new Ci.Face3(o,a,s,Ci.Triangle.normal(Mt, Rt, Pt)),
  36878. l.faceIndex = o),
  36879. l
  36880. }
  36881. function xi() {}
  36882. function Si(e, t, i, n, r, o) {
  36883. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E;
  36884. if (s = e[o[t]].x,
  36885. l = e[o[t]].y,
  36886. c = e[o[i]].x,
  36887. h = e[o[i]].y,
  36888. u = e[o[n]].x,
  36889. d = e[o[n]].y,
  36890. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  36891. return !1;
  36892. for (g = u - c,
  36893. m = d - h,
  36894. v = s - u,
  36895. y = l - d,
  36896. A = c - s,
  36897. C = h - l,
  36898. a = 0; a < r; a++)
  36899. if (p = e[o[a]].x,
  36900. f = e[o[a]].y,
  36901. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = A * (f - l) - C * (p - s),
  36902. E = v * (f - d) - y * (p - u),
  36903. g * (f - h) - m * (p - c) >= -Number.EPSILON && E >= -Number.EPSILON && I >= -Number.EPSILON))
  36904. return !1;
  36905. return !0
  36906. }
  36907. function Mi(e) {
  36908. switch (e) {
  36909. case Ci.LinearEncoding:
  36910. return ["Linear", "( value )"];
  36911. case Ci.sRGBEncoding:
  36912. return ["sRGB", "( value )"];
  36913. case Ci.RGBEEncoding:
  36914. return ["RGBE", "( value )"];
  36915. case Ci.RGBM7Encoding:
  36916. return ["RGBM", "( value, 7.0 )"];
  36917. case Ci.RGBM16Encoding:
  36918. return ["RGBM", "( value, 16.0 )"];
  36919. case Ci.RGBDEncoding:
  36920. return ["RGBD", "( value, 256.0 )"];
  36921. case Ci.GammaEncoding:
  36922. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  36923. default:
  36924. throw new Error("unsupported encoding: " + e)
  36925. }
  36926. }
  36927. function Ri(e, t) {
  36928. var i = Mi(t);
  36929. return "vec4 " + e + "( vec4 value ) { return " + i[0] + "ToLinear" + i[1] + "; }"
  36930. }
  36931. function Pi(e) {
  36932. return "" !== e
  36933. }
  36934. function Oi(e, t) {
  36935. 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)
  36936. }
  36937. function Li(e) {
  36938. return e.replace(/#include +<([\w\d.]+)>/g, function(e, t) {
  36939. var i = Ci.ShaderChunk[t];
  36940. if (void 0 === i)
  36941. throw new Error("Can not resolve #include <" + t + ">");
  36942. return Li(i)
  36943. })
  36944. }
  36945. function Di(e) {
  36946. return e.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, function(e, t, i, n) {
  36947. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  36948. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  36949. return r
  36950. })
  36951. }
  36952. function Ni(e, t, i, n) {
  36953. gi.set(t, i, n).unproject(mi);
  36954. var r = fi[e];
  36955. if (void 0 !== r)
  36956. for (var o = 0, a = r.length; o < a; o++)
  36957. pi.vertices[r[o]].copy(gi)
  36958. }
  36959. "function" == typeof define && define.amd ? define("three", Ci) : void 0 !== i && void 0 !== t && (t.exports = Ci),
  36960. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  36961. void 0 === Math.sign && (Math.sign = function(e) {
  36962. return e < 0 ? -1 : 0 < e ? 1 : +e
  36963. }
  36964. ),
  36965. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  36966. get: function() {
  36967. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  36968. }
  36969. }),
  36970. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  36971. writable: !0,
  36972. configurable: !0,
  36973. value: function(e) {
  36974. "use strict";
  36975. if (null == e)
  36976. throw new TypeError("Cannot convert first argument to object");
  36977. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  36978. var r = arguments[i];
  36979. if (null != r) {
  36980. r = Object(r);
  36981. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  36982. var l = o[a]
  36983. , c = Object.getOwnPropertyDescriptor(r, l);
  36984. void 0 !== c && c.enumerable && (t[l] = r[l])
  36985. }
  36986. }
  36987. }
  36988. return t
  36989. }
  36990. }),
  36991. Ci.MOUSE = {
  36992. LEFT: 0,
  36993. MIDDLE: 1,
  36994. RIGHT: 2
  36995. },
  36996. Ci.CullFaceNone = 0,
  36997. Ci.CullFaceBack = 1,
  36998. Ci.CullFaceFront = 2,
  36999. Ci.CullFaceFrontBack = 3,
  37000. Ci.FrontFaceDirectionCW = 0,
  37001. Ci.FrontFaceDirectionCCW = 1,
  37002. Ci.BasicShadowMap = 0,
  37003. Ci.PCFShadowMap = 1,
  37004. Ci.PCFSoftShadowMap = 2,
  37005. Ci.FrontSide = 0,
  37006. Ci.BackSide = 1,
  37007. Ci.DoubleSide = 2,
  37008. Ci.FlatShading = 1,
  37009. Ci.SmoothShading = 2,
  37010. Ci.NoColors = 0,
  37011. Ci.FaceColors = 1,
  37012. Ci.VertexColors = 2,
  37013. Ci.NoBlending = 0,
  37014. Ci.NormalBlending = 1,
  37015. Ci.AdditiveBlending = 2,
  37016. Ci.SubtractiveBlending = 3,
  37017. Ci.MultiplyBlending = 4,
  37018. Ci.CustomBlending = 5,
  37019. Ci.AddEquation = 100,
  37020. Ci.SubtractEquation = 101,
  37021. Ci.ReverseSubtractEquation = 102,
  37022. Ci.MinEquation = 103,
  37023. Ci.MaxEquation = 104,
  37024. Ci.ZeroFactor = 200,
  37025. Ci.OneFactor = 201,
  37026. Ci.SrcColorFactor = 202,
  37027. Ci.OneMinusSrcColorFactor = 203,
  37028. Ci.SrcAlphaFactor = 204,
  37029. Ci.OneMinusSrcAlphaFactor = 205,
  37030. Ci.DstAlphaFactor = 206,
  37031. Ci.OneMinusDstAlphaFactor = 207,
  37032. Ci.DstColorFactor = 208,
  37033. Ci.OneMinusDstColorFactor = 209,
  37034. Ci.SrcAlphaSaturateFactor = 210,
  37035. Ci.NeverDepth = 0,
  37036. Ci.AlwaysDepth = 1,
  37037. Ci.LessDepth = 2,
  37038. Ci.LessEqualDepth = 3,
  37039. Ci.EqualDepth = 4,
  37040. Ci.GreaterEqualDepth = 5,
  37041. Ci.GreaterDepth = 6,
  37042. Ci.NotEqualDepth = 7,
  37043. Ci.MultiplyOperation = 0,
  37044. Ci.MixOperation = 1,
  37045. Ci.AddOperation = 2,
  37046. Ci.NoToneMapping = 0,
  37047. Ci.LinearToneMapping = 1,
  37048. Ci.ReinhardToneMapping = 2,
  37049. Ci.Uncharted2ToneMapping = 3,
  37050. Ci.CineonToneMapping = 4,
  37051. Ci.UVMapping = 300,
  37052. Ci.CubeReflectionMapping = 301,
  37053. Ci.CubeRefractionMapping = 302,
  37054. Ci.EquirectangularReflectionMapping = 303,
  37055. Ci.EquirectangularRefractionMapping = 304,
  37056. Ci.SphericalReflectionMapping = 305,
  37057. Ci.CubeUVReflectionMapping = 306,
  37058. Ci.CubeUVRefractionMapping = 307,
  37059. Ci.RepeatWrapping = 1e3,
  37060. Ci.ClampToEdgeWrapping = 1001,
  37061. Ci.MirroredRepeatWrapping = 1002,
  37062. Ci.NearestFilter = 1003,
  37063. Ci.NearestMipMapNearestFilter = 1004,
  37064. Ci.NearestMipMapLinearFilter = 1005,
  37065. Ci.LinearFilter = 1006,
  37066. Ci.LinearMipMapNearestFilter = 1007,
  37067. Ci.LinearMipMapLinearFilter = 1008,
  37068. Ci.UnsignedByteType = 1009,
  37069. Ci.ByteType = 1010,
  37070. Ci.ShortType = 1011,
  37071. Ci.UnsignedShortType = 1012,
  37072. Ci.IntType = 1013,
  37073. Ci.UnsignedIntType = 1014,
  37074. Ci.FloatType = 1015,
  37075. Ci.HalfFloatType = 1025,
  37076. Ci.UnsignedShort4444Type = 1016,
  37077. Ci.UnsignedShort5551Type = 1017,
  37078. Ci.UnsignedShort565Type = 1018,
  37079. Ci.AlphaFormat = 1019,
  37080. Ci.RGBFormat = 1020,
  37081. Ci.RGBAFormat = 1021,
  37082. Ci.LuminanceFormat = 1022,
  37083. Ci.LuminanceAlphaFormat = 1023,
  37084. Ci.RGBEFormat = Ci.RGBAFormat,
  37085. Ci.RGB_S3TC_DXT1_Format = 2001,
  37086. Ci.RGBA_S3TC_DXT1_Format = 2002,
  37087. Ci.RGBA_S3TC_DXT3_Format = 2003,
  37088. Ci.RGBA_S3TC_DXT5_Format = 2004,
  37089. Ci.RGB_PVRTC_4BPPV1_Format = 2100,
  37090. Ci.RGB_PVRTC_2BPPV1_Format = 2101,
  37091. Ci.RGBA_PVRTC_4BPPV1_Format = 2102,
  37092. Ci.RGBA_PVRTC_2BPPV1_Format = 2103,
  37093. Ci.RGB_ETC1_Format = 2151,
  37094. Ci.LoopOnce = 2200,
  37095. Ci.LoopRepeat = 2201,
  37096. Ci.LoopPingPong = 2202,
  37097. Ci.InterpolateDiscrete = 2300,
  37098. Ci.InterpolateLinear = 2301,
  37099. Ci.InterpolateSmooth = 2302,
  37100. Ci.ZeroCurvatureEnding = 2400,
  37101. Ci.ZeroSlopeEnding = 2401,
  37102. Ci.WrapAroundEnding = 2402,
  37103. Ci.TrianglesDrawMode = 0,
  37104. Ci.TriangleStripDrawMode = 1,
  37105. Ci.TriangleFanDrawMode = 2,
  37106. Ci.LinearEncoding = 3e3,
  37107. Ci.sRGBEncoding = 3001,
  37108. Ci.GammaEncoding = 3007,
  37109. Ci.RGBEEncoding = 3002,
  37110. Ci.LogLuvEncoding = 3003,
  37111. Ci.RGBM7Encoding = 3004,
  37112. Ci.RGBM16Encoding = 3005,
  37113. Ci.RGBDEncoding = 3006,
  37114. Ci.Color = function(e) {
  37115. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  37116. }
  37117. ,
  37118. Ci.Color.prototype = {
  37119. constructor: Ci.Color,
  37120. r: 1,
  37121. g: 1,
  37122. b: 1,
  37123. set: function(e) {
  37124. return e instanceof Ci.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  37125. this
  37126. },
  37127. setScalar: function(e) {
  37128. this.r = e,
  37129. this.g = e,
  37130. this.b = e
  37131. },
  37132. setHex: function(e) {
  37133. return e = Math.floor(e),
  37134. this.r = (e >> 16 & 255) / 255,
  37135. this.g = (e >> 8 & 255) / 255,
  37136. this.b = (255 & e) / 255,
  37137. this
  37138. },
  37139. setRGB: function(e, t, i) {
  37140. return this.r = e,
  37141. this.g = t,
  37142. this.b = i,
  37143. this
  37144. },
  37145. setHSL: function(e, t, i) {
  37146. if (e = Ci.Math.euclideanModulo(e, 1),
  37147. t = Ci.Math.clamp(t, 0, 1),
  37148. i = Ci.Math.clamp(i, 0, 1),
  37149. 0 === t)
  37150. this.r = this.g = this.b = i;
  37151. else {
  37152. var n = i <= .5 ? i * (1 + t) : i + t - i * t
  37153. , r = 2 * i - n;
  37154. this.r = _i(r, n, e + 1 / 3),
  37155. this.g = _i(r, n, e),
  37156. this.b = _i(r, n, e - 1 / 3)
  37157. }
  37158. return this
  37159. },
  37160. setStyle: function(t) {
  37161. function e(e) {
  37162. void 0 !== e && parseFloat(e) < 1 && console.warn("THREE.Color: Alpha component of " + t + " will be ignored.")
  37163. }
  37164. var i;
  37165. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)) {
  37166. var n, r = i[1], o = i[2];
  37167. switch (r) {
  37168. case "rgb":
  37169. case "rgba":
  37170. if (n = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37171. return this.r = Math.min(255, parseInt(n[1], 10)) / 255,
  37172. this.g = Math.min(255, parseInt(n[2], 10)) / 255,
  37173. this.b = Math.min(255, parseInt(n[3], 10)) / 255,
  37174. e(n[5]),
  37175. this;
  37176. if (n = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37177. return this.r = Math.min(100, parseInt(n[1], 10)) / 100,
  37178. this.g = Math.min(100, parseInt(n[2], 10)) / 100,
  37179. this.b = Math.min(100, parseInt(n[3], 10)) / 100,
  37180. e(n[5]),
  37181. this;
  37182. break;
  37183. case "hsl":
  37184. case "hsla":
  37185. if (n = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) {
  37186. var a = parseFloat(n[1]) / 360
  37187. , s = parseInt(n[2], 10) / 100
  37188. , l = parseInt(n[3], 10) / 100;
  37189. return e(n[5]),
  37190. this.setHSL(a, s, l)
  37191. }
  37192. }
  37193. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(t)) {
  37194. var c, h = (c = i[1]).length;
  37195. if (3 === h)
  37196. return this.r = parseInt(c.charAt(0) + c.charAt(0), 16) / 255,
  37197. this.g = parseInt(c.charAt(1) + c.charAt(1), 16) / 255,
  37198. this.b = parseInt(c.charAt(2) + c.charAt(2), 16) / 255,
  37199. this;
  37200. if (6 === h)
  37201. return this.r = parseInt(c.charAt(0) + c.charAt(1), 16) / 255,
  37202. this.g = parseInt(c.charAt(2) + c.charAt(3), 16) / 255,
  37203. this.b = parseInt(c.charAt(4) + c.charAt(5), 16) / 255,
  37204. this
  37205. }
  37206. t && 0 < t.length && (void 0 !== (c = Ci.ColorKeywords[t]) ? this.setHex(c) : console.warn("THREE.Color: Unknown color " + t));
  37207. return this
  37208. },
  37209. clone: function() {
  37210. return new this.constructor(this.r,this.g,this.b)
  37211. },
  37212. copy: function(e) {
  37213. return this.r = e.r,
  37214. this.g = e.g,
  37215. this.b = e.b,
  37216. this
  37217. },
  37218. copyGammaToLinear: function(e, t) {
  37219. return void 0 === t && (t = 2),
  37220. this.r = Math.pow(e.r, t),
  37221. this.g = Math.pow(e.g, t),
  37222. this.b = Math.pow(e.b, t),
  37223. this
  37224. },
  37225. copyLinearToGamma: function(e, t) {
  37226. void 0 === t && (t = 2);
  37227. var i = 0 < t ? 1 / t : 1;
  37228. return this.r = Math.pow(e.r, i),
  37229. this.g = Math.pow(e.g, i),
  37230. this.b = Math.pow(e.b, i),
  37231. this
  37232. },
  37233. convertGammaToLinear: function() {
  37234. var e = this.r
  37235. , t = this.g
  37236. , i = this.b;
  37237. return this.r = e * e,
  37238. this.g = t * t,
  37239. this.b = i * i,
  37240. this
  37241. },
  37242. convertLinearToGamma: function() {
  37243. return this.r = Math.sqrt(this.r),
  37244. this.g = Math.sqrt(this.g),
  37245. this.b = Math.sqrt(this.b),
  37246. this
  37247. },
  37248. getHex: function() {
  37249. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  37250. },
  37251. getHexString: function() {
  37252. return ("000000" + this.getHex().toString(16)).slice(-6)
  37253. },
  37254. getHSL: function(e) {
  37255. var t, i, n = e || {
  37256. h: 0,
  37257. s: 0,
  37258. l: 0
  37259. }, 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;
  37260. if (l === s)
  37261. i = t = 0;
  37262. else {
  37263. var h = s - l;
  37264. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  37265. s) {
  37266. case r:
  37267. t = (o - a) / h + (o < a ? 6 : 0);
  37268. break;
  37269. case o:
  37270. t = (a - r) / h + 2;
  37271. break;
  37272. case a:
  37273. t = (r - o) / h + 4
  37274. }
  37275. t /= 6
  37276. }
  37277. return n.h = t,
  37278. n.s = i,
  37279. n.l = c,
  37280. n
  37281. },
  37282. getStyle: function() {
  37283. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  37284. },
  37285. offsetHSL: function(e, t, i) {
  37286. var n = this.getHSL();
  37287. return n.h += e,
  37288. n.s += t,
  37289. n.l += i,
  37290. this.setHSL(n.h, n.s, n.l),
  37291. this
  37292. },
  37293. add: function(e) {
  37294. return this.r += e.r,
  37295. this.g += e.g,
  37296. this.b += e.b,
  37297. this
  37298. },
  37299. addColors: function(e, t) {
  37300. return this.r = e.r + t.r,
  37301. this.g = e.g + t.g,
  37302. this.b = e.b + t.b,
  37303. this
  37304. },
  37305. addScalar: function(e) {
  37306. return this.r += e,
  37307. this.g += e,
  37308. this.b += e,
  37309. this
  37310. },
  37311. multiply: function(e) {
  37312. return this.r *= e.r,
  37313. this.g *= e.g,
  37314. this.b *= e.b,
  37315. this
  37316. },
  37317. multiplyScalar: function(e) {
  37318. return this.r *= e,
  37319. this.g *= e,
  37320. this.b *= e,
  37321. this
  37322. },
  37323. lerp: function(e, t) {
  37324. return this.r += (e.r - this.r) * t,
  37325. this.g += (e.g - this.g) * t,
  37326. this.b += (e.b - this.b) * t,
  37327. this
  37328. },
  37329. equals: function(e) {
  37330. return e.r === this.r && e.g === this.g && e.b === this.b
  37331. },
  37332. fromArray: function(e, t) {
  37333. return void 0 === t && (t = 0),
  37334. this.r = e[t],
  37335. this.g = e[t + 1],
  37336. this.b = e[t + 2],
  37337. this
  37338. },
  37339. toArray: function(e, t) {
  37340. return void 0 === e && (e = []),
  37341. void 0 === t && (t = 0),
  37342. e[t] = this.r,
  37343. e[t + 1] = this.g,
  37344. e[t + 2] = this.b,
  37345. e
  37346. }
  37347. },
  37348. Ci.ColorKeywords = {
  37349. aliceblue: 15792383,
  37350. antiquewhite: 16444375,
  37351. aqua: 65535,
  37352. aquamarine: 8388564,
  37353. azure: 15794175,
  37354. beige: 16119260,
  37355. bisque: 16770244,
  37356. black: 0,
  37357. blanchedalmond: 16772045,
  37358. blue: 255,
  37359. blueviolet: 9055202,
  37360. brown: 10824234,
  37361. burlywood: 14596231,
  37362. cadetblue: 6266528,
  37363. chartreuse: 8388352,
  37364. chocolate: 13789470,
  37365. coral: 16744272,
  37366. cornflowerblue: 6591981,
  37367. cornsilk: 16775388,
  37368. crimson: 14423100,
  37369. cyan: 65535,
  37370. darkblue: 139,
  37371. darkcyan: 35723,
  37372. darkgoldenrod: 12092939,
  37373. darkgray: 11119017,
  37374. darkgreen: 25600,
  37375. darkgrey: 11119017,
  37376. darkkhaki: 12433259,
  37377. darkmagenta: 9109643,
  37378. darkolivegreen: 5597999,
  37379. darkorange: 16747520,
  37380. darkorchid: 10040012,
  37381. darkred: 9109504,
  37382. darksalmon: 15308410,
  37383. darkseagreen: 9419919,
  37384. darkslateblue: 4734347,
  37385. darkslategray: 3100495,
  37386. darkslategrey: 3100495,
  37387. darkturquoise: 52945,
  37388. darkviolet: 9699539,
  37389. deeppink: 16716947,
  37390. deepskyblue: 49151,
  37391. dimgray: 6908265,
  37392. dimgrey: 6908265,
  37393. dodgerblue: 2003199,
  37394. firebrick: 11674146,
  37395. floralwhite: 16775920,
  37396. forestgreen: 2263842,
  37397. fuchsia: 16711935,
  37398. gainsboro: 14474460,
  37399. ghostwhite: 16316671,
  37400. gold: 16766720,
  37401. goldenrod: 14329120,
  37402. gray: 8421504,
  37403. green: 32768,
  37404. greenyellow: 11403055,
  37405. grey: 8421504,
  37406. honeydew: 15794160,
  37407. hotpink: 16738740,
  37408. indianred: 13458524,
  37409. indigo: 4915330,
  37410. ivory: 16777200,
  37411. khaki: 15787660,
  37412. lavender: 15132410,
  37413. lavenderblush: 16773365,
  37414. lawngreen: 8190976,
  37415. lemonchiffon: 16775885,
  37416. lightblue: 11393254,
  37417. lightcoral: 15761536,
  37418. lightcyan: 14745599,
  37419. lightgoldenrodyellow: 16448210,
  37420. lightgray: 13882323,
  37421. lightgreen: 9498256,
  37422. lightgrey: 13882323,
  37423. lightpink: 16758465,
  37424. lightsalmon: 16752762,
  37425. lightseagreen: 2142890,
  37426. lightskyblue: 8900346,
  37427. lightslategray: 7833753,
  37428. lightslategrey: 7833753,
  37429. lightsteelblue: 11584734,
  37430. lightyellow: 16777184,
  37431. lime: 65280,
  37432. limegreen: 3329330,
  37433. linen: 16445670,
  37434. magenta: 16711935,
  37435. maroon: 8388608,
  37436. mediumaquamarine: 6737322,
  37437. mediumblue: 205,
  37438. mediumorchid: 12211667,
  37439. mediumpurple: 9662683,
  37440. mediumseagreen: 3978097,
  37441. mediumslateblue: 8087790,
  37442. mediumspringgreen: 64154,
  37443. mediumturquoise: 4772300,
  37444. mediumvioletred: 13047173,
  37445. midnightblue: 1644912,
  37446. mintcream: 16121850,
  37447. mistyrose: 16770273,
  37448. moccasin: 16770229,
  37449. navajowhite: 16768685,
  37450. navy: 128,
  37451. oldlace: 16643558,
  37452. olive: 8421376,
  37453. olivedrab: 7048739,
  37454. orange: 16753920,
  37455. orangered: 16729344,
  37456. orchid: 14315734,
  37457. palegoldenrod: 15657130,
  37458. palegreen: 10025880,
  37459. paleturquoise: 11529966,
  37460. palevioletred: 14381203,
  37461. papayawhip: 16773077,
  37462. peachpuff: 16767673,
  37463. peru: 13468991,
  37464. pink: 16761035,
  37465. plum: 14524637,
  37466. powderblue: 11591910,
  37467. purple: 8388736,
  37468. red: 16711680,
  37469. rosybrown: 12357519,
  37470. royalblue: 4286945,
  37471. saddlebrown: 9127187,
  37472. salmon: 16416882,
  37473. sandybrown: 16032864,
  37474. seagreen: 3050327,
  37475. seashell: 16774638,
  37476. sienna: 10506797,
  37477. silver: 12632256,
  37478. skyblue: 8900331,
  37479. slateblue: 6970061,
  37480. slategray: 7372944,
  37481. slategrey: 7372944,
  37482. snow: 16775930,
  37483. springgreen: 65407,
  37484. steelblue: 4620980,
  37485. tan: 13808780,
  37486. teal: 32896,
  37487. thistle: 14204888,
  37488. tomato: 16737095,
  37489. turquoise: 4251856,
  37490. violet: 15631086,
  37491. wheat: 16113331,
  37492. white: 16777215,
  37493. whitesmoke: 16119285,
  37494. yellow: 16776960,
  37495. yellowgreen: 10145074
  37496. },
  37497. Ci.Quaternion = function(e, t, i, n) {
  37498. this._x = e || 0,
  37499. this._y = t || 0,
  37500. this._z = i || 0,
  37501. this._w = void 0 !== n ? n : 1
  37502. }
  37503. ,
  37504. Ci.Quaternion.prototype = {
  37505. constructor: Ci.Quaternion,
  37506. get x() {
  37507. return this._x
  37508. },
  37509. set x(e) {
  37510. this._x = e,
  37511. this.onChangeCallback()
  37512. },
  37513. get y() {
  37514. return this._y
  37515. },
  37516. set y(e) {
  37517. this._y = e,
  37518. this.onChangeCallback()
  37519. },
  37520. get z() {
  37521. return this._z
  37522. },
  37523. set z(e) {
  37524. this._z = e,
  37525. this.onChangeCallback()
  37526. },
  37527. get w() {
  37528. return this._w
  37529. },
  37530. set w(e) {
  37531. this._w = e,
  37532. this.onChangeCallback()
  37533. },
  37534. set: function(e, t, i, n) {
  37535. return this._x = e,
  37536. this._y = t,
  37537. this._z = i,
  37538. this._w = n,
  37539. this.onChangeCallback(),
  37540. this
  37541. },
  37542. clone: function() {
  37543. return new this.constructor(this._x,this._y,this._z,this._w)
  37544. },
  37545. toObject:function(){//add
  37546. return {x:this.x, y:this.y,z:this.z, w:this.w};
  37547. },
  37548. copy: function(e) {
  37549. return this._x = e.x,
  37550. this._y = e.y,
  37551. this._z = e.z,
  37552. this._w = e.w,
  37553. this.onChangeCallback(),
  37554. this
  37555. },
  37556. setFromEuler: function(e, t) {
  37557. if (e instanceof Ci.Euler == 0)
  37558. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  37559. var i = Math.cos(e._x / 2)
  37560. , n = Math.cos(e._y / 2)
  37561. , r = Math.cos(e._z / 2)
  37562. , o = Math.sin(e._x / 2)
  37563. , a = Math.sin(e._y / 2)
  37564. , s = Math.sin(e._z / 2)
  37565. , l = e.order;
  37566. return "XYZ" === l ? (this._x = o * n * r + i * a * s,
  37567. this._y = i * a * r - o * n * s,
  37568. this._z = i * n * s + o * a * r,
  37569. this._w = i * n * r - o * a * s) : "YXZ" === l ? (this._x = o * n * r + i * a * s,
  37570. this._y = i * a * r - o * n * s,
  37571. this._z = i * n * s - o * a * r,
  37572. this._w = i * n * r + o * a * s) : "ZXY" === l ? (this._x = o * n * r - i * a * s,
  37573. this._y = i * a * r + o * n * s,
  37574. this._z = i * n * s + o * a * r,
  37575. this._w = i * n * r - o * a * s) : "ZYX" === l ? (this._x = o * n * r - i * a * s,
  37576. this._y = i * a * r + o * n * s,
  37577. this._z = i * n * s - o * a * r,
  37578. this._w = i * n * r + o * a * s) : "YZX" === l ? (this._x = o * n * r + i * a * s,
  37579. this._y = i * a * r + o * n * s,
  37580. this._z = i * n * s - o * a * r,
  37581. this._w = i * n * r - o * a * s) : "XZY" === l && (this._x = o * n * r - i * a * s,
  37582. this._y = i * a * r - o * n * s,
  37583. this._z = i * n * s + o * a * r,
  37584. this._w = i * n * r + o * a * s),
  37585. !1 !== t && this.onChangeCallback(),
  37586. this
  37587. },
  37588. setFromAxisAngle: function(e, t) {
  37589. var i = t / 2
  37590. , n = Math.sin(i);
  37591. return this._x = e.x * n,
  37592. this._y = e.y * n,
  37593. this._z = e.z * n,
  37594. this._w = Math.cos(i),
  37595. this.onChangeCallback(),
  37596. this
  37597. },
  37598. setFromRotationMatrix: function(e) {
  37599. 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;
  37600. return 0 < d ? (t = .5 / Math.sqrt(d + 1),
  37601. this._w = .25 / t,
  37602. this._x = (h - l) * t,
  37603. this._y = (o - c) * t,
  37604. this._z = (a - r) * t) : s < n && u < n ? (t = 2 * Math.sqrt(1 + n - s - u),
  37605. this._w = (h - l) / t,
  37606. this._x = .25 * t,
  37607. this._y = (r + a) / t,
  37608. this._z = (o + c) / t) : u < s ? (t = 2 * Math.sqrt(1 + s - n - u),
  37609. this._w = (o - c) / t,
  37610. this._x = (r + a) / t,
  37611. this._y = .25 * t,
  37612. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  37613. this._w = (a - r) / t,
  37614. this._x = (o + c) / t,
  37615. this._y = (l + h) / t,
  37616. this._z = .25 * t),
  37617. this.onChangeCallback(),
  37618. this
  37619. },
  37620. setFromUnitVectors: function(e, t) {
  37621. return void 0 === Be && (Be = new Ci.Vector3),
  37622. (Ve = e.dot(t) + 1) < 1e-6 ? (Ve = 0,
  37623. 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),
  37624. this._x = Be.x,
  37625. this._y = Be.y,
  37626. this._z = Be.z,
  37627. this._w = Ve,
  37628. this.normalize(),
  37629. this
  37630. },
  37631. inverse: function() {
  37632. return this.conjugate().normalize(),
  37633. this
  37634. },
  37635. conjugate: function() {
  37636. return this._x *= -1,
  37637. this._y *= -1,
  37638. this._z *= -1,
  37639. this.onChangeCallback(),
  37640. this
  37641. },
  37642. dot: function(e) {
  37643. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  37644. },
  37645. lengthSq: function() {
  37646. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  37647. },
  37648. length: function() {
  37649. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  37650. },
  37651. normalize: function() {
  37652. var e = this.length();
  37653. return 0 === e ? (this._x = 0,
  37654. this._y = 0,
  37655. this._z = 0,
  37656. this._w = 1) : (e = 1 / e,
  37657. this._x = this._x * e,
  37658. this._y = this._y * e,
  37659. this._z = this._z * e,
  37660. this._w = this._w * e),
  37661. this.onChangeCallback(),
  37662. this
  37663. },
  37664. multiply: function(e, t) {
  37665. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  37666. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  37667. },
  37668. multiplyQuaternions: function(e, t) {
  37669. var i = e._x
  37670. , n = e._y
  37671. , r = e._z
  37672. , o = e._w
  37673. , a = t._x
  37674. , s = t._y
  37675. , l = t._z
  37676. , c = t._w;
  37677. return this._x = i * c + o * a + n * l - r * s,
  37678. this._y = n * c + o * s + r * a - i * l,
  37679. this._z = r * c + o * l + i * s - n * a,
  37680. this._w = o * c - i * a - n * s - r * l,
  37681. this.onChangeCallback(),
  37682. this
  37683. },
  37684. slerp: function(e, t) {
  37685. if (0 === t)
  37686. return this;
  37687. if (1 === t)
  37688. return this.copy(e);
  37689. var i = this._x
  37690. , n = this._y
  37691. , r = this._z
  37692. , o = this._w
  37693. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  37694. if (a < 0 ? (this._w = -e._w,
  37695. this._x = -e._x,
  37696. this._y = -e._y,
  37697. this._z = -e._z,
  37698. a = -a) : this.copy(e),
  37699. 1 <= a)
  37700. return this._w = o,
  37701. this._x = i,
  37702. this._y = n,
  37703. this._z = r,
  37704. this;
  37705. var s = Math.sqrt(1 - a * a);
  37706. if (Math.abs(s) < .001)
  37707. return this._w = .5 * (o + this._w),
  37708. this._x = .5 * (i + this._x),
  37709. this._y = .5 * (n + this._y),
  37710. this._z = .5 * (r + this._z),
  37711. this;
  37712. var l = Math.atan2(s, a)
  37713. , c = Math.sin((1 - t) * l) / s
  37714. , h = Math.sin(t * l) / s;
  37715. return this._w = o * c + this._w * h,
  37716. this._x = i * c + this._x * h,
  37717. this._y = n * c + this._y * h,
  37718. this._z = r * c + this._z * h,
  37719. this.onChangeCallback(),
  37720. this
  37721. },
  37722. equals: function(e) {
  37723. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  37724. },
  37725. fromArray: function(e, t) {
  37726. return void 0 === t && (t = 0),
  37727. this._x = e[t],
  37728. this._y = e[t + 1],
  37729. this._z = e[t + 2],
  37730. this._w = e[t + 3],
  37731. this.onChangeCallback(),
  37732. this
  37733. },
  37734. toArray: function(e, t) {
  37735. return void 0 === e && (e = []),
  37736. void 0 === t && (t = 0),
  37737. e[t] = this._x,
  37738. e[t + 1] = this._y,
  37739. e[t + 2] = this._z,
  37740. e[t + 3] = this._w,
  37741. e
  37742. },
  37743. onChange: function(e) {
  37744. return this.onChangeCallback = e,
  37745. this
  37746. },
  37747. onChangeCallback: function() {}
  37748. },
  37749. Object.assign(Ci.Quaternion, {
  37750. slerp: function(e, t, i, n) {
  37751. return i.copy(e).slerp(t, n)
  37752. },
  37753. slerpFlat: function(e, t, i, n, r, o, a) {
  37754. var s = i[n + 0]
  37755. , l = i[n + 1]
  37756. , c = i[n + 2]
  37757. , h = i[n + 3]
  37758. , u = r[o + 0]
  37759. , d = r[o + 1]
  37760. , p = r[o + 2]
  37761. , f = r[o + 3];
  37762. if (h !== f || s !== u || l !== d || c !== p) {
  37763. var g = 1 - a
  37764. , m = s * u + l * d + c * p + h * f
  37765. , v = 0 <= m ? 1 : -1
  37766. , y = 1 - m * m;
  37767. if (y > Number.EPSILON) {
  37768. var A = Math.sqrt(y)
  37769. , C = Math.atan2(A, m * v);
  37770. g = Math.sin(g * C) / A,
  37771. a = Math.sin(a * C) / A
  37772. }
  37773. var I = a * v;
  37774. if (s = s * g + u * I,
  37775. l = l * g + d * I,
  37776. c = c * g + p * I,
  37777. h = h * g + f * I,
  37778. g === 1 - a) {
  37779. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  37780. s *= E,
  37781. l *= E,
  37782. c *= E,
  37783. h *= E
  37784. }
  37785. }
  37786. e[t] = s,
  37787. e[t + 1] = l,
  37788. e[t + 2] = c,
  37789. e[t + 3] = h
  37790. }
  37791. }),
  37792. Ci.Vector2 = function(e, t) {
  37793. this.x = e || 0,
  37794. this.y = t || 0
  37795. }
  37796. ,
  37797. Ci.Vector2.prototype = {
  37798. constructor: Ci.Vector2,
  37799. get width() {
  37800. return this.x
  37801. },
  37802. set width(e) {
  37803. this.x = e
  37804. },
  37805. get height() {
  37806. return this.y
  37807. },
  37808. set height(e) {
  37809. this.y = e
  37810. },
  37811. set: function(e, t) {
  37812. return this.x = e,
  37813. this.y = t,
  37814. this
  37815. },
  37816. setScalar: function(e) {
  37817. return this.x = e,
  37818. this.y = e,
  37819. this
  37820. },
  37821. setX: function(e) {
  37822. return this.x = e,
  37823. this
  37824. },
  37825. setY: function(e) {
  37826. return this.y = e,
  37827. this
  37828. },
  37829. setComponent: function(e, t) {
  37830. switch (e) {
  37831. case 0:
  37832. this.x = t;
  37833. break;
  37834. case 1:
  37835. this.y = t;
  37836. break;
  37837. default:
  37838. throw new Error("index is out of range: " + e)
  37839. }
  37840. },
  37841. getComponent: function(e) {
  37842. switch (e) {
  37843. case 0:
  37844. return this.x;
  37845. case 1:
  37846. return this.y;
  37847. default:
  37848. throw new Error("index is out of range: " + e)
  37849. }
  37850. },
  37851. clone: function() {
  37852. return new this.constructor(this.x,this.y)
  37853. },
  37854. copy: function(e) {
  37855. return this.x = e.x,
  37856. this.y = e.y,
  37857. this
  37858. },
  37859. add: function(e, t) {
  37860. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37861. this.addVectors(e, t)) : (this.x += e.x,
  37862. this.y += e.y,
  37863. this)
  37864. },
  37865. addScalar: function(e) {
  37866. return this.x += e,
  37867. this.y += e,
  37868. this
  37869. },
  37870. addVectors: function(e, t) {
  37871. return this.x = e.x + t.x,
  37872. this.y = e.y + t.y,
  37873. this
  37874. },
  37875. addScaledVector: function(e, t) {
  37876. return this.x += e.x * t,
  37877. this.y += e.y * t,
  37878. this
  37879. },
  37880. sub: function(e, t) {
  37881. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37882. this.subVectors(e, t)) : (this.x -= e.x,
  37883. this.y -= e.y,
  37884. this)
  37885. },
  37886. subScalar: function(e) {
  37887. return this.x -= e,
  37888. this.y -= e,
  37889. this
  37890. },
  37891. subVectors: function(e, t) {
  37892. return this.x = e.x - t.x,
  37893. this.y = e.y - t.y,
  37894. this
  37895. },
  37896. multiply: function(e) {
  37897. return this.x *= e.x,
  37898. this.y *= e.y,
  37899. this
  37900. },
  37901. multiplyScalar: function(e) {
  37902. return isFinite(e) ? (this.x *= e,
  37903. this.y *= e) : (this.x = 0,
  37904. this.y = 0),
  37905. this
  37906. },
  37907. divide: function(e) {
  37908. return this.x /= e.x,
  37909. this.y /= e.y,
  37910. this
  37911. },
  37912. divideScalar: function(e) {
  37913. return this.multiplyScalar(1 / e)
  37914. },
  37915. min: function(e) {
  37916. return this.x = Math.min(this.x, e.x),
  37917. this.y = Math.min(this.y, e.y),
  37918. this
  37919. },
  37920. max: function(e) {
  37921. return this.x = Math.max(this.x, e.x),
  37922. this.y = Math.max(this.y, e.y),
  37923. this
  37924. },
  37925. clamp: function(e, t) {
  37926. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  37927. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  37928. this
  37929. },
  37930. clampScalar: function(e, t) {
  37931. return void 0 === Ne && (Ne = new Ci.Vector2,
  37932. Fe = new Ci.Vector2),
  37933. Ne.set(e, e),
  37934. Fe.set(t, t),
  37935. this.clamp(Ne, Fe)
  37936. },
  37937. clampLength: function(e, t) {
  37938. var i = this.length();
  37939. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  37940. this
  37941. },
  37942. floor: function() {
  37943. return this.x = Math.floor(this.x),
  37944. this.y = Math.floor(this.y),
  37945. this
  37946. },
  37947. ceil: function() {
  37948. return this.x = Math.ceil(this.x),
  37949. this.y = Math.ceil(this.y),
  37950. this
  37951. },
  37952. round: function() {
  37953. return this.x = Math.round(this.x),
  37954. this.y = Math.round(this.y),
  37955. this
  37956. },
  37957. roundToZero: function() {
  37958. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  37959. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  37960. this
  37961. },
  37962. negate: function() {
  37963. return this.x = -this.x,
  37964. this.y = -this.y,
  37965. this
  37966. },
  37967. dot: function(e) {
  37968. return this.x * e.x + this.y * e.y
  37969. },
  37970. lengthSq: function() {
  37971. return this.x * this.x + this.y * this.y
  37972. },
  37973. length: function() {
  37974. return Math.sqrt(this.x * this.x + this.y * this.y)
  37975. },
  37976. lengthManhattan: function() {
  37977. return Math.abs(this.x) + Math.abs(this.y)
  37978. },
  37979. normalize: function() {
  37980. return this.divideScalar(this.length())
  37981. },
  37982. angle: function() {
  37983. var e = Math.atan2(this.y, this.x);
  37984. return e < 0 && (e += 2 * Math.PI),
  37985. e
  37986. },
  37987. distanceTo: function(e) {
  37988. return Math.sqrt(this.distanceToSquared(e))
  37989. },
  37990. distanceToSquared: function(e) {
  37991. var t = this.x - e.x
  37992. , i = this.y - e.y;
  37993. return t * t + i * i
  37994. },
  37995. setLength: function(e) {
  37996. return this.multiplyScalar(e / this.length())
  37997. },
  37998. lerp: function(e, t) {
  37999. return this.x += (e.x - this.x) * t,
  38000. this.y += (e.y - this.y) * t,
  38001. this
  38002. },
  38003. lerpVectors: function(e, t, i) {
  38004. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38005. this
  38006. },
  38007. equals: function(e) {
  38008. return e.x === this.x && e.y === this.y
  38009. },
  38010. fromArray: function(e, t) {
  38011. return void 0 === t && (t = 0),
  38012. this.x = e[t],
  38013. this.y = e[t + 1],
  38014. this
  38015. },
  38016. toArray: function(e, t) {
  38017. return void 0 === e && (e = []),
  38018. void 0 === t && (t = 0),
  38019. e[t] = this.x,
  38020. e[t + 1] = this.y,
  38021. e
  38022. },
  38023. fromAttribute: function(e, t, i) {
  38024. return void 0 === i && (i = 0),
  38025. t = t * e.itemSize + i,
  38026. this.x = e.array[t],
  38027. this.y = e.array[t + 1],
  38028. this
  38029. },
  38030. rotateAround: function(e, t) {
  38031. var i = Math.cos(t)
  38032. , n = Math.sin(t)
  38033. , r = this.x - e.x
  38034. , o = this.y - e.y;
  38035. return this.x = r * i - o * n + e.x,
  38036. this.y = r * n + o * i + e.y,
  38037. this
  38038. }
  38039. },
  38040. Ci.Vector3 = function(e, t, i) {
  38041. this.x = e || 0,
  38042. this.y = t || 0,
  38043. this.z = i || 0
  38044. }
  38045. ,
  38046. Ci.Vector3.prototype = {
  38047. constructor: Ci.Vector3,
  38048. set: function(e, t, i) {
  38049. return this.x = e,
  38050. this.y = t,
  38051. this.z = i,
  38052. this
  38053. },
  38054. setScalar: function(e) {
  38055. return this.x = e,
  38056. this.y = e,
  38057. this.z = e,
  38058. this
  38059. },
  38060. setX: function(e) {
  38061. return this.x = e,
  38062. this
  38063. },
  38064. setY: function(e) {
  38065. return this.y = e,
  38066. this
  38067. },
  38068. setZ: function(e) {
  38069. return this.z = e,
  38070. this
  38071. },
  38072. setComponent: function(e, t) {
  38073. switch (e) {
  38074. case 0:
  38075. this.x = t;
  38076. break;
  38077. case 1:
  38078. this.y = t;
  38079. break;
  38080. case 2:
  38081. this.z = t;
  38082. break;
  38083. default:
  38084. throw new Error("index is out of range: " + e)
  38085. }
  38086. },
  38087. getComponent: function(e) {
  38088. switch (e) {
  38089. case 0:
  38090. return this.x;
  38091. case 1:
  38092. return this.y;
  38093. case 2:
  38094. return this.z;
  38095. default:
  38096. throw new Error("index is out of range: " + e)
  38097. }
  38098. },
  38099. clone: function() {
  38100. return new this.constructor(this.x,this.y,this.z)
  38101. },
  38102. copy: function(e) {
  38103. return this.x = e.x,
  38104. this.y = e.y,
  38105. this.z = e.z,
  38106. this
  38107. },
  38108. add: function(e, t) {
  38109. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38110. this.addVectors(e, t)) : (this.x += e.x,
  38111. this.y += e.y,
  38112. this.z += e.z,
  38113. this)
  38114. },
  38115. addScalar: function(e) {
  38116. return this.x += e,
  38117. this.y += e,
  38118. this.z += e,
  38119. this
  38120. },
  38121. addVectors: function(e, t) {
  38122. return this.x = e.x + t.x,
  38123. this.y = e.y + t.y,
  38124. this.z = e.z + t.z,
  38125. this
  38126. },
  38127. addScaledVector: function(e, t) {
  38128. return this.x += e.x * t,
  38129. this.y += e.y * t,
  38130. this.z += e.z * t,
  38131. this
  38132. },
  38133. sub: function(e, t) {
  38134. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38135. this.subVectors(e, t)) : (this.x -= e.x,
  38136. this.y -= e.y,
  38137. this.z -= e.z,
  38138. this)
  38139. },
  38140. subScalar: function(e) {
  38141. return this.x -= e,
  38142. this.y -= e,
  38143. this.z -= e,
  38144. this
  38145. },
  38146. subVectors: function(e, t) {
  38147. return this.x = e.x - t.x,
  38148. this.y = e.y - t.y,
  38149. this.z = e.z - t.z,
  38150. this
  38151. },
  38152. multiply: function(e, t) {
  38153. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  38154. this.multiplyVectors(e, t)) : (this.x *= e.x,
  38155. this.y *= e.y,
  38156. this.z *= e.z,
  38157. this)
  38158. },
  38159. multiplyScalar: function(e) {
  38160. return isFinite(e) ? (this.x *= e,
  38161. this.y *= e,
  38162. this.z *= e) : (this.x = 0,
  38163. this.y = 0,
  38164. this.z = 0),
  38165. this
  38166. },
  38167. multiplyVectors: function(e, t) {
  38168. return this.x = e.x * t.x,
  38169. this.y = e.y * t.y,
  38170. this.z = e.z * t.z,
  38171. this
  38172. },
  38173. applyEuler: function(e) {
  38174. return e instanceof Ci.Euler == 0 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  38175. void 0 === De && (De = new Ci.Quaternion),
  38176. this.applyQuaternion(De.setFromEuler(e)),
  38177. this
  38178. },
  38179. applyAxisAngle: function(e, t) {
  38180. return void 0 === Le && (Le = new Ci.Quaternion),
  38181. this.applyQuaternion(Le.setFromAxisAngle(e, t)),
  38182. this
  38183. },
  38184. applyMatrix3: function(e) {
  38185. var t = this.x
  38186. , i = this.y
  38187. , n = this.z
  38188. , r = e.elements;
  38189. return this.x = r[0] * t + r[3] * i + r[6] * n,
  38190. this.y = r[1] * t + r[4] * i + r[7] * n,
  38191. this.z = r[2] * t + r[5] * i + r[8] * n,
  38192. this
  38193. },
  38194. applyMatrix4: function(e) {
  38195. var t = this.x
  38196. , i = this.y
  38197. , n = this.z
  38198. , r = e.elements;
  38199. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  38200. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  38201. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  38202. this
  38203. },
  38204. applyProjection: function(e) {
  38205. var t = this.x
  38206. , i = this.y
  38207. , n = this.z
  38208. , r = e.elements
  38209. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  38210. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  38211. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  38212. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  38213. this
  38214. },
  38215. applyQuaternion: function(e) {
  38216. var t = this.x
  38217. , i = this.y
  38218. , n = this.z
  38219. , r = e.x
  38220. , o = e.y
  38221. , a = e.z
  38222. , s = e.w
  38223. , l = s * t + o * n - a * i
  38224. , c = s * i + a * t - r * n
  38225. , h = s * n + r * i - o * t
  38226. , u = -r * t - o * i - a * n;
  38227. return this.x = l * s + u * -r + c * -a - h * -o,
  38228. this.y = c * s + u * -o + h * -r - l * -a,
  38229. this.z = h * s + u * -a + l * -o - c * -r,
  38230. this
  38231. },
  38232. project: function(e) {
  38233. return void 0 === Oe && (Oe = new Ci.Matrix4),
  38234. Oe.multiplyMatrices(e.projectionMatrix, Oe.getInverse(e.matrixWorld)),
  38235. this.applyProjection(Oe)
  38236. },
  38237. unproject: function(e) {
  38238. return void 0 === Pe && (Pe = new Ci.Matrix4),
  38239. Pe.multiplyMatrices(e.matrixWorld, Pe.getInverse(e.projectionMatrix)),
  38240. this.applyProjection(Pe)
  38241. },
  38242. transformDirection: function(e) {
  38243. var t = this.x
  38244. , i = this.y
  38245. , n = this.z
  38246. , r = e.elements;
  38247. return this.x = r[0] * t + r[4] * i + r[8] * n,
  38248. this.y = r[1] * t + r[5] * i + r[9] * n,
  38249. this.z = r[2] * t + r[6] * i + r[10] * n,
  38250. this.normalize(),
  38251. this
  38252. },
  38253. divide: function(e) {
  38254. return this.x /= e.x,
  38255. this.y /= e.y,
  38256. this.z /= e.z,
  38257. this
  38258. },
  38259. divideScalar: function(e) {
  38260. return this.multiplyScalar(1 / e)
  38261. },
  38262. min: function(e) {
  38263. return this.x = Math.min(this.x, e.x),
  38264. this.y = Math.min(this.y, e.y),
  38265. this.z = Math.min(this.z, e.z),
  38266. this
  38267. },
  38268. max: function(e) {
  38269. return this.x = Math.max(this.x, e.x),
  38270. this.y = Math.max(this.y, e.y),
  38271. this.z = Math.max(this.z, e.z),
  38272. this
  38273. },
  38274. clamp: function(e, t) {
  38275. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38276. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38277. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38278. this
  38279. },
  38280. clampScalar: function(e, t) {
  38281. return void 0 === Me && (Me = new Ci.Vector3,
  38282. Re = new Ci.Vector3),
  38283. Me.set(e, e, e),
  38284. Re.set(t, t, t),
  38285. this.clamp(Me, Re)
  38286. },
  38287. clampLength: function(e, t) {
  38288. var i = this.length();
  38289. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38290. this
  38291. },
  38292. floor: function() {
  38293. return this.x = Math.floor(this.x),
  38294. this.y = Math.floor(this.y),
  38295. this.z = Math.floor(this.z),
  38296. this
  38297. },
  38298. ceil: function() {
  38299. return this.x = Math.ceil(this.x),
  38300. this.y = Math.ceil(this.y),
  38301. this.z = Math.ceil(this.z),
  38302. this
  38303. },
  38304. round: function() {
  38305. return this.x = Math.round(this.x),
  38306. this.y = Math.round(this.y),
  38307. this.z = Math.round(this.z),
  38308. this
  38309. },
  38310. roundToZero: function() {
  38311. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38312. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38313. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38314. this
  38315. },
  38316. negate: function() {
  38317. return this.x = -this.x,
  38318. this.y = -this.y,
  38319. this.z = -this.z,
  38320. this
  38321. },
  38322. dot: function(e) {
  38323. return this.x * e.x + this.y * e.y + this.z * e.z
  38324. },
  38325. lengthSq: function() {
  38326. return this.x * this.x + this.y * this.y + this.z * this.z
  38327. },
  38328. length: function() {
  38329. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  38330. },
  38331. lengthManhattan: function() {
  38332. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  38333. },
  38334. normalize: function() {
  38335. return this.divideScalar(this.length())
  38336. },
  38337. setLength: function(e) {
  38338. return this.multiplyScalar(e / this.length())
  38339. },
  38340. lerp: function(e, t) {
  38341. return this.x += (e.x - this.x) * t,
  38342. this.y += (e.y - this.y) * t,
  38343. this.z += (e.z - this.z) * t,
  38344. this
  38345. },
  38346. lerpVectors: function(e, t, i) {
  38347. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38348. this
  38349. },
  38350. cross: function(e, t) {
  38351. if (void 0 !== t)
  38352. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  38353. this.crossVectors(e, t);
  38354. var i = this.x
  38355. , n = this.y
  38356. , r = this.z;
  38357. return this.x = n * e.z - r * e.y,
  38358. this.y = r * e.x - i * e.z,
  38359. this.z = i * e.y - n * e.x,
  38360. this
  38361. },
  38362. crossVectors: function(e, t) {
  38363. var i = e.x
  38364. , n = e.y
  38365. , r = e.z
  38366. , o = t.x
  38367. , a = t.y
  38368. , s = t.z;
  38369. return this.x = n * s - r * a,
  38370. this.y = r * o - i * s,
  38371. this.z = i * a - n * o,
  38372. this
  38373. },
  38374. projectOnVector: function(e) {
  38375. return void 0 === xe && (xe = new Ci.Vector3),
  38376. xe.copy(e).normalize(),
  38377. Se = this.dot(xe),
  38378. this.copy(xe).multiplyScalar(Se)
  38379. },
  38380. projectOnPlane: function(e) {
  38381. return void 0 === Te && (Te = new Ci.Vector3),
  38382. Te.copy(this).projectOnVector(e),
  38383. this.sub(Te)
  38384. },
  38385. reflect: function(e) {
  38386. return void 0 === we && (we = new Ci.Vector3),
  38387. this.sub(we.copy(e).multiplyScalar(2 * this.dot(e)))
  38388. },
  38389. angleTo: function(e) {
  38390. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  38391. return Math.acos(Ci.Math.clamp(t, -1, 1))
  38392. },
  38393. distanceTo: function(e) {
  38394. return Math.sqrt(this.distanceToSquared(e))
  38395. },
  38396. distanceToSquared: function(e) {
  38397. var t = this.x - e.x
  38398. , i = this.y - e.y
  38399. , n = this.z - e.z;
  38400. return t * t + i * i + n * n
  38401. },
  38402. setFromSpherical: function(e) {
  38403. var t = Math.sin(e.phi) * e.radius;
  38404. return this.x = t * Math.sin(e.theta),
  38405. this.y = Math.cos(e.phi) * e.radius,
  38406. this.z = t * Math.cos(e.theta),
  38407. this
  38408. },
  38409. setFromMatrixPosition: function(e) {
  38410. return this.setFromMatrixColumn(e, 3)
  38411. },
  38412. setFromMatrixScale: function(e) {
  38413. var t = this.setFromMatrixColumn(e, 0).length()
  38414. , i = this.setFromMatrixColumn(e, 1).length()
  38415. , n = this.setFromMatrixColumn(e, 2).length();
  38416. return this.x = t,
  38417. this.y = i,
  38418. this.z = n,
  38419. this
  38420. },
  38421. setFromMatrixColumn: function(e, t) {
  38422. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  38423. t = e = t),
  38424. this.fromArray(e.elements, 4 * t)
  38425. },
  38426. equals: function(e) {
  38427. return e.x === this.x && e.y === this.y && e.z === this.z
  38428. },
  38429. fromArray: function(e, t) {
  38430. return void 0 === t && (t = 0),
  38431. this.x = e[t],
  38432. this.y = e[t + 1],
  38433. this.z = e[t + 2],
  38434. this
  38435. },
  38436. toArray: function(e, t) {
  38437. return void 0 === e && (e = []),
  38438. void 0 === t && (t = 0),
  38439. e[t] = this.x,
  38440. e[t + 1] = this.y,
  38441. e[t + 2] = this.z,
  38442. e
  38443. },
  38444. fromAttribute: function(e, t, i) {
  38445. return void 0 === i && (i = 0),
  38446. t = t * e.itemSize + i,
  38447. this.x = e.array[t],
  38448. this.y = e.array[t + 1],
  38449. this.z = e.array[t + 2],
  38450. this
  38451. }
  38452. },
  38453. Ci.Vector4 = function(e, t, i, n) {
  38454. this.x = e || 0,
  38455. this.y = t || 0,
  38456. this.z = i || 0,
  38457. this.w = void 0 !== n ? n : 1
  38458. }
  38459. ,
  38460. Ci.Vector4.prototype = {
  38461. constructor: Ci.Vector4,
  38462. set: function(e, t, i, n) {
  38463. return this.x = e,
  38464. this.y = t,
  38465. this.z = i,
  38466. this.w = n,
  38467. this
  38468. },
  38469. setScalar: function(e) {
  38470. return this.x = e,
  38471. this.y = e,
  38472. this.z = e,
  38473. this.w = e,
  38474. this
  38475. },
  38476. setX: function(e) {
  38477. return this.x = e,
  38478. this
  38479. },
  38480. setY: function(e) {
  38481. return this.y = e,
  38482. this
  38483. },
  38484. setZ: function(e) {
  38485. return this.z = e,
  38486. this
  38487. },
  38488. setW: function(e) {
  38489. return this.w = e,
  38490. this
  38491. },
  38492. setComponent: function(e, t) {
  38493. switch (e) {
  38494. case 0:
  38495. this.x = t;
  38496. break;
  38497. case 1:
  38498. this.y = t;
  38499. break;
  38500. case 2:
  38501. this.z = t;
  38502. break;
  38503. case 3:
  38504. this.w = t;
  38505. break;
  38506. default:
  38507. throw new Error("index is out of range: " + e)
  38508. }
  38509. },
  38510. getComponent: function(e) {
  38511. switch (e) {
  38512. case 0:
  38513. return this.x;
  38514. case 1:
  38515. return this.y;
  38516. case 2:
  38517. return this.z;
  38518. case 3:
  38519. return this.w;
  38520. default:
  38521. throw new Error("index is out of range: " + e)
  38522. }
  38523. },
  38524. clone: function() {
  38525. return new this.constructor(this.x,this.y,this.z,this.w)
  38526. },
  38527. copy: function(e) {
  38528. return this.x = e.x,
  38529. this.y = e.y,
  38530. this.z = e.z,
  38531. this.w = void 0 !== e.w ? e.w : 1,
  38532. this
  38533. },
  38534. add: function(e, t) {
  38535. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38536. this.addVectors(e, t)) : (this.x += e.x,
  38537. this.y += e.y,
  38538. this.z += e.z,
  38539. this.w += e.w,
  38540. this)
  38541. },
  38542. addScalar: function(e) {
  38543. return this.x += e,
  38544. this.y += e,
  38545. this.z += e,
  38546. this.w += e,
  38547. this
  38548. },
  38549. addVectors: function(e, t) {
  38550. return this.x = e.x + t.x,
  38551. this.y = e.y + t.y,
  38552. this.z = e.z + t.z,
  38553. this.w = e.w + t.w,
  38554. this
  38555. },
  38556. addScaledVector: function(e, t) {
  38557. return this.x += e.x * t,
  38558. this.y += e.y * t,
  38559. this.z += e.z * t,
  38560. this.w += e.w * t,
  38561. this
  38562. },
  38563. sub: function(e, t) {
  38564. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38565. this.subVectors(e, t)) : (this.x -= e.x,
  38566. this.y -= e.y,
  38567. this.z -= e.z,
  38568. this.w -= e.w,
  38569. this)
  38570. },
  38571. subScalar: function(e) {
  38572. return this.x -= e,
  38573. this.y -= e,
  38574. this.z -= e,
  38575. this.w -= e,
  38576. this
  38577. },
  38578. subVectors: function(e, t) {
  38579. return this.x = e.x - t.x,
  38580. this.y = e.y - t.y,
  38581. this.z = e.z - t.z,
  38582. this.w = e.w - t.w,
  38583. this
  38584. },
  38585. multiplyScalar: function(e) {
  38586. return isFinite(e) ? (this.x *= e,
  38587. this.y *= e,
  38588. this.z *= e,
  38589. this.w *= e) : (this.x = 0,
  38590. this.y = 0,
  38591. this.z = 0,
  38592. this.w = 0),
  38593. this
  38594. },
  38595. applyMatrix4: function(e) {
  38596. var t = this.x
  38597. , i = this.y
  38598. , n = this.z
  38599. , r = this.w
  38600. , o = e.elements;
  38601. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  38602. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  38603. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  38604. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  38605. this
  38606. },
  38607. divideScalar: function(e) {
  38608. return this.multiplyScalar(1 / e)
  38609. },
  38610. setAxisAngleFromQuaternion: function(e) {
  38611. this.w = 2 * Math.acos(e.w);
  38612. var t = Math.sqrt(1 - e.w * e.w);
  38613. return t < 1e-4 ? (this.x = 1,
  38614. this.y = 0,
  38615. this.z = 0) : (this.x = e.x / t,
  38616. this.y = e.y / t,
  38617. this.z = e.z / t),
  38618. this
  38619. },
  38620. setAxisAngleFromRotationMatrix: function(e) {
  38621. 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];
  38622. if (Math.abs(s - c) < .01 && Math.abs(l - d) < .01 && Math.abs(u - p) < .01) {
  38623. if (Math.abs(s + c) < .1 && Math.abs(l + d) < .1 && Math.abs(u + p) < .1 && Math.abs(a + h + f - 3) < .1)
  38624. return this.set(1, 0, 0, 0),
  38625. this;
  38626. t = Math.PI;
  38627. var g = (a + 1) / 2
  38628. , m = (h + 1) / 2
  38629. , v = (f + 1) / 2
  38630. , y = (s + c) / 4
  38631. , A = (l + d) / 4
  38632. , C = (u + p) / 4;
  38633. return m < g && v < g ? r = g < .01 ? (i = 0,
  38634. n = .707106781) : (n = y / (i = Math.sqrt(g)),
  38635. A / i) : v < m ? r = m < .01 ? (n = 0,
  38636. i = .707106781) : (i = y / (n = Math.sqrt(m)),
  38637. C / n) : v < .01 ? (n = i = .707106781,
  38638. r = 0) : (i = A / (r = Math.sqrt(v)),
  38639. n = C / r),
  38640. this.set(i, n, r, t),
  38641. this
  38642. }
  38643. var I = Math.sqrt((p - u) * (p - u) + (l - d) * (l - d) + (c - s) * (c - s));
  38644. return Math.abs(I) < .001 && (I = 1),
  38645. this.x = (p - u) / I,
  38646. this.y = (l - d) / I,
  38647. this.z = (c - s) / I,
  38648. this.w = Math.acos((a + h + f - 1) / 2),
  38649. this
  38650. },
  38651. min: function(e) {
  38652. return this.x = Math.min(this.x, e.x),
  38653. this.y = Math.min(this.y, e.y),
  38654. this.z = Math.min(this.z, e.z),
  38655. this.w = Math.min(this.w, e.w),
  38656. this
  38657. },
  38658. max: function(e) {
  38659. return this.x = Math.max(this.x, e.x),
  38660. this.y = Math.max(this.y, e.y),
  38661. this.z = Math.max(this.z, e.z),
  38662. this.w = Math.max(this.w, e.w),
  38663. this
  38664. },
  38665. clamp: function(e, t) {
  38666. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38667. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38668. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38669. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  38670. this
  38671. },
  38672. clampScalar: function(e, t) {
  38673. return void 0 === _e && (_e = new Ci.Vector4,
  38674. be = new Ci.Vector4),
  38675. _e.set(e, e, e, e),
  38676. be.set(t, t, t, t),
  38677. this.clamp(_e, be)
  38678. },
  38679. floor: function() {
  38680. return this.x = Math.floor(this.x),
  38681. this.y = Math.floor(this.y),
  38682. this.z = Math.floor(this.z),
  38683. this.w = Math.floor(this.w),
  38684. this
  38685. },
  38686. ceil: function() {
  38687. return this.x = Math.ceil(this.x),
  38688. this.y = Math.ceil(this.y),
  38689. this.z = Math.ceil(this.z),
  38690. this.w = Math.ceil(this.w),
  38691. this
  38692. },
  38693. round: function() {
  38694. return this.x = Math.round(this.x),
  38695. this.y = Math.round(this.y),
  38696. this.z = Math.round(this.z),
  38697. this.w = Math.round(this.w),
  38698. this
  38699. },
  38700. roundToZero: function() {
  38701. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38702. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38703. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38704. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  38705. this
  38706. },
  38707. negate: function() {
  38708. return this.x = -this.x,
  38709. this.y = -this.y,
  38710. this.z = -this.z,
  38711. this.w = -this.w,
  38712. this
  38713. },
  38714. dot: function(e) {
  38715. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  38716. },
  38717. lengthSq: function() {
  38718. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  38719. },
  38720. length: function() {
  38721. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  38722. },
  38723. lengthManhattan: function() {
  38724. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  38725. },
  38726. normalize: function() {
  38727. return this.divideScalar(this.length())
  38728. },
  38729. setLength: function(e) {
  38730. return this.multiplyScalar(e / this.length())
  38731. },
  38732. lerp: function(e, t) {
  38733. return this.x += (e.x - this.x) * t,
  38734. this.y += (e.y - this.y) * t,
  38735. this.z += (e.z - this.z) * t,
  38736. this.w += (e.w - this.w) * t,
  38737. this
  38738. },
  38739. lerpVectors: function(e, t, i) {
  38740. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38741. this
  38742. },
  38743. equals: function(e) {
  38744. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  38745. },
  38746. fromArray: function(e, t) {
  38747. return void 0 === t && (t = 0),
  38748. this.x = e[t],
  38749. this.y = e[t + 1],
  38750. this.z = e[t + 2],
  38751. this.w = e[t + 3],
  38752. this
  38753. },
  38754. toArray: function(e, t) {
  38755. return void 0 === e && (e = []),
  38756. void 0 === t && (t = 0),
  38757. e[t] = this.x,
  38758. e[t + 1] = this.y,
  38759. e[t + 2] = this.z,
  38760. e[t + 3] = this.w,
  38761. e
  38762. },
  38763. fromAttribute: function(e, t, i) {
  38764. return void 0 === i && (i = 0),
  38765. t = t * e.itemSize + i,
  38766. this.x = e.array[t],
  38767. this.y = e.array[t + 1],
  38768. this.z = e.array[t + 2],
  38769. this.w = e.array[t + 3],
  38770. this
  38771. }
  38772. },
  38773. Ci.Euler = function(e, t, i, n) {
  38774. this._x = e || 0,
  38775. this._y = t || 0,
  38776. this._z = i || 0,
  38777. this._order = n || Ci.Euler.DefaultOrder
  38778. }
  38779. ,
  38780. Ci.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  38781. Ci.Euler.DefaultOrder = "XYZ",
  38782. Ci.Euler.prototype = {
  38783. constructor: Ci.Euler,
  38784. get x() {
  38785. return this._x
  38786. },
  38787. set x(e) {
  38788. this._x = e,
  38789. this.onChangeCallback()
  38790. },
  38791. get y() {
  38792. return this._y
  38793. },
  38794. set y(e) {
  38795. this._y = e,
  38796. this.onChangeCallback()
  38797. },
  38798. get z() {
  38799. return this._z
  38800. },
  38801. set z(e) {
  38802. this._z = e,
  38803. this.onChangeCallback()
  38804. },
  38805. get order() {
  38806. return this._order
  38807. },
  38808. set order(e) {
  38809. this._order = e,
  38810. this.onChangeCallback()
  38811. },
  38812. set: function(e, t, i, n) {
  38813. return this._x = e,
  38814. this._y = t,
  38815. this._z = i,
  38816. this._order = n || this._order,
  38817. this.onChangeCallback(),
  38818. this
  38819. },
  38820. clone: function() {
  38821. return new this.constructor(this._x,this._y,this._z,this._order)
  38822. },
  38823. copy: function(e) {
  38824. return this._x = e._x,
  38825. this._y = e._y,
  38826. this._z = e._z,
  38827. this._order = e._order,
  38828. this.onChangeCallback(),
  38829. this
  38830. },
  38831. toObject: function() {//xzw
  38832. return {x:this.x,y:this.y,z:this.z}
  38833. },
  38834. setFromRotationMatrix: function(e, t, i) {
  38835. var n = Ci.Math.clamp
  38836. , r = e.elements
  38837. , o = r[0]
  38838. , a = r[4]
  38839. , s = r[8]
  38840. , l = r[1]
  38841. , c = r[5]
  38842. , h = r[9]
  38843. , u = r[2]
  38844. , d = r[6]
  38845. , p = r[10];
  38846. return "XYZ" === (t = t || this._order) ? (this._y = Math.asin(n(s, -1, 1)),
  38847. Math.abs(s) < .99999 ? (this._x = Math.atan2(-h, p),
  38848. this._z = Math.atan2(-a, o)) : (this._x = Math.atan2(d, c),
  38849. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-n(h, -1, 1)),
  38850. Math.abs(h) < .99999 ? (this._y = Math.atan2(s, p),
  38851. this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, o),
  38852. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(n(d, -1, 1)),
  38853. Math.abs(d) < .99999 ? (this._y = Math.atan2(-u, p),
  38854. this._z = Math.atan2(-a, c)) : (this._y = 0,
  38855. this._z = Math.atan2(l, o))) : "ZYX" === t ? (this._y = Math.asin(-n(u, -1, 1)),
  38856. Math.abs(u) < .99999 ? (this._x = Math.atan2(d, p),
  38857. this._z = Math.atan2(l, o)) : (this._x = 0,
  38858. this._z = Math.atan2(-a, c))) : "YZX" === t ? (this._z = Math.asin(n(l, -1, 1)),
  38859. Math.abs(l) < .99999 ? (this._x = Math.atan2(-h, c),
  38860. this._y = Math.atan2(-u, o)) : (this._x = 0,
  38861. this._y = Math.atan2(s, p))) : "XZY" === t ? (this._z = Math.asin(-n(a, -1, 1)),
  38862. Math.abs(a) < .99999 ? (this._x = Math.atan2(d, c),
  38863. this._y = Math.atan2(s, o)) : (this._x = Math.atan2(-h, p),
  38864. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  38865. this._order = t,
  38866. !1 !== i && this.onChangeCallback(),
  38867. this
  38868. },
  38869. setFromQuaternion: function(e, t, i) {
  38870. return void 0 === Ee && (Ee = new Ci.Matrix4),
  38871. Ee.makeRotationFromQuaternion(e),
  38872. this.setFromRotationMatrix(Ee, t, i),
  38873. this
  38874. },
  38875. setFromVector3: function(e, t) {
  38876. return this.set(e.x, e.y, e.z, t || this._order)
  38877. },
  38878. reorder: (Ie = new Ci.Quaternion,
  38879. function(e) {
  38880. Ie.setFromEuler(this),
  38881. this.setFromQuaternion(Ie, e)
  38882. }
  38883. ),
  38884. equals: function(e) {
  38885. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  38886. },
  38887. fromArray: function(e) {
  38888. return this._x = e[0],
  38889. this._y = e[1],
  38890. this._z = e[2],
  38891. void 0 !== e[3] && (this._order = e[3]),
  38892. this.onChangeCallback(),
  38893. this
  38894. },
  38895. toArray: function(e, t) {
  38896. return void 0 === e && (e = []),
  38897. void 0 === t && (t = 0),
  38898. e[t] = this._x,
  38899. e[t + 1] = this._y,
  38900. e[t + 2] = this._z,
  38901. e[t + 3] = this._order,
  38902. e
  38903. },
  38904. toVector3: function(e) {
  38905. return e ? e.set(this._x, this._y, this._z) : new Ci.Vector3(this._x,this._y,this._z)
  38906. },
  38907. onChange: function(e) {
  38908. return this.onChangeCallback = e,
  38909. this
  38910. },
  38911. onChangeCallback: function() {}
  38912. },
  38913. Ci.Line3 = function(e, t) {
  38914. this.start = void 0 !== e ? e : new Ci.Vector3,
  38915. this.end = void 0 !== t ? t : new Ci.Vector3
  38916. }
  38917. ,
  38918. Ci.Line3.prototype = {
  38919. constructor: Ci.Line3,
  38920. set: function(e, t) {
  38921. return this.start.copy(e),
  38922. this.end.copy(t),
  38923. this
  38924. },
  38925. clone: function() {
  38926. return (new this.constructor).copy(this)
  38927. },
  38928. copy: function(e) {
  38929. return this.start.copy(e.start),
  38930. this.end.copy(e.end),
  38931. this
  38932. },
  38933. center: function(e) {
  38934. return (e || new Ci.Vector3).addVectors(this.start, this.end).multiplyScalar(.5)
  38935. },
  38936. delta: function(e) {
  38937. return (e || new Ci.Vector3).subVectors(this.end, this.start)
  38938. },
  38939. distanceSq: function() {
  38940. return this.start.distanceToSquared(this.end)
  38941. },
  38942. distance: function() {
  38943. return this.start.distanceTo(this.end)
  38944. },
  38945. at: function(e, t) {
  38946. var i = t || new Ci.Vector3;
  38947. return this.delta(i).multiplyScalar(e).add(this.start)
  38948. },
  38949. closestPointToPointParameter: (Ae = new Ci.Vector3,
  38950. Ce = new Ci.Vector3,
  38951. function(e, t) {
  38952. Ae.subVectors(e, this.start),
  38953. Ce.subVectors(this.end, this.start);
  38954. var i = Ce.dot(Ce)
  38955. , n = Ce.dot(Ae) / i;
  38956. return t && (n = Ci.Math.clamp(n, 0, 1)),
  38957. n
  38958. }
  38959. ),
  38960. closestPointToPoint: function(e, t, i) {
  38961. var n = this.closestPointToPointParameter(e, t)
  38962. , r = i || new Ci.Vector3;
  38963. return this.delta(r).multiplyScalar(n).add(this.start)
  38964. },
  38965. applyMatrix4: function(e) {
  38966. return this.start.applyMatrix4(e),
  38967. this.end.applyMatrix4(e),
  38968. this
  38969. },
  38970. equals: function(e) {
  38971. return e.start.equals(this.start) && e.end.equals(this.end)
  38972. }
  38973. },
  38974. Ci.Box2 = function(e, t) {
  38975. this.min = void 0 !== e ? e : new Ci.Vector2(1 / 0,1 / 0),
  38976. this.max = void 0 !== t ? t : new Ci.Vector2(-1 / 0,-1 / 0)
  38977. }
  38978. ,
  38979. Ci.Box2.prototype = {
  38980. constructor: Ci.Box2,
  38981. set: function(e, t) {
  38982. return this.min.copy(e),
  38983. this.max.copy(t),
  38984. this
  38985. },
  38986. setFromPoints: function(e) {
  38987. this.makeEmpty();
  38988. for (var t = 0, i = e.length; t < i; t++)
  38989. this.expandByPoint(e[t]);
  38990. return this
  38991. },
  38992. setFromCenterAndSize: (ye = new Ci.Vector2,
  38993. function(e, t) {
  38994. var i = ye.copy(t).multiplyScalar(.5);
  38995. return this.min.copy(e).sub(i),
  38996. this.max.copy(e).add(i),
  38997. this
  38998. }
  38999. ),
  39000. clone: function() {
  39001. return (new this.constructor).copy(this)
  39002. },
  39003. copy: function(e) {
  39004. return this.min.copy(e.min),
  39005. this.max.copy(e.max),
  39006. this
  39007. },
  39008. makeEmpty: function() {
  39009. return this.min.x = this.min.y = 1 / 0,
  39010. this.max.x = this.max.y = -1 / 0,
  39011. this
  39012. },
  39013. isEmpty: function() {
  39014. return this.max.x < this.min.x || this.max.y < this.min.y
  39015. },
  39016. center: function(e) {
  39017. return (e || new Ci.Vector2).addVectors(this.min, this.max).multiplyScalar(.5)
  39018. },
  39019. size: function(e) {
  39020. return (e || new Ci.Vector2).subVectors(this.max, this.min)
  39021. },
  39022. expandByPoint: function(e) {
  39023. return this.min.min(e),
  39024. this.max.max(e),
  39025. this
  39026. },
  39027. expandByVector: function(e) {
  39028. return this.min.sub(e),
  39029. this.max.add(e),
  39030. this
  39031. },
  39032. expandByScalar: function(e) {
  39033. return this.min.addScalar(-e),
  39034. this.max.addScalar(e),
  39035. this
  39036. },
  39037. containsPoint: function(e) {
  39038. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  39039. },
  39040. containsBox: function(e) {
  39041. 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
  39042. },
  39043. getParameter: function(e, t) {
  39044. 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))
  39045. },
  39046. intersectsBox: function(e) {
  39047. 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)
  39048. },
  39049. clampPoint: function(e, t) {
  39050. return (t || new Ci.Vector2).copy(e).clamp(this.min, this.max)
  39051. },
  39052. distanceToPoint: (ve = new Ci.Vector2,
  39053. function(e) {
  39054. return ve.copy(e).clamp(this.min, this.max).sub(e).length()
  39055. }
  39056. ),
  39057. intersect: function(e) {
  39058. return this.min.max(e.min),
  39059. this.max.min(e.max),
  39060. this
  39061. },
  39062. union: function(e) {
  39063. return this.min.min(e.min),
  39064. this.max.max(e.max),
  39065. this
  39066. },
  39067. translate: function(e) {
  39068. return this.min.add(e),
  39069. this.max.add(e),
  39070. this
  39071. },
  39072. equals: function(e) {
  39073. return e.min.equals(this.min) && e.max.equals(this.max)
  39074. }
  39075. },
  39076. Ci.Box3 = function(e, t) {
  39077. this.min = void 0 !== e ? e : new Ci.Vector3(1 / 0,1 / 0,1 / 0),
  39078. this.max = void 0 !== t ? t : new Ci.Vector3(-1 / 0,-1 / 0,-1 / 0)
  39079. }
  39080. ,
  39081. Ci.Box3.prototype = {
  39082. constructor: Ci.Box3,
  39083. set: function(e, t) {
  39084. return this.min.copy(e),
  39085. this.max.copy(t),
  39086. this
  39087. },
  39088. setFromArray: function(e) {
  39089. this.makeEmpty();
  39090. 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) {
  39091. var c = e[s]
  39092. , h = e[s + 1]
  39093. , u = e[s + 2];
  39094. c < t && (t = c),
  39095. h < i && (i = h),
  39096. u < n && (n = u),
  39097. r < c && (r = c),
  39098. o < h && (o = h),
  39099. a < u && (a = u)
  39100. }
  39101. this.min.set(t, i, n),
  39102. this.max.set(r, o, a)
  39103. },
  39104. setFromPoints: function(e) {
  39105. this.makeEmpty();
  39106. for (var t = 0, i = e.length; t < i; t++)
  39107. this.expandByPoint(e[t]);
  39108. return this
  39109. },
  39110. setFromCenterAndSize: (me = new Ci.Vector3,
  39111. function(e, t) {
  39112. var i = me.copy(t).multiplyScalar(.5);
  39113. return this.min.copy(e).sub(i),
  39114. this.max.copy(e).add(i),
  39115. this
  39116. }
  39117. ),
  39118. setFromObject: function(e) {
  39119. void 0 === ge && (ge = new Ci.Box3);
  39120. var i = this;
  39121. return this.makeEmpty(),
  39122. e.updateMatrixWorld(!0),
  39123. e.traverse(function(e) {
  39124. var t = e.geometry;
  39125. void 0 !== t && (null === t.boundingBox && t.computeBoundingBox(),
  39126. !1 === t.boundingBox.isEmpty() && (ge.copy(t.boundingBox),
  39127. ge.applyMatrix4(e.matrixWorld),
  39128. i.union(ge)))
  39129. }),
  39130. this
  39131. },
  39132. clone: function() {
  39133. return (new this.constructor).copy(this)
  39134. },
  39135. copy: function(e) {
  39136. return this.min.copy(e.min),
  39137. this.max.copy(e.max),
  39138. this
  39139. },
  39140. makeEmpty: function() {
  39141. return this.min.x = this.min.y = this.min.z = 1 / 0,
  39142. this.max.x = this.max.y = this.max.z = -1 / 0,
  39143. this
  39144. },
  39145. isEmpty: function() {
  39146. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  39147. },
  39148. center: function(e) {
  39149. return (e || new Ci.Vector3).addVectors(this.min, this.max).multiplyScalar(.5)
  39150. },
  39151. size: function(e) {
  39152. return (e || new Ci.Vector3).subVectors(this.max, this.min)
  39153. },
  39154. expandByPoint: function(e) {
  39155. return this.min.min(e),
  39156. this.max.max(e),
  39157. this
  39158. },
  39159. expandByVector: function(e) {
  39160. return this.min.sub(e),
  39161. this.max.add(e),
  39162. this
  39163. },
  39164. expandByScalar: function(e) {
  39165. return this.min.addScalar(-e),
  39166. this.max.addScalar(e),
  39167. this
  39168. },
  39169. containsPoint: function(e) {
  39170. 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)
  39171. },
  39172. containsBox: function(e) {
  39173. 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
  39174. },
  39175. getParameter: function(e, t) {
  39176. 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))
  39177. },
  39178. intersectsBox: function(e) {
  39179. 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)
  39180. },
  39181. intersectsSphere: function(e) {
  39182. return void 0 === fe && (fe = new Ci.Vector3),
  39183. this.clampPoint(e.center, fe),
  39184. fe.distanceToSquared(e.center) <= e.radius * e.radius
  39185. },
  39186. intersectsPlane: function(e) {
  39187. var t, i;
  39188. return i = 0 < e.normal.x ? (t = e.normal.x * this.min.x,
  39189. e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  39190. e.normal.x * this.min.x),
  39191. 0 < e.normal.y ? (t += e.normal.y * this.min.y,
  39192. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  39193. i += e.normal.y * this.min.y),
  39194. 0 < e.normal.z ? (t += e.normal.z * this.min.z,
  39195. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  39196. i += e.normal.z * this.min.z),
  39197. t <= e.constant && i >= e.constant
  39198. },
  39199. clampPoint: function(e, t) {
  39200. return (t || new Ci.Vector3).copy(e).clamp(this.min, this.max)
  39201. },
  39202. distanceToPoint: (pe = new Ci.Vector3,
  39203. function(e) {
  39204. return pe.copy(e).clamp(this.min, this.max).sub(e).length()
  39205. }
  39206. ),
  39207. getBoundingSphere: (de = new Ci.Vector3,
  39208. function(e) {
  39209. var t = e || new Ci.Sphere;
  39210. return t.center = this.center(),
  39211. t.radius = .5 * this.size(de).length(),
  39212. t
  39213. }
  39214. ),
  39215. intersect: function(e) {
  39216. return this.min.max(e.min),
  39217. this.max.min(e.max),
  39218. this
  39219. },
  39220. union: function(e) {
  39221. return this.min.min(e.min),
  39222. this.max.max(e.max),
  39223. this
  39224. },
  39225. 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],
  39226. function(e) {
  39227. return ue[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
  39228. ue[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
  39229. ue[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
  39230. ue[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
  39231. ue[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
  39232. ue[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
  39233. ue[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
  39234. ue[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
  39235. this.makeEmpty(),
  39236. this.setFromPoints(ue),
  39237. this
  39238. }
  39239. ),
  39240. translate: function(e) {
  39241. return this.min.add(e),
  39242. this.max.add(e),
  39243. this
  39244. },
  39245. equals: function(e) {
  39246. return e.min.equals(this.min) && e.max.equals(this.max)
  39247. }
  39248. },
  39249. Ci.Matrix3 = function() {
  39250. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  39251. 0 < arguments.length && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  39252. }
  39253. ,
  39254. Ci.Matrix3.prototype = {
  39255. constructor: Ci.Matrix3,
  39256. set: function(e, t, i, n, r, o, a, s, l) {
  39257. var c = this.elements;
  39258. return c[0] = e,
  39259. c[1] = n,
  39260. c[2] = a,
  39261. c[3] = t,
  39262. c[4] = r,
  39263. c[5] = s,
  39264. c[6] = i,
  39265. c[7] = o,
  39266. c[8] = l,
  39267. this
  39268. },
  39269. identity: function() {
  39270. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  39271. this
  39272. },
  39273. clone: function() {
  39274. return (new this.constructor).fromArray(this.elements)
  39275. },
  39276. copy: function(e) {
  39277. var t = e.elements;
  39278. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  39279. this
  39280. },
  39281. setFromMatrix4: function(e) {
  39282. var t = e.elements;
  39283. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  39284. this
  39285. },
  39286. applyToVector3Array: function(e, t, i) {
  39287. void 0 === he && (he = new Ci.Vector3),
  39288. void 0 === t && (t = 0),
  39289. void 0 === i && (i = e.length);
  39290. for (var n = 0, r = t; n < i; n += 3,
  39291. r += 3)
  39292. he.fromArray(e, r),
  39293. he.applyMatrix3(this),
  39294. he.toArray(e, r);
  39295. return e
  39296. },
  39297. applyToBuffer: function(e, t, i) {
  39298. void 0 === ce && (ce = new Ci.Vector3),
  39299. void 0 === t && (t = 0),
  39300. void 0 === i && (i = e.length / e.itemSize);
  39301. for (var n = 0, r = t; n < i; n++,
  39302. r++)
  39303. ce.x = e.getX(r),
  39304. ce.y = e.getY(r),
  39305. ce.z = e.getZ(r),
  39306. ce.applyMatrix3(this),
  39307. e.setXYZ(ce.x, ce.y, ce.z);
  39308. return e
  39309. },
  39310. multiplyScalar: function(e) {
  39311. var t = this.elements;
  39312. return t[0] *= e,
  39313. t[3] *= e,
  39314. t[6] *= e,
  39315. t[1] *= e,
  39316. t[4] *= e,
  39317. t[7] *= e,
  39318. t[2] *= e,
  39319. t[5] *= e,
  39320. t[8] *= e,
  39321. this
  39322. },
  39323. determinant: function() {
  39324. var e = this.elements
  39325. , t = e[0]
  39326. , i = e[1]
  39327. , n = e[2]
  39328. , r = e[3]
  39329. , o = e[4]
  39330. , a = e[5]
  39331. , s = e[6]
  39332. , l = e[7]
  39333. , c = e[8];
  39334. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  39335. },
  39336. getInverse: function(e, t) {
  39337. e instanceof Ci.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  39338. var i = e.elements
  39339. , n = this.elements
  39340. , r = i[0]
  39341. , o = i[1]
  39342. , a = i[2]
  39343. , s = i[3]
  39344. , l = i[4]
  39345. , c = i[5]
  39346. , h = i[6]
  39347. , u = i[7]
  39348. , d = i[8]
  39349. , p = d * l - c * u
  39350. , f = c * h - d * s
  39351. , g = u * s - l * h
  39352. , m = r * p + o * f + a * g;
  39353. if (0 != m)
  39354. return n[0] = p,
  39355. n[1] = a * u - d * o,
  39356. n[2] = c * o - a * l,
  39357. n[3] = f,
  39358. n[4] = d * r - a * h,
  39359. n[5] = a * s - c * r,
  39360. n[6] = g,
  39361. n[7] = o * h - u * r,
  39362. n[8] = l * r - o * s,
  39363. this.multiplyScalar(1 / m);
  39364. var v = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  39365. if (t)
  39366. throw new Error(v);
  39367. return this.identity()/* console.warn(v), *///许钟文删 boxHelper报的
  39368. },
  39369. transpose: function() {
  39370. var e, t = this.elements;
  39371. return e = t[1],
  39372. t[1] = t[3],
  39373. t[3] = e,
  39374. e = t[2],
  39375. t[2] = t[6],
  39376. t[6] = e,
  39377. e = t[5],
  39378. t[5] = t[7],
  39379. t[7] = e,
  39380. this
  39381. },
  39382. flattenToArrayOffset: function(e, t) {
  39383. var i = this.elements;
  39384. return e[t] = i[0],
  39385. e[t + 1] = i[1],
  39386. e[t + 2] = i[2],
  39387. e[t + 3] = i[3],
  39388. e[t + 4] = i[4],
  39389. e[t + 5] = i[5],
  39390. e[t + 6] = i[6],
  39391. e[t + 7] = i[7],
  39392. e[t + 8] = i[8],
  39393. e
  39394. },
  39395. getNormalMatrix: function(e) {
  39396. return this.setFromMatrix4(e).getInverse(this).transpose()
  39397. },
  39398. transposeIntoArray: function(e) {
  39399. var t = this.elements;
  39400. return e[0] = t[0],
  39401. e[1] = t[3],
  39402. e[2] = t[6],
  39403. e[3] = t[1],
  39404. e[4] = t[4],
  39405. e[5] = t[7],
  39406. e[6] = t[2],
  39407. e[7] = t[5],
  39408. e[8] = t[8],
  39409. this
  39410. },
  39411. fromArray: function(e) {
  39412. return this.elements.set(e),
  39413. this
  39414. },
  39415. toArray: function() {
  39416. var e = this.elements;
  39417. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  39418. }
  39419. },
  39420. Ci.Matrix4 = function() {
  39421. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  39422. 0 < arguments.length && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  39423. }
  39424. ,
  39425. Ci.Matrix4.prototype = {
  39426. constructor: Ci.Matrix4,
  39427. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  39428. var m = this.elements;
  39429. return m[0] = e,
  39430. m[4] = t,
  39431. m[8] = i,
  39432. m[12] = n,
  39433. m[1] = r,
  39434. m[5] = o,
  39435. m[9] = a,
  39436. m[13] = s,
  39437. m[2] = l,
  39438. m[6] = c,
  39439. m[10] = h,
  39440. m[14] = u,
  39441. m[3] = d,
  39442. m[7] = p,
  39443. m[11] = f,
  39444. m[15] = g,
  39445. this
  39446. },
  39447. identity: function() {
  39448. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39449. this
  39450. },
  39451. clone: function() {
  39452. return (new Ci.Matrix4).fromArray(this.elements)
  39453. },
  39454. copy: function(e) {
  39455. return this.elements.set(e.elements),
  39456. this
  39457. },
  39458. copyPosition: function(e) {
  39459. var t = this.elements
  39460. , i = e.elements;
  39461. return t[12] = i[12],
  39462. t[13] = i[13],
  39463. t[14] = i[14],
  39464. this
  39465. },
  39466. extractBasis: function(e, t, i) {
  39467. return e.setFromMatrixColumn(this, 0),
  39468. t.setFromMatrixColumn(this, 1),
  39469. i.setFromMatrixColumn(this, 2),
  39470. this
  39471. },
  39472. makeBasis: function(e, t, i) {
  39473. 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),
  39474. this
  39475. },
  39476. extractRotation: function(e) {
  39477. void 0 === le && (le = new Ci.Vector3);
  39478. var t = this.elements
  39479. , i = e.elements
  39480. , n = 1 / le.setFromMatrixColumn(e, 0).length()
  39481. , r = 1 / le.setFromMatrixColumn(e, 1).length()
  39482. , o = 1 / le.setFromMatrixColumn(e, 2).length();
  39483. return t[0] = i[0] * n,
  39484. t[1] = i[1] * n,
  39485. t[2] = i[2] * n,
  39486. t[4] = i[4] * r,
  39487. t[5] = i[5] * r,
  39488. t[6] = i[6] * r,
  39489. t[8] = i[8] * o,
  39490. t[9] = i[9] * o,
  39491. t[10] = i[10] * o,
  39492. this
  39493. },
  39494. makeRotationFromEuler: function(e) {
  39495. e instanceof Ci.Euler == 0 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39496. var t = this.elements
  39497. , i = e.x
  39498. , n = e.y
  39499. , r = e.z
  39500. , o = Math.cos(i)
  39501. , a = Math.sin(i)
  39502. , s = Math.cos(n)
  39503. , l = Math.sin(n)
  39504. , c = Math.cos(r)
  39505. , h = Math.sin(r);
  39506. if ("XYZ" === e.order) {
  39507. var u = o * c
  39508. , d = o * h
  39509. , p = a * c
  39510. , f = a * h;
  39511. t[0] = s * c,
  39512. t[4] = -s * h,
  39513. t[8] = l,
  39514. t[1] = d + p * l,
  39515. t[5] = u - f * l,
  39516. t[9] = -a * s,
  39517. t[2] = f - u * l,
  39518. t[6] = p + d * l,
  39519. t[10] = o * s
  39520. } else if ("YXZ" === e.order) {
  39521. var g = s * c
  39522. , m = s * h
  39523. , v = l * c
  39524. , y = l * h;
  39525. t[0] = g + y * a,
  39526. t[4] = v * a - m,
  39527. t[8] = o * l,
  39528. t[1] = o * h,
  39529. t[5] = o * c,
  39530. t[9] = -a,
  39531. t[2] = m * a - v,
  39532. t[6] = y + g * a,
  39533. t[10] = o * s
  39534. } else if ("ZXY" === e.order) {
  39535. g = s * c,
  39536. m = s * h,
  39537. v = l * c,
  39538. y = l * h;
  39539. t[0] = g - y * a,
  39540. t[4] = -o * h,
  39541. t[8] = v + m * a,
  39542. t[1] = m + v * a,
  39543. t[5] = o * c,
  39544. t[9] = y - g * a,
  39545. t[2] = -o * l,
  39546. t[6] = a,
  39547. t[10] = o * s
  39548. } else if ("ZYX" === e.order) {
  39549. u = o * c,
  39550. d = o * h,
  39551. p = a * c,
  39552. f = a * h;
  39553. t[0] = s * c,
  39554. t[4] = p * l - d,
  39555. t[8] = u * l + f,
  39556. t[1] = s * h,
  39557. t[5] = f * l + u,
  39558. t[9] = d * l - p,
  39559. t[2] = -l,
  39560. t[6] = a * s,
  39561. t[10] = o * s
  39562. } else if ("YZX" === e.order) {
  39563. var A = o * s
  39564. , C = o * l
  39565. , I = a * s
  39566. , E = a * l;
  39567. t[0] = s * c,
  39568. t[4] = E - A * h,
  39569. t[8] = I * h + C,
  39570. t[1] = h,
  39571. t[5] = o * c,
  39572. t[9] = -a * c,
  39573. t[2] = -l * c,
  39574. t[6] = C * h + I,
  39575. t[10] = A - E * h
  39576. } else if ("XZY" === e.order) {
  39577. A = o * s,
  39578. C = o * l,
  39579. I = a * s,
  39580. E = a * l;
  39581. t[0] = s * c,
  39582. t[4] = -h,
  39583. t[8] = l * c,
  39584. t[1] = A * h + E,
  39585. t[5] = o * c,
  39586. t[9] = C * h - I,
  39587. t[2] = I * h - C,
  39588. t[6] = a * c,
  39589. t[10] = E * h + A
  39590. }
  39591. return t[3] = 0,
  39592. t[7] = 0,
  39593. t[11] = 0,
  39594. t[12] = 0,
  39595. t[13] = 0,
  39596. t[14] = 0,
  39597. t[15] = 1,
  39598. this
  39599. },
  39600. makeRotationFromQuaternion: function(e) {
  39601. var t = this.elements
  39602. , i = e.x
  39603. , n = e.y
  39604. , r = e.z
  39605. , o = e.w
  39606. , a = i + i
  39607. , s = n + n
  39608. , l = r + r
  39609. , c = i * a
  39610. , h = i * s
  39611. , u = i * l
  39612. , d = n * s
  39613. , p = n * l
  39614. , f = r * l
  39615. , g = o * a
  39616. , m = o * s
  39617. , v = o * l;
  39618. return t[0] = 1 - (d + f),
  39619. t[4] = h - v,
  39620. t[8] = u + m,
  39621. t[1] = h + v,
  39622. t[5] = 1 - (c + f),
  39623. t[9] = p - g,
  39624. t[2] = u - m,
  39625. t[6] = p + g,
  39626. t[10] = 1 - (c + d),
  39627. t[3] = 0,
  39628. t[7] = 0,
  39629. t[11] = 0,
  39630. t[12] = 0,
  39631. t[13] = 0,
  39632. t[14] = 0,
  39633. t[15] = 1,
  39634. this
  39635. },
  39636. lookAt: function(e, t, i) {
  39637. void 0 === oe && (oe = new Ci.Vector3),
  39638. void 0 === ae && (ae = new Ci.Vector3),
  39639. void 0 === se && (se = new Ci.Vector3);
  39640. var n = this.elements;
  39641. return se.subVectors(e, t).normalize(),
  39642. 0 === se.lengthSq() && (se.z = 1),
  39643. oe.crossVectors(i, se).normalize(),
  39644. 0 === oe.lengthSq() && (se.x += 1e-4,
  39645. oe.crossVectors(i, se).normalize()),
  39646. ae.crossVectors(se, oe),
  39647. n[0] = oe.x,
  39648. n[4] = ae.x,
  39649. n[8] = se.x,
  39650. n[1] = oe.y,
  39651. n[5] = ae.y,
  39652. n[9] = se.y,
  39653. n[2] = oe.z,
  39654. n[6] = ae.z,
  39655. n[10] = se.z,
  39656. this
  39657. },
  39658. multiply: function(e, t) {
  39659. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  39660. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  39661. },
  39662. multiplyMatrices: function(e, t) {
  39663. var i = e.elements
  39664. , n = t.elements
  39665. , r = this.elements
  39666. , o = i[0]
  39667. , a = i[4]
  39668. , s = i[8]
  39669. , l = i[12]
  39670. , c = i[1]
  39671. , h = i[5]
  39672. , u = i[9]
  39673. , d = i[13]
  39674. , p = i[2]
  39675. , f = i[6]
  39676. , g = i[10]
  39677. , m = i[14]
  39678. , v = i[3]
  39679. , y = i[7]
  39680. , A = i[11]
  39681. , C = i[15]
  39682. , I = n[0]
  39683. , E = n[4]
  39684. , _ = n[8]
  39685. , b = n[12]
  39686. , w = n[1]
  39687. , T = n[5]
  39688. , x = n[9]
  39689. , S = n[13]
  39690. , M = n[2]
  39691. , R = n[6]
  39692. , P = n[10]
  39693. , O = n[14]
  39694. , L = n[3]
  39695. , D = n[7]
  39696. , N = n[11]
  39697. , F = n[15];
  39698. return r[0] = o * I + a * w + s * M + l * L,
  39699. r[4] = o * E + a * T + s * R + l * D,
  39700. r[8] = o * _ + a * x + s * P + l * N,
  39701. r[12] = o * b + a * S + s * O + l * F,
  39702. r[1] = c * I + h * w + u * M + d * L,
  39703. r[5] = c * E + h * T + u * R + d * D,
  39704. r[9] = c * _ + h * x + u * P + d * N,
  39705. r[13] = c * b + h * S + u * O + d * F,
  39706. r[2] = p * I + f * w + g * M + m * L,
  39707. r[6] = p * E + f * T + g * R + m * D,
  39708. r[10] = p * _ + f * x + g * P + m * N,
  39709. r[14] = p * b + f * S + g * O + m * F,
  39710. r[3] = v * I + y * w + A * M + C * L,
  39711. r[7] = v * E + y * T + A * R + C * D,
  39712. r[11] = v * _ + y * x + A * P + C * N,
  39713. r[15] = v * b + y * S + A * O + C * F,
  39714. this
  39715. },
  39716. multiplyToArray: function(e, t, i) {
  39717. var n = this.elements;
  39718. return this.multiplyMatrices(e, t),
  39719. i[0] = n[0],
  39720. i[1] = n[1],
  39721. i[2] = n[2],
  39722. i[3] = n[3],
  39723. i[4] = n[4],
  39724. i[5] = n[5],
  39725. i[6] = n[6],
  39726. i[7] = n[7],
  39727. i[8] = n[8],
  39728. i[9] = n[9],
  39729. i[10] = n[10],
  39730. i[11] = n[11],
  39731. i[12] = n[12],
  39732. i[13] = n[13],
  39733. i[14] = n[14],
  39734. i[15] = n[15],
  39735. this
  39736. },
  39737. multiplyScalar: function(e) {
  39738. var t = this.elements;
  39739. return t[0] *= e,
  39740. t[4] *= e,
  39741. t[8] *= e,
  39742. t[12] *= e,
  39743. t[1] *= e,
  39744. t[5] *= e,
  39745. t[9] *= e,
  39746. t[13] *= e,
  39747. t[2] *= e,
  39748. t[6] *= e,
  39749. t[10] *= e,
  39750. t[14] *= e,
  39751. t[3] *= e,
  39752. t[7] *= e,
  39753. t[11] *= e,
  39754. t[15] *= e,
  39755. this
  39756. },
  39757. applyToVector3Array: function(e, t, i) {
  39758. void 0 === re && (re = new Ci.Vector3),
  39759. void 0 === t && (t = 0),
  39760. void 0 === i && (i = e.length);
  39761. for (var n = 0, r = t; n < i; n += 3,
  39762. r += 3)
  39763. re.fromArray(e, r),
  39764. re.applyMatrix4(this),
  39765. re.toArray(e, r);
  39766. return e
  39767. },
  39768. applyToBuffer: function(e, t, i) {
  39769. void 0 === ne && (ne = new Ci.Vector3),
  39770. void 0 === t && (t = 0),
  39771. void 0 === i && (i = e.length / e.itemSize);
  39772. for (var n = 0, r = t; n < i; n++,
  39773. r++)
  39774. ne.x = e.getX(r),
  39775. ne.y = e.getY(r),
  39776. ne.z = e.getZ(r),
  39777. ne.applyMatrix4(this),
  39778. e.setXYZ(ne.x, ne.y, ne.z);
  39779. return e
  39780. },
  39781. determinant: function() {
  39782. var e = this.elements
  39783. , t = e[0]
  39784. , i = e[4]
  39785. , n = e[8]
  39786. , r = e[12]
  39787. , o = e[1]
  39788. , a = e[5]
  39789. , s = e[9]
  39790. , l = e[13]
  39791. , c = e[2]
  39792. , h = e[6]
  39793. , u = e[10]
  39794. , d = e[14];
  39795. 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)
  39796. },
  39797. transpose: function() {
  39798. var e, t = this.elements;
  39799. return e = t[1],
  39800. t[1] = t[4],
  39801. t[4] = e,
  39802. e = t[2],
  39803. t[2] = t[8],
  39804. t[8] = e,
  39805. e = t[6],
  39806. t[6] = t[9],
  39807. t[9] = e,
  39808. e = t[3],
  39809. t[3] = t[12],
  39810. t[12] = e,
  39811. e = t[7],
  39812. t[7] = t[13],
  39813. t[13] = e,
  39814. e = t[11],
  39815. t[11] = t[14],
  39816. t[14] = e,
  39817. this
  39818. },
  39819. flattenToArrayOffset: function(e, t) {
  39820. var i = this.elements;
  39821. return e[t] = i[0],
  39822. e[t + 1] = i[1],
  39823. e[t + 2] = i[2],
  39824. e[t + 3] = i[3],
  39825. e[t + 4] = i[4],
  39826. e[t + 5] = i[5],
  39827. e[t + 6] = i[6],
  39828. e[t + 7] = i[7],
  39829. e[t + 8] = i[8],
  39830. e[t + 9] = i[9],
  39831. e[t + 10] = i[10],
  39832. e[t + 11] = i[11],
  39833. e[t + 12] = i[12],
  39834. e[t + 13] = i[13],
  39835. e[t + 14] = i[14],
  39836. e[t + 15] = i[15],
  39837. e
  39838. },
  39839. getPosition: function() {
  39840. return void 0 === ie && (ie = new Ci.Vector3),
  39841. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  39842. ie.setFromMatrixColumn(this, 3)
  39843. },
  39844. setPosition: function(e) {
  39845. var t = this.elements;
  39846. return t[12] = e.x,
  39847. t[13] = e.y,
  39848. t[14] = e.z,
  39849. this
  39850. },
  39851. getInverse: function(e, t) {
  39852. var i = this.elements
  39853. , n = e.elements
  39854. , r = n[0]
  39855. , o = n[1]
  39856. , a = n[2]
  39857. , s = n[3]
  39858. , l = n[4]
  39859. , c = n[5]
  39860. , h = n[6]
  39861. , u = n[7]
  39862. , d = n[8]
  39863. , p = n[9]
  39864. , f = n[10]
  39865. , g = n[11]
  39866. , m = n[12]
  39867. , v = n[13]
  39868. , y = n[14]
  39869. , A = n[15]
  39870. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  39871. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  39872. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  39873. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  39874. , b = r * C + o * I + a * E + s * _;
  39875. if (0 != b)
  39876. return i[0] = C,
  39877. i[1] = v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A,
  39878. i[2] = c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A,
  39879. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  39880. i[4] = I,
  39881. i[5] = d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A,
  39882. i[6] = m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A,
  39883. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  39884. i[8] = E,
  39885. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A,
  39886. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A,
  39887. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  39888. i[12] = _,
  39889. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y,
  39890. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y,
  39891. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  39892. this.multiplyScalar(1 / b);
  39893. var w = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  39894. if (t)
  39895. throw new Error(w);
  39896. return console.warn(w),
  39897. this.identity()
  39898. },
  39899. scale: function(e) {
  39900. var t = this.elements
  39901. , i = e.x
  39902. , n = e.y
  39903. , r = e.z;
  39904. return t[0] *= i,
  39905. t[4] *= n,
  39906. t[8] *= r,
  39907. t[1] *= i,
  39908. t[5] *= n,
  39909. t[9] *= r,
  39910. t[2] *= i,
  39911. t[6] *= n,
  39912. t[10] *= r,
  39913. t[3] *= i,
  39914. t[7] *= n,
  39915. t[11] *= r,
  39916. this
  39917. },
  39918. getMaxScaleOnAxis: function() {
  39919. var e = this.elements
  39920. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  39921. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  39922. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  39923. return Math.sqrt(Math.max(t, i, n))
  39924. },
  39925. makeTranslation: function(e, t, i) {
  39926. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  39927. this
  39928. },
  39929. makeRotationX: function(e) {
  39930. var t = Math.cos(e)
  39931. , i = Math.sin(e);
  39932. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  39933. this
  39934. },
  39935. makeRotationY: function(e) {
  39936. var t = Math.cos(e)
  39937. , i = Math.sin(e);
  39938. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  39939. this
  39940. },
  39941. makeRotationZ: function(e) {
  39942. var t = Math.cos(e)
  39943. , i = Math.sin(e);
  39944. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39945. this
  39946. },
  39947. makeRotationAxis: function(e, t) {
  39948. var i = Math.cos(t)
  39949. , n = Math.sin(t)
  39950. , r = 1 - i
  39951. , o = e.x
  39952. , a = e.y
  39953. , s = e.z
  39954. , l = r * o
  39955. , c = r * a;
  39956. 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),
  39957. this
  39958. },
  39959. makeScale: function(e, t, i) {
  39960. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  39961. this
  39962. },
  39963. compose: function(e, t, i) {
  39964. return this.makeRotationFromQuaternion(t),
  39965. this.scale(i),
  39966. this.setPosition(e),
  39967. this
  39968. },
  39969. decompose: function(e, t, i) {
  39970. void 0 === ee && (ee = new Ci.Vector3),
  39971. void 0 === te && (te = new Ci.Matrix4);
  39972. var n = this.elements
  39973. , r = ee.set(n[0], n[1], n[2]).length()
  39974. , o = ee.set(n[4], n[5], n[6]).length()
  39975. , a = ee.set(n[8], n[9], n[10]).length();
  39976. this.determinant() < 0 && (r = -r),
  39977. e.x = n[12],
  39978. e.y = n[13],
  39979. e.z = n[14],
  39980. te.elements.set(this.elements);
  39981. var s = 1 / r
  39982. , l = 1 / o
  39983. , c = 1 / a;
  39984. return te.elements[0] *= s,
  39985. te.elements[1] *= s,
  39986. te.elements[2] *= s,
  39987. te.elements[4] *= l,
  39988. te.elements[5] *= l,
  39989. te.elements[6] *= l,
  39990. te.elements[8] *= c,
  39991. te.elements[9] *= c,
  39992. te.elements[10] *= c,
  39993. t.setFromRotationMatrix(te),
  39994. i.x = r,
  39995. i.y = o,
  39996. i.z = a,
  39997. this
  39998. },
  39999. makeFrustum: function(e, t, i, n, r, o) {
  40000. var a = this.elements
  40001. , s = 2 * r / (t - e)
  40002. , l = 2 * r / (n - i)
  40003. , c = (t + e) / (t - e)
  40004. , h = (n + i) / (n - i)
  40005. , u = -(o + r) / (o - r)
  40006. , d = -2 * o * r / (o - r);
  40007. return a[0] = s,
  40008. a[4] = 0,
  40009. a[8] = c,
  40010. a[12] = 0,
  40011. a[1] = 0,
  40012. a[5] = l,
  40013. a[9] = h,
  40014. a[13] = 0,
  40015. a[2] = 0,
  40016. a[6] = 0,
  40017. a[10] = u,
  40018. a[14] = d,
  40019. a[3] = 0,
  40020. a[7] = 0,
  40021. a[11] = -1,
  40022. a[15] = 0,
  40023. this
  40024. },
  40025. makePerspective: function(e, t, i, n) {
  40026. var r = i * Math.tan(Ci.Math.degToRad(.5 * e))
  40027. , o = -r
  40028. , a = o * t
  40029. , s = r * t;
  40030. return this.makeFrustum(a, s, o, r, i, n)
  40031. },
  40032. makeOrthographic: function(e, t, i, n, r, o) {
  40033. var a = this.elements
  40034. , s = 1 / (t - e)
  40035. , l = 1 / (i - n)
  40036. , c = 1 / (o - r)
  40037. , h = (t + e) * s
  40038. , u = (i + n) * l
  40039. , d = (o + r) * c;
  40040. return a[0] = 2 * s,
  40041. a[4] = 0,
  40042. a[8] = 0,
  40043. a[12] = -h,
  40044. a[1] = 0,
  40045. a[5] = 2 * l,
  40046. a[9] = 0,
  40047. a[13] = -u,
  40048. a[2] = 0,
  40049. a[6] = 0,
  40050. a[10] = -2 * c,
  40051. a[14] = -d,
  40052. a[3] = 0,
  40053. a[7] = 0,
  40054. a[11] = 0,
  40055. a[15] = 1,
  40056. this
  40057. },
  40058. equals: function(e) {
  40059. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  40060. if (t[n] !== i[n])
  40061. return !1;
  40062. return !0
  40063. },
  40064. fromArray: function(e) {
  40065. return this.elements.set(e),
  40066. this
  40067. },
  40068. toArray: function() {
  40069. var e = this.elements;
  40070. 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]]
  40071. }
  40072. },
  40073. Ci.Ray = function(e, t) {
  40074. this.origin = void 0 !== e ? e : new Ci.Vector3,
  40075. this.direction = void 0 !== t ? t : new Ci.Vector3
  40076. }
  40077. ,
  40078. Ci.Ray.prototype = {
  40079. constructor: Ci.Ray,
  40080. set: function(e, t) {
  40081. return this.origin.copy(e),
  40082. this.direction.copy(t),
  40083. this
  40084. },
  40085. clone: function() {
  40086. return (new this.constructor).copy(this)
  40087. },
  40088. copy: function(e) {
  40089. return this.origin.copy(e.origin),
  40090. this.direction.copy(e.direction),
  40091. this
  40092. },
  40093. at: function(e, t) {
  40094. return (t || new Ci.Vector3).copy(this.direction).multiplyScalar(e).add(this.origin)
  40095. },
  40096. lookAt: function(e) {
  40097. this.direction.copy(e).sub(this.origin).normalize()
  40098. },
  40099. recast: ($ = new Ci.Vector3,
  40100. function(e) {
  40101. return this.origin.copy(this.at(e, $)),
  40102. this
  40103. }
  40104. ),
  40105. closestPointToPoint: function(e, t) {
  40106. var i = t || new Ci.Vector3;
  40107. i.subVectors(e, this.origin);
  40108. var n = i.dot(this.direction);
  40109. return n < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(n).add(this.origin)
  40110. },
  40111. distanceToPoint: function(e) {
  40112. return Math.sqrt(this.distanceSqToPoint(e))
  40113. },
  40114. distanceSqToPoint: (J = new Ci.Vector3,
  40115. function(e) {
  40116. var t = J.subVectors(e, this.origin).dot(this.direction);
  40117. return t < 0 ? this.origin.distanceToSquared(e) : (J.copy(this.direction).multiplyScalar(t).add(this.origin),
  40118. J.distanceToSquared(e))
  40119. }
  40120. ),
  40121. distanceSqToSegment: (Z = new Ci.Vector3,
  40122. K = new Ci.Vector3,
  40123. Q = new Ci.Vector3,
  40124. function(e, t, i, n) {
  40125. Z.copy(e).add(t).multiplyScalar(.5),
  40126. K.copy(t).sub(e).normalize(),
  40127. Q.copy(this.origin).sub(Z);
  40128. 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);
  40129. if (0 < p)
  40130. if (o = c * h - u,
  40131. s = l * p,
  40132. 0 <= (r = c * u - h))
  40133. if (-s <= o)
  40134. if (o <= s) {
  40135. var f = 1 / p;
  40136. a = (r *= f) * (r + c * (o *= f) + 2 * h) + o * (c * r + o + 2 * u) + d
  40137. } else
  40138. o = l,
  40139. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40140. else
  40141. o = -l,
  40142. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40143. else
  40144. 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,
  40145. (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;
  40146. else
  40147. o = 0 < c ? -l : l,
  40148. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40149. return i && i.copy(this.direction).multiplyScalar(r).add(this.origin),
  40150. n && n.copy(K).multiplyScalar(o).add(Z),
  40151. a
  40152. }
  40153. ),
  40154. intersectSphere: (X = new Ci.Vector3,
  40155. function(e, t) {
  40156. X.subVectors(e.center, this.origin);
  40157. var i = X.dot(this.direction)
  40158. , n = X.dot(X) - i * i
  40159. , r = e.radius * e.radius;
  40160. if (r < n)
  40161. return null;
  40162. var o = Math.sqrt(r - n)
  40163. , a = i - o
  40164. , s = i + o;
  40165. return a < 0 && s < 0 ? null : a < 0 ? this.at(s, t) : this.at(a, t)
  40166. }
  40167. ),
  40168. intersectsSphere: function(e) {
  40169. return this.distanceToPoint(e.center) <= e.radius
  40170. },
  40171. distanceToPlane: function(e) {
  40172. var t = e.normal.dot(this.direction);
  40173. if (0 === t)
  40174. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  40175. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  40176. return 0 <= i ? i : null
  40177. },
  40178. intersectPlane: function(e, t) {
  40179. var i = this.distanceToPlane(e);
  40180. return null === i ? null : this.at(i, t)
  40181. },
  40182. intersectsPlane: function(e) {
  40183. var t = e.distanceToPoint(this.origin);
  40184. return 0 === t || e.normal.dot(this.direction) * t < 0
  40185. },
  40186. intersectBox: function(e, t) {
  40187. 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;
  40188. return n = 0 <= l ? (i = (e.min.x - u.x) * l,
  40189. (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  40190. (e.min.x - u.x) * l),
  40191. (o = 0 <= c ? (r = (e.min.y - u.y) * c,
  40192. (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  40193. (e.min.y - u.y) * c)) < i || n < r ? null : ((i < r || i != i) && (i = r),
  40194. (o < n || n != n) && (n = o),
  40195. (s = 0 <= h ? (a = (e.min.z - u.z) * h,
  40196. (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  40197. (e.min.z - u.z) * h)) < i || n < a ? null : ((i < a || i != i) && (i = a),
  40198. (s < n || n != n) && (n = s),
  40199. n < 0 ? null : this.at(0 <= i ? i : n, t)))
  40200. },
  40201. intersectsBox: (q = new Ci.Vector3,
  40202. function(e) {
  40203. return null !== this.intersectBox(e, q)
  40204. }
  40205. ),
  40206. intersectTriangle: (G = new Ci.Vector3,
  40207. W = new Ci.Vector3,
  40208. j = new Ci.Vector3,
  40209. Y = new Ci.Vector3,
  40210. function(e, t, i, n, r) {
  40211. W.subVectors(t, e),
  40212. j.subVectors(i, e),
  40213. Y.crossVectors(W, j);
  40214. var o, a = this.direction.dot(Y);
  40215. if (0 < a) {
  40216. if (n)
  40217. return null;
  40218. o = 1
  40219. } else {
  40220. if (!(a < 0))
  40221. return null;
  40222. o = -1,
  40223. a = -a
  40224. }
  40225. G.subVectors(this.origin, e);
  40226. var s = o * this.direction.dot(j.crossVectors(G, j));
  40227. if (s < 0)
  40228. return null;
  40229. var l = o * this.direction.dot(W.cross(G));
  40230. if (l < 0)
  40231. return null;
  40232. if (a < s + l)
  40233. return null;
  40234. var c = -o * G.dot(Y);
  40235. return c < 0 ? null : this.at(c / a, r)
  40236. }
  40237. ),
  40238. applyMatrix4: function(e) {
  40239. return this.direction.add(this.origin).applyMatrix4(e),
  40240. this.origin.applyMatrix4(e),
  40241. this.direction.sub(this.origin),
  40242. this.direction.normalize(),
  40243. this
  40244. },
  40245. equals: function(e) {
  40246. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  40247. }
  40248. },
  40249. Ci.Sphere = function(e, t) {
  40250. this.center = void 0 !== e ? e : new Ci.Vector3,
  40251. this.radius = void 0 !== t ? t : 0
  40252. }
  40253. ,
  40254. Ci.Sphere.prototype = {
  40255. constructor: Ci.Sphere,
  40256. set: function(e, t) {
  40257. return this.center.copy(e),
  40258. this.radius = t,
  40259. this
  40260. },
  40261. setFromPoints: (z = new Ci.Box3,
  40262. function(e, t) {
  40263. var i = this.center;
  40264. void 0 !== t ? i.copy(t) : z.setFromPoints(e).center(i);
  40265. for (var n = 0, r = 0, o = e.length; r < o; r++)
  40266. n = Math.max(n, i.distanceToSquared(e[r]));
  40267. return this.radius = Math.sqrt(n),
  40268. this
  40269. }
  40270. ),
  40271. clone: function() {
  40272. return (new this.constructor).copy(this)
  40273. },
  40274. copy: function(e) {
  40275. return this.center.copy(e.center),
  40276. this.radius = e.radius,
  40277. this
  40278. },
  40279. empty: function() {
  40280. return this.radius <= 0
  40281. },
  40282. containsPoint: function(e) {
  40283. return e.distanceToSquared(this.center) <= this.radius * this.radius
  40284. },
  40285. distanceToPoint: function(e) {
  40286. return e.distanceTo(this.center) - this.radius
  40287. },
  40288. intersectsSphere: function(e) {
  40289. var t = this.radius + e.radius;
  40290. return e.center.distanceToSquared(this.center) <= t * t
  40291. },
  40292. intersectsBox: function(e) {
  40293. return e.intersectsSphere(this)
  40294. },
  40295. intersectsPlane: function(e) {
  40296. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  40297. },
  40298. clampPoint: function(e, t) {
  40299. var i = this.center.distanceToSquared(e)
  40300. , n = t || new Ci.Vector3;
  40301. return n.copy(e),
  40302. i > this.radius * this.radius && (n.sub(this.center).normalize(),
  40303. n.multiplyScalar(this.radius).add(this.center)),
  40304. n
  40305. },
  40306. getBoundingBox: function(e) {
  40307. var t = e || new Ci.Box3;
  40308. return t.set(this.center, this.center),
  40309. t.expandByScalar(this.radius),
  40310. t
  40311. },
  40312. applyMatrix4: function(e) {
  40313. return this.center.applyMatrix4(e),
  40314. this.radius = this.radius * e.getMaxScaleOnAxis(),
  40315. this
  40316. },
  40317. translate: function(e) {
  40318. return this.center.add(e),
  40319. this
  40320. },
  40321. equals: function(e) {
  40322. return e.center.equals(this.center) && e.radius === this.radius
  40323. }
  40324. },
  40325. Ci.Frustum = function(e, t, i, n, r, o) {
  40326. 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]
  40327. }
  40328. ,
  40329. Ci.Frustum.prototype = {
  40330. constructor: Ci.Frustum,
  40331. set: function(e, t, i, n, r, o) {
  40332. var a = this.planes;
  40333. return a[0].copy(e),
  40334. a[1].copy(t),
  40335. a[2].copy(i),
  40336. a[3].copy(n),
  40337. a[4].copy(r),
  40338. a[5].copy(o),
  40339. this
  40340. },
  40341. clone: function() {
  40342. return (new this.constructor).copy(this)
  40343. },
  40344. copy: function(e) {
  40345. for (var t = this.planes, i = 0; i < 6; i++)
  40346. t[i].copy(e.planes[i]);
  40347. return this
  40348. },
  40349. setFromMatrix: function(e) {
  40350. var t = this.planes
  40351. , i = e.elements
  40352. , n = i[0]
  40353. , r = i[1]
  40354. , o = i[2]
  40355. , a = i[3]
  40356. , s = i[4]
  40357. , l = i[5]
  40358. , c = i[6]
  40359. , h = i[7]
  40360. , u = i[8]
  40361. , d = i[9]
  40362. , p = i[10]
  40363. , f = i[11]
  40364. , g = i[12]
  40365. , m = i[13]
  40366. , v = i[14]
  40367. , y = i[15];
  40368. return t[0].setComponents(a - n, h - s, f - u, y - g).normalize(),
  40369. t[1].setComponents(a + n, h + s, f + u, y + g).normalize(),
  40370. t[2].setComponents(a + r, h + l, f + d, y + m).normalize(),
  40371. t[3].setComponents(a - r, h - l, f - d, y - m).normalize(),
  40372. t[4].setComponents(a - o, h - c, f - p, y - v).normalize(),
  40373. t[5].setComponents(a + o, h + c, f + p, y + v).normalize(),
  40374. this
  40375. },
  40376. intersectsObject: (H = new Ci.Sphere,
  40377. function(e) {
  40378. var t = e.geometry;
  40379. return null === t.boundingSphere && t.computeBoundingSphere(),
  40380. H.copy(t.boundingSphere),
  40381. H.applyMatrix4(e.matrixWorld),
  40382. this.intersectsSphere(H)
  40383. }
  40384. ),
  40385. intersectsSphere: function(e) {
  40386. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  40387. if (t[r].distanceToPoint(i) < n)
  40388. return !1
  40389. }
  40390. return !0
  40391. },
  40392. intersectsBox: (k = new Ci.Vector3,
  40393. U = new Ci.Vector3,
  40394. function(e) {
  40395. for (var t = this.planes, i = 0; i < 6; i++) {
  40396. var n = t[i];
  40397. k.x = 0 < n.normal.x ? e.min.x : e.max.x,
  40398. U.x = 0 < n.normal.x ? e.max.x : e.min.x,
  40399. k.y = 0 < n.normal.y ? e.min.y : e.max.y,
  40400. U.y = 0 < n.normal.y ? e.max.y : e.min.y,
  40401. k.z = 0 < n.normal.z ? e.min.z : e.max.z,
  40402. U.z = 0 < n.normal.z ? e.max.z : e.min.z;
  40403. var r = n.distanceToPoint(k)
  40404. , o = n.distanceToPoint(U);
  40405. if (r < 0 && o < 0)
  40406. return !1
  40407. }
  40408. return !0
  40409. }
  40410. ),
  40411. containsPoint: function(e) {
  40412. for (var t = this.planes, i = 0; i < 6; i++)
  40413. if (t[i].distanceToPoint(e) < 0)
  40414. return !1;
  40415. return !0
  40416. }
  40417. },
  40418. Ci.Plane = function(e, t) {
  40419. this.normal = void 0 !== e ? e : new Ci.Vector3(1,0,0),
  40420. this.constant = void 0 !== t ? t : 0
  40421. }
  40422. ,
  40423. Ci.Plane.prototype = {
  40424. constructor: Ci.Plane,
  40425. set: function(e, t) {
  40426. return this.normal.copy(e),
  40427. this.constant = t,
  40428. this
  40429. },
  40430. setComponents: function(e, t, i, n) {
  40431. return this.normal.set(e, t, i),
  40432. this.constant = n,
  40433. this
  40434. },
  40435. setFromNormalAndCoplanarPoint: function(e, t) {
  40436. return this.normal.copy(e),
  40437. this.constant = -t.dot(this.normal),
  40438. this
  40439. },
  40440. setFromCoplanarPoints: (B = new Ci.Vector3,
  40441. V = new Ci.Vector3,
  40442. function(e, t, i) {
  40443. var n = B.subVectors(i, t).cross(V.subVectors(e, t)).normalize();
  40444. return this.setFromNormalAndCoplanarPoint(n, e),
  40445. this
  40446. }
  40447. ),
  40448. clone: function() {
  40449. return (new this.constructor).copy(this)
  40450. },
  40451. copy: function(e) {
  40452. return this.normal.copy(e.normal),
  40453. this.constant = e.constant,
  40454. this
  40455. },
  40456. normalize: function() {
  40457. var e = 1 / this.normal.length();
  40458. return this.normal.multiplyScalar(e),
  40459. this.constant *= e,
  40460. this
  40461. },
  40462. negate: function() {
  40463. return this.constant *= -1,
  40464. this.normal.negate(),
  40465. this
  40466. },
  40467. distanceToPoint: function(e) {
  40468. return this.normal.dot(e) + this.constant
  40469. },
  40470. distanceToSphere: function(e) {
  40471. return this.distanceToPoint(e.center) - e.radius
  40472. },
  40473. projectPoint: function(e, t) {
  40474. return this.orthoPoint(e, t).sub(e).negate()
  40475. },
  40476. orthoPoint: function(e, t) {
  40477. var i = this.distanceToPoint(e);
  40478. return (t || new Ci.Vector3).copy(this.normal).multiplyScalar(i)
  40479. },
  40480. intersectLine: (F = new Ci.Vector3,
  40481. function(e, t) {
  40482. var i = t || new Ci.Vector3
  40483. , n = e.delta(F)
  40484. , r = this.normal.dot(n);
  40485. if (0 !== r) {
  40486. var o = -(e.start.dot(this.normal) + this.constant) / r;
  40487. if (!(o < 0 || 1 < o))
  40488. return i.copy(n).multiplyScalar(o).add(e.start)
  40489. } else if (0 === this.distanceToPoint(e.start))
  40490. return i.copy(e.start)
  40491. }
  40492. ),
  40493. intersectsLine: function(e) {
  40494. var t = this.distanceToPoint(e.start)
  40495. , i = this.distanceToPoint(e.end);
  40496. return t < 0 && 0 < i || i < 0 && 0 < t
  40497. },
  40498. intersectsBox: function(e) {
  40499. return e.intersectsPlane(this)
  40500. },
  40501. intersectsSphere: function(e) {
  40502. return e.intersectsPlane(this)
  40503. },
  40504. coplanarPoint: function(e) {
  40505. return (e || new Ci.Vector3).copy(this.normal).multiplyScalar(-this.constant)
  40506. },
  40507. applyMatrix4: (L = new Ci.Vector3,
  40508. D = new Ci.Vector3,
  40509. N = new Ci.Matrix3,
  40510. function(e, t) {
  40511. var i = t || N.getNormalMatrix(e)
  40512. , n = L.copy(this.normal).applyMatrix3(i)
  40513. , r = this.coplanarPoint(D);
  40514. return r.applyMatrix4(e),
  40515. this.setFromNormalAndCoplanarPoint(n, r),
  40516. this
  40517. }
  40518. ),
  40519. translate: function(e) {
  40520. return this.constant = this.constant - e.dot(this.normal),
  40521. this
  40522. },
  40523. equals: function(e) {
  40524. return e.normal.equals(this.normal) && e.constant === this.constant
  40525. }
  40526. },
  40527. Ci.Spherical = function(e, t, i) {
  40528. return this.radius = void 0 !== e ? e : 1,
  40529. this.phi = void 0 !== t ? t : 0,
  40530. this.theta = void 0 !== i ? i : 0,
  40531. this
  40532. }
  40533. ,
  40534. Ci.Spherical.prototype = {
  40535. constructor: Ci.Spherical,
  40536. set: function(e, t, i) {
  40537. this.radius = e,
  40538. this.phi = t,
  40539. this.theta = i
  40540. },
  40541. clone: function() {
  40542. return (new this.constructor).copy(this)
  40543. },
  40544. copy: function(e) {
  40545. return this.radius.copy(e.radius),
  40546. this.phi.copy(e.phi),
  40547. this.theta.copy(e.theta),
  40548. this
  40549. },
  40550. makeSafe: function() {
  40551. this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi))
  40552. },
  40553. setFromVector3: function(e) {
  40554. return this.radius = e.length(),
  40555. 0 === this.radius ? (this.theta = 0,
  40556. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  40557. this.phi = Math.acos(Ci.Math.clamp(e.y / this.radius, -1, 1))),
  40558. this
  40559. }
  40560. },
  40561. Ci.Math = {
  40562. generateUUID: (R = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),
  40563. P = new Array(36),
  40564. O = 0,
  40565. function() {
  40566. for (var e = 0; e < 36; e++)
  40567. 8 === e || 13 === e || 18 === e || 23 === e ? P[e] = "-" : 14 === e ? P[e] = "4" : (O <= 2 && (O = 33554432 + 16777216 * Math.random() | 0),
  40568. M = 15 & O,
  40569. O >>= 4,
  40570. P[e] = R[19 === e ? 3 & M | 8 : M]);
  40571. return P.join("")
  40572. }
  40573. ),
  40574. clamp: function(e, t, i) {
  40575. return Math.max(t, Math.min(i, e))
  40576. },
  40577. euclideanModulo: function(e, t) {
  40578. return (e % t + t) % t
  40579. },
  40580. mapLinear: function(e, t, i, n, r) {
  40581. return n + (e - t) * (r - n) / (i - t)
  40582. },
  40583. smoothstep: function(e, t, i) {
  40584. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * (3 - 2 * e)
  40585. },
  40586. smootherstep: function(e, t, i) {
  40587. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * e * (e * (6 * e - 15) + 10)
  40588. },
  40589. random16: function() {
  40590. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  40591. Math.random()
  40592. },
  40593. randInt: function(e, t) {
  40594. return e + Math.floor(Math.random() * (t - e + 1))
  40595. },
  40596. randFloat: function(e, t) {
  40597. return e + Math.random() * (t - e)
  40598. },
  40599. randFloatSpread: function(e) {
  40600. return e * (.5 - Math.random())
  40601. },
  40602. degToRad: (S = Math.PI / 180,
  40603. function(e) {
  40604. return e * S
  40605. }
  40606. ),
  40607. radToDeg: (x = 180 / Math.PI,
  40608. function(e) {
  40609. return e * x
  40610. }
  40611. ),
  40612. isPowerOfTwo: function(e) {
  40613. return 0 == (e & e - 1) && 0 !== e
  40614. },
  40615. nearestPowerOfTwo: function(e) {
  40616. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  40617. },
  40618. nextPowerOfTwo: function(e) {
  40619. return e--,
  40620. e |= e >> 1,
  40621. e |= e >> 2,
  40622. e |= e >> 4,
  40623. e |= e >> 8,
  40624. e |= e >> 16,
  40625. ++e
  40626. }
  40627. },
  40628. Ci.Spline = function(e) {
  40629. function t(e, t, i, n, r, o, a) {
  40630. var s = .5 * (i - e)
  40631. , l = .5 * (n - t);
  40632. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  40633. }
  40634. this.points = e;
  40635. var i, n, r, o, a, s, l, c, h, u = [], d = {
  40636. x: 0,
  40637. y: 0,
  40638. z: 0
  40639. };
  40640. this.initFromArray = function(e) {
  40641. this.points = [];
  40642. for (var t = 0; t < e.length; t++)
  40643. this.points[t] = {
  40644. x: e[t][0],
  40645. y: e[t][1],
  40646. z: e[t][2]
  40647. }
  40648. }
  40649. ,
  40650. this.getPoint = function(e) {
  40651. return i = (this.points.length - 1) * e,
  40652. n = Math.floor(i),
  40653. r = i - n,
  40654. u[0] = 0 === n ? n : n - 1,
  40655. u[1] = n,
  40656. u[2] = n > this.points.length - 2 ? this.points.length - 1 : n + 1,
  40657. u[3] = n > this.points.length - 3 ? this.points.length - 1 : n + 2,
  40658. s = this.points[u[0]],
  40659. l = this.points[u[1]],
  40660. c = this.points[u[2]],
  40661. h = this.points[u[3]],
  40662. a = r * (o = r * r),
  40663. d.x = t(s.x, l.x, c.x, h.x, r, o, a),
  40664. d.y = t(s.y, l.y, c.y, h.y, r, o, a),
  40665. d.z = t(s.z, l.z, c.z, h.z, r, o, a),
  40666. d
  40667. }
  40668. ,
  40669. this.getControlPointsArray = function() {
  40670. var e, t, i = this.points.length, n = [];
  40671. for (e = 0; e < i; e++)
  40672. t = this.points[e],
  40673. n[e] = [t.x, t.y, t.z];
  40674. return n
  40675. }
  40676. ,
  40677. this.getLength = function(e) {
  40678. var t, i, n, r, o = 0, a = 0, s = 0, l = new Ci.Vector3, c = new Ci.Vector3, h = [], u = 0;
  40679. for (h[0] = 0,
  40680. e = e || 100,
  40681. n = this.points.length * e,
  40682. l.copy(this.points[0]),
  40683. t = 1; t < n; t++)
  40684. i = t / n,
  40685. r = this.getPoint(i),
  40686. c.copy(r),
  40687. u += c.distanceTo(l),
  40688. l.copy(r),
  40689. o = (this.points.length - 1) * i,
  40690. (a = Math.floor(o)) !== s && (h[a] = u,
  40691. s = a);
  40692. return h[h.length] = u,
  40693. {
  40694. chunks: h,
  40695. total: u
  40696. }
  40697. }
  40698. ,
  40699. this.reparametrizeByArcLength = function(e) {
  40700. var t, i, n, r, o, a, s, l, c = [], h = new Ci.Vector3, u = this.getLength();
  40701. for (c.push(h.copy(this.points[0]).clone()),
  40702. t = 1; t < this.points.length; t++) {
  40703. for (a = u.chunks[t] - u.chunks[t - 1],
  40704. s = Math.ceil(e * a / u.total),
  40705. r = (t - 1) / (this.points.length - 1),
  40706. o = t / (this.points.length - 1),
  40707. i = 1; i < s - 1; i++)
  40708. n = r + i * (1 / s) * (o - r),
  40709. l = this.getPoint(n),
  40710. c.push(h.copy(l).clone());
  40711. c.push(h.copy(this.points[t]).clone())
  40712. }
  40713. this.points = c
  40714. }
  40715. }
  40716. ,
  40717. Ci.Triangle = function(e, t, i) {
  40718. this.a = void 0 !== e ? e : new Ci.Vector3,
  40719. this.b = void 0 !== t ? t : new Ci.Vector3,
  40720. this.c = void 0 !== i ? i : new Ci.Vector3
  40721. }
  40722. ,
  40723. Ci.Triangle.normal = (T = new Ci.Vector3,
  40724. function(e, t, i, n) {
  40725. var r = n || new Ci.Vector3;
  40726. r.subVectors(i, t),
  40727. T.subVectors(e, t),
  40728. r.cross(T);
  40729. var o = r.lengthSq();
  40730. return 0 < o ? r.multiplyScalar(1 / Math.sqrt(o)) : r.set(0, 0, 0)
  40731. }
  40732. ),
  40733. Ci.Triangle.barycoordFromPoint = (_ = new Ci.Vector3,
  40734. b = new Ci.Vector3,
  40735. w = new Ci.Vector3,
  40736. function(e, t, i, n, r) {
  40737. _.subVectors(n, t),
  40738. b.subVectors(i, t),
  40739. w.subVectors(e, t);
  40740. var o = _.dot(_)
  40741. , a = _.dot(b)
  40742. , s = _.dot(w)
  40743. , l = b.dot(b)
  40744. , c = b.dot(w)
  40745. , h = o * l - a * a
  40746. , u = r || new Ci.Vector3;
  40747. if (0 == h)
  40748. return u.set(-2, -1, -1);
  40749. var d = 1 / h
  40750. , p = (l * s - a * c) * d
  40751. , f = (o * c - a * s) * d;
  40752. return u.set(1 - p - f, f, p)
  40753. }
  40754. ),
  40755. Ci.Triangle.containsPoint = (E = new Ci.Vector3,
  40756. function(e, t, i, n) {
  40757. var r = Ci.Triangle.barycoordFromPoint(e, t, i, n, E);
  40758. return 0 <= r.x && 0 <= r.y && r.x + r.y <= 1
  40759. }
  40760. ),
  40761. Ci.Triangle.prototype = {
  40762. constructor: Ci.Triangle,
  40763. set: function(e, t, i) {
  40764. return this.a.copy(e),
  40765. this.b.copy(t),
  40766. this.c.copy(i),
  40767. this
  40768. },
  40769. setFromPointsAndIndices: function(e, t, i, n) {
  40770. return this.a.copy(e[t]),
  40771. this.b.copy(e[i]),
  40772. this.c.copy(e[n]),
  40773. this
  40774. },
  40775. clone: function() {
  40776. return (new this.constructor).copy(this)
  40777. },
  40778. copy: function(e) {
  40779. return this.a.copy(e.a),
  40780. this.b.copy(e.b),
  40781. this.c.copy(e.c),
  40782. this
  40783. },
  40784. area: (C = new Ci.Vector3,
  40785. I = new Ci.Vector3,
  40786. function() {
  40787. return C.subVectors(this.c, this.b),
  40788. I.subVectors(this.a, this.b),
  40789. .5 * C.cross(I).length()
  40790. }
  40791. ),
  40792. midpoint: function(e) {
  40793. return (e || new Ci.Vector3).addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  40794. },
  40795. normal: function(e) {
  40796. return Ci.Triangle.normal(this.a, this.b, this.c, e)
  40797. },
  40798. plane: function(e) {
  40799. return (e || new Ci.Plane).setFromCoplanarPoints(this.a, this.b, this.c)
  40800. },
  40801. barycoordFromPoint: function(e, t) {
  40802. return Ci.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  40803. },
  40804. containsPoint: function(e) {
  40805. return Ci.Triangle.containsPoint(e, this.a, this.b, this.c)
  40806. },
  40807. equals: function(e) {
  40808. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  40809. }
  40810. },
  40811. Ci.Interpolant = function(e, t, i, n) {
  40812. this.parameterPositions = e,
  40813. this._cachedIndex = 0,
  40814. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  40815. this.sampleValues = t,
  40816. this.valueSize = i
  40817. }
  40818. ,
  40819. Ci.Interpolant.prototype = {
  40820. constructor: Ci.Interpolant,
  40821. evaluate: function(e) {
  40822. var t = this.parameterPositions
  40823. , i = this._cachedIndex
  40824. , n = t[i]
  40825. , r = t[i - 1];
  40826. e: {
  40827. t: {
  40828. var o;
  40829. i: {
  40830. n: if (!(e < n)) {
  40831. for (var a = i + 2; ; ) {
  40832. if (void 0 === n) {
  40833. if (e < r)
  40834. break n;
  40835. return i = t.length,
  40836. this._cachedIndex = i,
  40837. this.afterEnd_(i - 1, e, r)
  40838. }
  40839. if (i === a)
  40840. break;
  40841. if (r = n,
  40842. e < (n = t[++i]))
  40843. break t
  40844. }
  40845. o = t.length;
  40846. break i
  40847. }
  40848. if (r <= e)
  40849. break e;
  40850. var s = t[1];
  40851. e < s && (i = 2,
  40852. r = s);
  40853. for (a = i - 2; ; ) {
  40854. if (void 0 === r)
  40855. return this._cachedIndex = 0,
  40856. this.beforeStart_(0, e, n);
  40857. if (i === a)
  40858. break;
  40859. if (n = r,
  40860. (r = t[--i - 1]) <= e)
  40861. break t
  40862. }
  40863. o = i,
  40864. i = 0
  40865. }
  40866. for (; i < o; ) {
  40867. var l = i + o >>> 1;
  40868. e < t[l] ? o = l : i = 1 + l
  40869. }
  40870. if (n = t[i],
  40871. void 0 === (r = t[i - 1]))
  40872. return this._cachedIndex = 0,
  40873. this.beforeStart_(0, e, n);
  40874. if (void 0 === n)
  40875. return i = t.length,
  40876. this._cachedIndex = i,
  40877. this.afterEnd_(i - 1, r, e)
  40878. }
  40879. this._cachedIndex = i,
  40880. this.intervalChanged_(i, r, n)
  40881. }
  40882. return this.interpolate_(i, r, e, n)
  40883. },
  40884. settings: null,
  40885. DefaultSettings_: {},
  40886. getSettings_: function() {
  40887. return this.settings || this.DefaultSettings_
  40888. },
  40889. copySampleValue_: function(e) {
  40890. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  40891. t[o] = i[r + o];
  40892. return t
  40893. },
  40894. interpolate_: function(e, t, i, n) {
  40895. throw new Error("call to abstract method")
  40896. },
  40897. intervalChanged_: function(e, t, i) {}
  40898. },
  40899. Object.assign(Ci.Interpolant.prototype, {
  40900. beforeStart_: Ci.Interpolant.prototype.copySampleValue_,
  40901. afterEnd_: Ci.Interpolant.prototype.copySampleValue_
  40902. }),
  40903. Ci.CubicInterpolant = function(e, t, i, n) {
  40904. Ci.Interpolant.call(this, e, t, i, n),
  40905. this._weightPrev = -0,
  40906. this._offsetPrev = -0,
  40907. this._weightNext = -0,
  40908. this._offsetNext = -0
  40909. }
  40910. ,
  40911. Ci.CubicInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40912. constructor: Ci.CubicInterpolant,
  40913. DefaultSettings_: {
  40914. endingStart: Ci.ZeroCurvatureEnding,
  40915. endingEnd: Ci.ZeroCurvatureEnding
  40916. },
  40917. intervalChanged_: function(e, t, i) {
  40918. var n = this.parameterPositions
  40919. , r = e - 2
  40920. , o = e + 1
  40921. , a = n[r]
  40922. , s = n[o];
  40923. if (void 0 === a)
  40924. switch (this.getSettings_().endingStart) {
  40925. case Ci.ZeroSlopeEnding:
  40926. r = e,
  40927. a = 2 * t - i;
  40928. break;
  40929. case Ci.WrapAroundEnding:
  40930. a = t + n[r = n.length - 2] - n[r + 1];
  40931. break;
  40932. default:
  40933. r = e,
  40934. a = i
  40935. }
  40936. if (void 0 === s)
  40937. switch (this.getSettings_().endingEnd) {
  40938. case Ci.ZeroSlopeEnding:
  40939. o = e,
  40940. s = 2 * i - t;
  40941. break;
  40942. case Ci.WrapAroundEnding:
  40943. s = i + n[o = 1] - n[0];
  40944. break;
  40945. default:
  40946. o = e - 1,
  40947. s = t
  40948. }
  40949. var l = .5 * (i - t)
  40950. , c = this.valueSize;
  40951. this._weightPrev = l / (t - a),
  40952. this._weightNext = l / (s - i),
  40953. this._offsetPrev = r * c,
  40954. this._offsetNext = o * c
  40955. },
  40956. interpolate_: function(e, t, i, n) {
  40957. 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)
  40958. r[C] = m * o[c + C] + v * o[l + C] + y * o[s + C] + A * o[h + C];
  40959. return r
  40960. }
  40961. }),
  40962. Ci.DiscreteInterpolant = function(e, t, i, n) {
  40963. Ci.Interpolant.call(this, e, t, i, n)
  40964. }
  40965. ,
  40966. Ci.DiscreteInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40967. constructor: Ci.DiscreteInterpolant,
  40968. interpolate_: function(e, t, i, n) {
  40969. return this.copySampleValue_(e - 1)
  40970. }
  40971. }),
  40972. Ci.LinearInterpolant = function(e, t, i, n) {
  40973. Ci.Interpolant.call(this, e, t, i, n)
  40974. }
  40975. ,
  40976. Ci.LinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40977. constructor: Ci.LinearInterpolant,
  40978. interpolate_: function(e, t, i, n) {
  40979. 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)
  40980. r[u] = o[l + u] * h + o[s + u] * c;
  40981. return r
  40982. }
  40983. }),
  40984. Ci.QuaternionLinearInterpolant = function(e, t, i, n) {
  40985. Ci.Interpolant.call(this, e, t, i, n)
  40986. }
  40987. ,
  40988. Ci.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40989. constructor: Ci.QuaternionLinearInterpolant,
  40990. interpolate_: function(e, t, i, n) {
  40991. 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)
  40992. Ci.Quaternion.slerpFlat(r, 0, o, s - a, o, s, l);
  40993. return r
  40994. }
  40995. }),
  40996. Ci.Clock = function(e) {
  40997. this.autoStart = void 0 === e || e,
  40998. this.startTime = 0,
  40999. this.oldTime = 0,
  41000. this.elapsedTime = 0,
  41001. this.running = !1
  41002. }
  41003. ,
  41004. Ci.Clock.prototype = {
  41005. constructor: Ci.Clock,
  41006. start: function() {
  41007. this.startTime = performance.now(),
  41008. this.oldTime = this.startTime,
  41009. this.running = !0
  41010. },
  41011. stop: function() {
  41012. this.getElapsedTime(),
  41013. this.running = !1
  41014. },
  41015. getElapsedTime: function() {
  41016. return this.getDelta(),
  41017. this.elapsedTime
  41018. },
  41019. getDelta: function() {
  41020. var e = 0;
  41021. if (this.autoStart && !this.running && this.start(),
  41022. this.running) {
  41023. var t = performance.now();
  41024. e = .001 * (t - this.oldTime),
  41025. this.oldTime = t,
  41026. this.elapsedTime += e
  41027. }
  41028. return e
  41029. }
  41030. },
  41031. Ci.EventDispatcher = function() {}
  41032. ,
  41033. Ci.EventDispatcher.prototype = {
  41034. constructor: Ci.EventDispatcher,
  41035. apply: function(e) {
  41036. e.addEventListener = Ci.EventDispatcher.prototype.addEventListener,
  41037. e.hasEventListener = Ci.EventDispatcher.prototype.hasEventListener,
  41038. e.removeEventListener = Ci.EventDispatcher.prototype.removeEventListener,
  41039. e.dispatchEvent = Ci.EventDispatcher.prototype.dispatchEvent
  41040. },
  41041. addEventListener: function(e, t) {
  41042. void 0 === this._listeners && (this._listeners = {});
  41043. var i = this._listeners;
  41044. void 0 === i[e] && (i[e] = []),
  41045. -1 === i[e].indexOf(t) && i[e].push(t)
  41046. },
  41047. hasEventListener: function(e, t) {
  41048. if (void 0 === this._listeners)
  41049. return !1;
  41050. var i = this._listeners;
  41051. return void 0 !== i[e] && -1 !== i[e].indexOf(t)
  41052. },
  41053. removeEventListener: function(e, t) {
  41054. if (void 0 !== this._listeners) {
  41055. var i = this._listeners[e];
  41056. if (void 0 !== i) {
  41057. var n = i.indexOf(t);
  41058. -1 !== n && i.splice(n, 1)
  41059. }
  41060. }
  41061. },
  41062. dispatchEvent: function(e) {
  41063. if (void 0 !== this._listeners) {
  41064. var t = this._listeners[e.type];
  41065. if (void 0 !== t) {
  41066. e.target = this;
  41067. for (var i = [], n = t.length, r = 0; r < n; r++)
  41068. i[r] = t[r];
  41069. for (r = 0; r < n; r++)
  41070. i[r].call(this, e)
  41071. }
  41072. }
  41073. }
  41074. },
  41075. Ci.Layers = function() {
  41076. this.mask = 1
  41077. }
  41078. ,
  41079. Ci.Layers.prototype = {
  41080. constructor: Ci.Layers,
  41081. set: function(e) {
  41082. this.mask = 1 << e
  41083. },
  41084. enable: function(e) {
  41085. this.mask |= 1 << e
  41086. },
  41087. toggle: function(e) {
  41088. this.mask ^= 1 << e
  41089. },
  41090. disable: function(e) {
  41091. this.mask &= ~(1 << e)
  41092. },
  41093. test: function(e) {
  41094. return 0 != (this.mask & e.mask)
  41095. }
  41096. },
  41097. (A = Ci).Raycaster = function(e, t, i, n) {
  41098. this.ray = new A.Ray(e,t),
  41099. this.near = i || 0,
  41100. this.far = n || 1 / 0,
  41101. this.params = {
  41102. Mesh: {},
  41103. Line: {},
  41104. LOD: {},
  41105. Points: {
  41106. threshold: 1
  41107. },
  41108. Sprite: {}
  41109. },
  41110. Object.defineProperties(this.params, {
  41111. PointCloud: {
  41112. get: function() {
  41113. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  41114. this.Points
  41115. }
  41116. }
  41117. })
  41118. }
  41119. ,
  41120. A.Raycaster.prototype = {
  41121. constructor: A.Raycaster,
  41122. linePrecision: 1,
  41123. set: function(e, t) {
  41124. this.ray.set(e, t)
  41125. },
  41126. setFromCamera: function(e, t) {
  41127. t instanceof A.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld),
  41128. 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),
  41129. this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  41130. },
  41131. intersectObject: function(e, t) {
  41132. var i = [];
  41133. return Ei(e, this, i, t),
  41134. i.sort(Ii),
  41135. i
  41136. },
  41137. intersectObjects: function(e, t) {
  41138. var i = [];
  41139. if (!1 === Array.isArray(e))
  41140. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  41141. i;
  41142. for (var n = 0, r = e.length; n < r; n++)
  41143. Ei(e[n], this, i, t);
  41144. return i.sort(Ii),
  41145. i
  41146. }
  41147. },
  41148. Ci.Object3D = function() {
  41149. Object.defineProperty(this, "id", {
  41150. value: Ci.Object3DIdCount++
  41151. }),
  41152. this.uuid = Ci.Math.generateUUID(),
  41153. this.name = "",
  41154. this.type = "Object3D",
  41155. this.parent = null,
  41156. this.children = [],
  41157. this.up = Ci.Object3D.DefaultUp.clone();
  41158. var e = new Ci.Vector3
  41159. , t = new Ci.Euler
  41160. , i = new Ci.Quaternion
  41161. , n = new Ci.Vector3(1,1,1);
  41162. t.onChange(function() {
  41163. i.setFromEuler(t, !1)
  41164. }),
  41165. i.onChange(function() {
  41166. t.setFromQuaternion(i, void 0, !1)
  41167. }),
  41168. Object.defineProperties(this, {
  41169. position: {
  41170. enumerable: !0,
  41171. value: e
  41172. },
  41173. rotation: {
  41174. enumerable: !0,
  41175. value: t
  41176. },
  41177. quaternion: {
  41178. enumerable: !0,
  41179. value: i
  41180. },
  41181. scale: {
  41182. enumerable: !0,
  41183. value: n
  41184. },
  41185. modelViewMatrix: {
  41186. value: new Ci.Matrix4
  41187. },
  41188. normalMatrix: {
  41189. value: new Ci.Matrix3
  41190. }
  41191. }),
  41192. this.rotationAutoUpdate = !0,
  41193. this.matrix = new Ci.Matrix4,
  41194. this.matrixWorld = new Ci.Matrix4,
  41195. this.matrixAutoUpdate = Ci.Object3D.DefaultMatrixAutoUpdate,
  41196. this.matrixWorldNeedsUpdate = !1,
  41197. this.layers = new Ci.Layers,
  41198. this.visible = !0,
  41199. this.castShadow = !1,
  41200. this.receiveShadow = !1,
  41201. this.frustumCulled = !0,
  41202. this.renderOrder = 0,
  41203. this.userData = {}
  41204. }
  41205. ,
  41206. Ci.Object3D.DefaultUp = new Ci.Vector3(0,1,0),
  41207. Ci.Object3D.DefaultMatrixAutoUpdate = !0,
  41208. Ci.Object3D.prototype = {
  41209. constructor: Ci.Object3D,
  41210. applyMatrix: function(e) {
  41211. this.matrix.multiplyMatrices(e, this.matrix),
  41212. this.matrix.decompose(this.position, this.quaternion, this.scale)
  41213. },
  41214. setRotationFromAxisAngle: function(e, t) {
  41215. this.quaternion.setFromAxisAngle(e, t)
  41216. },
  41217. setRotationFromEuler: function(e) {
  41218. this.quaternion.setFromEuler(e, !0)
  41219. },
  41220. setRotationFromMatrix: function(e) {
  41221. this.quaternion.setFromRotationMatrix(e)
  41222. },
  41223. setRotationFromQuaternion: function(e) {
  41224. this.quaternion.copy(e)
  41225. },
  41226. rotateOnAxis: (y = new Ci.Quaternion,
  41227. function(e, t) {
  41228. return y.setFromAxisAngle(e, t),
  41229. this.quaternion.multiply(y),
  41230. this
  41231. }
  41232. ),
  41233. rotateX: (v = new Ci.Vector3(1,0,0),
  41234. function(e) {
  41235. return this.rotateOnAxis(v, e)
  41236. }
  41237. ),
  41238. rotateY: (m = new Ci.Vector3(0,1,0),
  41239. function(e) {
  41240. return this.rotateOnAxis(m, e)
  41241. }
  41242. ),
  41243. rotateZ: (g = new Ci.Vector3(0,0,1),
  41244. function(e) {
  41245. return this.rotateOnAxis(g, e)
  41246. }
  41247. ),
  41248. translateOnAxis: (f = new Ci.Vector3,
  41249. function(e, t) {
  41250. return f.copy(e).applyQuaternion(this.quaternion),
  41251. this.position.add(f.multiplyScalar(t)),
  41252. this
  41253. }
  41254. ),
  41255. translateX: (p = new Ci.Vector3(1,0,0),
  41256. function(e) {
  41257. return this.translateOnAxis(p, e)
  41258. }
  41259. ),
  41260. translateY: (d = new Ci.Vector3(0,1,0),
  41261. function(e) {
  41262. return this.translateOnAxis(d, e)
  41263. }
  41264. ),
  41265. translateZ: (u = new Ci.Vector3(0,0,1),
  41266. function(e) {
  41267. return this.translateOnAxis(u, e)
  41268. }
  41269. ),
  41270. localToWorld: function(e) {
  41271. return e.applyMatrix4(this.matrixWorld)
  41272. },
  41273. worldToLocal: (h = new Ci.Matrix4,
  41274. function(e) {
  41275. return e.applyMatrix4(h.getInverse(this.matrixWorld))
  41276. }
  41277. ),
  41278. lookAt: (c = new Ci.Matrix4,
  41279. function(e) {
  41280. c.lookAt(e, this.position, this.up),
  41281. this.quaternion.setFromRotationMatrix(c)
  41282. }
  41283. ),
  41284. add: function(e) {
  41285. if (1 < arguments.length) {
  41286. for (var t = 0; t < arguments.length; t++)
  41287. this.add(arguments[t]);
  41288. return this
  41289. }
  41290. 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),
  41291. e.parent = this,
  41292. e.dispatchEvent({
  41293. type: "added"
  41294. }),
  41295. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  41296. this
  41297. },
  41298. remove: function(e) {
  41299. if (1 < arguments.length)
  41300. for (var t = 0; t < arguments.length; t++)
  41301. this.remove(arguments[t]);
  41302. var i = this.children.indexOf(e);
  41303. -1 !== i && (e.parent = null,
  41304. e.dispatchEvent({
  41305. type: "removed"
  41306. }),
  41307. this.children.splice(i, 1))
  41308. },
  41309. getObjectById: function(e) {
  41310. return this.getObjectByProperty("id", e)
  41311. },
  41312. getObjectByName: function(e) {
  41313. return this.getObjectByProperty("name", e)
  41314. },
  41315. getObjectByProperty: function(e, t) {
  41316. if (this[e] === t)
  41317. return this;
  41318. for (var i = 0, n = this.children.length; i < n; i++) {
  41319. var r = this.children[i].getObjectByProperty(e, t);
  41320. if (void 0 !== r)
  41321. return r
  41322. }
  41323. },
  41324. getWorldPosition: function(e) {
  41325. var t = e || new Ci.Vector3;
  41326. return this.updateMatrixWorld(!0),
  41327. t.setFromMatrixPosition(this.matrixWorld)
  41328. },
  41329. getWorldQuaternion: (s = new Ci.Vector3,
  41330. l = new Ci.Vector3,
  41331. function(e) {
  41332. var t = e || new Ci.Quaternion;
  41333. return this.updateMatrixWorld(!0),
  41334. this.matrixWorld.decompose(s, t, l),
  41335. t
  41336. }
  41337. ),
  41338. getWorldRotation: (a = new Ci.Quaternion,
  41339. function(e) {
  41340. var t = e || new Ci.Euler;
  41341. return this.getWorldQuaternion(a),
  41342. t.setFromQuaternion(a, this.rotation.order, !1)
  41343. }
  41344. ),
  41345. getWorldScale: (r = new Ci.Vector3,
  41346. o = new Ci.Quaternion,
  41347. function(e) {
  41348. var t = e || new Ci.Vector3;
  41349. return this.updateMatrixWorld(!0),
  41350. this.matrixWorld.decompose(r, o, t),
  41351. t
  41352. }
  41353. ),
  41354. getWorldDirection: (n = new Ci.Quaternion,
  41355. function(e) {
  41356. var t = e || new Ci.Vector3;
  41357. return this.getWorldQuaternion(n),
  41358. t.set(0, 0, 1).applyQuaternion(n)
  41359. }
  41360. ),
  41361. raycast: function() {},
  41362. traverse: function(e) {
  41363. e(this);
  41364. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41365. t[i].traverse(e)
  41366. },
  41367. traverseVisible: function(e) {
  41368. if (!1 !== this.visible) {
  41369. e(this);
  41370. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41371. t[i].traverseVisible(e)
  41372. }
  41373. },
  41374. traverseAncestors: function(e) {
  41375. var t = this.parent;
  41376. null !== t && (e(t),
  41377. t.traverseAncestors(e))
  41378. },
  41379. updateMatrix: function() {
  41380. this.matrix.compose(this.position, this.quaternion, this.scale),
  41381. this.matrixWorldNeedsUpdate = !0
  41382. },
  41383. updateMatrixWorld: function(e) {
  41384. !0 === this.matrixAutoUpdate && this.updateMatrix(),
  41385. !0 !== this.matrixWorldNeedsUpdate && !0 !== e || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  41386. e = !(this.matrixWorldNeedsUpdate = !1));
  41387. for (var t = 0, i = this.children.length; t < i; t++)
  41388. this.children[t].updateMatrixWorld(e)
  41389. },
  41390. toJSON: function(e) {
  41391. function t(e) {
  41392. var t = [];
  41393. for (var i in e) {
  41394. var n = e[i];
  41395. delete n.metadata,
  41396. t.push(n)
  41397. }
  41398. return t
  41399. }
  41400. var i = void 0 === e
  41401. , n = {};
  41402. i && (e = {
  41403. geometries: {},
  41404. materials: {},
  41405. textures: {},
  41406. images: {}
  41407. },
  41408. n.metadata = {
  41409. version: 4.4,
  41410. type: "Object",
  41411. generator: "Object3D.toJSON"
  41412. });
  41413. var r = {};
  41414. if (r.uuid = this.uuid,
  41415. r.type = this.type,
  41416. "" !== this.name && (r.name = this.name),
  41417. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  41418. !0 === this.castShadow && (r.castShadow = !0),
  41419. !0 === this.receiveShadow && (r.receiveShadow = !0),
  41420. !1 === this.visible && (r.visible = !1),
  41421. r.matrix = this.matrix.toArray(),
  41422. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  41423. r.geometry = this.geometry.uuid),
  41424. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  41425. r.material = this.material.uuid),
  41426. 0 < this.children.length) {
  41427. r.children = [];
  41428. for (var o = 0; o < this.children.length; o++)
  41429. r.children.push(this.children[o].toJSON(e).object)
  41430. }
  41431. if (i) {
  41432. var a = t(e.geometries)
  41433. , s = t(e.materials)
  41434. , l = t(e.textures)
  41435. , c = t(e.images);
  41436. 0 < a.length && (n.geometries = a),
  41437. 0 < s.length && (n.materials = s),
  41438. 0 < l.length && (n.textures = l),
  41439. 0 < c.length && (n.images = c)
  41440. }
  41441. return n.object = r,
  41442. n
  41443. },
  41444. clone: function(e) {
  41445. return (new this.constructor).copy(this, e)
  41446. },
  41447. copy: function(e, t) {
  41448. if (void 0 === t && (t = !0),
  41449. this.name = e.name,
  41450. this.up.copy(e.up),
  41451. this.position.copy(e.position),
  41452. this.quaternion.copy(e.quaternion),
  41453. this.scale.copy(e.scale),
  41454. this.rotationAutoUpdate = e.rotationAutoUpdate,
  41455. this.matrix.copy(e.matrix),
  41456. this.matrixWorld.copy(e.matrixWorld),
  41457. this.matrixAutoUpdate = e.matrixAutoUpdate,
  41458. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  41459. this.visible = e.visible,
  41460. this.castShadow = e.castShadow,
  41461. this.receiveShadow = e.receiveShadow,
  41462. this.frustumCulled = e.frustumCulled,
  41463. this.renderOrder = e.renderOrder,
  41464. this.userData = JSON.parse(JSON.stringify(e.userData)),
  41465. !0 === t)
  41466. for (var i = 0; i < e.children.length; i++) {
  41467. var n = e.children[i];
  41468. this.add(n.clone())
  41469. }
  41470. return this
  41471. }
  41472. },
  41473. Ci.EventDispatcher.prototype.apply(Ci.Object3D.prototype),
  41474. Ci.Object3DIdCount = 0,
  41475. Ci.Face3 = function(e, t, i, n, r, o) {
  41476. this.a = e,
  41477. this.b = t,
  41478. this.c = i,
  41479. this.normal = n instanceof Ci.Vector3 ? n : new Ci.Vector3,
  41480. this.vertexNormals = Array.isArray(n) ? n : [],
  41481. this.color = r instanceof Ci.Color ? r : new Ci.Color,
  41482. this.vertexColors = Array.isArray(r) ? r : [],
  41483. this.materialIndex = void 0 !== o ? o : 0
  41484. }
  41485. ,
  41486. Ci.Face3.prototype = {
  41487. constructor: Ci.Face3,
  41488. clone: function() {
  41489. return (new this.constructor).copy(this)
  41490. },
  41491. copy: function(e) {
  41492. this.a = e.a,
  41493. this.b = e.b,
  41494. this.c = e.c,
  41495. this.normal.copy(e.normal),
  41496. this.color.copy(e.color),
  41497. this.materialIndex = e.materialIndex;
  41498. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  41499. this.vertexNormals[t] = e.vertexNormals[t].clone();
  41500. for (t = 0,
  41501. i = e.vertexColors.length; t < i; t++)
  41502. this.vertexColors[t] = e.vertexColors[t].clone();
  41503. return this
  41504. }
  41505. },
  41506. Ci.BufferAttribute = function(e, t) {
  41507. this.uuid = Ci.Math.generateUUID(),
  41508. this.array = e,
  41509. this.itemSize = t,
  41510. this.dynamic = !1,
  41511. this.updateRange = {
  41512. offset: 0,
  41513. count: -1
  41514. },
  41515. this.version = 0
  41516. }
  41517. ,
  41518. Ci.BufferAttribute.prototype = {
  41519. constructor: Ci.BufferAttribute,
  41520. get count() {
  41521. return this.array.length / this.itemSize
  41522. },
  41523. set needsUpdate(e) {
  41524. !0 === e && this.version++
  41525. },
  41526. setDynamic: function(e) {
  41527. return this.dynamic = e,
  41528. this
  41529. },
  41530. copy: function(e) {
  41531. return this.array = new e.array.constructor(e.array),
  41532. this.itemSize = e.itemSize,
  41533. this.dynamic = e.dynamic,
  41534. this
  41535. },
  41536. copyAt: function(e, t, i) {
  41537. e *= this.itemSize,
  41538. i *= t.itemSize;
  41539. for (var n = 0, r = this.itemSize; n < r; n++)
  41540. this.array[e + n] = t.array[i + n];
  41541. return this
  41542. },
  41543. copyArray: function(e) {
  41544. return this.array.set(e),
  41545. this
  41546. },
  41547. copyColorsArray: function(e) {
  41548. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41549. var o = e[n];
  41550. void 0 === o && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", n),
  41551. o = new Ci.Color),
  41552. t[i++] = o.r,
  41553. t[i++] = o.g,
  41554. t[i++] = o.b
  41555. }
  41556. return this
  41557. },
  41558. copyIndicesArray: function(e) {
  41559. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41560. var o = e[n];
  41561. t[i++] = o.a,
  41562. t[i++] = o.b,
  41563. t[i++] = o.c
  41564. }
  41565. return this
  41566. },
  41567. copyVector2sArray: function(e) {
  41568. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41569. var o = e[n];
  41570. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", n),
  41571. o = new Ci.Vector2),
  41572. t[i++] = o.x,
  41573. t[i++] = o.y
  41574. }
  41575. return this
  41576. },
  41577. copyVector3sArray: function(e) {
  41578. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41579. var o = e[n];
  41580. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", n),
  41581. o = new Ci.Vector3),
  41582. t[i++] = o.x,
  41583. t[i++] = o.y,
  41584. t[i++] = o.z
  41585. }
  41586. return this
  41587. },
  41588. copyVector4sArray: function(e) {
  41589. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41590. var o = e[n];
  41591. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", n),
  41592. o = new Ci.Vector4),
  41593. t[i++] = o.x,
  41594. t[i++] = o.y,
  41595. t[i++] = o.z,
  41596. t[i++] = o.w
  41597. }
  41598. return this
  41599. },
  41600. set: function(e, t) {
  41601. return void 0 === t && (t = 0),
  41602. this.array.set(e, t),
  41603. this
  41604. },
  41605. getX: function(e) {
  41606. return this.array[e * this.itemSize]
  41607. },
  41608. setX: function(e, t) {
  41609. return this.array[e * this.itemSize] = t,
  41610. this
  41611. },
  41612. getY: function(e) {
  41613. return this.array[e * this.itemSize + 1]
  41614. },
  41615. setY: function(e, t) {
  41616. return this.array[e * this.itemSize + 1] = t,
  41617. this
  41618. },
  41619. getZ: function(e) {
  41620. return this.array[e * this.itemSize + 2]
  41621. },
  41622. setZ: function(e, t) {
  41623. return this.array[e * this.itemSize + 2] = t,
  41624. this
  41625. },
  41626. getW: function(e) {
  41627. return this.array[e * this.itemSize + 3]
  41628. },
  41629. setW: function(e, t) {
  41630. return this.array[e * this.itemSize + 3] = t,
  41631. this
  41632. },
  41633. setXY: function(e, t, i) {
  41634. return e *= this.itemSize,
  41635. this.array[e + 0] = t,
  41636. this.array[e + 1] = i,
  41637. this
  41638. },
  41639. setXYZ: function(e, t, i, n) {
  41640. return e *= this.itemSize,
  41641. this.array[e + 0] = t,
  41642. this.array[e + 1] = i,
  41643. this.array[e + 2] = n,
  41644. this
  41645. },
  41646. setXYZW: function(e, t, i, n, r) {
  41647. return e *= this.itemSize,
  41648. this.array[e + 0] = t,
  41649. this.array[e + 1] = i,
  41650. this.array[e + 2] = n,
  41651. this.array[e + 3] = r,
  41652. this
  41653. },
  41654. clone: function() {
  41655. return (new this.constructor).copy(this)
  41656. }
  41657. },
  41658. Ci.Int8Attribute = function(e, t) {
  41659. return new Ci.BufferAttribute(new Int8Array(e),t)
  41660. }
  41661. ,
  41662. Ci.Uint8Attribute = function(e, t) {
  41663. return new Ci.BufferAttribute(new Uint8Array(e),t)
  41664. }
  41665. ,
  41666. Ci.Uint8ClampedAttribute = function(e, t) {
  41667. return new Ci.BufferAttribute(new Uint8ClampedArray(e),t)
  41668. }
  41669. ,
  41670. Ci.Int16Attribute = function(e, t) {
  41671. return new Ci.BufferAttribute(new Int16Array(e),t)
  41672. }
  41673. ,
  41674. Ci.Uint16Attribute = function(e, t) {
  41675. return new Ci.BufferAttribute(new Uint16Array(e),t)
  41676. }
  41677. ,
  41678. Ci.Int32Attribute = function(e, t) {
  41679. return new Ci.BufferAttribute(new Int32Array(e),t)
  41680. }
  41681. ,
  41682. Ci.Uint32Attribute = function(e, t) {
  41683. return new Ci.BufferAttribute(new Uint32Array(e),t)
  41684. }
  41685. ,
  41686. Ci.Float32Attribute = function(e, t) {
  41687. return new Ci.BufferAttribute(new Float32Array(e),t)
  41688. }
  41689. ,
  41690. Ci.Float64Attribute = function(e, t) {
  41691. return new Ci.BufferAttribute(new Float64Array(e),t)
  41692. }
  41693. ,
  41694. Ci.DynamicBufferAttribute = function(e, t) {
  41695. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  41696. new Ci.BufferAttribute(e,t).setDynamic(!0)
  41697. }
  41698. ,
  41699. Ci.InstancedBufferAttribute = function(e, t, i) {
  41700. Ci.BufferAttribute.call(this, e, t),
  41701. this.meshPerAttribute = i || 1
  41702. }
  41703. ,
  41704. Ci.InstancedBufferAttribute.prototype = Object.create(Ci.BufferAttribute.prototype),
  41705. Ci.InstancedBufferAttribute.prototype.constructor = Ci.InstancedBufferAttribute,
  41706. Ci.InstancedBufferAttribute.prototype.copy = function(e) {
  41707. return Ci.BufferAttribute.prototype.copy.call(this, e),
  41708. this.meshPerAttribute = e.meshPerAttribute,
  41709. this
  41710. }
  41711. ,
  41712. Ci.InterleavedBuffer = function(e, t) {
  41713. this.uuid = Ci.Math.generateUUID(),
  41714. this.array = e,
  41715. this.stride = t,
  41716. this.dynamic = !1,
  41717. this.updateRange = {
  41718. offset: 0,
  41719. count: -1
  41720. },
  41721. this.version = 0
  41722. }
  41723. ,
  41724. Ci.InterleavedBuffer.prototype = {
  41725. constructor: Ci.InterleavedBuffer,
  41726. get length() {
  41727. return this.array.length
  41728. },
  41729. get count() {
  41730. return this.array.length / this.stride
  41731. },
  41732. set needsUpdate(e) {
  41733. !0 === e && this.version++
  41734. },
  41735. setDynamic: function(e) {
  41736. return this.dynamic = e,
  41737. this
  41738. },
  41739. copy: function(e) {
  41740. return this.array = new e.array.constructor(e.array),
  41741. this.stride = e.stride,
  41742. this.dynamic = e.dynamic,
  41743. this
  41744. },
  41745. copyAt: function(e, t, i) {
  41746. e *= this.stride,
  41747. i *= t.stride;
  41748. for (var n = 0, r = this.stride; n < r; n++)
  41749. this.array[e + n] = t.array[i + n];
  41750. return this
  41751. },
  41752. set: function(e, t) {
  41753. return void 0 === t && (t = 0),
  41754. this.array.set(e, t),
  41755. this
  41756. },
  41757. clone: function() {
  41758. return (new this.constructor).copy(this)
  41759. }
  41760. },
  41761. Ci.InstancedInterleavedBuffer = function(e, t, i) {
  41762. Ci.InterleavedBuffer.call(this, e, t),
  41763. this.meshPerAttribute = i || 1
  41764. }
  41765. ,
  41766. Ci.InstancedInterleavedBuffer.prototype = Object.create(Ci.InterleavedBuffer.prototype),
  41767. Ci.InstancedInterleavedBuffer.prototype.constructor = Ci.InstancedInterleavedBuffer,
  41768. Ci.InstancedInterleavedBuffer.prototype.copy = function(e) {
  41769. return Ci.InterleavedBuffer.prototype.copy.call(this, e),
  41770. this.meshPerAttribute = e.meshPerAttribute,
  41771. this
  41772. }
  41773. ,
  41774. Ci.InterleavedBufferAttribute = function(e, t, i) {
  41775. this.uuid = Ci.Math.generateUUID(),
  41776. this.data = e,
  41777. this.itemSize = t,
  41778. this.offset = i
  41779. }
  41780. ,
  41781. Ci.InterleavedBufferAttribute.prototype = {
  41782. constructor: Ci.InterleavedBufferAttribute,
  41783. get length() {
  41784. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  41785. this.array.length
  41786. },
  41787. get count() {
  41788. return this.data.count
  41789. },
  41790. setX: function(e, t) {
  41791. return this.data.array[e * this.data.stride + this.offset] = t,
  41792. this
  41793. },
  41794. setY: function(e, t) {
  41795. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  41796. this
  41797. },
  41798. setZ: function(e, t) {
  41799. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  41800. this
  41801. },
  41802. setW: function(e, t) {
  41803. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  41804. this
  41805. },
  41806. getX: function(e) {
  41807. return this.data.array[e * this.data.stride + this.offset]
  41808. },
  41809. getY: function(e) {
  41810. return this.data.array[e * this.data.stride + this.offset + 1]
  41811. },
  41812. getZ: function(e) {
  41813. return this.data.array[e * this.data.stride + this.offset + 2]
  41814. },
  41815. getW: function(e) {
  41816. return this.data.array[e * this.data.stride + this.offset + 3]
  41817. },
  41818. setXY: function(e, t, i) {
  41819. return e = e * this.data.stride + this.offset,
  41820. this.data.array[e + 0] = t,
  41821. this.data.array[e + 1] = i,
  41822. this
  41823. },
  41824. setXYZ: function(e, t, i, n) {
  41825. return e = e * this.data.stride + this.offset,
  41826. this.data.array[e + 0] = t,
  41827. this.data.array[e + 1] = i,
  41828. this.data.array[e + 2] = n,
  41829. this
  41830. },
  41831. setXYZW: function(e, t, i, n, r) {
  41832. return e = e * this.data.stride + this.offset,
  41833. this.data.array[e + 0] = t,
  41834. this.data.array[e + 1] = i,
  41835. this.data.array[e + 2] = n,
  41836. this.data.array[e + 3] = r,
  41837. this
  41838. }
  41839. },
  41840. Ci.Geometry = function() {
  41841. Object.defineProperty(this, "id", {
  41842. value: Ci.GeometryIdCount++
  41843. }),
  41844. this.uuid = Ci.Math.generateUUID(),
  41845. this.name = "",
  41846. this.type = "Geometry",
  41847. this.vertices = [],
  41848. this.colors = [],
  41849. this.faces = [],
  41850. this.faceVertexUvs = [[]],
  41851. this.morphTargets = [],
  41852. this.morphNormals = [],
  41853. this.skinWeights = [],
  41854. this.skinIndices = [],
  41855. this.lineDistances = [],
  41856. this.boundingBox = null,
  41857. this.boundingSphere = null,
  41858. this.verticesNeedUpdate = !1,
  41859. this.elementsNeedUpdate = !1,
  41860. this.uvsNeedUpdate = !1,
  41861. this.normalsNeedUpdate = !1,
  41862. this.colorsNeedUpdate = !1,
  41863. this.lineDistancesNeedUpdate = !1,
  41864. this.groupsNeedUpdate = !1
  41865. }
  41866. ,
  41867. Ci.Geometry.prototype = {
  41868. constructor: Ci.Geometry,
  41869. applyMatrix: function(e) {
  41870. for (var t = (new Ci.Matrix3).getNormalMatrix(e), i = 0, n = this.vertices.length; i < n; i++) {
  41871. this.vertices[i].applyMatrix4(e)
  41872. }
  41873. for (i = 0,
  41874. n = this.faces.length; i < n; i++) {
  41875. var r = this.faces[i];
  41876. r.normal.applyMatrix3(t).normalize();
  41877. for (var o = 0, a = r.vertexNormals.length; o < a; o++)
  41878. r.vertexNormals[o].applyMatrix3(t).normalize()
  41879. }
  41880. return null !== this.boundingBox && this.computeBoundingBox(),
  41881. null !== this.boundingSphere && this.computeBoundingSphere(),
  41882. this.verticesNeedUpdate = !0,
  41883. this.normalsNeedUpdate = !0,
  41884. this
  41885. },
  41886. rotateX: function(e) {
  41887. return void 0 === mt && (mt = new Ci.Matrix4),
  41888. mt.makeRotationX(e),
  41889. this.applyMatrix(mt),
  41890. this
  41891. },
  41892. rotateY: function(e) {
  41893. return void 0 === gt && (gt = new Ci.Matrix4),
  41894. gt.makeRotationY(e),
  41895. this.applyMatrix(gt),
  41896. this
  41897. },
  41898. rotateZ: function(e) {
  41899. return void 0 === ft && (ft = new Ci.Matrix4),
  41900. ft.makeRotationZ(e),
  41901. this.applyMatrix(ft),
  41902. this
  41903. },
  41904. translate: function(e, t, i) {
  41905. return void 0 === pt && (pt = new Ci.Matrix4),
  41906. pt.makeTranslation(e, t, i),
  41907. this.applyMatrix(pt),
  41908. this
  41909. },
  41910. scale: function(e, t, i) {
  41911. return void 0 === dt && (dt = new Ci.Matrix4),
  41912. dt.makeScale(e, t, i),
  41913. this.applyMatrix(dt),
  41914. this
  41915. },
  41916. lookAt: function(e) {
  41917. void 0 === ut && (ut = new Ci.Object3D),
  41918. ut.lookAt(e),
  41919. ut.updateMatrix(),
  41920. this.applyMatrix(ut.matrix)
  41921. },
  41922. fromBufferGeometry: function(e) {
  41923. function t(e, t, i, n) {
  41924. var r = void 0 !== l ? [d[e].clone(), d[t].clone(), d[i].clone()] : []
  41925. , o = void 0 !== c ? [s.colors[e].clone(), s.colors[t].clone(), s.colors[i].clone()] : []
  41926. , a = new Ci.Face3(e,t,i,r,o,n);
  41927. s.faces.push(a),
  41928. void 0 !== h && s.faceVertexUvs[0].push([p[e].clone(), p[t].clone(), p[i].clone()]),
  41929. void 0 !== u && s.faceVertexUvs[1].push([f[e].clone(), f[t].clone(), f[i].clone()])
  41930. }
  41931. var s = this
  41932. , i = null !== e.index ? e.index.array : void 0
  41933. , n = e.attributes
  41934. , r = n.position.array
  41935. , l = void 0 !== n.normal ? n.normal.array : void 0
  41936. , c = void 0 !== n.color ? n.color.array : void 0
  41937. , h = void 0 !== n.uv ? n.uv.array : void 0
  41938. , u = void 0 !== n.uv2 ? n.uv2.array : void 0;
  41939. void 0 !== u && (this.faceVertexUvs[1] = []);
  41940. for (var d = [], p = [], f = [], o = 0, a = 0; o < r.length; o += 3,
  41941. a += 2)
  41942. s.vertices.push(new Ci.Vector3(r[o],r[o + 1],r[o + 2])),
  41943. void 0 !== l && d.push(new Ci.Vector3(l[o],l[o + 1],l[o + 2])),
  41944. void 0 !== c && s.colors.push(new Ci.Color(c[o],c[o + 1],c[o + 2])),
  41945. void 0 !== h && p.push(new Ci.Vector2(h[a],h[a + 1])),
  41946. void 0 !== u && f.push(new Ci.Vector2(u[a],u[a + 1]));
  41947. if (void 0 !== i) {
  41948. var g = e.groups;
  41949. if (0 < g.length)
  41950. for (o = 0; o < g.length; o++)
  41951. for (var m = g[o], v = m.start, y = (a = v,
  41952. v + m.count); a < y; a += 3)
  41953. t(i[a], i[a + 1], i[a + 2], m.materialIndex);
  41954. else
  41955. for (o = 0; o < i.length; o += 3)
  41956. t(i[o], i[o + 1], i[o + 2])
  41957. } else
  41958. for (o = 0; o < r.length / 3; o += 3)
  41959. t(o, o + 1, o + 2);
  41960. return this.computeFaceNormals(),
  41961. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  41962. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  41963. this
  41964. },
  41965. center: function() {
  41966. this.computeBoundingBox();
  41967. var e = this.boundingBox.center().negate();
  41968. return this.translate(e.x, e.y, e.z),
  41969. e
  41970. },
  41971. normalize: function() {
  41972. this.computeBoundingSphere();
  41973. var e = this.boundingSphere.center
  41974. , t = this.boundingSphere.radius
  41975. , i = 0 === t ? 1 : 1 / t
  41976. , n = new Ci.Matrix4;
  41977. 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),
  41978. this.applyMatrix(n),
  41979. this
  41980. },
  41981. computeFaceNormals: function() {
  41982. for (var e = new Ci.Vector3, t = new Ci.Vector3, i = 0, n = this.faces.length; i < n; i++) {
  41983. var r = this.faces[i]
  41984. , o = this.vertices[r.a]
  41985. , a = this.vertices[r.b]
  41986. , s = this.vertices[r.c];
  41987. e.subVectors(s, a),
  41988. t.subVectors(o, a),
  41989. e.cross(t),
  41990. e.normalize(),
  41991. r.normal.copy(e)
  41992. }
  41993. },
  41994. computeVertexNormals: function(e) {
  41995. var t, i, n, r, o, a;
  41996. for (void 0 === e && (e = !0),
  41997. a = new Array(this.vertices.length),
  41998. t = 0,
  41999. i = this.vertices.length; t < i; t++)
  42000. a[t] = new Ci.Vector3;
  42001. if (e) {
  42002. var s, l, c, h = new Ci.Vector3, u = new Ci.Vector3;
  42003. for (n = 0,
  42004. r = this.faces.length; n < r; n++)
  42005. o = this.faces[n],
  42006. s = this.vertices[o.a],
  42007. l = this.vertices[o.b],
  42008. c = this.vertices[o.c],
  42009. h.subVectors(c, l),
  42010. u.subVectors(s, l),
  42011. h.cross(u),
  42012. a[o.a].add(h),
  42013. a[o.b].add(h),
  42014. a[o.c].add(h)
  42015. } else
  42016. for (n = 0,
  42017. r = this.faces.length; n < r; n++)
  42018. a[(o = this.faces[n]).a].add(o.normal),
  42019. a[o.b].add(o.normal),
  42020. a[o.c].add(o.normal);
  42021. for (t = 0,
  42022. i = this.vertices.length; t < i; t++)
  42023. a[t].normalize();
  42024. for (n = 0,
  42025. r = this.faces.length; n < r; n++) {
  42026. var d = (o = this.faces[n]).vertexNormals;
  42027. 3 === d.length ? (d[0].copy(a[o.a]),
  42028. d[1].copy(a[o.b]),
  42029. d[2].copy(a[o.c])) : (d[0] = a[o.a].clone(),
  42030. d[1] = a[o.b].clone(),
  42031. d[2] = a[o.c].clone())
  42032. }
  42033. 0 < this.faces.length && (this.normalsNeedUpdate = !0)
  42034. },
  42035. computeMorphNormals: function() {
  42036. var e, t, i, n, r;
  42037. for (i = 0,
  42038. n = this.faces.length; i < n; i++)
  42039. for ((r = this.faces[i]).__originalFaceNormal ? r.__originalFaceNormal.copy(r.normal) : r.__originalFaceNormal = r.normal.clone(),
  42040. r.__originalVertexNormals || (r.__originalVertexNormals = []),
  42041. e = 0,
  42042. t = r.vertexNormals.length; e < t; e++)
  42043. r.__originalVertexNormals[e] ? r.__originalVertexNormals[e].copy(r.vertexNormals[e]) : r.__originalVertexNormals[e] = r.vertexNormals[e].clone();
  42044. var o = new Ci.Geometry;
  42045. for (o.faces = this.faces,
  42046. e = 0,
  42047. t = this.morphTargets.length; e < t; e++) {
  42048. if (!this.morphNormals[e]) {
  42049. this.morphNormals[e] = {},
  42050. this.morphNormals[e].faceNormals = [],
  42051. this.morphNormals[e].vertexNormals = [];
  42052. var a = this.morphNormals[e].faceNormals
  42053. , s = this.morphNormals[e].vertexNormals;
  42054. for (i = 0,
  42055. n = this.faces.length; i < n; i++)
  42056. l = new Ci.Vector3,
  42057. c = {
  42058. a: new Ci.Vector3,
  42059. b: new Ci.Vector3,
  42060. c: new Ci.Vector3
  42061. },
  42062. a.push(l),
  42063. s.push(c)
  42064. }
  42065. var l, c, h = this.morphNormals[e];
  42066. for (o.vertices = this.morphTargets[e].vertices,
  42067. o.computeFaceNormals(),
  42068. o.computeVertexNormals(),
  42069. i = 0,
  42070. n = this.faces.length; i < n; i++)
  42071. r = this.faces[i],
  42072. l = h.faceNormals[i],
  42073. c = h.vertexNormals[i],
  42074. l.copy(r.normal),
  42075. c.a.copy(r.vertexNormals[0]),
  42076. c.b.copy(r.vertexNormals[1]),
  42077. c.c.copy(r.vertexNormals[2])
  42078. }
  42079. for (i = 0,
  42080. n = this.faces.length; i < n; i++)
  42081. (r = this.faces[i]).normal = r.__originalFaceNormal,
  42082. r.vertexNormals = r.__originalVertexNormals
  42083. },
  42084. computeTangents: function() {
  42085. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  42086. },
  42087. computeLineDistances: function() {
  42088. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  42089. 0 < i && (e += t[i].distanceTo(t[i - 1])),
  42090. this.lineDistances[i] = e
  42091. },
  42092. computeBoundingBox: function() {
  42093. null === this.boundingBox && (this.boundingBox = new Ci.Box3),
  42094. this.boundingBox.setFromPoints(this.vertices)
  42095. },
  42096. computeBoundingSphere: function() {
  42097. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere),
  42098. this.boundingSphere.setFromPoints(this.vertices)
  42099. },
  42100. merge: function(e, t, i) {
  42101. if (e instanceof Ci.Geometry != 0) {
  42102. 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];
  42103. void 0 === i && (i = 0),
  42104. void 0 !== t && (n = (new Ci.Matrix3).getNormalMatrix(t));
  42105. for (var u = 0, d = a.length; u < d; u++) {
  42106. var p = a[u].clone();
  42107. void 0 !== t && p.applyMatrix4(t),
  42108. o.push(p)
  42109. }
  42110. for (u = 0,
  42111. d = l.length; u < d; u++) {
  42112. var f, g, m, v = l[u], y = v.vertexNormals, A = v.vertexColors;
  42113. (f = new Ci.Face3(v.a + r,v.b + r,v.c + r)).normal.copy(v.normal),
  42114. void 0 !== n && f.normal.applyMatrix3(n).normalize();
  42115. for (var C = 0, I = y.length; C < I; C++)
  42116. g = y[C].clone(),
  42117. void 0 !== n && g.applyMatrix3(n).normalize(),
  42118. f.vertexNormals.push(g);
  42119. f.color.copy(v.color);
  42120. for (C = 0,
  42121. I = A.length; C < I; C++)
  42122. m = A[C],
  42123. f.vertexColors.push(m.clone());
  42124. f.materialIndex = v.materialIndex + i,
  42125. s.push(f)
  42126. }
  42127. for (u = 0,
  42128. d = h.length; u < d; u++) {
  42129. var E = h[u]
  42130. , _ = [];
  42131. if (void 0 !== E) {
  42132. for (C = 0,
  42133. I = E.length; C < I; C++)
  42134. _.push(E[C].clone());
  42135. c.push(_)
  42136. }
  42137. }
  42138. } else
  42139. console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e)
  42140. },
  42141. mergeMesh: function(e) {
  42142. return e instanceof Ci.Mesh == 0 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  42143. void this.merge(e.geometry, e.matrix))
  42144. },
  42145. mergeVertices: function() {
  42146. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = Math.pow(10, 4);
  42147. for (i = 0,
  42148. n = this.vertices.length; i < n; i++)
  42149. e = this.vertices[i],
  42150. void 0 === l[t = Math.round(e.x * u) + "_" + Math.round(e.y * u) + "_" + Math.round(e.z * u)] ? (l[t] = i,
  42151. c.push(this.vertices[i]),
  42152. h[i] = c.length - 1) : h[i] = h[l[t]];
  42153. var d = [];
  42154. for (i = 0,
  42155. n = this.faces.length; i < n; i++) {
  42156. (r = this.faces[i]).a = h[r.a],
  42157. r.b = h[r.b],
  42158. r.c = h[r.c],
  42159. o = [r.a, r.b, r.c];
  42160. for (var p = 0; p < 3; p++)
  42161. if (o[p] === o[(p + 1) % 3]) {
  42162. p,
  42163. d.push(i);
  42164. break
  42165. }
  42166. }
  42167. for (i = d.length - 1; 0 <= i; i--) {
  42168. var f = d[i];
  42169. for (this.faces.splice(f, 1),
  42170. a = 0,
  42171. s = this.faceVertexUvs.length; a < s; a++)
  42172. this.faceVertexUvs[a].splice(f, 1)
  42173. }
  42174. var g = this.vertices.length - c.length;
  42175. return this.vertices = c,
  42176. g
  42177. },
  42178. sortFacesByMaterialIndex: function() {
  42179. for (var e = this.faces, t = e.length, i = 0; i < t; i++)
  42180. e[i]._id = i;
  42181. e.sort(function(e, t) {
  42182. return e.materialIndex - t.materialIndex
  42183. });
  42184. var n, r, o = this.faceVertexUvs[0], a = this.faceVertexUvs[1];
  42185. o && o.length === t && (n = []),
  42186. a && a.length === t && (r = []);
  42187. for (i = 0; i < t; i++) {
  42188. var s = e[i]._id;
  42189. n && n.push(o[s]),
  42190. r && r.push(a[s])
  42191. }
  42192. n && (this.faceVertexUvs[0] = n),
  42193. r && (this.faceVertexUvs[1] = r)
  42194. },
  42195. toJSON: function() {
  42196. function e(e, t, i) {
  42197. return i ? e | 1 << t : e & ~(1 << t)
  42198. }
  42199. function t(e) {
  42200. var t = e.x.toString() + e.y.toString() + e.z.toString();
  42201. return void 0 !== d[t] || (d[t] = u.length / 3,
  42202. u.push(e.x, e.y, e.z)),
  42203. d[t]
  42204. }
  42205. function i(e) {
  42206. var t = e.r.toString() + e.g.toString() + e.b.toString();
  42207. return void 0 !== f[t] || (f[t] = p.length,
  42208. p.push(e.getHex())),
  42209. f[t]
  42210. }
  42211. function n(e) {
  42212. var t = e.x.toString() + e.y.toString();
  42213. return void 0 !== m[t] || (m[t] = g.length / 2,
  42214. g.push(e.x, e.y)),
  42215. m[t]
  42216. }
  42217. var r = {
  42218. metadata: {
  42219. version: 4.4,
  42220. type: "Geometry",
  42221. generator: "Geometry.toJSON"
  42222. }
  42223. };
  42224. if (r.uuid = this.uuid,
  42225. r.type = this.type,
  42226. "" !== this.name && (r.name = this.name),
  42227. void 0 !== this.parameters) {
  42228. var o = this.parameters;
  42229. for (var a in o)
  42230. void 0 !== o[a] && (r[a] = o[a]);
  42231. return r
  42232. }
  42233. for (var s = [], l = 0; l < this.vertices.length; l++) {
  42234. var c = this.vertices[l];
  42235. s.push(c.x, c.y, c.z)
  42236. }
  42237. var h = []
  42238. , u = []
  42239. , d = {}
  42240. , p = []
  42241. , f = {}
  42242. , g = []
  42243. , m = {};
  42244. for (l = 0; l < this.faces.length; l++) {
  42245. var v = this.faces[l]
  42246. , y = void 0 !== this.faceVertexUvs[0][l]
  42247. , A = 0 < v.normal.length()
  42248. , C = 0 < v.vertexNormals.length
  42249. , I = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  42250. , E = 0 < v.vertexColors.length
  42251. , _ = 0;
  42252. 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),
  42253. h.push(_),
  42254. h.push(v.a, v.b, v.c),
  42255. h.push(v.materialIndex),
  42256. y) {
  42257. var b = this.faceVertexUvs[0][l];
  42258. h.push(n(b[0]), n(b[1]), n(b[2]))
  42259. }
  42260. if (A && h.push(t(v.normal)),
  42261. C) {
  42262. var w = v.vertexNormals;
  42263. h.push(t(w[0]), t(w[1]), t(w[2]))
  42264. }
  42265. if (I && h.push(i(v.color)),
  42266. E) {
  42267. var T = v.vertexColors;
  42268. h.push(i(T[0]), i(T[1]), i(T[2]))
  42269. }
  42270. }
  42271. return r.data = {},
  42272. r.data.vertices = s,
  42273. r.data.normals = u,
  42274. 0 < p.length && (r.data.colors = p),
  42275. 0 < g.length && (r.data.uvs = [g]),
  42276. r.data.faces = h,
  42277. r
  42278. },
  42279. clone: function() {
  42280. return (new Ci.Geometry).copy(this)
  42281. },
  42282. copy: function(e) {
  42283. this.vertices = [],
  42284. this.faces = [],
  42285. this.faceVertexUvs = [[]];
  42286. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  42287. this.vertices.push(t[i].clone());
  42288. var r = e.faces;
  42289. for (i = 0,
  42290. n = r.length; i < n; i++)
  42291. this.faces.push(r[i].clone());
  42292. for (i = 0,
  42293. n = e.faceVertexUvs.length; i < n; i++) {
  42294. var o = e.faceVertexUvs[i];
  42295. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  42296. for (var a = 0, s = o.length; a < s; a++) {
  42297. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  42298. var d = l[h];
  42299. c.push(d.clone())
  42300. }
  42301. this.faceVertexUvs[i].push(c)
  42302. }
  42303. }
  42304. return this
  42305. },
  42306. dispose: function() {
  42307. this.dispatchEvent({
  42308. type: "dispose"
  42309. })
  42310. }
  42311. },
  42312. Ci.EventDispatcher.prototype.apply(Ci.Geometry.prototype),
  42313. Ci.GeometryIdCount = 0,
  42314. Ci.DirectGeometry = function() {
  42315. Object.defineProperty(this, "id", {
  42316. value: Ci.GeometryIdCount++
  42317. }),
  42318. this.uuid = Ci.Math.generateUUID(),
  42319. this.name = "",
  42320. this.type = "DirectGeometry",
  42321. this.indices = [],
  42322. this.vertices = [],
  42323. this.normals = [],
  42324. this.colors = [],
  42325. this.uvs = [],
  42326. this.uvs2 = [],
  42327. this.groups = [],
  42328. this.morphTargets = {},
  42329. this.skinWeights = [],
  42330. this.skinIndices = [],
  42331. this.boundingBox = null,
  42332. this.boundingSphere = null,
  42333. this.verticesNeedUpdate = !1,
  42334. this.normalsNeedUpdate = !1,
  42335. this.colorsNeedUpdate = !1,
  42336. this.uvsNeedUpdate = !1,
  42337. this.groupsNeedUpdate = !1
  42338. }
  42339. ,
  42340. Ci.DirectGeometry.prototype = {
  42341. constructor: Ci.DirectGeometry,
  42342. computeBoundingBox: Ci.Geometry.prototype.computeBoundingBox,
  42343. computeBoundingSphere: Ci.Geometry.prototype.computeBoundingSphere,
  42344. computeFaceNormals: function() {
  42345. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  42346. },
  42347. computeVertexNormals: function() {
  42348. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  42349. },
  42350. computeGroups: function(e) {
  42351. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  42352. var a = r[o];
  42353. a.materialIndex !== i && (i = a.materialIndex,
  42354. void 0 !== t && (t.count = 3 * o - t.start,
  42355. n.push(t)),
  42356. t = {
  42357. start: 3 * o,
  42358. materialIndex: i
  42359. })
  42360. }
  42361. void 0 !== t && (t.count = 3 * o - t.start,
  42362. n.push(t)),
  42363. this.groups = n
  42364. },
  42365. fromGeometry: function(e) {
  42366. 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;
  42367. if (0 < l) {
  42368. t = [];
  42369. for (var c = 0; c < l; c++)
  42370. t[c] = [];
  42371. this.morphTargets.position = t
  42372. }
  42373. var h, u = e.morphNormals, d = u.length;
  42374. if (0 < d) {
  42375. h = [];
  42376. for (c = 0; c < d; c++)
  42377. h[c] = [];
  42378. this.morphTargets.normal = h
  42379. }
  42380. var p = e.skinIndices
  42381. , f = e.skinWeights
  42382. , g = p.length === n.length
  42383. , m = f.length === n.length;
  42384. for (c = 0; c < i.length; c++) {
  42385. var v = i[c];
  42386. this.vertices.push(n[v.a], n[v.b], n[v.c]);
  42387. var y = v.vertexNormals;
  42388. if (3 === y.length)
  42389. this.normals.push(y[0], y[1], y[2]);
  42390. else {
  42391. var A = v.normal;
  42392. this.normals.push(A, A, A)
  42393. }
  42394. var C, I = v.vertexColors;
  42395. if (3 === I.length)
  42396. this.colors.push(I[0], I[1], I[2]);
  42397. else {
  42398. var E = v.color;
  42399. this.colors.push(E, E, E)
  42400. }
  42401. if (!0 === o)
  42402. void 0 !== (C = r[0][c]) ? this.uvs.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", c),
  42403. this.uvs.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42404. if (!0 === a)
  42405. void 0 !== (C = r[1][c]) ? this.uvs2.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", c),
  42406. this.uvs2.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42407. for (var _ = 0; _ < l; _++) {
  42408. var b = s[_].vertices;
  42409. t[_].push(b[v.a], b[v.b], b[v.c])
  42410. }
  42411. for (_ = 0; _ < d; _++) {
  42412. var w = u[_].vertexNormals[c];
  42413. h[_].push(w.a, w.b, w.c)
  42414. }
  42415. g && this.skinIndices.push(p[v.a], p[v.b], p[v.c]),
  42416. m && this.skinWeights.push(f[v.a], f[v.b], f[v.c])
  42417. }
  42418. return this.computeGroups(e),
  42419. this.verticesNeedUpdate = e.verticesNeedUpdate,
  42420. this.normalsNeedUpdate = e.normalsNeedUpdate,
  42421. this.colorsNeedUpdate = e.colorsNeedUpdate,
  42422. this.uvsNeedUpdate = e.uvsNeedUpdate,
  42423. this.groupsNeedUpdate = e.groupsNeedUpdate,
  42424. this
  42425. },
  42426. dispose: function() {
  42427. this.dispatchEvent({
  42428. type: "dispose"
  42429. })
  42430. }
  42431. },
  42432. Ci.EventDispatcher.prototype.apply(Ci.DirectGeometry.prototype),
  42433. Ci.BufferGeometry = function() {
  42434. Object.defineProperty(this, "id", {
  42435. value: Ci.GeometryIdCount++
  42436. }),
  42437. this.uuid = Ci.Math.generateUUID(),
  42438. this.name = "",
  42439. this.type = "BufferGeometry",
  42440. this.index = null,
  42441. this.attributes = {},
  42442. this.morphAttributes = {},
  42443. this.groups = [],
  42444. this.boundingBox = null,
  42445. this.boundingSphere = null,
  42446. this.drawRange = {
  42447. start: 0,
  42448. count: 1 / 0
  42449. }
  42450. }
  42451. ,
  42452. Ci.BufferGeometry.prototype = {
  42453. constructor: Ci.BufferGeometry,
  42454. getIndex: function() {
  42455. return this.index
  42456. },
  42457. setIndex: function(e) {
  42458. this.index = e
  42459. },
  42460. addAttribute: function(e, t) {
  42461. return t instanceof Ci.BufferAttribute == 0 && t instanceof Ci.InterleavedBufferAttribute == 0 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  42462. void this.addAttribute(e, new Ci.BufferAttribute(t,arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  42463. void this.setIndex(t)) : (this.attributes[e] = t,
  42464. this)
  42465. },
  42466. getAttribute: function(e) {
  42467. return this.attributes[e]
  42468. },
  42469. removeAttribute: function(e) {
  42470. return delete this.attributes[e],
  42471. this
  42472. },
  42473. addGroup: function(e, t, i) {
  42474. this.groups.push({
  42475. start: e,
  42476. count: t,
  42477. materialIndex: void 0 !== i ? i : 0
  42478. })
  42479. },
  42480. clearGroups: function() {
  42481. this.groups = []
  42482. },
  42483. setDrawRange: function(e, t) {
  42484. this.drawRange.start = e,
  42485. this.drawRange.count = t
  42486. },
  42487. applyMatrix: function(e) {
  42488. var t = this.attributes.position;
  42489. void 0 !== t && (e.applyToVector3Array(t.array),
  42490. t.needsUpdate = !0);
  42491. var i = this.attributes.normal;
  42492. void 0 !== i && ((new Ci.Matrix3).getNormalMatrix(e).applyToVector3Array(i.array),
  42493. i.needsUpdate = !0);
  42494. return null !== this.boundingBox && this.computeBoundingBox(),
  42495. null !== this.boundingSphere && this.computeBoundingSphere(),
  42496. this
  42497. },
  42498. rotateX: function(e) {
  42499. return void 0 === ht && (ht = new Ci.Matrix4),
  42500. ht.makeRotationX(e),
  42501. this.applyMatrix(ht),
  42502. this
  42503. },
  42504. rotateY: function(e) {
  42505. return void 0 === ct && (ct = new Ci.Matrix4),
  42506. ct.makeRotationY(e),
  42507. this.applyMatrix(ct),
  42508. this
  42509. },
  42510. rotateZ: function(e) {
  42511. return void 0 === lt && (lt = new Ci.Matrix4),
  42512. lt.makeRotationZ(e),
  42513. this.applyMatrix(lt),
  42514. this
  42515. },
  42516. translate: function(e, t, i) {
  42517. return void 0 === st && (st = new Ci.Matrix4),
  42518. st.makeTranslation(e, t, i),
  42519. this.applyMatrix(st),
  42520. this
  42521. },
  42522. scale: function(e, t, i) {
  42523. return void 0 === at && (at = new Ci.Matrix4),
  42524. at.makeScale(e, t, i),
  42525. this.applyMatrix(at),
  42526. this
  42527. },
  42528. lookAt: function(e) {
  42529. void 0 === ot && (ot = new Ci.Object3D),
  42530. ot.lookAt(e),
  42531. ot.updateMatrix(),
  42532. this.applyMatrix(ot.matrix)
  42533. },
  42534. center: function() {
  42535. this.computeBoundingBox();
  42536. var e = this.boundingBox.center().negate();
  42537. return this.translate(e.x, e.y, e.z),
  42538. e
  42539. },
  42540. setFromObject: function(e) {
  42541. var t = e.geometry;
  42542. if (e instanceof Ci.Points || e instanceof Ci.Line) {
  42543. var i = new Ci.Float32Attribute(3 * t.vertices.length,3)
  42544. , n = new Ci.Float32Attribute(3 * t.colors.length,3);
  42545. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  42546. this.addAttribute("color", n.copyColorsArray(t.colors)),
  42547. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  42548. var r = new Ci.Float32Attribute(t.lineDistances.length,1);
  42549. this.addAttribute("lineDistance", r.copyArray(t.lineDistances))
  42550. }
  42551. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  42552. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  42553. } else
  42554. e instanceof Ci.Mesh && t instanceof Ci.Geometry && this.fromGeometry(t);
  42555. return this
  42556. },
  42557. updateFromObject: function(e) {
  42558. var t, i = e.geometry;
  42559. if (e instanceof Ci.Mesh) {
  42560. var n = i.__directGeometry;
  42561. if (void 0 === n)
  42562. return this.fromGeometry(i);
  42563. n.verticesNeedUpdate = i.verticesNeedUpdate,
  42564. n.normalsNeedUpdate = i.normalsNeedUpdate,
  42565. n.colorsNeedUpdate = i.colorsNeedUpdate,
  42566. n.uvsNeedUpdate = i.uvsNeedUpdate,
  42567. n.groupsNeedUpdate = i.groupsNeedUpdate,
  42568. i.verticesNeedUpdate = !1,
  42569. i.normalsNeedUpdate = !1,
  42570. i.colorsNeedUpdate = !1,
  42571. i.uvsNeedUpdate = !1,
  42572. i.groupsNeedUpdate = !1,
  42573. i = n
  42574. }
  42575. !0 === i.verticesNeedUpdate && (void 0 !== (t = this.attributes.position) && (t.copyVector3sArray(i.vertices),
  42576. t.needsUpdate = !0),
  42577. i.verticesNeedUpdate = !1);
  42578. !0 === i.normalsNeedUpdate && (void 0 !== (t = this.attributes.normal) && (t.copyVector3sArray(i.normals),
  42579. t.needsUpdate = !0),
  42580. i.normalsNeedUpdate = !1);
  42581. !0 === i.colorsNeedUpdate && (void 0 !== (t = this.attributes.color) && (t.copyColorsArray(i.colors),
  42582. t.needsUpdate = !0),
  42583. i.colorsNeedUpdate = !1);
  42584. i.uvsNeedUpdate && (void 0 !== (t = this.attributes.uv) && (t.copyVector2sArray(i.uvs),
  42585. t.needsUpdate = !0),
  42586. i.uvsNeedUpdate = !1);
  42587. i.lineDistancesNeedUpdate && (void 0 !== (t = this.attributes.lineDistance) && (t.copyArray(i.lineDistances),
  42588. t.needsUpdate = !0),
  42589. i.lineDistancesNeedUpdate = !1);
  42590. return i.groupsNeedUpdate && (i.computeGroups(e.geometry),
  42591. this.groups = i.groups,
  42592. i.groupsNeedUpdate = !1),
  42593. this
  42594. },
  42595. fromGeometry: function(e) {
  42596. return e.__directGeometry = (new Ci.DirectGeometry).fromGeometry(e),
  42597. this.fromDirectGeometry(e.__directGeometry)
  42598. },
  42599. fromDirectGeometry: function(e) {
  42600. var t = new Float32Array(3 * e.vertices.length);
  42601. if (this.addAttribute("position", new Ci.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  42602. 0 < e.normals.length) {
  42603. var i = new Float32Array(3 * e.normals.length);
  42604. this.addAttribute("normal", new Ci.BufferAttribute(i,3).copyVector3sArray(e.normals))
  42605. }
  42606. if (0 < e.colors.length) {
  42607. var n = new Float32Array(3 * e.colors.length);
  42608. this.addAttribute("color", new Ci.BufferAttribute(n,3).copyColorsArray(e.colors))
  42609. }
  42610. if (0 < e.uvs.length) {
  42611. var r = new Float32Array(2 * e.uvs.length);
  42612. this.addAttribute("uv", new Ci.BufferAttribute(r,2).copyVector2sArray(e.uvs))
  42613. }
  42614. if (0 < e.uvs2.length) {
  42615. var o = new Float32Array(2 * e.uvs2.length);
  42616. this.addAttribute("uv2", new Ci.BufferAttribute(o,2).copyVector2sArray(e.uvs2))
  42617. }
  42618. if (0 < e.indices.length) {
  42619. var a = new (65535 < e.vertices.length ? Uint32Array : Uint16Array)(3 * e.indices.length);
  42620. this.setIndex(new Ci.BufferAttribute(a,1).copyIndicesArray(e.indices))
  42621. }
  42622. for (var s in this.groups = e.groups,
  42623. e.morphTargets) {
  42624. for (var l = [], c = e.morphTargets[s], h = 0, u = c.length; h < u; h++) {
  42625. var d = c[h]
  42626. , p = new Ci.Float32Attribute(3 * d.length,3);
  42627. l.push(p.copyVector3sArray(d))
  42628. }
  42629. this.morphAttributes[s] = l
  42630. }
  42631. if (0 < e.skinIndices.length) {
  42632. var f = new Ci.Float32Attribute(4 * e.skinIndices.length,4);
  42633. this.addAttribute("skinIndex", f.copyVector4sArray(e.skinIndices))
  42634. }
  42635. if (0 < e.skinWeights.length) {
  42636. var g = new Ci.Float32Attribute(4 * e.skinWeights.length,4);
  42637. this.addAttribute("skinWeight", g.copyVector4sArray(e.skinWeights))
  42638. }
  42639. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42640. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42641. this
  42642. },
  42643. computeBoundingBox: (new Ci.Vector3,
  42644. function() {
  42645. null === this.boundingBox && (this.boundingBox = new Ci.Box3);
  42646. var e = this.attributes.position.array;
  42647. e && this.boundingBox.setFromArray(e),
  42648. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  42649. this.boundingBox.max.set(0, 0, 0)),
  42650. (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)
  42651. }
  42652. ),
  42653. computeBoundingSphere: (nt = new Ci.Box3,
  42654. rt = new Ci.Vector3,
  42655. function() {
  42656. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere);
  42657. var e = this.attributes.position.array;
  42658. if (e) {
  42659. var t = this.boundingSphere.center;
  42660. nt.setFromArray(e),
  42661. nt.center(t);
  42662. for (var i = 0, n = 0, r = e.length; n < r; n += 3)
  42663. rt.fromArray(e, n),
  42664. i = Math.max(i, t.distanceToSquared(rt));
  42665. this.boundingSphere.radius = Math.sqrt(i),
  42666. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  42667. }
  42668. }
  42669. ),
  42670. computeFaceNormals: function() {},
  42671. computeVertexNormals: function() {
  42672. var e = this.index
  42673. , t = this.attributes
  42674. , i = this.groups;
  42675. if (t.position) {
  42676. var n = t.position.array;
  42677. if (void 0 === t.normal)
  42678. this.addAttribute("normal", new Ci.BufferAttribute(new Float32Array(n.length),3));
  42679. else
  42680. for (var r = t.normal.array, o = 0, a = r.length; o < a; o++)
  42681. r[o] = 0;
  42682. 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;
  42683. if (e) {
  42684. var m = e.array;
  42685. 0 === i.length && this.addGroup(0, m.length);
  42686. for (var v = 0, y = i.length; v < y; ++v) {
  42687. var A = i[v]
  42688. , C = A.start;
  42689. for (o = C,
  42690. a = C + A.count; o < a; o += 3)
  42691. s = 3 * m[o + 0],
  42692. l = 3 * m[o + 1],
  42693. c = 3 * m[o + 2],
  42694. u.fromArray(n, s),
  42695. d.fromArray(n, l),
  42696. p.fromArray(n, c),
  42697. f.subVectors(p, d),
  42698. g.subVectors(u, d),
  42699. f.cross(g),
  42700. h[s] += f.x,
  42701. h[1 + s] += f.y,
  42702. h[2 + s] += f.z,
  42703. h[l] += f.x,
  42704. h[1 + l] += f.y,
  42705. h[2 + l] += f.z,
  42706. h[c] += f.x,
  42707. h[1 + c] += f.y,
  42708. h[2 + c] += f.z
  42709. }
  42710. } else
  42711. for (o = 0,
  42712. a = n.length; o < a; o += 9)
  42713. u.fromArray(n, o),
  42714. d.fromArray(n, o + 3),
  42715. p.fromArray(n, o + 6),
  42716. f.subVectors(p, d),
  42717. g.subVectors(u, d),
  42718. f.cross(g),
  42719. h[o] = f.x,
  42720. h[o + 1] = f.y,
  42721. h[o + 2] = f.z,
  42722. h[o + 3] = f.x,
  42723. h[o + 4] = f.y,
  42724. h[o + 5] = f.z,
  42725. h[o + 6] = f.x,
  42726. h[o + 7] = f.y,
  42727. h[o + 8] = f.z;
  42728. this.normalizeNormals(),
  42729. t.normal.needsUpdate = !0
  42730. }
  42731. },
  42732. merge: function(e, t) {
  42733. if (e instanceof Ci.BufferGeometry != 0) {
  42734. void 0 === t && (t = 0);
  42735. var i = this.attributes;
  42736. for (var n in i)
  42737. if (void 0 !== e.attributes[n])
  42738. for (var r = i[n].array, o = e.attributes[n], a = o.array, s = 0, l = o.itemSize * t; s < a.length; s++,
  42739. l++)
  42740. r[l] = a[s];
  42741. return this
  42742. }
  42743. console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e)
  42744. },
  42745. normalizeNormals: function() {
  42746. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  42747. e = r[o],
  42748. t = r[o + 1],
  42749. i = r[o + 2],
  42750. n = 1 / Math.sqrt(e * e + t * t + i * i),
  42751. r[o] *= n,
  42752. r[o + 1] *= n,
  42753. r[o + 2] *= n
  42754. },
  42755. toNonIndexed: function() {
  42756. if (null === this.index)
  42757. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  42758. this;
  42759. var e = new Ci.BufferGeometry
  42760. , t = this.index.array
  42761. , i = this.attributes;
  42762. for (var n in i) {
  42763. 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++) {
  42764. l = t[h] * a;
  42765. for (var d = 0; d < a; d++)
  42766. s[c++] = o[l++]
  42767. }
  42768. e.addAttribute(n, new Ci.BufferAttribute(s,a))
  42769. }
  42770. return e
  42771. },
  42772. toJSON: function() {
  42773. var e = {
  42774. metadata: {
  42775. version: 4.4,
  42776. type: "BufferGeometry",
  42777. generator: "BufferGeometry.toJSON"
  42778. }
  42779. };
  42780. if (e.uuid = this.uuid,
  42781. e.type = this.type,
  42782. "" !== this.name && (e.name = this.name),
  42783. void 0 !== this.parameters) {
  42784. var t = this.parameters;
  42785. for (var i in t)
  42786. void 0 !== t[i] && (e[i] = t[i]);
  42787. return e
  42788. }
  42789. e.data = {
  42790. attributes: {}
  42791. };
  42792. var n = this.index;
  42793. if (null !== n) {
  42794. var r = Array.prototype.slice.call(n.array);
  42795. e.data.index = {
  42796. type: n.array.constructor.name,
  42797. array: r
  42798. }
  42799. }
  42800. var o = this.attributes;
  42801. for (var i in o) {
  42802. var a = o[i];
  42803. r = Array.prototype.slice.call(a.array);
  42804. e.data.attributes[i] = {
  42805. itemSize: a.itemSize,
  42806. type: a.array.constructor.name,
  42807. array: r
  42808. }
  42809. }
  42810. var s = this.groups;
  42811. 0 < s.length && (e.data.groups = JSON.parse(JSON.stringify(s)));
  42812. var l = this.boundingSphere;
  42813. return null !== l && (e.data.boundingSphere = {
  42814. center: l.center.toArray(),
  42815. radius: l.radius
  42816. }),
  42817. e
  42818. },
  42819. clone: function() {
  42820. return (new Ci.BufferGeometry).copy(this)
  42821. },
  42822. copy: function(e) {
  42823. var t = e.index;
  42824. null !== t && this.setIndex(t.clone());
  42825. var i = e.attributes;
  42826. for (var n in i) {
  42827. var r = i[n];
  42828. this.addAttribute(n, r.clone())
  42829. }
  42830. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42831. var l = o[a];
  42832. this.addGroup(l.start, l.count)
  42833. }
  42834. return this
  42835. },
  42836. dispose: function() {
  42837. this.dispatchEvent({
  42838. type: "dispose"
  42839. })
  42840. }
  42841. },
  42842. Ci.EventDispatcher.prototype.apply(Ci.BufferGeometry.prototype),
  42843. Ci.BufferGeometry.MaxIndex = 65535,
  42844. Ci.InstancedBufferGeometry = function() {
  42845. Ci.BufferGeometry.call(this),
  42846. this.type = "InstancedBufferGeometry",
  42847. this.maxInstancedCount = void 0
  42848. }
  42849. ,
  42850. Ci.InstancedBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  42851. Ci.InstancedBufferGeometry.prototype.constructor = Ci.InstancedBufferGeometry,
  42852. Ci.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  42853. this.groups.push({
  42854. start: e,
  42855. count: t,
  42856. instances: i
  42857. })
  42858. }
  42859. ,
  42860. Ci.InstancedBufferGeometry.prototype.copy = function(e) {
  42861. var t = e.index;
  42862. null !== t && this.setIndex(t.clone());
  42863. var i = e.attributes;
  42864. for (var n in i) {
  42865. var r = i[n];
  42866. this.addAttribute(n, r.clone())
  42867. }
  42868. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42869. var l = o[a];
  42870. this.addGroup(l.start, l.count, l.instances)
  42871. }
  42872. return this
  42873. }
  42874. ,
  42875. Ci.EventDispatcher.prototype.apply(Ci.InstancedBufferGeometry.prototype),
  42876. Ci.Uniform = function(e, t) {
  42877. this.type = e,
  42878. this.value = t,
  42879. this.dynamic = !1
  42880. }
  42881. ,
  42882. Ci.Uniform.prototype = {
  42883. constructor: Ci.Uniform,
  42884. onUpdate: function(e) {
  42885. return this.dynamic = !0,
  42886. this.onUpdateCallback = e,
  42887. this
  42888. }
  42889. },
  42890. Ci.AnimationClip = function(e, t, i) {
  42891. this.name = e || Ci.Math.generateUUID(),
  42892. this.tracks = i,
  42893. this.duration = void 0 !== t ? t : -1,
  42894. this.duration < 0 && this.resetDuration(),
  42895. this.trim(),
  42896. this.optimize()
  42897. }
  42898. ,
  42899. Ci.AnimationClip.prototype = {
  42900. constructor: Ci.AnimationClip,
  42901. resetDuration: function() {
  42902. for (var e = 0, t = 0, i = this.tracks.length; t !== i; ++t) {
  42903. var n = this.tracks[t];
  42904. e = Math.max(e, n.times[n.times.length - 1])
  42905. }
  42906. this.duration = e
  42907. },
  42908. trim: function() {
  42909. for (var e = 0; e < this.tracks.length; e++)
  42910. this.tracks[e].trim(0, this.duration);
  42911. return this
  42912. },
  42913. optimize: function() {
  42914. for (var e = 0; e < this.tracks.length; e++)
  42915. this.tracks[e].optimize();
  42916. return this
  42917. }
  42918. },
  42919. Object.assign(Ci.AnimationClip, {
  42920. parse: function(e) {
  42921. for (var t = [], i = e.tracks, n = 1 / (e.fps || 1), r = 0, o = i.length; r !== o; ++r)
  42922. t.push(Ci.KeyframeTrack.parse(i[r]).scale(n));
  42923. return new Ci.AnimationClip(e.name,e.duration,t)
  42924. },
  42925. toJSON: function(e) {
  42926. for (var t = [], i = e.tracks, n = {
  42927. name: e.name,
  42928. duration: e.duration,
  42929. tracks: t
  42930. }, r = 0, o = i.length; r !== o; ++r)
  42931. t.push(Ci.KeyframeTrack.toJSON(i[r]));
  42932. return n
  42933. },
  42934. CreateFromMorphTargetSequence: function(e, t, i) {
  42935. for (var n = t.length, r = [], o = 0; o < n; o++) {
  42936. var a = []
  42937. , s = [];
  42938. a.push((o + n - 1) % n, o, (o + 1) % n),
  42939. s.push(0, 1, 0);
  42940. var l = Ci.AnimationUtils.getKeyframeOrder(a);
  42941. a = Ci.AnimationUtils.sortedArray(a, 1, l),
  42942. s = Ci.AnimationUtils.sortedArray(s, 1, l),
  42943. 0 === a[0] && (a.push(n),
  42944. s.push(s[0])),
  42945. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluences[" + t[o].name + "]",a,s).scale(1 / i))
  42946. }
  42947. return new Ci.AnimationClip(e,-1,r)
  42948. },
  42949. findByName: function(e, t) {
  42950. for (var i = 0; i < e.length; i++)
  42951. if (e[i].name === t)
  42952. return e[i];
  42953. return null
  42954. },
  42955. CreateClipsFromMorphTargetSequences: function(e, t) {
  42956. for (var i = {}, n = /^([\w-]*?)([\d]+)$/, r = 0, o = e.length; r < o; r++) {
  42957. var a = e[r]
  42958. , s = a.name.match(n);
  42959. if (s && 1 < s.length) {
  42960. var l = i[h = s[1]];
  42961. l || (i[h] = l = []),
  42962. l.push(a)
  42963. }
  42964. }
  42965. var c = [];
  42966. for (var h in i)
  42967. c.push(Ci.AnimationClip.CreateFromMorphTargetSequence(h, i[h], t));
  42968. return c
  42969. },
  42970. parseAnimation: function(e, t, i) {
  42971. if (!e)
  42972. return console.error(" no animation in JSONLoader data"),
  42973. null;
  42974. function n(e, t, i, n, r) {
  42975. if (0 !== i.length) {
  42976. var o = []
  42977. , a = [];
  42978. Ci.AnimationUtils.flattenJSON(i, o, a, n),
  42979. 0 !== o.length && r.push(new e(t,o,a))
  42980. }
  42981. }
  42982. for (var r = [], o = e.name || "default", a = e.length || -1, s = e.fps || 30, l = e.hierarchy || [], c = 0; c < l.length; c++) {
  42983. var h = l[c].keys;
  42984. if (h && 0 != h.length)
  42985. if (h[0].morphTargets) {
  42986. for (var u = {}, d = 0; d < h.length; d++)
  42987. if (h[d].morphTargets)
  42988. for (var p = 0; p < h[d].morphTargets.length; p++)
  42989. u[h[d].morphTargets[p]] = -1;
  42990. for (var f in u) {
  42991. var g = []
  42992. , m = [];
  42993. for (p = 0; p !== h[d].morphTargets.length; ++p) {
  42994. var v = h[d];
  42995. g.push(v.time),
  42996. m.push(v.morphTarget === f ? 1 : 0)
  42997. }
  42998. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluence[" + f + "]",g,m))
  42999. }
  43000. a = u.length * (s || 1)
  43001. } else {
  43002. var y = ".bones[" + t[c].name + "]";
  43003. n(Ci.VectorKeyframeTrack, y + ".position", h, "pos", r),
  43004. n(Ci.QuaternionKeyframeTrack, y + ".quaternion", h, "rot", r),
  43005. n(Ci.VectorKeyframeTrack, y + ".scale", h, "scl", r)
  43006. }
  43007. }
  43008. return 0 === r.length ? null : new Ci.AnimationClip(o,a,r)
  43009. }
  43010. }),
  43011. Ci.AnimationMixer = function(e) {
  43012. this._root = e,
  43013. this._initMemoryManager(),
  43014. this._accuIndex = 0,
  43015. this.time = 0,
  43016. this.timeScale = 1
  43017. }
  43018. ,
  43019. Ci.AnimationMixer.prototype = {
  43020. constructor: Ci.AnimationMixer,
  43021. clipAction: function(e, t) {
  43022. var i, n = (t || this._root).uuid, r = "string" == typeof e ? e : e.name, o = e !== r ? e : null, a = this._actionsByClip[r];
  43023. if (void 0 !== a) {
  43024. var s = a.actionByRoot[n];
  43025. if (void 0 !== s)
  43026. return s;
  43027. if (o = (i = a.knownActions[0])._clip,
  43028. e !== r && e !== o)
  43029. throw new Error("Different clips with the same name detected!")
  43030. }
  43031. if (null === o)
  43032. return null;
  43033. var l = new Ci.AnimationMixer._Action(this,o,t);
  43034. return this._bindAction(l, i),
  43035. this._addInactiveAction(l, r, n),
  43036. l
  43037. },
  43038. existingAction: function(e, t) {
  43039. var i = (t || this._root).uuid
  43040. , n = "string" == typeof e ? e : e.name
  43041. , r = this._actionsByClip[n];
  43042. return void 0 !== r && r.actionByRoot[i] || null
  43043. },
  43044. stopAllAction: function() {
  43045. var e = this._actions
  43046. , t = this._nActiveActions
  43047. , i = this._bindings
  43048. , n = this._nActiveBindings;
  43049. this._nActiveActions = 0;
  43050. for (var r = this._nActiveBindings = 0; r !== t; ++r)
  43051. e[r].reset();
  43052. for (r = 0; r !== n; ++r)
  43053. i[r].useCount = 0;
  43054. return this
  43055. },
  43056. update: function(e) {
  43057. e *= this.timeScale;
  43058. 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) {
  43059. var s = t[a];
  43060. s.enabled && s._update(n, e, r, o)
  43061. }
  43062. var l = this._bindings
  43063. , c = this._nActiveBindings;
  43064. for (a = 0; a !== c; ++a)
  43065. l[a].apply(o);
  43066. return this
  43067. },
  43068. getRoot: function() {
  43069. return this._root
  43070. },
  43071. uncacheClip: function(e) {
  43072. var t = this._actions
  43073. , i = e.name
  43074. , n = this._actionsByClip
  43075. , r = n[i];
  43076. if (void 0 !== r) {
  43077. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  43078. var l = o[a];
  43079. this._deactivateAction(l);
  43080. var c = l._cacheIndex
  43081. , h = t[t.length - 1];
  43082. l._cacheIndex = null,
  43083. l._byClipCacheIndex = null,
  43084. t[h._cacheIndex = c] = h,
  43085. t.pop(),
  43086. this._removeInactiveBindingsForAction(l)
  43087. }
  43088. delete n[i]
  43089. }
  43090. },
  43091. uncacheRoot: function(e) {
  43092. var t = e.uuid
  43093. , i = this._actionsByClip;
  43094. for (var n in i) {
  43095. var r = i[n].actionByRoot[t];
  43096. void 0 !== r && (this._deactivateAction(r),
  43097. this._removeInactiveAction(r))
  43098. }
  43099. var o = this._bindingsByRootAndName[t];
  43100. if (void 0 !== o)
  43101. for (var a in o) {
  43102. var s = o[a];
  43103. s.restoreOriginalState(),
  43104. this._removeInactiveBinding(s)
  43105. }
  43106. },
  43107. uncacheAction: function(e, t) {
  43108. var i = this.existingAction(e, t);
  43109. null !== i && (this._deactivateAction(i),
  43110. this._removeInactiveAction(i))
  43111. }
  43112. },
  43113. Ci.EventDispatcher.prototype.apply(Ci.AnimationMixer.prototype),
  43114. Ci.AnimationMixer._Action = function(e, t, i) {
  43115. this._mixer = e,
  43116. this._clip = t,
  43117. this._localRoot = i || null;
  43118. for (var n = t.tracks, r = n.length, o = new Array(r), a = {
  43119. endingStart: Ci.ZeroCurvatureEnding,
  43120. endingEnd: Ci.ZeroCurvatureEnding
  43121. }, s = 0; s !== r; ++s) {
  43122. var l = n[s].createInterpolant(null);
  43123. (o[s] = l).settings = a
  43124. }
  43125. this._interpolantSettings = a,
  43126. this._interpolants = o,
  43127. this._propertyBindings = new Array(r),
  43128. this._cacheIndex = null,
  43129. this._byClipCacheIndex = null,
  43130. this._timeScaleInterpolant = null,
  43131. this._weightInterpolant = null,
  43132. this.loop = Ci.LoopRepeat,
  43133. this._loopCount = -1,
  43134. this._startTime = null,
  43135. this.time = 0,
  43136. this.timeScale = 1,
  43137. this._effectiveTimeScale = 1,
  43138. this.weight = 1,
  43139. this._effectiveWeight = 1,
  43140. this.repetitions = 1 / 0,
  43141. this.paused = !1,
  43142. this.enabled = !0,
  43143. this.clampWhenFinished = !1,
  43144. this.zeroSlopeAtStart = !0,
  43145. this.zeroSlopeAtEnd = !0
  43146. }
  43147. ,
  43148. Ci.AnimationMixer._Action.prototype = {
  43149. constructor: Ci.AnimationMixer._Action,
  43150. play: function() {
  43151. return this._mixer._activateAction(this),
  43152. this
  43153. },
  43154. stop: function() {
  43155. return this._mixer._deactivateAction(this),
  43156. this.reset()
  43157. },
  43158. reset: function() {
  43159. return this.paused = !1,
  43160. this.enabled = !0,
  43161. this.time = 0,
  43162. this._loopCount = -1,
  43163. this._startTime = null,
  43164. this.stopFading().stopWarping()
  43165. },
  43166. isRunning: function() {
  43167. return this._startTime,
  43168. this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  43169. },
  43170. isScheduled: function() {
  43171. return this._mixer._isActiveAction(this)
  43172. },
  43173. startAt: function(e) {
  43174. return this._startTime = e,
  43175. this
  43176. },
  43177. setLoop: function(e, t) {
  43178. return this.loop = e,
  43179. this.repetitions = t,
  43180. this
  43181. },
  43182. setEffectiveWeight: function(e) {
  43183. return this.weight = e,
  43184. this._effectiveWeight = this.enabled ? e : 0,
  43185. this.stopFading()
  43186. },
  43187. getEffectiveWeight: function() {
  43188. return this._effectiveWeight
  43189. },
  43190. fadeIn: function(e) {
  43191. return this._scheduleFading(e, 0, 1)
  43192. },
  43193. fadeOut: function(e) {
  43194. return this._scheduleFading(e, 1, 0)
  43195. },
  43196. crossFadeFrom: function(e, t, i) {
  43197. if (this._mixer,
  43198. e.fadeOut(t),
  43199. this.fadeIn(t),
  43200. i) {
  43201. var n = this._clip.duration
  43202. , r = e._clip.duration
  43203. , o = r / n
  43204. , a = n / r;
  43205. e.warp(1, o, t),
  43206. this.warp(a, 1, t)
  43207. }
  43208. return this
  43209. },
  43210. crossFadeTo: function(e, t, i) {
  43211. return e.crossFadeFrom(this, t, i)
  43212. },
  43213. stopFading: function() {
  43214. var e = this._weightInterpolant;
  43215. return null !== e && (this._weightInterpolant = null,
  43216. this._mixer._takeBackControlInterpolant(e)),
  43217. this
  43218. },
  43219. setEffectiveTimeScale: function(e) {
  43220. return this.timeScale = e,
  43221. this._effectiveTimeScale = this.paused ? 0 : e,
  43222. this.stopWarping()
  43223. },
  43224. getEffectiveTimeScale: function() {
  43225. return this._effectiveTimeScale
  43226. },
  43227. setDuration: function(e) {
  43228. return this.timeScale = this._clip.duration / e,
  43229. this.stopWarping()
  43230. },
  43231. syncWith: function(e) {
  43232. return this.time = e.time,
  43233. this.timeScale = e.timeScale,
  43234. this.stopWarping()
  43235. },
  43236. halt: function(e) {
  43237. return this.warp(this._currentTimeScale, 0, e)
  43238. },
  43239. warp: function(e, t, i) {
  43240. var n = this._mixer
  43241. , r = n.time
  43242. , o = this._timeScaleInterpolant
  43243. , a = this.timeScale;
  43244. null === o && (o = n._lendControlInterpolant(),
  43245. this._timeScaleInterpolant = o);
  43246. var s = o.parameterPositions
  43247. , l = o.sampleValues;
  43248. return s[0] = r,
  43249. s[1] = r + i,
  43250. l[0] = e / a,
  43251. l[1] = t / a,
  43252. this
  43253. },
  43254. stopWarping: function() {
  43255. var e = this._timeScaleInterpolant;
  43256. return null !== e && (this._timeScaleInterpolant = null,
  43257. this._mixer._takeBackControlInterpolant(e)),
  43258. this
  43259. },
  43260. getMixer: function() {
  43261. return this._mixer
  43262. },
  43263. getClip: function() {
  43264. return this._clip
  43265. },
  43266. getRoot: function() {
  43267. return this._localRoot || this._mixer._root
  43268. },
  43269. _update: function(e, t, i, n) {
  43270. var r = this._startTime;
  43271. if (null !== r) {
  43272. var o = (e - r) * i;
  43273. if (o < 0 || 0 === i)
  43274. return;
  43275. this._startTime = null,
  43276. t = i * o
  43277. }
  43278. t *= this._updateTimeScale(e);
  43279. var a = this._updateTime(t)
  43280. , s = this._updateWeight(e);
  43281. if (0 < s)
  43282. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  43283. l[h].evaluate(a),
  43284. c[h].accumulate(n, s)
  43285. },
  43286. _updateWeight: function(e) {
  43287. var t = 0;
  43288. if (this.enabled) {
  43289. t = this.weight;
  43290. var i = this._weightInterpolant;
  43291. if (null !== i) {
  43292. var n = i.evaluate(e)[0];
  43293. t *= n,
  43294. e > i.parameterPositions[1] && (this.stopFading(),
  43295. 0 === n && (this.enabled = !1))
  43296. }
  43297. }
  43298. return this._effectiveWeight = t
  43299. },
  43300. _updateTimeScale: function(e) {
  43301. var t = 0;
  43302. if (!this.paused) {
  43303. t = this.timeScale;
  43304. var i = this._timeScaleInterpolant;
  43305. if (null !== i)
  43306. t *= i.evaluate(e)[0],
  43307. e > i.parameterPositions[1] && (this.stopWarping(),
  43308. 0 === t ? this.pause = !0 : this.timeScale = t)
  43309. }
  43310. return this._effectiveTimeScale = t
  43311. },
  43312. _updateTime: function(e) {
  43313. var t = this.time + e;
  43314. if (0 === e)
  43315. return t;
  43316. var i = this._clip.duration
  43317. , n = this.loop
  43318. , r = this._loopCount
  43319. , o = !1;
  43320. switch (n) {
  43321. case Ci.LoopOnce:
  43322. if (-1 === r && (this.loopCount = 0,
  43323. this._setEndings(!0, !0, !1)),
  43324. i <= t)
  43325. t = i;
  43326. else {
  43327. if (!(t < 0))
  43328. break;
  43329. t = 0
  43330. }
  43331. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  43332. this._mixer.dispatchEvent({
  43333. type: "finished",
  43334. action: this,
  43335. direction: e < 0 ? -1 : 1
  43336. });
  43337. break;
  43338. case Ci.LoopPingPong:
  43339. o = !0;
  43340. case Ci.LoopRepeat:
  43341. if (-1 === r && (0 < e ? (r = 0,
  43342. this._setEndings(!0, 0 === this.repetitions, o)) : this._setEndings(0 === this.repetitions, !0, o)),
  43343. i <= t || t < 0) {
  43344. var a = Math.floor(t / i);
  43345. t -= i * a,
  43346. r += Math.abs(a);
  43347. var s = this.repetitions - r;
  43348. if (s < 0) {
  43349. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  43350. t = 0 < e ? i : 0,
  43351. this._mixer.dispatchEvent({
  43352. type: "finished",
  43353. action: this,
  43354. direction: 0 < e ? 1 : -1
  43355. });
  43356. break
  43357. }
  43358. if (0 == s) {
  43359. var l = e < 0;
  43360. this._setEndings(l, !l, o)
  43361. } else
  43362. this._setEndings(!1, !1, o);
  43363. this._loopCount = r,
  43364. this._mixer.dispatchEvent({
  43365. type: "loop",
  43366. action: this,
  43367. loopDelta: a
  43368. })
  43369. }
  43370. if (n === Ci.LoopPingPong && 1 == (1 & r))
  43371. return i - (this.time = t)
  43372. }
  43373. return this.time = t
  43374. },
  43375. _setEndings: function(e, t, i) {
  43376. var n = this._interpolantSettings;
  43377. i ? (n.endingStart = Ci.ZeroSlopeEnding,
  43378. n.endingEnd = Ci.ZeroSlopeEnding) : (n.endingStart = e ? this.zeroSlopeAtStart ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding,
  43379. n.endingEnd = t ? this.zeroSlopeAtEnd ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding)
  43380. },
  43381. _scheduleFading: function(e, t, i) {
  43382. var n = this._mixer
  43383. , r = n.time
  43384. , o = this._weightInterpolant;
  43385. null === o && (o = n._lendControlInterpolant(),
  43386. this._weightInterpolant = o);
  43387. var a = o.parameterPositions
  43388. , s = o.sampleValues;
  43389. return a[0] = r,
  43390. s[0] = t,
  43391. a[1] = r + e,
  43392. s[1] = i,
  43393. this
  43394. }
  43395. },
  43396. Object.assign(Ci.AnimationMixer.prototype, {
  43397. _bindAction: function(e, t) {
  43398. var i = e._localRoot || this._root
  43399. , n = e._clip.tracks
  43400. , r = n.length
  43401. , o = e._propertyBindings
  43402. , a = e._interpolants
  43403. , s = i.uuid
  43404. , l = this._bindingsByRootAndName
  43405. , c = l[s];
  43406. void 0 === c && (c = {},
  43407. l[s] = c);
  43408. for (var h = 0; h !== r; ++h) {
  43409. var u = n[h]
  43410. , d = u.name
  43411. , p = c[d];
  43412. if (void 0 !== p)
  43413. o[h] = p;
  43414. else {
  43415. if (void 0 !== (p = o[h])) {
  43416. null === p._cacheIndex && (++p.referenceCount,
  43417. this._addInactiveBinding(p, s, d));
  43418. continue
  43419. }
  43420. var f = t && t._propertyBindings[h].binding.parsedPath;
  43421. ++(p = new Ci.PropertyMixer(Ci.PropertyBinding.create(i, d, f),u.ValueTypeName,u.getValueSize())).referenceCount,
  43422. this._addInactiveBinding(p, s, d),
  43423. o[h] = p
  43424. }
  43425. a[h].resultBuffer = p.buffer
  43426. }
  43427. },
  43428. _activateAction: function(e) {
  43429. if (!this._isActiveAction(e)) {
  43430. if (null === e._cacheIndex) {
  43431. var t = (e._localRoot || this._root).uuid
  43432. , i = e._clip.name
  43433. , n = this._actionsByClip[i];
  43434. this._bindAction(e, n && n.knownActions[0]),
  43435. this._addInactiveAction(e, i, t)
  43436. }
  43437. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  43438. var s = r[o];
  43439. 0 == s.useCount++ && (this._lendBinding(s),
  43440. s.saveOriginalState())
  43441. }
  43442. this._lendAction(e)
  43443. }
  43444. },
  43445. _deactivateAction: function(e) {
  43446. if (this._isActiveAction(e)) {
  43447. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43448. var r = t[i];
  43449. 0 == --r.useCount && (r.restoreOriginalState(),
  43450. this._takeBackBinding(r))
  43451. }
  43452. this._takeBackAction(e)
  43453. }
  43454. },
  43455. _initMemoryManager: function() {
  43456. this._actions = [],
  43457. this._nActiveActions = 0,
  43458. this._actionsByClip = {},
  43459. this._bindings = [],
  43460. this._nActiveBindings = 0,
  43461. this._bindingsByRootAndName = {},
  43462. this._controlInterpolants = [],
  43463. this._nActiveControlInterpolants = 0;
  43464. var e = this;
  43465. this.stats = {
  43466. actions: {
  43467. get total() {
  43468. return e._actions.length
  43469. },
  43470. get inUse() {
  43471. return e._nActiveActions
  43472. }
  43473. },
  43474. bindings: {
  43475. get total() {
  43476. return e._bindings.length
  43477. },
  43478. get inUse() {
  43479. return e._nActiveBindings
  43480. }
  43481. },
  43482. controlInterpolants: {
  43483. get total() {
  43484. return e._controlInterpolants.length
  43485. },
  43486. get inUse() {
  43487. return e._nActiveControlInterpolants
  43488. }
  43489. }
  43490. }
  43491. },
  43492. _isActiveAction: function(e) {
  43493. var t = e._cacheIndex;
  43494. return null !== t && t < this._nActiveActions
  43495. },
  43496. _addInactiveAction: function(e, t, i) {
  43497. var n = this._actions
  43498. , r = this._actionsByClip
  43499. , o = r[t];
  43500. if (void 0 === o)
  43501. o = {
  43502. knownActions: [e],
  43503. actionByRoot: {}
  43504. },
  43505. e._byClipCacheIndex = 0,
  43506. r[t] = o;
  43507. else {
  43508. var a = o.knownActions;
  43509. e._byClipCacheIndex = a.length,
  43510. a.push(e)
  43511. }
  43512. e._cacheIndex = n.length,
  43513. n.push(e),
  43514. o.actionByRoot[i] = e
  43515. },
  43516. _removeInactiveAction: function(e) {
  43517. var t = this._actions
  43518. , i = t[t.length - 1]
  43519. , n = e._cacheIndex;
  43520. t[i._cacheIndex = n] = i,
  43521. t.pop(),
  43522. e._cacheIndex = null;
  43523. var r = e._clip.name
  43524. , o = this._actionsByClip
  43525. , a = o[r]
  43526. , s = a.knownActions
  43527. , l = s[s.length - 1]
  43528. , c = e._byClipCacheIndex;
  43529. s[l._byClipCacheIndex = c] = l,
  43530. s.pop(),
  43531. e._byClipCacheIndex = null,
  43532. delete a.actionByRoot[(t._localRoot || this._root).uuid],
  43533. 0 === s.length && delete o[r],
  43534. this._removeInactiveBindingsForAction(e)
  43535. },
  43536. _removeInactiveBindingsForAction: function(e) {
  43537. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43538. var r = t[i];
  43539. 0 == --r.referenceCount && this._removeInactiveBinding(r)
  43540. }
  43541. },
  43542. _lendAction: function(e) {
  43543. var t = this._actions
  43544. , i = e._cacheIndex
  43545. , n = this._nActiveActions++
  43546. , r = t[n];
  43547. t[e._cacheIndex = n] = e,
  43548. t[r._cacheIndex = i] = r
  43549. },
  43550. _takeBackAction: function(e) {
  43551. var t = this._actions
  43552. , i = e._cacheIndex
  43553. , n = --this._nActiveActions
  43554. , r = t[n];
  43555. t[e._cacheIndex = n] = e,
  43556. t[r._cacheIndex = i] = r
  43557. },
  43558. _addInactiveBinding: function(e, t, i) {
  43559. var n = this._bindingsByRootAndName
  43560. , r = n[t]
  43561. , o = this._bindings;
  43562. void 0 === r && (r = {},
  43563. n[t] = r),
  43564. (r[i] = e)._cacheIndex = o.length,
  43565. o.push(e)
  43566. },
  43567. _removeInactiveBinding: function(e) {
  43568. var t = this._bindings
  43569. , i = e.binding
  43570. , n = i.rootNode.uuid
  43571. , r = i.path
  43572. , o = this._bindingsByRootAndName
  43573. , a = o[n]
  43574. , s = t[t.length - 1]
  43575. , l = e._cacheIndex;
  43576. t[s._cacheIndex = l] = s,
  43577. t.pop(),
  43578. delete a[r];
  43579. e: {
  43580. for (var c in a)
  43581. break e;
  43582. delete o[n]
  43583. }
  43584. },
  43585. _lendBinding: function(e) {
  43586. var t = this._bindings
  43587. , i = e._cacheIndex
  43588. , n = this._nActiveBindings++
  43589. , r = t[n];
  43590. t[e._cacheIndex = n] = e,
  43591. t[r._cacheIndex = i] = r
  43592. },
  43593. _takeBackBinding: function(e) {
  43594. var t = this._bindings
  43595. , i = e._cacheIndex
  43596. , n = --this._nActiveBindings
  43597. , r = t[n];
  43598. t[e._cacheIndex = n] = e,
  43599. t[r._cacheIndex = i] = r
  43600. },
  43601. _lendControlInterpolant: function() {
  43602. var e = this._controlInterpolants
  43603. , t = this._nActiveControlInterpolants++
  43604. , i = e[t];
  43605. return void 0 === i && (e[(i = new Ci.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex = t] = i),
  43606. i
  43607. },
  43608. _takeBackControlInterpolant: function(e) {
  43609. var t = this._controlInterpolants
  43610. , i = e.__cacheIndex
  43611. , n = --this._nActiveControlInterpolants
  43612. , r = t[n];
  43613. t[e.__cacheIndex = n] = e,
  43614. t[r.__cacheIndex = i] = r
  43615. },
  43616. _controlInterpolantsResultBuffer: new Float32Array(1)
  43617. }),
  43618. Ci.AnimationObjectGroup = function(e) {
  43619. this.uuid = Ci.Math.generateUUID(),
  43620. this._objects = Array.prototype.slice.call(arguments),
  43621. this.nCachedObjects_ = 0;
  43622. var t = {};
  43623. this._indicesByUUID = t;
  43624. for (var i = 0, n = arguments.length; i !== n; ++i)
  43625. t[arguments[i].uuid] = i;
  43626. this._paths = [],
  43627. this._parsedPaths = [],
  43628. this._bindings = [],
  43629. this._bindingsIndicesByPath = {};
  43630. var r = this;
  43631. this.stats = {
  43632. objects: {
  43633. get total() {
  43634. return r._objects.length
  43635. },
  43636. get inUse() {
  43637. return this.total - r.nCachedObjects_
  43638. }
  43639. },
  43640. get bindingsPerObject() {
  43641. return r._bindings.length
  43642. }
  43643. }
  43644. }
  43645. ,
  43646. Ci.AnimationObjectGroup.prototype = {
  43647. constructor: Ci.AnimationObjectGroup,
  43648. add: function(e) {
  43649. 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) {
  43650. var u = arguments[c]
  43651. , d = u.uuid
  43652. , p = r[d];
  43653. if (void 0 === p) {
  43654. p = i++,
  43655. r[d] = p,
  43656. t.push(u);
  43657. for (var f = 0, g = l; f !== g; ++f)
  43658. s[f].push(new Ci.PropertyBinding(u,o[f],a[f]))
  43659. } else if (p < n) {
  43660. var m = t[p]
  43661. , v = --n
  43662. , y = t[v];
  43663. t[r[y.uuid] = p] = y,
  43664. t[r[d] = v] = u;
  43665. for (f = 0,
  43666. g = l; f !== g; ++f) {
  43667. var A = s[f]
  43668. , C = A[v]
  43669. , I = A[p];
  43670. A[p] = C,
  43671. void 0 === I && (I = new Ci.PropertyBinding(u,o[f],a[f])),
  43672. A[v] = I
  43673. }
  43674. } else
  43675. t[p] !== m && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  43676. }
  43677. this.nCachedObjects_ = n
  43678. },
  43679. remove: function(e) {
  43680. for (var t = this._objects, i = (t.length,
  43681. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  43682. var l = arguments[a]
  43683. , c = l.uuid
  43684. , h = n[c];
  43685. if (void 0 !== h && i <= h) {
  43686. var u = i++
  43687. , d = t[u];
  43688. t[n[d.uuid] = h] = d,
  43689. t[n[c] = u] = l;
  43690. for (var p = 0, f = o; p !== f; ++p) {
  43691. var g = r[p]
  43692. , m = g[u]
  43693. , v = g[h];
  43694. g[h] = m,
  43695. g[u] = v
  43696. }
  43697. }
  43698. }
  43699. this.nCachedObjects_ = i
  43700. },
  43701. uncache: function(e) {
  43702. 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) {
  43703. var c = arguments[s].uuid
  43704. , h = r[c];
  43705. if (void 0 !== h)
  43706. if (delete r[c],
  43707. h < n) {
  43708. var u = --n
  43709. , d = t[u]
  43710. , p = t[y = --i];
  43711. t[r[d.uuid] = h] = d,
  43712. t[r[p.uuid] = u] = p,
  43713. t.pop();
  43714. for (var f = 0, g = a; f !== g; ++f) {
  43715. var m = (A = o[f])[u]
  43716. , v = A[y];
  43717. A[h] = m,
  43718. A[u] = v,
  43719. A.pop()
  43720. }
  43721. } else {
  43722. var y;
  43723. t[r[(p = t[y = --i]).uuid] = h] = p,
  43724. t.pop();
  43725. for (f = 0,
  43726. g = a; f !== g; ++f) {
  43727. var A;
  43728. (A = o[f])[h] = A[y],
  43729. A.pop()
  43730. }
  43731. }
  43732. }
  43733. this.nCachedObjects_ = n
  43734. },
  43735. subscribe_: function(e, t) {
  43736. var i = this._bindingsIndicesByPath
  43737. , n = i[e]
  43738. , r = this._bindings;
  43739. if (void 0 !== n)
  43740. return r[n];
  43741. var o = this._paths
  43742. , a = this._parsedPaths
  43743. , s = this._objects
  43744. , l = s.length
  43745. , c = this.nCachedObjects_
  43746. , h = new Array(l);
  43747. n = r.length,
  43748. i[e] = n,
  43749. o.push(e),
  43750. a.push(t),
  43751. r.push(h);
  43752. for (var u = c, d = s.length; u !== d; ++u) {
  43753. var p = s[u];
  43754. h[u] = new Ci.PropertyBinding(p,e,t)
  43755. }
  43756. return h
  43757. },
  43758. unsubscribe_: function(e) {
  43759. var t = this._bindingsIndicesByPath
  43760. , i = t[e];
  43761. if (void 0 !== i) {
  43762. var n = this._paths
  43763. , r = this._parsedPaths
  43764. , o = this._bindings
  43765. , a = o.length - 1
  43766. , s = o[a];
  43767. o[t[e[a]] = i] = s,
  43768. o.pop(),
  43769. r[i] = r[a],
  43770. r.pop(),
  43771. n[i] = n[a],
  43772. n.pop()
  43773. }
  43774. }
  43775. },
  43776. Ci.AnimationUtils = {
  43777. arraySlice: function(e, t, i) {
  43778. return Ci.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  43779. },
  43780. convertArray: function(e, t, i) {
  43781. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  43782. },
  43783. isTypedArray: function(e) {
  43784. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  43785. },
  43786. getKeyframeOrder: function(i) {
  43787. for (var e = i.length, t = new Array(e), n = 0; n !== e; ++n)
  43788. t[n] = n;
  43789. return t.sort(function(e, t) {
  43790. return i[e] - i[t]
  43791. }),
  43792. t
  43793. },
  43794. sortedArray: function(e, t, i) {
  43795. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  43796. for (var s = i[o] * t, l = 0; l !== t; ++l)
  43797. r[a++] = e[s + l];
  43798. return r
  43799. },
  43800. flattenJSON: function(e, t, i, n) {
  43801. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  43802. o = e[r++];
  43803. if (void 0 !== o) {
  43804. var a = o[n];
  43805. if (void 0 !== a)
  43806. if (Array.isArray(a))
  43807. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43808. i.push.apply(i, a)),
  43809. void 0 !== (o = e[r++]); )
  43810. ;
  43811. else if (void 0 !== a.toArray)
  43812. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43813. a.toArray(i, i.length)),
  43814. void 0 !== (o = e[r++]); )
  43815. ;
  43816. else
  43817. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43818. i.push(a)),
  43819. void 0 !== (o = e[r++]); )
  43820. ;
  43821. }
  43822. }
  43823. },
  43824. Ci.KeyframeTrack = function(e, t, i, n) {
  43825. if (void 0 === e)
  43826. throw new Error("track name is undefined");
  43827. if (void 0 === t || 0 === t.length)
  43828. throw new Error("no keyframes in track named " + e);
  43829. this.name = e,
  43830. this.times = Ci.AnimationUtils.convertArray(t, this.TimeBufferType),
  43831. this.values = Ci.AnimationUtils.convertArray(i, this.ValueBufferType),
  43832. this.setInterpolation(n || this.DefaultInterpolation),
  43833. this.validate(),
  43834. this.optimize()
  43835. }
  43836. ,
  43837. Ci.KeyframeTrack.prototype = {
  43838. constructor: Ci.KeyframeTrack,
  43839. TimeBufferType: Float32Array,
  43840. ValueBufferType: Float32Array,
  43841. DefaultInterpolation: Ci.InterpolateLinear,
  43842. InterpolantFactoryMethodDiscrete: function(e) {
  43843. return new Ci.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  43844. },
  43845. InterpolantFactoryMethodLinear: function(e) {
  43846. return new Ci.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  43847. },
  43848. InterpolantFactoryMethodSmooth: function(e) {
  43849. return new Ci.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  43850. },
  43851. setInterpolation: function(e) {
  43852. var t = void 0;
  43853. switch (e) {
  43854. case Ci.InterpolateDiscrete:
  43855. t = this.InterpolantFactoryMethodDiscrete;
  43856. break;
  43857. case Ci.InterpolateLinear:
  43858. t = this.InterpolantFactoryMethodLinear;
  43859. break;
  43860. case Ci.InterpolateSmooth:
  43861. t = this.InterpolantFactoryMethodSmooth
  43862. }
  43863. if (void 0 !== t)
  43864. this.createInterpolant = t;
  43865. else {
  43866. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  43867. if (void 0 === this.createInterpolant) {
  43868. if (e === this.DefaultInterpolation)
  43869. throw new Error(i);
  43870. this.setInterpolation(this.DefaultInterpolation)
  43871. }
  43872. console.warn(i)
  43873. }
  43874. },
  43875. getInterpolation: function() {
  43876. switch (this.createInterpolant) {
  43877. case this.InterpolantFactoryMethodDiscrete:
  43878. return Ci.InterpolateDiscrete;
  43879. case this.InterpolantFactoryMethodLinear:
  43880. return Ci.InterpolateLinear;
  43881. case this.InterpolantFactoryMethodSmooth:
  43882. return Ci.InterpolateSmooth
  43883. }
  43884. },
  43885. getValueSize: function() {
  43886. return this.values.length / this.times.length
  43887. },
  43888. shift: function(e) {
  43889. if (0 !== e)
  43890. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43891. t[i] += e;
  43892. return this
  43893. },
  43894. scale: function(e) {
  43895. if (1 !== e)
  43896. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43897. t[i] *= e;
  43898. return this
  43899. },
  43900. trim: function(e, t) {
  43901. for (var i = this.times, n = i.length, r = 0, o = n - 1; r !== n && i[r] < e; )
  43902. ++r;
  43903. for (; -1 !== o && i[o] > t; )
  43904. --o;
  43905. if (++o,
  43906. 0 !== r || o !== n) {
  43907. o <= r && (r = (o = Math.max(o, 1)) - 1);
  43908. var a = this.getValueSize();
  43909. this.times = Ci.AnimationUtils.arraySlice(i, r, o),
  43910. this.values = Ci.AnimationUtils.arraySlice(this.values, r * a, o * a)
  43911. }
  43912. return this
  43913. },
  43914. validate: function() {
  43915. var e = !0
  43916. , t = this.getValueSize();
  43917. t - Math.floor(t) != 0 && (console.error("invalid value size in track", this),
  43918. e = !1);
  43919. var i = this.times
  43920. , n = this.values
  43921. , r = i.length;
  43922. 0 === r && (console.error("track is empty", this),
  43923. e = !1);
  43924. for (var o = null, a = 0; a !== r; a++) {
  43925. var s = i[a];
  43926. if ("number" == typeof s && isNaN(s)) {
  43927. console.error("time is not a valid number", this, a, s),
  43928. e = !1;
  43929. break
  43930. }
  43931. if (null !== o && s < o) {
  43932. console.error("out of order keys", this, a, s, o),
  43933. e = !1;
  43934. break
  43935. }
  43936. o = s
  43937. }
  43938. if (void 0 !== n && Ci.AnimationUtils.isTypedArray(n)) {
  43939. a = 0;
  43940. for (var l = n.length; a !== l; ++a) {
  43941. var c = n[a];
  43942. if (isNaN(c)) {
  43943. console.error("value is not a valid number", this, a, c),
  43944. e = !1;
  43945. break
  43946. }
  43947. }
  43948. }
  43949. return e
  43950. },
  43951. optimize: function() {
  43952. for (var e = this.times, t = this.values, i = this.getValueSize(), n = 1, r = 1, o = e.length - 1; r <= o; ++r) {
  43953. var a = !1
  43954. , s = e[r];
  43955. if (s !== e[r + 1] && (1 !== r || s !== s[0]))
  43956. for (var l = r * i, c = l - i, h = l + i, u = 0; u !== i; ++u) {
  43957. var d = t[l + u];
  43958. if (d !== t[c + u] || d !== t[h + u]) {
  43959. a = !0;
  43960. break
  43961. }
  43962. }
  43963. if (a) {
  43964. if (r !== n) {
  43965. e[n] = e[r];
  43966. var p = r * i
  43967. , f = n * i;
  43968. for (u = 0; u !== i; ++u)
  43969. t[f + u] = t[p + u]
  43970. }
  43971. ++n
  43972. }
  43973. }
  43974. return n !== e.length && (this.times = Ci.AnimationUtils.arraySlice(e, 0, n),
  43975. this.values = Ci.AnimationUtils.arraySlice(t, 0, n * i)),
  43976. this
  43977. }
  43978. },
  43979. Object.assign(Ci.KeyframeTrack, {
  43980. parse: function(e) {
  43981. if (void 0 === e.type)
  43982. throw new Error("track type undefined, can not parse");
  43983. var t = Ci.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  43984. if (void 0 === e.times) {
  43985. console.warn("legacy JSON format detected, converting");
  43986. var i = []
  43987. , n = [];
  43988. Ci.AnimationUtils.flattenJSON(e.keys, i, n, "value"),
  43989. e.times = i,
  43990. e.values = n
  43991. }
  43992. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  43993. },
  43994. toJSON: function(e) {
  43995. var t, i = e.constructor;
  43996. if (void 0 !== i.toJSON)
  43997. t = i.toJSON(e);
  43998. else {
  43999. t = {
  44000. name: e.name,
  44001. times: Ci.AnimationUtils.convertArray(e.times, Array),
  44002. values: Ci.AnimationUtils.convertArray(e.values, Array)
  44003. };
  44004. var n = e.getInterpolation();
  44005. n !== e.DefaultInterpolation && (t.interpolation = n)
  44006. }
  44007. return t.type = e.ValueTypeName,
  44008. t
  44009. },
  44010. _getTrackTypeForValueTypeName: function(e) {
  44011. switch (e.toLowerCase()) {
  44012. case "scalar":
  44013. case "double":
  44014. case "float":
  44015. case "number":
  44016. case "integer":
  44017. return Ci.NumberKeyframeTrack;
  44018. case "vector":
  44019. case "vector2":
  44020. case "vector3":
  44021. case "vector4":
  44022. return Ci.VectorKeyframeTrack;
  44023. case "color":
  44024. return Ci.ColorKeyframeTrack;
  44025. case "quaternion":
  44026. return Ci.QuaternionKeyframeTrack;
  44027. case "bool":
  44028. case "boolean":
  44029. return Ci.BooleanKeyframeTrack;
  44030. case "string":
  44031. return Ci.StringKeyframeTrack
  44032. }
  44033. throw new Error("Unsupported typeName: " + e)
  44034. }
  44035. }),
  44036. Ci.PropertyBinding = function(e, t, i) {
  44037. this.path = t,
  44038. this.parsedPath = i || Ci.PropertyBinding.parseTrackName(t),
  44039. this.node = Ci.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  44040. this.rootNode = e
  44041. }
  44042. ,
  44043. Ci.PropertyBinding.prototype = {
  44044. constructor: Ci.PropertyBinding,
  44045. getValue: function(e, t) {
  44046. this.bind(),
  44047. this.getValue(e, t)
  44048. },
  44049. setValue: function(e, t) {
  44050. this.bind(),
  44051. this.setValue(e, t)
  44052. },
  44053. bind: function() {
  44054. var e = this.node
  44055. , t = this.parsedPath
  44056. , i = t.objectName
  44057. , n = t.propertyName
  44058. , r = t.propertyIndex;
  44059. if (e || (e = Ci.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  44060. this.node = e),
  44061. this.getValue = this._getValue_unavailable,
  44062. this.setValue = this._setValue_unavailable,
  44063. e) {
  44064. if (i) {
  44065. var o = t.objectIndex;
  44066. switch (i) {
  44067. case "materials":
  44068. if (!e.material)
  44069. return void console.error(" can not bind to material as node does not have a material", this);
  44070. if (!e.material.materials)
  44071. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  44072. e = e.material.materials;
  44073. break;
  44074. case "bones":
  44075. if (!e.skeleton)
  44076. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  44077. e = e.skeleton.bones;
  44078. for (var a = 0; a < e.length; a++)
  44079. if (e[a].name === o) {
  44080. o = a;
  44081. break
  44082. }
  44083. break;
  44084. default:
  44085. if (void 0 === e[i])
  44086. return void console.error(" can not bind to objectName of node, undefined", this);
  44087. e = e[i]
  44088. }
  44089. if (void 0 !== o) {
  44090. if (void 0 === e[o])
  44091. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  44092. e = e[o]
  44093. }
  44094. }
  44095. var s = e[n];
  44096. if (s) {
  44097. var l = this.Versioning.None;
  44098. void 0 !== e.needsUpdate ? (l = this.Versioning.NeedsUpdate,
  44099. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (l = this.Versioning.MatrixWorldNeedsUpdate,
  44100. this.targetObject = e);
  44101. var c = this.BindingType.Direct;
  44102. if (void 0 !== r) {
  44103. if ("morphTargetInfluences" === n) {
  44104. if (!e.geometry)
  44105. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  44106. if (!e.geometry.morphTargets)
  44107. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  44108. for (a = 0; a < this.node.geometry.morphTargets.length; a++)
  44109. if (e.geometry.morphTargets[a].name === r) {
  44110. r = a;
  44111. break
  44112. }
  44113. }
  44114. c = this.BindingType.ArrayElement,
  44115. this.resolvedProperty = s,
  44116. this.propertyIndex = r
  44117. } else
  44118. void 0 !== s.fromArray && void 0 !== s.toArray ? (c = this.BindingType.HasFromToArray,
  44119. this.resolvedProperty = s) : void 0 !== s.length ? (c = this.BindingType.EntireArray,
  44120. this.resolvedProperty = s) : this.propertyName = n;
  44121. this.getValue = this.GetterByBindingType[c],
  44122. this.setValue = this.SetterByBindingTypeAndVersioning[c][l]
  44123. } else {
  44124. var h = t.nodeName;
  44125. console.error(" trying to update property for track: " + h + "." + n + " but it wasn't found.", e)
  44126. }
  44127. } else
  44128. console.error(" trying to update node for track: " + this.path + " but it wasn't found.")
  44129. },
  44130. unbind: function() {
  44131. this.node = null,
  44132. this.getValue = this._getValue_unbound,
  44133. this.setValue = this._setValue_unbound
  44134. }
  44135. },
  44136. Object.assign(Ci.PropertyBinding.prototype, {
  44137. _getValue_unavailable: function() {},
  44138. _setValue_unavailable: function() {},
  44139. _getValue_unbound: Ci.PropertyBinding.prototype.getValue,
  44140. _setValue_unbound: Ci.PropertyBinding.prototype.setValue,
  44141. BindingType: {
  44142. Direct: 0,
  44143. EntireArray: 1,
  44144. ArrayElement: 2,
  44145. HasFromToArray: 3
  44146. },
  44147. Versioning: {
  44148. None: 0,
  44149. NeedsUpdate: 1,
  44150. MatrixWorldNeedsUpdate: 2
  44151. },
  44152. GetterByBindingType: [function(e, t) {
  44153. e[t] = this.node[this.propertyName]
  44154. }
  44155. , function(e, t) {
  44156. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44157. e[t++] = i[n]
  44158. }
  44159. , function(e, t) {
  44160. e[t] = this.resolvedProperty[this.propertyIndex]
  44161. }
  44162. , function(e, t) {
  44163. this.resolvedProperty.toArray(e, t)
  44164. }
  44165. ],
  44166. SetterByBindingTypeAndVersioning: [[function(e, t) {
  44167. this.node[this.propertyName] = e[t]
  44168. }
  44169. , function(e, t) {
  44170. this.node[this.propertyName] = e[t],
  44171. this.targetObject.needsUpdate = !0
  44172. }
  44173. , function(e, t) {
  44174. this.node[this.propertyName] = e[t],
  44175. this.targetObject.matrixWorldNeedsUpdate = !0
  44176. }
  44177. ], [function(e, t) {
  44178. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44179. i[n] = e[t++]
  44180. }
  44181. , function(e, t) {
  44182. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44183. i[n] = e[t++];
  44184. this.targetObject.needsUpdate = !0
  44185. }
  44186. , function(e, t) {
  44187. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44188. i[n] = e[t++];
  44189. this.targetObject.matrixWorldNeedsUpdate = !0
  44190. }
  44191. ], [function(e, t) {
  44192. this.resolvedProperty[this.propertyIndex] = e[t]
  44193. }
  44194. , function(e, t) {
  44195. this.resolvedProperty[this.propertyIndex] = e[t],
  44196. this.targetObject.needsUpdate = !0
  44197. }
  44198. , function(e, t) {
  44199. this.resolvedProperty[this.propertyIndex] = e[t],
  44200. this.targetObject.matrixWorldNeedsUpdate = !0
  44201. }
  44202. ], [function(e, t) {
  44203. this.resolvedProperty.fromArray(e, t)
  44204. }
  44205. , function(e, t) {
  44206. this.resolvedProperty.fromArray(e, t),
  44207. this.targetObject.needsUpdate = !0
  44208. }
  44209. , function(e, t) {
  44210. this.resolvedProperty.fromArray(e, t),
  44211. this.targetObject.matrixWorldNeedsUpdate = !0
  44212. }
  44213. ]]
  44214. }),
  44215. Ci.PropertyBinding.Composite = function(e, t, i) {
  44216. var n = i || Ci.PropertyBinding.parseTrackName(t);
  44217. this._targetGroup = e,
  44218. this._bindings = e.subscribe_(t, n)
  44219. }
  44220. ,
  44221. Ci.PropertyBinding.Composite.prototype = {
  44222. constructor: Ci.PropertyBinding.Composite,
  44223. getValue: function(e, t) {
  44224. this.bind();
  44225. var i = this._targetGroup.nCachedObjects_
  44226. , n = this._bindings[i];
  44227. void 0 !== n && n.getValue(e, t)
  44228. },
  44229. setValue: function(e, t) {
  44230. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  44231. i[n].setValue(e, t)
  44232. },
  44233. bind: function() {
  44234. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44235. e[t].bind()
  44236. },
  44237. unbind: function() {
  44238. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44239. e[t].unbind()
  44240. }
  44241. },
  44242. Ci.PropertyBinding.create = function(e, t, i) {
  44243. return e instanceof Ci.AnimationObjectGroup ? new Ci.PropertyBinding.Composite(e,t,i) : new Ci.PropertyBinding(e,t,i)
  44244. }
  44245. ,
  44246. Ci.PropertyBinding.parseTrackName = function(e) {
  44247. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  44248. , i = t.exec(e);
  44249. if (!i)
  44250. throw new Error("cannot parse trackName at all: " + e);
  44251. i.index === t.lastIndex && t.lastIndex++;
  44252. var n = {
  44253. nodeName: i[3],
  44254. objectName: i[5],
  44255. objectIndex: i[7],
  44256. propertyName: i[9],
  44257. propertyIndex: i[11]
  44258. };
  44259. if (null === n.propertyName || 0 === n.propertyName.length)
  44260. throw new Error("can not parse propertyName from trackName: " + e);
  44261. return n
  44262. }
  44263. ,
  44264. Ci.PropertyBinding.findNode = function(e, r) {
  44265. if (!r || "" === r || "root" === r || "." === r || -1 === r || r === e.name || r === e.uuid)
  44266. return e;
  44267. if (e.skeleton) {
  44268. var t = function(e) {
  44269. for (var t = 0; t < e.bones.length; t++) {
  44270. var i = e.bones[t];
  44271. if (i.name === r)
  44272. return i
  44273. }
  44274. return null
  44275. }(e.skeleton);
  44276. if (t)
  44277. return t
  44278. }
  44279. if (e.children) {
  44280. var o = function(e) {
  44281. for (var t = 0; t < e.length; t++) {
  44282. var i = e[t];
  44283. if (i.name === r || i.uuid === r)
  44284. return i;
  44285. var n = o(i.children);
  44286. if (n)
  44287. return n
  44288. }
  44289. return null
  44290. }
  44291. , i = o(e.children);
  44292. if (i)
  44293. return i
  44294. }
  44295. return null
  44296. }
  44297. ,
  44298. Ci.PropertyMixer = function(e, t, i) {
  44299. this.binding = e,
  44300. this.valueSize = i;
  44301. var n, r = Float64Array;
  44302. switch (t) {
  44303. case "quaternion":
  44304. n = this._slerp;
  44305. break;
  44306. case "string":
  44307. case "bool":
  44308. r = Array,
  44309. n = this._select;
  44310. break;
  44311. default:
  44312. n = this._lerp
  44313. }
  44314. this.buffer = new r(4 * i),
  44315. this._mixBufferRegion = n,
  44316. this.cumulativeWeight = 0,
  44317. this.useCount = 0,
  44318. this.referenceCount = 0
  44319. }
  44320. ,
  44321. Ci.PropertyMixer.prototype = {
  44322. constructor: Ci.PropertyMixer,
  44323. accumulate: function(e, t) {
  44324. var i = this.buffer
  44325. , n = this.valueSize
  44326. , r = e * n + n
  44327. , o = this.cumulativeWeight;
  44328. if (0 === o) {
  44329. for (var a = 0; a !== n; ++a)
  44330. i[r + a] = i[a];
  44331. o = t
  44332. } else {
  44333. var s = t / (o += t);
  44334. this._mixBufferRegion(i, r, 0, s, n)
  44335. }
  44336. this.cumulativeWeight = o
  44337. },
  44338. apply: function(e) {
  44339. var t = this.valueSize
  44340. , i = this.buffer
  44341. , n = e * t + t
  44342. , r = this.cumulativeWeight
  44343. , o = this.binding;
  44344. if (this.cumulativeWeight = 0,
  44345. r < 1) {
  44346. var a = 3 * t;
  44347. this._mixBufferRegion(i, n, a, 1 - r, t)
  44348. }
  44349. for (var s = t, l = t + t; s !== l; ++s)
  44350. if (i[s] !== i[s + t]) {
  44351. o.setValue(i, n);
  44352. break
  44353. }
  44354. },
  44355. saveOriginalState: function() {
  44356. var e = this.binding
  44357. , t = this.buffer
  44358. , i = this.valueSize
  44359. , n = 3 * i;
  44360. e.getValue(t, n);
  44361. for (var r = i, o = n; r !== o; ++r)
  44362. t[r] = t[n + r % i];
  44363. this.cumulativeWeight = 0
  44364. },
  44365. restoreOriginalState: function() {
  44366. var e = 3 * this.valueSize;
  44367. this.binding.setValue(this.buffer, e)
  44368. },
  44369. _select: function(e, t, i, n, r) {
  44370. if (.5 <= n)
  44371. for (var o = 0; o !== r; ++o)
  44372. e[t + o] = e[i + o]
  44373. },
  44374. _slerp: function(e, t, i, n, r) {
  44375. Ci.Quaternion.slerpFlat(e, t, e, t, e, i, n)
  44376. },
  44377. _lerp: function(e, t, i, n, r) {
  44378. for (var o = 1 - n, a = 0; a !== r; ++a) {
  44379. var s = t + a;
  44380. e[s] = e[s] * o + e[i + a] * n
  44381. }
  44382. }
  44383. },
  44384. Ci.BooleanKeyframeTrack = function(e, t, i) {
  44385. Ci.KeyframeTrack.call(this, e, t, i)
  44386. }
  44387. ,
  44388. Ci.BooleanKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44389. constructor: Ci.BooleanKeyframeTrack,
  44390. ValueTypeName: "bool",
  44391. ValueBufferType: Array,
  44392. DefaultInterpolation: Ci.IntepolateDiscrete,
  44393. InterpolantFactoryMethodLinear: void 0,
  44394. InterpolantFactoryMethodSmooth: void 0
  44395. }),
  44396. Ci.NumberKeyframeTrack = function(e, t, i, n) {
  44397. Ci.KeyframeTrack.call(this, e, t, i, n)
  44398. }
  44399. ,
  44400. Ci.NumberKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44401. constructor: Ci.NumberKeyframeTrack,
  44402. ValueTypeName: "number"
  44403. }),
  44404. Ci.QuaternionKeyframeTrack = function(e, t, i, n) {
  44405. Ci.KeyframeTrack.call(this, e, t, i, n)
  44406. }
  44407. ,
  44408. Ci.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44409. constructor: Ci.QuaternionKeyframeTrack,
  44410. ValueTypeName: "quaternion",
  44411. DefaultInterpolation: Ci.InterpolateLinear,
  44412. InterpolantFactoryMethodLinear: function(e) {
  44413. return new Ci.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44414. },
  44415. InterpolantFactoryMethodSmooth: void 0
  44416. }),
  44417. Ci.StringKeyframeTrack = function(e, t, i, n) {
  44418. Ci.KeyframeTrack.call(this, e, t, i, n)
  44419. }
  44420. ,
  44421. Ci.StringKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44422. constructor: Ci.StringKeyframeTrack,
  44423. ValueTypeName: "string",
  44424. ValueBufferType: Array,
  44425. DefaultInterpolation: Ci.IntepolateDiscrete,
  44426. InterpolantFactoryMethodLinear: void 0,
  44427. InterpolantFactoryMethodSmooth: void 0
  44428. }),
  44429. Ci.VectorKeyframeTrack = function(e, t, i, n) {
  44430. Ci.KeyframeTrack.call(this, e, t, i, n)
  44431. }
  44432. ,
  44433. Ci.VectorKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44434. constructor: Ci.VectorKeyframeTrack,
  44435. ValueTypeName: "vector"
  44436. }),
  44437. Ci.Audio = function(e) {
  44438. Ci.Object3D.call(this),
  44439. this.type = "Audio",
  44440. this.context = e.context,
  44441. this.source = this.context.createBufferSource(),
  44442. this.source.onended = this.onEnded.bind(this),
  44443. this.gain = this.context.createGain(),
  44444. this.gain.connect(e.getInput()),
  44445. this.autoplay = !1,
  44446. this.startTime = 0,
  44447. this.playbackRate = 1,
  44448. this.isPlaying = !1,
  44449. this.hasPlaybackControl = !0,
  44450. this.sourceType = "empty",
  44451. this.filter = null
  44452. }
  44453. ,
  44454. Ci.Audio.prototype = Object.create(Ci.Object3D.prototype),
  44455. Ci.Audio.prototype.constructor = Ci.Audio,
  44456. Ci.Audio.prototype.getOutput = function() {
  44457. return this.gain
  44458. }
  44459. ,
  44460. Ci.Audio.prototype.load = function(e) {
  44461. var t = new Ci.AudioBuffer(this.context);
  44462. return t.load(e),
  44463. this.setBuffer(t),
  44464. this
  44465. }
  44466. ,
  44467. Ci.Audio.prototype.setNodeSource = function(e) {
  44468. return this.hasPlaybackControl = !1,
  44469. this.sourceType = "audioNode",
  44470. this.source = e,
  44471. this.connect(),
  44472. this
  44473. }
  44474. ,
  44475. Ci.Audio.prototype.setBuffer = function(e) {
  44476. var t = this;
  44477. return e.onReady(function(e) {
  44478. t.source.buffer = e,
  44479. t.sourceType = "buffer",
  44480. t.autoplay && t.play()
  44481. }),
  44482. this
  44483. }
  44484. ,
  44485. Ci.Audio.prototype.play = function() {
  44486. if (!0 !== this.isPlaying)
  44487. if (!1 !== this.hasPlaybackControl) {
  44488. var e = this.context.createBufferSource();
  44489. e.buffer = this.source.buffer,
  44490. e.loop = this.source.loop,
  44491. e.onended = this.source.onended,
  44492. e.start(0, this.startTime),
  44493. e.playbackRate.value = this.playbackRate,
  44494. this.isPlaying = !0,
  44495. this.source = e,
  44496. this.connect()
  44497. } else
  44498. console.warn("THREE.Audio: this Audio has no playback control.");
  44499. else
  44500. console.warn("THREE.Audio: Audio is already playing.")
  44501. }
  44502. ,
  44503. Ci.Audio.prototype.pause = function() {
  44504. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44505. void (this.startTime = this.context.currentTime))
  44506. }
  44507. ,
  44508. Ci.Audio.prototype.stop = function() {
  44509. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44510. void (this.startTime = 0))
  44511. }
  44512. ,
  44513. Ci.Audio.prototype.connect = function() {
  44514. null !== this.filter ? (this.source.connect(this.filter),
  44515. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  44516. }
  44517. ,
  44518. Ci.Audio.prototype.disconnect = function() {
  44519. null !== this.filter ? (this.source.disconnect(this.filter),
  44520. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  44521. }
  44522. ,
  44523. Ci.Audio.prototype.getFilter = function() {
  44524. return this.filter
  44525. }
  44526. ,
  44527. Ci.Audio.prototype.setFilter = function(e) {
  44528. void 0 === e && (e = null),
  44529. !0 === this.isPlaying ? (this.disconnect(),
  44530. this.filter = e,
  44531. this.connect()) : this.filter = e
  44532. }
  44533. ,
  44534. Ci.Audio.prototype.setPlaybackRate = function(e) {
  44535. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  44536. void (!0 === this.isPlaying && (this.source.playbackRate.value = this.playbackRate)))
  44537. }
  44538. ,
  44539. Ci.Audio.prototype.getPlaybackRate = function() {
  44540. return this.playbackRate
  44541. }
  44542. ,
  44543. Ci.Audio.prototype.onEnded = function() {
  44544. this.isPlaying = !1
  44545. }
  44546. ,
  44547. Ci.Audio.prototype.setLoop = function(e) {
  44548. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  44549. }
  44550. ,
  44551. Ci.Audio.prototype.getLoop = function() {
  44552. return !1 === this.hasPlaybackControl ? (console.warn("THREE.Audio: this Audio has no playback control."),
  44553. !1) : this.source.loop
  44554. }
  44555. ,
  44556. Ci.Audio.prototype.setVolume = function(e) {
  44557. this.gain.gain.value = e
  44558. }
  44559. ,
  44560. Ci.Audio.prototype.getVolume = function() {
  44561. return this.gain.gain.value
  44562. }
  44563. ,
  44564. Ci.AudioAnalyser = function(e, t) {
  44565. this.analyser = e.context.createAnalyser(),
  44566. this.analyser.fftSize = void 0 !== t ? t : 2048,
  44567. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  44568. e.getOutput().connect(this.analyser)
  44569. }
  44570. ,
  44571. Ci.AudioAnalyser.prototype = {
  44572. constructor: Ci.AudioAnalyser,
  44573. getData: function() {
  44574. return this.analyser.getByteFrequencyData(this.data),
  44575. this.data
  44576. }
  44577. },
  44578. Ci.AudioBuffer = function(e) {
  44579. this.context = e,
  44580. this.ready = !1,
  44581. this.readyCallbacks = []
  44582. }
  44583. ,
  44584. Ci.AudioBuffer.prototype.load = function(e) {
  44585. var i = this
  44586. , t = new XMLHttpRequest;
  44587. return t.open("GET", e, !0),
  44588. t.responseType = "arraybuffer",
  44589. t.onload = function(e) {
  44590. i.context.decodeAudioData(this.response, function(e) {
  44591. i.buffer = e,
  44592. i.ready = !0;
  44593. for (var t = 0; t < i.readyCallbacks.length; t++)
  44594. i.readyCallbacks[t](i.buffer);
  44595. i.readyCallbacks = []
  44596. })
  44597. }
  44598. ,
  44599. t.send(),
  44600. this
  44601. }
  44602. ,
  44603. Ci.AudioBuffer.prototype.onReady = function(e) {
  44604. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  44605. }
  44606. ,
  44607. Ci.PositionalAudio = function(e) {
  44608. Ci.Audio.call(this, e),
  44609. this.panner = this.context.createPanner(),
  44610. this.panner.connect(this.gain)
  44611. }
  44612. ,
  44613. Ci.PositionalAudio.prototype = Object.create(Ci.Audio.prototype),
  44614. Ci.PositionalAudio.prototype.constructor = Ci.PositionalAudio,
  44615. Ci.PositionalAudio.prototype.getOutput = function() {
  44616. return this.panner
  44617. }
  44618. ,
  44619. Ci.PositionalAudio.prototype.setRefDistance = function(e) {
  44620. this.panner.refDistance = e
  44621. }
  44622. ,
  44623. Ci.PositionalAudio.prototype.getRefDistance = function() {
  44624. return this.panner.refDistance
  44625. }
  44626. ,
  44627. Ci.PositionalAudio.prototype.setRolloffFactor = function(e) {
  44628. this.panner.rolloffFactor = e
  44629. }
  44630. ,
  44631. Ci.PositionalAudio.prototype.getRolloffFactor = function() {
  44632. return this.panner.rolloffFactor
  44633. }
  44634. ,
  44635. Ci.PositionalAudio.prototype.setDistanceModel = function(e) {
  44636. this.panner.distanceModel = e
  44637. }
  44638. ,
  44639. Ci.PositionalAudio.prototype.getDistanceModel = function() {
  44640. return this.panner.distanceModel
  44641. }
  44642. ,
  44643. Ci.PositionalAudio.prototype.setMaxDistance = function(e) {
  44644. this.panner.maxDistance = e
  44645. }
  44646. ,
  44647. Ci.PositionalAudio.prototype.getMaxDistance = function() {
  44648. return this.panner.maxDistance
  44649. }
  44650. ,
  44651. Ci.PositionalAudio.prototype.updateMatrixWorld = (it = new Ci.Vector3,
  44652. function(e) {
  44653. Ci.Object3D.prototype.updateMatrixWorld.call(this, e),
  44654. it.setFromMatrixPosition(this.matrixWorld),
  44655. this.panner.setPosition(it.x, it.y, it.z)
  44656. }
  44657. ),
  44658. Ci.AudioListener = function() {
  44659. Ci.Object3D.call(this),
  44660. this.type = "AudioListener",
  44661. this.context = new (window.AudioContext || window.webkitAudioContext),
  44662. this.gain = this.context.createGain(),
  44663. this.gain.connect(this.context.destination),
  44664. this.filter = null
  44665. }
  44666. ,
  44667. Ci.AudioListener.prototype = Object.create(Ci.Object3D.prototype),
  44668. Ci.AudioListener.prototype.constructor = Ci.AudioListener,
  44669. Ci.AudioListener.prototype.getInput = function() {
  44670. return this.gain
  44671. }
  44672. ,
  44673. Ci.AudioListener.prototype.removeFilter = function() {
  44674. null !== this.filter && (this.gain.disconnect(this.filter),
  44675. this.filter.disconnect(this.context.destination),
  44676. this.gain.connect(this.context.destination),
  44677. this.filter = null)
  44678. }
  44679. ,
  44680. Ci.AudioListener.prototype.setFilter = function(e) {
  44681. null !== this.filter ? (this.gain.disconnect(this.filter),
  44682. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  44683. this.filter = e,
  44684. this.gain.connect(this.filter),
  44685. this.filter.connect(this.context.destination)
  44686. }
  44687. ,
  44688. Ci.AudioListener.prototype.getFilter = function() {
  44689. return this.filter
  44690. }
  44691. ,
  44692. Ci.AudioListener.prototype.setMasterVolume = function(e) {
  44693. this.gain.gain.value = e
  44694. }
  44695. ,
  44696. Ci.AudioListener.prototype.getMasterVolume = function() {
  44697. return this.gain.gain.value
  44698. }
  44699. ,
  44700. Ci.AudioListener.prototype.updateMatrixWorld = (Je = new Ci.Vector3,
  44701. $e = new Ci.Quaternion,
  44702. et = new Ci.Vector3,
  44703. tt = new Ci.Vector3,
  44704. function(e) {
  44705. Ci.Object3D.prototype.updateMatrixWorld.call(this, e);
  44706. var t = this.context.listener
  44707. , i = this.up;
  44708. this.matrixWorld.decompose(Je, $e, et),
  44709. tt.set(0, 0, -1).applyQuaternion($e),
  44710. t.setPosition(Je.x, Je.y, Je.z),
  44711. t.setOrientation(tt.x, tt.y, tt.z, i.x, i.y, i.z)
  44712. }
  44713. ),
  44714. Ci.Camera = function() {
  44715. Ci.Object3D.call(this),
  44716. this.type = "Camera",
  44717. this.matrixWorldInverse = new Ci.Matrix4,
  44718. this.projectionMatrix = new Ci.Matrix4
  44719. }
  44720. ,
  44721. Ci.Camera.prototype = Object.create(Ci.Object3D.prototype),
  44722. Ci.Camera.prototype.constructor = Ci.Camera,
  44723. Ci.Camera.prototype.getWorldDirection = (Qe = new Ci.Quaternion,
  44724. function(e) {
  44725. var t = e || new Ci.Vector3;
  44726. return this.getWorldQuaternion(Qe),
  44727. t.set(0, 0, -1).applyQuaternion(Qe)
  44728. }
  44729. ),
  44730. Ci.Camera.prototype.lookAt = (Ke = new Ci.Matrix4,
  44731. function(e) {
  44732. Ke.lookAt(this.position, e, this.up),
  44733. this.quaternion.setFromRotationMatrix(Ke)
  44734. }
  44735. ),
  44736. Ci.Camera.prototype.clone = function() {
  44737. return (new this.constructor).copy(this)
  44738. }
  44739. ,
  44740. Ci.Camera.prototype.copy = function(e) {
  44741. return Ci.Object3D.prototype.copy.call(this, e),
  44742. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  44743. this.projectionMatrix.copy(e.projectionMatrix),
  44744. this
  44745. }
  44746. ,
  44747. Ci.CubeCamera = function(e, t, i) {
  44748. Ci.Object3D.call(this),
  44749. this.type = "CubeCamera";
  44750. var r = new Ci.PerspectiveCamera(90,1,e,t);
  44751. r.up.set(0, -1, 0),
  44752. r.lookAt(new Ci.Vector3(1,0,0)),
  44753. this.add(r);
  44754. var o = new Ci.PerspectiveCamera(90,1,e,t);
  44755. o.up.set(0, -1, 0),
  44756. o.lookAt(new Ci.Vector3(-1,0,0)),
  44757. this.add(o);
  44758. var a = new Ci.PerspectiveCamera(90,1,e,t);
  44759. a.up.set(0, 0, 1),
  44760. a.lookAt(new Ci.Vector3(0,1,0)),
  44761. this.add(a);
  44762. var s = new Ci.PerspectiveCamera(90,1,e,t);
  44763. s.up.set(0, 0, -1),
  44764. s.lookAt(new Ci.Vector3(0,-1,0)),
  44765. this.add(s);
  44766. var l = new Ci.PerspectiveCamera(90,1,e,t);
  44767. l.up.set(0, -1, 0),
  44768. l.lookAt(new Ci.Vector3(0,0,1)),
  44769. this.add(l);
  44770. var c = new Ci.PerspectiveCamera(90,1,e,t);
  44771. c.up.set(0, -1, 0),
  44772. c.lookAt(new Ci.Vector3(0,0,-1)),
  44773. this.add(c);
  44774. var n = {
  44775. format: Ci.RGBFormat,
  44776. magFilter: Ci.LinearFilter,
  44777. minFilter: Ci.LinearFilter
  44778. };
  44779. this.renderTarget = new Ci.WebGLRenderTargetCube(i,i,n),
  44780. this.updateCubeMap = function(e, t) {
  44781. null === this.parent && this.updateMatrixWorld();
  44782. var i = this.renderTarget
  44783. , n = i.texture.generateMipmaps;
  44784. i.texture.generateMipmaps = !1,
  44785. i.activeCubeFace = 0,
  44786. e.render(t, r, i),
  44787. i.activeCubeFace = 1,
  44788. e.render(t, o, i),
  44789. i.activeCubeFace = 2,
  44790. e.render(t, a, i),
  44791. i.activeCubeFace = 3,
  44792. e.render(t, s, i),
  44793. i.activeCubeFace = 4,
  44794. e.render(t, l, i),
  44795. i.texture.generateMipmaps = n,
  44796. i.activeCubeFace = 5,
  44797. e.render(t, c, i),
  44798. e.setRenderTarget(null)
  44799. }
  44800. }
  44801. ,
  44802. Ci.CubeCamera.prototype = Object.create(Ci.Object3D.prototype),
  44803. Ci.CubeCamera.prototype.constructor = Ci.CubeCamera,
  44804. Ci.OrthographicCamera = function(e, t, i, n, r, o) {
  44805. Ci.Camera.call(this),
  44806. this.type = "OrthographicCamera",
  44807. this.zoom = 1,
  44808. this.left = e,
  44809. this.right = t,
  44810. this.top = i,
  44811. this.bottom = n,
  44812. this.near = void 0 !== r ? r : .1,
  44813. this.far = void 0 !== o ? o : 2e3,
  44814. this.updateProjectionMatrix()
  44815. }
  44816. ,
  44817. Ci.OrthographicCamera.prototype = Object.create(Ci.Camera.prototype),
  44818. Ci.OrthographicCamera.prototype.constructor = Ci.OrthographicCamera,
  44819. Ci.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  44820. var e = (this.right - this.left) / (2 * this.zoom)
  44821. , t = (this.top - this.bottom) / (2 * this.zoom)
  44822. , i = (this.right + this.left) / 2
  44823. , n = (this.top + this.bottom) / 2;
  44824. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  44825. }
  44826. ,
  44827. Ci.OrthographicCamera.prototype.copy = function(e) {
  44828. return Ci.Camera.prototype.copy.call(this, e),
  44829. this.left = e.left,
  44830. this.right = e.right,
  44831. this.top = e.top,
  44832. this.bottom = e.bottom,
  44833. this.near = e.near,
  44834. this.far = e.far,
  44835. this.zoom = e.zoom,
  44836. this
  44837. }
  44838. ,
  44839. Ci.OrthographicCamera.prototype.toJSON = function(e) {
  44840. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44841. return t.object.zoom = this.zoom,
  44842. t.object.left = this.left,
  44843. t.object.right = this.right,
  44844. t.object.top = this.top,
  44845. t.object.bottom = this.bottom,
  44846. t.object.near = this.near,
  44847. t.object.far = this.far,
  44848. t
  44849. }
  44850. ,
  44851. Ci.PerspectiveCamera = function(e, t, i, n) {
  44852. Ci.Camera.call(this),
  44853. this.type = "PerspectiveCamera",
  44854. this.focalLength = 10,
  44855. this.zoom = 1,
  44856. this.fov = void 0 !== e ? e : 50,
  44857. this.aspect = void 0 !== t ? t : 1,
  44858. this.near = void 0 !== i ? i : .1,
  44859. this.far = void 0 !== n ? n : 2e3,
  44860. this.updateProjectionMatrix()
  44861. }
  44862. ,
  44863. Ci.PerspectiveCamera.prototype = Object.create(Ci.Camera.prototype),
  44864. Ci.PerspectiveCamera.prototype.constructor = Ci.PerspectiveCamera,
  44865. Ci.PerspectiveCamera.prototype.setLens = function(e, t) {
  44866. void 0 === t && (t = 24),
  44867. this.fov = 2 * Ci.Math.radToDeg(Math.atan(t / (2 * e))),
  44868. this.updateProjectionMatrix()
  44869. }
  44870. ,
  44871. Ci.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  44872. this.fullWidth = e,
  44873. this.fullHeight = t,
  44874. this.x = i,
  44875. this.y = n,
  44876. this.width = r,
  44877. this.height = o,
  44878. this.updateProjectionMatrix()
  44879. }
  44880. ,
  44881. Ci.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  44882. var e = Ci.Math.radToDeg(2 * Math.atan(Math.tan(.5 * Ci.Math.degToRad(this.fov)) / this.zoom));
  44883. if (this.fullWidth) {
  44884. var t = this.fullWidth / this.fullHeight
  44885. , i = Math.tan(Ci.Math.degToRad(.5 * e)) * this.near
  44886. , n = -i
  44887. , r = t * n
  44888. , o = t * i
  44889. , a = Math.abs(o - r)
  44890. , s = Math.abs(i - n);
  44891. 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)
  44892. } else
  44893. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  44894. }
  44895. ,
  44896. Ci.PerspectiveCamera.prototype.copy = function(e) {
  44897. return Ci.Camera.prototype.copy.call(this, e),
  44898. this.focalLength = e.focalLength,
  44899. this.zoom = e.zoom,
  44900. this.fov = e.fov,
  44901. this.aspect = e.aspect,
  44902. this.near = e.near,
  44903. this.far = e.far,
  44904. this
  44905. }
  44906. ,
  44907. Ci.PerspectiveCamera.prototype.toJSON = function(e) {
  44908. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44909. return t.object.focalLength = this.focalLength,
  44910. t.object.zoom = this.zoom,
  44911. t.object.fov = this.fov,
  44912. t.object.aspect = this.aspect,
  44913. t.object.near = this.near,
  44914. t.object.far = this.far,
  44915. t
  44916. }
  44917. ,
  44918. Ci.StereoCamera = function() {
  44919. this.type = "StereoCamera",
  44920. this.aspect = 1,
  44921. this.cameraL = new Ci.PerspectiveCamera,
  44922. this.cameraL.layers.enable(1),
  44923. this.cameraL.matrixAutoUpdate = !1,
  44924. this.cameraR = new Ci.PerspectiveCamera,
  44925. this.cameraR.layers.enable(2),
  44926. this.cameraR.matrixAutoUpdate = !1
  44927. }
  44928. ,
  44929. Ci.StereoCamera.prototype = {
  44930. constructor: Ci.StereoCamera,
  44931. update: (Xe = new Ci.Matrix4,
  44932. Ze = new Ci.Matrix4,
  44933. function(e) {
  44934. if (Ge !== e.focalLength || We !== e.fov || je !== e.aspect * this.aspect || Ye !== e.near || qe !== e.far) {
  44935. Ge = e.focalLength,
  44936. We = e.fov,
  44937. je = e.aspect * this.aspect,
  44938. Ye = e.near,
  44939. qe = e.far;
  44940. var t, i, n = e.projectionMatrix.clone(), r = .032 * Ye / Ge, o = Ye * Math.tan(Ci.Math.degToRad(.5 * We));
  44941. Ze.elements[12] = -.032,
  44942. Xe.elements[12] = .032,
  44943. t = -o * je + r,
  44944. i = o * je + r,
  44945. n.elements[0] = 2 * Ye / (i - t),
  44946. n.elements[8] = (i + t) / (i - t),
  44947. this.cameraL.projectionMatrix.copy(n),
  44948. t = -o * je - r,
  44949. i = o * je - r,
  44950. n.elements[0] = 2 * Ye / (i - t),
  44951. n.elements[8] = (i + t) / (i - t),
  44952. this.cameraR.projectionMatrix.copy(n)
  44953. }
  44954. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ze),
  44955. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Xe)
  44956. }
  44957. )
  44958. },
  44959. Ci.Light = function(e, t) {
  44960. Ci.Object3D.call(this),
  44961. this.type = "Light",
  44962. this.color = new Ci.Color(e),
  44963. this.intensity = void 0 !== t ? t : 1,
  44964. this.receiveShadow = void 0
  44965. }
  44966. ,
  44967. Ci.Light.prototype = Object.create(Ci.Object3D.prototype),
  44968. Ci.Light.prototype.constructor = Ci.Light,
  44969. Ci.Light.prototype.copy = function(e) {
  44970. return Ci.Object3D.prototype.copy.call(this, e),
  44971. this.color.copy(e.color),
  44972. this.intensity = e.intensity,
  44973. this
  44974. }
  44975. ,
  44976. Ci.Light.prototype.toJSON = function(e) {
  44977. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44978. return t.object.color = this.color.getHex(),
  44979. t.object.intensity = this.intensity,
  44980. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  44981. void 0 !== this.distance && (t.object.distance = this.distance),
  44982. void 0 !== this.angle && (t.object.angle = this.angle),
  44983. void 0 !== this.decay && (t.object.decay = this.decay),
  44984. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  44985. t
  44986. }
  44987. ,
  44988. Ci.LightShadow = function(e) {
  44989. this.camera = e,
  44990. this.bias = 0,
  44991. this.radius = 1,
  44992. this.mapSize = new Ci.Vector2(512,512),
  44993. this.map = null,
  44994. this.matrix = new Ci.Matrix4
  44995. }
  44996. ,
  44997. Ci.LightShadow.prototype = {
  44998. constructor: Ci.LightShadow,
  44999. copy: function(e) {
  45000. return this.camera = e.camera.clone(),
  45001. this.bias = e.bias,
  45002. this.radius = e.radius,
  45003. this.mapSize.copy(e.mapSize),
  45004. this
  45005. },
  45006. clone: function() {
  45007. return (new this.constructor).copy(this)
  45008. }
  45009. },
  45010. Ci.AmbientLight = function(e, t) {
  45011. Ci.Light.call(this, e, t),
  45012. this.type = "AmbientLight",
  45013. this.castShadow = void 0
  45014. }
  45015. ,
  45016. Ci.AmbientLight.prototype = Object.create(Ci.Light.prototype),
  45017. Ci.AmbientLight.prototype.constructor = Ci.AmbientLight,
  45018. Ci.DirectionalLight = function(e, t) {
  45019. Ci.Light.call(this, e, t),
  45020. this.type = "DirectionalLight",
  45021. this.position.set(0, 1, 0),
  45022. this.updateMatrix(),
  45023. this.target = new Ci.Object3D,
  45024. this.shadow = new Ci.LightShadow(new Ci.OrthographicCamera(-5,5,5,-5,.5,500))
  45025. }
  45026. ,
  45027. Ci.DirectionalLight.prototype = Object.create(Ci.Light.prototype),
  45028. Ci.DirectionalLight.prototype.constructor = Ci.DirectionalLight,
  45029. Ci.DirectionalLight.prototype.copy = function(e) {
  45030. return Ci.Light.prototype.copy.call(this, e),
  45031. this.target = e.target.clone(),
  45032. this.shadow = e.shadow.clone(),
  45033. this
  45034. }
  45035. ,
  45036. Ci.HemisphereLight = function(e, t, i) {
  45037. Ci.Light.call(this, e, i),
  45038. this.type = "HemisphereLight",
  45039. this.castShadow = void 0,
  45040. this.position.set(0, 1, 0),
  45041. this.updateMatrix(),
  45042. this.groundColor = new Ci.Color(t)
  45043. }
  45044. ,
  45045. Ci.HemisphereLight.prototype = Object.create(Ci.Light.prototype),
  45046. Ci.HemisphereLight.prototype.constructor = Ci.HemisphereLight,
  45047. Ci.HemisphereLight.prototype.copy = function(e) {
  45048. return Ci.Light.prototype.copy.call(this, e),
  45049. this.groundColor.copy(e.groundColor),
  45050. this
  45051. }
  45052. ,
  45053. Ci.PointLight = function(e, t, i, n) {
  45054. Ci.Light.call(this, e, t),
  45055. this.type = "PointLight",
  45056. this.distance = void 0 !== i ? i : 0,
  45057. this.decay = void 0 !== n ? n : 1,
  45058. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(90,1,.5,500))
  45059. }
  45060. ,
  45061. Ci.PointLight.prototype = Object.create(Ci.Light.prototype),
  45062. Ci.PointLight.prototype.constructor = Ci.PointLight,
  45063. Object.defineProperty(Ci.PointLight.prototype, "power", {
  45064. get: function() {
  45065. return 4 * this.intensity * Math.PI
  45066. },
  45067. set: function(e) {
  45068. this.intensity = e / (4 * Math.PI)
  45069. }
  45070. }),
  45071. Ci.PointLight.prototype.copy = function(e) {
  45072. return Ci.Light.prototype.copy.call(this, e),
  45073. this.distance = e.distance,
  45074. this.decay = e.decay,
  45075. this.shadow = e.shadow.clone(),
  45076. this
  45077. }
  45078. ,
  45079. Ci.SpotLight = function(e, t, i, n, r, o) {
  45080. Ci.Light.call(this, e, t),
  45081. this.type = "SpotLight",
  45082. this.position.set(0, 1, 0),
  45083. this.updateMatrix(),
  45084. this.target = new Ci.Object3D,
  45085. this.distance = void 0 !== i ? i : 0,
  45086. this.angle = void 0 !== n ? n : Math.PI / 3,
  45087. this.penumbra = void 0 !== r ? r : 0,
  45088. this.decay = void 0 !== o ? o : 1,
  45089. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(50,1,.5,500))
  45090. }
  45091. ,
  45092. Ci.SpotLight.prototype = Object.create(Ci.Light.prototype),
  45093. Ci.SpotLight.prototype.constructor = Ci.SpotLight,
  45094. Object.defineProperty(Ci.SpotLight.prototype, "power", {
  45095. get: function() {
  45096. return this.intensity * Math.PI
  45097. },
  45098. set: function(e) {
  45099. this.intensity = e / Math.PI
  45100. }
  45101. }),
  45102. Ci.SpotLight.prototype.copy = function(e) {
  45103. return Ci.Light.prototype.copy.call(this, e),
  45104. this.distance = e.distance,
  45105. this.angle = e.angle,
  45106. this.penumbra = e.penumbra,
  45107. this.decay = e.decay,
  45108. this.target = e.target.clone(),
  45109. this.shadow = e.shadow.clone(),
  45110. this
  45111. }
  45112. ,
  45113. Ci.Cache = {
  45114. enabled: !1,
  45115. files: {},
  45116. add: function(e, t) {
  45117. !1 !== this.enabled && (this.files[e] = t)
  45118. },
  45119. get: function(e) {
  45120. if (!1 !== this.enabled)
  45121. return this.files[e]
  45122. },
  45123. remove: function(e) {
  45124. delete this.files[e]
  45125. },
  45126. clear: function() {
  45127. this.files = {}
  45128. }
  45129. },
  45130. Ci.Loader = function() {
  45131. this.onLoadStart = function() {}
  45132. ,
  45133. this.onLoadProgress = function() {}
  45134. ,
  45135. this.onLoadComplete = function() {}
  45136. }
  45137. ,
  45138. Ci.Loader.prototype = {
  45139. constructor: Ci.Loader,
  45140. crossOrigin: void 0,
  45141. extractUrlBase: function(e) {
  45142. var t = e.split("/");
  45143. return 1 === t.length ? "./" : (t.pop(),
  45144. t.join("/") + "/")
  45145. },
  45146. initMaterials: function(e, t, i) {
  45147. for (var n = [], r = 0; r < e.length; ++r)
  45148. n[r] = this.createMaterial(e[r], t, i);
  45149. return n
  45150. },
  45151. createMaterial: function(e, c, h) {
  45152. function t(e, t, i, n, r) {
  45153. var o, a = c + e, s = Ci.Loader.Handlers.get(a);
  45154. o = null !== s ? s.load(a) : (He.setCrossOrigin(h),
  45155. He.load(a)),
  45156. void 0 !== t && (o.repeat.fromArray(t),
  45157. 1 !== t[0] && (o.wrapS = Ci.RepeatWrapping),
  45158. 1 !== t[1] && (o.wrapT = Ci.RepeatWrapping)),
  45159. void 0 !== i && o.offset.fromArray(i),
  45160. void 0 !== n && ("repeat" === n[0] && (o.wrapS = Ci.RepeatWrapping),
  45161. "mirror" === n[0] && (o.wrapS = Ci.MirroredRepeatWrapping),
  45162. "repeat" === n[1] && (o.wrapT = Ci.RepeatWrapping),
  45163. "mirror" === n[1] && (o.wrapT = Ci.MirroredRepeatWrapping)),
  45164. void 0 !== r && (o.anisotropy = r);
  45165. var l = Ci.Math.generateUUID();
  45166. return u[l] = o,
  45167. l
  45168. }
  45169. void 0 === Ue && (Ue = new Ci.Color),
  45170. void 0 === He && (He = new Ci.TextureLoader),
  45171. void 0 === ze && (ze = new Ci.MaterialLoader);
  45172. var u = {}
  45173. , i = {
  45174. uuid: Ci.Math.generateUUID(),
  45175. type: "MeshLambertMaterial"
  45176. };
  45177. for (var n in e) {
  45178. var r = e[n];
  45179. switch (n) {
  45180. case "DbgColor":
  45181. case "DbgIndex":
  45182. case "opticalDensity":
  45183. case "illumination":
  45184. break;
  45185. case "DbgName":
  45186. i.name = r;
  45187. break;
  45188. case "blending":
  45189. i.blending = Ci[r];
  45190. break;
  45191. case "colorAmbient":
  45192. case "mapAmbient":
  45193. console.warn("THREE.Loader.createMaterial:", n, "is no longer supported.");
  45194. break;
  45195. case "colorDiffuse":
  45196. i.color = Ue.fromArray(r).getHex();
  45197. break;
  45198. case "colorSpecular":
  45199. i.specular = Ue.fromArray(r).getHex();
  45200. break;
  45201. case "colorEmissive":
  45202. i.emissive = Ue.fromArray(r).getHex();
  45203. break;
  45204. case "specularCoef":
  45205. i.shininess = r;
  45206. break;
  45207. case "shading":
  45208. "basic" === r.toLowerCase() && (i.type = "MeshBasicMaterial"),
  45209. "phong" === r.toLowerCase() && (i.type = "MeshPhongMaterial");
  45210. break;
  45211. case "mapDiffuse":
  45212. i.map = t(r, e.mapDiffuseRepeat, e.mapDiffuseOffset, e.mapDiffuseWrap, e.mapDiffuseAnisotropy);
  45213. break;
  45214. case "mapDiffuseRepeat":
  45215. case "mapDiffuseOffset":
  45216. case "mapDiffuseWrap":
  45217. case "mapDiffuseAnisotropy":
  45218. break;
  45219. case "mapLight":
  45220. i.lightMap = t(r, e.mapLightRepeat, e.mapLightOffset, e.mapLightWrap, e.mapLightAnisotropy);
  45221. break;
  45222. case "mapLightRepeat":
  45223. case "mapLightOffset":
  45224. case "mapLightWrap":
  45225. case "mapLightAnisotropy":
  45226. break;
  45227. case "mapAO":
  45228. i.aoMap = t(r, e.mapAORepeat, e.mapAOOffset, e.mapAOWrap, e.mapAOAnisotropy);
  45229. break;
  45230. case "mapAORepeat":
  45231. case "mapAOOffset":
  45232. case "mapAOWrap":
  45233. case "mapAOAnisotropy":
  45234. break;
  45235. case "mapBump":
  45236. i.bumpMap = t(r, e.mapBumpRepeat, e.mapBumpOffset, e.mapBumpWrap, e.mapBumpAnisotropy);
  45237. break;
  45238. case "mapBumpScale":
  45239. i.bumpScale = r;
  45240. break;
  45241. case "mapBumpRepeat":
  45242. case "mapBumpOffset":
  45243. case "mapBumpWrap":
  45244. case "mapBumpAnisotropy":
  45245. break;
  45246. case "mapNormal":
  45247. i.normalMap = t(r, e.mapNormalRepeat, e.mapNormalOffset, e.mapNormalWrap, e.mapNormalAnisotropy);
  45248. break;
  45249. case "mapNormalFactor":
  45250. i.normalScale = [r, r];
  45251. break;
  45252. case "mapNormalRepeat":
  45253. case "mapNormalOffset":
  45254. case "mapNormalWrap":
  45255. case "mapNormalAnisotropy":
  45256. break;
  45257. case "mapSpecular":
  45258. i.specularMap = t(r, e.mapSpecularRepeat, e.mapSpecularOffset, e.mapSpecularWrap, e.mapSpecularAnisotropy);
  45259. break;
  45260. case "mapSpecularRepeat":
  45261. case "mapSpecularOffset":
  45262. case "mapSpecularWrap":
  45263. case "mapSpecularAnisotropy":
  45264. break;
  45265. case "mapAlpha":
  45266. i.alphaMap = t(r, e.mapAlphaRepeat, e.mapAlphaOffset, e.mapAlphaWrap, e.mapAlphaAnisotropy);
  45267. break;
  45268. case "mapAlphaRepeat":
  45269. case "mapAlphaOffset":
  45270. case "mapAlphaWrap":
  45271. case "mapAlphaAnisotropy":
  45272. break;
  45273. case "flipSided":
  45274. i.side = Ci.BackSide;
  45275. break;
  45276. case "doubleSided":
  45277. i.side = Ci.DoubleSide;
  45278. break;
  45279. case "transparency":
  45280. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  45281. i.opacity = r;
  45282. break;
  45283. case "depthTest":
  45284. case "depthWrite":
  45285. case "colorWrite":
  45286. case "opacity":
  45287. case "reflectivity":
  45288. case "transparent":
  45289. case "visible":
  45290. case "wireframe":
  45291. i[n] = r;
  45292. break;
  45293. case "vertexColors":
  45294. !0 === r && (i.vertexColors = Ci.VertexColors),
  45295. "face" === r && (i.vertexColors = Ci.FaceColors);
  45296. break;
  45297. default:
  45298. console.error("THREE.Loader.createMaterial: Unsupported", n, r)
  45299. }
  45300. }
  45301. return "MeshBasicMaterial" === i.type && delete i.emissive,
  45302. "MeshPhongMaterial" !== i.type && delete i.specular,
  45303. i.opacity < 1 && (i.transparent = !0),
  45304. ze.setTextures(u),
  45305. ze.parse(i)
  45306. }
  45307. },
  45308. Ci.Loader.Handlers = {
  45309. handlers: [],
  45310. add: function(e, t) {
  45311. this.handlers.push(e, t)
  45312. },
  45313. get: function(e) {
  45314. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  45315. var r = t[i]
  45316. , o = t[i + 1];
  45317. if (r.test(e))
  45318. return o
  45319. }
  45320. return null
  45321. }
  45322. },
  45323. Ci.XHRLoader = function(e) {
  45324. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45325. }
  45326. ,
  45327. Ci.XHRLoader.prototype = {
  45328. constructor: Ci.XHRLoader,
  45329. load: function(i, n, t, r) {
  45330. void 0 !== this.path && (i = this.path + i);
  45331. var o = this
  45332. , e = Ci.Cache.get(i);
  45333. if (void 0 !== e)
  45334. return n && setTimeout(function() {
  45335. n(e)
  45336. }, 0),
  45337. e;
  45338. var a = new XMLHttpRequest;
  45339. return a.overrideMimeType("text/plain"),
  45340. a.open("GET", i, !0),
  45341. a.addEventListener("load", function(e) {
  45342. var t = e.target.response;
  45343. Ci.Cache.add(i, t),
  45344. 200 === this.status ? (n && n(t),
  45345. o.manager.itemEnd(i)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  45346. n && n(t),
  45347. o.manager.itemEnd(i)) : (r && r(e),
  45348. o.manager.itemError(i))
  45349. }, !1),
  45350. void 0 !== t && a.addEventListener("progress", function(e) {
  45351. t(e)
  45352. }, !1),
  45353. a.addEventListener("error", function(e) {
  45354. r && r(e),
  45355. o.manager.itemError(i)
  45356. }, !1),
  45357. void 0 !== this.responseType && (a.responseType = this.responseType),
  45358. void 0 !== this.withCredentials && (a.withCredentials = this.withCredentials),
  45359. a.send(null),
  45360. o.manager.itemStart(i),
  45361. a
  45362. },
  45363. setPath: function(e) {
  45364. this.path = e
  45365. },
  45366. setResponseType: function(e) {
  45367. this.responseType = e
  45368. },
  45369. setWithCredentials: function(e) {
  45370. this.withCredentials = e
  45371. }
  45372. },
  45373. Ci.FontLoader = function(e) {
  45374. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45375. }
  45376. ,
  45377. Ci.FontLoader.prototype = {
  45378. constructor: Ci.FontLoader,
  45379. load: function(e, t, i, n) {
  45380. new Ci.XHRLoader(this.manager).load(e, function(e) {
  45381. t(new Ci.Font(JSON.parse(e.substring(65, e.length - 2))))
  45382. }, i, n)
  45383. }
  45384. },
  45385. Ci.ImageLoader = function(e) {
  45386. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45387. }
  45388. ,
  45389. Ci.ImageLoader.prototype = {
  45390. constructor: Ci.ImageLoader,
  45391. load: function(t, i, n, r) {
  45392. void 0 !== this.path && (t = this.path + t);
  45393. var o = this
  45394. , e = Ci.Cache.get(t);
  45395. if (void 0 !== e)
  45396. return o.manager.itemStart(t),
  45397. i ? setTimeout(function() {
  45398. i(e),
  45399. o.manager.itemEnd(t)
  45400. }, 0) : o.manager.itemEnd(t),
  45401. e;
  45402. var a = document.createElement("img");
  45403. return a.addEventListener("load", function(e) {
  45404. Ci.Cache.add(t, this),
  45405. i && i(this),
  45406. o.manager.itemEnd(t)
  45407. }, !1),
  45408. void 0 !== n && a.addEventListener("progress", function(e) {
  45409. n(e)
  45410. }, !1),
  45411. a.addEventListener("error", function(e) {
  45412. r && r(e),
  45413. o.manager.itemError(t)
  45414. }, !1),
  45415. void 0 !== this.crossOrigin && (a.crossOrigin = this.crossOrigin),
  45416. o.manager.itemStart(t),
  45417. a.src = t,
  45418. a
  45419. },
  45420. setCrossOrigin: function(e) {
  45421. this.crossOrigin = e
  45422. },
  45423. setPath: function(e) {
  45424. this.path = e
  45425. }
  45426. },
  45427. Ci.JSONLoader = function(e) {
  45428. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  45429. e = void 0),
  45430. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45431. this.withCredentials = !1
  45432. }
  45433. ,
  45434. Ci.JSONLoader.prototype = {
  45435. constructor: Ci.JSONLoader,
  45436. get statusDomElement() {
  45437. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  45438. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  45439. this._statusDomElement
  45440. },
  45441. load: function(o, a, e, t) {
  45442. var s = this
  45443. , l = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : Ci.Loader.prototype.extractUrlBase(o)
  45444. , i = new Ci.XHRLoader(this.manager);
  45445. i.setWithCredentials(this.withCredentials),
  45446. i.load(o, function(e) {
  45447. var t = JSON.parse(e)
  45448. , i = t.metadata;
  45449. if (void 0 !== i) {
  45450. var n = i.type;
  45451. if (void 0 !== n) {
  45452. if ("object" === n.toLowerCase())
  45453. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.ObjectLoader instead.");
  45454. if ("scene" === n.toLowerCase())
  45455. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.SceneLoader instead.")
  45456. }
  45457. }
  45458. var r = s.parse(t, l);
  45459. a(r.geometry, r.materials)
  45460. }, e, t)
  45461. },
  45462. setTexturePath: function(e) {
  45463. this.texturePath = e
  45464. },
  45465. parse: function(D, e) {
  45466. var N = new Ci.Geometry
  45467. , t = void 0 !== D.scale ? 1 / D.scale : 1;
  45468. if (function(e) {
  45469. function t(e, t) {
  45470. return e & 1 << t
  45471. }
  45472. 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;
  45473. if (void 0 !== D.uvs) {
  45474. for (i = 0; i < D.uvs.length; i++)
  45475. D.uvs[i].length && L++;
  45476. for (i = 0; i < L; i++)
  45477. N.faceVertexUvs[i] = []
  45478. }
  45479. for (o = 0,
  45480. a = R.length; o < a; )
  45481. (A = new Ci.Vector3).x = R[o++] * e,
  45482. A.y = R[o++] * e,
  45483. A.z = R[o++] * e,
  45484. N.vertices.push(A);
  45485. for (o = 0,
  45486. a = M.length; o < a; )
  45487. if (d = t(u = M[o++], 0),
  45488. p = t(u, 1),
  45489. f = t(u, 3),
  45490. g = t(u, 4),
  45491. m = t(u, 5),
  45492. v = t(u, 6),
  45493. y = t(u, 7),
  45494. d) {
  45495. if ((I = new Ci.Face3).a = M[o],
  45496. I.b = M[o + 1],
  45497. I.c = M[o + 3],
  45498. (E = new Ci.Face3).a = M[o + 1],
  45499. E.b = M[o + 2],
  45500. E.c = M[o + 3],
  45501. o += 4,
  45502. p && (h = M[o++],
  45503. I.materialIndex = h,
  45504. E.materialIndex = h),
  45505. r = N.faces.length,
  45506. f)
  45507. for (i = 0; i < L; i++)
  45508. for (w = D.uvs[i],
  45509. N.faceVertexUvs[i][r] = [],
  45510. N.faceVertexUvs[i][r + 1] = [],
  45511. n = 0; n < 4; n++)
  45512. x = w[2 * (c = M[o++])],
  45513. S = w[2 * c + 1],
  45514. T = new Ci.Vector2(x,S),
  45515. 2 !== n && N.faceVertexUvs[i][r].push(T),
  45516. 0 !== n && N.faceVertexUvs[i][r + 1].push(T);
  45517. if (g && (l = 3 * M[o++],
  45518. I.normal.set(P[l++], P[l++], P[l]),
  45519. E.normal.copy(I.normal)),
  45520. m)
  45521. for (i = 0; i < 4; i++)
  45522. l = 3 * M[o++],
  45523. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45524. 2 !== i && I.vertexNormals.push(b),
  45525. 0 !== i && E.vertexNormals.push(b);
  45526. if (v && (_ = O[s = M[o++]],
  45527. I.color.setHex(_),
  45528. E.color.setHex(_)),
  45529. y)
  45530. for (i = 0; i < 4; i++)
  45531. _ = O[s = M[o++]],
  45532. 2 !== i && I.vertexColors.push(new Ci.Color(_)),
  45533. 0 !== i && E.vertexColors.push(new Ci.Color(_));
  45534. N.faces.push(I),
  45535. N.faces.push(E)
  45536. } else {
  45537. if ((C = new Ci.Face3).a = M[o++],
  45538. C.b = M[o++],
  45539. C.c = M[o++],
  45540. p && (h = M[o++],
  45541. C.materialIndex = h),
  45542. r = N.faces.length,
  45543. f)
  45544. for (i = 0; i < L; i++)
  45545. for (w = D.uvs[i],
  45546. N.faceVertexUvs[i][r] = [],
  45547. n = 0; n < 3; n++)
  45548. x = w[2 * (c = M[o++])],
  45549. S = w[2 * c + 1],
  45550. T = new Ci.Vector2(x,S),
  45551. N.faceVertexUvs[i][r].push(T);
  45552. if (g && (l = 3 * M[o++],
  45553. C.normal.set(P[l++], P[l++], P[l])),
  45554. m)
  45555. for (i = 0; i < 3; i++)
  45556. l = 3 * M[o++],
  45557. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45558. C.vertexNormals.push(b);
  45559. if (v && (s = M[o++],
  45560. C.color.setHex(O[s])),
  45561. y)
  45562. for (i = 0; i < 3; i++)
  45563. s = M[o++],
  45564. C.vertexColors.push(new Ci.Color(O[s]));
  45565. N.faces.push(C)
  45566. }
  45567. }(t),
  45568. function() {
  45569. var e = void 0 !== D.influencesPerVertex ? D.influencesPerVertex : 2;
  45570. if (D.skinWeights)
  45571. for (var t = 0, i = D.skinWeights.length; t < i; t += e) {
  45572. var n = D.skinWeights[t]
  45573. , r = 1 < e ? D.skinWeights[t + 1] : 0
  45574. , o = 2 < e ? D.skinWeights[t + 2] : 0
  45575. , a = 3 < e ? D.skinWeights[t + 3] : 0;
  45576. N.skinWeights.push(new Ci.Vector4(n,r,o,a))
  45577. }
  45578. if (D.skinIndices)
  45579. for (t = 0,
  45580. i = D.skinIndices.length; t < i; t += e) {
  45581. var s = D.skinIndices[t]
  45582. , l = 1 < e ? D.skinIndices[t + 1] : 0
  45583. , c = 2 < e ? D.skinIndices[t + 2] : 0
  45584. , h = 3 < e ? D.skinIndices[t + 3] : 0;
  45585. N.skinIndices.push(new Ci.Vector4(s,l,c,h))
  45586. }
  45587. N.bones = D.bones,
  45588. 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.")
  45589. }(),
  45590. function(e) {
  45591. if (void 0 !== D.morphTargets)
  45592. for (var t = 0, i = D.morphTargets.length; t < i; t++) {
  45593. N.morphTargets[t] = {},
  45594. N.morphTargets[t].name = D.morphTargets[t].name,
  45595. N.morphTargets[t].vertices = [];
  45596. for (var n = N.morphTargets[t].vertices, r = D.morphTargets[t].vertices, o = 0, a = r.length; o < a; o += 3) {
  45597. var s = new Ci.Vector3;
  45598. s.x = r[o] * e,
  45599. s.y = r[o + 1] * e,
  45600. s.z = r[o + 2] * e,
  45601. n.push(s)
  45602. }
  45603. }
  45604. if (void 0 !== D.morphColors && 0 < D.morphColors.length) {
  45605. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  45606. var l = N.faces
  45607. , c = D.morphColors[0].colors;
  45608. for (t = 0,
  45609. i = l.length; t < i; t++)
  45610. l[t].color.fromArray(c, 3 * t)
  45611. }
  45612. }(t),
  45613. function() {
  45614. var e = []
  45615. , t = [];
  45616. void 0 !== D.animation && t.push(D.animation),
  45617. void 0 !== D.animations && (D.animations.length ? t = t.concat(D.animations) : t.push(D.animations));
  45618. for (var i = 0; i < t.length; i++) {
  45619. var n = Ci.AnimationClip.parseAnimation(t[i], N.bones);
  45620. n && e.push(n)
  45621. }
  45622. if (N.morphTargets) {
  45623. var r = Ci.AnimationClip.CreateClipsFromMorphTargetSequences(N.morphTargets, 10);
  45624. e = e.concat(r)
  45625. }
  45626. 0 < e.length && (N.animations = e)
  45627. }(),
  45628. N.computeFaceNormals(),
  45629. N.computeBoundingSphere(),
  45630. void 0 === D.materials || 0 === D.materials.length)
  45631. return {
  45632. geometry: N
  45633. };
  45634. var i = Ci.Loader.prototype.initMaterials(D.materials, e, this.crossOrigin);
  45635. return {
  45636. geometry: N,
  45637. materials: i
  45638. }
  45639. }
  45640. },
  45641. Ci.LoadingManager = function(e, t, i) {
  45642. var n = this
  45643. , r = !1
  45644. , o = 0
  45645. , a = 0;
  45646. this.onStart = void 0,
  45647. this.onLoad = e,
  45648. this.onProgress = t,
  45649. this.onError = i,
  45650. this.itemStart = function(e) {
  45651. a++,
  45652. !1 === r && void 0 !== n.onStart && n.onStart(e, o, a),
  45653. r = !0
  45654. }
  45655. ,
  45656. this.itemEnd = function(e) {
  45657. o++,
  45658. void 0 !== n.onProgress && n.onProgress(e, o, a),
  45659. o === a && (r = !1,
  45660. void 0 !== n.onLoad && n.onLoad())
  45661. }
  45662. ,
  45663. this.itemError = function(e) {
  45664. void 0 !== n.onError && n.onError(e)
  45665. }
  45666. }
  45667. ,
  45668. Ci.DefaultLoadingManager = new Ci.LoadingManager,
  45669. Ci.BufferGeometryLoader = function(e) {
  45670. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45671. }
  45672. ,
  45673. Ci.BufferGeometryLoader.prototype = {
  45674. constructor: Ci.BufferGeometryLoader,
  45675. load: function(e, t, i, n) {
  45676. var r = this;
  45677. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45678. t(r.parse(JSON.parse(e)))
  45679. }, i, n)
  45680. },
  45681. parse: function(e) {
  45682. var t = new Ci.BufferGeometry
  45683. , i = e.data.index
  45684. , n = {
  45685. Int8Array: Int8Array,
  45686. Uint8Array: Uint8Array,
  45687. Uint8ClampedArray: Uint8ClampedArray,
  45688. Int16Array: Int16Array,
  45689. Uint16Array: Uint16Array,
  45690. Int32Array: Int32Array,
  45691. Uint32Array: Uint32Array,
  45692. Float32Array: Float32Array,
  45693. Float64Array: Float64Array
  45694. };
  45695. if (void 0 !== i) {
  45696. var r = new n[i.type](i.array);
  45697. t.setIndex(new Ci.BufferAttribute(r,1))
  45698. }
  45699. var o = e.data.attributes;
  45700. for (var a in o) {
  45701. var s = o[a];
  45702. r = new n[s.type](s.array);
  45703. t.addAttribute(a, new Ci.BufferAttribute(r,s.itemSize))
  45704. }
  45705. var l = e.data.groups || e.data.drawcalls || e.data.offsets;
  45706. if (void 0 !== l)
  45707. for (var c = 0, h = l.length; c !== h; ++c) {
  45708. var u = l[c];
  45709. t.addGroup(u.start, u.count, u.materialIndex)
  45710. }
  45711. var d = e.data.boundingSphere;
  45712. if (void 0 !== d) {
  45713. var p = new Ci.Vector3;
  45714. void 0 !== d.center && p.fromArray(d.center),
  45715. t.boundingSphere = new Ci.Sphere(p,d.radius)
  45716. }
  45717. return t
  45718. }
  45719. },
  45720. Ci.MaterialLoader = function(e) {
  45721. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45722. this.textures = {}
  45723. }
  45724. ,
  45725. Ci.MaterialLoader.prototype = {
  45726. constructor: Ci.MaterialLoader,
  45727. load: function(e, t, i, n) {
  45728. var r = this;
  45729. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45730. t(r.parse(JSON.parse(e)))
  45731. }, i, n)
  45732. },
  45733. setTextures: function(e) {
  45734. this.textures = e
  45735. },
  45736. getTexture: function(e) {
  45737. var t = this.textures;
  45738. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  45739. t[e]
  45740. },
  45741. parse: function(e) {
  45742. var t = new Ci[e.type];
  45743. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  45744. void 0 !== e.name && (t.name = e.name),
  45745. void 0 !== e.color && t.color.setHex(e.color),
  45746. void 0 !== e.roughness && (t.roughness = e.roughness),
  45747. void 0 !== e.metalness && (t.metalness = e.metalness),
  45748. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  45749. void 0 !== e.specular && t.specular.setHex(e.specular),
  45750. void 0 !== e.shininess && (t.shininess = e.shininess),
  45751. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  45752. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  45753. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  45754. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  45755. void 0 !== e.shading && (t.shading = e.shading),
  45756. void 0 !== e.blending && (t.blending = e.blending),
  45757. void 0 !== e.side && (t.side = e.side),
  45758. void 0 !== e.opacity && (t.opacity = e.opacity),
  45759. void 0 !== e.transparent && (t.transparent = e.transparent),
  45760. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  45761. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  45762. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  45763. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  45764. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  45765. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  45766. void 0 !== e.size && (t.size = e.size),
  45767. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  45768. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  45769. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  45770. t.transparent = !0),
  45771. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  45772. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  45773. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  45774. void 0 !== e.normalScale) {
  45775. var i = e.normalScale;
  45776. !1 === Array.isArray(i) && (i = [i, i]),
  45777. t.normalScale = (new Ci.Vector2).fromArray(i)
  45778. }
  45779. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  45780. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  45781. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  45782. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  45783. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  45784. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  45785. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  45786. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  45787. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  45788. t.combine = Ci.MultiplyOperation),
  45789. e.reflectivity && (t.reflectivity = e.reflectivity),
  45790. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  45791. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  45792. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  45793. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  45794. void 0 !== e.materials)
  45795. for (var n = 0, r = e.materials.length; n < r; n++)
  45796. t.materials.push(this.parse(e.materials[n]));
  45797. return t
  45798. }
  45799. },
  45800. Ci.ObjectLoader = function(e) {
  45801. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45802. this.texturePath = ""
  45803. }
  45804. ,
  45805. Ci.ObjectLoader.prototype = {
  45806. constructor: Ci.ObjectLoader,
  45807. load: function(e, t, i, n) {
  45808. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  45809. var r = this;
  45810. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45811. r.parse(JSON.parse(e), t)
  45812. }, i, n)
  45813. },
  45814. setTexturePath: function(e) {
  45815. this.texturePath = e
  45816. },
  45817. setCrossOrigin: function(e) {
  45818. this.crossOrigin = e
  45819. },
  45820. parse: function(e, t) {
  45821. var i = this.parseGeometries(e.geometries)
  45822. , n = this.parseImages(e.images, function() {
  45823. void 0 !== t && t(a)
  45824. })
  45825. , r = this.parseTextures(e.textures, n)
  45826. , o = this.parseMaterials(e.materials, r)
  45827. , a = this.parseObject(e.object, i, o);
  45828. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  45829. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  45830. a
  45831. },
  45832. parseGeometries: function(e) {
  45833. var t = {};
  45834. if (void 0 !== e)
  45835. for (var i = new Ci.JSONLoader, n = new Ci.BufferGeometryLoader, r = 0, o = e.length; r < o; r++) {
  45836. var a, s = e[r];
  45837. switch (s.type) {
  45838. case "PlaneGeometry":
  45839. case "PlaneBufferGeometry":
  45840. a = new Ci[s.type](s.width,s.height,s.widthSegments,s.heightSegments);
  45841. break;
  45842. case "BoxGeometry":
  45843. case "BoxBufferGeometry":
  45844. case "CubeGeometry":
  45845. a = new Ci[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);
  45846. break;
  45847. case "CircleGeometry":
  45848. case "CircleBufferGeometry":
  45849. a = new Ci[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);
  45850. break;
  45851. case "CylinderGeometry":
  45852. case "CylinderBufferGeometry":
  45853. a = new Ci[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);
  45854. break;
  45855. case "SphereGeometry":
  45856. case "SphereBufferGeometry":
  45857. a = new Ci[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);
  45858. break;
  45859. case "DodecahedronGeometry":
  45860. a = new Ci.DodecahedronGeometry(s.radius,s.detail);
  45861. break;
  45862. case "IcosahedronGeometry":
  45863. a = new Ci.IcosahedronGeometry(s.radius,s.detail);
  45864. break;
  45865. case "OctahedronGeometry":
  45866. a = new Ci.OctahedronGeometry(s.radius,s.detail);
  45867. break;
  45868. case "TetrahedronGeometry":
  45869. a = new Ci.TetrahedronGeometry(s.radius,s.detail);
  45870. break;
  45871. case "RingGeometry":
  45872. case "RingBufferGeometry":
  45873. a = new Ci[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);
  45874. break;
  45875. case "TorusGeometry":
  45876. case "TorusBufferGeometry":
  45877. a = new Ci[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);
  45878. break;
  45879. case "TorusKnotGeometry":
  45880. case "TorusKnotBufferGeometry":
  45881. a = new Ci[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);
  45882. break;
  45883. case "LatheGeometry":
  45884. a = new Ci.LatheGeometry(s.points,s.segments,s.phiStart,s.phiLength);
  45885. break;
  45886. case "BufferGeometry":
  45887. a = n.parse(s);
  45888. break;
  45889. case "Geometry":
  45890. a = i.parse(s.data, this.texturePath).geometry;
  45891. break;
  45892. default:
  45893. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + s.type + '"');
  45894. continue
  45895. }
  45896. a.uuid = s.uuid,
  45897. void 0 !== s.name && (a.name = s.name),
  45898. t[s.uuid] = a
  45899. }
  45900. return t
  45901. },
  45902. parseMaterials: function(e, t) {
  45903. var i = {};
  45904. if (void 0 !== e) {
  45905. var n = new Ci.MaterialLoader;
  45906. n.setTextures(t);
  45907. for (var r = 0, o = e.length; r < o; r++) {
  45908. var a = n.parse(e[r]);
  45909. i[a.uuid] = a
  45910. }
  45911. }
  45912. return i
  45913. },
  45914. parseAnimations: function(e) {
  45915. for (var t = [], i = 0; i < e.length; i++) {
  45916. var n = Ci.AnimationClip.parse(e[i]);
  45917. t.push(n)
  45918. }
  45919. return t
  45920. },
  45921. parseImages: function(e, t) {
  45922. function i(e) {
  45923. return n.manager.itemStart(e),
  45924. a.load(e, function() {
  45925. n.manager.itemEnd(e)
  45926. })
  45927. }
  45928. var n = this
  45929. , r = {};
  45930. if (void 0 !== e && 0 < e.length) {
  45931. var o = new Ci.LoadingManager(t)
  45932. , a = new Ci.ImageLoader(o);
  45933. a.setCrossOrigin(this.crossOrigin);
  45934. for (var s = 0, l = e.length; s < l; s++) {
  45935. var c = e[s]
  45936. , h = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url) ? c.url : n.texturePath + c.url;
  45937. r[c.uuid] = i(h)
  45938. }
  45939. }
  45940. return r
  45941. },
  45942. parseTextures: function(e, t) {
  45943. function i(e) {
  45944. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  45945. Ci[e])
  45946. }
  45947. var n = {};
  45948. if (void 0 !== e)
  45949. for (var r = 0, o = e.length; r < o; r++) {
  45950. var a = e[r];
  45951. void 0 === a.image && console.warn('THREE.ObjectLoader: No "image" specified for', a.uuid),
  45952. void 0 === t[a.image] && console.warn("THREE.ObjectLoader: Undefined image", a.image);
  45953. var s = new Ci.Texture(t[a.image]);
  45954. s.needsUpdate = !0,
  45955. s.uuid = a.uuid,
  45956. void 0 !== a.name && (s.name = a.name),
  45957. void 0 !== a.mapping && (s.mapping = i(a.mapping)),
  45958. void 0 !== a.offset && (s.offset = new Ci.Vector2(a.offset[0],a.offset[1])),
  45959. void 0 !== a.repeat && (s.repeat = new Ci.Vector2(a.repeat[0],a.repeat[1])),
  45960. void 0 !== a.minFilter && (s.minFilter = i(a.minFilter)),
  45961. void 0 !== a.magFilter && (s.magFilter = i(a.magFilter)),
  45962. void 0 !== a.anisotropy && (s.anisotropy = a.anisotropy),
  45963. Array.isArray(a.wrap) && (s.wrapS = i(a.wrap[0]),
  45964. s.wrapT = i(a.wrap[1])),
  45965. n[a.uuid] = s
  45966. }
  45967. return n
  45968. },
  45969. parseObject: (ke = new Ci.Matrix4,
  45970. function(e, t, i) {
  45971. function n(e) {
  45972. return void 0 === t[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  45973. t[e]
  45974. }
  45975. function r(e) {
  45976. if (void 0 !== e)
  45977. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  45978. i[e]
  45979. }
  45980. var o;
  45981. switch (e.type) {
  45982. case "Scene":
  45983. o = new Ci.Scene;
  45984. break;
  45985. case "PerspectiveCamera":
  45986. o = new Ci.PerspectiveCamera(e.fov,e.aspect,e.near,e.far);
  45987. break;
  45988. case "OrthographicCamera":
  45989. o = new Ci.OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far);
  45990. break;
  45991. case "AmbientLight":
  45992. o = new Ci.AmbientLight(e.color,e.intensity);
  45993. break;
  45994. case "DirectionalLight":
  45995. o = new Ci.DirectionalLight(e.color,e.intensity);
  45996. break;
  45997. case "PointLight":
  45998. o = new Ci.PointLight(e.color,e.intensity,e.distance,e.decay);
  45999. break;
  46000. case "SpotLight":
  46001. o = new Ci.SpotLight(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);
  46002. break;
  46003. case "HemisphereLight":
  46004. o = new Ci.HemisphereLight(e.color,e.groundColor,e.intensity);
  46005. break;
  46006. case "Mesh":
  46007. var a = n(e.geometry)
  46008. , s = r(e.material);
  46009. o = a.bones && 0 < a.bones.length ? new Ci.SkinnedMesh(a,s) : new Ci.Mesh(a,s);
  46010. break;
  46011. case "LOD":
  46012. o = new Ci.LOD;
  46013. break;
  46014. case "Line":
  46015. o = new Ci.Line(n(e.geometry),r(e.material),e.mode);
  46016. break;
  46017. case "PointCloud":
  46018. case "Points":
  46019. o = new Ci.Points(n(e.geometry),r(e.material));
  46020. break;
  46021. case "Sprite":
  46022. o = new Ci.Sprite(r(e.material));
  46023. break;
  46024. case "Group":
  46025. o = new Ci.Group;
  46026. break;
  46027. default:
  46028. o = new Ci.Object3D
  46029. }
  46030. if (o.uuid = e.uuid,
  46031. void 0 !== e.name && (o.name = e.name),
  46032. void 0 !== e.matrix ? (ke.fromArray(e.matrix),
  46033. ke.decompose(o.position, o.quaternion, o.scale)) : (void 0 !== e.position && o.position.fromArray(e.position),
  46034. void 0 !== e.rotation && o.rotation.fromArray(e.rotation),
  46035. void 0 !== e.scale && o.scale.fromArray(e.scale)),
  46036. void 0 !== e.castShadow && (o.castShadow = e.castShadow),
  46037. void 0 !== e.receiveShadow && (o.receiveShadow = e.receiveShadow),
  46038. void 0 !== e.visible && (o.visible = e.visible),
  46039. void 0 !== e.userData && (o.userData = e.userData),
  46040. void 0 !== e.children)
  46041. for (var l in e.children)
  46042. o.add(this.parseObject(e.children[l], t, i));
  46043. if ("LOD" === e.type)
  46044. for (var c = e.levels, h = 0; h < c.length; h++) {
  46045. var u = c[h];
  46046. void 0 !== (l = o.getObjectByProperty("uuid", u.object)) && o.addLevel(l, u.distance)
  46047. }
  46048. return o
  46049. }
  46050. )
  46051. },
  46052. Ci.TextureLoader = function(e) {
  46053. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46054. }
  46055. ,
  46056. Ci.TextureLoader.prototype = {
  46057. constructor: Ci.TextureLoader,
  46058. load: function(e, t, i, n) {
  46059. var r = new Ci.Texture
  46060. , o = new Ci.ImageLoader(this.manager);
  46061. return o.setCrossOrigin(this.crossOrigin),
  46062. o.setPath(this.path),
  46063. o.load(e, function(e) {
  46064. r.image = e,
  46065. r.needsUpdate = !0,
  46066. void 0 !== t && t(r)
  46067. }, i, n),
  46068. r
  46069. },
  46070. setCrossOrigin: function(e) {
  46071. this.crossOrigin = e
  46072. },
  46073. setPath: function(e) {
  46074. this.path = e
  46075. }
  46076. },
  46077. Ci.CubeTextureLoader = function(e) {
  46078. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46079. }
  46080. ,
  46081. Ci.CubeTextureLoader.prototype = {
  46082. constructor: Ci.CubeTextureLoader,
  46083. load: function(e, i, t, n) {
  46084. function r(t) {
  46085. a.load(e[t], function(e) {
  46086. o.images[t] = e,
  46087. 6 === ++s && (o.needsUpdate = !0,
  46088. i && i(o))
  46089. }, void 0, n)
  46090. }
  46091. var o = new Ci.CubeTexture
  46092. , a = new Ci.ImageLoader(this.manager);
  46093. a.setCrossOrigin(this.crossOrigin),
  46094. a.setPath(this.path);
  46095. for (var s = 0, l = 0; l < e.length; ++l)
  46096. r(l);
  46097. return o
  46098. },
  46099. setCrossOrigin: function(e) {
  46100. this.crossOrigin = e
  46101. },
  46102. setPath: function(e) {
  46103. this.path = e
  46104. }
  46105. },
  46106. Ci.DataTextureLoader = Ci.BinaryTextureLoader = function(e) {
  46107. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46108. this._parser = null
  46109. }
  46110. ,
  46111. Ci.BinaryTextureLoader.prototype = {
  46112. constructor: Ci.BinaryTextureLoader,
  46113. load: function(e, i, t, n) {
  46114. var r = this
  46115. , o = new Ci.DataTexture
  46116. , a = new Ci.XHRLoader(this.manager);
  46117. return a.setResponseType("arraybuffer"),
  46118. a.load(e, function(e) {
  46119. var t = r._parser(e);
  46120. t && (void 0 !== t.image ? o.image = t.image : void 0 !== t.data && (o.image.width = t.width,
  46121. o.image.height = t.height,
  46122. o.image.data = t.data),
  46123. o.wrapS = void 0 !== t.wrapS ? t.wrapS : Ci.ClampToEdgeWrapping,
  46124. o.wrapT = void 0 !== t.wrapT ? t.wrapT : Ci.ClampToEdgeWrapping,
  46125. o.magFilter = void 0 !== t.magFilter ? t.magFilter : Ci.LinearFilter,
  46126. o.minFilter = void 0 !== t.minFilter ? t.minFilter : Ci.LinearMipMapLinearFilter,
  46127. o.anisotropy = void 0 !== t.anisotropy ? t.anisotropy : 1,
  46128. void 0 !== t.format && (o.format = t.format),
  46129. void 0 !== t.type && (o.type = t.type),
  46130. void 0 !== t.mipmaps && (o.mipmaps = t.mipmaps),
  46131. 1 === t.mipmapCount && (o.minFilter = Ci.LinearFilter),
  46132. o.needsUpdate = !0,
  46133. i && i(o, t))
  46134. }, t, n),
  46135. o
  46136. }
  46137. },
  46138. Ci.CompressedTextureLoader = function(e) {
  46139. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46140. this._parser = null
  46141. }
  46142. ,
  46143. Ci.CompressedTextureLoader.prototype = {
  46144. constructor: Ci.CompressedTextureLoader,
  46145. load: function(e, o, t, n) {
  46146. function i(i) {
  46147. r.load(e[i], function(e) {
  46148. var t = a._parser(e, !0);
  46149. s[i] = {
  46150. width: t.width,
  46151. height: t.height,
  46152. format: t.format,
  46153. mipmaps: t.mipmaps
  46154. },
  46155. 6 === (c += 1) && (1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46156. l.format = t.format,
  46157. l.needsUpdate = !0,
  46158. o && o(l))
  46159. }, t, n)
  46160. }
  46161. var a = this
  46162. , s = []
  46163. , l = new Ci.CompressedTexture;
  46164. l.image = s;
  46165. var r = new Ci.XHRLoader(this.manager);
  46166. if (r.setPath(this.path),
  46167. r.setResponseType("arraybuffer"),
  46168. Array.isArray(e))
  46169. for (var c = 0, h = 0, u = e.length; h < u; ++h)
  46170. i(h);
  46171. else
  46172. r.load(e, function(e) {
  46173. var t = a._parser(e, !0);
  46174. if (t.isCubemap)
  46175. for (var i = t.mipmaps.length / t.mipmapCount, n = 0; n < i; n++) {
  46176. s[n] = {
  46177. mipmaps: []
  46178. };
  46179. for (var r = 0; r < t.mipmapCount; r++)
  46180. s[n].mipmaps.push(t.mipmaps[n * t.mipmapCount + r]),
  46181. s[n].format = t.format,
  46182. s[n].width = t.width,
  46183. s[n].height = t.height
  46184. }
  46185. else
  46186. l.image.width = t.width,
  46187. l.image.height = t.height,
  46188. l.mipmaps = t.mipmaps;
  46189. 1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46190. l.format = t.format,
  46191. l.needsUpdate = !0,
  46192. o && o(l)
  46193. }, t, n);
  46194. return l
  46195. },
  46196. setPath: function(e) {
  46197. this.path = e
  46198. }
  46199. },
  46200. Ci.Material = function() {
  46201. Object.defineProperty(this, "id", {
  46202. value: Ci.MaterialIdCount++
  46203. }),
  46204. this.uuid = Ci.Math.generateUUID(),
  46205. this.name = "",
  46206. this.type = "Material",
  46207. this.side = Ci.FrontSide,
  46208. this.opacity = 1,
  46209. this.transparent = !1,
  46210. this.blending = Ci.NormalBlending,
  46211. this.blendSrc = Ci.SrcAlphaFactor,
  46212. this.blendDst = Ci.OneMinusSrcAlphaFactor,
  46213. this.blendEquation = Ci.AddEquation,
  46214. this.blendSrcAlpha = null,
  46215. this.blendDstAlpha = null,
  46216. this.blendEquationAlpha = null,
  46217. this.depthFunc = Ci.LessEqualDepth,
  46218. this.depthTest = !0,
  46219. this.depthWrite = !0,
  46220. this.colorWrite = !0,
  46221. this.precision = null,
  46222. this.polygonOffset = !1,
  46223. this.polygonOffsetFactor = 0,
  46224. this.polygonOffsetUnits = 0,
  46225. this.alphaTest = 0,
  46226. this.premultipliedAlpha = !1,
  46227. this.overdraw = 0,
  46228. this.visible = !0,
  46229. this._needsUpdate = !0
  46230. }
  46231. ,
  46232. Ci.Material.prototype = {
  46233. constructor: Ci.Material,
  46234. get needsUpdate() {
  46235. return this._needsUpdate
  46236. },
  46237. set needsUpdate(e) {
  46238. !0 === e && this.update(),
  46239. this._needsUpdate = e
  46240. },
  46241. setValues: function(e) {
  46242. if (void 0 !== e)
  46243. for (var t in e) {
  46244. var i = e[t];
  46245. if (void 0 !== i) {
  46246. var n = this[t];
  46247. 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.")
  46248. } else
  46249. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  46250. }
  46251. },
  46252. toJSON: function(e) {
  46253. function t(e) {
  46254. var t = [];
  46255. for (var i in e) {
  46256. var n = e[i];
  46257. delete n.metadata,
  46258. t.push(n)
  46259. }
  46260. return t
  46261. }
  46262. var i = void 0 === e;
  46263. i && (e = {
  46264. textures: {},
  46265. images: {}
  46266. });
  46267. var n = {
  46268. metadata: {
  46269. version: 4.4,
  46270. type: "Material",
  46271. generator: "Material.toJSON"
  46272. }
  46273. };
  46274. if (n.uuid = this.uuid,
  46275. n.type = this.type,
  46276. "" !== this.name && (n.name = this.name),
  46277. this.color instanceof Ci.Color && (n.color = this.color.getHex()),
  46278. .5 !== this.roughness && (n.roughness = this.roughness),
  46279. .5 !== this.metalness && (n.metalness = this.metalness),
  46280. this.emissive instanceof Ci.Color && (n.emissive = this.emissive.getHex()),
  46281. this.specular instanceof Ci.Color && (n.specular = this.specular.getHex()),
  46282. void 0 !== this.shininess && (n.shininess = this.shininess),
  46283. this.map instanceof Ci.Texture && (n.map = this.map.toJSON(e).uuid),
  46284. this.alphaMap instanceof Ci.Texture && (n.alphaMap = this.alphaMap.toJSON(e).uuid),
  46285. this.lightMap instanceof Ci.Texture && (n.lightMap = this.lightMap.toJSON(e).uuid),
  46286. this.bumpMap instanceof Ci.Texture && (n.bumpMap = this.bumpMap.toJSON(e).uuid,
  46287. n.bumpScale = this.bumpScale),
  46288. this.normalMap instanceof Ci.Texture && (n.normalMap = this.normalMap.toJSON(e).uuid,
  46289. n.normalScale = this.normalScale.toArray()),
  46290. this.displacementMap instanceof Ci.Texture && (n.displacementMap = this.displacementMap.toJSON(e).uuid,
  46291. n.displacementScale = this.displacementScale,
  46292. n.displacementBias = this.displacementBias),
  46293. this.roughnessMap instanceof Ci.Texture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  46294. this.metalnessMap instanceof Ci.Texture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  46295. this.emissiveMap instanceof Ci.Texture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  46296. this.specularMap instanceof Ci.Texture && (n.specularMap = this.specularMap.toJSON(e).uuid),
  46297. this.envMap instanceof Ci.Texture && (n.envMap = this.envMap.toJSON(e).uuid,
  46298. n.reflectivity = this.reflectivity),
  46299. void 0 !== this.size && (n.size = this.size),
  46300. void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation),
  46301. void 0 !== this.vertexColors && this.vertexColors !== Ci.NoColors && (n.vertexColors = this.vertexColors),
  46302. void 0 !== this.shading && this.shading !== Ci.SmoothShading && (n.shading = this.shading),
  46303. void 0 !== this.blending && this.blending !== Ci.NormalBlending && (n.blending = this.blending),
  46304. void 0 !== this.side && this.side !== Ci.FrontSide && (n.side = this.side),
  46305. this.opacity < 1 && (n.opacity = this.opacity),
  46306. !0 === this.transparent && (n.transparent = this.transparent),
  46307. 0 < this.alphaTest && (n.alphaTest = this.alphaTest),
  46308. !0 === this.premultipliedAlpha && (n.premultipliedAlpha = this.premultipliedAlpha),
  46309. !0 === this.wireframe && (n.wireframe = this.wireframe),
  46310. 1 < this.wireframeLinewidth && (n.wireframeLinewidth = this.wireframeLinewidth),
  46311. i) {
  46312. var r = t(e.textures)
  46313. , o = t(e.images);
  46314. 0 < r.length && (n.textures = r),
  46315. 0 < o.length && (n.images = o)
  46316. }
  46317. return n
  46318. },
  46319. clone: function() {
  46320. return (new this.constructor).copy(this)
  46321. },
  46322. copy: function(e) {
  46323. return this.name = e.name,
  46324. this.side = e.side,
  46325. this.opacity = e.opacity,
  46326. this.transparent = e.transparent,
  46327. this.blending = e.blending,
  46328. this.blendSrc = e.blendSrc,
  46329. this.blendDst = e.blendDst,
  46330. this.blendEquation = e.blendEquation,
  46331. this.blendSrcAlpha = e.blendSrcAlpha,
  46332. this.blendDstAlpha = e.blendDstAlpha,
  46333. this.blendEquationAlpha = e.blendEquationAlpha,
  46334. this.depthFunc = e.depthFunc,
  46335. this.depthTest = e.depthTest,
  46336. this.depthWrite = e.depthWrite,
  46337. this.colorWrite = e.colorWrite,
  46338. this.precision = e.precision,
  46339. this.polygonOffset = e.polygonOffset,
  46340. this.polygonOffsetFactor = e.polygonOffsetFactor,
  46341. this.polygonOffsetUnits = e.polygonOffsetUnits,
  46342. this.alphaTest = e.alphaTest,
  46343. this.premultipliedAlpha = e.premultipliedAlpha,
  46344. this.overdraw = e.overdraw,
  46345. this.visible = e.visible,
  46346. this
  46347. },
  46348. update: function() {
  46349. this.dispatchEvent({
  46350. type: "update"
  46351. })
  46352. },
  46353. dispose: function() {
  46354. this.dispatchEvent({
  46355. type: "dispose"
  46356. })
  46357. }
  46358. },
  46359. Ci.EventDispatcher.prototype.apply(Ci.Material.prototype),
  46360. Ci.MaterialIdCount = 0,
  46361. Ci.LineBasicMaterial = function(e) {
  46362. Ci.Material.call(this),
  46363. this.type = "LineBasicMaterial",
  46364. this.color = new Ci.Color(16777215),
  46365. this.linewidth = 1,
  46366. this.linecap = "round",
  46367. this.linejoin = "round",
  46368. this.blending = Ci.NormalBlending,
  46369. this.vertexColors = Ci.NoColors,
  46370. this.fog = !0,
  46371. this.setValues(e)
  46372. }
  46373. ,
  46374. Ci.LineBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46375. Ci.LineBasicMaterial.prototype.constructor = Ci.LineBasicMaterial,
  46376. Ci.LineBasicMaterial.prototype.copy = function(e) {
  46377. return Ci.Material.prototype.copy.call(this, e),
  46378. this.color.copy(e.color),
  46379. this.linewidth = e.linewidth,
  46380. this.linecap = e.linecap,
  46381. this.linejoin = e.linejoin,
  46382. this.vertexColors = e.vertexColors,
  46383. this.fog = e.fog,
  46384. this
  46385. }
  46386. ,
  46387. Ci.LineDashedMaterial = function(e) {
  46388. Ci.Material.call(this),
  46389. this.type = "LineDashedMaterial",
  46390. this.color = new Ci.Color(16777215),
  46391. this.linewidth = 1,
  46392. this.scale = 1,
  46393. this.dashSize = 3,
  46394. this.gapSize = 1,
  46395. this.blending = Ci.NormalBlending,
  46396. this.vertexColors = Ci.NoColors,
  46397. this.fog = !0,
  46398. this.setValues(e)
  46399. }
  46400. ,
  46401. Ci.LineDashedMaterial.prototype = Object.create(Ci.Material.prototype),
  46402. Ci.LineDashedMaterial.prototype.constructor = Ci.LineDashedMaterial,
  46403. Ci.LineDashedMaterial.prototype.copy = function(e) {
  46404. return Ci.Material.prototype.copy.call(this, e),
  46405. this.color.copy(e.color),
  46406. this.linewidth = e.linewidth,
  46407. this.scale = e.scale,
  46408. this.dashSize = e.dashSize,
  46409. this.gapSize = e.gapSize,
  46410. this.vertexColors = e.vertexColors,
  46411. this.fog = e.fog,
  46412. this
  46413. }
  46414. ,
  46415. Ci.MeshBasicMaterial = function(e) {
  46416. Ci.Material.call(this),
  46417. this.type = "MeshBasicMaterial",
  46418. this.color = new Ci.Color(16777215),
  46419. this.map = null,
  46420. this.aoMap = null,
  46421. this.aoMapIntensity = 1,
  46422. this.specularMap = null,
  46423. this.alphaMap = null,
  46424. this.envMap = null,
  46425. this.combine = Ci.MultiplyOperation,
  46426. this.reflectivity = 1,
  46427. this.refractionRatio = .98,
  46428. this.fog = !0,
  46429. this.shading = Ci.SmoothShading,
  46430. this.blending = Ci.NormalBlending,
  46431. this.wireframe = !1,
  46432. this.wireframeLinewidth = 1,
  46433. this.wireframeLinecap = "round",
  46434. this.wireframeLinejoin = "round",
  46435. this.vertexColors = Ci.NoColors,
  46436. this.skinning = !1,
  46437. this.morphTargets = !1,
  46438. this.setValues(e)
  46439. }
  46440. ,
  46441. Ci.MeshBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46442. Ci.MeshBasicMaterial.prototype.constructor = Ci.MeshBasicMaterial,
  46443. Ci.MeshBasicMaterial.prototype.copy = function(e) {
  46444. return Ci.Material.prototype.copy.call(this, e),
  46445. this.color.copy(e.color),
  46446. this.map = e.map,
  46447. this.aoMap = e.aoMap,
  46448. this.aoMapIntensity = e.aoMapIntensity,
  46449. this.specularMap = e.specularMap,
  46450. this.alphaMap = e.alphaMap,
  46451. this.envMap = e.envMap,
  46452. this.combine = e.combine,
  46453. this.reflectivity = e.reflectivity,
  46454. this.refractionRatio = e.refractionRatio,
  46455. this.fog = e.fog,
  46456. this.shading = e.shading,
  46457. this.wireframe = e.wireframe,
  46458. this.wireframeLinewidth = e.wireframeLinewidth,
  46459. this.wireframeLinecap = e.wireframeLinecap,
  46460. this.wireframeLinejoin = e.wireframeLinejoin,
  46461. this.vertexColors = e.vertexColors,
  46462. this.skinning = e.skinning,
  46463. this.morphTargets = e.morphTargets,
  46464. this
  46465. }
  46466. ,
  46467. Ci.MeshLambertMaterial = function(e) {
  46468. Ci.Material.call(this),
  46469. this.type = "MeshLambertMaterial",
  46470. this.color = new Ci.Color(16777215),
  46471. this.map = null,
  46472. this.lightMap = null,
  46473. this.lightMapIntensity = 1,
  46474. this.aoMap = null,
  46475. this.aoMapIntensity = 1,
  46476. this.emissive = new Ci.Color(0),
  46477. this.emissiveIntensity = 1,
  46478. this.emissiveMap = null,
  46479. this.specularMap = null,
  46480. this.alphaMap = null,
  46481. this.envMap = null,
  46482. this.combine = Ci.MultiplyOperation,
  46483. this.reflectivity = 1,
  46484. this.refractionRatio = .98,
  46485. this.fog = !0,
  46486. this.blending = Ci.NormalBlending,
  46487. this.wireframe = !1,
  46488. this.wireframeLinewidth = 1,
  46489. this.wireframeLinecap = "round",
  46490. this.wireframeLinejoin = "round",
  46491. this.vertexColors = Ci.NoColors,
  46492. this.skinning = !1,
  46493. this.morphTargets = !1,
  46494. this.morphNormals = !1,
  46495. this.setValues(e)
  46496. }
  46497. ,
  46498. Ci.MeshLambertMaterial.prototype = Object.create(Ci.Material.prototype),
  46499. Ci.MeshLambertMaterial.prototype.constructor = Ci.MeshLambertMaterial,
  46500. Ci.MeshLambertMaterial.prototype.copy = function(e) {
  46501. return Ci.Material.prototype.copy.call(this, e),
  46502. this.color.copy(e.color),
  46503. this.map = e.map,
  46504. this.lightMap = e.lightMap,
  46505. this.lightMapIntensity = e.lightMapIntensity,
  46506. this.aoMap = e.aoMap,
  46507. this.aoMapIntensity = e.aoMapIntensity,
  46508. this.emissive.copy(e.emissive),
  46509. this.emissiveMap = e.emissiveMap,
  46510. this.emissiveIntensity = e.emissiveIntensity,
  46511. this.specularMap = e.specularMap,
  46512. this.alphaMap = e.alphaMap,
  46513. this.envMap = e.envMap,
  46514. this.combine = e.combine,
  46515. this.reflectivity = e.reflectivity,
  46516. this.refractionRatio = e.refractionRatio,
  46517. this.fog = e.fog,
  46518. this.wireframe = e.wireframe,
  46519. this.wireframeLinewidth = e.wireframeLinewidth,
  46520. this.wireframeLinecap = e.wireframeLinecap,
  46521. this.wireframeLinejoin = e.wireframeLinejoin,
  46522. this.vertexColors = e.vertexColors,
  46523. this.skinning = e.skinning,
  46524. this.morphTargets = e.morphTargets,
  46525. this.morphNormals = e.morphNormals,
  46526. this
  46527. }
  46528. ,
  46529. Ci.MeshPhongMaterial = function(e) {
  46530. Ci.Material.call(this),
  46531. this.type = "MeshPhongMaterial",
  46532. this.color = new Ci.Color(16777215),
  46533. this.specular = new Ci.Color(1118481),
  46534. this.shininess = 30,
  46535. this.map = null,
  46536. this.lightMap = null,
  46537. this.lightMapIntensity = 1,
  46538. this.aoMap = null,
  46539. this.aoMapIntensity = 1,
  46540. this.emissive = new Ci.Color(0),
  46541. this.emissiveIntensity = 1,
  46542. this.emissiveMap = null,
  46543. this.bumpMap = null,
  46544. this.bumpScale = 1,
  46545. this.normalMap = null,
  46546. this.normalScale = new Ci.Vector2(1,1),
  46547. this.displacementMap = null,
  46548. this.displacementScale = 1,
  46549. this.displacementBias = 0,
  46550. this.specularMap = null,
  46551. this.alphaMap = null,
  46552. this.envMap = null,
  46553. this.combine = Ci.MultiplyOperation,
  46554. this.reflectivity = 1,
  46555. this.refractionRatio = .98,
  46556. this.fog = !0,
  46557. this.shading = Ci.SmoothShading,
  46558. this.blending = Ci.NormalBlending,
  46559. this.wireframe = !1,
  46560. this.wireframeLinewidth = 1,
  46561. this.wireframeLinecap = "round",
  46562. this.wireframeLinejoin = "round",
  46563. this.vertexColors = Ci.NoColors,
  46564. this.skinning = !1,
  46565. this.morphTargets = !1,
  46566. this.morphNormals = !1,
  46567. this.setValues(e)
  46568. }
  46569. ,
  46570. Ci.MeshPhongMaterial.prototype = Object.create(Ci.Material.prototype),
  46571. Ci.MeshPhongMaterial.prototype.constructor = Ci.MeshPhongMaterial,
  46572. Ci.MeshPhongMaterial.prototype.copy = function(e) {
  46573. return Ci.Material.prototype.copy.call(this, e),
  46574. this.color.copy(e.color),
  46575. this.specular.copy(e.specular),
  46576. this.shininess = e.shininess,
  46577. this.map = e.map,
  46578. this.lightMap = e.lightMap,
  46579. this.lightMapIntensity = e.lightMapIntensity,
  46580. this.aoMap = e.aoMap,
  46581. this.aoMapIntensity = e.aoMapIntensity,
  46582. this.emissive.copy(e.emissive),
  46583. this.emissiveMap = e.emissiveMap,
  46584. this.emissiveIntensity = e.emissiveIntensity,
  46585. this.bumpMap = e.bumpMap,
  46586. this.bumpScale = e.bumpScale,
  46587. this.normalMap = e.normalMap,
  46588. this.normalScale.copy(e.normalScale),
  46589. this.displacementMap = e.displacementMap,
  46590. this.displacementScale = e.displacementScale,
  46591. this.displacementBias = e.displacementBias,
  46592. this.specularMap = e.specularMap,
  46593. this.alphaMap = e.alphaMap,
  46594. this.envMap = e.envMap,
  46595. this.combine = e.combine,
  46596. this.reflectivity = e.reflectivity,
  46597. this.refractionRatio = e.refractionRatio,
  46598. this.fog = e.fog,
  46599. this.shading = e.shading,
  46600. this.wireframe = e.wireframe,
  46601. this.wireframeLinewidth = e.wireframeLinewidth,
  46602. this.wireframeLinecap = e.wireframeLinecap,
  46603. this.wireframeLinejoin = e.wireframeLinejoin,
  46604. this.vertexColors = e.vertexColors,
  46605. this.skinning = e.skinning,
  46606. this.morphTargets = e.morphTargets,
  46607. this.morphNormals = e.morphNormals,
  46608. this
  46609. }
  46610. ,
  46611. Ci.MeshStandardMaterial = function(e) {
  46612. Ci.Material.call(this),
  46613. this.type = "MeshStandardMaterial",
  46614. this.color = new Ci.Color(16777215),
  46615. this.roughness = .5,
  46616. this.metalness = .5,
  46617. this.map = null,
  46618. this.lightMap = null,
  46619. this.lightMapIntensity = 1,
  46620. this.aoMap = null,
  46621. this.aoMapIntensity = 1,
  46622. this.emissive = new Ci.Color(0),
  46623. this.emissiveIntensity = 1,
  46624. this.emissiveMap = null,
  46625. this.bumpMap = null,
  46626. this.bumpScale = 1,
  46627. this.normalMap = null,
  46628. this.normalScale = new Ci.Vector2(1,1),
  46629. this.displacementMap = null,
  46630. this.displacementScale = 1,
  46631. this.displacementBias = 0,
  46632. this.roughnessMap = null,
  46633. this.metalnessMap = null,
  46634. this.alphaMap = null,
  46635. this.envMap = null,
  46636. this.envMapIntensity = 1,
  46637. this.refractionRatio = .98,
  46638. this.fog = !0,
  46639. this.shading = Ci.SmoothShading,
  46640. this.blending = Ci.NormalBlending,
  46641. this.wireframe = !1,
  46642. this.wireframeLinewidth = 1,
  46643. this.wireframeLinecap = "round",
  46644. this.wireframeLinejoin = "round",
  46645. this.vertexColors = Ci.NoColors,
  46646. this.skinning = !1,
  46647. this.morphTargets = !1,
  46648. this.morphNormals = !1,
  46649. this.setValues(e)
  46650. }
  46651. ,
  46652. Ci.MeshStandardMaterial.prototype = Object.create(Ci.Material.prototype),
  46653. Ci.MeshStandardMaterial.prototype.constructor = Ci.MeshStandardMaterial,
  46654. Ci.MeshStandardMaterial.prototype.copy = function(e) {
  46655. return Ci.Material.prototype.copy.call(this, e),
  46656. this.color.copy(e.color),
  46657. this.roughness = e.roughness,
  46658. this.metalness = e.metalness,
  46659. this.map = e.map,
  46660. this.lightMap = e.lightMap,
  46661. this.lightMapIntensity = e.lightMapIntensity,
  46662. this.aoMap = e.aoMap,
  46663. this.aoMapIntensity = e.aoMapIntensity,
  46664. this.emissive.copy(e.emissive),
  46665. this.emissiveMap = e.emissiveMap,
  46666. this.emissiveIntensity = e.emissiveIntensity,
  46667. this.bumpMap = e.bumpMap,
  46668. this.bumpScale = e.bumpScale,
  46669. this.normalMap = e.normalMap,
  46670. this.normalScale.copy(e.normalScale),
  46671. this.displacementMap = e.displacementMap,
  46672. this.displacementScale = e.displacementScale,
  46673. this.displacementBias = e.displacementBias,
  46674. this.roughnessMap = e.roughnessMap,
  46675. this.metalnessMap = e.metalnessMap,
  46676. this.alphaMap = e.alphaMap,
  46677. this.envMap = e.envMap,
  46678. this.envMapIntensity = e.envMapIntensity,
  46679. this.refractionRatio = e.refractionRatio,
  46680. this.fog = e.fog,
  46681. this.shading = e.shading,
  46682. this.wireframe = e.wireframe,
  46683. this.wireframeLinewidth = e.wireframeLinewidth,
  46684. this.wireframeLinecap = e.wireframeLinecap,
  46685. this.wireframeLinejoin = e.wireframeLinejoin,
  46686. this.vertexColors = e.vertexColors,
  46687. this.skinning = e.skinning,
  46688. this.morphTargets = e.morphTargets,
  46689. this.morphNormals = e.morphNormals,
  46690. this
  46691. }
  46692. ,
  46693. Ci.MeshDepthMaterial = function(e) {
  46694. Ci.Material.call(this),
  46695. this.type = "MeshDepthMaterial",
  46696. this.morphTargets = !1,
  46697. this.wireframe = !1,
  46698. this.wireframeLinewidth = 1,
  46699. this.setValues(e)
  46700. }
  46701. ,
  46702. Ci.MeshDepthMaterial.prototype = Object.create(Ci.Material.prototype),
  46703. Ci.MeshDepthMaterial.prototype.constructor = Ci.MeshDepthMaterial,
  46704. Ci.MeshDepthMaterial.prototype.copy = function(e) {
  46705. return Ci.Material.prototype.copy.call(this, e),
  46706. this.wireframe = e.wireframe,
  46707. this.wireframeLinewidth = e.wireframeLinewidth,
  46708. this
  46709. }
  46710. ,
  46711. Ci.MeshNormalMaterial = function(e) {
  46712. Ci.Material.call(this, e),
  46713. this.type = "MeshNormalMaterial",
  46714. this.wireframe = !1,
  46715. this.wireframeLinewidth = 1,
  46716. this.morphTargets = !1,
  46717. this.setValues(e)
  46718. }
  46719. ,
  46720. Ci.MeshNormalMaterial.prototype = Object.create(Ci.Material.prototype),
  46721. Ci.MeshNormalMaterial.prototype.constructor = Ci.MeshNormalMaterial,
  46722. Ci.MeshNormalMaterial.prototype.copy = function(e) {
  46723. return Ci.Material.prototype.copy.call(this, e),
  46724. this.wireframe = e.wireframe,
  46725. this.wireframeLinewidth = e.wireframeLinewidth,
  46726. this
  46727. }
  46728. ,
  46729. Ci.MultiMaterial = function(e) {
  46730. this.uuid = Ci.Math.generateUUID(),
  46731. this.type = "MultiMaterial",
  46732. this.materials = e instanceof Array ? e : [],
  46733. this.visible = !0
  46734. }
  46735. ,
  46736. Ci.MultiMaterial.prototype = {
  46737. constructor: Ci.MultiMaterial,
  46738. toJSON: function(e) {
  46739. for (var t = {
  46740. metadata: {
  46741. version: 4.2,
  46742. type: "material",
  46743. generator: "MaterialExporter"
  46744. },
  46745. uuid: this.uuid,
  46746. type: this.type,
  46747. materials: []
  46748. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  46749. var o = i[n].toJSON(e);
  46750. delete o.metadata,
  46751. t.materials.push(o)
  46752. }
  46753. return t.visible = this.visible,
  46754. t
  46755. },
  46756. clone: function() {
  46757. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  46758. e.materials.push(this.materials[t].clone());
  46759. return e.visible = this.visible,
  46760. e
  46761. }
  46762. },
  46763. Ci.PointsMaterial = function(e) {
  46764. Ci.Material.call(this),
  46765. this.type = "PointsMaterial",
  46766. this.color = new Ci.Color(16777215),
  46767. this.map = null,
  46768. this.size = 1,
  46769. this.sizeAttenuation = !0,
  46770. this.blending = Ci.NormalBlending,
  46771. this.vertexColors = Ci.NoColors,
  46772. this.fog = !0,
  46773. this.setValues(e)
  46774. }
  46775. ,
  46776. Ci.PointsMaterial.prototype = Object.create(Ci.Material.prototype),
  46777. Ci.PointsMaterial.prototype.constructor = Ci.PointsMaterial,
  46778. Ci.PointsMaterial.prototype.copy = function(e) {
  46779. return Ci.Material.prototype.copy.call(this, e),
  46780. this.color.copy(e.color),
  46781. this.map = e.map,
  46782. this.size = e.size,
  46783. this.sizeAttenuation = e.sizeAttenuation,
  46784. this.vertexColors = e.vertexColors,
  46785. this.fog = e.fog,
  46786. this
  46787. }
  46788. ,
  46789. Ci.ShaderMaterial = function(e) {
  46790. Ci.Material.call(this),
  46791. this.type = "ShaderMaterial",
  46792. this.defines = {},
  46793. this.uniforms = {},
  46794. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  46795. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  46796. this.shading = Ci.SmoothShading,
  46797. this.linewidth = 1,
  46798. this.wireframe = !1,
  46799. this.wireframeLinewidth = 1,
  46800. this.fog = !1,
  46801. this.lights = !1,
  46802. this.vertexColors = Ci.NoColors,
  46803. this.skinning = !1,
  46804. this.morphTargets = !1,
  46805. this.morphNormals = !1,
  46806. this.extensions = {
  46807. derivatives: !1,
  46808. fragDepth: !1,
  46809. drawBuffers: !1,
  46810. shaderTextureLOD: !1
  46811. },
  46812. this.defaultAttributeValues = {
  46813. color: [1, 1, 1],
  46814. uv: [0, 0],
  46815. uv2: [0, 0]
  46816. },
  46817. (this.index0AttributeName = void 0) !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  46818. this.setValues(e))
  46819. }
  46820. ,
  46821. Ci.ShaderMaterial.prototype = Object.create(Ci.Material.prototype),
  46822. Ci.ShaderMaterial.prototype.constructor = Ci.ShaderMaterial,
  46823. Ci.ShaderMaterial.prototype.copy = function(e) {
  46824. return Ci.Material.prototype.copy.call(this, e),
  46825. this.fragmentShader = e.fragmentShader,
  46826. this.vertexShader = e.vertexShader,
  46827. this.uniforms = Ci.UniformsUtils.clone(e.uniforms),
  46828. this.defines = e.defines,
  46829. this.shading = e.shading,
  46830. this.wireframe = e.wireframe,
  46831. this.wireframeLinewidth = e.wireframeLinewidth,
  46832. this.fog = e.fog,
  46833. this.lights = e.lights,
  46834. this.vertexColors = e.vertexColors,
  46835. this.skinning = e.skinning,
  46836. this.morphTargets = e.morphTargets,
  46837. this.morphNormals = e.morphNormals,
  46838. this.extensions = e.extensions,
  46839. this
  46840. }
  46841. ,
  46842. Ci.ShaderMaterial.prototype.toJSON = function(e) {
  46843. var t = Ci.Material.prototype.toJSON.call(this, e);
  46844. return t.uniforms = this.uniforms,
  46845. t.vertexShader = this.vertexShader,
  46846. t.fragmentShader = this.fragmentShader,
  46847. t
  46848. }
  46849. ,
  46850. Ci.RawShaderMaterial = function(e) {
  46851. Ci.ShaderMaterial.call(this, e),
  46852. this.type = "RawShaderMaterial"
  46853. }
  46854. ,
  46855. Ci.RawShaderMaterial.prototype = Object.create(Ci.ShaderMaterial.prototype),
  46856. Ci.RawShaderMaterial.prototype.constructor = Ci.RawShaderMaterial,
  46857. Ci.SpriteMaterial = function(e) {
  46858. Ci.Material.call(this),
  46859. this.type = "SpriteMaterial",
  46860. this.color = new Ci.Color(16777215),
  46861. this.map = null,
  46862. this.rotation = 0,
  46863. this.fog = !1,
  46864. this.setValues(e)
  46865. }
  46866. ,
  46867. Ci.SpriteMaterial.prototype = Object.create(Ci.Material.prototype),
  46868. Ci.SpriteMaterial.prototype.constructor = Ci.SpriteMaterial,
  46869. Ci.SpriteMaterial.prototype.copy = function(e) {
  46870. return Ci.Material.prototype.copy.call(this, e),
  46871. this.color.copy(e.color),
  46872. this.map = e.map,
  46873. this.rotation = e.rotation,
  46874. this.fog = e.fog,
  46875. this
  46876. }
  46877. ,
  46878. Ci.Texture = function(e, t, i, n, r, o, a, s, l) {
  46879. Object.defineProperty(this, "id", {
  46880. value: Ci.TextureIdCount++
  46881. }),
  46882. this.uuid = Ci.Math.generateUUID(),
  46883. this.name = "",
  46884. this.sourceFile = "",
  46885. this.image = void 0 !== e ? e : Ci.Texture.DEFAULT_IMAGE,
  46886. this.mipmaps = [],
  46887. this.mapping = void 0 !== t ? t : Ci.Texture.DEFAULT_MAPPING,
  46888. this.wrapS = void 0 !== i ? i : Ci.ClampToEdgeWrapping,
  46889. this.wrapT = void 0 !== n ? n : Ci.ClampToEdgeWrapping,
  46890. this.magFilter = void 0 !== r ? r : Ci.LinearFilter,
  46891. this.minFilter = void 0 !== o ? o : Ci.LinearMipMapLinearFilter,
  46892. this.anisotropy = void 0 !== l ? l : 1,
  46893. this.format = void 0 !== a ? a : Ci.RGBAFormat,
  46894. this.type = void 0 !== s ? s : Ci.UnsignedByteType,
  46895. this.offset = new Ci.Vector2(0,0),
  46896. this.repeat = new Ci.Vector2(1,1),
  46897. this.generateMipmaps = !0,
  46898. this.premultiplyAlpha = !1,
  46899. this.flipY = !0,
  46900. this.unpackAlignment = 4,
  46901. this.encoding = Ci.LinearEncoding,
  46902. this.version = 0,
  46903. this.onUpdate = null
  46904. }
  46905. ,
  46906. Ci.Texture.DEFAULT_IMAGE = void 0,
  46907. Ci.Texture.DEFAULT_MAPPING = Ci.UVMapping,
  46908. Ci.Texture.prototype = {
  46909. constructor: Ci.Texture,
  46910. set needsUpdate(e) {
  46911. !0 === e && this.version++
  46912. },
  46913. clone: function() {
  46914. return (new this.constructor).copy(this)
  46915. },
  46916. copy: function(e) {
  46917. return this.image = e.image,
  46918. this.mipmaps = e.mipmaps.slice(0),
  46919. this.mapping = e.mapping,
  46920. this.wrapS = e.wrapS,
  46921. this.wrapT = e.wrapT,
  46922. this.magFilter = e.magFilter,
  46923. this.minFilter = e.minFilter,
  46924. this.anisotropy = e.anisotropy,
  46925. this.format = e.format,
  46926. this.type = e.type,
  46927. this.offset.copy(e.offset),
  46928. this.repeat.copy(e.repeat),
  46929. this.generateMipmaps = e.generateMipmaps,
  46930. this.premultiplyAlpha = e.premultiplyAlpha,
  46931. this.flipY = e.flipY,
  46932. this.unpackAlignment = e.unpackAlignment,
  46933. this.encoding = e.encoding,
  46934. this
  46935. },
  46936. toJSON: function(e) {
  46937. if (void 0 !== e.textures[this.uuid])
  46938. return e.textures[this.uuid];
  46939. var t, i, n = {
  46940. metadata: {
  46941. version: 4.4,
  46942. type: "Texture",
  46943. generator: "Texture.toJSON"
  46944. },
  46945. uuid: this.uuid,
  46946. name: this.name,
  46947. mapping: this.mapping,
  46948. repeat: [this.repeat.x, this.repeat.y],
  46949. offset: [this.offset.x, this.offset.y],
  46950. wrap: [this.wrapS, this.wrapT],
  46951. minFilter: this.minFilter,
  46952. magFilter: this.magFilter,
  46953. anisotropy: this.anisotropy
  46954. };
  46955. if (void 0 !== this.image) {
  46956. var r = this.image;
  46957. void 0 === r.uuid && (r.uuid = Ci.Math.generateUUID()),
  46958. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  46959. uuid: r.uuid,
  46960. url: (t = r,
  46961. void 0 !== t.toDataURL ? i = t : ((i = document.createElement("canvas")).width = t.width,
  46962. i.height = t.height,
  46963. i.getContext("2d").drawImage(t, 0, 0, t.width, t.height)),
  46964. 2048 < i.width || 2048 < i.height ? i.toDataURL("image/jpeg", .6) : i.toDataURL("image/png"))
  46965. }),
  46966. n.image = r.uuid
  46967. }
  46968. return e.textures[this.uuid] = n
  46969. },
  46970. dispose: function() {
  46971. this.dispatchEvent({
  46972. type: "dispose"
  46973. })
  46974. },
  46975. transformUv: function(e) {
  46976. if (this.mapping === Ci.UVMapping) {
  46977. if (e.multiply(this.repeat),
  46978. e.add(this.offset),
  46979. e.x < 0 || 1 < e.x)
  46980. switch (this.wrapS) {
  46981. case Ci.RepeatWrapping:
  46982. e.x = e.x - Math.floor(e.x);
  46983. break;
  46984. case Ci.ClampToEdgeWrapping:
  46985. e.x = e.x < 0 ? 0 : 1;
  46986. break;
  46987. case Ci.MirroredRepeatWrapping:
  46988. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  46989. }
  46990. if (e.y < 0 || 1 < e.y)
  46991. switch (this.wrapT) {
  46992. case Ci.RepeatWrapping:
  46993. e.y = e.y - Math.floor(e.y);
  46994. break;
  46995. case Ci.ClampToEdgeWrapping:
  46996. e.y = e.y < 0 ? 0 : 1;
  46997. break;
  46998. case Ci.MirroredRepeatWrapping:
  46999. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  47000. }
  47001. this.flipY && (e.y = 1 - e.y)
  47002. }
  47003. }
  47004. },
  47005. Ci.EventDispatcher.prototype.apply(Ci.Texture.prototype),
  47006. Ci.TextureIdCount = 0,
  47007. Ci.CanvasTexture = function(e, t, i, n, r, o, a, s, l) {
  47008. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  47009. this.needsUpdate = !0
  47010. }
  47011. ,
  47012. Ci.CanvasTexture.prototype = Object.create(Ci.Texture.prototype),
  47013. Ci.CanvasTexture.prototype.constructor = Ci.CanvasTexture,
  47014. Ci.CubeTexture = function(e, t, i, n, r, o, a, s, l) {
  47015. e = void 0 !== e ? e : [],
  47016. t = void 0 !== t ? t : Ci.CubeReflectionMapping,
  47017. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  47018. this.flipY = !1
  47019. }
  47020. ,
  47021. Ci.CubeTexture.prototype = Object.create(Ci.Texture.prototype),
  47022. Ci.CubeTexture.prototype.constructor = Ci.CubeTexture,
  47023. Object.defineProperty(Ci.CubeTexture.prototype, "images", {
  47024. get: function() {
  47025. return this.image
  47026. },
  47027. set: function(e) {
  47028. this.image = e
  47029. }
  47030. }),
  47031. Ci.CompressedTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  47032. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  47033. this.image = {
  47034. width: t,
  47035. height: i
  47036. },
  47037. this.mipmaps = e,
  47038. this.flipY = !1,
  47039. this.generateMipmaps = !1
  47040. }
  47041. ,
  47042. Ci.CompressedTexture.prototype = Object.create(Ci.Texture.prototype),
  47043. Ci.CompressedTexture.prototype.constructor = Ci.CompressedTexture,
  47044. Ci.DataTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  47045. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  47046. this.image = {
  47047. data: e,
  47048. width: t,
  47049. height: i
  47050. },
  47051. this.magFilter = void 0 !== l ? l : Ci.NearestFilter,
  47052. this.minFilter = void 0 !== c ? c : Ci.NearestFilter,
  47053. this.flipY = !1,
  47054. this.generateMipmaps = !1
  47055. }
  47056. ,
  47057. Ci.DataTexture.prototype = Object.create(Ci.Texture.prototype),
  47058. Ci.DataTexture.prototype.constructor = Ci.DataTexture,
  47059. Ci.VideoTexture = function(t, e, i, n, r, o, a, s, l) {
  47060. Ci.Texture.call(this, t, e, i, n, r, o, a, s, l),
  47061. this.generateMipmaps = !1;
  47062. var c = this;
  47063. !function e() {
  47064. requestAnimationFrame(e),
  47065. !t.paused && t.readyState === t.HAVE_ENOUGH_DATA && (c.needsUpdate = !0)
  47066. }()
  47067. }
  47068. ,
  47069. Ci.VideoTexture.prototype = Object.create(Ci.Texture.prototype),
  47070. Ci.VideoTexture.prototype.constructor = Ci.VideoTexture,
  47071. Ci.Group = function() {
  47072. Ci.Object3D.call(this),
  47073. this.type = "Group"
  47074. }
  47075. ,
  47076. Ci.Group.prototype = Object.create(Ci.Object3D.prototype),
  47077. Ci.Group.prototype.constructor = Ci.Group,
  47078. Ci.Points = function(e, t) {
  47079. Ci.Object3D.call(this),
  47080. this.type = "Points",
  47081. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47082. this.material = void 0 !== t ? t : new Ci.PointsMaterial({
  47083. color: 16777215 * Math.random()
  47084. })
  47085. }
  47086. ,
  47087. Ci.Points.prototype = Object.create(Ci.Object3D.prototype),
  47088. Ci.Points.prototype.constructor = Ci.Points,
  47089. Ci.Points.prototype.raycast = (Wt = new Ci.Matrix4,
  47090. jt = new Ci.Ray,
  47091. Yt = new Ci.Sphere,
  47092. function(o, a) {
  47093. function e(e, t) {
  47094. var i = jt.distanceSqToPoint(e);
  47095. if (i < c) {
  47096. var n = jt.closestPointToPoint(e);
  47097. n.applyMatrix4(l);
  47098. var r = o.ray.origin.distanceTo(n);
  47099. if (r < o.near || r > o.far)
  47100. return;
  47101. a.push({
  47102. distance: r,
  47103. distanceToRay: Math.sqrt(i),
  47104. point: n.clone(),
  47105. index: t,
  47106. face: null,
  47107. object: s
  47108. })
  47109. }
  47110. }
  47111. var s = this
  47112. , t = this.geometry
  47113. , l = this.matrixWorld
  47114. , i = o.params.Points.threshold;
  47115. if (null === t.boundingSphere && t.computeBoundingSphere(),
  47116. Yt.copy(t.boundingSphere),
  47117. Yt.applyMatrix4(l),
  47118. !1 !== o.ray.intersectsSphere(Yt)) {
  47119. Wt.getInverse(l),
  47120. jt.copy(o.ray).applyMatrix4(Wt);
  47121. var n = i / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  47122. , c = n * n
  47123. , r = new Ci.Vector3;
  47124. if (t instanceof Ci.BufferGeometry) {
  47125. var h = t.index
  47126. , u = t.attributes.position.array;
  47127. if (null !== h)
  47128. for (var d = h.array, p = 0, f = d.length; p < f; p++) {
  47129. var g = d[p];
  47130. r.fromArray(u, 3 * g),
  47131. e(r, g)
  47132. }
  47133. else {
  47134. p = 0;
  47135. for (var m = u.length / 3; p < m; p++)
  47136. r.fromArray(u, 3 * p),
  47137. e(r, p)
  47138. }
  47139. } else {
  47140. var v = t.vertices;
  47141. for (p = 0,
  47142. m = v.length; p < m; p++)
  47143. e(v[p], p)
  47144. }
  47145. }
  47146. }
  47147. ),
  47148. Ci.Points.prototype.clone = function() {
  47149. return new this.constructor(this.geometry,this.material).copy(this)
  47150. }
  47151. ,
  47152. Ci.Line = function(e, t, i) {
  47153. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  47154. new Ci.LineSegments(e,t)) : (Ci.Object3D.call(this),
  47155. this.type = "Line",
  47156. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47157. void (this.material = void 0 !== t ? t : new Ci.LineBasicMaterial({
  47158. color: 16777215 * Math.random()
  47159. })))
  47160. }
  47161. ,
  47162. Ci.Line.prototype = Object.create(Ci.Object3D.prototype),
  47163. Ci.Line.prototype.constructor = Ci.Line,
  47164. Ci.Line.prototype.raycast = (Ht = new Ci.Matrix4,
  47165. zt = new Ci.Ray,
  47166. Gt = new Ci.Sphere,
  47167. function(e, t) {
  47168. var i = e.linePrecision
  47169. , n = i * i
  47170. , r = this.geometry
  47171. , o = this.matrixWorld;
  47172. if (null === r.boundingSphere && r.computeBoundingSphere(),
  47173. Gt.copy(r.boundingSphere),
  47174. Gt.applyMatrix4(o),
  47175. !1 !== e.ray.intersectsSphere(Gt)) {
  47176. Ht.getInverse(o),
  47177. zt.copy(e.ray).applyMatrix4(Ht);
  47178. var a = new Ci.Vector3
  47179. , s = new Ci.Vector3
  47180. , l = new Ci.Vector3
  47181. , c = new Ci.Vector3
  47182. , h = this instanceof Ci.LineSegments ? 2 : 1;
  47183. if (r instanceof Ci.BufferGeometry) {
  47184. var u = r.index
  47185. , d = r.attributes.position.array;
  47186. if (null !== u)
  47187. for (var p = u.array, f = 0, g = p.length - 1; f < g; f += h) {
  47188. var m = p[f]
  47189. , v = p[f + 1];
  47190. a.fromArray(d, 3 * m),
  47191. s.fromArray(d, 3 * v),
  47192. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47193. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47194. distance: C,
  47195. point: l.clone().applyMatrix4(this.matrixWorld),
  47196. index: f,
  47197. face: null,
  47198. faceIndex: null,
  47199. object: this
  47200. }))
  47201. }
  47202. else
  47203. for (f = 0,
  47204. g = d.length / 3 - 1; f < g; f += h)
  47205. a.fromArray(d, 3 * f),
  47206. s.fromArray(d, 3 * f + 3),
  47207. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47208. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47209. distance: C,
  47210. point: l.clone().applyMatrix4(this.matrixWorld),
  47211. index: f,
  47212. face: null,
  47213. faceIndex: null,
  47214. object: this
  47215. }))
  47216. } else if (r instanceof Ci.Geometry) {
  47217. var y = r.vertices
  47218. , A = y.length;
  47219. for (f = 0; f < A - 1; f += h) {
  47220. var C;
  47221. n < zt.distanceSqToSegment(y[f], y[f + 1], c, l) || (c.applyMatrix4(this.matrixWorld),
  47222. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47223. distance: C,
  47224. point: l.clone().applyMatrix4(this.matrixWorld),
  47225. index: f,
  47226. face: null,
  47227. faceIndex: null,
  47228. object: this
  47229. }))
  47230. }
  47231. }
  47232. }
  47233. }
  47234. ),
  47235. Ci.Line.prototype.clone = function() {
  47236. return new this.constructor(this.geometry,this.material).copy(this)
  47237. }
  47238. ,
  47239. Ci.LineStrip = 0,
  47240. Ci.LinePieces = 1,
  47241. Ci.LineSegments = function(e, t) {
  47242. Ci.Line.call(this, e, t),
  47243. this.type = "LineSegments"
  47244. }
  47245. ,
  47246. Ci.LineSegments.prototype = Object.create(Ci.Line.prototype),
  47247. Ci.LineSegments.prototype.constructor = Ci.LineSegments,
  47248. Ci.Mesh = function(e, t) {
  47249. Ci.Object3D.call(this),
  47250. this.type = "Mesh",
  47251. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47252. this.material = void 0 !== t ? t : new Ci.MeshBasicMaterial({
  47253. color: 16777215 * Math.random()
  47254. }),
  47255. this.drawMode = Ci.TrianglesDrawMode,
  47256. this.updateMorphTargets()
  47257. }
  47258. ,
  47259. Ci.Mesh.prototype = Object.create(Ci.Object3D.prototype),
  47260. Ci.Mesh.prototype.constructor = Ci.Mesh,
  47261. Ci.Mesh.prototype.setDrawMode = function(e) {
  47262. this.drawMode = e
  47263. }
  47264. ,
  47265. Ci.Mesh.prototype.updateMorphTargets = function() {
  47266. if (void 0 !== this.geometry.morphTargets && 0 < this.geometry.morphTargets.length) {
  47267. this.morphTargetBase = -1,
  47268. this.morphTargetInfluences = [],
  47269. this.morphTargetDictionary = {};
  47270. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  47271. this.morphTargetInfluences.push(0),
  47272. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  47273. }
  47274. }
  47275. ,
  47276. Ci.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  47277. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  47278. 0)
  47279. }
  47280. ,
  47281. Ci.Mesh.prototype.raycast = (Tt = new Ci.Matrix4,
  47282. xt = new Ci.Ray,
  47283. St = new Ci.Sphere,
  47284. Mt = new Ci.Vector3,
  47285. Rt = new Ci.Vector3,
  47286. Pt = new Ci.Vector3,
  47287. Ot = new Ci.Vector3,
  47288. Lt = new Ci.Vector3,
  47289. Dt = new Ci.Vector3,
  47290. Nt = new Ci.Vector2,
  47291. Ft = new Ci.Vector2,
  47292. Bt = new Ci.Vector2,
  47293. Vt = new Ci.Vector3,
  47294. kt = new Ci.Vector3,
  47295. Ut = new Ci.Vector3,
  47296. function(e, t) {
  47297. var i, n, r = this.geometry, o = this.material, a = this.matrixWorld;
  47298. if (void 0 !== o && (null === r.boundingSphere && r.computeBoundingSphere(),
  47299. St.copy(r.boundingSphere),
  47300. St.applyMatrix4(a),
  47301. !1 !== e.ray.intersectsSphere(St) && (Tt.getInverse(a),
  47302. xt.copy(e.ray).applyMatrix4(Tt),
  47303. null === r.boundingBox || !1 !== xt.intersectsBox(r.boundingBox))))
  47304. if (r instanceof Ci.BufferGeometry) {
  47305. var s, l, c, h = r.index, u = r.attributes, d = u.position.array;
  47306. if (void 0 !== u.uv && (i = u.uv.array),
  47307. null !== h)
  47308. for (var p = h.array, f = 0, g = p.length; f < g; f += 3)
  47309. s = p[f],
  47310. l = p[f + 1],
  47311. c = p[f + 2],
  47312. (n = Ti(this, e, xt, d, i, s, l, c)) && (n.faceIndex = Math.floor(f / 3),
  47313. t.push(n));
  47314. else
  47315. for (f = 0,
  47316. g = d.length; f < g; f += 9)
  47317. (n = Ti(this, e, xt, d, i, s = f / 3, l = s + 1, c = s + 2)) && (n.index = s,
  47318. t.push(n))
  47319. } else if (r instanceof Ci.Geometry) {
  47320. var m, v, y, A = o instanceof Ci.MultiMaterial, C = 1 == A ? o.materials : null, I = r.vertices, E = r.faces, _ = r.faceVertexUvs[0];
  47321. 0 < _.length && (i = _);
  47322. for (var b = 0, w = E.length; b < w; b++) {
  47323. var T = E[b]
  47324. , x = 1 == A ? C[T.materialIndex] : o;
  47325. if (void 0 !== x) {
  47326. if (m = I[T.a],
  47327. v = I[T.b],
  47328. y = I[T.c],
  47329. !0 === x.morphTargets) {
  47330. var S = r.morphTargets
  47331. , M = this.morphTargetInfluences;
  47332. Mt.set(0, 0, 0),
  47333. Rt.set(0, 0, 0),
  47334. Pt.set(0, 0, 0);
  47335. for (var R = 0, P = S.length; R < P; R++) {
  47336. var O = M[R];
  47337. if (0 !== O) {
  47338. var L = S[R].vertices;
  47339. Mt.addScaledVector(Ot.subVectors(L[T.a], m), O),
  47340. Rt.addScaledVector(Lt.subVectors(L[T.b], v), O),
  47341. Pt.addScaledVector(Dt.subVectors(L[T.c], y), O)
  47342. }
  47343. }
  47344. Mt.add(m),
  47345. Rt.add(v),
  47346. Pt.add(y),
  47347. m = Mt,
  47348. v = Rt,
  47349. y = Pt
  47350. }
  47351. if (n = wi(this, e, xt, m, v, y, kt)) {
  47352. if (i) {
  47353. var D = i[b];
  47354. Nt.copy(D[0]),
  47355. Ft.copy(D[1]),
  47356. Bt.copy(D[2]),
  47357. n.uv = bi(kt, m, v, y, Nt, Ft, Bt)
  47358. }
  47359. n.face = T,
  47360. n.faceIndex = b,
  47361. t.push(n)
  47362. }
  47363. }
  47364. }
  47365. }
  47366. }
  47367. ),
  47368. Ci.Mesh.prototype.clone = function() {
  47369. return new this.constructor(this.geometry,this.material).copy(this)
  47370. }
  47371. ,
  47372. Ci.Bone = function(e) {
  47373. Ci.Object3D.call(this),
  47374. this.type = "Bone",
  47375. this.skin = e
  47376. }
  47377. ,
  47378. Ci.Bone.prototype = Object.create(Ci.Object3D.prototype),
  47379. Ci.Bone.prototype.constructor = Ci.Bone,
  47380. Ci.Bone.prototype.copy = function(e) {
  47381. return Ci.Object3D.prototype.copy.call(this, e),
  47382. this.skin = e.skin,
  47383. this
  47384. }
  47385. ,
  47386. Ci.Skeleton = function(e, t, i) {
  47387. if (this.useVertexTexture = void 0 === i || i,
  47388. this.identityMatrix = new Ci.Matrix4,
  47389. e = e || [],
  47390. this.bones = e.slice(0),
  47391. this.useVertexTexture) {
  47392. var n = Math.sqrt(4 * this.bones.length);
  47393. n = Ci.Math.nextPowerOfTwo(Math.ceil(n)),
  47394. n = Math.max(n, 4),
  47395. this.boneTextureWidth = n,
  47396. this.boneTextureHeight = n,
  47397. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  47398. this.boneTexture = new Ci.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,Ci.RGBAFormat,Ci.FloatType)
  47399. } else
  47400. this.boneMatrices = new Float32Array(16 * this.bones.length);
  47401. if (void 0 === t)
  47402. this.calculateInverses();
  47403. else if (this.bones.length === t.length)
  47404. this.boneInverses = t.slice(0);
  47405. else {
  47406. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  47407. this.boneInverses = [];
  47408. for (var r = 0, o = this.bones.length; r < o; r++)
  47409. this.boneInverses.push(new Ci.Matrix4)
  47410. }
  47411. }
  47412. ,
  47413. Ci.Skeleton.prototype.calculateInverses = function() {
  47414. this.boneInverses = [];
  47415. for (var e = 0, t = this.bones.length; e < t; e++) {
  47416. var i = new Ci.Matrix4;
  47417. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  47418. this.boneInverses.push(i)
  47419. }
  47420. }
  47421. ,
  47422. Ci.Skeleton.prototype.pose = function() {
  47423. for (var e, t = 0, i = this.bones.length; t < i; t++)
  47424. (e = this.bones[t]) && e.matrixWorld.getInverse(this.boneInverses[t]);
  47425. for (t = 0,
  47426. i = this.bones.length; t < i; t++)
  47427. (e = this.bones[t]) && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  47428. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  47429. e.matrix.decompose(e.position, e.quaternion, e.scale))
  47430. }
  47431. ,
  47432. Ci.Skeleton.prototype.update = (wt = new Ci.Matrix4,
  47433. function() {
  47434. for (var e = 0, t = this.bones.length; e < t; e++) {
  47435. var i = this.bones[e] ? this.bones[e].matrixWorld : this.identityMatrix;
  47436. wt.multiplyMatrices(i, this.boneInverses[e]),
  47437. wt.flattenToArrayOffset(this.boneMatrices, 16 * e)
  47438. }
  47439. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  47440. }
  47441. ),
  47442. Ci.Skeleton.prototype.clone = function() {
  47443. return new Ci.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  47444. }
  47445. ,
  47446. Ci.SkinnedMesh = function(e, t, i) {
  47447. Ci.Mesh.call(this, e, t),
  47448. this.type = "SkinnedMesh",
  47449. this.bindMode = "attached",
  47450. this.bindMatrix = new Ci.Matrix4,
  47451. this.bindMatrixInverse = new Ci.Matrix4;
  47452. var n = [];
  47453. if (this.geometry && void 0 !== this.geometry.bones) {
  47454. for (var r, o, a = 0, s = this.geometry.bones.length; a < s; ++a)
  47455. o = this.geometry.bones[a],
  47456. r = new Ci.Bone(this),
  47457. n.push(r),
  47458. r.name = o.name,
  47459. r.position.fromArray(o.pos),
  47460. r.quaternion.fromArray(o.rotq),
  47461. void 0 !== o.scl && r.scale.fromArray(o.scl);
  47462. for (a = 0,
  47463. s = this.geometry.bones.length; a < s; ++a)
  47464. -1 !== (o = this.geometry.bones[a]).parent && null !== o.parent ? n[o.parent].add(n[a]) : this.add(n[a])
  47465. }
  47466. this.normalizeSkinWeights(),
  47467. this.updateMatrixWorld(!0),
  47468. this.bind(new Ci.Skeleton(n,void 0,i), this.matrixWorld)
  47469. }
  47470. ,
  47471. Ci.SkinnedMesh.prototype = Object.create(Ci.Mesh.prototype),
  47472. Ci.SkinnedMesh.prototype.constructor = Ci.SkinnedMesh,
  47473. Ci.SkinnedMesh.prototype.bind = function(e, t) {
  47474. this.skeleton = e,
  47475. void 0 === t && (this.updateMatrixWorld(!0),
  47476. this.skeleton.calculateInverses(),
  47477. t = this.matrixWorld),
  47478. this.bindMatrix.copy(t),
  47479. this.bindMatrixInverse.getInverse(t)
  47480. }
  47481. ,
  47482. Ci.SkinnedMesh.prototype.pose = function() {
  47483. this.skeleton.pose()
  47484. }
  47485. ,
  47486. Ci.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  47487. if (this.geometry instanceof Ci.Geometry)
  47488. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  47489. var t = this.geometry.skinWeights[e];
  47490. (r = 1 / t.lengthManhattan()) !== 1 / 0 ? t.multiplyScalar(r) : t.set(1, 0, 0, 0)
  47491. }
  47492. else if (this.geometry instanceof Ci.BufferGeometry) {
  47493. var i = new Ci.Vector4
  47494. , n = this.geometry.attributes.skinWeight;
  47495. for (e = 0; e < n.count; e++) {
  47496. var r;
  47497. i.x = n.getX(e),
  47498. i.y = n.getY(e),
  47499. i.z = n.getZ(e),
  47500. i.w = n.getW(e),
  47501. (r = 1 / i.lengthManhattan()) !== 1 / 0 ? i.multiplyScalar(r) : i.set(1, 0, 0, 0),
  47502. n.setXYZW(e, i.x, i.y, i.z, i.w)
  47503. }
  47504. }
  47505. }
  47506. ,
  47507. Ci.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  47508. Ci.Mesh.prototype.updateMatrixWorld.call(this, !0),
  47509. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  47510. }
  47511. ,
  47512. Ci.SkinnedMesh.prototype.clone = function() {
  47513. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  47514. }
  47515. ,
  47516. Ci.LOD = function() {
  47517. Ci.Object3D.call(this),
  47518. this.type = "LOD",
  47519. Object.defineProperties(this, {
  47520. levels: {
  47521. enumerable: !0,
  47522. value: []
  47523. },
  47524. objects: {
  47525. get: function() {
  47526. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  47527. this.levels
  47528. }
  47529. }
  47530. })
  47531. }
  47532. ,
  47533. Ci.LOD.prototype = Object.create(Ci.Object3D.prototype),
  47534. Ci.LOD.prototype.constructor = Ci.LOD,
  47535. Ci.LOD.prototype.addLevel = function(e, t) {
  47536. void 0 === t && (t = 0),
  47537. t = Math.abs(t);
  47538. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  47539. ;
  47540. i.splice(n, 0, {
  47541. distance: t,
  47542. object: e
  47543. }),
  47544. this.add(e)
  47545. }
  47546. ,
  47547. Ci.LOD.prototype.getObjectForDistance = function(e) {
  47548. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  47549. ;
  47550. return t[i - 1].object
  47551. }
  47552. ,
  47553. Ci.LOD.prototype.raycast = (bt = new Ci.Vector3,
  47554. function(e, t) {
  47555. bt.setFromMatrixPosition(this.matrixWorld);
  47556. var i = e.ray.origin.distanceTo(bt);
  47557. this.getObjectForDistance(i).raycast(e, t)
  47558. }
  47559. ),
  47560. Ci.LOD.prototype.update = (Et = new Ci.Vector3,
  47561. _t = new Ci.Vector3,
  47562. function(e) {
  47563. var t = this.levels;
  47564. if (1 < t.length) {
  47565. Et.setFromMatrixPosition(e.matrixWorld),
  47566. _t.setFromMatrixPosition(this.matrixWorld);
  47567. var i = Et.distanceTo(_t);
  47568. t[0].object.visible = !0;
  47569. for (var n = 1, r = t.length; n < r && i >= t[n].distance; n++)
  47570. t[n - 1].object.visible = !1,
  47571. t[n].object.visible = !0;
  47572. for (; n < r; n++)
  47573. t[n].object.visible = !1
  47574. }
  47575. }
  47576. ),
  47577. Ci.LOD.prototype.copy = function(e) {
  47578. Ci.Object3D.prototype.copy.call(this, e, !1);
  47579. for (var t = e.levels, i = 0, n = t.length; i < n; i++) {
  47580. var r = t[i];
  47581. this.addLevel(r.object.clone(), r.distance)
  47582. }
  47583. return this
  47584. }
  47585. ,
  47586. Ci.LOD.prototype.toJSON = function(e) {
  47587. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  47588. t.object.levels = [];
  47589. for (var i = this.levels, n = 0, r = i.length; n < r; n++) {
  47590. var o = i[n];
  47591. t.object.levels.push({
  47592. object: o.object.uuid,
  47593. distance: o.distance
  47594. })
  47595. }
  47596. return t
  47597. }
  47598. ,
  47599. Ci.Sprite = (yt = new Uint16Array([0, 1, 2, 0, 2, 3]),
  47600. At = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0]),
  47601. Ct = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  47602. (It = new Ci.BufferGeometry).setIndex(new Ci.BufferAttribute(yt,1)),
  47603. It.addAttribute("position", new Ci.BufferAttribute(At,3)),
  47604. It.addAttribute("uv", new Ci.BufferAttribute(Ct,2)),
  47605. function(e) {
  47606. Ci.Object3D.call(this),
  47607. this.type = "Sprite",
  47608. this.geometry = It,
  47609. this.material = void 0 !== e ? e : new Ci.SpriteMaterial
  47610. }
  47611. ),
  47612. Ci.Sprite.prototype = Object.create(Ci.Object3D.prototype),
  47613. Ci.Sprite.prototype.constructor = Ci.Sprite,
  47614. Ci.Sprite.prototype.raycast = (vt = new Ci.Vector3,
  47615. function(e, t) {
  47616. vt.setFromMatrixPosition(this.matrixWorld);
  47617. var i = e.ray.distanceSqToPoint(vt);
  47618. this.scale.x * this.scale.y < i || t.push({
  47619. distance: Math.sqrt(i),
  47620. point: this.position,
  47621. face: null,
  47622. object: this
  47623. })
  47624. }
  47625. ),
  47626. Ci.Sprite.prototype.clone = function() {
  47627. return new this.constructor(this.material).copy(this)
  47628. }
  47629. ,
  47630. Ci.Particle = Ci.Sprite,
  47631. Ci.LensFlare = function(e, t, i, n, r) {
  47632. Ci.Object3D.call(this),
  47633. this.lensFlares = [],
  47634. this.positionScreen = new Ci.Vector3,
  47635. (this.customUpdateCallback = void 0) !== e && this.add(e, t, i, n, r)
  47636. }
  47637. ,
  47638. Ci.LensFlare.prototype = Object.create(Ci.Object3D.prototype),
  47639. Ci.LensFlare.prototype.constructor = Ci.LensFlare,
  47640. Ci.LensFlare.prototype.add = function(e, t, i, n, r, o) {
  47641. void 0 === t && (t = -1),
  47642. void 0 === i && (i = 0),
  47643. void 0 === o && (o = 1),
  47644. void 0 === r && (r = new Ci.Color(16777215)),
  47645. void 0 === n && (n = Ci.NormalBlending),
  47646. i = Math.min(i, Math.max(0, i)),
  47647. this.lensFlares.push({
  47648. texture: e,
  47649. size: t,
  47650. distance: i,
  47651. x: 0,
  47652. y: 0,
  47653. z: 0,
  47654. scale: 1,
  47655. rotation: 0,
  47656. opacity: o,
  47657. color: r,
  47658. blending: n
  47659. })
  47660. }
  47661. ,
  47662. Ci.LensFlare.prototype.updateLensFlares = function() {
  47663. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  47664. for (e = 0; e < i; e++)
  47665. (t = this.lensFlares[e]).x = this.positionScreen.x + n * t.distance,
  47666. t.y = this.positionScreen.y + r * t.distance,
  47667. t.wantedRotation = t.x * Math.PI * .25,
  47668. t.rotation += .25 * (t.wantedRotation - t.rotation)
  47669. }
  47670. ,
  47671. Ci.LensFlare.prototype.copy = function(e) {
  47672. Ci.Object3D.prototype.copy.call(this, e),
  47673. this.positionScreen.copy(e.positionScreen),
  47674. this.customUpdateCallback = e.customUpdateCallback;
  47675. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  47676. this.lensFlares.push(e.lensFlares[t]);
  47677. return this
  47678. }
  47679. ,
  47680. Ci.Scene = function() {
  47681. Ci.Object3D.call(this),
  47682. this.type = "Scene",
  47683. this.fog = null,
  47684. this.overrideMaterial = null,
  47685. this.autoUpdate = !0
  47686. }
  47687. ,
  47688. Ci.Scene.prototype = Object.create(Ci.Object3D.prototype),
  47689. Ci.Scene.prototype.constructor = Ci.Scene,
  47690. Ci.Scene.prototype.copy = function(e, t) {
  47691. return Ci.Object3D.prototype.copy.call(this, e, t),
  47692. null !== e.fog && (this.fog = e.fog.clone()),
  47693. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  47694. this.autoUpdate = e.autoUpdate,
  47695. this.matrixAutoUpdate = e.matrixAutoUpdate,
  47696. this
  47697. }
  47698. ,
  47699. Ci.Fog = function(e, t, i) {
  47700. this.name = "",
  47701. this.color = new Ci.Color(e),
  47702. this.near = void 0 !== t ? t : 1,
  47703. this.far = void 0 !== i ? i : 1e3
  47704. }
  47705. ,
  47706. Ci.Fog.prototype.clone = function() {
  47707. return new Ci.Fog(this.color.getHex(),this.near,this.far)
  47708. }
  47709. ,
  47710. Ci.FogExp2 = function(e, t) {
  47711. this.name = "",
  47712. this.color = new Ci.Color(e),
  47713. this.density = void 0 !== t ? t : 25e-5
  47714. }
  47715. ,
  47716. Ci.FogExp2.prototype.clone = function() {
  47717. return new Ci.FogExp2(this.color.getHex(),this.density)
  47718. }
  47719. ,
  47720. Ci.ShaderChunk = {},
  47721. Ci.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  47722. Ci.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  47723. Ci.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  47724. 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",
  47725. Ci.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  47726. Ci.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  47727. Ci.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  47728. 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",
  47729. 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",
  47730. Ci.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  47731. Ci.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  47732. Ci.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  47733. Ci.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  47734. 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",
  47735. 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",
  47736. Ci.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  47737. Ci.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  47738. Ci.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  47739. 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",
  47740. Ci.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  47741. 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",
  47742. Ci.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  47743. 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",
  47744. 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",
  47745. 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",
  47746. 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",
  47747. 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",
  47748. 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",
  47749. Ci.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  47750. Ci.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  47751. 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",
  47752. 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",
  47753. Ci.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  47754. 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",
  47755. Ci.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  47756. Ci.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  47757. 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",
  47758. 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",
  47759. 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",
  47760. Ci.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  47761. 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",
  47762. 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",
  47763. 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",
  47764. Ci.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  47765. Ci.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  47766. 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",
  47767. Ci.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  47768. Ci.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  47769. Ci.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  47770. 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",
  47771. 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",
  47772. 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",
  47773. 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",
  47774. 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",
  47775. Ci.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  47776. 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",
  47777. Ci.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  47778. Ci.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  47779. 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",
  47780. 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",
  47781. 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",
  47782. 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",
  47783. 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",
  47784. 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",
  47785. 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",
  47786. 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",
  47787. 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",
  47788. Ci.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  47789. Ci.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  47790. 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",
  47791. Ci.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  47792. Ci.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  47793. Ci.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  47794. 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",
  47795. 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",
  47796. 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",
  47797. 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",
  47798. Ci.UniformsUtils = {
  47799. merge: function(e) {
  47800. for (var t = {}, i = 0; i < e.length; i++) {
  47801. var n = this.clone(e[i]);
  47802. for (var r in n)
  47803. t[r] = n[r]
  47804. }
  47805. return t
  47806. },
  47807. clone: function(e) {
  47808. var t = {};
  47809. for (var i in e)
  47810. for (var n in t[i] = {},
  47811. e[i]) {
  47812. var r = e[i][n];
  47813. 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
  47814. }
  47815. return t
  47816. }
  47817. },
  47818. Ci.UniformsLib = {
  47819. common: {
  47820. diffuse: {
  47821. type: "c",
  47822. value: new Ci.Color(15658734)
  47823. },
  47824. opacity: {
  47825. type: "f",
  47826. value: 1
  47827. },
  47828. map: {
  47829. type: "t",
  47830. value: null
  47831. },
  47832. offsetRepeat: {
  47833. type: "v4",
  47834. value: new Ci.Vector4(0,0,1,1)
  47835. },
  47836. specularMap: {
  47837. type: "t",
  47838. value: null
  47839. },
  47840. alphaMap: {
  47841. type: "t",
  47842. value: null
  47843. },
  47844. envMap: {
  47845. type: "t",
  47846. value: null
  47847. },
  47848. flipEnvMap: {
  47849. type: "f",
  47850. value: -1
  47851. },
  47852. reflectivity: {
  47853. type: "f",
  47854. value: 1
  47855. },
  47856. refractionRatio: {
  47857. type: "f",
  47858. value: .98
  47859. }
  47860. },
  47861. aomap: {
  47862. aoMap: {
  47863. type: "t",
  47864. value: null
  47865. },
  47866. aoMapIntensity: {
  47867. type: "f",
  47868. value: 1
  47869. }
  47870. },
  47871. lightmap: {
  47872. lightMap: {
  47873. type: "t",
  47874. value: null
  47875. },
  47876. lightMapIntensity: {
  47877. type: "f",
  47878. value: 1
  47879. }
  47880. },
  47881. emissivemap: {
  47882. emissiveMap: {
  47883. type: "t",
  47884. value: null
  47885. }
  47886. },
  47887. bumpmap: {
  47888. bumpMap: {
  47889. type: "t",
  47890. value: null
  47891. },
  47892. bumpScale: {
  47893. type: "f",
  47894. value: 1
  47895. }
  47896. },
  47897. normalmap: {
  47898. normalMap: {
  47899. type: "t",
  47900. value: null
  47901. },
  47902. normalScale: {
  47903. type: "v2",
  47904. value: new Ci.Vector2(1,1)
  47905. }
  47906. },
  47907. displacementmap: {
  47908. displacementMap: {
  47909. type: "t",
  47910. value: null
  47911. },
  47912. displacementScale: {
  47913. type: "f",
  47914. value: 1
  47915. },
  47916. displacementBias: {
  47917. type: "f",
  47918. value: 0
  47919. }
  47920. },
  47921. roughnessmap: {
  47922. roughnessMap: {
  47923. type: "t",
  47924. value: null
  47925. }
  47926. },
  47927. metalnessmap: {
  47928. metalnessMap: {
  47929. type: "t",
  47930. value: null
  47931. }
  47932. },
  47933. fog: {
  47934. fogDensity: {
  47935. type: "f",
  47936. value: 25e-5
  47937. },
  47938. fogNear: {
  47939. type: "f",
  47940. value: 1
  47941. },
  47942. fogFar: {
  47943. type: "f",
  47944. value: 2e3
  47945. },
  47946. fogColor: {
  47947. type: "c",
  47948. value: new Ci.Color(16777215)
  47949. }
  47950. },
  47951. lights: {
  47952. ambientLightColor: {
  47953. type: "fv",
  47954. value: []
  47955. },
  47956. directionalLights: {
  47957. type: "sa",
  47958. value: [],
  47959. properties: {
  47960. direction: {
  47961. type: "v3"
  47962. },
  47963. color: {
  47964. type: "c"
  47965. },
  47966. shadow: {
  47967. type: "i"
  47968. },
  47969. shadowBias: {
  47970. type: "f"
  47971. },
  47972. shadowRadius: {
  47973. type: "f"
  47974. },
  47975. shadowMapSize: {
  47976. type: "v2"
  47977. }
  47978. }
  47979. },
  47980. directionalShadowMap: {
  47981. type: "tv",
  47982. value: []
  47983. },
  47984. directionalShadowMatrix: {
  47985. type: "m4v",
  47986. value: []
  47987. },
  47988. spotLights: {
  47989. type: "sa",
  47990. value: [],
  47991. properties: {
  47992. color: {
  47993. type: "c"
  47994. },
  47995. position: {
  47996. type: "v3"
  47997. },
  47998. direction: {
  47999. type: "v3"
  48000. },
  48001. distance: {
  48002. type: "f"
  48003. },
  48004. coneCos: {
  48005. type: "f"
  48006. },
  48007. penumbraCos: {
  48008. type: "f"
  48009. },
  48010. decay: {
  48011. type: "f"
  48012. },
  48013. shadow: {
  48014. type: "i"
  48015. },
  48016. shadowBias: {
  48017. type: "f"
  48018. },
  48019. shadowRadius: {
  48020. type: "f"
  48021. },
  48022. shadowMapSize: {
  48023. type: "v2"
  48024. }
  48025. }
  48026. },
  48027. spotShadowMap: {
  48028. type: "tv",
  48029. value: []
  48030. },
  48031. spotShadowMatrix: {
  48032. type: "m4v",
  48033. value: []
  48034. },
  48035. pointLights: {
  48036. type: "sa",
  48037. value: [],
  48038. properties: {
  48039. color: {
  48040. type: "c"
  48041. },
  48042. position: {
  48043. type: "v3"
  48044. },
  48045. decay: {
  48046. type: "f"
  48047. },
  48048. distance: {
  48049. type: "f"
  48050. },
  48051. shadow: {
  48052. type: "i"
  48053. },
  48054. shadowBias: {
  48055. type: "f"
  48056. },
  48057. shadowRadius: {
  48058. type: "f"
  48059. },
  48060. shadowMapSize: {
  48061. type: "v2"
  48062. }
  48063. }
  48064. },
  48065. pointShadowMap: {
  48066. type: "tv",
  48067. value: []
  48068. },
  48069. pointShadowMatrix: {
  48070. type: "m4v",
  48071. value: []
  48072. },
  48073. hemisphereLights: {
  48074. type: "sa",
  48075. value: [],
  48076. properties: {
  48077. direction: {
  48078. type: "v3"
  48079. },
  48080. skyColor: {
  48081. type: "c"
  48082. },
  48083. groundColor: {
  48084. type: "c"
  48085. }
  48086. }
  48087. }
  48088. },
  48089. points: {
  48090. diffuse: {
  48091. type: "c",
  48092. value: new Ci.Color(15658734)
  48093. },
  48094. opacity: {
  48095. type: "f",
  48096. value: 1
  48097. },
  48098. size: {
  48099. type: "f",
  48100. value: 1
  48101. },
  48102. scale: {
  48103. type: "f",
  48104. value: 1
  48105. },
  48106. map: {
  48107. type: "t",
  48108. value: null
  48109. },
  48110. offsetRepeat: {
  48111. type: "v4",
  48112. value: new Ci.Vector4(0,0,1,1)
  48113. }
  48114. }
  48115. },
  48116. 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",
  48117. 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",
  48118. 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",
  48119. 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",
  48120. 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",
  48121. 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",
  48122. 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",
  48123. 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",
  48124. 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",
  48125. 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",
  48126. 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",
  48127. 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",
  48128. 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",
  48129. 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",
  48130. 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",
  48131. 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",
  48132. 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",
  48133. 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",
  48134. 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",
  48135. 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",
  48136. 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",
  48137. 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",
  48138. 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",
  48139. 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",
  48140. Ci.ShaderLib = {
  48141. basic: {
  48142. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.fog]),
  48143. vertexShader: Ci.ShaderChunk.meshbasic_vert,
  48144. fragmentShader: Ci.ShaderChunk.meshbasic_frag
  48145. },
  48146. lambert: {
  48147. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  48148. emissive: {
  48149. type: "c",
  48150. value: new Ci.Color(0)
  48151. }
  48152. }]),
  48153. vertexShader: Ci.ShaderChunk.meshlambert_vert,
  48154. fragmentShader: Ci.ShaderChunk.meshlambert_frag
  48155. },
  48156. phong: {
  48157. 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, {
  48158. emissive: {
  48159. type: "c",
  48160. value: new Ci.Color(0)
  48161. },
  48162. specular: {
  48163. type: "c",
  48164. value: new Ci.Color(1118481)
  48165. },
  48166. shininess: {
  48167. type: "f",
  48168. value: 30
  48169. }
  48170. }]),
  48171. vertexShader: Ci.ShaderChunk.meshphong_vert,
  48172. fragmentShader: Ci.ShaderChunk.meshphong_frag
  48173. },
  48174. standard: {
  48175. 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, {
  48176. emissive: {
  48177. type: "c",
  48178. value: new Ci.Color(0)
  48179. },
  48180. roughness: {
  48181. type: "f",
  48182. value: .5
  48183. },
  48184. metalness: {
  48185. type: "f",
  48186. value: 0
  48187. },
  48188. envMapIntensity: {
  48189. type: "f",
  48190. value: 1
  48191. }
  48192. }]),
  48193. vertexShader: Ci.ShaderChunk.meshstandard_vert,
  48194. fragmentShader: Ci.ShaderChunk.meshstandard_frag
  48195. },
  48196. points: {
  48197. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.points, Ci.UniformsLib.fog]),
  48198. vertexShader: Ci.ShaderChunk.points_vert,
  48199. fragmentShader: Ci.ShaderChunk.points_frag
  48200. },
  48201. dashed: {
  48202. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.fog, {
  48203. scale: {
  48204. type: "f",
  48205. value: 1
  48206. },
  48207. dashSize: {
  48208. type: "f",
  48209. value: 1
  48210. },
  48211. totalSize: {
  48212. type: "f",
  48213. value: 2
  48214. }
  48215. }]),
  48216. vertexShader: Ci.ShaderChunk.linedashed_vert,
  48217. fragmentShader: Ci.ShaderChunk.linedashed_frag
  48218. },
  48219. depth: {
  48220. uniforms: {
  48221. mNear: {
  48222. type: "f",
  48223. value: 1
  48224. },
  48225. mFar: {
  48226. type: "f",
  48227. value: 2e3
  48228. },
  48229. opacity: {
  48230. type: "f",
  48231. value: 1
  48232. }
  48233. },
  48234. vertexShader: Ci.ShaderChunk.depth_vert,
  48235. fragmentShader: Ci.ShaderChunk.depth_frag
  48236. },
  48237. normal: {
  48238. uniforms: {
  48239. opacity: {
  48240. type: "f",
  48241. value: 1
  48242. }
  48243. },
  48244. vertexShader: Ci.ShaderChunk.normal_vert,
  48245. fragmentShader: Ci.ShaderChunk.normal_frag
  48246. },
  48247. cube: {
  48248. uniforms: {
  48249. tCube: {
  48250. type: "t",
  48251. value: null
  48252. },
  48253. tFlip: {
  48254. type: "f",
  48255. value: -1
  48256. }
  48257. },
  48258. vertexShader: Ci.ShaderChunk.cube_vert,
  48259. fragmentShader: Ci.ShaderChunk.cube_frag
  48260. },
  48261. equirect: {
  48262. uniforms: {
  48263. tEquirect: {
  48264. type: "t",
  48265. value: null
  48266. },
  48267. tFlip: {
  48268. type: "f",
  48269. value: -1
  48270. }
  48271. },
  48272. vertexShader: Ci.ShaderChunk.equirect_vert,
  48273. fragmentShader: Ci.ShaderChunk.equirect_frag
  48274. },
  48275. depthRGBA: {
  48276. uniforms: {},
  48277. vertexShader: Ci.ShaderChunk.depthRGBA_vert,
  48278. fragmentShader: Ci.ShaderChunk.depthRGBA_frag
  48279. },
  48280. distanceRGBA: {
  48281. uniforms: {
  48282. lightPos: {
  48283. type: "v3",
  48284. value: new Ci.Vector3(0,0,0)
  48285. }
  48286. },
  48287. vertexShader: Ci.ShaderChunk.distanceRGBA_vert,
  48288. fragmentShader: Ci.ShaderChunk.distanceRGBA_frag
  48289. }
  48290. },
  48291. Ci.WebGLRenderer = function(e) {
  48292. function S() {
  48293. return null === Q ? he : 1
  48294. }
  48295. function i(e, t, i, n) {
  48296. !0 === V && (e *= n,
  48297. t *= n,
  48298. i *= n),
  48299. _e.clearColor(e, t, i, n)
  48300. }
  48301. function t() {
  48302. _e.init(),
  48303. _e.scissor(ie.copy(ue).multiplyScalar(he)),
  48304. _e.viewport(re.copy(pe).multiplyScalar(he)),
  48305. i(ae.r, ae.g, ae.b, se)
  48306. }
  48307. function n() {
  48308. te = K = null,
  48309. ee = "",
  48310. $ = -1,
  48311. _e.reset()
  48312. }
  48313. function r(e) {
  48314. e.preventDefault(),
  48315. n(),
  48316. t(),
  48317. be.clear()
  48318. }
  48319. function f(e) {
  48320. var t = e.target;
  48321. t.removeEventListener("dispose", f),
  48322. function(e) {
  48323. var t = be.get(e);
  48324. if (e.image && t.__image__webglTextureCube)
  48325. X.deleteTexture(t.__image__webglTextureCube);
  48326. else {
  48327. if (void 0 === t.__webglInit)
  48328. return;
  48329. X.deleteTexture(t.__webglTexture)
  48330. }
  48331. be.delete(e)
  48332. }(t),
  48333. ye.textures--
  48334. }
  48335. function a(e) {
  48336. var t = e.target;
  48337. t.removeEventListener("dispose", a),
  48338. function(e) {
  48339. var t = be.get(e)
  48340. , i = be.get(e.texture);
  48341. if (e && void 0 !== i.__webglTexture) {
  48342. if (X.deleteTexture(i.__webglTexture),
  48343. e instanceof Ci.WebGLRenderTargetCube)
  48344. for (var n = 0; n < 6; n++)
  48345. X.deleteFramebuffer(t.__webglFramebuffer[n]),
  48346. X.deleteRenderbuffer(t.__webglDepthbuffer[n]);
  48347. else
  48348. X.deleteFramebuffer(t.__webglFramebuffer),
  48349. X.deleteRenderbuffer(t.__webglDepthbuffer);
  48350. be.delete(e.texture),
  48351. be.delete(e)
  48352. }
  48353. }(t),
  48354. ye.textures--
  48355. }
  48356. function v(e) {
  48357. var t = e.target;
  48358. t.removeEventListener("dispose", v),
  48359. function(e) {
  48360. y(e),
  48361. be.delete(e)
  48362. }(t)
  48363. }
  48364. function y(e) {
  48365. var t = be.get(e).program;
  48366. (e.program = void 0) !== t && Te.releaseProgram(t)
  48367. }
  48368. function M(e, t) {
  48369. return Math.abs(t[0]) - Math.abs(e[0])
  48370. }
  48371. function s(e, t) {
  48372. 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
  48373. }
  48374. function l(e, t) {
  48375. 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
  48376. }
  48377. function d(e, t, i, n, r) {
  48378. var o, a;
  48379. a = i.transparent ? (o = G,
  48380. ++W) : (o = H,
  48381. ++z);
  48382. var s = o[a];
  48383. void 0 !== s ? (s.id = e.id,
  48384. s.object = e,
  48385. s.geometry = t,
  48386. s.material = i,
  48387. s.z = me.z,
  48388. s.group = r) : (s = {
  48389. id: e.id,
  48390. object: e,
  48391. geometry: t,
  48392. material: i,
  48393. z: me.z,
  48394. group: r
  48395. },
  48396. o.push(s))
  48397. }
  48398. function c(e, t, i, n) {
  48399. for (var r = 0, o = e.length; r < o; r++) {
  48400. var a = e[r]
  48401. , s = a.object
  48402. , l = a.geometry
  48403. , c = void 0 === n ? a.material : n
  48404. , h = a.group;
  48405. if (s.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, s.matrixWorld),
  48406. s.normalMatrix.getNormalMatrix(s.modelViewMatrix),
  48407. s instanceof Ci.ImmediateRenderObject) {
  48408. R(c);
  48409. var u = P(t, i, c, s);
  48410. ee = "",
  48411. s.render(function(e) {
  48412. Z.renderBufferImmediate(e, u, c)
  48413. })
  48414. } else
  48415. Z.renderBufferDirect(t, i, l, c, s, h)
  48416. }
  48417. }
  48418. function R(e) {
  48419. (function(e) {
  48420. e.side !== Ci.DoubleSide ? _e.enable(X.CULL_FACE) : _e.disable(X.CULL_FACE),
  48421. _e.setFlipSided(e.side === Ci.BackSide)
  48422. }
  48423. )(e),
  48424. !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),
  48425. _e.setDepthFunc(e.depthFunc),
  48426. _e.setDepthTest(e.depthTest),
  48427. _e.setDepthWrite(e.depthWrite),
  48428. _e.setColorWrite(e.colorWrite),
  48429. _e.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  48430. }
  48431. function P(e, t, i, n) {
  48432. oe = 0;
  48433. var r = be.get(i);
  48434. void 0 === r.program && (i.needsUpdate = !0),
  48435. void 0 !== r.lightsHash && r.lightsHash !== ve.hash && (i.needsUpdate = !0),
  48436. i.needsUpdate && (function(e, t, i) {
  48437. var n = be.get(e)
  48438. , r = Te.getParameters(e, ve, t, i)
  48439. , o = Te.getProgramCode(e, r)
  48440. , a = n.program
  48441. , s = !0;
  48442. if (void 0 === a)
  48443. e.addEventListener("dispose", v);
  48444. else if (a.code !== o)
  48445. y(e);
  48446. else {
  48447. if (void 0 !== r.shaderID)
  48448. return;
  48449. s = !1
  48450. }
  48451. if (s) {
  48452. if (r.shaderID) {
  48453. var l = Ci.ShaderLib[r.shaderID];
  48454. n.__webglShader = {
  48455. name: e.type,
  48456. uniforms: Ci.UniformsUtils.clone(l.uniforms),
  48457. vertexShader: l.vertexShader,
  48458. fragmentShader: l.fragmentShader
  48459. }
  48460. } else
  48461. n.__webglShader = {
  48462. name: e.type,
  48463. uniforms: e.uniforms,
  48464. vertexShader: e.vertexShader,
  48465. fragmentShader: e.fragmentShader
  48466. };
  48467. e.__webglShader = n.__webglShader,
  48468. a = Te.acquireProgram(e, r, o),
  48469. n.program = a,
  48470. e.program = a
  48471. }
  48472. var c = a.getAttributes();
  48473. if (e.morphTargets)
  48474. for (var h = e.numSupportedMorphTargets = 0; h < Z.maxMorphTargets; h++)
  48475. 0 <= c["morphTarget" + h] && e.numSupportedMorphTargets++;
  48476. if (e.morphNormals)
  48477. for (h = e.numSupportedMorphNormals = 0; h < Z.maxMorphNormals; h++)
  48478. 0 <= c["morphNormal" + h] && e.numSupportedMorphNormals++;
  48479. n.uniformsList = [];
  48480. var u = n.__webglShader.uniforms
  48481. , d = n.program.getUniforms();
  48482. for (var p in u) {
  48483. var f = d[p];
  48484. f && n.uniformsList.push([n.__webglShader.uniforms[p], f])
  48485. }
  48486. (e instanceof Ci.MeshPhongMaterial || e instanceof Ci.MeshLambertMaterial || e instanceof Ci.MeshStandardMaterial || e.lights) && (n.lightsHash = ve.hash,
  48487. u.ambientLightColor.value = ve.ambient,
  48488. u.directionalLights.value = ve.directional,
  48489. u.spotLights.value = ve.spot,
  48490. u.pointLights.value = ve.point,
  48491. u.hemisphereLights.value = ve.hemi,
  48492. u.directionalShadowMap.value = ve.directionalShadowMap,
  48493. u.directionalShadowMatrix.value = ve.directionalShadowMatrix,
  48494. u.spotShadowMap.value = ve.spotShadowMap,
  48495. u.spotShadowMatrix.value = ve.spotShadowMatrix,
  48496. u.pointShadowMap.value = ve.pointShadowMap,
  48497. u.pointShadowMatrix.value = ve.pointShadowMatrix),
  48498. n.hasDynamicUniforms = !1;
  48499. for (var g = 0, m = n.uniformsList.length; g < m; g++) {
  48500. if (!0 === n.uniformsList[g][0].dynamic) {
  48501. n.hasDynamicUniforms = !0;
  48502. break
  48503. }
  48504. }
  48505. }(i, t, n),
  48506. i.needsUpdate = !1);
  48507. var o = !1
  48508. , a = !1
  48509. , s = !1
  48510. , l = r.program
  48511. , c = l.getUniforms()
  48512. , h = r.__webglShader.uniforms;
  48513. if (l.id !== K && (X.useProgram(l.program),
  48514. K = l.id,
  48515. s = a = o = !0),
  48516. i.id !== $ && ($ = i.id,
  48517. a = !0),
  48518. !o && e === te || (X.uniformMatrix4fv(c.projectionMatrix, !1, e.projectionMatrix.elements),
  48519. Ee.logarithmicDepthBuffer && X.uniform1f(c.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  48520. e !== te && (te = e,
  48521. s = a = !0),
  48522. (i instanceof Ci.ShaderMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial || i.envMap) && void 0 !== c.cameraPosition && (me.setFromMatrixPosition(e.matrixWorld),
  48523. X.uniform3f(c.cameraPosition, me.x, me.y, me.z)),
  48524. (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),
  48525. void 0 !== c.toneMappingExposure && X.uniform1f(c.toneMappingExposure, Z.toneMappingExposure),
  48526. void 0 !== c.toneMappingWhitePoint && X.uniform1f(c.toneMappingWhitePoint, Z.toneMappingWhitePoint)),
  48527. i.skinning)
  48528. if (n.bindMatrix && void 0 !== c.bindMatrix && X.uniformMatrix4fv(c.bindMatrix, !1, n.bindMatrix.elements),
  48529. n.bindMatrixInverse && void 0 !== c.bindMatrixInverse && X.uniformMatrix4fv(c.bindMatrixInverse, !1, n.bindMatrixInverse.elements),
  48530. Ee.floatVertexTextures && n.skeleton && n.skeleton.useVertexTexture) {
  48531. if (void 0 !== c.boneTexture) {
  48532. var u = A();
  48533. X.uniform1i(c.boneTexture, u),
  48534. Z.setTexture(n.skeleton.boneTexture, u)
  48535. }
  48536. void 0 !== c.boneTextureWidth && X.uniform1i(c.boneTextureWidth, n.skeleton.boneTextureWidth),
  48537. void 0 !== c.boneTextureHeight && X.uniform1i(c.boneTextureHeight, n.skeleton.boneTextureHeight)
  48538. } else
  48539. n.skeleton && n.skeleton.boneMatrices && void 0 !== c.boneGlobalMatrices && X.uniformMatrix4fv(c.boneGlobalMatrices, !1, n.skeleton.boneMatrices);
  48540. return a && ((i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshStandardMaterial || i.lights) && function(e, t) {
  48541. e.ambientLightColor.needsUpdate = t,
  48542. e.directionalLights.needsUpdate = t,
  48543. e.pointLights.needsUpdate = t,
  48544. e.spotLights.needsUpdate = t,
  48545. e.hemisphereLights.needsUpdate = t
  48546. }(h, s),
  48547. t && i.fog && function(e, t) {
  48548. e.fogColor.value = t.color,
  48549. t instanceof Ci.Fog ? (e.fogNear.value = t.near,
  48550. e.fogFar.value = t.far) : t instanceof Ci.FogExp2 && (e.fogDensity.value = t.density)
  48551. }(h, t),
  48552. (i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial) && function(e, t) {
  48553. var i;
  48554. if (e.opacity.value = t.opacity,
  48555. e.diffuse.value = t.color,
  48556. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  48557. e.map.value = t.map,
  48558. e.specularMap.value = t.specularMap,
  48559. e.alphaMap.value = t.alphaMap,
  48560. t.aoMap && (e.aoMap.value = t.aoMap,
  48561. e.aoMapIntensity.value = t.aoMapIntensity),
  48562. 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),
  48563. void 0 !== i) {
  48564. i instanceof Ci.WebGLRenderTarget && (i = i.texture);
  48565. var n = i.offset
  48566. , r = i.repeat;
  48567. e.offsetRepeat.value.set(n.x, n.y, r.x, r.y)
  48568. }
  48569. e.envMap.value = t.envMap,
  48570. e.flipEnvMap.value = t.envMap instanceof Ci.WebGLRenderTargetCube ? 1 : -1,
  48571. e.reflectivity.value = t.reflectivity,
  48572. e.refractionRatio.value = t.refractionRatio
  48573. }(h, i),
  48574. i instanceof Ci.LineBasicMaterial ? p(h, i) : i instanceof Ci.LineDashedMaterial ? (p(h, i),
  48575. function(e, t) {
  48576. e.dashSize.value = t.dashSize,
  48577. e.totalSize.value = t.dashSize + t.gapSize,
  48578. e.scale.value = t.scale
  48579. }(h, i)) : i instanceof Ci.PointsMaterial ? function(e, t) {
  48580. if (e.diffuse.value = t.color,
  48581. e.opacity.value = t.opacity,
  48582. e.size.value = t.size * he,
  48583. e.scale.value = O.clientHeight / 2,
  48584. e.map.value = t.map,
  48585. null !== t.map) {
  48586. var i = t.map.offset
  48587. , n = t.map.repeat;
  48588. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  48589. }
  48590. }(h, i) : i instanceof Ci.MeshLambertMaterial ? function(e, t) {
  48591. t.lightMap && (e.lightMap.value = t.lightMap,
  48592. e.lightMapIntensity.value = t.lightMapIntensity),
  48593. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  48594. }(h, i) : i instanceof Ci.MeshPhongMaterial ? function(e, t) {
  48595. e.specular.value = t.specular,
  48596. e.shininess.value = Math.max(t.shininess, 1e-4),
  48597. t.lightMap && (e.lightMap.value = t.lightMap,
  48598. e.lightMapIntensity.value = t.lightMapIntensity),
  48599. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48600. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48601. e.bumpScale.value = t.bumpScale),
  48602. t.normalMap && (e.normalMap.value = t.normalMap,
  48603. e.normalScale.value.copy(t.normalScale)),
  48604. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48605. e.displacementScale.value = t.displacementScale,
  48606. e.displacementBias.value = t.displacementBias)
  48607. }(h, i) : i instanceof Ci.MeshStandardMaterial ? function(e, t) {
  48608. e.roughness.value = t.roughness,
  48609. e.metalness.value = t.metalness,
  48610. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  48611. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  48612. t.lightMap && (e.lightMap.value = t.lightMap,
  48613. e.lightMapIntensity.value = t.lightMapIntensity),
  48614. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48615. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48616. e.bumpScale.value = t.bumpScale),
  48617. t.normalMap && (e.normalMap.value = t.normalMap,
  48618. e.normalScale.value.copy(t.normalScale)),
  48619. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48620. e.displacementScale.value = t.displacementScale,
  48621. e.displacementBias.value = t.displacementBias),
  48622. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  48623. }(h, i) : i instanceof Ci.MeshDepthMaterial ? (h.mNear.value = e.near,
  48624. h.mFar.value = e.far,
  48625. h.opacity.value = i.opacity) : i instanceof Ci.MeshNormalMaterial && (h.opacity.value = i.opacity),
  48626. g(r.uniformsList)),
  48627. function(e, t) {
  48628. X.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  48629. e.normalMatrix && X.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  48630. }(c, n),
  48631. void 0 !== c.modelMatrix && X.uniformMatrix4fv(c.modelMatrix, !1, n.matrixWorld.elements),
  48632. !0 === r.hasDynamicUniforms && function(e, t, i) {
  48633. for (var n = [], r = 0, o = e.length; r < o; r++) {
  48634. var a = e[r][0]
  48635. , s = a.onUpdateCallback;
  48636. void 0 !== s && (s.bind(a)(t, i),
  48637. n.push(e[r]))
  48638. }
  48639. g(n)
  48640. }(r.uniformsList, n, e),
  48641. l
  48642. }
  48643. function p(e, t) {
  48644. e.diffuse.value = t.color,
  48645. e.opacity.value = t.opacity
  48646. }
  48647. function A() {
  48648. var e = oe;
  48649. return e >= Ee.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + Ee.maxTextures),
  48650. oe += 1,
  48651. e
  48652. }
  48653. function C(e, t, i, n) {
  48654. var r, o;
  48655. if ("1i" === t)
  48656. X.uniform1i(i, n);
  48657. else if ("1f" === t)
  48658. X.uniform1f(i, n);
  48659. else if ("2f" === t)
  48660. X.uniform2f(i, n[0], n[1]);
  48661. else if ("3f" === t)
  48662. X.uniform3f(i, n[0], n[1], n[2]);
  48663. else if ("4f" === t)
  48664. X.uniform4f(i, n[0], n[1], n[2], n[3]);
  48665. else if ("1iv" === t)
  48666. X.uniform1iv(i, n);
  48667. else if ("3iv" === t)
  48668. X.uniform3iv(i, n);
  48669. else if ("1fv" === t)
  48670. X.uniform1fv(i, n);
  48671. else if ("2fv" === t)
  48672. X.uniform2fv(i, n);
  48673. else if ("3fv" === t)
  48674. X.uniform3fv(i, n);
  48675. else if ("4fv" === t)
  48676. X.uniform4fv(i, n);
  48677. else if ("Matrix2fv" === t)
  48678. X.uniformMatrix2fv(i, !1, n);
  48679. else if ("Matrix3fv" === t)
  48680. X.uniformMatrix3fv(i, !1, n);
  48681. else if ("Matrix4fv" === t)
  48682. X.uniformMatrix4fv(i, !1, n);
  48683. else if ("i" === t)
  48684. X.uniform1i(i, n);
  48685. else if ("f" === t)
  48686. X.uniform1f(i, n);
  48687. else if ("v2" === t)
  48688. X.uniform2f(i, n.x, n.y);
  48689. else if ("v3" === t)
  48690. X.uniform3f(i, n.x, n.y, n.z);
  48691. else if ("v4" === t)
  48692. X.uniform4f(i, n.x, n.y, n.z, n.w);
  48693. else if ("c" === t)
  48694. X.uniform3f(i, n.r, n.g, n.b);
  48695. else if ("s" === t) {
  48696. var a = e.properties;
  48697. for (var s in a) {
  48698. var l = a[s]
  48699. , c = i[s]
  48700. , h = n[s];
  48701. C(l, l.type, c, h)
  48702. }
  48703. } else if ("sa" === t) {
  48704. a = e.properties;
  48705. for (var u = 0, d = n.length; u < d; u++)
  48706. for (var s in a) {
  48707. l = a[s],
  48708. c = i[u][s],
  48709. h = n[u][s];
  48710. C(l, l.type, c, h)
  48711. }
  48712. } else if ("iv1" === t)
  48713. X.uniform1iv(i, n);
  48714. else if ("iv" === t)
  48715. X.uniform3iv(i, n);
  48716. else if ("fv1" === t)
  48717. X.uniform1fv(i, n);
  48718. else if ("fv" === t)
  48719. X.uniform3fv(i, n);
  48720. else if ("v2v" === t) {
  48721. void 0 === e._array && (e._array = new Float32Array(2 * n.length));
  48722. u = 0;
  48723. for (var p = 0, f = n.length; u < f; u++,
  48724. p += 2)
  48725. e._array[p + 0] = n[u].x,
  48726. e._array[p + 1] = n[u].y;
  48727. X.uniform2fv(i, e._array)
  48728. } else if ("v3v" === t) {
  48729. void 0 === e._array && (e._array = new Float32Array(3 * n.length));
  48730. u = 0;
  48731. var g = 0;
  48732. for (f = n.length; u < f; u++,
  48733. g += 3)
  48734. e._array[g + 0] = n[u].x,
  48735. e._array[g + 1] = n[u].y,
  48736. e._array[g + 2] = n[u].z;
  48737. X.uniform3fv(i, e._array)
  48738. } else if ("v4v" === t) {
  48739. void 0 === e._array && (e._array = new Float32Array(4 * n.length));
  48740. u = 0;
  48741. var m = 0;
  48742. for (f = n.length; u < f; u++,
  48743. m += 4)
  48744. e._array[m + 0] = n[u].x,
  48745. e._array[m + 1] = n[u].y,
  48746. e._array[m + 2] = n[u].z,
  48747. e._array[m + 3] = n[u].w;
  48748. X.uniform4fv(i, e._array)
  48749. } else if ("m2" === t)
  48750. X.uniformMatrix2fv(i, !1, n.elements);
  48751. else if ("m3" === t)
  48752. X.uniformMatrix3fv(i, !1, n.elements);
  48753. else if ("m3v" === t) {
  48754. void 0 === e._array && (e._array = new Float32Array(9 * n.length));
  48755. for (u = 0,
  48756. f = n.length; u < f; u++)
  48757. n[u].flattenToArrayOffset(e._array, 9 * u);
  48758. X.uniformMatrix3fv(i, !1, e._array)
  48759. } else if ("m4" === t)
  48760. X.uniformMatrix4fv(i, !1, n.elements);
  48761. else if ("m4v" === t) {
  48762. void 0 === e._array && (e._array = new Float32Array(16 * n.length));
  48763. for (u = 0,
  48764. f = n.length; u < f; u++)
  48765. n[u].flattenToArrayOffset(e._array, 16 * u);
  48766. X.uniformMatrix4fv(i, !1, e._array)
  48767. } else if ("t" === t) {
  48768. if (r = n,
  48769. o = A(),
  48770. X.uniform1i(i, o),
  48771. !r)
  48772. return;
  48773. 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)
  48774. } else if ("tv" === t) {
  48775. void 0 === e._array && (e._array = []);
  48776. for (u = 0,
  48777. f = e.value.length; u < f; u++)
  48778. e._array[u] = A();
  48779. X.uniform1iv(i, e._array);
  48780. for (u = 0,
  48781. f = e.value.length; u < f; u++)
  48782. r = e.value[u],
  48783. o = e._array[u],
  48784. 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))
  48785. } else
  48786. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  48787. }
  48788. function g(e) {
  48789. for (var t = 0, i = e.length; t < i; t++) {
  48790. var n = e[t][0];
  48791. if (!1 !== n.needsUpdate)
  48792. C(n, n.type, e[t][1], n.value)
  48793. }
  48794. }
  48795. function m(e, t, i) {
  48796. var n;
  48797. if (i ? (X.texParameteri(e, X.TEXTURE_WRAP_S, x(t.wrapS)),
  48798. X.texParameteri(e, X.TEXTURE_WRAP_T, x(t.wrapT)),
  48799. X.texParameteri(e, X.TEXTURE_MAG_FILTER, x(t.magFilter)),
  48800. X.texParameteri(e, X.TEXTURE_MIN_FILTER, x(t.minFilter))) : (X.texParameteri(e, X.TEXTURE_WRAP_S, X.CLAMP_TO_EDGE),
  48801. X.texParameteri(e, X.TEXTURE_WRAP_T, X.CLAMP_TO_EDGE),
  48802. 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),
  48803. X.texParameteri(e, X.TEXTURE_MAG_FILTER, T(t.magFilter)),
  48804. X.texParameteri(e, X.TEXTURE_MIN_FILTER, T(t.minFilter)),
  48805. 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)),
  48806. n = Ie.get("EXT_texture_filter_anisotropic")) {
  48807. if (t.type === Ci.FloatType && null === Ie.get("OES_texture_float_linear"))
  48808. return;
  48809. if (t.type === Ci.HalfFloatType && null === Ie.get("OES_texture_half_float_linear"))
  48810. return;
  48811. (1 < t.anisotropy || be.get(t).__currentAnisotropy) && (X.texParameterf(e, n.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, Z.getMaxAnisotropy())),
  48812. be.get(t).__currentAnisotropy = t.anisotropy)
  48813. }
  48814. }
  48815. function o(e, t, i) {
  48816. void 0 === e.__webglInit && (e.__webglInit = !0,
  48817. t.addEventListener("dispose", f),
  48818. e.__webglTexture = X.createTexture(),
  48819. ye.textures++),
  48820. _e.activeTexture(X.TEXTURE0 + i),
  48821. _e.bindTexture(X.TEXTURE_2D, e.__webglTexture),
  48822. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, t.flipY),
  48823. X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  48824. X.pixelStorei(X.UNPACK_ALIGNMENT, t.unpackAlignment);
  48825. var n = I(t.image, Ee.maxTextureSize);
  48826. !function(e) {
  48827. return e.wrapS !== Ci.ClampToEdgeWrapping || e.wrapT !== Ci.ClampToEdgeWrapping || e.minFilter !== Ci.NearestFilter && e.minFilter !== Ci.LinearFilter
  48828. }(t) || !1 !== E(n) || (n = function(e) {
  48829. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  48830. var t = document.createElement("canvas");
  48831. return t.width = Ci.Math.nearestPowerOfTwo(e.width),
  48832. t.height = Ci.Math.nearestPowerOfTwo(e.height),
  48833. t.getContext("2d").drawImage(e, 0, 0, t.width, t.height),
  48834. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  48835. t
  48836. }
  48837. return e
  48838. }(n));
  48839. var r = E(n)
  48840. , o = x(t.format)
  48841. , a = x(t.type);
  48842. m(X.TEXTURE_2D, t, r);
  48843. var s, l = t.mipmaps;
  48844. if (t instanceof Ci.DataTexture)
  48845. if (0 < l.length && r) {
  48846. for (var c = 0, h = l.length; c < h; c++)
  48847. s = l[c],
  48848. _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  48849. t.generateMipmaps = !1
  48850. } else
  48851. _e.texImage2D(X.TEXTURE_2D, 0, o, n.width, n.height, 0, o, a, n.data);
  48852. else if (t instanceof Ci.CompressedTexture)
  48853. for (c = 0,
  48854. h = l.length; c < h; c++)
  48855. s = l[c],
  48856. 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);
  48857. else if (0 < l.length && r) {
  48858. for (c = 0,
  48859. h = l.length; c < h; c++)
  48860. s = l[c],
  48861. _e.texImage2D(X.TEXTURE_2D, c, o, o, a, s);
  48862. t.generateMipmaps = !1
  48863. } else
  48864. _e.texImage2D(X.TEXTURE_2D, 0, o, o, a, n);
  48865. t.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  48866. e.__version = t.version,
  48867. t.onUpdate && t.onUpdate(t)
  48868. }
  48869. function I(e, t) {
  48870. if (e.width > t || e.height > t) {
  48871. var i = t / Math.max(e.width, e.height)
  48872. , n = document.createElement("canvas");
  48873. return n.width = Math.floor(e.width * i),
  48874. n.height = Math.floor(e.height * i),
  48875. n.getContext("2d").drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  48876. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  48877. n
  48878. }
  48879. return e
  48880. }
  48881. function E(e) {
  48882. return Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height)
  48883. }
  48884. function _(e, t) {
  48885. var i = be.get(e);
  48886. if (6 === e.image.length)
  48887. if (0 < e.version && i.__version !== e.version) {
  48888. i.__image__webglTextureCube || (e.addEventListener("dispose", f),
  48889. i.__image__webglTextureCube = X.createTexture(),
  48890. ye.textures++),
  48891. _e.activeTexture(X.TEXTURE0 + t),
  48892. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  48893. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, e.flipY);
  48894. for (var n = e instanceof Ci.CompressedTexture, r = e.image[0]instanceof Ci.DataTexture, o = [], a = 0; a < 6; a++)
  48895. !Z.autoScaleCubemaps || n || r ? o[a] = r ? e.image[a].image : e.image[a] : o[a] = I(e.image[a], Ee.maxCubemapSize);
  48896. var s = E(o[0])
  48897. , l = x(e.format)
  48898. , c = x(e.type);
  48899. m(X.TEXTURE_CUBE_MAP, e, s);
  48900. for (a = 0; a < 6; a++)
  48901. if (n)
  48902. for (var h, u = o[a].mipmaps, d = 0, p = u.length; d < p; d++)
  48903. h = u[d],
  48904. 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);
  48905. else
  48906. 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]);
  48907. e.generateMipmaps && s && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  48908. i.__version = e.version,
  48909. e.onUpdate && e.onUpdate(e)
  48910. } else
  48911. _e.activeTexture(X.TEXTURE0 + t),
  48912. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  48913. }
  48914. function b(e, t) {
  48915. _e.activeTexture(X.TEXTURE0 + t),
  48916. _e.bindTexture(X.TEXTURE_CUBE_MAP, be.get(e).__webglTexture)
  48917. }
  48918. function h(e, t, i, n) {
  48919. var r = x(t.texture.format)
  48920. , o = x(t.texture.type);
  48921. _e.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  48922. X.bindFramebuffer(X.FRAMEBUFFER, e),
  48923. X.framebufferTexture2D(X.FRAMEBUFFER, i, n, be.get(t.texture).__webglTexture, 0),
  48924. X.bindFramebuffer(X.FRAMEBUFFER, null)
  48925. }
  48926. function u(e, t) {
  48927. X.bindRenderbuffer(X.RENDERBUFFER, e),
  48928. t.depthBuffer && !t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_COMPONENT16, t.width, t.height),
  48929. 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),
  48930. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_STENCIL_ATTACHMENT, X.RENDERBUFFER, e)) : X.renderbufferStorage(X.RENDERBUFFER, X.RGBA4, t.width, t.height),
  48931. X.bindRenderbuffer(X.RENDERBUFFER, null)
  48932. }
  48933. function w(e) {
  48934. var t = be.get(e)
  48935. , i = be.get(e.texture);
  48936. e.addEventListener("dispose", a),
  48937. i.__webglTexture = X.createTexture(),
  48938. ye.textures++;
  48939. var n = e instanceof Ci.WebGLRenderTargetCube
  48940. , r = Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height);
  48941. if (n) {
  48942. t.__webglFramebuffer = [];
  48943. for (var o = 0; o < 6; o++)
  48944. t.__webglFramebuffer[o] = X.createFramebuffer()
  48945. } else
  48946. t.__webglFramebuffer = X.createFramebuffer();
  48947. if (n) {
  48948. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__webglTexture),
  48949. m(X.TEXTURE_CUBE_MAP, e.texture, r);
  48950. for (o = 0; o < 6; o++)
  48951. h(t.__webglFramebuffer[o], e, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + o);
  48952. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  48953. _e.bindTexture(X.TEXTURE_CUBE_MAP, null)
  48954. } else
  48955. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture),
  48956. m(X.TEXTURE_2D, e.texture, r),
  48957. h(t.__webglFramebuffer, e, X.COLOR_ATTACHMENT0, X.TEXTURE_2D),
  48958. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  48959. _e.bindTexture(X.TEXTURE_2D, null);
  48960. e.depthBuffer && function(e) {
  48961. var t = be.get(e);
  48962. if (e instanceof Ci.WebGLRenderTargetCube) {
  48963. t.__webglDepthbuffer = [];
  48964. for (var i = 0; i < 6; i++)
  48965. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer[i]),
  48966. t.__webglDepthbuffer[i] = X.createRenderbuffer(),
  48967. u(t.__webglDepthbuffer[i], e)
  48968. } else
  48969. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer),
  48970. t.__webglDepthbuffer = X.createRenderbuffer(),
  48971. u(t.__webglDepthbuffer, e);
  48972. X.bindFramebuffer(X.FRAMEBUFFER, null)
  48973. }(e)
  48974. }
  48975. function T(e) {
  48976. return e === Ci.NearestFilter || e === Ci.NearestMipMapNearestFilter || e === Ci.NearestMipMapLinearFilter ? X.NEAREST : X.LINEAR
  48977. }
  48978. function x(e) {
  48979. var t;
  48980. if (e === Ci.RepeatWrapping)
  48981. return X.REPEAT;
  48982. if (e === Ci.ClampToEdgeWrapping)
  48983. return X.CLAMP_TO_EDGE;
  48984. if (e === Ci.MirroredRepeatWrapping)
  48985. return X.MIRRORED_REPEAT;
  48986. if (e === Ci.NearestFilter)
  48987. return X.NEAREST;
  48988. if (e === Ci.NearestMipMapNearestFilter)
  48989. return X.NEAREST_MIPMAP_NEAREST;
  48990. if (e === Ci.NearestMipMapLinearFilter)
  48991. return X.NEAREST_MIPMAP_LINEAR;
  48992. if (e === Ci.LinearFilter)
  48993. return X.LINEAR;
  48994. if (e === Ci.LinearMipMapNearestFilter)
  48995. return X.LINEAR_MIPMAP_NEAREST;
  48996. if (e === Ci.LinearMipMapLinearFilter)
  48997. return X.LINEAR_MIPMAP_LINEAR;
  48998. if (e === Ci.UnsignedByteType)
  48999. return X.UNSIGNED_BYTE;
  49000. if (e === Ci.UnsignedShort4444Type)
  49001. return X.UNSIGNED_SHORT_4_4_4_4;
  49002. if (e === Ci.UnsignedShort5551Type)
  49003. return X.UNSIGNED_SHORT_5_5_5_1;
  49004. if (e === Ci.UnsignedShort565Type)
  49005. return X.UNSIGNED_SHORT_5_6_5;
  49006. if (e === Ci.ByteType)
  49007. return X.BYTE;
  49008. if (e === Ci.ShortType)
  49009. return X.SHORT;
  49010. if (e === Ci.UnsignedShortType)
  49011. return X.UNSIGNED_SHORT;
  49012. if (e === Ci.IntType)
  49013. return X.INT;
  49014. if (e === Ci.UnsignedIntType)
  49015. return X.UNSIGNED_INT;
  49016. if (e === Ci.FloatType)
  49017. return X.FLOAT;
  49018. if (null !== (t = Ie.get("OES_texture_half_float")) && e === Ci.HalfFloatType)
  49019. return t.HALF_FLOAT_OES;
  49020. if (e === Ci.AlphaFormat)
  49021. return X.ALPHA;
  49022. if (e === Ci.RGBFormat)
  49023. return X.RGB;
  49024. if (e === Ci.RGBAFormat)
  49025. return X.RGBA;
  49026. if (e === Ci.LuminanceFormat)
  49027. return X.LUMINANCE;
  49028. if (e === Ci.LuminanceAlphaFormat)
  49029. return X.LUMINANCE_ALPHA;
  49030. if (e === Ci.AddEquation)
  49031. return X.FUNC_ADD;
  49032. if (e === Ci.SubtractEquation)
  49033. return X.FUNC_SUBTRACT;
  49034. if (e === Ci.ReverseSubtractEquation)
  49035. return X.FUNC_REVERSE_SUBTRACT;
  49036. if (e === Ci.ZeroFactor)
  49037. return X.ZERO;
  49038. if (e === Ci.OneFactor)
  49039. return X.ONE;
  49040. if (e === Ci.SrcColorFactor)
  49041. return X.SRC_COLOR;
  49042. if (e === Ci.OneMinusSrcColorFactor)
  49043. return X.ONE_MINUS_SRC_COLOR;
  49044. if (e === Ci.SrcAlphaFactor)
  49045. return X.SRC_ALPHA;
  49046. if (e === Ci.OneMinusSrcAlphaFactor)
  49047. return X.ONE_MINUS_SRC_ALPHA;
  49048. if (e === Ci.DstAlphaFactor)
  49049. return X.DST_ALPHA;
  49050. if (e === Ci.OneMinusDstAlphaFactor)
  49051. return X.ONE_MINUS_DST_ALPHA;
  49052. if (e === Ci.DstColorFactor)
  49053. return X.DST_COLOR;
  49054. if (e === Ci.OneMinusDstColorFactor)
  49055. return X.ONE_MINUS_DST_COLOR;
  49056. if (e === Ci.SrcAlphaSaturateFactor)
  49057. return X.SRC_ALPHA_SATURATE;
  49058. if (null !== (t = Ie.get("WEBGL_compressed_texture_s3tc"))) {
  49059. if (e === Ci.RGB_S3TC_DXT1_Format)
  49060. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  49061. if (e === Ci.RGBA_S3TC_DXT1_Format)
  49062. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  49063. if (e === Ci.RGBA_S3TC_DXT3_Format)
  49064. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  49065. if (e === Ci.RGBA_S3TC_DXT5_Format)
  49066. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  49067. }
  49068. if (null !== (t = Ie.get("WEBGL_compressed_texture_pvrtc"))) {
  49069. if (e === Ci.RGB_PVRTC_4BPPV1_Format)
  49070. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  49071. if (e === Ci.RGB_PVRTC_2BPPV1_Format)
  49072. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  49073. if (e === Ci.RGBA_PVRTC_4BPPV1_Format)
  49074. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  49075. if (e === Ci.RGBA_PVRTC_2BPPV1_Format)
  49076. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  49077. }
  49078. if (null !== (t = Ie.get("WEBGL_compressed_texture_etc1")) && e === Ci.RGB_ETC1_Format)
  49079. return t.COMPRESSED_RGB_ETC1_WEBGL;
  49080. if (null !== (t = Ie.get("EXT_blend_minmax"))) {
  49081. if (e === Ci.MinEquation)
  49082. return t.MIN_EXT;
  49083. if (e === Ci.MaxEquation)
  49084. return t.MAX_EXT
  49085. }
  49086. return 0
  49087. }
  49088. console.log("THREE.WebGLRenderer", Ci.REVISION);
  49089. var O = void 0 !== (e = e || {}).canvas ? e.canvas : document.createElement("canvas")
  49090. , L = void 0 !== e.context ? e.context : null
  49091. , D = void 0 !== e.alpha && e.alpha
  49092. , N = void 0 === e.depth || e.depth
  49093. , F = void 0 === e.stencil || e.stencil
  49094. , B = void 0 !== e.antialias && e.antialias
  49095. , V = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  49096. , k = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  49097. , U = []
  49098. , H = []
  49099. , z = -1
  49100. , G = []
  49101. , W = -1
  49102. , j = new Float32Array(8)
  49103. , Y = []
  49104. , q = [];
  49105. this.domElement = O,
  49106. this.context = null,
  49107. this.autoClear = !0,
  49108. this.autoClearColor = !0,
  49109. this.autoClearDepth = !0,
  49110. this.autoClearStencil = !0,
  49111. this.sortObjects = !0,
  49112. this.gammaFactor = 2,
  49113. this.gammaInput = !1,
  49114. this.gammaOutput = !1,
  49115. this.physicallyCorrectLights = !1,
  49116. this.toneMapping = Ci.LinearToneMapping,
  49117. this.toneMappingExposure = 1,
  49118. this.toneMappingWhitePoint = 1,
  49119. this.maxMorphTargets = 8,
  49120. this.maxMorphNormals = 4,
  49121. this.autoScaleCubemaps = !0;
  49122. 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 = {
  49123. hash: "",
  49124. ambient: [0, 0, 0],
  49125. directional: [],
  49126. directionalShadowMap: [],
  49127. directionalShadowMatrix: [],
  49128. spot: [],
  49129. spotShadowMap: [],
  49130. spotShadowMatrix: [],
  49131. point: [],
  49132. pointShadowMap: [],
  49133. pointShadowMatrix: [],
  49134. hemi: [],
  49135. shadows: [],
  49136. shadowsPointLight: 0
  49137. }, ye = {
  49138. geometries: 0,
  49139. textures: 0
  49140. }, Ae = {
  49141. calls: 0,
  49142. vertices: 0,
  49143. faces: 0,
  49144. points: 0
  49145. };
  49146. this.info = {
  49147. render: Ae,
  49148. memory: ye,
  49149. programs: null
  49150. };
  49151. try {
  49152. var Ce = {
  49153. alpha: D,
  49154. depth: N,
  49155. stencil: F,
  49156. antialias: B,
  49157. premultipliedAlpha: V,
  49158. preserveDrawingBuffer: k
  49159. };
  49160. if (null === (X = L || O.getContext("webgl", Ce) || O.getContext("experimental-webgl", Ce)))
  49161. throw null !== O.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  49162. void 0 === X.getShaderPrecisionFormat && (X.getShaderPrecisionFormat = function() {
  49163. return {
  49164. rangeMin: 1,
  49165. rangeMax: 1,
  49166. precision: 1
  49167. }
  49168. }
  49169. ),
  49170. O.addEventListener("webglcontextlost", r, !1)
  49171. } catch (e) {
  49172. console.error("THREE.WebGLRenderer: " + e)
  49173. }
  49174. var Ie = new Ci.WebGLExtensions(X);
  49175. Ie.get("OES_texture_float"),
  49176. Ie.get("OES_texture_float_linear"),
  49177. Ie.get("OES_texture_half_float"),
  49178. Ie.get("OES_texture_half_float_linear"),
  49179. Ie.get("OES_standard_derivatives"),
  49180. Ie.get("ANGLE_instanced_arrays"),
  49181. Ie.get("OES_element_index_uint") && (Ci.BufferGeometry.MaxIndex = 4294967296);
  49182. var Ee = new Ci.WebGLCapabilities(X,Ie,e)
  49183. , _e = new Ci.WebGLState(X,Ie,x)
  49184. , be = new Ci.WebGLProperties
  49185. , we = new Ci.WebGLObjects(X,be,this.info)
  49186. , Te = new Ci.WebGLPrograms(this,Ee)
  49187. , xe = new Ci.WebGLLights;
  49188. this.info.programs = Te.programs;
  49189. var Se = new Ci.WebGLBufferRenderer(X,Ie,Ae)
  49190. , Me = new Ci.WebGLIndexedBufferRenderer(X,Ie,Ae);
  49191. t(),
  49192. this.context = X,
  49193. this.capabilities = Ee,
  49194. this.extensions = Ie,
  49195. this.properties = be,
  49196. this.state = _e;
  49197. var Re = new Ci.WebGLShadowMap(this,ve,we);
  49198. this.shadowMap = Re;
  49199. var Pe, Oe = new Ci.SpritePlugin(this,Y), Le = new Ci.LensFlarePlugin(this,q);
  49200. this.getContext = function() {
  49201. return X
  49202. }
  49203. ,
  49204. this.getContextAttributes = function() {
  49205. return X.getContextAttributes()
  49206. }
  49207. ,
  49208. this.forceContextLoss = function() {
  49209. Ie.get("WEBGL_lose_context").loseContext()
  49210. }
  49211. ,
  49212. this.getMaxAnisotropy = function() {
  49213. if (void 0 !== Pe)
  49214. return Pe;
  49215. var e = Ie.get("EXT_texture_filter_anisotropic");
  49216. return Pe = null !== e ? X.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  49217. }
  49218. ,
  49219. this.getPrecision = function() {
  49220. return Ee.precision
  49221. }
  49222. ,
  49223. this.getPixelRatio = function() {
  49224. return he
  49225. }
  49226. ,
  49227. this.setPixelRatio = function(e) {
  49228. void 0 !== e && (he = e,
  49229. this.setSize(pe.z, pe.w, !1))
  49230. }
  49231. ,
  49232. this.getSize = function() {
  49233. return {
  49234. width: le,
  49235. height: ce
  49236. }
  49237. }
  49238. ,
  49239. this.setSize = function(e, t, i, n) {
  49240. null != n && (he = n),
  49241. le = e,
  49242. ce = t,
  49243. O.width = e * he,
  49244. O.height = t * he,
  49245. !1 !== i && (O.style.width = e + "px",
  49246. O.style.height = t + "px"),
  49247. this.setViewport(0, 0, e, t)
  49248. }
  49249. ,
  49250. this.setViewport = function(e, t, i, n) {
  49251. _e.viewport(pe.set(e, t, i, n))
  49252. }
  49253. ,
  49254. this.setScissor = function(e, t, i, n) {
  49255. _e.scissor(ue.set(e, t, i, n))
  49256. }
  49257. ,
  49258. this.setScissorTest = function(e) {
  49259. _e.setScissorTest(de = e)
  49260. }
  49261. ,
  49262. this.getClearColor = function() {
  49263. return ae
  49264. }
  49265. ,
  49266. this.setClearColor = function(e, t) {
  49267. ae.set(e),
  49268. se = void 0 !== t ? t : 1,
  49269. i(ae.r, ae.g, ae.b, se)
  49270. }
  49271. ,
  49272. this.getClearAlpha = function() {
  49273. return se
  49274. }
  49275. ,
  49276. this.setClearAlpha = function(e) {
  49277. se = e,
  49278. i(ae.r, ae.g, ae.b, se)
  49279. }
  49280. ,
  49281. this.clear = function(e, t, i) {
  49282. var n = 0;
  49283. void 0 !== e && !e || (n |= X.COLOR_BUFFER_BIT),
  49284. void 0 !== t && !t || (n |= X.DEPTH_BUFFER_BIT),
  49285. void 0 !== i && !i || (n |= X.STENCIL_BUFFER_BIT),
  49286. X.clear(n)
  49287. }
  49288. ,
  49289. this.clearColor = function() {
  49290. this.clear(!0, !1, !1)
  49291. }
  49292. ,
  49293. this.clearDepth = function() {
  49294. this.clear(!1, !0, !1)
  49295. }
  49296. ,
  49297. this.clearStencil = function() {
  49298. this.clear(!1, !1, !0)
  49299. }
  49300. ,
  49301. this.clearTarget = function(e, t, i, n) {
  49302. this.setRenderTarget(e),
  49303. this.clear(t, i, n)
  49304. }
  49305. ,
  49306. this.resetGLState = n,
  49307. this.dispose = function() {
  49308. O.removeEventListener("webglcontextlost", r, !1)
  49309. }
  49310. ,
  49311. this.renderBufferImmediate = function(e, t, i) {
  49312. _e.initAttributes();
  49313. var n = be.get(e);
  49314. e.hasPositions && !n.position && (n.position = X.createBuffer()),
  49315. e.hasNormals && !n.normal && (n.normal = X.createBuffer()),
  49316. e.hasUvs && !n.uv && (n.uv = X.createBuffer()),
  49317. e.hasColors && !n.color && (n.color = X.createBuffer());
  49318. var r = t.getAttributes();
  49319. if (e.hasPositions && (X.bindBuffer(X.ARRAY_BUFFER, n.position),
  49320. X.bufferData(X.ARRAY_BUFFER, e.positionArray, X.DYNAMIC_DRAW),
  49321. _e.enableAttribute(r.position),
  49322. X.vertexAttribPointer(r.position, 3, X.FLOAT, !1, 0, 0)),
  49323. e.hasNormals) {
  49324. if (X.bindBuffer(X.ARRAY_BUFFER, n.normal),
  49325. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === Ci.FlatShading)
  49326. for (var o = 0, a = 3 * e.count; o < a; o += 9) {
  49327. var s = e.normalArray
  49328. , l = (s[o + 0] + s[o + 3] + s[o + 6]) / 3
  49329. , c = (s[o + 1] + s[o + 4] + s[o + 7]) / 3
  49330. , h = (s[o + 2] + s[o + 5] + s[o + 8]) / 3;
  49331. s[o + 0] = l,
  49332. s[o + 1] = c,
  49333. s[o + 2] = h,
  49334. s[o + 3] = l,
  49335. s[o + 4] = c,
  49336. s[o + 5] = h,
  49337. s[o + 6] = l,
  49338. s[o + 7] = c,
  49339. s[o + 8] = h
  49340. }
  49341. X.bufferData(X.ARRAY_BUFFER, e.normalArray, X.DYNAMIC_DRAW),
  49342. _e.enableAttribute(r.normal),
  49343. X.vertexAttribPointer(r.normal, 3, X.FLOAT, !1, 0, 0)
  49344. }
  49345. e.hasUvs && i.map && (X.bindBuffer(X.ARRAY_BUFFER, n.uv),
  49346. X.bufferData(X.ARRAY_BUFFER, e.uvArray, X.DYNAMIC_DRAW),
  49347. _e.enableAttribute(r.uv),
  49348. X.vertexAttribPointer(r.uv, 2, X.FLOAT, !1, 0, 0)),
  49349. e.hasColors && i.vertexColors !== Ci.NoColors && (X.bindBuffer(X.ARRAY_BUFFER, n.color),
  49350. X.bufferData(X.ARRAY_BUFFER, e.colorArray, X.DYNAMIC_DRAW),
  49351. _e.enableAttribute(r.color),
  49352. X.vertexAttribPointer(r.color, 3, X.FLOAT, !1, 0, 0)),
  49353. _e.disableUnusedAttributes(),
  49354. X.drawArrays(X.TRIANGLES, 0, e.count),
  49355. e.count = 0
  49356. }
  49357. ,
  49358. this.renderBufferDirect = function(e, t, i, n, r, o) {
  49359. R(n);
  49360. var a = P(e, t, n, r)
  49361. , s = !1
  49362. , l = i.id + "_" + a.id + "_" + n.wireframe;
  49363. l !== ee && (ee = l,
  49364. s = !0);
  49365. var c = r.morphTargetInfluences;
  49366. if (void 0 !== c) {
  49367. for (var h = [], u = 0, d = c.length; u < d; u++) {
  49368. var p = c[u];
  49369. h.push([p, u])
  49370. }
  49371. h.sort(M),
  49372. 8 < h.length && (h.length = 8);
  49373. var f = i.morphAttributes;
  49374. for (u = 0,
  49375. d = h.length; u < d; u++) {
  49376. p = h[u];
  49377. if (j[u] = p[0],
  49378. 0 !== p[0]) {
  49379. var g = p[1];
  49380. !0 === n.morphTargets && f.position && i.addAttribute("morphTarget" + u, f.position[g]),
  49381. !0 === n.morphNormals && f.normal && i.addAttribute("morphNormal" + u, f.normal[g])
  49382. } else
  49383. !0 === n.morphTargets && i.removeAttribute("morphTarget" + u),
  49384. !0 === n.morphNormals && i.removeAttribute("morphNormal" + u)
  49385. }
  49386. var m = a.getUniforms();
  49387. null !== m.morphTargetInfluences && X.uniform1fv(m.morphTargetInfluences, j),
  49388. s = !0
  49389. }
  49390. g = i.index;
  49391. var v, y = i.attributes.position;
  49392. !0 === n.wireframe && (g = we.getWireframeAttribute(i)),
  49393. null !== g ? (v = Me).setIndex(g) : v = Se,
  49394. s && (function(e, t, i, n) {
  49395. var r;
  49396. if (i instanceof Ci.InstancedBufferGeometry && null === (r = Ie.get("ANGLE_instanced_arrays")))
  49397. console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  49398. else {
  49399. void 0 === n && (n = 0),
  49400. _e.initAttributes();
  49401. var o = i.attributes
  49402. , a = t.getAttributes()
  49403. , s = e.defaultAttributeValues;
  49404. for (var l in a) {
  49405. var c = a[l];
  49406. if (0 <= c) {
  49407. var h = o[l];
  49408. if (void 0 !== h) {
  49409. var u = h.itemSize
  49410. , d = we.getAttributeBuffer(h);
  49411. if (h instanceof Ci.InterleavedBufferAttribute) {
  49412. var p = h.data
  49413. , f = p.stride
  49414. , g = h.offset;
  49415. p instanceof Ci.InstancedInterleavedBuffer ? (_e.enableAttributeAndDivisor(c, p.meshPerAttribute, r),
  49416. void 0 === i.maxInstancedCount && (i.maxInstancedCount = p.meshPerAttribute * p.count)) : _e.enableAttribute(c),
  49417. X.bindBuffer(X.ARRAY_BUFFER, d),
  49418. X.vertexAttribPointer(c, u, X.FLOAT, !1, f * p.array.BYTES_PER_ELEMENT, (n * f + g) * p.array.BYTES_PER_ELEMENT)
  49419. } else
  49420. h instanceof Ci.InstancedBufferAttribute ? (_e.enableAttributeAndDivisor(c, h.meshPerAttribute, r),
  49421. void 0 === i.maxInstancedCount && (i.maxInstancedCount = h.meshPerAttribute * h.count)) : _e.enableAttribute(c),
  49422. X.bindBuffer(X.ARRAY_BUFFER, d),
  49423. X.vertexAttribPointer(c, u, X.FLOAT, !1, 0, n * u * 4)
  49424. } else if (void 0 !== s) {
  49425. var m = s[l];
  49426. if (void 0 !== m)
  49427. switch (m.length) {
  49428. case 2:
  49429. X.vertexAttrib2fv(c, m);
  49430. break;
  49431. case 3:
  49432. X.vertexAttrib3fv(c, m);
  49433. break;
  49434. case 4:
  49435. X.vertexAttrib4fv(c, m);
  49436. break;
  49437. default:
  49438. X.vertexAttrib1fv(c, m)
  49439. }
  49440. }
  49441. }
  49442. }
  49443. _e.disableUnusedAttributes()
  49444. }
  49445. }(n, a, i),
  49446. null !== g && X.bindBuffer(X.ELEMENT_ARRAY_BUFFER, we.getAttributeBuffer(g)));
  49447. var A = 1 / 0;
  49448. null !== g ? A = g.count : void 0 !== y && (A = y.count);
  49449. var C = i.drawRange.start
  49450. , I = i.drawRange.count
  49451. , E = null !== o ? o.start : 0
  49452. , _ = null !== o ? o.count : 1 / 0
  49453. , b = Math.max(0, C, E)
  49454. , w = Math.min(0 + A, C + I, E + _) - 1
  49455. , T = Math.max(0, w - b + 1);
  49456. if (r instanceof Ci.Mesh)
  49457. if (!0 === n.wireframe)
  49458. _e.setLineWidth(n.wireframeLinewidth * S()),
  49459. v.setMode(X.LINES);
  49460. else
  49461. switch (r.drawMode) {
  49462. case Ci.TrianglesDrawMode:
  49463. v.setMode(X.TRIANGLES);
  49464. break;
  49465. case Ci.TriangleStripDrawMode:
  49466. v.setMode(X.TRIANGLE_STRIP);
  49467. break;
  49468. case Ci.TriangleFanDrawMode:
  49469. v.setMode(X.TRIANGLE_FAN)
  49470. }
  49471. else if (r instanceof Ci.Line) {
  49472. var x = n.linewidth;
  49473. void 0 === x && (x = 1),
  49474. _e.setLineWidth(x * S()),
  49475. r instanceof Ci.LineSegments ? v.setMode(X.LINES) : v.setMode(X.LINE_STRIP)
  49476. } else
  49477. r instanceof Ci.Points && v.setMode(X.POINTS);
  49478. i instanceof Ci.InstancedBufferGeometry ? 0 < i.maxInstancedCount && v.renderInstances(i, b, T) : v.render(b, T)
  49479. }
  49480. ,
  49481. this.render = function(e, t, i, n) {
  49482. if (t instanceof Ci.Camera != 0) {
  49483. var r = e.fog;
  49484. if (ee = "",
  49485. $ = -1,
  49486. !(te = null) === e.autoUpdate && e.updateMatrixWorld(),
  49487. null === t.parent && t.updateMatrixWorld(),
  49488. t.matrixWorldInverse.getInverse(t.matrixWorld),
  49489. ge.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  49490. fe.setFromMatrix(ge),
  49491. U.length = 0,
  49492. W = z = -1,
  49493. Y.length = 0,
  49494. q.length = 0,
  49495. function e(t, i) {
  49496. if (!1 !== t.visible) {
  49497. if (t.layers.test(i.layers))
  49498. if (t instanceof Ci.Light)
  49499. U.push(t);
  49500. else if (t instanceof Ci.Sprite)
  49501. !1 !== t.frustumCulled && !0 !== fe.intersectsObject(t) || Y.push(t);
  49502. else if (t instanceof Ci.LensFlare)
  49503. q.push(t);
  49504. else if (t instanceof Ci.ImmediateRenderObject)
  49505. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49506. me.applyProjection(ge)),
  49507. d(t, null, t.material, me.z, null);
  49508. else if ((t instanceof Ci.Mesh || t instanceof Ci.Line || t instanceof Ci.Points) && (t instanceof Ci.SkinnedMesh && t.skeleton.update(),
  49509. !1 === t.frustumCulled || !0 === fe.intersectsObject(t))) {
  49510. var n = t.material;
  49511. if (!0 === n.visible) {
  49512. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49513. me.applyProjection(ge));
  49514. var r = we.update(t);
  49515. if (n instanceof Ci.MultiMaterial)
  49516. for (var o = r.groups, a = n.materials, s = 0, l = o.length; s < l; s++) {
  49517. var c = o[s]
  49518. , h = a[c.materialIndex];
  49519. !0 === h.visible && d(t, r, h, me.z, c)
  49520. }
  49521. else
  49522. d(t, r, n, me.z, null)
  49523. }
  49524. }
  49525. var u = t.children;
  49526. for (s = 0,
  49527. l = u.length; s < l; s++)
  49528. e(u[s], i)
  49529. }
  49530. }(e, t),
  49531. H.length = z + 1,
  49532. G.length = W + 1,
  49533. !0 === Z.sortObjects && (H.sort(s),
  49534. G.sort(l)),
  49535. function(e, t) {
  49536. 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;
  49537. for (i = ve.shadowsPointLight = 0,
  49538. n = e.length; i < n; i++)
  49539. if (o = (r = e[i]).color,
  49540. a = r.intensity,
  49541. s = r.distance,
  49542. r instanceof Ci.AmbientLight)
  49543. l += o.r * a,
  49544. c += o.g * a,
  49545. h += o.b * a;
  49546. else if (r instanceof Ci.DirectionalLight) {
  49547. (v = xe.get(r)).color.copy(r.color).multiplyScalar(r.intensity),
  49548. v.direction.setFromMatrixPosition(r.matrixWorld),
  49549. me.setFromMatrixPosition(r.target.matrixWorld),
  49550. v.direction.sub(me),
  49551. v.direction.transformDirection(u),
  49552. v.shadow = r.castShadow,
  49553. r.castShadow && (v.shadowBias = r.shadow.bias,
  49554. v.shadowRadius = r.shadow.radius,
  49555. v.shadowMapSize = r.shadow.mapSize,
  49556. ve.shadows[m++] = r),
  49557. ve.directionalShadowMap[d] = r.shadow.map,
  49558. ve.directionalShadowMatrix[d] = r.shadow.matrix,
  49559. ve.directional[d++] = v
  49560. } else if (r instanceof Ci.SpotLight) {
  49561. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49562. v.position.applyMatrix4(u),
  49563. v.color.copy(o).multiplyScalar(a),
  49564. v.distance = s,
  49565. v.direction.setFromMatrixPosition(r.matrixWorld),
  49566. me.setFromMatrixPosition(r.target.matrixWorld),
  49567. v.direction.sub(me),
  49568. v.direction.transformDirection(u),
  49569. v.coneCos = Math.cos(r.angle),
  49570. v.penumbraCos = Math.cos(r.angle * (1 - r.penumbra)),
  49571. v.decay = 0 === r.distance ? 0 : r.decay,
  49572. v.shadow = r.castShadow,
  49573. r.castShadow && (v.shadowBias = r.shadow.bias,
  49574. v.shadowRadius = r.shadow.radius,
  49575. v.shadowMapSize = r.shadow.mapSize,
  49576. ve.shadows[m++] = r),
  49577. ve.spotShadowMap[f] = r.shadow.map,
  49578. ve.spotShadowMatrix[f] = r.shadow.matrix,
  49579. ve.spot[f++] = v
  49580. } else if (r instanceof Ci.PointLight) {
  49581. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49582. v.position.applyMatrix4(u),
  49583. v.color.copy(r.color).multiplyScalar(r.intensity),
  49584. v.distance = r.distance,
  49585. v.decay = 0 === r.distance ? 0 : r.decay,
  49586. v.shadow = r.castShadow,
  49587. r.castShadow && (v.shadowBias = r.shadow.bias,
  49588. v.shadowRadius = r.shadow.radius,
  49589. v.shadowMapSize = r.shadow.mapSize,
  49590. ve.shadows[m++] = r),
  49591. ve.pointShadowMap[p] = r.shadow.map,
  49592. void 0 === ve.pointShadowMatrix[p] && (ve.pointShadowMatrix[p] = new Ci.Matrix4),
  49593. me.setFromMatrixPosition(r.matrixWorld).negate(),
  49594. ve.pointShadowMatrix[p].identity().setPosition(me),
  49595. ve.point[p++] = v
  49596. } else if (r instanceof Ci.HemisphereLight) {
  49597. var v;
  49598. (v = xe.get(r)).direction.setFromMatrixPosition(r.matrixWorld),
  49599. v.direction.transformDirection(u),
  49600. v.direction.normalize(),
  49601. v.skyColor.copy(r.color).multiplyScalar(a),
  49602. v.groundColor.copy(r.groundColor).multiplyScalar(a),
  49603. ve.hemi[g++] = v
  49604. }
  49605. ve.ambient[0] = l,
  49606. ve.ambient[1] = c,
  49607. ve.ambient[2] = h,
  49608. ve.directional.length = d,
  49609. ve.spot.length = f,
  49610. ve.point.length = p,
  49611. ve.hemi.length = g,
  49612. ve.shadows.length = m,
  49613. ve.hash = d + "," + p + "," + f + "," + g + "," + m
  49614. }(U, t),
  49615. Re.render(e, t),
  49616. Ae.calls = 0,
  49617. Ae.vertices = 0,
  49618. Ae.faces = 0,
  49619. void (Ae.points = 0) === i && (i = null),
  49620. this.setRenderTarget(i),
  49621. (this.autoClear || n) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  49622. e.overrideMaterial) {
  49623. var o = e.overrideMaterial;
  49624. c(H, t, r, o),
  49625. c(G, t, r, o)
  49626. } else
  49627. _e.setBlending(Ci.NoBlending),
  49628. c(H, t, r),
  49629. c(G, t, r);
  49630. if (Oe.render(e, t),
  49631. Le.render(e, t, re),
  49632. i) {
  49633. var a = i.texture;
  49634. a.generateMipmaps && E(i) && a.minFilter !== Ci.NearestFilter && a.minFilter !== Ci.LinearFilter && function(e) {
  49635. var t = e instanceof Ci.WebGLRenderTargetCube ? X.TEXTURE_CUBE_MAP : X.TEXTURE_2D
  49636. , i = be.get(e.texture).__webglTexture;
  49637. _e.bindTexture(t, i),
  49638. X.generateMipmap(t),
  49639. _e.bindTexture(t, null)
  49640. }(i)
  49641. }
  49642. _e.setDepthTest(!0),
  49643. _e.setDepthWrite(!0),
  49644. _e.setColorWrite(!0)
  49645. } else
  49646. console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")
  49647. }
  49648. ,
  49649. this.setFaceCulling = function(e, t) {
  49650. e === Ci.CullFaceNone ? _e.disable(X.CULL_FACE) : (t === Ci.FrontFaceDirectionCW ? X.frontFace(X.CW) : X.frontFace(X.CCW),
  49651. e === Ci.CullFaceBack ? X.cullFace(X.BACK) : e === Ci.CullFaceFront ? X.cullFace(X.FRONT) : X.cullFace(X.FRONT_AND_BACK),
  49652. _e.enable(X.CULL_FACE))
  49653. }
  49654. ,
  49655. this.setTexture = function(e, t) {
  49656. var i = be.get(e);
  49657. if (0 < e.version && i.__version !== e.version) {
  49658. var n = e.image;
  49659. 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)
  49660. }
  49661. _e.activeTexture(X.TEXTURE0 + t),
  49662. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture)
  49663. }
  49664. ,
  49665. this.getCurrentRenderTarget = function() {
  49666. return Q
  49667. }
  49668. ,
  49669. this.setRenderTarget = function(e) {
  49670. (Q = e) && void 0 === be.get(e).__webglFramebuffer && w(e);
  49671. var t, i = e instanceof Ci.WebGLRenderTargetCube;
  49672. if (e) {
  49673. var n = be.get(e);
  49674. t = i ? n.__webglFramebuffer[e.activeCubeFace] : n.__webglFramebuffer,
  49675. ie.copy(e.scissor),
  49676. ne = e.scissorTest,
  49677. re.copy(e.viewport)
  49678. } else
  49679. t = null,
  49680. ie.copy(ue).multiplyScalar(he),
  49681. ne = de,
  49682. re.copy(pe).multiplyScalar(he);
  49683. if (J !== t && (X.bindFramebuffer(X.FRAMEBUFFER, t),
  49684. J = t),
  49685. _e.scissor(ie),
  49686. _e.setScissorTest(ne),
  49687. _e.viewport(re),
  49688. i) {
  49689. var r = be.get(e.texture);
  49690. X.framebufferTexture2D(X.FRAMEBUFFER, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, r.__webglTexture, e.activeMipMapLevel)
  49691. }
  49692. }
  49693. ,
  49694. this.readRenderTargetPixels = function(e, t, i, n, r, o) {
  49695. if (e instanceof Ci.WebGLRenderTarget != 0) {
  49696. var a = be.get(e).__webglFramebuffer;
  49697. if (a) {
  49698. var s = !1;
  49699. a !== J && (X.bindFramebuffer(X.FRAMEBUFFER, a),
  49700. s = !0);
  49701. try {
  49702. var l = e.texture;
  49703. if (l.format !== Ci.RGBAFormat && x(l.format) !== X.getParameter(X.IMPLEMENTATION_COLOR_READ_FORMAT))
  49704. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  49705. 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")))
  49706. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  49707. 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.")
  49708. } finally {
  49709. s && X.bindFramebuffer(X.FRAMEBUFFER, J)
  49710. }
  49711. }
  49712. } else
  49713. console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")
  49714. }
  49715. }
  49716. ,
  49717. Ci.WebGLRenderTarget = function(e, t, i) {
  49718. this.uuid = Ci.Math.generateUUID(),
  49719. this.width = e,
  49720. this.height = t,
  49721. this.scissor = new Ci.Vector4(0,0,e,t),
  49722. this.scissorTest = !1,
  49723. this.viewport = new Ci.Vector4(0,0,e,t),
  49724. void 0 === (i = i || {}).minFilter && (i.minFilter = Ci.LinearFilter),
  49725. this.texture = new Ci.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  49726. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  49727. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  49728. }
  49729. ,
  49730. Ci.WebGLRenderTarget.prototype = {
  49731. constructor: Ci.WebGLRenderTarget,
  49732. setSize: function(e, t) {
  49733. this.width === e && this.height === t || (this.width = e,
  49734. this.height = t,
  49735. this.dispose()),
  49736. this.viewport.set(0, 0, e, t),
  49737. this.scissor.set(0, 0, e, t)
  49738. },
  49739. clone: function() {
  49740. return (new this.constructor).copy(this)
  49741. },
  49742. copy: function(e) {
  49743. return this.width = e.width,
  49744. this.height = e.height,
  49745. this.viewport.copy(e.viewport),
  49746. this.texture = e.texture.clone(),
  49747. this.depthBuffer = e.depthBuffer,
  49748. this.stencilBuffer = e.stencilBuffer,
  49749. this
  49750. },
  49751. dispose: function() {
  49752. this.dispatchEvent({
  49753. type: "dispose"
  49754. })
  49755. }
  49756. },
  49757. Ci.EventDispatcher.prototype.apply(Ci.WebGLRenderTarget.prototype),
  49758. Ci.WebGLRenderTargetCube = function(e, t, i) {
  49759. Ci.WebGLRenderTarget.call(this, e, t, i),
  49760. this.activeCubeFace = 0,
  49761. this.activeMipMapLevel = 0
  49762. }
  49763. ,
  49764. Ci.WebGLRenderTargetCube.prototype = Object.create(Ci.WebGLRenderTarget.prototype),
  49765. Ci.WebGLRenderTargetCube.prototype.constructor = Ci.WebGLRenderTargetCube,
  49766. Ci.WebGLBufferRenderer = function(r, o, a) {
  49767. var s;
  49768. this.setMode = function(e) {
  49769. s = e
  49770. }
  49771. ,
  49772. this.render = function(e, t) {
  49773. r.drawArrays(s, e, t),
  49774. a.calls++,
  49775. a.vertices += t,
  49776. s === r.TRIANGLES && (a.faces += t / 3)
  49777. }
  49778. ,
  49779. this.renderInstances = function(e) {
  49780. var t = o.get("ANGLE_instanced_arrays");
  49781. if (null !== t) {
  49782. var i = e.attributes.position
  49783. , n = 0;
  49784. n = i instanceof Ci.InterleavedBufferAttribute ? i.data.count : i.count,
  49785. t.drawArraysInstancedANGLE(s, 0, n, e.maxInstancedCount),
  49786. a.calls++,
  49787. a.vertices += n * e.maxInstancedCount,
  49788. s === r.TRIANGLES && (a.faces += e.maxInstancedCount * n / 3)
  49789. } else
  49790. console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")
  49791. }
  49792. }
  49793. ,
  49794. Ci.WebGLIndexedBufferRenderer = function(r, o, a) {
  49795. var s, l, c;
  49796. this.setMode = function(e) {
  49797. s = e
  49798. }
  49799. ,
  49800. this.setIndex = function(e) {
  49801. c = e.array instanceof Uint32Array && o.get("OES_element_index_uint") ? (l = r.UNSIGNED_INT,
  49802. 4) : (l = r.UNSIGNED_SHORT,
  49803. 2)
  49804. }
  49805. ,
  49806. this.render = function(e, t) {
  49807. r.drawElements(s, t, l, e * c),
  49808. a.calls++,
  49809. a.vertices += t,
  49810. s === r.TRIANGLES && (a.faces += t / 3)
  49811. }
  49812. ,
  49813. this.renderInstances = function(e, t, i) {
  49814. var n = o.get("ANGLE_instanced_arrays");
  49815. 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),
  49816. a.calls++,
  49817. a.vertices += i * e.maxInstancedCount,
  49818. void (s === r.TRIANGLES && (a.faces += e.maxInstancedCount * i / 3)))
  49819. }
  49820. }
  49821. ,
  49822. Ci.WebGLExtensions = function(i) {
  49823. var n = {};
  49824. this.get = function(e) {
  49825. if (void 0 !== n[e])
  49826. return n[e];
  49827. var t;
  49828. switch (e) {
  49829. case "EXT_texture_filter_anisotropic":
  49830. t = i.getExtension("EXT_texture_filter_anisotropic") || i.getExtension("MOZ_EXT_texture_filter_anisotropic") || i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  49831. break;
  49832. case "WEBGL_compressed_texture_s3tc":
  49833. t = i.getExtension("WEBGL_compressed_texture_s3tc") || i.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  49834. break;
  49835. case "WEBGL_compressed_texture_pvrtc":
  49836. t = i.getExtension("WEBGL_compressed_texture_pvrtc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  49837. break;
  49838. case "WEBGL_compressed_texture_etc1":
  49839. t = i.getExtension("WEBGL_compressed_texture_etc1");
  49840. break;
  49841. default:
  49842. t = i.getExtension(e)
  49843. }
  49844. return null === t && console.warn("THREE.WebGLRenderer: " + e + " extension not supported."),
  49845. n[e] = t
  49846. }
  49847. }
  49848. ,
  49849. Ci.WebGLCapabilities = function(t, e, i) {
  49850. function n(e) {
  49851. if ("highp" === e) {
  49852. if (0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.HIGH_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT).precision)
  49853. return "highp";
  49854. e = "mediump"
  49855. }
  49856. 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"
  49857. }
  49858. this.getMaxPrecision = n,
  49859. this.precision = void 0 !== i.precision ? i.precision : "highp",
  49860. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  49861. this.maxTextures = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
  49862. this.maxVertexTextures = t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  49863. this.maxTextureSize = t.getParameter(t.MAX_TEXTURE_SIZE),
  49864. this.maxCubemapSize = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),
  49865. this.maxAttributes = t.getParameter(t.MAX_VERTEX_ATTRIBS),
  49866. this.maxVertexUniforms = t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),
  49867. this.maxVaryings = t.getParameter(t.MAX_VARYING_VECTORS),
  49868. this.maxFragmentUniforms = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),
  49869. this.vertexTextures = 0 < this.maxVertexTextures,
  49870. this.floatFragmentTextures = !!e.get("OES_texture_float"),
  49871. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  49872. var r = n(this.precision);
  49873. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  49874. this.precision = r),
  49875. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!e.get("EXT_frag_depth"))
  49876. }
  49877. ,
  49878. Ci.WebGLGeometries = function(i, o, a) {
  49879. function s(e) {
  49880. var t = e.target
  49881. , i = c[t.id];
  49882. null !== i.index && l(i.index),
  49883. function(e) {
  49884. for (var t in e)
  49885. l(e[t])
  49886. }(i.attributes),
  49887. t.removeEventListener("dispose", s),
  49888. delete c[t.id];
  49889. var n = o.get(t);
  49890. n.wireframe && l(n.wireframe),
  49891. o.delete(t);
  49892. var r = o.get(i);
  49893. r.wireframe && l(r.wireframe),
  49894. o.delete(i),
  49895. a.memory.geometries--
  49896. }
  49897. function l(e) {
  49898. var t = function(e) {
  49899. return e instanceof Ci.InterleavedBufferAttribute ? o.get(e.data).__webglBuffer : o.get(e).__webglBuffer
  49900. }(e);
  49901. void 0 !== t && (i.deleteBuffer(t),
  49902. function(e) {
  49903. e instanceof Ci.InterleavedBufferAttribute ? o.delete(e.data) : o.delete(e)
  49904. }(e))
  49905. }
  49906. var c = {};
  49907. this.get = function(e) {
  49908. var t, i = e.geometry;
  49909. return void 0 !== c[i.id] ? c[i.id] : (i.addEventListener("dispose", s),
  49910. i instanceof Ci.BufferGeometry ? t = i : i instanceof Ci.Geometry && (void 0 === i._bufferGeometry && (i._bufferGeometry = (new Ci.BufferGeometry).setFromObject(e)),
  49911. t = i._bufferGeometry),
  49912. c[i.id] = t,
  49913. a.memory.geometries++,
  49914. t)
  49915. }
  49916. }
  49917. ,
  49918. Ci.WebGLLights = function() {
  49919. var i = {};
  49920. this.get = function(e) {
  49921. if (void 0 !== i[e.id])
  49922. return i[e.id];
  49923. var t;
  49924. switch (e.type) {
  49925. case "DirectionalLight":
  49926. t = {
  49927. direction: new Ci.Vector3,
  49928. color: new Ci.Color,
  49929. shadow: !1,
  49930. shadowBias: 0,
  49931. shadowRadius: 1,
  49932. shadowMapSize: new Ci.Vector2
  49933. };
  49934. break;
  49935. case "SpotLight":
  49936. t = {
  49937. position: new Ci.Vector3,
  49938. direction: new Ci.Vector3,
  49939. color: new Ci.Color,
  49940. distance: 0,
  49941. coneCos: 0,
  49942. penumbraCos: 0,
  49943. decay: 0,
  49944. shadow: !1,
  49945. shadowBias: 0,
  49946. shadowRadius: 1,
  49947. shadowMapSize: new Ci.Vector2
  49948. };
  49949. break;
  49950. case "PointLight":
  49951. t = {
  49952. position: new Ci.Vector3,
  49953. color: new Ci.Color,
  49954. distance: 0,
  49955. decay: 0,
  49956. shadow: !1,
  49957. shadowBias: 0,
  49958. shadowRadius: 1,
  49959. shadowMapSize: new Ci.Vector2
  49960. };
  49961. break;
  49962. case "HemisphereLight":
  49963. t = {
  49964. direction: new Ci.Vector3,
  49965. skyColor: new Ci.Color,
  49966. groundColor: new Ci.Color
  49967. }
  49968. }
  49969. return i[e.id] = t
  49970. }
  49971. }
  49972. ,
  49973. Ci.WebGLObjects = function(g, m, e) {
  49974. function v(e, t) {
  49975. var i = e instanceof Ci.InterleavedBufferAttribute ? e.data : e
  49976. , n = m.get(i);
  49977. void 0 === n.__webglBuffer ? function(e, t, i) {
  49978. e.__webglBuffer = g.createBuffer(),
  49979. g.bindBuffer(i, e.__webglBuffer);
  49980. var n = t.dynamic ? g.DYNAMIC_DRAW : g.STATIC_DRAW;
  49981. g.bufferData(i, t.array, n),
  49982. e.version = t.version
  49983. }(n, i, t) : n.version !== i.version && function(e, t, i) {
  49984. g.bindBuffer(i, e.__webglBuffer),
  49985. !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)),
  49986. t.updateRange.count = 0),
  49987. e.version = t.version
  49988. }(n, i, t)
  49989. }
  49990. function y(e, t, i) {
  49991. if (i < t) {
  49992. var n = t;
  49993. t = i,
  49994. i = n
  49995. }
  49996. var r = e[t];
  49997. return void 0 === r ? (e[t] = [i],
  49998. !0) : -1 === r.indexOf(i) && (r.push(i),
  49999. !0)
  50000. }
  50001. var c = new Ci.WebGLGeometries(g,m,e);
  50002. this.getAttributeBuffer = function(e) {
  50003. return e instanceof Ci.InterleavedBufferAttribute ? m.get(e.data).__webglBuffer : m.get(e).__webglBuffer
  50004. }
  50005. ,
  50006. this.getWireframeAttribute = function(e) {
  50007. var t = m.get(e);
  50008. if (void 0 !== t.wireframe)
  50009. return t.wireframe;
  50010. var i, n = [], r = e.index, o = e.attributes, a = o.position;
  50011. if (null !== r)
  50012. for (var s = {}, l = 0, c = (i = r.array).length; l < c; l += 3) {
  50013. var h = i[l + 0]
  50014. , u = i[l + 1]
  50015. , d = i[l + 2];
  50016. y(s, h, u) && n.push(h, u),
  50017. y(s, u, d) && n.push(u, d),
  50018. y(s, d, h) && n.push(d, h)
  50019. }
  50020. else
  50021. for (l = 0,
  50022. c = (i = o.position.array).length / 3 - 1; l < c; l += 3) {
  50023. h = l + 0,
  50024. u = l + 1,
  50025. d = l + 2;
  50026. n.push(h, u, u, d, d, h)
  50027. }
  50028. var p = 65535 < a.count ? Uint32Array : Uint16Array
  50029. , f = new Ci.BufferAttribute(new p(n),1);
  50030. return v(f, g.ELEMENT_ARRAY_BUFFER),
  50031. t.wireframe = f
  50032. }
  50033. ,
  50034. this.update = function(e) {
  50035. var t = c.get(e);
  50036. e.geometry instanceof Ci.Geometry && t.updateFromObject(e);
  50037. var i = t.index
  50038. , n = t.attributes;
  50039. for (var r in null !== i && v(i, g.ELEMENT_ARRAY_BUFFER),
  50040. n)
  50041. v(n[r], g.ARRAY_BUFFER);
  50042. var o = t.morphAttributes;
  50043. for (var r in o)
  50044. for (var a = o[r], s = 0, l = a.length; s < l; s++)
  50045. v(a[s], g.ARRAY_BUFFER);
  50046. return t
  50047. }
  50048. }
  50049. ,
  50050. Ci.WebGLProgram = (Qt = 0,
  50051. Jt = /^([\w\d_]+)\.([\w\d_]+)$/,
  50052. $t = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  50053. ei = /^([\w\d_]+)\[0\]$/,
  50054. function(e, t, i, n) {
  50055. var r = e.context
  50056. , o = i.extensions
  50057. , a = i.defines
  50058. , s = i.__webglShader.vertexShader
  50059. , l = i.__webglShader.fragmentShader
  50060. , c = "SHADOWMAP_TYPE_BASIC";
  50061. n.shadowMapType === Ci.PCFShadowMap ? c = "SHADOWMAP_TYPE_PCF" : n.shadowMapType === Ci.PCFSoftShadowMap && (c = "SHADOWMAP_TYPE_PCF_SOFT");
  50062. var h = "ENVMAP_TYPE_CUBE"
  50063. , u = "ENVMAP_MODE_REFLECTION"
  50064. , d = "ENVMAP_BLENDING_MULTIPLY";
  50065. if (n.envMap) {
  50066. switch (i.envMap.mapping) {
  50067. case Ci.CubeReflectionMapping:
  50068. case Ci.CubeRefractionMapping:
  50069. h = "ENVMAP_TYPE_CUBE";
  50070. break;
  50071. case Ci.CubeUVReflectionMapping:
  50072. case Ci.CubeUVRefractionMapping:
  50073. h = "ENVMAP_TYPE_CUBE_UV";
  50074. break;
  50075. case Ci.EquirectangularReflectionMapping:
  50076. case Ci.EquirectangularRefractionMapping:
  50077. h = "ENVMAP_TYPE_EQUIREC";
  50078. break;
  50079. case Ci.SphericalReflectionMapping:
  50080. h = "ENVMAP_TYPE_SPHERE"
  50081. }
  50082. switch (i.envMap.mapping) {
  50083. case Ci.CubeRefractionMapping:
  50084. case Ci.EquirectangularRefractionMapping:
  50085. u = "ENVMAP_MODE_REFRACTION"
  50086. }
  50087. switch (i.combine) {
  50088. case Ci.MultiplyOperation:
  50089. d = "ENVMAP_BLENDING_MULTIPLY";
  50090. break;
  50091. case Ci.MixOperation:
  50092. d = "ENVMAP_BLENDING_MIX";
  50093. break;
  50094. case Ci.AddOperation:
  50095. d = "ENVMAP_BLENDING_ADD"
  50096. }
  50097. }
  50098. var p, f, g = 0 < e.gammaFactor ? e.gammaFactor : 1, m = function(e, t, i) {
  50099. 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")
  50100. }(o, n, e.extensions), v = function(e) {
  50101. var t = [];
  50102. for (var i in e) {
  50103. var n = e[i];
  50104. !1 !== n && t.push("#define " + i + " " + n)
  50105. }
  50106. return t.join("\n")
  50107. }(a), y = r.createProgram();
  50108. 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"),
  50109. [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) {
  50110. var i;
  50111. switch (t) {
  50112. case Ci.LinearToneMapping:
  50113. i = "Linear";
  50114. break;
  50115. case Ci.ReinhardToneMapping:
  50116. i = "Reinhard";
  50117. break;
  50118. case Ci.Uncharted2ToneMapping:
  50119. i = "Uncharted2";
  50120. break;
  50121. case Ci.CineonToneMapping:
  50122. i = "OptimizedCineon";
  50123. break;
  50124. default:
  50125. throw new Error("unsupported toneMapping: " + t)
  50126. }
  50127. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  50128. }("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) {
  50129. var i = Mi(t);
  50130. return "vec4 " + e + "( vec4 value ) { return LinearTo" + i[0] + i[1] + "; }"
  50131. }("linearToOutputTexel", n.outputEncoding) : "", "\n"].filter(Pi).join("\n")),
  50132. s = Oi(s = Li(s), n),
  50133. l = Oi(l = Li(l), n),
  50134. i instanceof Ci.ShaderMaterial == 0 && (s = Di(s),
  50135. l = Di(l));
  50136. var A = p + s
  50137. , C = f + l
  50138. , I = Ci.WebGLShader(r, r.VERTEX_SHADER, A)
  50139. , E = Ci.WebGLShader(r, r.FRAGMENT_SHADER, C);
  50140. r.attachShader(y, I),
  50141. r.attachShader(y, E),
  50142. void 0 !== i.index0AttributeName ? r.bindAttribLocation(y, 0, i.index0AttributeName) : !0 === n.morphTargets && r.bindAttribLocation(y, 0, "position"),
  50143. r.linkProgram(y);
  50144. var _, b, w = r.getProgramInfoLog(y), T = r.getShaderInfoLog(I), x = r.getShaderInfoLog(E), S = !0, M = !0;
  50145. return !1 === r.getProgramParameter(y, r.LINK_STATUS) ? (S = !1,
  50146. 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),
  50147. M && (this.diagnostics = {
  50148. runnable: S,
  50149. material: i,
  50150. programLog: w,
  50151. vertexShader: {
  50152. log: T,
  50153. prefix: p
  50154. },
  50155. fragmentShader: {
  50156. log: x,
  50157. prefix: f
  50158. }
  50159. }),
  50160. r.deleteShader(I),
  50161. r.deleteShader(E),
  50162. this.getUniforms = function() {
  50163. return void 0 === _ && (_ = function(e, t) {
  50164. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), r = 0; r < n; r++) {
  50165. var o = e.getActiveUniform(t, r).name
  50166. , a = e.getUniformLocation(t, o)
  50167. , s = Jt.exec(o);
  50168. if (s) {
  50169. var l = s[1]
  50170. , c = s[2]
  50171. , h = i[l];
  50172. (h = h || (i[l] = {}))[c] = a
  50173. } else if (s = $t.exec(o)) {
  50174. var u = s[1]
  50175. , d = s[2]
  50176. , p = s[3]
  50177. , f = i[u]
  50178. , g = (f = f || (i[u] = []))[d];
  50179. (g = g || (f[d] = {}))[p] = a
  50180. } else
  50181. (s = ei.exec(o)) ? i[u = s[1]] = a : i[o] = a
  50182. }
  50183. return i
  50184. }(r, y)),
  50185. _
  50186. }
  50187. ,
  50188. this.getAttributes = function() {
  50189. return void 0 === b && (b = function(e, t) {
  50190. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), r = 0; r < n; r++) {
  50191. var o = e.getActiveAttrib(t, r).name;
  50192. i[o] = e.getAttribLocation(t, o)
  50193. }
  50194. return i
  50195. }(r, y)),
  50196. b
  50197. }
  50198. ,
  50199. this.destroy = function() {
  50200. r.deleteProgram(y),
  50201. this.program = void 0
  50202. }
  50203. ,
  50204. Object.defineProperties(this, {
  50205. uniforms: {
  50206. get: function() {
  50207. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  50208. this.getUniforms()
  50209. }
  50210. },
  50211. attributes: {
  50212. get: function() {
  50213. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  50214. this.getAttributes()
  50215. }
  50216. }
  50217. }),
  50218. this.id = Qt++,
  50219. this.code = t,
  50220. this.usedTimes = 1,
  50221. this.program = y,
  50222. this.vertexShader = I,
  50223. this.fragmentShader = E,
  50224. this
  50225. }
  50226. ),
  50227. Ci.WebGLPrograms = function(s, l) {
  50228. function c(e, t) {
  50229. var i;
  50230. return e ? e instanceof Ci.Texture ? i = e.encoding : e instanceof Ci.WebGLRenderTarget && (i = e.texture.encoding) : i = Ci.LinearEncoding,
  50231. i === Ci.LinearEncoding && t && (i = Ci.GammaEncoding),
  50232. i
  50233. }
  50234. var h = []
  50235. , u = {
  50236. MeshDepthMaterial: "depth",
  50237. MeshNormalMaterial: "normal",
  50238. MeshBasicMaterial: "basic",
  50239. MeshLambertMaterial: "lambert",
  50240. MeshPhongMaterial: "phong",
  50241. MeshStandardMaterial: "standard",
  50242. LineBasicMaterial: "basic",
  50243. LineDashedMaterial: "dashed",
  50244. PointsMaterial: "points"
  50245. }
  50246. , 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"];
  50247. this.getParameters = function(e, t, i, n) {
  50248. var r = u[e.type]
  50249. , o = function(e) {
  50250. if (l.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  50251. return 1024;
  50252. var t = l.maxVertexUniforms
  50253. , i = Math.floor((t - 20) / 4);
  50254. 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)")),
  50255. i
  50256. }(n)
  50257. , a = s.getPrecision();
  50258. return null === e.precision || (a = l.getMaxPrecision(e.precision)) !== e.precision && console.warn("THREE.WebGLProgram.getParameters:", e.precision, "not supported, using", a, "instead."),
  50259. {
  50260. shaderID: r,
  50261. precision: a,
  50262. supportsVertexTextures: l.vertexTextures,
  50263. outputEncoding: c(s.getCurrentRenderTarget(), s.gammaOutput),
  50264. map: !!e.map,
  50265. mapEncoding: c(e.map, s.gammaInput),
  50266. envMap: !!e.envMap,
  50267. envMapMode: e.envMap && e.envMap.mapping,
  50268. envMapEncoding: c(e.envMap, s.gammaInput),
  50269. envMapCubeUV: !!e.envMap && (e.envMap.mapping === Ci.CubeUVReflectionMapping || e.envMap.mapping === Ci.CubeUVRefractionMapping),
  50270. lightMap: !!e.lightMap,
  50271. aoMap: !!e.aoMap,
  50272. emissiveMap: !!e.emissiveMap,
  50273. emissiveMapEncoding: c(e.emissiveMap, s.gammaInput),
  50274. bumpMap: !!e.bumpMap,
  50275. normalMap: !!e.normalMap,
  50276. displacementMap: !!e.displacementMap,
  50277. roughnessMap: !!e.roughnessMap,
  50278. metalnessMap: !!e.metalnessMap,
  50279. specularMap: !!e.specularMap,
  50280. alphaMap: !!e.alphaMap,
  50281. combine: e.combine,
  50282. vertexColors: e.vertexColors,
  50283. fog: i,
  50284. useFog: e.fog,
  50285. fogExp: i instanceof Ci.FogExp2,
  50286. flatShading: e.shading === Ci.FlatShading,
  50287. sizeAttenuation: e.sizeAttenuation,
  50288. logarithmicDepthBuffer: l.logarithmicDepthBuffer,
  50289. skinning: e.skinning,
  50290. maxBones: o,
  50291. useVertexTexture: l.floatVertexTextures && n && n.skeleton && n.skeleton.useVertexTexture,
  50292. morphTargets: e.morphTargets,
  50293. morphNormals: e.morphNormals,
  50294. maxMorphTargets: s.maxMorphTargets,
  50295. maxMorphNormals: s.maxMorphNormals,
  50296. numDirLights: t.directional.length,
  50297. numPointLights: t.point.length,
  50298. numSpotLights: t.spot.length,
  50299. numHemiLights: t.hemi.length,
  50300. pointLightShadows: t.shadowsPointLight,
  50301. shadowMapEnabled: s.shadowMap.enabled && n.receiveShadow && 0 < t.shadows.length,
  50302. shadowMapType: s.shadowMap.type,
  50303. toneMapping: s.toneMapping,
  50304. physicallyCorrectLights: s.physicallyCorrectLights,
  50305. premultipliedAlpha: e.premultipliedAlpha,
  50306. alphaTest: e.alphaTest,
  50307. doubleSided: e.side === Ci.DoubleSide,
  50308. flipSided: e.side === Ci.BackSide
  50309. }
  50310. }
  50311. ,
  50312. this.getProgramCode = function(e, t) {
  50313. var i = [];
  50314. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  50315. i.push(e.vertexShader)),
  50316. void 0 !== e.defines)
  50317. for (var n in e.defines)
  50318. i.push(n),
  50319. i.push(e.defines[n]);
  50320. for (var r = 0; r < a.length; r++) {
  50321. var o = a[r];
  50322. i.push(o),
  50323. i.push(t[o])
  50324. }
  50325. return i.join()
  50326. }
  50327. ,
  50328. this.acquireProgram = function(e, t, i) {
  50329. for (var n, r = 0, o = h.length; r < o; r++) {
  50330. var a = h[r];
  50331. if (a.code === i) {
  50332. ++(n = a).usedTimes;
  50333. break
  50334. }
  50335. }
  50336. return void 0 === n && (n = new Ci.WebGLProgram(s,i,e,t),
  50337. h.push(n)),
  50338. n
  50339. }
  50340. ,
  50341. this.releaseProgram = function(e) {
  50342. if (0 == --e.usedTimes) {
  50343. var t = h.indexOf(e);
  50344. h[t] = h[h.length - 1],
  50345. h.pop(),
  50346. e.destroy()
  50347. }
  50348. }
  50349. ,
  50350. this.programs = h
  50351. }
  50352. ,
  50353. Ci.WebGLProperties = function() {
  50354. var n = {};
  50355. this.get = function(e) {
  50356. var t = e.uuid
  50357. , i = n[t];
  50358. return void 0 === i && (i = {},
  50359. n[t] = i),
  50360. i
  50361. }
  50362. ,
  50363. this.delete = function(e) {
  50364. delete n[e.uuid]
  50365. }
  50366. ,
  50367. this.clear = function() {
  50368. n = {}
  50369. }
  50370. }
  50371. ,
  50372. Ci.WebGLShader = function(e, t, i) {
  50373. var n = e.createShader(t);
  50374. return e.shaderSource(n, i),
  50375. e.compileShader(n),
  50376. !1 === e.getShaderParameter(n, e.COMPILE_STATUS) && console.error("THREE.WebGLShader: Shader couldn't compile."),
  50377. "" !== e.getShaderInfoLog(n) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", t === e.VERTEX_SHADER ? "vertex" : "fragment", e.getShaderInfoLog(n), function(e) {
  50378. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  50379. t[i] = i + 1 + ": " + t[i];
  50380. return t.join("\n")
  50381. }(i)),
  50382. n
  50383. }
  50384. ,
  50385. Ci.WebGLShadowMap = function(P, O, L) {
  50386. function D(e, t, i, n) {
  50387. var r = e.geometry
  50388. , o = null
  50389. , a = p
  50390. , s = e.customDepthMaterial;
  50391. if (i && (a = f,
  50392. s = e.customDistanceMaterial),
  50393. s)
  50394. o = s;
  50395. else {
  50396. var l = void 0 !== r.morphTargets && 0 < r.morphTargets.length && t.morphTargets
  50397. , c = e instanceof Ci.SkinnedMesh && t.skinning
  50398. , h = 0;
  50399. l && (h |= u),
  50400. c && (h |= d),
  50401. o = a[h]
  50402. }
  50403. return o.visible = t.visible,
  50404. o.wireframe = t.wireframe,
  50405. o.wireframeLinewidth = t.wireframeLinewidth,
  50406. i && void 0 !== o.uniforms.lightPos && o.uniforms.lightPos.value.copy(n),
  50407. o
  50408. }
  50409. function N(e, t, i) {
  50410. if (!1 !== e.visible) {
  50411. 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)))
  50412. !0 === e.material.visible && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  50413. G.push(e));
  50414. for (var n = e.children, r = 0, o = n.length; r < o; r++)
  50415. N(n[r], t, i)
  50416. }
  50417. }
  50418. 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) {
  50419. var a = 0 != (o & u)
  50420. , s = 0 != (o & d)
  50421. , l = new Ci.ShaderMaterial({
  50422. uniforms: i,
  50423. vertexShader: t.vertexShader,
  50424. fragmentShader: t.fragmentShader,
  50425. morphTargets: a,
  50426. skinning: s
  50427. });
  50428. p[o] = l;
  50429. var c = new Ci.ShaderMaterial({
  50430. defines: {
  50431. USE_SHADOWMAP: ""
  50432. },
  50433. uniforms: r,
  50434. vertexShader: n.vertexShader,
  50435. fragmentShader: n.fragmentShader,
  50436. morphTargets: a,
  50437. skinning: s
  50438. });
  50439. f[o] = c
  50440. }
  50441. var q = this;
  50442. this.enabled = !1,
  50443. this.autoUpdate = !0,
  50444. this.needsUpdate = !1,
  50445. this.type = Ci.PCFShadowMap,
  50446. this.cullFace = Ci.CullFaceFront,
  50447. this.render = function(e, t) {
  50448. var i, n, r = O.shadows;
  50449. if (0 !== r.length && !1 !== q.enabled && (!1 !== q.autoUpdate || !1 !== q.needsUpdate)) {
  50450. B.clearColor(1, 1, 1, 1),
  50451. B.disable(F.BLEND),
  50452. B.enable(F.CULL_FACE),
  50453. F.frontFace(F.CCW),
  50454. F.cullFace(q.cullFace === Ci.CullFaceFront ? F.FRONT : F.BACK),
  50455. B.setDepthTest(!0),
  50456. B.setScissorTest(!1);
  50457. for (var o = 0, a = r.length; o < a; o++) {
  50458. var s = r[o]
  50459. , l = s.shadow
  50460. , c = l.camera;
  50461. if (U.copy(l.mapSize),
  50462. s instanceof Ci.PointLight) {
  50463. i = 6,
  50464. n = !0;
  50465. var h = U.x
  50466. , u = U.y;
  50467. Y[0].set(2 * h, u, h, u),
  50468. Y[1].set(0, u, h, u),
  50469. Y[2].set(3 * h, u, h, u),
  50470. Y[3].set(h, u, h, u),
  50471. Y[4].set(3 * h, 0, h, u),
  50472. Y[5].set(h, 0, h, u),
  50473. U.x *= 4,
  50474. U.y *= 2
  50475. } else
  50476. n = !(i = 1);
  50477. if (null === l.map) {
  50478. var d = {
  50479. minFilter: Ci.NearestFilter,
  50480. magFilter: Ci.NearestFilter,
  50481. format: Ci.RGBAFormat
  50482. };
  50483. l.map = new Ci.WebGLRenderTarget(U.x,U.y,d),
  50484. s instanceof Ci.SpotLight && (c.aspect = U.x / U.y),
  50485. c.updateProjectionMatrix()
  50486. }
  50487. var p = l.map
  50488. , f = l.matrix;
  50489. z.setFromMatrixPosition(s.matrixWorld),
  50490. c.position.copy(z),
  50491. P.setRenderTarget(p),
  50492. P.clear();
  50493. for (var g = 0; g < i; g++) {
  50494. if (n) {
  50495. H.copy(c.position),
  50496. H.add(W[g]),
  50497. c.up.copy(j[g]),
  50498. c.lookAt(H);
  50499. var m = Y[g];
  50500. B.viewport(m)
  50501. } else
  50502. H.setFromMatrixPosition(s.target.matrixWorld),
  50503. c.lookAt(H);
  50504. c.updateMatrixWorld(),
  50505. c.matrixWorldInverse.getInverse(c.matrixWorld),
  50506. f.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  50507. f.multiply(c.projectionMatrix),
  50508. f.multiply(c.matrixWorldInverse),
  50509. k.multiplyMatrices(c.projectionMatrix, c.matrixWorldInverse),
  50510. V.setFromMatrix(k),
  50511. G.length = 0,
  50512. N(e, t, c);
  50513. for (var v = 0, y = G.length; v < y; v++) {
  50514. var A = G[v]
  50515. , C = L.update(A)
  50516. , I = A.material;
  50517. if (I instanceof Ci.MultiMaterial)
  50518. for (var E = C.groups, _ = I.materials, b = 0, w = E.length; b < w; b++) {
  50519. var T = E[b]
  50520. , x = _[T.materialIndex];
  50521. if (!0 === x.visible) {
  50522. var S = D(A, x, n, z);
  50523. P.renderBufferDirect(c, null, C, S, A, T)
  50524. }
  50525. }
  50526. else {
  50527. S = D(A, I, n, z);
  50528. P.renderBufferDirect(c, null, C, S, A, null)
  50529. }
  50530. }
  50531. }
  50532. }
  50533. var M = P.getClearColor()
  50534. , R = P.getClearAlpha();
  50535. P.setClearColor(M, R),
  50536. B.enable(F.BLEND),
  50537. q.cullFace === Ci.CullFaceFront && F.cullFace(F.BACK),
  50538. q.needsUpdate = !1
  50539. }
  50540. }
  50541. }
  50542. ,
  50543. Ci.WebGLState = function(l, i, c) {
  50544. var n = this
  50545. , r = new Ci.Vector4
  50546. , o = new Uint8Array(16)
  50547. , a = new Uint8Array(16)
  50548. , s = new Uint8Array(16)
  50549. , t = {}
  50550. , h = null
  50551. , u = null
  50552. , d = null
  50553. , p = null
  50554. , f = null
  50555. , g = null
  50556. , m = null
  50557. , v = null
  50558. , y = !1
  50559. , A = null
  50560. , C = null
  50561. , I = null
  50562. , E = null
  50563. , _ = null
  50564. , b = null
  50565. , w = null
  50566. , T = null
  50567. , x = null
  50568. , S = null
  50569. , M = null
  50570. , R = null
  50571. , P = null
  50572. , O = null
  50573. , L = null
  50574. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  50575. , N = void 0
  50576. , F = {}
  50577. , B = new Ci.Vector4
  50578. , V = null
  50579. , k = null
  50580. , U = new Ci.Vector4
  50581. , H = new Ci.Vector4
  50582. , z = l.createTexture();
  50583. l.bindTexture(l.TEXTURE_2D, z),
  50584. l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.LINEAR),
  50585. l.texImage2D(l.TEXTURE_2D, 0, l.RGB, 1, 1, 0, l.RGB, l.UNSIGNED_BYTE, new Uint8Array(3)),
  50586. this.init = function() {
  50587. this.clearColor(0, 0, 0, 1),
  50588. this.clearDepth(1),
  50589. this.clearStencil(0),
  50590. this.enable(l.DEPTH_TEST),
  50591. l.depthFunc(l.LEQUAL),
  50592. l.frontFace(l.CCW),
  50593. l.cullFace(l.BACK),
  50594. this.enable(l.CULL_FACE),
  50595. this.enable(l.BLEND),
  50596. l.blendEquation(l.FUNC_ADD),
  50597. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  50598. }
  50599. ,
  50600. this.initAttributes = function() {
  50601. for (var e = 0, t = o.length; e < t; e++)
  50602. o[e] = 0
  50603. }
  50604. ,
  50605. this.enableAttribute = function(e) {
  50606. o[e] = 1,
  50607. 0 === a[e] && (l.enableVertexAttribArray(e),
  50608. a[e] = 1),
  50609. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  50610. s[e] = 0)
  50611. }
  50612. ,
  50613. this.enableAttributeAndDivisor = function(e, t, i) {
  50614. o[e] = 1,
  50615. 0 === a[e] && (l.enableVertexAttribArray(e),
  50616. a[e] = 1),
  50617. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  50618. s[e] = t)
  50619. }
  50620. ,
  50621. this.disableUnusedAttributes = function() {
  50622. for (var e = 0, t = a.length; e < t; e++)
  50623. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  50624. a[e] = 0)
  50625. }
  50626. ,
  50627. this.enable = function(e) {
  50628. !0 !== t[e] && (l.enable(e),
  50629. t[e] = !0)
  50630. }
  50631. ,
  50632. this.disable = function(e) {
  50633. !1 !== t[e] && (l.disable(e),
  50634. t[e] = !1)
  50635. }
  50636. ,
  50637. this.getCompressedTextureFormats = function() {
  50638. if (null === h && (h = [],
  50639. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  50640. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  50641. h.push(e[t]);
  50642. return h
  50643. }
  50644. ,
  50645. this.setBlending = function(e, t, i, n, r, o, a, s) {
  50646. e === Ci.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  50647. e === u && s === y || (e === Ci.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50648. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  50649. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === Ci.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50650. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50651. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === Ci.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50652. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50653. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50654. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50655. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  50656. u = e,
  50657. y = s),
  50658. e === Ci.CustomBlending ? (r = r || t,
  50659. o = o || i,
  50660. a = a || n,
  50661. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  50662. d = t,
  50663. g = r),
  50664. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  50665. p = i,
  50666. f = n,
  50667. m = o,
  50668. v = a)) : v = m = g = f = p = d = null
  50669. }
  50670. ,
  50671. this.setDepthFunc = function(e) {
  50672. if (A !== e) {
  50673. if (e)
  50674. switch (e) {
  50675. case Ci.NeverDepth:
  50676. l.depthFunc(l.NEVER);
  50677. break;
  50678. case Ci.AlwaysDepth:
  50679. l.depthFunc(l.ALWAYS);
  50680. break;
  50681. case Ci.LessDepth:
  50682. l.depthFunc(l.LESS);
  50683. break;
  50684. case Ci.LessEqualDepth:
  50685. l.depthFunc(l.LEQUAL);
  50686. break;
  50687. case Ci.EqualDepth:
  50688. l.depthFunc(l.EQUAL);
  50689. break;
  50690. case Ci.GreaterEqualDepth:
  50691. l.depthFunc(l.GEQUAL);
  50692. break;
  50693. case Ci.GreaterDepth:
  50694. l.depthFunc(l.GREATER);
  50695. break;
  50696. case Ci.NotEqualDepth:
  50697. l.depthFunc(l.NOTEQUAL);
  50698. break;
  50699. default:
  50700. l.depthFunc(l.LEQUAL)
  50701. }
  50702. else
  50703. l.depthFunc(l.LEQUAL);
  50704. A = e
  50705. }
  50706. }
  50707. ,
  50708. this.setDepthTest = function(e) {
  50709. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  50710. }
  50711. ,
  50712. this.setDepthWrite = function(e) {
  50713. C !== e && (l.depthMask(e),
  50714. C = e)
  50715. }
  50716. ,
  50717. this.setColorWrite = function(e) {
  50718. I !== e && (l.colorMask(e, e, e, e),
  50719. I = e)
  50720. }
  50721. ,
  50722. this.setStencilFunc = function(e, t, i) {
  50723. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  50724. _ = e,
  50725. b = t,
  50726. w = i)
  50727. }
  50728. ,
  50729. this.setStencilOp = function(e, t, i) {
  50730. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  50731. T = e,
  50732. x = t,
  50733. S = i)
  50734. }
  50735. ,
  50736. this.setStencilTest = function(e) {
  50737. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  50738. }
  50739. ,
  50740. this.setStencilWrite = function(e) {
  50741. E !== e && (l.stencilMask(e),
  50742. E = e)
  50743. }
  50744. ,
  50745. this.setFlipSided = function(e) {
  50746. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  50747. M = e)
  50748. }
  50749. ,
  50750. this.setLineWidth = function(e) {
  50751. e !== R && (l.lineWidth(e),
  50752. R = e)
  50753. }
  50754. ,
  50755. this.setPolygonOffset = function(e, t, i) {
  50756. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  50757. !e || P === t && O === i || (l.polygonOffset(t, i),
  50758. P = t,
  50759. O = i)
  50760. }
  50761. ,
  50762. this.getScissorTest = function() {
  50763. return L
  50764. }
  50765. ,
  50766. this.setScissorTest = function(e) {
  50767. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  50768. }
  50769. ,
  50770. this.activeTexture = function(e) {
  50771. void 0 === e && (e = l.TEXTURE0 + D - 1),
  50772. N !== e && (l.activeTexture(e),
  50773. N = e)
  50774. }
  50775. ,
  50776. this.bindTexture = function(e, t) {
  50777. void 0 === N && n.activeTexture();
  50778. var i = F[N];
  50779. void 0 === i && (i = {
  50780. type: void 0,
  50781. texture: void 0
  50782. },
  50783. F[N] = i),
  50784. i.type === e && i.texture === t || (l.bindTexture(e, t || z),
  50785. i.type = e,
  50786. i.texture = t)
  50787. }
  50788. ,
  50789. this.compressedTexImage2D = function() {
  50790. try {
  50791. l.compressedTexImage2D.apply(l, arguments)
  50792. } catch (e) {
  50793. console.error(e)
  50794. }
  50795. }
  50796. ,
  50797. this.texImage2D = function() {
  50798. try {
  50799. l.texImage2D.apply(l, arguments)
  50800. } catch (e) {
  50801. console.error(e)
  50802. }
  50803. }
  50804. ,
  50805. this.clearColor = function(e, t, i, n) {
  50806. r.set(e, t, i, n),
  50807. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  50808. B.copy(r))
  50809. }
  50810. ,
  50811. this.clearDepth = function(e) {
  50812. V !== e && (l.clearDepth(e),
  50813. V = e)
  50814. }
  50815. ,
  50816. this.clearStencil = function(e) {
  50817. k !== e && (l.clearStencil(e),
  50818. k = e)
  50819. }
  50820. ,
  50821. this.scissor = function(e) {
  50822. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  50823. U.copy(e))
  50824. }
  50825. ,
  50826. this.viewport = function(e) {
  50827. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  50828. H.copy(e))
  50829. }
  50830. ,
  50831. this.reset = function() {
  50832. for (var e = 0; e < a.length; e++)
  50833. 1 === a[e] && (l.disableVertexAttribArray(e),
  50834. a[e] = 0);
  50835. t = {},
  50836. N = void 0,
  50837. F = {},
  50838. M = E = C = I = u = h = null
  50839. }
  50840. }
  50841. ,
  50842. Ci.LensFlarePlugin = function(v, y) {
  50843. function A() {
  50844. 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]);
  50845. C = S.createBuffer(),
  50846. I = S.createBuffer(),
  50847. S.bindBuffer(S.ARRAY_BUFFER, C),
  50848. S.bufferData(S.ARRAY_BUFFER, t, S.STATIC_DRAW),
  50849. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  50850. S.bufferData(S.ELEMENT_ARRAY_BUFFER, i, S.STATIC_DRAW),
  50851. T = S.createTexture(),
  50852. x = S.createTexture(),
  50853. M.bindTexture(S.TEXTURE_2D, T),
  50854. S.texImage2D(S.TEXTURE_2D, 0, S.RGB, 16, 16, 0, S.RGB, S.UNSIGNED_BYTE, null),
  50855. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50856. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50857. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50858. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50859. M.bindTexture(S.TEXTURE_2D, x),
  50860. S.texImage2D(S.TEXTURE_2D, 0, S.RGBA, 16, 16, 0, S.RGBA, S.UNSIGNED_BYTE, null),
  50861. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50862. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50863. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50864. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50865. e = (w = 0 < S.getParameter(S.MAX_VERTEX_TEXTURE_IMAGE_UNITS)) ? {
  50866. 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"),
  50867. 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")
  50868. } : {
  50869. 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"),
  50870. 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")
  50871. },
  50872. E = function(e) {
  50873. var t = S.createProgram()
  50874. , i = S.createShader(S.FRAGMENT_SHADER)
  50875. , n = S.createShader(S.VERTEX_SHADER)
  50876. , r = "precision " + v.getPrecision() + " float;\n";
  50877. return S.shaderSource(i, r + e.fragmentShader),
  50878. S.shaderSource(n, r + e.vertexShader),
  50879. S.compileShader(i),
  50880. S.compileShader(n),
  50881. S.attachShader(t, i),
  50882. S.attachShader(t, n),
  50883. S.linkProgram(t),
  50884. t
  50885. }(e),
  50886. _ = {
  50887. vertex: S.getAttribLocation(E, "position"),
  50888. uv: S.getAttribLocation(E, "uv")
  50889. },
  50890. b = {
  50891. renderType: S.getUniformLocation(E, "renderType"),
  50892. map: S.getUniformLocation(E, "map"),
  50893. occlusionMap: S.getUniformLocation(E, "occlusionMap"),
  50894. opacity: S.getUniformLocation(E, "opacity"),
  50895. color: S.getUniformLocation(E, "color"),
  50896. scale: S.getUniformLocation(E, "scale"),
  50897. rotation: S.getUniformLocation(E, "rotation"),
  50898. screenPosition: S.getUniformLocation(E, "screenPosition")
  50899. }
  50900. }
  50901. var C, I, E, _, b, w, T, x, S = v.context, M = v.state;
  50902. this.render = function(e, t, i) {
  50903. if (0 !== y.length) {
  50904. var n = new Ci.Vector3
  50905. , r = i.w / i.z
  50906. , o = .5 * i.z
  50907. , a = .5 * i.w
  50908. , s = 16 / i.w
  50909. , l = new Ci.Vector2(s * r,s)
  50910. , c = new Ci.Vector3(1,1,0)
  50911. , h = new Ci.Vector2(1,1);
  50912. void 0 === E && A(),
  50913. S.useProgram(E),
  50914. M.initAttributes(),
  50915. M.enableAttribute(_.vertex),
  50916. M.enableAttribute(_.uv),
  50917. M.disableUnusedAttributes(),
  50918. S.uniform1i(b.occlusionMap, 0),
  50919. S.uniform1i(b.map, 1),
  50920. S.bindBuffer(S.ARRAY_BUFFER, C),
  50921. S.vertexAttribPointer(_.vertex, 2, S.FLOAT, !1, 16, 0),
  50922. S.vertexAttribPointer(_.uv, 2, S.FLOAT, !1, 16, 8),
  50923. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  50924. M.disable(S.CULL_FACE),
  50925. M.setDepthWrite(!1);
  50926. for (var u = 0, d = y.length; u < d; u++) {
  50927. s = 16 / i.w,
  50928. l.set(s * r, s);
  50929. var p = y[u];
  50930. if (n.set(p.matrixWorld.elements[12], p.matrixWorld.elements[13], p.matrixWorld.elements[14]),
  50931. n.applyMatrix4(t.matrixWorldInverse),
  50932. n.applyProjection(t.projectionMatrix),
  50933. c.copy(n),
  50934. h.x = c.x * o + o,
  50935. h.y = c.y * a + a,
  50936. w || 0 < h.x && h.x < i.z && 0 < h.y && h.y < i.w) {
  50937. M.activeTexture(S.TEXTURE0),
  50938. M.bindTexture(S.TEXTURE_2D, null),
  50939. M.activeTexture(S.TEXTURE1),
  50940. M.bindTexture(S.TEXTURE_2D, T),
  50941. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGB, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  50942. S.uniform1i(b.renderType, 0),
  50943. S.uniform2f(b.scale, l.x, l.y),
  50944. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  50945. M.disable(S.BLEND),
  50946. M.enable(S.DEPTH_TEST),
  50947. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  50948. M.activeTexture(S.TEXTURE0),
  50949. M.bindTexture(S.TEXTURE_2D, x),
  50950. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGBA, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  50951. S.uniform1i(b.renderType, 1),
  50952. M.disable(S.DEPTH_TEST),
  50953. M.activeTexture(S.TEXTURE1),
  50954. M.bindTexture(S.TEXTURE_2D, T),
  50955. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  50956. p.positionScreen.copy(c),
  50957. p.customUpdateCallback ? p.customUpdateCallback(p) : p.updateLensFlares(),
  50958. S.uniform1i(b.renderType, 2),
  50959. M.enable(S.BLEND);
  50960. for (var f = 0, g = p.lensFlares.length; f < g; f++) {
  50961. var m = p.lensFlares[f];
  50962. .001 < m.opacity && .001 < m.scale && (c.x = m.x,
  50963. c.y = m.y,
  50964. c.z = m.z,
  50965. s = m.size * m.scale / i.w,
  50966. l.x = s * r,
  50967. l.y = s,
  50968. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  50969. S.uniform2f(b.scale, l.x, l.y),
  50970. S.uniform1f(b.rotation, m.rotation),
  50971. S.uniform1f(b.opacity, m.opacity),
  50972. S.uniform3f(b.color, m.color.r, m.color.g, m.color.b),
  50973. M.setBlending(m.blending, m.blendEquation, m.blendSrc, m.blendDst),
  50974. v.setTexture(m.texture, 1),
  50975. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0))
  50976. }
  50977. }
  50978. }
  50979. M.enable(S.CULL_FACE),
  50980. M.enable(S.DEPTH_TEST),
  50981. M.setDepthWrite(!0),
  50982. v.resetGLState()
  50983. }
  50984. }
  50985. }
  50986. ,
  50987. Ci.SpritePlugin = function(u, d) {
  50988. function p() {
  50989. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  50990. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  50991. g = I.createBuffer(),
  50992. m = I.createBuffer(),
  50993. I.bindBuffer(I.ARRAY_BUFFER, g),
  50994. I.bufferData(I.ARRAY_BUFFER, e, I.STATIC_DRAW),
  50995. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  50996. I.bufferData(I.ELEMENT_ARRAY_BUFFER, t, I.STATIC_DRAW),
  50997. v = function() {
  50998. var e = I.createProgram()
  50999. , t = I.createShader(I.VERTEX_SHADER)
  51000. , i = I.createShader(I.FRAGMENT_SHADER);
  51001. 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")),
  51002. 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")),
  51003. I.compileShader(t),
  51004. I.compileShader(i),
  51005. I.attachShader(e, t),
  51006. I.attachShader(e, i),
  51007. I.linkProgram(e),
  51008. e
  51009. }(),
  51010. y = {
  51011. position: I.getAttribLocation(v, "position"),
  51012. uv: I.getAttribLocation(v, "uv")
  51013. },
  51014. A = {
  51015. uvOffset: I.getUniformLocation(v, "uvOffset"),
  51016. uvScale: I.getUniformLocation(v, "uvScale"),
  51017. rotation: I.getUniformLocation(v, "rotation"),
  51018. scale: I.getUniformLocation(v, "scale"),
  51019. color: I.getUniformLocation(v, "color"),
  51020. map: I.getUniformLocation(v, "map"),
  51021. opacity: I.getUniformLocation(v, "opacity"),
  51022. modelViewMatrix: I.getUniformLocation(v, "modelViewMatrix"),
  51023. projectionMatrix: I.getUniformLocation(v, "projectionMatrix"),
  51024. fogType: I.getUniformLocation(v, "fogType"),
  51025. fogDensity: I.getUniformLocation(v, "fogDensity"),
  51026. fogNear: I.getUniformLocation(v, "fogNear"),
  51027. fogFar: I.getUniformLocation(v, "fogFar"),
  51028. fogColor: I.getUniformLocation(v, "fogColor"),
  51029. alphaTest: I.getUniformLocation(v, "alphaTest")
  51030. };
  51031. var i = document.createElement("canvas");
  51032. i.width = 8,
  51033. i.height = 8;
  51034. var n = i.getContext("2d");
  51035. n.fillStyle = "white",
  51036. n.fillRect(0, 0, 8, 8),
  51037. (C = new Ci.Texture(i)).needsUpdate = !0
  51038. }
  51039. function f(e, t) {
  51040. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  51041. }
  51042. var g, m, v, y, A, C, I = u.context, E = u.state, _ = new Ci.Vector3, b = new Ci.Quaternion, w = new Ci.Vector3;
  51043. this.render = function(e, t) {
  51044. if (0 !== d.length) {
  51045. void 0 === v && p(),
  51046. I.useProgram(v),
  51047. E.initAttributes(),
  51048. E.enableAttribute(y.position),
  51049. E.enableAttribute(y.uv),
  51050. E.disableUnusedAttributes(),
  51051. E.disable(I.CULL_FACE),
  51052. E.enable(I.BLEND),
  51053. I.bindBuffer(I.ARRAY_BUFFER, g),
  51054. I.vertexAttribPointer(y.position, 2, I.FLOAT, !1, 16, 0),
  51055. I.vertexAttribPointer(y.uv, 2, I.FLOAT, !1, 16, 8),
  51056. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  51057. I.uniformMatrix4fv(A.projectionMatrix, !1, t.projectionMatrix.elements),
  51058. E.activeTexture(I.TEXTURE0),
  51059. I.uniform1i(A.map, 0);
  51060. var i = 0
  51061. , n = 0
  51062. , r = e.fog;
  51063. r ? (I.uniform3f(A.fogColor, r.color.r, r.color.g, r.color.b),
  51064. r instanceof Ci.Fog ? (I.uniform1f(A.fogNear, r.near),
  51065. I.uniform1f(A.fogFar, r.far),
  51066. I.uniform1i(A.fogType, 1),
  51067. n = i = 1) : r instanceof Ci.FogExp2 && (I.uniform1f(A.fogDensity, r.density),
  51068. I.uniform1i(A.fogType, 2),
  51069. n = i = 2)) : (I.uniform1i(A.fogType, 0),
  51070. n = i = 0);
  51071. for (var o = 0, a = d.length; o < a; o++) {
  51072. (l = d[o]).modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  51073. l.z = -l.modelViewMatrix.elements[14]
  51074. }
  51075. d.sort(f);
  51076. var s = [];
  51077. for (o = 0,
  51078. a = d.length; o < a; o++) {
  51079. var l, c = (l = d[o]).material;
  51080. I.uniform1f(A.alphaTest, c.alphaTest),
  51081. I.uniformMatrix4fv(A.modelViewMatrix, !1, l.modelViewMatrix.elements),
  51082. l.matrixWorld.decompose(_, b, w),
  51083. s[0] = w.x,
  51084. s[1] = w.y;
  51085. var h = 0;
  51086. e.fog && c.fog && (h = n),
  51087. i !== h && (I.uniform1i(A.fogType, h),
  51088. i = h),
  51089. null !== c.map ? (I.uniform2f(A.uvOffset, c.map.offset.x, c.map.offset.y),
  51090. I.uniform2f(A.uvScale, c.map.repeat.x, c.map.repeat.y)) : (I.uniform2f(A.uvOffset, 0, 0),
  51091. I.uniform2f(A.uvScale, 1, 1)),
  51092. I.uniform1f(A.opacity, c.opacity),
  51093. I.uniform3f(A.color, c.color.r, c.color.g, c.color.b),
  51094. I.uniform1f(A.rotation, c.rotation),
  51095. I.uniform2fv(A.scale, s),
  51096. E.setBlending(c.blending, c.blendEquation, c.blendSrc, c.blendDst),
  51097. E.setDepthTest(c.depthTest),
  51098. E.setDepthWrite(c.depthWrite),
  51099. c.map && c.map.image && c.map.image.width ? u.setTexture(c.map, 0) : u.setTexture(C, 0),
  51100. I.drawElements(I.TRIANGLES, 6, I.UNSIGNED_SHORT, 0)
  51101. }
  51102. E.enable(I.CULL_FACE),
  51103. u.resetGLState()
  51104. }
  51105. }
  51106. }
  51107. ,
  51108. Object.defineProperties(Ci.Box2.prototype, {
  51109. empty: {
  51110. value: function() {
  51111. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  51112. this.isEmpty()
  51113. }
  51114. },
  51115. isIntersectionBox: {
  51116. value: function(e) {
  51117. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51118. this.intersectsBox(e)
  51119. }
  51120. }
  51121. }),
  51122. Object.defineProperties(Ci.Box3.prototype, {
  51123. empty: {
  51124. value: function() {
  51125. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  51126. this.isEmpty()
  51127. }
  51128. },
  51129. isIntersectionBox: {
  51130. value: function(e) {
  51131. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51132. this.intersectsBox(e)
  51133. }
  51134. },
  51135. isIntersectionSphere: {
  51136. value: function(e) {
  51137. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51138. this.intersectsSphere(e)
  51139. }
  51140. }
  51141. }),
  51142. Object.defineProperties(Ci.Matrix3.prototype, {
  51143. multiplyVector3: {
  51144. value: function(e) {
  51145. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  51146. e.applyMatrix3(this)
  51147. }
  51148. },
  51149. multiplyVector3Array: {
  51150. value: function(e) {
  51151. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51152. this.applyToVector3Array(e)
  51153. }
  51154. }
  51155. }),
  51156. Object.defineProperties(Ci.Matrix4.prototype, {
  51157. extractPosition: {
  51158. value: function(e) {
  51159. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  51160. this.copyPosition(e)
  51161. }
  51162. },
  51163. setRotationFromQuaternion: {
  51164. value: function(e) {
  51165. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  51166. this.makeRotationFromQuaternion(e)
  51167. }
  51168. },
  51169. multiplyVector3: {
  51170. value: function(e) {
  51171. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  51172. e.applyProjection(this)
  51173. }
  51174. },
  51175. multiplyVector4: {
  51176. value: function(e) {
  51177. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51178. e.applyMatrix4(this)
  51179. }
  51180. },
  51181. multiplyVector3Array: {
  51182. value: function(e) {
  51183. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51184. this.applyToVector3Array(e)
  51185. }
  51186. },
  51187. rotateAxis: {
  51188. value: function(e) {
  51189. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  51190. e.transformDirection(this)
  51191. }
  51192. },
  51193. crossVector: {
  51194. value: function(e) {
  51195. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51196. e.applyMatrix4(this)
  51197. }
  51198. },
  51199. translate: {
  51200. value: function(e) {
  51201. console.error("THREE.Matrix4: .translate() has been removed.")
  51202. }
  51203. },
  51204. rotateX: {
  51205. value: function(e) {
  51206. console.error("THREE.Matrix4: .rotateX() has been removed.")
  51207. }
  51208. },
  51209. rotateY: {
  51210. value: function(e) {
  51211. console.error("THREE.Matrix4: .rotateY() has been removed.")
  51212. }
  51213. },
  51214. rotateZ: {
  51215. value: function(e) {
  51216. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  51217. }
  51218. },
  51219. rotateByAxis: {
  51220. value: function(e, t) {
  51221. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  51222. }
  51223. }
  51224. }),
  51225. Object.defineProperties(Ci.Plane.prototype, {
  51226. isIntersectionLine: {
  51227. value: function(e) {
  51228. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  51229. this.intersectsLine(e)
  51230. }
  51231. }
  51232. }),
  51233. Object.defineProperties(Ci.Quaternion.prototype, {
  51234. multiplyVector3: {
  51235. value: function(e) {
  51236. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  51237. e.applyQuaternion(this)
  51238. }
  51239. }
  51240. }),
  51241. Object.defineProperties(Ci.Ray.prototype, {
  51242. isIntersectionBox: {
  51243. value: function(e) {
  51244. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51245. this.intersectsBox(e)
  51246. }
  51247. },
  51248. isIntersectionPlane: {
  51249. value: function(e) {
  51250. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  51251. this.intersectsPlane(e)
  51252. }
  51253. },
  51254. isIntersectionSphere: {
  51255. value: function(e) {
  51256. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51257. this.intersectsSphere(e)
  51258. }
  51259. }
  51260. }),
  51261. Object.defineProperties(Ci.Vector3.prototype, {
  51262. setEulerFromRotationMatrix: {
  51263. value: function() {
  51264. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  51265. }
  51266. },
  51267. setEulerFromQuaternion: {
  51268. value: function() {
  51269. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  51270. }
  51271. },
  51272. getPositionFromMatrix: {
  51273. value: function(e) {
  51274. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  51275. this.setFromMatrixPosition(e)
  51276. }
  51277. },
  51278. getScaleFromMatrix: {
  51279. value: function(e) {
  51280. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  51281. this.setFromMatrixScale(e)
  51282. }
  51283. },
  51284. getColumnFromMatrix: {
  51285. value: function(e, t) {
  51286. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  51287. this.setFromMatrixColumn(e, t)
  51288. }
  51289. }
  51290. }),
  51291. Ci.Face4 = function(e, t, i, n, r, o, a) {
  51292. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  51293. new Ci.Face3(e,t,i,r,o,a)
  51294. }
  51295. ,
  51296. Ci.Vertex = function(e, t, i) {
  51297. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  51298. new Ci.Vector3(e,t,i)
  51299. }
  51300. ,
  51301. Object.defineProperties(Ci.Object3D.prototype, {
  51302. eulerOrder: {
  51303. get: function() {
  51304. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51305. this.rotation.order
  51306. },
  51307. set: function(e) {
  51308. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51309. this.rotation.order = e
  51310. }
  51311. },
  51312. getChildByName: {
  51313. value: function(e) {
  51314. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  51315. this.getObjectByName(e)
  51316. }
  51317. },
  51318. renderDepth: {
  51319. set: function(e) {
  51320. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  51321. }
  51322. },
  51323. translate: {
  51324. value: function(e, t) {
  51325. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  51326. this.translateOnAxis(t, e)
  51327. }
  51328. },
  51329. useQuaternion: {
  51330. get: function() {
  51331. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51332. },
  51333. set: function(e) {
  51334. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51335. }
  51336. }
  51337. }),
  51338. Object.defineProperties(Ci, {
  51339. PointCloud: {
  51340. value: function(e, t) {
  51341. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  51342. new Ci.Points(e,t)
  51343. }
  51344. },
  51345. ParticleSystem: {
  51346. value: function(e, t) {
  51347. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  51348. new Ci.Points(e,t)
  51349. }
  51350. }
  51351. }),
  51352. Object.defineProperties(Ci.Light.prototype, {
  51353. onlyShadow: {
  51354. set: function(e) {
  51355. console.warn("THREE.Light: .onlyShadow has been removed.")
  51356. }
  51357. },
  51358. shadowCameraFov: {
  51359. set: function(e) {
  51360. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  51361. this.shadow.camera.fov = e
  51362. }
  51363. },
  51364. shadowCameraLeft: {
  51365. set: function(e) {
  51366. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  51367. this.shadow.camera.left = e
  51368. }
  51369. },
  51370. shadowCameraRight: {
  51371. set: function(e) {
  51372. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  51373. this.shadow.camera.right = e
  51374. }
  51375. },
  51376. shadowCameraTop: {
  51377. set: function(e) {
  51378. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  51379. this.shadow.camera.top = e
  51380. }
  51381. },
  51382. shadowCameraBottom: {
  51383. set: function(e) {
  51384. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  51385. this.shadow.camera.bottom = e
  51386. }
  51387. },
  51388. shadowCameraNear: {
  51389. set: function(e) {
  51390. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  51391. this.shadow.camera.near = e
  51392. }
  51393. },
  51394. shadowCameraFar: {
  51395. set: function(e) {
  51396. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  51397. this.shadow.camera.far = e
  51398. }
  51399. },
  51400. shadowCameraVisible: {
  51401. set: function(e) {
  51402. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  51403. }
  51404. },
  51405. shadowBias: {
  51406. set: function(e) {
  51407. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  51408. this.shadow.bias = e
  51409. }
  51410. },
  51411. shadowDarkness: {
  51412. set: function(e) {
  51413. console.warn("THREE.Light: .shadowDarkness has been removed.")
  51414. }
  51415. },
  51416. shadowMapWidth: {
  51417. set: function(e) {
  51418. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  51419. this.shadow.mapSize.width = e
  51420. }
  51421. },
  51422. shadowMapHeight: {
  51423. set: function(e) {
  51424. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  51425. this.shadow.mapSize.height = e
  51426. }
  51427. }
  51428. }),
  51429. Object.defineProperties(Ci.BufferAttribute.prototype, {
  51430. length: {
  51431. get: function() {
  51432. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  51433. this.array.length
  51434. }
  51435. }
  51436. }),
  51437. Object.defineProperties(Ci.BufferGeometry.prototype, {
  51438. drawcalls: {
  51439. get: function() {
  51440. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  51441. this.groups
  51442. }
  51443. },
  51444. offsets: {
  51445. get: function() {
  51446. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  51447. this.groups
  51448. }
  51449. },
  51450. addIndex: {
  51451. value: function(e) {
  51452. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  51453. this.setIndex(e)
  51454. }
  51455. },
  51456. addDrawCall: {
  51457. value: function(e, t, i) {
  51458. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  51459. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  51460. this.addGroup(e, t)
  51461. }
  51462. },
  51463. clearDrawCalls: {
  51464. value: function() {
  51465. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  51466. this.clearGroups()
  51467. }
  51468. },
  51469. computeTangents: {
  51470. value: function() {
  51471. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  51472. }
  51473. },
  51474. computeOffsets: {
  51475. value: function() {
  51476. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  51477. }
  51478. }
  51479. }),
  51480. Object.defineProperties(Ci.Material.prototype, {
  51481. wrapAround: {
  51482. get: function() {
  51483. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51484. },
  51485. set: function(e) {
  51486. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51487. }
  51488. },
  51489. wrapRGB: {
  51490. get: function() {
  51491. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  51492. new Ci.Color
  51493. }
  51494. }
  51495. }),
  51496. Object.defineProperties(Ci, {
  51497. PointCloudMaterial: {
  51498. value: function(e) {
  51499. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  51500. new Ci.PointsMaterial(e)
  51501. }
  51502. },
  51503. ParticleBasicMaterial: {
  51504. value: function(e) {
  51505. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  51506. new Ci.PointsMaterial(e)
  51507. }
  51508. },
  51509. ParticleSystemMaterial: {
  51510. value: function(e) {
  51511. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  51512. new Ci.PointsMaterial(e)
  51513. }
  51514. }
  51515. }),
  51516. Object.defineProperties(Ci.MeshPhongMaterial.prototype, {
  51517. metal: {
  51518. get: function() {
  51519. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  51520. !1
  51521. },
  51522. set: function(e) {
  51523. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  51524. }
  51525. }
  51526. }),
  51527. Object.defineProperties(Ci.ShaderMaterial.prototype, {
  51528. derivatives: {
  51529. get: function() {
  51530. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51531. this.extensions.derivatives
  51532. },
  51533. set: function(e) {
  51534. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51535. this.extensions.derivatives = e
  51536. }
  51537. }
  51538. }),
  51539. Object.defineProperties(Ci.WebGLRenderer.prototype, {
  51540. supportsFloatTextures: {
  51541. value: function() {
  51542. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  51543. this.extensions.get("OES_texture_float")
  51544. }
  51545. },
  51546. supportsHalfFloatTextures: {
  51547. value: function() {
  51548. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  51549. this.extensions.get("OES_texture_half_float")
  51550. }
  51551. },
  51552. supportsStandardDerivatives: {
  51553. value: function() {
  51554. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  51555. this.extensions.get("OES_standard_derivatives")
  51556. }
  51557. },
  51558. supportsCompressedTextureS3TC: {
  51559. value: function() {
  51560. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  51561. this.extensions.get("WEBGL_compressed_texture_s3tc")
  51562. }
  51563. },
  51564. supportsCompressedTexturePVRTC: {
  51565. value: function() {
  51566. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  51567. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  51568. }
  51569. },
  51570. supportsBlendMinMax: {
  51571. value: function() {
  51572. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  51573. this.extensions.get("EXT_blend_minmax")
  51574. }
  51575. },
  51576. supportsVertexTextures: {
  51577. value: function() {
  51578. return this.capabilities.vertexTextures
  51579. }
  51580. },
  51581. supportsInstancedArrays: {
  51582. value: function() {
  51583. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  51584. this.extensions.get("ANGLE_instanced_arrays")
  51585. }
  51586. },
  51587. enableScissorTest: {
  51588. value: function(e) {
  51589. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  51590. this.setScissorTest(e)
  51591. }
  51592. },
  51593. initMaterial: {
  51594. value: function() {
  51595. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  51596. }
  51597. },
  51598. addPrePlugin: {
  51599. value: function() {
  51600. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  51601. }
  51602. },
  51603. addPostPlugin: {
  51604. value: function() {
  51605. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  51606. }
  51607. },
  51608. updateShadowMap: {
  51609. value: function() {
  51610. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  51611. }
  51612. },
  51613. shadowMapEnabled: {
  51614. get: function() {
  51615. return this.shadowMap.enabled
  51616. },
  51617. set: function(e) {
  51618. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  51619. this.shadowMap.enabled = e
  51620. }
  51621. },
  51622. shadowMapType: {
  51623. get: function() {
  51624. return this.shadowMap.type
  51625. },
  51626. set: function(e) {
  51627. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  51628. this.shadowMap.type = e
  51629. }
  51630. },
  51631. shadowMapCullFace: {
  51632. get: function() {
  51633. return this.shadowMap.cullFace
  51634. },
  51635. set: function(e) {
  51636. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  51637. this.shadowMap.cullFace = e
  51638. }
  51639. }
  51640. }),
  51641. Object.defineProperties(Ci.WebGLRenderTarget.prototype, {
  51642. wrapS: {
  51643. get: function() {
  51644. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51645. this.texture.wrapS
  51646. },
  51647. set: function(e) {
  51648. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51649. this.texture.wrapS = e
  51650. }
  51651. },
  51652. wrapT: {
  51653. get: function() {
  51654. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51655. this.texture.wrapT
  51656. },
  51657. set: function(e) {
  51658. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51659. this.texture.wrapT = e
  51660. }
  51661. },
  51662. magFilter: {
  51663. get: function() {
  51664. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51665. this.texture.magFilter
  51666. },
  51667. set: function(e) {
  51668. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51669. this.texture.magFilter = e
  51670. }
  51671. },
  51672. minFilter: {
  51673. get: function() {
  51674. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51675. this.texture.minFilter
  51676. },
  51677. set: function(e) {
  51678. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51679. this.texture.minFilter = e
  51680. }
  51681. },
  51682. anisotropy: {
  51683. get: function() {
  51684. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51685. this.texture.anisotropy
  51686. },
  51687. set: function(e) {
  51688. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51689. this.texture.anisotropy = e
  51690. }
  51691. },
  51692. offset: {
  51693. get: function() {
  51694. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51695. this.texture.offset
  51696. },
  51697. set: function(e) {
  51698. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51699. this.texture.offset = e
  51700. }
  51701. },
  51702. repeat: {
  51703. get: function() {
  51704. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51705. this.texture.repeat
  51706. },
  51707. set: function(e) {
  51708. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51709. this.texture.repeat = e
  51710. }
  51711. },
  51712. format: {
  51713. get: function() {
  51714. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51715. this.texture.format
  51716. },
  51717. set: function(e) {
  51718. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51719. this.texture.format = e
  51720. }
  51721. },
  51722. type: {
  51723. get: function() {
  51724. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51725. this.texture.type
  51726. },
  51727. set: function(e) {
  51728. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51729. this.texture.type = e
  51730. }
  51731. },
  51732. generateMipmaps: {
  51733. get: function() {
  51734. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51735. this.texture.generateMipmaps
  51736. },
  51737. set: function(e) {
  51738. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51739. this.texture.generateMipmaps = e
  51740. }
  51741. }
  51742. }),
  51743. Ci.GeometryUtils = {
  51744. merge: function(e, t, i) {
  51745. var n;
  51746. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),
  51747. t instanceof Ci.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  51748. n = t.matrix,
  51749. t = t.geometry),
  51750. e.merge(t, n, i)
  51751. },
  51752. center: function(e) {
  51753. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  51754. e.center()
  51755. }
  51756. },
  51757. Ci.ImageUtils = {
  51758. crossOrigin: void 0,
  51759. loadTexture: function(e, t, i, n) {
  51760. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  51761. var r = new Ci.TextureLoader;
  51762. r.setCrossOrigin(this.crossOrigin);
  51763. var o = r.load(e, i, void 0, n);
  51764. return t && (o.mapping = t),
  51765. o
  51766. },
  51767. loadTextureCube: function(e, t, i, n) {
  51768. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  51769. var r = new Ci.CubeTextureLoader;
  51770. r.setCrossOrigin(this.crossOrigin);
  51771. var o = r.load(e, i, void 0, n);
  51772. return t && (o.mapping = t),
  51773. o
  51774. },
  51775. loadCompressedTexture: function() {
  51776. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  51777. },
  51778. loadCompressedTextureCube: function() {
  51779. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  51780. }
  51781. },
  51782. Ci.Projector = function() {
  51783. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  51784. this.projectVector = function(e, t) {
  51785. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  51786. e.project(t)
  51787. }
  51788. ,
  51789. this.unprojectVector = function(e, t) {
  51790. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  51791. e.unproject(t)
  51792. }
  51793. ,
  51794. this.pickingRay = function(e, t) {
  51795. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  51796. }
  51797. }
  51798. ,
  51799. Ci.CanvasRenderer = function() {
  51800. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  51801. this.domElement = document.createElement("canvas"),
  51802. this.clear = function() {}
  51803. ,
  51804. this.render = function() {}
  51805. ,
  51806. this.setClearColor = function() {}
  51807. ,
  51808. this.setSize = function() {}
  51809. }
  51810. ,
  51811. Ci.MeshFaceMaterial = Ci.MultiMaterial,
  51812. Ci.CurveUtils = {
  51813. tangentQuadraticBezier: function(e, t, i, n) {
  51814. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  51815. },
  51816. tangentCubicBezier: function(e, t, i, n, r) {
  51817. 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
  51818. },
  51819. tangentSpline: function(e, t, i, n, r) {
  51820. return 6 * e * e - 6 * e + (3 * e * e - 4 * e + 1) + (-6 * e * e + 6 * e) + (3 * e * e - 2 * e)
  51821. },
  51822. interpolate: function(e, t, i, n, r) {
  51823. var o = .5 * (i - e)
  51824. , a = .5 * (n - t)
  51825. , s = r * r;
  51826. return (2 * t - 2 * i + o + a) * (r * s) + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  51827. }
  51828. },
  51829. Ci.SceneUtils = {
  51830. createMultiMaterialObject: function(e, t) {
  51831. for (var i = new Ci.Group, n = 0, r = t.length; n < r; n++)
  51832. i.add(new Ci.Mesh(e,t[n]));
  51833. return i
  51834. },
  51835. detach: function(e, t, i) {
  51836. e.applyMatrix(t.matrixWorld),
  51837. t.remove(e),
  51838. i.add(e)
  51839. },
  51840. attach: function(e, t, i) {
  51841. var n = new Ci.Matrix4;
  51842. n.getInverse(i.matrixWorld),
  51843. e.applyMatrix(n),
  51844. t.remove(e),
  51845. i.add(e)
  51846. }
  51847. },
  51848. Ci.ShapeUtils = {
  51849. area: function(e) {
  51850. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  51851. i += e[n].x * e[r].y - e[r].x * e[n].y;
  51852. return .5 * i
  51853. },
  51854. triangulate: function(e, t) {
  51855. var i = e.length;
  51856. if (i < 3)
  51857. return null;
  51858. var n, r, o, a = [], s = [], l = [];
  51859. if (0 < Ci.ShapeUtils.area(e))
  51860. for (r = 0; r < i; r++)
  51861. s[r] = r;
  51862. else
  51863. for (r = 0; r < i; r++)
  51864. s[r] = i - 1 - r;
  51865. var c = i
  51866. , h = 2 * c;
  51867. for (r = c - 1; 2 < c; ) {
  51868. if (h-- <= 0)
  51869. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  51870. t ? l : a;
  51871. if (c <= (n = r) && (n = 0),
  51872. c <= (r = n + 1) && (r = 0),
  51873. c <= (o = r + 1) && (o = 0),
  51874. Si(e, n, r, o, c, s)) {
  51875. var u, d, p, f, g;
  51876. for (u = s[n],
  51877. d = s[r],
  51878. p = s[o],
  51879. a.push([e[u], e[d], e[p]]),
  51880. l.push([s[n], s[r], s[o]]),
  51881. g = (f = r) + 1; g < c; f++,
  51882. g++)
  51883. s[f] = s[g];
  51884. h = 2 * --c
  51885. }
  51886. }
  51887. return t ? l : a
  51888. },
  51889. triangulateShape: function(e, t) {
  51890. function w(e, t, i) {
  51891. 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
  51892. }
  51893. function b(e, t, i, n, r) {
  51894. var o = t.x - e.x
  51895. , a = t.y - e.y
  51896. , s = n.x - i.x
  51897. , l = n.y - i.y
  51898. , c = e.x - i.x
  51899. , h = e.y - i.y
  51900. , u = a * s - o * l
  51901. , d = a * c - o * h;
  51902. if (Math.abs(u) > Number.EPSILON) {
  51903. var p;
  51904. if (0 < u) {
  51905. if (d < 0 || u < d)
  51906. return [];
  51907. if ((p = l * c - s * h) < 0 || u < p)
  51908. return []
  51909. } else {
  51910. if (0 < d || d < u)
  51911. return [];
  51912. if (0 < (p = l * c - s * h) || p < u)
  51913. return []
  51914. }
  51915. if (0 === p)
  51916. return !r || 0 != d && d != u ? [e] : [];
  51917. if (p === u)
  51918. return !r || 0 != d && d != u ? [t] : [];
  51919. if (0 == d)
  51920. return [i];
  51921. if (d == u)
  51922. return [n];
  51923. var f = p / u;
  51924. return [{
  51925. x: e.x + f * o,
  51926. y: e.y + f * a
  51927. }]
  51928. }
  51929. if (0 != d || l * c != s * h)
  51930. return [];
  51931. var g, m, v, y, A, C, I, E, _ = 0 == o && 0 == a, b = 0 == s && 0 == l;
  51932. 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,
  51933. (m = t).x) : (v = (g = t).x,
  51934. (m = e).x),
  51935. i.x < n.x ? (I = (A = i).x,
  51936. (C = n).x) : (I = (A = n).x,
  51937. (C = i).x)) : (y = e.y < t.y ? (v = (g = e).y,
  51938. (m = t).y) : (v = (g = t).y,
  51939. (m = e).y),
  51940. i.y < n.y ? (I = (A = i).y,
  51941. (C = n).y) : (I = (A = n).y,
  51942. (C = i).y)),
  51943. 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])
  51944. }
  51945. function T(e, t, i, n) {
  51946. var r = t.x - e.x
  51947. , o = t.y - e.y
  51948. , a = i.x - e.x
  51949. , s = i.y - e.y
  51950. , l = n.x - e.x
  51951. , c = n.y - e.y
  51952. , h = r * s - o * a
  51953. , u = r * c - o * l;
  51954. if (Math.abs(h) > Number.EPSILON) {
  51955. var d = l * s - c * a;
  51956. return 0 < h ? 0 <= u && 0 <= d : 0 <= u || 0 <= d
  51957. }
  51958. return 0 < u
  51959. }
  51960. for (var i, n, r, o, a, s, l = {}, c = e.concat(), h = 0, u = t.length; h < u; h++)
  51961. Array.prototype.push.apply(c, t[h]);
  51962. for (i = 0,
  51963. n = c.length; i < n; i++)
  51964. void 0 !== l[a = c[i].x + ":" + c[i].y] && console.warn("THREE.Shape: Duplicate point", a),
  51965. l[a] = i;
  51966. var d = function(e, a) {
  51967. function t(e, t) {
  51968. var i = m.length - 1
  51969. , n = e - 1;
  51970. n < 0 && (n = i);
  51971. var r = e + 1;
  51972. i < r && (r = 0);
  51973. var o = T(m[e], m[n], m[r], c[t]);
  51974. if (!o)
  51975. return !1;
  51976. var a = c.length - 1
  51977. , s = t - 1;
  51978. s < 0 && (s = a);
  51979. var l = t + 1;
  51980. return a < l && (l = 0),
  51981. !!(o = T(c[t], c[s], c[l], m[e]))
  51982. }
  51983. function i(e, t) {
  51984. var i, n;
  51985. for (i = 0; i < m.length; i++)
  51986. if (n = i + 1,
  51987. n %= m.length,
  51988. 0 < b(e, t, m[i], m[n], !0).length)
  51989. return !0;
  51990. return !1
  51991. }
  51992. function n(e, t) {
  51993. var i, n, r, o;
  51994. for (i = 0; i < v.length; i++)
  51995. for (n = a[v[i]],
  51996. r = 0; r < n.length; r++)
  51997. if (o = r + 1,
  51998. o %= n.length,
  51999. 0 < b(e, t, n[r], n[o], !0).length)
  52000. return !0;
  52001. return !1
  52002. }
  52003. 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++)
  52004. v.push(A);
  52005. for (var I = 0, E = 2 * v.length; 0 < v.length; ) {
  52006. if (--E < 0) {
  52007. console.log("Infinite Loop! Holes left:" + v.length + ", Probably Hole outside Shape!");
  52008. break
  52009. }
  52010. for (o = I; o < m.length; o++) {
  52011. s = m[o],
  52012. r = -1;
  52013. for (A = 0; A < v.length; A++)
  52014. if (h = v[A],
  52015. void 0 === y[u = s.x + ":" + s.y + ":" + h]) {
  52016. c = a[h];
  52017. for (var _ = 0; _ < c.length; _++)
  52018. if (l = c[_],
  52019. t(o, _) && !i(s, l) && !n(s, l)) {
  52020. r = _,
  52021. v.splice(A, 1),
  52022. d = m.slice(0, o + 1),
  52023. p = m.slice(o),
  52024. f = c.slice(r),
  52025. g = c.slice(0, r + 1),
  52026. m = d.concat(f).concat(g).concat(p),
  52027. I = o;
  52028. break
  52029. }
  52030. if (0 <= r)
  52031. break;
  52032. y[u] = !0
  52033. }
  52034. if (0 <= r)
  52035. break
  52036. }
  52037. }
  52038. return m
  52039. }(e, t)
  52040. , p = Ci.ShapeUtils.triangulate(d, !1);
  52041. for (i = 0,
  52042. n = p.length; i < n; i++)
  52043. for (o = p[i],
  52044. r = 0; r < 3; r++)
  52045. void 0 !== (s = l[a = o[r].x + ":" + o[r].y]) && (o[r] = s);
  52046. return p.concat()
  52047. },
  52048. isClockWise: function(e) {
  52049. return Ci.ShapeUtils.area(e) < 0
  52050. },
  52051. b2: function(e, t, i, n) {
  52052. return function(e, t) {
  52053. var i = 1 - e;
  52054. return i * i * t
  52055. }(e, t) + function(e, t) {
  52056. return 2 * (1 - e) * e * t
  52057. }(e, i) + function(e, t) {
  52058. return e * e * t
  52059. }(e, n)
  52060. },
  52061. b3: function(e, t, i, n, r) {
  52062. return function(e, t) {
  52063. var i = 1 - e;
  52064. return i * i * i * t
  52065. }(e, t) + function(e, t) {
  52066. var i = 1 - e;
  52067. return 3 * i * i * e * t
  52068. }(e, i) + function(e, t) {
  52069. return 3 * (1 - e) * e * e * t
  52070. }(e, n) + function(e, t) {
  52071. return e * e * e * t
  52072. }(e, r)
  52073. }
  52074. },
  52075. Ci.Curve = function() {}
  52076. ,
  52077. Ci.Curve.prototype = {
  52078. constructor: Ci.Curve,
  52079. getPoint: function(e) {
  52080. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  52081. null
  52082. },
  52083. getPointAt: function(e) {
  52084. var t = this.getUtoTmapping(e);
  52085. return this.getPoint(t)
  52086. },
  52087. getPoints: function(e) {
  52088. e = e || 5;
  52089. var t, i = [];
  52090. for (t = 0; t <= e; t++)
  52091. i.push(this.getPoint(t / e));
  52092. return i
  52093. },
  52094. getSpacedPoints: function(e) {
  52095. e = e || 5;
  52096. var t, i = [];
  52097. for (t = 0; t <= e; t++)
  52098. i.push(this.getPointAt(t / e));
  52099. return i
  52100. },
  52101. getLength: function() {
  52102. var e = this.getLengths();
  52103. return e[e.length - 1]
  52104. },
  52105. getLengths: function(e) {
  52106. if (e = e || (this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  52107. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  52108. return this.cacheArcLengths;
  52109. this.needsUpdate = !1;
  52110. var t, i, n = [], r = this.getPoint(0), o = 0;
  52111. for (n.push(0),
  52112. i = 1; i <= e; i++)
  52113. o += (t = this.getPoint(i / e)).distanceTo(r),
  52114. n.push(o),
  52115. r = t;
  52116. return this.cacheArcLengths = n
  52117. },
  52118. updateArcLengths: function() {
  52119. this.needsUpdate = !0,
  52120. this.getLengths()
  52121. },
  52122. getUtoTmapping: function(e, t) {
  52123. var i, n = this.getLengths(), r = 0, o = n.length;
  52124. i = t || e * n[o - 1];
  52125. for (var a, s = 0, l = o - 1; s <= l; )
  52126. if ((a = n[r = Math.floor(s + (l - s) / 2)] - i) < 0)
  52127. s = r + 1;
  52128. else {
  52129. if (!(0 < a)) {
  52130. l = r;
  52131. break
  52132. }
  52133. l = r - 1
  52134. }
  52135. if (n[r = l] === i)
  52136. return r / (o - 1);
  52137. var c = n[r];
  52138. return (r + (i - c) / (n[r + 1] - c)) / (o - 1)
  52139. },
  52140. getTangent: function(e) {
  52141. var t = e - 1e-4
  52142. , i = e + 1e-4;
  52143. t < 0 && (t = 0),
  52144. 1 < i && (i = 1);
  52145. var n = this.getPoint(t);
  52146. return this.getPoint(i).clone().sub(n).normalize()
  52147. },
  52148. getTangentAt: function(e) {
  52149. var t = this.getUtoTmapping(e);
  52150. return this.getTangent(t)
  52151. }
  52152. },
  52153. Ci.Curve.create = function(e, t) {
  52154. return e.prototype = Object.create(Ci.Curve.prototype),
  52155. (e.prototype.constructor = e).prototype.getPoint = t,
  52156. e
  52157. }
  52158. ,
  52159. Ci.CurvePath = function() {
  52160. this.curves = [],
  52161. this.autoClose = !1
  52162. }
  52163. ,
  52164. Ci.CurvePath.prototype = Object.create(Ci.Curve.prototype),
  52165. Ci.CurvePath.prototype.constructor = Ci.CurvePath,
  52166. Ci.CurvePath.prototype.add = function(e) {
  52167. this.curves.push(e)
  52168. }
  52169. ,
  52170. Ci.CurvePath.prototype.closePath = function() {
  52171. var e = this.curves[0].getPoint(0)
  52172. , t = this.curves[this.curves.length - 1].getPoint(1);
  52173. e.equals(t) || this.curves.push(new Ci.LineCurve(t,e))
  52174. }
  52175. ,
  52176. Ci.CurvePath.prototype.getPoint = function(e) {
  52177. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  52178. if (i[n] >= t) {
  52179. var r = i[n] - t
  52180. , o = this.curves[n]
  52181. , a = 1 - r / o.getLength();
  52182. return o.getPointAt(a)
  52183. }
  52184. n++
  52185. }
  52186. return null
  52187. }
  52188. ,
  52189. Ci.CurvePath.prototype.getLength = function() {
  52190. var e = this.getCurveLengths();
  52191. return e[e.length - 1]
  52192. }
  52193. ,
  52194. Ci.CurvePath.prototype.getCurveLengths = function() {
  52195. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  52196. return this.cacheLengths;
  52197. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  52198. t += this.curves[i].getLength(),
  52199. e.push(t);
  52200. return this.cacheLengths = e
  52201. }
  52202. ,
  52203. Ci.CurvePath.prototype.createPointsGeometry = function(e) {
  52204. var t = this.getPoints(e);
  52205. return this.createGeometry(t)
  52206. }
  52207. ,
  52208. Ci.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  52209. var t = this.getSpacedPoints(e);
  52210. return this.createGeometry(t)
  52211. }
  52212. ,
  52213. Ci.CurvePath.prototype.createGeometry = function(e) {
  52214. for (var t = new Ci.Geometry, i = 0, n = e.length; i < n; i++) {
  52215. var r = e[i];
  52216. t.vertices.push(new Ci.Vector3(r.x,r.y,r.z || 0))
  52217. }
  52218. return t
  52219. }
  52220. ,
  52221. Ci.Font = function(e) {
  52222. this.data = e
  52223. }
  52224. ,
  52225. Ci.Font.prototype = {
  52226. constructor: Ci.Font,
  52227. generateShapes: function(e, s, b) {
  52228. function l(e, t, i) {
  52229. var n = w.glyphs[e] || w.glyphs["?"];
  52230. if (n) {
  52231. 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;
  52232. if (n.o)
  52233. for (var A = n._cachedOutline || (n._cachedOutline = n.o.split(" ")), C = 0, I = A.length; C < I; ) {
  52234. switch (A[C++]) {
  52235. case "m":
  52236. r = A[C++] * t + i,
  52237. o = A[C++] * t,
  52238. g.moveTo(r, o);
  52239. break;
  52240. case "l":
  52241. r = A[C++] * t + i,
  52242. o = A[C++] * t,
  52243. g.lineTo(r, o);
  52244. break;
  52245. case "q":
  52246. if (a = A[C++] * t + i,
  52247. s = A[C++] * t,
  52248. h = A[C++] * t + i,
  52249. u = A[C++] * t,
  52250. g.quadraticCurveTo(h, u, a, s),
  52251. f = m[m.length - 1]) {
  52252. l = f.x,
  52253. c = f.y;
  52254. for (var E = 1; E <= b; E++) {
  52255. v(_ = E / b, l, h, a),
  52256. v(_, c, u, s)
  52257. }
  52258. }
  52259. break;
  52260. case "b":
  52261. if (a = A[C++] * t + i,
  52262. s = A[C++] * t,
  52263. h = A[C++] * t + i,
  52264. u = A[C++] * t,
  52265. d = A[C++] * t + i,
  52266. p = A[C++] * t,
  52267. g.bezierCurveTo(h, u, d, p, a, s),
  52268. f = m[m.length - 1]) {
  52269. l = f.x,
  52270. c = f.y;
  52271. for (E = 1; E <= b; E++) {
  52272. var _;
  52273. y(_ = E / b, l, h, d, a),
  52274. y(_, c, u, p, s)
  52275. }
  52276. }
  52277. }
  52278. }
  52279. return {
  52280. offset: n.ha * t,
  52281. path: g
  52282. }
  52283. }
  52284. }
  52285. void 0 === s && (s = 100),
  52286. void 0 === b && (b = 4);
  52287. for (var w = this.data, t = function(e) {
  52288. for (var t = String(e).split(""), i = s / w.resolution, n = 0, r = [], o = 0; o < t.length; o++) {
  52289. var a = l(t[o], i, n);
  52290. n += a.offset,
  52291. r.push(a.path)
  52292. }
  52293. return r
  52294. }(e), i = [], n = 0, r = t.length; n < r; n++)
  52295. Array.prototype.push.apply(i, t[n].toShapes());
  52296. return i
  52297. }
  52298. },
  52299. Ci.Path = function(e) {
  52300. Ci.CurvePath.call(this),
  52301. this.actions = [],
  52302. e && this.fromPoints(e)
  52303. }
  52304. ,
  52305. Ci.Path.prototype = Object.create(Ci.CurvePath.prototype),
  52306. Ci.Path.prototype.constructor = Ci.Path,
  52307. Ci.Path.prototype.fromPoints = function(e) {
  52308. this.moveTo(e[0].x, e[0].y);
  52309. for (var t = 1, i = e.length; t < i; t++)
  52310. this.lineTo(e[t].x, e[t].y)
  52311. }
  52312. ,
  52313. Ci.Path.prototype.moveTo = function(e, t) {
  52314. this.actions.push({
  52315. action: "moveTo",
  52316. args: [e, t]
  52317. })
  52318. }
  52319. ,
  52320. Ci.Path.prototype.lineTo = function(e, t) {
  52321. var i = this.actions[this.actions.length - 1].args
  52322. , n = i[i.length - 2]
  52323. , r = i[i.length - 1]
  52324. , o = new Ci.LineCurve(new Ci.Vector2(n,r),new Ci.Vector2(e,t));
  52325. this.curves.push(o),
  52326. this.actions.push({
  52327. action: "lineTo",
  52328. args: [e, t]
  52329. })
  52330. }
  52331. ,
  52332. Ci.Path.prototype.quadraticCurveTo = function(e, t, i, n) {
  52333. var r = this.actions[this.actions.length - 1].args
  52334. , o = r[r.length - 2]
  52335. , a = r[r.length - 1]
  52336. , s = new Ci.QuadraticBezierCurve(new Ci.Vector2(o,a),new Ci.Vector2(e,t),new Ci.Vector2(i,n));
  52337. this.curves.push(s),
  52338. this.actions.push({
  52339. action: "quadraticCurveTo",
  52340. args: [e, t, i, n]
  52341. })
  52342. }
  52343. ,
  52344. Ci.Path.prototype.bezierCurveTo = function(e, t, i, n, r, o) {
  52345. var a = this.actions[this.actions.length - 1].args
  52346. , s = a[a.length - 2]
  52347. , l = a[a.length - 1]
  52348. , c = new Ci.CubicBezierCurve(new Ci.Vector2(s,l),new Ci.Vector2(e,t),new Ci.Vector2(i,n),new Ci.Vector2(r,o));
  52349. this.curves.push(c),
  52350. this.actions.push({
  52351. action: "bezierCurveTo",
  52352. args: [e, t, i, n, r, o]
  52353. })
  52354. }
  52355. ,
  52356. Ci.Path.prototype.splineThru = function(e) {
  52357. var t = Array.prototype.slice.call(arguments)
  52358. , i = this.actions[this.actions.length - 1].args
  52359. , n = i[i.length - 2]
  52360. , r = i[i.length - 1]
  52361. , o = [new Ci.Vector2(n,r)];
  52362. Array.prototype.push.apply(o, e);
  52363. var a = new Ci.SplineCurve(o);
  52364. this.curves.push(a),
  52365. this.actions.push({
  52366. action: "splineThru",
  52367. args: t
  52368. })
  52369. }
  52370. ,
  52371. Ci.Path.prototype.arc = function(e, t, i, n, r, o) {
  52372. var a = this.actions[this.actions.length - 1].args
  52373. , s = a[a.length - 2]
  52374. , l = a[a.length - 1];
  52375. this.absarc(e + s, t + l, i, n, r, o)
  52376. }
  52377. ,
  52378. Ci.Path.prototype.absarc = function(e, t, i, n, r, o) {
  52379. this.absellipse(e, t, i, i, n, r, o)
  52380. }
  52381. ,
  52382. Ci.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  52383. var l = this.actions[this.actions.length - 1].args
  52384. , c = l[l.length - 2]
  52385. , h = l[l.length - 1];
  52386. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  52387. }
  52388. ,
  52389. Ci.Path.prototype.absellipse = function(e, t, i, n, r, o, a, s) {
  52390. var l = [e, t, i, n, r, o, a, s || 0]
  52391. , c = new Ci.EllipseCurve(e,t,i,n,r,o,a,s);
  52392. this.curves.push(c);
  52393. var h = c.getPoint(1);
  52394. l.push(h.x),
  52395. l.push(h.y),
  52396. this.actions.push({
  52397. action: "ellipse",
  52398. args: l
  52399. })
  52400. }
  52401. ,
  52402. Ci.Path.prototype.getSpacedPoints = function(e) {
  52403. e = e || 40;
  52404. for (var t = [], i = 0; i < e; i++)
  52405. t.push(this.getPoint(i / e));
  52406. return this.autoClose && t.push(t[0]),
  52407. t
  52408. }
  52409. ,
  52410. Ci.Path.prototype.getPoints = function(e) {
  52411. e = e || 12;
  52412. 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++) {
  52413. var v = this.actions[g]
  52414. , y = v.action
  52415. , A = v.args;
  52416. switch (y) {
  52417. case "moveTo":
  52418. case "lineTo":
  52419. f.push(new Ci.Vector2(A[0],A[1]));
  52420. break;
  52421. case "quadraticCurveTo":
  52422. t = A[2],
  52423. i = A[3],
  52424. o = A[0],
  52425. a = A[1],
  52426. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52427. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52428. c[c.length - 1]);
  52429. for (var C = 1; C <= e; C++) {
  52430. h = d(O = C / e, s, o, t),
  52431. u = d(O, l, a, i),
  52432. f.push(new Ci.Vector2(h,u))
  52433. }
  52434. break;
  52435. case "bezierCurveTo":
  52436. t = A[4],
  52437. i = A[5],
  52438. o = A[0],
  52439. a = A[1],
  52440. n = A[2],
  52441. r = A[3],
  52442. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52443. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52444. c[c.length - 1]);
  52445. for (C = 1; C <= e; C++) {
  52446. h = p(O = C / e, s, o, n, t),
  52447. u = p(O, l, a, r, i),
  52448. f.push(new Ci.Vector2(h,u))
  52449. }
  52450. break;
  52451. case "splineThru":
  52452. c = this.actions[g - 1].args;
  52453. var I = [new Ci.Vector2(c[c.length - 2],c[c.length - 1])]
  52454. , E = e * A[0].length;
  52455. I = I.concat(A[0]);
  52456. var _ = new Ci.SplineCurve(I);
  52457. for (C = 1; C <= E; C++)
  52458. f.push(_.getPointAt(C / E));
  52459. break;
  52460. case "arc":
  52461. var b = A[0]
  52462. , w = A[1]
  52463. , T = A[2]
  52464. , x = A[3]
  52465. , S = A[4]
  52466. , M = !!A[5]
  52467. , R = S - x
  52468. , P = 2 * e;
  52469. for (C = 1; C <= P; C++) {
  52470. var O = C / P;
  52471. M || (O = 1 - O),
  52472. L = x + O * R,
  52473. h = b + T * Math.cos(L),
  52474. u = w + T * Math.sin(L),
  52475. f.push(new Ci.Vector2(h,u))
  52476. }
  52477. break;
  52478. case "ellipse":
  52479. b = A[0],
  52480. w = A[1];
  52481. var L, D, N, F = A[2], B = A[3], V = (x = A[4],
  52482. S = A[5],
  52483. M = !!A[6],
  52484. A[7]);
  52485. R = S - x,
  52486. P = 2 * e;
  52487. 0 !== V && (D = Math.cos(V),
  52488. N = Math.sin(V));
  52489. for (C = 1; C <= P; C++) {
  52490. O = C / P;
  52491. if (M || (O = 1 - O),
  52492. L = x + O * R,
  52493. h = b + F * Math.cos(L),
  52494. u = w + B * Math.sin(L),
  52495. 0 !== V) {
  52496. var k = h;
  52497. h = (k - b) * D - (u - w) * N + b,
  52498. u = (k - b) * N + (u - w) * D + w
  52499. }
  52500. f.push(new Ci.Vector2(h,u))
  52501. }
  52502. }
  52503. }
  52504. var U = f[f.length - 1];
  52505. 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),
  52506. this.autoClose && f.push(f[0]),
  52507. f
  52508. }
  52509. ,
  52510. Ci.Path.prototype.toShapes = function(e, t) {
  52511. function i(e) {
  52512. for (var t = [], i = 0, n = e.length; i < n; i++) {
  52513. var r = e[i]
  52514. , o = new Ci.Shape;
  52515. o.actions = r.actions,
  52516. o.curves = r.curves,
  52517. t.push(o)
  52518. }
  52519. return t
  52520. }
  52521. function n(e, t) {
  52522. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  52523. var a = t[r]
  52524. , s = t[o]
  52525. , l = s.x - a.x
  52526. , c = s.y - a.y;
  52527. if (Math.abs(c) > Number.EPSILON) {
  52528. if (c < 0 && (a = t[o],
  52529. l = -l,
  52530. s = t[r],
  52531. c = -c),
  52532. e.y < a.y || e.y > s.y)
  52533. continue;
  52534. if (e.y === a.y) {
  52535. if (e.x === a.x)
  52536. return !0
  52537. } else {
  52538. var h = c * (e.x - a.x) - l * (e.y - a.y);
  52539. if (0 == h)
  52540. return !0;
  52541. if (h < 0)
  52542. continue;
  52543. n = !n
  52544. }
  52545. } else {
  52546. if (e.y !== a.y)
  52547. continue;
  52548. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  52549. return !0
  52550. }
  52551. }
  52552. return n
  52553. }
  52554. var r = Ci.ShapeUtils.isClockWise
  52555. , o = function(e) {
  52556. for (var t = [], i = new Ci.Path, n = 0, r = e.length; n < r; n++) {
  52557. var o = e[n]
  52558. , a = o.args
  52559. , s = o.action;
  52560. "moveTo" === s && 0 !== i.actions.length && (t.push(i),
  52561. i = new Ci.Path),
  52562. i[s].apply(i, a)
  52563. }
  52564. return 0 !== i.actions.length && t.push(i),
  52565. t
  52566. }(this.actions);
  52567. if (0 === o.length)
  52568. return [];
  52569. if (!0 === t)
  52570. return i(o);
  52571. var a, s, l, c = [];
  52572. if (1 === o.length)
  52573. return s = o[0],
  52574. (l = new Ci.Shape).actions = s.actions,
  52575. l.curves = s.curves,
  52576. c.push(l),
  52577. c;
  52578. var h = !r(o[0].getPoints());
  52579. h = e ? !h : h;
  52580. var u, d = [], p = [], f = [], g = 0;
  52581. p[g] = void 0,
  52582. f[g] = [];
  52583. for (var m = 0, v = o.length; m < v; m++)
  52584. a = r(u = (s = o[m]).getPoints()),
  52585. (a = e ? !a : a) ? (!h && p[g] && g++,
  52586. p[g] = {
  52587. s: new Ci.Shape,
  52588. p: u
  52589. },
  52590. p[g].s.actions = s.actions,
  52591. p[g].s.curves = s.curves,
  52592. h && g++,
  52593. f[g] = []) : f[g].push({
  52594. h: s,
  52595. p: u[0]
  52596. });
  52597. if (!p[0])
  52598. return i(o);
  52599. if (1 < p.length) {
  52600. for (var y = !1, A = [], C = 0, I = p.length; C < I; C++)
  52601. d[C] = [];
  52602. for (C = 0,
  52603. I = p.length; C < I; C++)
  52604. for (var E = f[C], _ = 0; _ < E.length; _++) {
  52605. for (var b = E[_], w = !0, T = 0; T < p.length; T++)
  52606. n(b.p, p[T].p) && (C !== T && A.push({
  52607. froms: C,
  52608. tos: T,
  52609. hole: _
  52610. }),
  52611. w ? (w = !1,
  52612. d[T].push(b)) : y = !0);
  52613. w && d[C].push(b)
  52614. }
  52615. 0 < A.length && (y || (f = d))
  52616. }
  52617. m = 0;
  52618. for (var x, S = p.length; m < S; m++) {
  52619. l = p[m].s,
  52620. c.push(l);
  52621. for (var M = 0, R = (x = f[m]).length; M < R; M++)
  52622. l.holes.push(x[M].h)
  52623. }
  52624. return c
  52625. }
  52626. ,
  52627. Ci.Shape = function() {
  52628. Ci.Path.apply(this, arguments),
  52629. this.holes = []
  52630. }
  52631. ,
  52632. Ci.Shape.prototype = Object.create(Ci.Path.prototype),
  52633. Ci.Shape.prototype.constructor = Ci.Shape,
  52634. Ci.Shape.prototype.extrude = function(e) {
  52635. return new Ci.ExtrudeGeometry(this,e)
  52636. }
  52637. ,
  52638. Ci.Shape.prototype.makeGeometry = function(e) {
  52639. return new Ci.ShapeGeometry(this,e)
  52640. }
  52641. ,
  52642. Ci.Shape.prototype.getPointsHoles = function(e) {
  52643. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  52644. t[i] = this.holes[i].getPoints(e);
  52645. return t
  52646. }
  52647. ,
  52648. Ci.Shape.prototype.extractAllPoints = function(e) {
  52649. return {
  52650. shape: this.getPoints(e),
  52651. holes: this.getPointsHoles(e)
  52652. }
  52653. }
  52654. ,
  52655. Ci.Shape.prototype.extractPoints = function(e) {
  52656. return this.extractAllPoints(e)
  52657. }
  52658. ,
  52659. Ci.LineCurve = function(e, t) {
  52660. this.v1 = e,
  52661. this.v2 = t
  52662. }
  52663. ,
  52664. Ci.LineCurve.prototype = Object.create(Ci.Curve.prototype),
  52665. Ci.LineCurve.prototype.constructor = Ci.LineCurve,
  52666. Ci.LineCurve.prototype.getPoint = function(e) {
  52667. var t = this.v2.clone().sub(this.v1);
  52668. return t.multiplyScalar(e).add(this.v1),
  52669. t
  52670. }
  52671. ,
  52672. Ci.LineCurve.prototype.getPointAt = function(e) {
  52673. return this.getPoint(e)
  52674. }
  52675. ,
  52676. Ci.LineCurve.prototype.getTangent = function(e) {
  52677. return this.v2.clone().sub(this.v1).normalize()
  52678. }
  52679. ,
  52680. Ci.QuadraticBezierCurve = function(e, t, i) {
  52681. this.v0 = e,
  52682. this.v1 = t,
  52683. this.v2 = i
  52684. }
  52685. ,
  52686. Ci.QuadraticBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52687. Ci.QuadraticBezierCurve.prototype.constructor = Ci.QuadraticBezierCurve,
  52688. Ci.QuadraticBezierCurve.prototype.getPoint = function(e) {
  52689. var t = Ci.ShapeUtils.b2;
  52690. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y))
  52691. }
  52692. ,
  52693. Ci.QuadraticBezierCurve.prototype.getTangent = function(e) {
  52694. var t = Ci.CurveUtils.tangentQuadraticBezier;
  52695. 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()
  52696. }
  52697. ,
  52698. Ci.CubicBezierCurve = function(e, t, i, n) {
  52699. this.v0 = e,
  52700. this.v1 = t,
  52701. this.v2 = i,
  52702. this.v3 = n
  52703. }
  52704. ,
  52705. Ci.CubicBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52706. Ci.CubicBezierCurve.prototype.constructor = Ci.CubicBezierCurve,
  52707. Ci.CubicBezierCurve.prototype.getPoint = function(e) {
  52708. var t = Ci.ShapeUtils.b3;
  52709. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y))
  52710. }
  52711. ,
  52712. Ci.CubicBezierCurve.prototype.getTangent = function(e) {
  52713. var t = Ci.CurveUtils.tangentCubicBezier;
  52714. 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()
  52715. }
  52716. ,
  52717. Ci.SplineCurve = function(e) {
  52718. this.points = null == e ? [] : e
  52719. }
  52720. ,
  52721. Ci.SplineCurve.prototype = Object.create(Ci.Curve.prototype),
  52722. Ci.SplineCurve.prototype.constructor = Ci.SplineCurve,
  52723. Ci.SplineCurve.prototype.getPoint = function(e) {
  52724. var t = this.points
  52725. , i = (t.length - 1) * e
  52726. , n = Math.floor(i)
  52727. , r = i - n
  52728. , o = t[0 === n ? n : n - 1]
  52729. , a = t[n]
  52730. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52731. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52732. , c = Ci.CurveUtils.interpolate;
  52733. return new Ci.Vector2(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r))
  52734. }
  52735. ,
  52736. Ci.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  52737. this.aX = e,
  52738. this.aY = t,
  52739. this.xRadius = i,
  52740. this.yRadius = n,
  52741. this.aStartAngle = r,
  52742. this.aEndAngle = o,
  52743. this.aClockwise = a,
  52744. this.aRotation = s || 0
  52745. }
  52746. ,
  52747. Ci.EllipseCurve.prototype = Object.create(Ci.Curve.prototype),
  52748. Ci.EllipseCurve.prototype.constructor = Ci.EllipseCurve,
  52749. Ci.EllipseCurve.prototype.getPoint = function(e) {
  52750. var t, i = this.aEndAngle - this.aStartAngle;
  52751. i < 0 && (i += 2 * Math.PI),
  52752. i > 2 * Math.PI && (i -= 2 * Math.PI),
  52753. t = !0 === this.aClockwise ? this.aEndAngle + (1 - e) * (2 * Math.PI - i) : this.aStartAngle + e * i;
  52754. var n = this.aX + this.xRadius * Math.cos(t)
  52755. , r = this.aY + this.yRadius * Math.sin(t);
  52756. if (0 !== this.aRotation) {
  52757. var o = Math.cos(this.aRotation)
  52758. , a = Math.sin(this.aRotation)
  52759. , s = n
  52760. , l = r;
  52761. n = (s - this.aX) * o - (l - this.aY) * a + this.aX,
  52762. r = (s - this.aX) * a + (l - this.aY) * o + this.aY
  52763. }
  52764. return new Ci.Vector2(n,r)
  52765. }
  52766. ,
  52767. Ci.ArcCurve = function(e, t, i, n, r, o) {
  52768. Ci.EllipseCurve.call(this, e, t, i, i, n, r, o)
  52769. }
  52770. ,
  52771. Ci.ArcCurve.prototype = Object.create(Ci.EllipseCurve.prototype),
  52772. Ci.ArcCurve.prototype.constructor = Ci.ArcCurve,
  52773. Ci.LineCurve3 = Ci.Curve.create(function(e, t) {
  52774. this.v1 = e,
  52775. this.v2 = t
  52776. }, function(e) {
  52777. var t = new Ci.Vector3;
  52778. return t.subVectors(this.v2, this.v1),
  52779. t.multiplyScalar(e),
  52780. t.add(this.v1),
  52781. t
  52782. }),
  52783. Ci.QuadraticBezierCurve3 = Ci.Curve.create(function(e, t, i) {
  52784. this.v0 = e,
  52785. this.v1 = t,
  52786. this.v2 = i
  52787. }, function(e) {
  52788. var t = Ci.ShapeUtils.b2;
  52789. 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))
  52790. }),
  52791. Ci.CubicBezierCurve3 = Ci.Curve.create(function(e, t, i, n) {
  52792. this.v0 = e,
  52793. this.v1 = t,
  52794. this.v2 = i,
  52795. this.v3 = n
  52796. }, function(e) {
  52797. var t = Ci.ShapeUtils.b3;
  52798. 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))
  52799. }),
  52800. Ci.SplineCurve3 = Ci.Curve.create(function(e) {
  52801. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  52802. this.points = null == e ? [] : e
  52803. }, function(e) {
  52804. var t = this.points
  52805. , i = (t.length - 1) * e
  52806. , n = Math.floor(i)
  52807. , r = i - n
  52808. , o = t[0 == n ? n : n - 1]
  52809. , a = t[n]
  52810. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52811. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52812. , c = Ci.CurveUtils.interpolate;
  52813. 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))
  52814. }),
  52815. Ci.CatmullRomCurve3 = (qt = new Ci.Vector3,
  52816. Xt = new xi,
  52817. Zt = new xi,
  52818. Kt = new xi,
  52819. xi.prototype.init = function(e, t, i, n) {
  52820. this.c0 = e,
  52821. this.c1 = i,
  52822. this.c2 = -3 * e + 3 * t - 2 * i - n,
  52823. this.c3 = 2 * e - 2 * t + i + n
  52824. }
  52825. ,
  52826. xi.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  52827. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  52828. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  52829. s *= o,
  52830. l *= o,
  52831. this.init(t, i, s, l)
  52832. }
  52833. ,
  52834. xi.prototype.initCatmullRom = function(e, t, i, n, r) {
  52835. this.init(t, i, r * (i - e), r * (n - t))
  52836. }
  52837. ,
  52838. xi.prototype.calc = function(e) {
  52839. var t = e * e
  52840. , i = t * e;
  52841. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  52842. }
  52843. ,
  52844. Ci.Curve.create(function(e) {
  52845. this.points = e || [],
  52846. this.closed = !1
  52847. }, function(e) {
  52848. var t, i, n, r, o, a, s, l, c = this.points;
  52849. if ((r = c.length) < 2 && console.log("duh, you need at least 2 points"),
  52850. n = (t = (r - (this.closed ? 0 : 1)) * e) - (i = Math.floor(t)),
  52851. this.closed ? i += 0 < i ? 0 : (Math.floor(Math.abs(i) / c.length) + 1) * c.length : 0 === n && i === r - 1 && (i = r - 2,
  52852. n = 1),
  52853. o = this.closed || 0 < i ? c[(i - 1) % r] : (qt.subVectors(c[0], c[1]).add(c[0]),
  52854. qt),
  52855. a = c[i % r],
  52856. s = c[(i + 1) % r],
  52857. l = this.closed || i + 2 < r ? c[(i + 2) % r] : (qt.subVectors(c[r - 1], c[r - 2]).add(c[r - 1]),
  52858. qt),
  52859. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  52860. var h = "chordal" === this.type ? .5 : .25
  52861. , u = Math.pow(o.distanceToSquared(a), h)
  52862. , d = Math.pow(a.distanceToSquared(s), h)
  52863. , p = Math.pow(s.distanceToSquared(l), h);
  52864. d < 1e-4 && (d = 1),
  52865. u < 1e-4 && (u = d),
  52866. p < 1e-4 && (p = d),
  52867. Xt.initNonuniformCatmullRom(o.x, a.x, s.x, l.x, u, d, p),
  52868. Zt.initNonuniformCatmullRom(o.y, a.y, s.y, l.y, u, d, p),
  52869. Kt.initNonuniformCatmullRom(o.z, a.z, s.z, l.z, u, d, p)
  52870. } else if ("catmullrom" === this.type) {
  52871. var f = void 0 !== this.tension ? this.tension : .5;
  52872. Xt.initCatmullRom(o.x, a.x, s.x, l.x, f),
  52873. Zt.initCatmullRom(o.y, a.y, s.y, l.y, f),
  52874. Kt.initCatmullRom(o.z, a.z, s.z, l.z, f)
  52875. }
  52876. return new Ci.Vector3(Xt.calc(n),Zt.calc(n),Kt.calc(n))
  52877. })),
  52878. Ci.ClosedSplineCurve3 = function(e) {
  52879. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  52880. Ci.CatmullRomCurve3.call(this, e),
  52881. this.type = "catmullrom",
  52882. this.closed = !0
  52883. }
  52884. ,
  52885. Ci.ClosedSplineCurve3.prototype = Object.create(Ci.CatmullRomCurve3.prototype),
  52886. Ci.BoxGeometry = function(e, t, i, n, r, o) {
  52887. Ci.Geometry.call(this),
  52888. this.type = "BoxGeometry",
  52889. this.parameters = {
  52890. width: e,
  52891. height: t,
  52892. depth: i,
  52893. widthSegments: n,
  52894. heightSegments: r,
  52895. depthSegments: o
  52896. },
  52897. this.fromBufferGeometry(new Ci.BoxBufferGeometry(e,t,i,n,r,o)),
  52898. this.mergeVertices()
  52899. }
  52900. ,
  52901. Ci.BoxGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52902. Ci.BoxGeometry.prototype.constructor = Ci.BoxGeometry,
  52903. Ci.CubeGeometry = Ci.BoxGeometry,
  52904. Ci.BoxBufferGeometry = function(e, t, i, n, r, o) {
  52905. function a(e, t, i, n, r, o, a, s, l, c, h) {
  52906. 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++)
  52907. for (var E = I * d - f, _ = 0; _ < m; _++) {
  52908. var b = _ * u - p;
  52909. C[e] = b * n,
  52910. C[t] = E * r,
  52911. C[i] = g,
  52912. P[D] = C.x,
  52913. P[D + 1] = C.y,
  52914. P[D + 2] = C.z,
  52915. C[e] = 0,
  52916. C[t] = 0,
  52917. C[i] = 0 < s ? 1 : -1,
  52918. O[D] = C.x,
  52919. O[D + 1] = C.y,
  52920. O[D + 2] = C.z,
  52921. L[N] = _ / l,
  52922. L[N + 1] = 1 - I / c,
  52923. D += 3,
  52924. N += 2,
  52925. y += 1
  52926. }
  52927. for (I = 0; I < c; I++)
  52928. for (_ = 0; _ < l; _++) {
  52929. var w = B + _ + m * I
  52930. , T = B + _ + m * (I + 1)
  52931. , x = B + (_ + 1) + m * (I + 1)
  52932. , S = B + (_ + 1) + m * I;
  52933. R[F] = w,
  52934. R[F + 1] = T,
  52935. R[F + 2] = S,
  52936. R[F + 3] = T,
  52937. R[F + 4] = x,
  52938. R[F + 5] = S,
  52939. F += 6,
  52940. A += 6
  52941. }
  52942. M.addGroup(V, A, h),
  52943. V += A,
  52944. B += y
  52945. }
  52946. Ci.BufferGeometry.call(this),
  52947. this.type = "BoxBufferGeometry",
  52948. this.parameters = {
  52949. width: e,
  52950. height: t,
  52951. depth: i,
  52952. widthSegments: n,
  52953. heightSegments: r,
  52954. depthSegments: o
  52955. };
  52956. var M = this;
  52957. n = Math.floor(n) || 1,
  52958. r = Math.floor(r) || 1,
  52959. o = Math.floor(o) || 1;
  52960. var s, l, c, h, u = (h = 0,
  52961. h += (s = n) * (l = r) * 2,
  52962. h += s * (c = o) * 2,
  52963. 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;
  52964. a("z", "y", "x", -1, -1, i, t, e, o, r, 0),
  52965. a("z", "y", "x", 1, -1, i, t, -e, o, r, 1),
  52966. a("x", "z", "y", 1, 1, e, i, t, n, o, 2),
  52967. a("x", "z", "y", 1, -1, e, i, -t, n, o, 3),
  52968. a("x", "y", "z", 1, -1, e, t, i, n, r, 4),
  52969. a("x", "y", "z", -1, -1, e, t, -i, n, r, 5),
  52970. this.setIndex(new Ci.BufferAttribute(R,1)),
  52971. this.addAttribute("position", new Ci.BufferAttribute(P,3)),
  52972. this.addAttribute("normal", new Ci.BufferAttribute(O,3)),
  52973. this.addAttribute("uv", new Ci.BufferAttribute(L,2))
  52974. }
  52975. ,
  52976. Ci.BoxBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52977. Ci.BoxBufferGeometry.prototype.constructor = Ci.BoxBufferGeometry,
  52978. Ci.CircleGeometry = function(e, t, i, n) {
  52979. Ci.Geometry.call(this),
  52980. this.type = "CircleGeometry",
  52981. this.parameters = {
  52982. radius: e,
  52983. segments: t,
  52984. thetaStart: i,
  52985. thetaLength: n
  52986. },
  52987. this.fromBufferGeometry(new Ci.CircleBufferGeometry(e,t,i,n))
  52988. }
  52989. ,
  52990. Ci.CircleGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52991. Ci.CircleGeometry.prototype.constructor = Ci.CircleGeometry,
  52992. Ci.CircleBufferGeometry = function(e, t, i, n) {
  52993. Ci.BufferGeometry.call(this),
  52994. this.type = "CircleBufferGeometry",
  52995. this.parameters = {
  52996. radius: e,
  52997. segments: t,
  52998. thetaStart: i,
  52999. thetaLength: n
  53000. },
  53001. e = e || 50,
  53002. t = void 0 !== t ? Math.max(3, t) : 8,
  53003. i = void 0 !== i ? i : 0,
  53004. n = void 0 !== n ? n : 2 * Math.PI;
  53005. var r = t + 2
  53006. , o = new Float32Array(3 * r)
  53007. , a = new Float32Array(3 * r)
  53008. , s = new Float32Array(2 * r);
  53009. a[2] = 1,
  53010. s[0] = .5,
  53011. s[1] = .5;
  53012. for (var l = 0, c = 3, h = 2; l <= t; l++,
  53013. c += 3,
  53014. h += 2) {
  53015. var u = i + l / t * n;
  53016. o[c] = e * Math.cos(u),
  53017. o[c + 1] = e * Math.sin(u),
  53018. a[c + 2] = 1,
  53019. s[h] = (o[c] / e + 1) / 2,
  53020. s[h + 1] = (o[c + 1] / e + 1) / 2
  53021. }
  53022. var d = [];
  53023. for (c = 1; c <= t; c++)
  53024. d.push(c, c + 1, 0);
  53025. this.setIndex(new Ci.BufferAttribute(new Uint16Array(d),1)),
  53026. this.addAttribute("position", new Ci.BufferAttribute(o,3)),
  53027. this.addAttribute("normal", new Ci.BufferAttribute(a,3)),
  53028. this.addAttribute("uv", new Ci.BufferAttribute(s,2)),
  53029. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53030. }
  53031. ,
  53032. Ci.CircleBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53033. Ci.CircleBufferGeometry.prototype.constructor = Ci.CircleBufferGeometry,
  53034. Ci.CylinderBufferGeometry = function(p, f, g, m, v, e, y, A) {
  53035. function t(e) {
  53036. var t, i, n, r = new Ci.Vector2, o = new Ci.Vector3, a = !0 === e ? p : f, s = !0 === e ? 1 : -1;
  53037. for (i = b,
  53038. t = 1; t <= m; t++)
  53039. I.setXYZ(b, 0, x * s, 0),
  53040. E.setXYZ(b, 0, s, 0),
  53041. !0 === e ? (r.x = t / m,
  53042. r.y = 0) : (r.x = (t - 1) / m,
  53043. r.y = 1),
  53044. _.setXY(b, r.x, r.y),
  53045. b++;
  53046. for (n = b,
  53047. t = 0; t <= m; t++) {
  53048. var l = t / m;
  53049. o.x = a * Math.sin(l * A + y),
  53050. o.y = x * s,
  53051. o.z = a * Math.cos(l * A + y),
  53052. I.setXYZ(b, o.x, o.y, o.z),
  53053. E.setXYZ(b, 0, s, 0),
  53054. _.setXY(b, l, !0 === e ? 1 : 0),
  53055. b++
  53056. }
  53057. for (t = 0; t < m; t++) {
  53058. var c = i + t
  53059. , h = n + t;
  53060. !0 === e ? (C.setX(w, h),
  53061. w++,
  53062. C.setX(w, h + 1)) : (C.setX(w, h + 1),
  53063. w++,
  53064. C.setX(w, h)),
  53065. w++,
  53066. C.setX(w, c),
  53067. w++
  53068. }
  53069. }
  53070. Ci.BufferGeometry.call(this),
  53071. this.type = "CylinderBufferGeometry",
  53072. this.parameters = {
  53073. radiusTop: p,
  53074. radiusBottom: f,
  53075. height: g,
  53076. radialSegments: m,
  53077. heightSegments: v,
  53078. openEnded: e,
  53079. thetaStart: y,
  53080. thetaLength: A
  53081. },
  53082. p = void 0 !== p ? p : 20,
  53083. f = void 0 !== f ? f : 20,
  53084. g = void 0 !== g ? g : 100,
  53085. m = Math.floor(m) || 8,
  53086. v = Math.floor(v) || 1,
  53087. e = void 0 !== e && e,
  53088. y = void 0 !== y ? y : 0,
  53089. A = void 0 !== A ? A : 2 * Math.PI;
  53090. var i, n, r = (n = (m + 1) * (v + 1),
  53091. !1 === e && (n += 2 * (m + 1) + 2 * m),
  53092. n), o = (i = m * v * 2 * 3,
  53093. !1 === e && (i += 2 * m * 3),
  53094. 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;
  53095. (function() {
  53096. var e, t, i = new Ci.Vector3, n = new Ci.Vector3, r = (f - p) / g;
  53097. for (t = 0; t <= v; t++) {
  53098. var o = []
  53099. , a = t / v
  53100. , s = a * (f - p) + p;
  53101. for (e = 0; e <= m; e++) {
  53102. var l = e / m;
  53103. n.x = s * Math.sin(l * A + y),
  53104. n.y = -a * g + x,
  53105. n.z = s * Math.cos(l * A + y),
  53106. I.setXYZ(b, n.x, n.y, n.z),
  53107. i.copy(n),
  53108. (0 === p && 0 === t || 0 === f && t === v) && (i.x = Math.sin(l * A + y),
  53109. i.z = Math.cos(l * A + y)),
  53110. i.setY(Math.sqrt(i.x * i.x + i.z * i.z) * r).normalize(),
  53111. E.setXYZ(b, i.x, i.y, i.z),
  53112. _.setXY(b, l, 1 - a),
  53113. o.push(b),
  53114. b++
  53115. }
  53116. T.push(o)
  53117. }
  53118. for (e = 0; e < m; e++)
  53119. for (t = 0; t < v; t++) {
  53120. var c = T[t][e]
  53121. , h = T[t + 1][e]
  53122. , u = T[t + 1][e + 1]
  53123. , d = T[t][e + 1];
  53124. C.setX(w, c),
  53125. w++,
  53126. C.setX(w, h),
  53127. w++,
  53128. C.setX(w, d),
  53129. w++,
  53130. C.setX(w, h),
  53131. w++,
  53132. C.setX(w, u),
  53133. w++,
  53134. C.setX(w, d),
  53135. w++
  53136. }
  53137. }
  53138. )(),
  53139. !1 === e && (0 < p && t(!0),
  53140. 0 < f && t(!1)),
  53141. this.setIndex(C),
  53142. this.addAttribute("position", I),
  53143. this.addAttribute("normal", E),
  53144. this.addAttribute("uv", _)
  53145. }
  53146. ,
  53147. Ci.CylinderBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53148. Ci.CylinderBufferGeometry.prototype.constructor = Ci.CylinderBufferGeometry,
  53149. Ci.CylinderGeometry = function(e, t, i, n, r, o, a, s) {
  53150. Ci.Geometry.call(this),
  53151. this.type = "CylinderGeometry",
  53152. this.parameters = {
  53153. radiusTop: e,
  53154. radiusBottom: t,
  53155. height: i,
  53156. radialSegments: n,
  53157. heightSegments: r,
  53158. openEnded: o,
  53159. thetaStart: a,
  53160. thetaLength: s
  53161. },
  53162. this.fromBufferGeometry(new Ci.CylinderBufferGeometry(e,t,i,n,r,o,a,s)),
  53163. this.mergeVertices()
  53164. }
  53165. ,
  53166. Ci.CylinderGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53167. Ci.CylinderGeometry.prototype.constructor = Ci.CylinderGeometry,
  53168. Ci.EdgesGeometry = function(e, t) {
  53169. function i(e, t) {
  53170. return e - t
  53171. }
  53172. Ci.BufferGeometry.call(this),
  53173. t = void 0 !== t ? t : 1;
  53174. var n, r = Math.cos(Ci.Math.degToRad(t)), o = [0, 0], a = {}, s = ["a", "b", "c"];
  53175. e instanceof Ci.BufferGeometry ? (n = new Ci.Geometry).fromBufferGeometry(e) : n = e.clone(),
  53176. n.mergeVertices(),
  53177. n.computeFaceNormals();
  53178. for (var l = n.vertices, c = n.faces, h = 0, u = c.length; h < u; h++)
  53179. for (var d = c[h], p = 0; p < 3; p++) {
  53180. o[0] = d[s[p]],
  53181. o[1] = d[s[(p + 1) % 3]],
  53182. o.sort(i),
  53183. void 0 === a[g = o.toString()] ? a[g] = {
  53184. vert1: o[0],
  53185. vert2: o[1],
  53186. face1: h,
  53187. face2: void 0
  53188. } : a[g].face2 = h
  53189. }
  53190. var f = [];
  53191. for (var g in a) {
  53192. var m = a[g];
  53193. if (void 0 === m.face2 || c[m.face1].normal.dot(c[m.face2].normal) <= r) {
  53194. var v = l[m.vert1];
  53195. f.push(v.x),
  53196. f.push(v.y),
  53197. f.push(v.z),
  53198. v = l[m.vert2],
  53199. f.push(v.x),
  53200. f.push(v.y),
  53201. f.push(v.z)
  53202. }
  53203. }
  53204. this.addAttribute("position", new Ci.BufferAttribute(new Float32Array(f),3))
  53205. }
  53206. ,
  53207. Ci.EdgesGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53208. Ci.EdgesGeometry.prototype.constructor = Ci.EdgesGeometry,
  53209. Ci.ExtrudeGeometry = function(e, t) {
  53210. return void 0 === e ? void (e = []) : (Ci.Geometry.call(this),
  53211. this.type = "ExtrudeGeometry",
  53212. e = Array.isArray(e) ? e : [e],
  53213. this.addShapeList(e, t),
  53214. void this.computeFaceNormals())
  53215. }
  53216. ;
  53217. Ci.ExtrudeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53218. Ci.ExtrudeGeometry.prototype.constructor = Ci.ExtrudeGeometry,
  53219. Ci.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  53220. for (var i = e.length, n = 0; n < i; n++) {
  53221. var r = e[n];
  53222. this.addShape(r, t)
  53223. }
  53224. }
  53225. ,
  53226. Ci.ExtrudeGeometry.prototype.addShape = function(e, t) {
  53227. function i(e, t, i) {
  53228. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  53229. t.clone().multiplyScalar(i).add(e)
  53230. }
  53231. function n(e, t, i) {
  53232. 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;
  53233. if (Math.abs(u) > Number.EPSILON) {
  53234. var d = Math.sqrt(h)
  53235. , p = Math.sqrt(l * l + c * c)
  53236. , f = t.x - s / d
  53237. , g = t.y + a / d
  53238. , m = ((i.x - c / p - f) * c - (i.y + l / p - g) * l) / (a * c - s * l)
  53239. , v = (n = f + a * m - e.x) * n + (r = g + s * m - e.y) * r;
  53240. if (v <= 2)
  53241. return new Ci.Vector2(n,r);
  53242. o = Math.sqrt(v / 2)
  53243. } else {
  53244. var y = !1;
  53245. a > Number.EPSILON ? l > Number.EPSILON && (y = !0) : a < -Number.EPSILON ? l < -Number.EPSILON && (y = !0) : Math.sign(s) === Math.sign(c) && (y = !0),
  53246. o = y ? (n = -s,
  53247. r = a,
  53248. Math.sqrt(h)) : (n = a,
  53249. r = s,
  53250. Math.sqrt(h / 2))
  53251. }
  53252. return new Ci.Vector2(n / o,r / o)
  53253. }
  53254. function r(e, t) {
  53255. var i, n;
  53256. for (G = e.length; 0 <= --G; ) {
  53257. (n = (i = G) - 1) < 0 && (n = e.length - 1);
  53258. var r = 0
  53259. , o = A + 2 * m;
  53260. for (r = 0; r < o; r++) {
  53261. var a = U * r
  53262. , s = U * (r + 1);
  53263. l(t + i + a, t + n + a, t + n + s, t + i + s, e, r, o, i, n)
  53264. }
  53265. }
  53266. }
  53267. function o(e, t, i) {
  53268. T.vertices.push(new Ci.Vector3(e,t,i))
  53269. }
  53270. function a(e, t, i) {
  53271. e += x,
  53272. t += x,
  53273. i += x,
  53274. T.faces.push(new Ci.Face3(e,t,i,null,null,0));
  53275. var n = E.generateTopUV(T, e, t, i);
  53276. T.faceVertexUvs[0].push(n)
  53277. }
  53278. function l(e, t, i, n) {
  53279. e += x,
  53280. t += x,
  53281. i += x,
  53282. n += x,
  53283. T.faces.push(new Ci.Face3(e,t,n,null,null,1)),
  53284. T.faces.push(new Ci.Face3(t,i,n,null,null,1));
  53285. var r = E.generateSideWallUV(T, e, t, i, n);
  53286. T.faceVertexUvs[0].push([r[0], r[1], r[3]]),
  53287. T.faceVertexUvs[0].push([r[1], r[2], r[3]])
  53288. }
  53289. 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;
  53290. C && (s = C.getSpacedPoints(A),
  53291. v = !(I = !0),
  53292. c = void 0 !== t.frames ? t.frames : new Ci.TubeGeometry.FrenetFrames(C,A,!1),
  53293. h = new Ci.Vector3,
  53294. u = new Ci.Vector3,
  53295. d = new Ci.Vector3),
  53296. v || (g = f = m = 0);
  53297. var _, b, w, T = this, x = this.vertices.length, S = e.extractPoints(y), M = S.shape, R = S.holes, P = !Ci.ShapeUtils.isClockWise(M);
  53298. if (P) {
  53299. for (M = M.reverse(),
  53300. b = 0,
  53301. w = R.length; b < w; b++)
  53302. _ = R[b],
  53303. Ci.ShapeUtils.isClockWise(_) && (R[b] = _.reverse());
  53304. P = !1
  53305. }
  53306. var O = Ci.ShapeUtils.triangulateShape(M, R)
  53307. , L = M;
  53308. for (b = 0,
  53309. w = R.length; b < w; b++)
  53310. _ = R[b],
  53311. M = M.concat(_);
  53312. 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++,
  53313. j++,
  53314. Y++)
  53315. j === W && (j = 0),
  53316. Y === W && (Y = 0),
  53317. z[G] = n(L[G], L[j], L[Y]);
  53318. var q, X, Z = [], K = z.concat();
  53319. for (b = 0,
  53320. w = R.length; b < w; b++) {
  53321. for (_ = R[b],
  53322. q = [],
  53323. G = 0,
  53324. j = (W = _.length) - 1,
  53325. Y = G + 1; G < W; G++,
  53326. j++,
  53327. Y++)
  53328. j === W && (j = 0),
  53329. Y === W && (Y = 0),
  53330. q[G] = n(_[G], _[j], _[Y]);
  53331. Z.push(q),
  53332. K = K.concat(q)
  53333. }
  53334. for (D = 0; D < m; D++) {
  53335. for (B = f * (1 - (F = D / m)),
  53336. N = g * Math.sin(F * Math.PI / 2),
  53337. G = 0,
  53338. W = L.length; G < W; G++)
  53339. o((V = i(L[G], z[G], N)).x, V.y, -B);
  53340. for (b = 0,
  53341. w = R.length; b < w; b++)
  53342. for (_ = R[b],
  53343. q = Z[b],
  53344. G = 0,
  53345. W = _.length; G < W; G++)
  53346. o((V = i(_[G], q[G], N)).x, V.y, -B)
  53347. }
  53348. for (N = g,
  53349. G = 0; G < U; G++)
  53350. V = v ? i(M[G], K[G], N) : M[G],
  53351. I ? (u.copy(c.normals[0]).multiplyScalar(V.x),
  53352. h.copy(c.binormals[0]).multiplyScalar(V.y),
  53353. d.copy(s[0]).add(u).add(h),
  53354. o(d.x, d.y, d.z)) : o(V.x, V.y, 0);
  53355. for (X = 1; X <= A; X++)
  53356. for (G = 0; G < U; G++)
  53357. V = v ? i(M[G], K[G], N) : M[G],
  53358. I ? (u.copy(c.normals[X]).multiplyScalar(V.x),
  53359. h.copy(c.binormals[X]).multiplyScalar(V.y),
  53360. d.copy(s[X]).add(u).add(h),
  53361. o(d.x, d.y, d.z)) : o(V.x, V.y, p / A * X);
  53362. for (D = m - 1; 0 <= D; D--) {
  53363. for (B = f * (1 - (F = D / m)),
  53364. N = g * Math.sin(F * Math.PI / 2),
  53365. G = 0,
  53366. W = L.length; G < W; G++)
  53367. o((V = i(L[G], z[G], N)).x, V.y, p + B);
  53368. for (b = 0,
  53369. w = R.length; b < w; b++)
  53370. for (_ = R[b],
  53371. q = Z[b],
  53372. G = 0,
  53373. W = _.length; G < W; G++)
  53374. V = i(_[G], q[G], N),
  53375. I ? o(V.x, V.y + s[A - 1].y, s[A - 1].x + B) : o(V.x, V.y, p + B)
  53376. }
  53377. (function() {
  53378. if (v) {
  53379. var e = 0
  53380. , t = U * e;
  53381. for (G = 0; G < H; G++)
  53382. a((k = O[G])[2] + t, k[1] + t, k[0] + t);
  53383. for (t = U * (e = A + 2 * m),
  53384. G = 0; G < H; G++)
  53385. a((k = O[G])[0] + t, k[1] + t, k[2] + t)
  53386. } else {
  53387. for (G = 0; G < H; G++)
  53388. a((k = O[G])[2], k[1], k[0]);
  53389. for (G = 0; G < H; G++)
  53390. a((k = O[G])[0] + U * A, k[1] + U * A, k[2] + U * A)
  53391. }
  53392. }
  53393. )(),
  53394. function() {
  53395. var e = 0;
  53396. for (r(L, e),
  53397. e += L.length,
  53398. b = 0,
  53399. w = R.length; b < w; b++)
  53400. r(_ = R[b], e),
  53401. e += _.length
  53402. }()
  53403. }
  53404. ,
  53405. Ci.ExtrudeGeometry.WorldUVGenerator = {
  53406. generateTopUV: function(e, t, i, n) {
  53407. var r = e.vertices
  53408. , o = r[t]
  53409. , a = r[i]
  53410. , s = r[n];
  53411. return [new Ci.Vector2(o.x,o.y), new Ci.Vector2(a.x,a.y), new Ci.Vector2(s.x,s.y)]
  53412. },
  53413. generateSideWallUV: function(e, t, i, n, r) {
  53414. var o = e.vertices
  53415. , a = o[t]
  53416. , s = o[i]
  53417. , l = o[n]
  53418. , c = o[r];
  53419. 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)]
  53420. }
  53421. },
  53422. Ci.ShapeGeometry = function(e, t) {
  53423. Ci.Geometry.call(this),
  53424. !(this.type = "ShapeGeometry") === Array.isArray(e) && (e = [e]),
  53425. this.addShapeList(e, t),
  53426. this.computeFaceNormals()
  53427. }
  53428. ,
  53429. Ci.ShapeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53430. Ci.ShapeGeometry.prototype.constructor = Ci.ShapeGeometry,
  53431. Ci.ShapeGeometry.prototype.addShapeList = function(e, t) {
  53432. for (var i = 0, n = e.length; i < n; i++)
  53433. this.addShape(e[i], t);
  53434. return this
  53435. }
  53436. ,
  53437. Ci.ShapeGeometry.prototype.addShape = function(e, t) {
  53438. void 0 === t && (t = {});
  53439. 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);
  53440. if (d) {
  53441. for (h = h.reverse(),
  53442. i = 0,
  53443. n = u.length; i < n; i++)
  53444. r = u[i],
  53445. Ci.ShapeUtils.isClockWise(r) && (u[i] = r.reverse());
  53446. d = !1
  53447. }
  53448. var p = Ci.ShapeUtils.triangulateShape(h, u);
  53449. for (i = 0,
  53450. n = u.length; i < n; i++)
  53451. r = u[i],
  53452. h = h.concat(r);
  53453. var f, g, m = h.length, v = p.length;
  53454. for (i = 0; i < m; i++)
  53455. f = h[i],
  53456. this.vertices.push(new Ci.Vector3(f.x,f.y,0));
  53457. for (i = 0; i < v; i++) {
  53458. var y = (g = p[i])[0] + l
  53459. , A = g[1] + l
  53460. , C = g[2] + l;
  53461. this.faces.push(new Ci.Face3(y,A,C,null,null,a)),
  53462. this.faceVertexUvs[0].push(s.generateTopUV(this, y, A, C))
  53463. }
  53464. }
  53465. ,
  53466. Ci.LatheBufferGeometry = function(e, t, i, n) {
  53467. Ci.BufferGeometry.call(this),
  53468. this.type = "LatheBufferGeometry",
  53469. this.parameters = {
  53470. points: e,
  53471. segments: t,
  53472. phiStart: i,
  53473. phiLength: n
  53474. },
  53475. t = Math.floor(t) || 12,
  53476. i = i || 0,
  53477. n = n || 2 * Math.PI,
  53478. n = Ci.Math.clamp(n, 0, 2 * Math.PI);
  53479. 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,
  53480. 1 / t), g = new Ci.Vector3, m = new Ci.Vector2;
  53481. for (o = 0; o <= t; o++) {
  53482. var v = i + o * f * n
  53483. , y = Math.sin(v)
  53484. , A = Math.cos(v);
  53485. for (a = 0; a <= e.length - 1; a++)
  53486. g.x = e[a].x * y,
  53487. g.y = e[a].y,
  53488. g.z = e[a].x * A,
  53489. h.setXYZ(d, g.x, g.y, g.z),
  53490. m.x = o / t,
  53491. m.y = a / (e.length - 1),
  53492. u.setXY(d, m.x, m.y),
  53493. d++
  53494. }
  53495. for (o = 0; o < t; o++)
  53496. for (a = 0; a < e.length - 1; a++) {
  53497. var C = r = a + o * e.length
  53498. , I = r + e.length
  53499. , E = r + e.length + 1
  53500. , _ = r + 1;
  53501. c.setX(p, C),
  53502. p++,
  53503. c.setX(p, I),
  53504. p++,
  53505. c.setX(p, _),
  53506. p++,
  53507. c.setX(p, I),
  53508. p++,
  53509. c.setX(p, E),
  53510. p++,
  53511. c.setX(p, _),
  53512. p++
  53513. }
  53514. if (this.setIndex(c),
  53515. this.addAttribute("position", h),
  53516. this.addAttribute("uv", u),
  53517. this.computeVertexNormals(),
  53518. n === 2 * Math.PI) {
  53519. var b = this.attributes.normal.array
  53520. , w = new Ci.Vector3
  53521. , T = new Ci.Vector3
  53522. , x = new Ci.Vector3;
  53523. for (r = t * e.length * 3,
  53524. a = o = 0; o < e.length; o++,
  53525. a += 3)
  53526. w.x = b[a + 0],
  53527. w.y = b[a + 1],
  53528. w.z = b[a + 2],
  53529. T.x = b[r + a + 0],
  53530. T.y = b[r + a + 1],
  53531. T.z = b[r + a + 2],
  53532. x.addVectors(w, T).normalize(),
  53533. b[a + 0] = b[r + a + 0] = x.x,
  53534. b[a + 1] = b[r + a + 1] = x.y,
  53535. b[a + 2] = b[r + a + 2] = x.z
  53536. }
  53537. }
  53538. ,
  53539. Ci.LatheBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53540. Ci.LatheBufferGeometry.prototype.constructor = Ci.LatheBufferGeometry,
  53541. Ci.LatheGeometry = function(e, t, i, n) {
  53542. Ci.Geometry.call(this),
  53543. this.type = "LatheGeometry",
  53544. this.parameters = {
  53545. points: e,
  53546. segments: t,
  53547. phiStart: i,
  53548. phiLength: n
  53549. },
  53550. this.fromBufferGeometry(new Ci.LatheBufferGeometry(e,t,i,n)),
  53551. this.mergeVertices()
  53552. }
  53553. ,
  53554. Ci.LatheGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53555. Ci.LatheGeometry.prototype.constructor = Ci.LatheGeometry,
  53556. Ci.PlaneGeometry = function(e, t, i, n) {
  53557. Ci.Geometry.call(this),
  53558. this.type = "PlaneGeometry",
  53559. this.parameters = {
  53560. width: e,
  53561. height: t,
  53562. widthSegments: i,
  53563. heightSegments: n
  53564. },
  53565. this.fromBufferGeometry(new Ci.PlaneBufferGeometry(e,t,i,n))
  53566. }
  53567. ,
  53568. Ci.PlaneGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53569. Ci.PlaneGeometry.prototype.constructor = Ci.PlaneGeometry,
  53570. Ci.PlaneBufferGeometry = function(e, t, i, n) {
  53571. Ci.BufferGeometry.call(this),
  53572. this.type = "PlaneBufferGeometry",
  53573. this.parameters = {
  53574. width: e,
  53575. height: t,
  53576. widthSegments: i,
  53577. heightSegments: n
  53578. };
  53579. 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++)
  53580. for (var y = v * u - o, A = 0; A < l; A++) {
  53581. var C = A * h - r;
  53582. d[g] = C,
  53583. d[g + 1] = -y,
  53584. p[g + 2] = 1,
  53585. f[m] = A / a,
  53586. f[m + 1] = 1 - v / s,
  53587. g += 3,
  53588. m += 2
  53589. }
  53590. g = 0;
  53591. var I = new (65535 < d.length / 3 ? Uint32Array : Uint16Array)(a * s * 6);
  53592. for (v = 0; v < s; v++)
  53593. for (A = 0; A < a; A++) {
  53594. var E = A + l * v
  53595. , _ = A + l * (v + 1)
  53596. , b = A + 1 + l * (v + 1)
  53597. , w = A + 1 + l * v;
  53598. I[g] = E,
  53599. I[g + 1] = _,
  53600. I[g + 2] = w,
  53601. I[g + 3] = _,
  53602. I[g + 4] = b,
  53603. I[g + 5] = w,
  53604. g += 6
  53605. }
  53606. this.setIndex(new Ci.BufferAttribute(I,1)),
  53607. this.addAttribute("position", new Ci.BufferAttribute(d,3)),
  53608. this.addAttribute("normal", new Ci.BufferAttribute(p,3)),
  53609. this.addAttribute("uv", new Ci.BufferAttribute(f,2))
  53610. }
  53611. ,
  53612. Ci.PlaneBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53613. Ci.PlaneBufferGeometry.prototype.constructor = Ci.PlaneBufferGeometry,
  53614. Ci.RingBufferGeometry = function(e, t, i, n, r, o) {
  53615. Ci.BufferGeometry.call(this),
  53616. this.type = "RingBufferGeometry",
  53617. this.parameters = {
  53618. innerRadius: e,
  53619. outerRadius: t,
  53620. thetaSegments: i,
  53621. phiSegments: n,
  53622. thetaStart: r,
  53623. thetaLength: o
  53624. },
  53625. e = e || 20,
  53626. t = t || 50,
  53627. r = void 0 !== r ? r : 0,
  53628. o = void 0 !== o ? o : 2 * Math.PI;
  53629. 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;
  53630. for (s = 0; s <= n; s++) {
  53631. for (l = 0; l <= i; l++)
  53632. a = r + l / i * o,
  53633. A.x = v * Math.cos(a),
  53634. A.y = v * Math.sin(a),
  53635. d.setXYZ(g, A.x, A.y, A.z),
  53636. p.setXYZ(g, 0, 0, 1),
  53637. C.x = (A.x / t + 1) / 2,
  53638. C.y = (A.y / t + 1) / 2,
  53639. f.setXY(g, C.x, C.y),
  53640. g++;
  53641. v += y
  53642. }
  53643. for (s = 0; s < n; s++) {
  53644. var I = s * (i + 1);
  53645. for (l = 0; l < i; l++) {
  53646. var E = a = l + I
  53647. , _ = a + i + 1
  53648. , b = a + i + 2
  53649. , w = a + 1;
  53650. u.setX(m, E),
  53651. m++,
  53652. u.setX(m, _),
  53653. m++,
  53654. u.setX(m, b),
  53655. m++,
  53656. u.setX(m, E),
  53657. m++,
  53658. u.setX(m, b),
  53659. m++,
  53660. u.setX(m, w),
  53661. m++
  53662. }
  53663. }
  53664. this.setIndex(u),
  53665. this.addAttribute("position", d),
  53666. this.addAttribute("normal", p),
  53667. this.addAttribute("uv", f)
  53668. }
  53669. ,
  53670. Ci.RingBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53671. Ci.RingBufferGeometry.prototype.constructor = Ci.RingBufferGeometry,
  53672. Ci.RingGeometry = function(e, t, i, n, r, o) {
  53673. Ci.Geometry.call(this),
  53674. this.type = "RingGeometry",
  53675. this.parameters = {
  53676. innerRadius: e,
  53677. outerRadius: t,
  53678. thetaSegments: i,
  53679. phiSegments: n,
  53680. thetaStart: r,
  53681. thetaLength: o
  53682. },
  53683. this.fromBufferGeometry(new Ci.RingBufferGeometry(e,t,i,n,r,o))
  53684. }
  53685. ,
  53686. Ci.RingGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53687. Ci.RingGeometry.prototype.constructor = Ci.RingGeometry,
  53688. Ci.SphereGeometry = function(e, t, i, n, r, o, a) {
  53689. Ci.Geometry.call(this),
  53690. this.type = "SphereGeometry",
  53691. this.parameters = {
  53692. radius: e,
  53693. widthSegments: t,
  53694. heightSegments: i,
  53695. phiStart: n,
  53696. phiLength: r,
  53697. thetaStart: o,
  53698. thetaLength: a
  53699. },
  53700. this.fromBufferGeometry(new Ci.SphereBufferGeometry(e,t,i,n,r,o,a))
  53701. }
  53702. ,
  53703. Ci.SphereGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53704. Ci.SphereGeometry.prototype.constructor = Ci.SphereGeometry,
  53705. Ci.SphereBufferGeometry = function(e, t, i, n, r, o, a) {
  53706. Ci.BufferGeometry.call(this),
  53707. this.type = "SphereBufferGeometry",
  53708. this.parameters = {
  53709. radius: e,
  53710. widthSegments: t,
  53711. heightSegments: i,
  53712. phiStart: n,
  53713. phiLength: r,
  53714. thetaStart: o,
  53715. thetaLength: a
  53716. },
  53717. e = e || 50,
  53718. t = Math.max(3, Math.floor(t) || 8),
  53719. i = Math.max(2, Math.floor(i) || 6),
  53720. n = void 0 !== n ? n : 0,
  53721. r = void 0 !== r ? r : 2 * Math.PI;
  53722. 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++) {
  53723. for (var m = [], v = g / i, y = 0; y <= t; y++) {
  53724. var A = y / t
  53725. , C = -e * Math.cos(n + A * r) * Math.sin(o + v * a)
  53726. , I = e * Math.cos(o + v * a)
  53727. , E = e * Math.sin(n + A * r) * Math.sin(o + v * a);
  53728. f.set(C, I, E).normalize(),
  53729. c.setXYZ(d, C, I, E),
  53730. h.setXYZ(d, f.x, f.y, f.z),
  53731. u.setXY(d, A, 1 - v),
  53732. m.push(d),
  53733. d++
  53734. }
  53735. p.push(m)
  53736. }
  53737. var _ = [];
  53738. for (g = 0; g < i; g++)
  53739. for (y = 0; y < t; y++) {
  53740. var b = p[g][y + 1]
  53741. , w = p[g][y]
  53742. , T = p[g + 1][y]
  53743. , x = p[g + 1][y + 1];
  53744. (0 !== g || 0 < o) && _.push(b, w, x),
  53745. (g !== i - 1 || s < Math.PI) && _.push(w, T, x)
  53746. }
  53747. this.setIndex(new (65535 < c.count ? Ci.Uint32Attribute : Ci.Uint16Attribute)(_,1)),
  53748. this.addAttribute("position", c),
  53749. this.addAttribute("normal", h),
  53750. this.addAttribute("uv", u),
  53751. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53752. }
  53753. ,
  53754. Ci.SphereBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53755. Ci.SphereBufferGeometry.prototype.constructor = Ci.SphereBufferGeometry,
  53756. Ci.TextGeometry = function(e, t) {
  53757. var i = (t = t || {}).font;
  53758. if (i instanceof Ci.Font == 0)
  53759. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  53760. new Ci.Geometry;
  53761. var n = i.generateShapes(e, t.size, t.curveSegments);
  53762. t.amount = void 0 !== t.height ? t.height : 50,
  53763. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  53764. void 0 === t.bevelSize && (t.bevelSize = 8),
  53765. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  53766. Ci.ExtrudeGeometry.call(this, n, t),
  53767. this.type = "TextGeometry"
  53768. }
  53769. ,
  53770. Ci.TextGeometry.prototype = Object.create(Ci.ExtrudeGeometry.prototype),
  53771. Ci.TextGeometry.prototype.constructor = Ci.TextGeometry,
  53772. Ci.TorusBufferGeometry = function(e, t, i, n, r) {
  53773. Ci.BufferGeometry.call(this),
  53774. this.type = "TorusBufferGeometry",
  53775. this.parameters = {
  53776. radius: e,
  53777. tube: t,
  53778. radialSegments: i,
  53779. tubularSegments: n,
  53780. arc: r
  53781. },
  53782. e = e || 100,
  53783. t = t || 40,
  53784. i = Math.floor(i) || 8,
  53785. n = Math.floor(n) || 6,
  53786. r = r || 2 * Math.PI;
  53787. 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;
  53788. for (o = 0; o <= i; o++)
  53789. for (a = 0; a <= n; a++) {
  53790. var A = a / n * r
  53791. , C = o / i * Math.PI * 2;
  53792. v.x = (e + t * Math.cos(C)) * Math.cos(A),
  53793. v.y = (e + t * Math.cos(C)) * Math.sin(A),
  53794. v.z = t * Math.sin(C),
  53795. h[p] = v.x,
  53796. h[p + 1] = v.y,
  53797. h[p + 2] = v.z,
  53798. m.x = e * Math.cos(A),
  53799. m.y = e * Math.sin(A),
  53800. y.subVectors(v, m).normalize(),
  53801. u[p] = y.x,
  53802. u[p + 1] = y.y,
  53803. u[p + 2] = y.z,
  53804. d[f] = a / n,
  53805. d[f + 1] = o / i,
  53806. p += 3,
  53807. f += 2
  53808. }
  53809. for (o = 1; o <= i; o++)
  53810. for (a = 1; a <= n; a++) {
  53811. var I = (n + 1) * o + a - 1
  53812. , E = (n + 1) * (o - 1) + a - 1
  53813. , _ = (n + 1) * (o - 1) + a
  53814. , b = (n + 1) * o + a;
  53815. c[g] = I,
  53816. c[g + 1] = E,
  53817. c[g + 2] = b,
  53818. c[g + 3] = E,
  53819. c[g + 4] = _,
  53820. c[g + 5] = b,
  53821. g += 6
  53822. }
  53823. this.setIndex(new Ci.BufferAttribute(c,1)),
  53824. this.addAttribute("position", new Ci.BufferAttribute(h,3)),
  53825. this.addAttribute("normal", new Ci.BufferAttribute(u,3)),
  53826. this.addAttribute("uv", new Ci.BufferAttribute(d,2))
  53827. }
  53828. ,
  53829. Ci.TorusBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53830. Ci.TorusBufferGeometry.prototype.constructor = Ci.TorusBufferGeometry,
  53831. Ci.TorusGeometry = function(e, t, i, n, r) {
  53832. Ci.Geometry.call(this),
  53833. this.type = "TorusGeometry",
  53834. this.parameters = {
  53835. radius: e,
  53836. tube: t,
  53837. radialSegments: i,
  53838. tubularSegments: n,
  53839. arc: r
  53840. },
  53841. this.fromBufferGeometry(new Ci.TorusBufferGeometry(e,t,i,n,r))
  53842. }
  53843. ,
  53844. Ci.TorusGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53845. Ci.TorusGeometry.prototype.constructor = Ci.TorusGeometry,
  53846. Ci.TorusKnotBufferGeometry = function(e, t, i, n, r, o) {
  53847. function a(e, t, i, n, r) {
  53848. var o = Math.cos(e)
  53849. , a = Math.sin(e)
  53850. , s = i / t * e
  53851. , l = Math.cos(s);
  53852. r.x = n * (2 + l) * .5 * o,
  53853. r.y = n * (2 + l) * a * .5,
  53854. r.z = n * Math.sin(s) * .5
  53855. }
  53856. Ci.BufferGeometry.call(this),
  53857. this.type = "TorusKnotBufferGeometry",
  53858. this.parameters = {
  53859. radius: e,
  53860. tube: t,
  53861. tubularSegments: i,
  53862. radialSegments: n,
  53863. p: r,
  53864. q: o
  53865. },
  53866. e = e || 100,
  53867. t = t || 40,
  53868. i = Math.floor(i) || 64,
  53869. r = r || 2,
  53870. o = o || 3;
  53871. 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;
  53872. for (s = 0; s <= i; ++s) {
  53873. var w = s / i * r * Math.PI * 2;
  53874. for (a(w, r, o, e, C),
  53875. a(.01 + w, r, o, e, I),
  53876. _.subVectors(I, C),
  53877. b.addVectors(I, C),
  53878. E.crossVectors(_, b),
  53879. b.crossVectors(E, _),
  53880. E.normalize(),
  53881. b.normalize(),
  53882. l = 0; l <= n; ++l) {
  53883. var T = l / n * Math.PI * 2
  53884. , x = -t * Math.cos(T)
  53885. , S = t * Math.sin(T);
  53886. v.x = C.x + (x * b.x + S * E.x),
  53887. v.y = C.y + (x * b.y + S * E.y),
  53888. v.z = C.z + (x * b.z + S * E.z),
  53889. d.setXYZ(g, v.x, v.y, v.z),
  53890. y.subVectors(v, C).normalize(),
  53891. p.setXYZ(g, y.x, y.y, y.z),
  53892. A.x = s / i,
  53893. A.y = l / n,
  53894. f.setXY(g, A.x, A.y),
  53895. g++
  53896. }
  53897. }
  53898. for (l = 1; l <= i; l++)
  53899. for (s = 1; s <= n; s++) {
  53900. var M = (n + 1) * (l - 1) + (s - 1)
  53901. , R = (n + 1) * l + (s - 1)
  53902. , P = (n + 1) * l + s
  53903. , O = (n + 1) * (l - 1) + s;
  53904. u.setX(m, M),
  53905. m++,
  53906. u.setX(m, R),
  53907. m++,
  53908. u.setX(m, O),
  53909. m++,
  53910. u.setX(m, R),
  53911. m++,
  53912. u.setX(m, P),
  53913. m++,
  53914. u.setX(m, O),
  53915. m++
  53916. }
  53917. this.setIndex(u),
  53918. this.addAttribute("position", d),
  53919. this.addAttribute("normal", p),
  53920. this.addAttribute("uv", f)
  53921. }
  53922. ,
  53923. Ci.TorusKnotBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53924. Ci.TorusKnotBufferGeometry.prototype.constructor = Ci.TorusKnotBufferGeometry,
  53925. Ci.TorusKnotGeometry = function(e, t, i, n, r, o, a) {
  53926. Ci.Geometry.call(this),
  53927. this.type = "TorusKnotGeometry",
  53928. this.parameters = {
  53929. radius: e,
  53930. tube: t,
  53931. tubularSegments: i,
  53932. radialSegments: n,
  53933. p: r,
  53934. q: o
  53935. },
  53936. void 0 !== a && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  53937. this.fromBufferGeometry(new Ci.TorusKnotBufferGeometry(e,t,i,n,r,o)),
  53938. this.mergeVertices()
  53939. }
  53940. ,
  53941. Ci.TorusKnotGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53942. Ci.TorusKnotGeometry.prototype.constructor = Ci.TorusKnotGeometry,
  53943. Ci.TubeGeometry = function(e, t, i, n, r, o) {
  53944. Ci.Geometry.call(this),
  53945. this.type = "TubeGeometry",
  53946. this.parameters = {
  53947. path: e,
  53948. segments: t,
  53949. radius: i,
  53950. radialSegments: n,
  53951. closed: r,
  53952. taper: o
  53953. },
  53954. t = t || 64,
  53955. i = i || 1,
  53956. n = n || 8,
  53957. r = r || !1,
  53958. o = o || Ci.TubeGeometry.NoTaper;
  53959. 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;
  53960. for (this.tangents = D,
  53961. this.normals = N,
  53962. this.binormals = F,
  53963. f = 0; f < P; f++)
  53964. for (M[f] = [],
  53965. l = f / (P - 1),
  53966. p = e.getPointAt(l),
  53967. D[f],
  53968. a = N[f],
  53969. s = F[f],
  53970. h = i * o(l),
  53971. g = 0; g < n; g++)
  53972. c = g / n * 2 * Math.PI,
  53973. u = -h * Math.cos(c),
  53974. d = h * Math.sin(c),
  53975. O.copy(p),
  53976. O.x += u * a.x + d * s.x,
  53977. O.y += u * a.y + d * s.y,
  53978. O.z += u * a.z + d * s.z,
  53979. M[f][g] = (T = O.x,
  53980. x = O.y,
  53981. S = O.z,
  53982. R.vertices.push(new Ci.Vector3(T,x,S)) - 1);
  53983. for (f = 0; f < t; f++)
  53984. for (g = 0; g < n; g++)
  53985. m = r ? (f + 1) % t : f + 1,
  53986. v = (g + 1) % n,
  53987. y = M[f][g],
  53988. A = M[m][g],
  53989. C = M[m][v],
  53990. I = M[f][v],
  53991. E = new Ci.Vector2(f / t,g / n),
  53992. _ = new Ci.Vector2((f + 1) / t,g / n),
  53993. b = new Ci.Vector2((f + 1) / t,(g + 1) / n),
  53994. w = new Ci.Vector2(f / t,(g + 1) / n),
  53995. this.faces.push(new Ci.Face3(y,A,I)),
  53996. this.faceVertexUvs[0].push([E, _, w]),
  53997. this.faces.push(new Ci.Face3(A,C,I)),
  53998. this.faceVertexUvs[0].push([_.clone(), b, w.clone()]);
  53999. this.computeFaceNormals(),
  54000. this.computeVertexNormals()
  54001. }
  54002. ,
  54003. Ci.TubeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54004. Ci.TubeGeometry.prototype.constructor = Ci.TubeGeometry,
  54005. Ci.TubeGeometry.NoTaper = function(e) {
  54006. return 1
  54007. }
  54008. ,
  54009. Ci.TubeGeometry.SinusoidalTaper = function(e) {
  54010. return Math.sin(Math.PI * e)
  54011. }
  54012. ,
  54013. Ci.TubeGeometry.FrenetFrames = function(e, t, i) {
  54014. 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;
  54015. for (this.tangents = u,
  54016. this.normals = d,
  54017. this.binormals = p,
  54018. l = 0; l < m; l++)
  54019. c = l / (m - 1),
  54020. u[l] = e.getTangentAt(c),
  54021. u[l].normalize();
  54022. for (d[0] = new Ci.Vector3,
  54023. p[0] = new Ci.Vector3,
  54024. r = Number.MAX_VALUE,
  54025. o = Math.abs(u[0].x),
  54026. a = Math.abs(u[0].y),
  54027. s = Math.abs(u[0].z),
  54028. o <= r && (r = o,
  54029. h.set(1, 0, 0)),
  54030. a <= r && (r = a,
  54031. h.set(0, 1, 0)),
  54032. s <= r && h.set(0, 0, 1),
  54033. f.crossVectors(u[0], h).normalize(),
  54034. d[0].crossVectors(u[0], f),
  54035. p[0].crossVectors(u[0], d[0]),
  54036. l = 1; l < m; l++)
  54037. d[l] = d[l - 1].clone(),
  54038. p[l] = p[l - 1].clone(),
  54039. f.crossVectors(u[l - 1], u[l]),
  54040. f.length() > Number.EPSILON && (f.normalize(),
  54041. n = Math.acos(Ci.Math.clamp(u[l - 1].dot(u[l]), -1, 1)),
  54042. d[l].applyMatrix4(g.makeRotationAxis(f, n))),
  54043. p[l].crossVectors(u[l], d[l]);
  54044. if (i)
  54045. for (n = Math.acos(Ci.Math.clamp(d[0].dot(d[m - 1]), -1, 1)),
  54046. n /= m - 1,
  54047. 0 < u[0].dot(f.crossVectors(d[0], d[m - 1])) && (n = -n),
  54048. l = 1; l < m; l++)
  54049. d[l].applyMatrix4(g.makeRotationAxis(u[l], n * l)),
  54050. p[l].crossVectors(u[l], d[l])
  54051. }
  54052. ,
  54053. Ci.PolyhedronGeometry = function(e, t, i, n) {
  54054. function f(e) {
  54055. var t = e.normalize().clone();
  54056. t.index = m.vertices.push(t) - 1;
  54057. var i = a(e) / 2 / Math.PI + .5
  54058. , n = function(e) {
  54059. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  54060. }(e) / Math.PI + .5;
  54061. return t.uv = new Ci.Vector2(i,1 - n),
  54062. t
  54063. }
  54064. function g(e, t, i, n) {
  54065. var r = new Ci.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,n);
  54066. m.faces.push(r),
  54067. y.copy(e).add(t).add(i).divideScalar(3);
  54068. var o = a(y);
  54069. m.faceVertexUvs[0].push([s(e.uv, e, o), s(t.uv, t, o), s(i.uv, i, o)])
  54070. }
  54071. function r(e, t) {
  54072. 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++) {
  54073. a[l] = [];
  54074. 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++)
  54075. a[l][d] = 0 === d && l === i ? c : f(c.clone().lerp(h, d / u))
  54076. }
  54077. for (l = 0; l < i; l++)
  54078. for (d = 0; d < 2 * (i - l) - 1; d++) {
  54079. var p = Math.floor(d / 2);
  54080. 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)
  54081. }
  54082. }
  54083. function a(e) {
  54084. return Math.atan2(e.z, -e.x)
  54085. }
  54086. function s(e, t, i) {
  54087. return i < 0 && 1 === e.x && (e = new Ci.Vector2(e.x - 1,e.y)),
  54088. 0 === t.x && 0 === t.z && (e = new Ci.Vector2(i / 2 / Math.PI + .5,e.y)),
  54089. e.clone()
  54090. }
  54091. Ci.Geometry.call(this),
  54092. this.type = "PolyhedronGeometry",
  54093. this.parameters = {
  54094. vertices: e,
  54095. indices: t,
  54096. radius: i,
  54097. detail: n
  54098. },
  54099. i = i || 1,
  54100. n = n || 0;
  54101. for (var m = this, o = 0, l = e.length; o < l; o += 3)
  54102. f(new Ci.Vector3(e[o],e[o + 1],e[o + 2]));
  54103. var c = this.vertices
  54104. , h = []
  54105. , u = (o = 0,
  54106. 0);
  54107. for (l = t.length; o < l; o += 3,
  54108. u++) {
  54109. var d = c[t[o]]
  54110. , p = c[t[o + 1]]
  54111. , v = c[t[o + 2]];
  54112. h[u] = new Ci.Face3(d.index,p.index,v.index,[d.clone(), p.clone(), v.clone()],void 0,u)
  54113. }
  54114. var y = new Ci.Vector3;
  54115. for (o = 0,
  54116. l = h.length; o < l; o++)
  54117. r(h[o], n);
  54118. for (o = 0,
  54119. l = this.faceVertexUvs[0].length; o < l; o++) {
  54120. var A = this.faceVertexUvs[0][o]
  54121. , C = A[0].x
  54122. , I = A[1].x
  54123. , E = A[2].x
  54124. , _ = Math.max(C, I, E)
  54125. , b = Math.min(C, I, E);
  54126. .9 < _ && b < .1 && (C < .2 && (A[0].x += 1),
  54127. I < .2 && (A[1].x += 1),
  54128. E < .2 && (A[2].x += 1))
  54129. }
  54130. for (o = 0,
  54131. l = this.vertices.length; o < l; o++)
  54132. this.vertices[o].multiplyScalar(i);
  54133. this.mergeVertices(),
  54134. this.computeFaceNormals(),
  54135. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,i)
  54136. }
  54137. ,
  54138. Ci.PolyhedronGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54139. Ci.PolyhedronGeometry.prototype.constructor = Ci.PolyhedronGeometry,
  54140. Ci.DodecahedronGeometry = function(e, t) {
  54141. var i = (1 + Math.sqrt(5)) / 2
  54142. , n = 1 / i
  54143. , 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];
  54144. 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),
  54145. this.type = "DodecahedronGeometry",
  54146. this.parameters = {
  54147. radius: e,
  54148. detail: t
  54149. }
  54150. }
  54151. ,
  54152. Ci.DodecahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54153. Ci.DodecahedronGeometry.prototype.constructor = Ci.DodecahedronGeometry,
  54154. Ci.IcosahedronGeometry = function(e, t) {
  54155. var i = (1 + Math.sqrt(5)) / 2
  54156. , 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];
  54157. 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),
  54158. this.type = "IcosahedronGeometry",
  54159. this.parameters = {
  54160. radius: e,
  54161. detail: t
  54162. }
  54163. }
  54164. ,
  54165. Ci.IcosahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54166. Ci.IcosahedronGeometry.prototype.constructor = Ci.IcosahedronGeometry,
  54167. Ci.OctahedronGeometry = function(e, t) {
  54168. 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),
  54169. this.type = "OctahedronGeometry",
  54170. this.parameters = {
  54171. radius: e,
  54172. detail: t
  54173. }
  54174. }
  54175. ,
  54176. Ci.OctahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54177. Ci.OctahedronGeometry.prototype.constructor = Ci.OctahedronGeometry,
  54178. Ci.TetrahedronGeometry = function(e, t) {
  54179. 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),
  54180. this.type = "TetrahedronGeometry",
  54181. this.parameters = {
  54182. radius: e,
  54183. detail: t
  54184. }
  54185. }
  54186. ,
  54187. Ci.TetrahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54188. Ci.TetrahedronGeometry.prototype.constructor = Ci.TetrahedronGeometry,
  54189. Ci.ParametricGeometry = function(e, t, i) {
  54190. Ci.Geometry.call(this),
  54191. this.type = "ParametricGeometry",
  54192. this.parameters = {
  54193. func: e,
  54194. slices: t,
  54195. stacks: i
  54196. };
  54197. 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;
  54198. for (n = 0; n <= i; n++)
  54199. for (a = n / i,
  54200. r = 0; r <= t; r++)
  54201. o = e(r / t, a),
  54202. g.push(o);
  54203. for (n = 0; n < i; n++)
  54204. for (r = 0; r < t; r++)
  54205. l = (s = n * y + r) + 1,
  54206. c = (n + 1) * y + r + 1,
  54207. h = (n + 1) * y + r,
  54208. u = new Ci.Vector2(r / t,n / i),
  54209. d = new Ci.Vector2((r + 1) / t,n / i),
  54210. p = new Ci.Vector2((r + 1) / t,(n + 1) / i),
  54211. f = new Ci.Vector2(r / t,(n + 1) / i),
  54212. m.push(new Ci.Face3(s,l,h)),
  54213. v.push([u, d, f]),
  54214. m.push(new Ci.Face3(l,c,h)),
  54215. v.push([d.clone(), p, f.clone()]);
  54216. this.computeFaceNormals(),
  54217. this.computeVertexNormals()
  54218. }
  54219. ,
  54220. Ci.ParametricGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54221. Ci.ParametricGeometry.prototype.constructor = Ci.ParametricGeometry,
  54222. Ci.WireframeGeometry = function(e) {
  54223. function t(e, t) {
  54224. return e - t
  54225. }
  54226. Ci.BufferGeometry.call(this);
  54227. var i = [0, 0]
  54228. , n = {}
  54229. , r = ["a", "b", "c"];
  54230. if (e instanceof Ci.Geometry) {
  54231. for (var o = e.vertices, a = e.faces, s = 0, l = new Uint32Array(6 * a.length), c = 0, h = a.length; c < h; c++)
  54232. for (var u = a[c], d = 0; d < 3; d++) {
  54233. i[0] = u[r[d]],
  54234. i[1] = u[r[(d + 1) % 3]],
  54235. i.sort(t),
  54236. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54237. l[2 * s + 1] = i[1],
  54238. n[E] = !0,
  54239. s++)
  54240. }
  54241. var p = new Float32Array(2 * s * 3);
  54242. for (c = 0,
  54243. h = s; c < h; c++)
  54244. for (d = 0; d < 2; d++) {
  54245. var f = o[l[2 * c + d]];
  54246. p[(_ = 6 * c + 3 * d) + 0] = f.x,
  54247. p[_ + 1] = f.y,
  54248. p[_ + 2] = f.z
  54249. }
  54250. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54251. } else if (e instanceof Ci.BufferGeometry)
  54252. if (null !== e.index) {
  54253. var g = e.index.array
  54254. , m = (o = e.attributes.position,
  54255. e.groups);
  54256. s = 0;
  54257. 0 === m.length && e.addGroup(0, g.length);
  54258. l = new Uint32Array(2 * g.length);
  54259. for (var v = 0, y = m.length; v < y; ++v)
  54260. for (var A = m[v], C = A.start, I = (c = C,
  54261. C + A.count); c < I; c += 3)
  54262. for (d = 0; d < 3; d++) {
  54263. var E;
  54264. i[0] = g[c + d],
  54265. i[1] = g[c + (d + 1) % 3],
  54266. i.sort(t),
  54267. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54268. l[2 * s + 1] = i[1],
  54269. n[E] = !0,
  54270. s++)
  54271. }
  54272. for (p = new Float32Array(2 * s * 3),
  54273. c = 0,
  54274. h = s; c < h; c++)
  54275. for (d = 0; d < 2; d++) {
  54276. var _ = 6 * c + 3 * d
  54277. , b = l[2 * c + d];
  54278. p[_ + 0] = o.getX(b),
  54279. p[_ + 1] = o.getY(b),
  54280. p[_ + 2] = o.getZ(b)
  54281. }
  54282. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54283. } else {
  54284. var w = (s = (o = e.attributes.position.array).length / 3) / 3;
  54285. for (p = new Float32Array(2 * s * 3),
  54286. c = 0,
  54287. h = w; c < h; c++)
  54288. for (d = 0; d < 3; d++) {
  54289. var T = 9 * c + 3 * d;
  54290. p[(_ = 18 * c + 6 * d) + 0] = o[T],
  54291. p[_ + 1] = o[1 + T],
  54292. p[_ + 2] = o[2 + T];
  54293. b = 9 * c + (d + 1) % 3 * 3;
  54294. p[_ + 3] = o[b],
  54295. p[_ + 4] = o[b + 1],
  54296. p[_ + 5] = o[b + 2]
  54297. }
  54298. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54299. }
  54300. }
  54301. ,
  54302. Ci.WireframeGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54303. Ci.WireframeGeometry.prototype.constructor = Ci.WireframeGeometry,
  54304. Ci.AxisHelper = function(e) {
  54305. e = e || 1;
  54306. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  54307. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  54308. , n = new Ci.BufferGeometry;
  54309. n.addAttribute("position", new Ci.BufferAttribute(t,3)),
  54310. n.addAttribute("color", new Ci.BufferAttribute(i,3));
  54311. var r = new Ci.LineBasicMaterial({
  54312. vertexColors: Ci.VertexColors
  54313. });
  54314. Ci.LineSegments.call(this, n, r)
  54315. }
  54316. ,
  54317. Ci.AxisHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54318. Ci.AxisHelper.prototype.constructor = Ci.AxisHelper,
  54319. Ci.ArrowHelper = function() {
  54320. var a = new Ci.Geometry;
  54321. a.vertices.push(new Ci.Vector3(0,0,0), new Ci.Vector3(0,1,0));
  54322. var s = new Ci.CylinderGeometry(0,.5,1,5,1);
  54323. return s.translate(0, -.5, 0),
  54324. function(e, t, i, n, r, o) {
  54325. Ci.Object3D.call(this),
  54326. void 0 === n && (n = 16776960),
  54327. void 0 === i && (i = 1),
  54328. void 0 === r && (r = .2 * i),
  54329. void 0 === o && (o = .2 * r),
  54330. this.position.copy(t),
  54331. this.line = new Ci.Line(a,new Ci.LineBasicMaterial({
  54332. color: n
  54333. })),
  54334. this.line.matrixAutoUpdate = !1,
  54335. this.add(this.line),
  54336. this.cone = new Ci.Mesh(s,new Ci.MeshBasicMaterial({
  54337. color: n
  54338. })),
  54339. this.cone.matrixAutoUpdate = !1,
  54340. this.add(this.cone),
  54341. this.setDirection(e),
  54342. this.setLength(i, r, o)
  54343. }
  54344. }(),
  54345. Ci.ArrowHelper.prototype = Object.create(Ci.Object3D.prototype),
  54346. Ci.ArrowHelper.prototype.constructor = Ci.ArrowHelper,
  54347. Ci.ArrowHelper.prototype.setDirection = (Ai = new Ci.Vector3,
  54348. function(e) {
  54349. .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(),
  54350. yi = Math.acos(e.y),
  54351. this.quaternion.setFromAxisAngle(Ai, yi))
  54352. }
  54353. ),
  54354. Ci.ArrowHelper.prototype.setLength = function(e, t, i) {
  54355. void 0 === t && (t = .2 * e),
  54356. void 0 === i && (i = .2 * t),
  54357. this.line.scale.set(1, Math.max(0, e - t), 1),
  54358. this.line.updateMatrix(),
  54359. this.cone.scale.set(i, t, i),
  54360. this.cone.position.y = e,
  54361. this.cone.updateMatrix()
  54362. }
  54363. ,
  54364. Ci.ArrowHelper.prototype.setColor = function(e) {
  54365. this.line.material.color.set(e),
  54366. this.cone.material.color.set(e)
  54367. }
  54368. ,
  54369. Ci.BoxHelper = function(e) {
  54370. 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])
  54371. , i = new Float32Array(24)
  54372. , n = new Ci.BufferGeometry;
  54373. n.setIndex(new Ci.BufferAttribute(t,1)),
  54374. n.addAttribute("position", new Ci.BufferAttribute(i,3)),
  54375. Ci.LineSegments.call(this, n, new Ci.LineBasicMaterial({
  54376. color: 16776960
  54377. })),
  54378. void 0 !== e && this.update(e)
  54379. }
  54380. ,
  54381. Ci.BoxHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54382. Ci.BoxHelper.prototype.constructor = Ci.BoxHelper,
  54383. Ci.BoxHelper.prototype.update = (vi = new Ci.Box3,
  54384. function(e) {
  54385. if (vi.setFromObject(e),
  54386. !vi.isEmpty()) {
  54387. var t = vi.min
  54388. , i = vi.max
  54389. , n = this.geometry.attributes.position
  54390. , r = n.array;
  54391. r[0] = i.x,
  54392. r[1] = i.y,
  54393. r[2] = i.z,
  54394. r[3] = t.x,
  54395. r[4] = i.y,
  54396. r[5] = i.z,
  54397. r[6] = t.x,
  54398. r[7] = t.y,
  54399. r[8] = i.z,
  54400. r[9] = i.x,
  54401. r[10] = t.y,
  54402. r[11] = i.z,
  54403. r[12] = i.x,
  54404. r[13] = i.y,
  54405. r[14] = t.z,
  54406. r[15] = t.x,
  54407. r[16] = i.y,
  54408. r[17] = t.z,
  54409. r[18] = t.x,
  54410. r[19] = t.y,
  54411. r[20] = t.z,
  54412. r[21] = i.x,
  54413. r[22] = t.y,
  54414. r[23] = t.z,
  54415. n.needsUpdate = !0,
  54416. this.geometry.computeBoundingSphere()
  54417. }
  54418. }
  54419. ),
  54420. Ci.BoundingBoxHelper = function(e, t) {
  54421. var i = void 0 !== t ? t : 8947848;
  54422. this.object = e,
  54423. this.box = new Ci.Box3,
  54424. Ci.Mesh.call(this, new Ci.BoxGeometry(1,1,1), new Ci.MeshBasicMaterial({
  54425. color: i,
  54426. wireframe: !0
  54427. }))
  54428. }
  54429. ,
  54430. Ci.BoundingBoxHelper.prototype = Object.create(Ci.Mesh.prototype),
  54431. Ci.BoundingBoxHelper.prototype.constructor = Ci.BoundingBoxHelper,
  54432. Ci.BoundingBoxHelper.prototype.update = function() {
  54433. this.box.setFromObject(this.object),
  54434. this.box.size(this.scale),
  54435. this.box.center(this.position)
  54436. }
  54437. ,
  54438. Ci.CameraHelper = function(e) {
  54439. function t(e, t, i) {
  54440. n(e, i),
  54441. n(t, i)
  54442. }
  54443. function n(e, t) {
  54444. i.vertices.push(new Ci.Vector3),
  54445. i.colors.push(new Ci.Color(t)),
  54446. void 0 === o[e] && (o[e] = []),
  54447. o[e].push(i.vertices.length - 1)
  54448. }
  54449. var i = new Ci.Geometry
  54450. , r = new Ci.LineBasicMaterial({
  54451. color: 16777215,
  54452. vertexColors: Ci.FaceColors
  54453. })
  54454. , o = {}
  54455. , a = 16755200
  54456. , s = 16711680
  54457. , l = 3355443;
  54458. t("n1", "n2", a),
  54459. t("n2", "n4", a),
  54460. t("n4", "n3", a),
  54461. t("n3", "n1", a),
  54462. t("f1", "f2", a),
  54463. t("f2", "f4", a),
  54464. t("f4", "f3", a),
  54465. t("f3", "f1", a),
  54466. t("n1", "f1", a),
  54467. t("n2", "f2", a),
  54468. t("n3", "f3", a),
  54469. t("n4", "f4", a),
  54470. t("p", "n1", s),
  54471. t("p", "n2", s),
  54472. t("p", "n3", s),
  54473. t("p", "n4", s),
  54474. t("u1", "u2", 43775),
  54475. t("u2", "u3", 43775),
  54476. t("u3", "u1", 43775),
  54477. t("c", "t", 16777215),
  54478. t("p", "c", l),
  54479. t("cn1", "cn2", l),
  54480. t("cn3", "cn4", l),
  54481. t("cf1", "cf2", l),
  54482. t("cf3", "cf4", l),
  54483. Ci.LineSegments.call(this, i, r),
  54484. this.camera = e,
  54485. this.camera.updateProjectionMatrix(),
  54486. this.matrix = e.matrixWorld,
  54487. this.matrixAutoUpdate = !1,
  54488. this.pointMap = o,
  54489. this.update()
  54490. }
  54491. ,
  54492. Ci.CameraHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54493. Ci.CameraHelper.prototype.constructor = Ci.CameraHelper,
  54494. Ci.CameraHelper.prototype.update = (gi = new Ci.Vector3,
  54495. mi = new Ci.Camera,
  54496. function() {
  54497. pi = this.geometry,
  54498. fi = this.pointMap,
  54499. mi.projectionMatrix.copy(this.camera.projectionMatrix),
  54500. Ni("c", 0, 0, -1),
  54501. Ni("t", 0, 0, 1),
  54502. Ni("n1", -1, -1, -1),
  54503. Ni("n2", 1, -1, -1),
  54504. Ni("n3", -1, 1, -1),
  54505. Ni("n4", 1, 1, -1),
  54506. Ni("f1", -1, -1, 1),
  54507. Ni("f2", 1, -1, 1),
  54508. Ni("f3", -1, 1, 1),
  54509. Ni("f4", 1, 1, 1),
  54510. Ni("u1", .7, 1.1, -1),
  54511. Ni("u2", -.7, 1.1, -1),
  54512. Ni("u3", 0, 2, -1),
  54513. Ni("cf1", -1, 0, 1),
  54514. Ni("cf2", 1, 0, 1),
  54515. Ni("cf3", 0, -1, 1),
  54516. Ni("cf4", 0, 1, 1),
  54517. Ni("cn1", -1, 0, -1),
  54518. Ni("cn2", 1, 0, -1),
  54519. Ni("cn3", 0, -1, -1),
  54520. Ni("cn4", 0, 1, -1),
  54521. pi.verticesNeedUpdate = !0
  54522. }
  54523. ),
  54524. Ci.DirectionalLightHelper = function(e, t) {
  54525. Ci.Object3D.call(this),
  54526. this.light = e,
  54527. this.light.updateMatrixWorld(),
  54528. this.matrix = e.matrixWorld,
  54529. this.matrixAutoUpdate = !1,
  54530. t = t || 1;
  54531. var i = new Ci.Geometry;
  54532. 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));
  54533. var n = new Ci.LineBasicMaterial({
  54534. fog: !1
  54535. });
  54536. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54537. this.lightPlane = new Ci.Line(i,n),
  54538. this.add(this.lightPlane),
  54539. (i = new Ci.Geometry).vertices.push(new Ci.Vector3, new Ci.Vector3),
  54540. (n = new Ci.LineBasicMaterial({
  54541. fog: !1
  54542. })).color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54543. this.targetLine = new Ci.Line(i,n),
  54544. this.add(this.targetLine),
  54545. this.update()
  54546. }
  54547. ,
  54548. Ci.DirectionalLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54549. Ci.DirectionalLightHelper.prototype.constructor = Ci.DirectionalLightHelper,
  54550. Ci.DirectionalLightHelper.prototype.dispose = function() {
  54551. this.lightPlane.geometry.dispose(),
  54552. this.lightPlane.material.dispose(),
  54553. this.targetLine.geometry.dispose(),
  54554. this.targetLine.material.dispose()
  54555. }
  54556. ,
  54557. Ci.DirectionalLightHelper.prototype.update = (hi = new Ci.Vector3,
  54558. ui = new Ci.Vector3,
  54559. di = new Ci.Vector3,
  54560. function() {
  54561. hi.setFromMatrixPosition(this.light.matrixWorld),
  54562. ui.setFromMatrixPosition(this.light.target.matrixWorld),
  54563. di.subVectors(ui, hi),
  54564. this.lightPlane.lookAt(di),
  54565. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54566. this.targetLine.geometry.vertices[1].copy(di),
  54567. this.targetLine.geometry.verticesNeedUpdate = !0,
  54568. this.targetLine.material.color.copy(this.lightPlane.material.color)
  54569. }
  54570. ),
  54571. Ci.EdgesHelper = function(e, t, i) {
  54572. var n = void 0 !== t ? t : 16777215;
  54573. Ci.LineSegments.call(this, new Ci.EdgesGeometry(e.geometry,i), new Ci.LineBasicMaterial({
  54574. color: n
  54575. })),
  54576. this.matrix = e.matrixWorld,
  54577. this.matrixAutoUpdate = !1
  54578. }
  54579. ,
  54580. Ci.EdgesHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54581. Ci.EdgesHelper.prototype.constructor = Ci.EdgesHelper,
  54582. Ci.FaceNormalsHelper = function(e, t, i, n) {
  54583. this.object = e,
  54584. this.size = void 0 !== t ? t : 1;
  54585. var r = void 0 !== i ? i : 16776960
  54586. , o = void 0 !== n ? n : 1
  54587. , a = 0
  54588. , s = this.object.geometry;
  54589. s instanceof Ci.Geometry ? a = s.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  54590. var l = new Ci.BufferGeometry
  54591. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54592. l.addAttribute("position", c),
  54593. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54594. color: r,
  54595. linewidth: o
  54596. })),
  54597. this.matrixAutoUpdate = !1,
  54598. this.update()
  54599. }
  54600. ,
  54601. Ci.FaceNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54602. Ci.FaceNormalsHelper.prototype.constructor = Ci.FaceNormalsHelper,
  54603. Ci.FaceNormalsHelper.prototype.update = (si = new Ci.Vector3,
  54604. li = new Ci.Vector3,
  54605. ci = new Ci.Matrix3,
  54606. function() {
  54607. this.object.updateMatrixWorld(!0),
  54608. ci.getNormalMatrix(this.object.matrixWorld);
  54609. 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++) {
  54610. var l = r[a]
  54611. , c = l.normal;
  54612. si.copy(n[l.a]).add(n[l.b]).add(n[l.c]).divideScalar(3).applyMatrix4(e),
  54613. li.copy(c).applyMatrix3(ci).normalize().multiplyScalar(this.size).add(si),
  54614. t.setXYZ(o, si.x, si.y, si.z),
  54615. o += 1,
  54616. t.setXYZ(o, li.x, li.y, li.z),
  54617. o += 1
  54618. }
  54619. return t.needsUpdate = !0,
  54620. this
  54621. }
  54622. ),
  54623. Ci.GridHelper = function(e, t) {
  54624. var i = new Ci.Geometry
  54625. , n = new Ci.LineBasicMaterial({
  54626. vertexColors: Ci.VertexColors
  54627. });
  54628. this.color1 = new Ci.Color(4473924),
  54629. this.color2 = new Ci.Color(8947848);
  54630. for (var r = -e; r <= e; r += t) {
  54631. 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));
  54632. var o = 0 === r ? this.color1 : this.color2;
  54633. i.colors.push(o, o, o, o)
  54634. }
  54635. Ci.LineSegments.call(this, i, n)
  54636. }
  54637. ,
  54638. Ci.GridHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54639. Ci.GridHelper.prototype.constructor = Ci.GridHelper,
  54640. Ci.GridHelper.prototype.setColors = function(e, t) {
  54641. this.color1.set(e),
  54642. this.color2.set(t),
  54643. this.geometry.colorsNeedUpdate = !0
  54644. }
  54645. ,
  54646. Ci.HemisphereLightHelper = function(e, t) {
  54647. Ci.Object3D.call(this),
  54648. this.light = e,
  54649. this.light.updateMatrixWorld(),
  54650. this.matrix = e.matrixWorld,
  54651. this.matrixAutoUpdate = !1,
  54652. this.colors = [new Ci.Color, new Ci.Color];
  54653. var i = new Ci.SphereGeometry(t,4,2);
  54654. i.rotateX(-Math.PI / 2);
  54655. for (var n = 0; n < 8; n++)
  54656. i.faces[n].color = this.colors[n < 4 ? 0 : 1];
  54657. var r = new Ci.MeshBasicMaterial({
  54658. vertexColors: Ci.FaceColors,
  54659. wireframe: !0
  54660. });
  54661. this.lightSphere = new Ci.Mesh(i,r),
  54662. this.add(this.lightSphere),
  54663. this.update()
  54664. }
  54665. ,
  54666. Ci.HemisphereLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54667. Ci.HemisphereLightHelper.prototype.constructor = Ci.HemisphereLightHelper,
  54668. Ci.HemisphereLightHelper.prototype.dispose = function() {
  54669. this.lightSphere.geometry.dispose(),
  54670. this.lightSphere.material.dispose()
  54671. }
  54672. ,
  54673. Ci.HemisphereLightHelper.prototype.update = (ai = new Ci.Vector3,
  54674. function() {
  54675. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  54676. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  54677. this.lightSphere.lookAt(ai.setFromMatrixPosition(this.light.matrixWorld).negate()),
  54678. this.lightSphere.geometry.colorsNeedUpdate = !0
  54679. }
  54680. ),
  54681. Ci.PointLightHelper = function(e, t) {
  54682. this.light = e,
  54683. this.light.updateMatrixWorld();
  54684. var i = new Ci.SphereGeometry(t,4,2)
  54685. , n = new Ci.MeshBasicMaterial({
  54686. wireframe: !0,
  54687. fog: !1
  54688. });
  54689. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54690. Ci.Mesh.call(this, i, n),
  54691. this.matrix = this.light.matrixWorld,
  54692. this.matrixAutoUpdate = !1
  54693. }
  54694. ,
  54695. Ci.PointLightHelper.prototype = Object.create(Ci.Mesh.prototype),
  54696. Ci.PointLightHelper.prototype.constructor = Ci.PointLightHelper,
  54697. Ci.PointLightHelper.prototype.dispose = function() {
  54698. this.geometry.dispose(),
  54699. this.material.dispose()
  54700. }
  54701. ,
  54702. Ci.PointLightHelper.prototype.update = function() {
  54703. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54704. }
  54705. ,
  54706. Ci.SkeletonHelper = function(e) {
  54707. this.bones = this.getBoneList(e);
  54708. for (var t = new Ci.Geometry, i = 0; i < this.bones.length; i++) {
  54709. this.bones[i].parent instanceof Ci.Bone && (t.vertices.push(new Ci.Vector3),
  54710. t.vertices.push(new Ci.Vector3),
  54711. t.colors.push(new Ci.Color(0,0,1)),
  54712. t.colors.push(new Ci.Color(0,1,0)))
  54713. }
  54714. t.dynamic = !0;
  54715. var n = new Ci.LineBasicMaterial({
  54716. vertexColors: Ci.VertexColors,
  54717. depthTest: !1,
  54718. depthWrite: !1,
  54719. transparent: !0
  54720. });
  54721. Ci.LineSegments.call(this, t, n),
  54722. this.root = e,
  54723. this.matrix = e.matrixWorld,
  54724. this.matrixAutoUpdate = !1,
  54725. this.update()
  54726. }
  54727. ,
  54728. Ci.SkeletonHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54729. Ci.SkeletonHelper.prototype.constructor = Ci.SkeletonHelper,
  54730. Ci.SkeletonHelper.prototype.getBoneList = function(e) {
  54731. var t = [];
  54732. e instanceof Ci.Bone && t.push(e);
  54733. for (var i = 0; i < e.children.length; i++)
  54734. t.push.apply(t, this.getBoneList(e.children[i]));
  54735. return t
  54736. }
  54737. ,
  54738. Ci.SkeletonHelper.prototype.update = function() {
  54739. 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++) {
  54740. var o = this.bones[r];
  54741. o.parent instanceof Ci.Bone && (i.multiplyMatrices(t, o.matrixWorld),
  54742. e.vertices[n].setFromMatrixPosition(i),
  54743. i.multiplyMatrices(t, o.parent.matrixWorld),
  54744. e.vertices[n + 1].setFromMatrixPosition(i),
  54745. n += 2)
  54746. }
  54747. e.verticesNeedUpdate = !0,
  54748. e.computeBoundingSphere()
  54749. }
  54750. ,
  54751. Ci.SpotLightHelper = function(e) {
  54752. Ci.Object3D.call(this),
  54753. this.light = e,
  54754. this.light.updateMatrixWorld(),
  54755. this.matrix = e.matrixWorld,
  54756. this.matrixAutoUpdate = !1;
  54757. var t = new Ci.CylinderGeometry(0,1,1,8,1,!0);
  54758. t.translate(0, -.5, 0),
  54759. t.rotateX(-Math.PI / 2);
  54760. var i = new Ci.MeshBasicMaterial({
  54761. wireframe: !0,
  54762. fog: !1
  54763. });
  54764. this.cone = new Ci.Mesh(t,i),
  54765. this.add(this.cone),
  54766. this.update()
  54767. }
  54768. ,
  54769. Ci.SpotLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54770. Ci.SpotLightHelper.prototype.constructor = Ci.SpotLightHelper,
  54771. Ci.SpotLightHelper.prototype.dispose = function() {
  54772. this.cone.geometry.dispose(),
  54773. this.cone.material.dispose()
  54774. }
  54775. ,
  54776. Ci.SpotLightHelper.prototype.update = (ri = new Ci.Vector3,
  54777. oi = new Ci.Vector3,
  54778. function() {
  54779. var e = this.light.distance ? this.light.distance : 1e4
  54780. , t = e * Math.tan(this.light.angle);
  54781. this.cone.scale.set(t, t, e),
  54782. ri.setFromMatrixPosition(this.light.matrixWorld),
  54783. oi.setFromMatrixPosition(this.light.target.matrixWorld),
  54784. this.cone.lookAt(oi.sub(ri)),
  54785. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54786. }
  54787. ),
  54788. Ci.VertexNormalsHelper = function(e, t, i, n) {
  54789. this.object = e,
  54790. this.size = void 0 !== t ? t : 1;
  54791. var r = void 0 !== i ? i : 16711680
  54792. , o = void 0 !== n ? n : 1
  54793. , a = 0
  54794. , s = this.object.geometry;
  54795. s instanceof Ci.Geometry ? a = 3 * s.faces.length : s instanceof Ci.BufferGeometry && (a = s.attributes.normal.count);
  54796. var l = new Ci.BufferGeometry
  54797. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54798. l.addAttribute("position", c),
  54799. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54800. color: r,
  54801. linewidth: o
  54802. })),
  54803. this.matrixAutoUpdate = !1,
  54804. this.update()
  54805. }
  54806. ,
  54807. Ci.VertexNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54808. Ci.VertexNormalsHelper.prototype.constructor = Ci.VertexNormalsHelper,
  54809. Ci.VertexNormalsHelper.prototype.update = (ti = new Ci.Vector3,
  54810. ii = new Ci.Vector3,
  54811. ni = new Ci.Matrix3,
  54812. function() {
  54813. var e = ["a", "b", "c"];
  54814. this.object.updateMatrixWorld(!0),
  54815. ni.getNormalMatrix(this.object.matrixWorld);
  54816. var t = this.object.matrixWorld
  54817. , i = this.geometry.attributes.position
  54818. , n = this.object.geometry;
  54819. if (n instanceof Ci.Geometry)
  54820. for (var r = n.vertices, o = n.faces, a = 0, s = 0, l = o.length; s < l; s++)
  54821. for (var c = o[s], h = 0, u = c.vertexNormals.length; h < u; h++) {
  54822. var d = r[c[e[h]]]
  54823. , p = c.vertexNormals[h];
  54824. ti.copy(d).applyMatrix4(t),
  54825. ii.copy(p).applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54826. i.setXYZ(a, ti.x, ti.y, ti.z),
  54827. a += 1,
  54828. i.setXYZ(a, ii.x, ii.y, ii.z),
  54829. a += 1
  54830. }
  54831. else if (n instanceof Ci.BufferGeometry) {
  54832. var f = n.attributes.position
  54833. , g = n.attributes.normal;
  54834. for (h = a = 0,
  54835. u = f.count; h < u; h++)
  54836. ti.set(f.getX(h), f.getY(h), f.getZ(h)).applyMatrix4(t),
  54837. ii.set(g.getX(h), g.getY(h), g.getZ(h)),
  54838. ii.applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54839. i.setXYZ(a, ti.x, ti.y, ti.z),
  54840. a += 1,
  54841. i.setXYZ(a, ii.x, ii.y, ii.z),
  54842. a += 1
  54843. }
  54844. return i.needsUpdate = !0,
  54845. this
  54846. }
  54847. ),
  54848. Ci.WireframeHelper = function(e, t) {
  54849. var i = void 0 !== t ? t : 16777215;
  54850. Ci.LineSegments.call(this, new Ci.WireframeGeometry(e.geometry), new Ci.LineBasicMaterial({
  54851. color: i
  54852. })),
  54853. this.matrix = e.matrixWorld,
  54854. this.matrixAutoUpdate = !1
  54855. }
  54856. ,
  54857. Ci.WireframeHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54858. Ci.WireframeHelper.prototype.constructor = Ci.WireframeHelper,
  54859. Ci.ImmediateRenderObject = function(e) {
  54860. Ci.Object3D.call(this),
  54861. this.material = e,
  54862. this.render = function(e) {}
  54863. }
  54864. ,
  54865. Ci.ImmediateRenderObject.prototype = Object.create(Ci.Object3D.prototype),
  54866. Ci.ImmediateRenderObject.prototype.constructor = Ci.ImmediateRenderObject,
  54867. Ci.MorphBlendMesh = function(e, t) {
  54868. Ci.Mesh.call(this, e, t),
  54869. this.animationsMap = {},
  54870. this.animationsList = [];
  54871. var i = this.geometry.morphTargets.length
  54872. , n = i - 1
  54873. , r = i / 1;
  54874. this.createAnimation("__default", 0, n, r),
  54875. this.setAnimationWeight("__default", 1)
  54876. }
  54877. ,
  54878. Ci.MorphBlendMesh.prototype = Object.create(Ci.Mesh.prototype),
  54879. Ci.MorphBlendMesh.prototype.constructor = Ci.MorphBlendMesh,
  54880. Ci.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  54881. var r = {
  54882. start: t,
  54883. end: i,
  54884. length: i - t + 1,
  54885. fps: n,
  54886. duration: (i - t) / n,
  54887. lastFrame: 0,
  54888. currentFrame: 0,
  54889. active: !1,
  54890. time: 0,
  54891. direction: 1,
  54892. weight: 1,
  54893. directionBackwards: !1,
  54894. mirroredLoop: !1
  54895. };
  54896. this.animationsMap[e] = r,
  54897. this.animationsList.push(r)
  54898. }
  54899. ,
  54900. Ci.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  54901. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  54902. var s = r.morphTargets[o].name.match(i);
  54903. if (s && 1 < s.length)
  54904. n[l = s[1]] || (n[l] = {
  54905. start: 1 / 0,
  54906. end: -1 / 0
  54907. }),
  54908. o < (c = n[l]).start && (c.start = o),
  54909. o > c.end && (c.end = o),
  54910. t = t || l
  54911. }
  54912. for (var l in n) {
  54913. var c = n[l];
  54914. this.createAnimation(l, c.start, c.end, e)
  54915. }
  54916. this.firstAnimation = t
  54917. }
  54918. ,
  54919. Ci.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  54920. var t = this.animationsMap[e];
  54921. t && (t.direction = 1,
  54922. t.directionBackwards = !1)
  54923. }
  54924. ,
  54925. Ci.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  54926. var t = this.animationsMap[e];
  54927. t && (t.direction = -1,
  54928. t.directionBackwards = !0)
  54929. }
  54930. ,
  54931. Ci.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  54932. var i = this.animationsMap[e];
  54933. i && (i.fps = t,
  54934. i.duration = (i.end - i.start) / i.fps)
  54935. }
  54936. ,
  54937. Ci.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  54938. var i = this.animationsMap[e];
  54939. i && (i.duration = t,
  54940. i.fps = (i.end - i.start) / i.duration)
  54941. }
  54942. ,
  54943. Ci.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  54944. var i = this.animationsMap[e];
  54945. i && (i.weight = t)
  54946. }
  54947. ,
  54948. Ci.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  54949. var i = this.animationsMap[e];
  54950. i && (i.time = t)
  54951. }
  54952. ,
  54953. Ci.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  54954. var t = 0
  54955. , i = this.animationsMap[e];
  54956. return i && (t = i.time),
  54957. t
  54958. }
  54959. ,
  54960. Ci.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  54961. var t = -1
  54962. , i = this.animationsMap[e];
  54963. return i && (t = i.duration),
  54964. t
  54965. }
  54966. ,
  54967. Ci.MorphBlendMesh.prototype.playAnimation = function(e) {
  54968. var t = this.animationsMap[e];
  54969. t ? (t.time = 0,
  54970. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  54971. }
  54972. ,
  54973. Ci.MorphBlendMesh.prototype.stopAnimation = function(e) {
  54974. var t = this.animationsMap[e];
  54975. t && (t.active = !1)
  54976. }
  54977. ,
  54978. Ci.MorphBlendMesh.prototype.update = function(e) {
  54979. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  54980. var n = this.animationsList[t];
  54981. if (n.active) {
  54982. var r = n.duration / n.length;
  54983. n.time += n.direction * e,
  54984. n.mirroredLoop ? (n.time > n.duration || n.time < 0) && (n.direction *= -1,
  54985. n.time > n.duration && (n.time = n.duration,
  54986. n.directionBackwards = !0),
  54987. n.time < 0 && (n.time = 0,
  54988. n.directionBackwards = !1)) : (n.time = n.time % n.duration,
  54989. n.time < 0 && (n.time += n.duration));
  54990. var o = n.start + Ci.Math.clamp(Math.floor(n.time / r), 0, n.length - 1)
  54991. , a = n.weight;
  54992. o !== n.currentFrame && (this.morphTargetInfluences[n.lastFrame] = 0,
  54993. this.morphTargetInfluences[n.currentFrame] = 1 * a,
  54994. this.morphTargetInfluences[o] = 0,
  54995. n.lastFrame = n.currentFrame,
  54996. n.currentFrame = o);
  54997. var s = n.time % r / r;
  54998. n.directionBackwards && (s = 1 - s),
  54999. n.currentFrame !== n.lastFrame ? (this.morphTargetInfluences[n.currentFrame] = s * a,
  55000. this.morphTargetInfluences[n.lastFrame] = (1 - s) * a) : this.morphTargetInfluences[n.currentFrame] = a
  55001. }
  55002. }
  55003. }
  55004. ,
  55005. void 0 !== i ? (void 0 !== t && t.exports && (i = t.exports = Ci),
  55006. i.THREE = Ci) : this.THREE = Ci
  55007. window.THREE = Ci
  55008. getObjLoader()
  55009. }
  55010. , {}]
  55011. }, {}, [116]);