main_2020_show.js 2.6 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949559505595155952559535595455955559565595755958559595596055961559625596355964559655596655967559685596955970559715597255973559745597555976559775597855979559805598155982559835598455985559865598755988559895599055991559925599355994559955599655997559985599956000560015600256003560045600556006560075600856009560105601156012560135601456015560165601756018560195602056021560225602356024560255602656027560285602956030560315603256033560345603556036560375603856039560405604156042560435604456045560465604756048560495605056051560525605356054560555605656057560585605956060560615606256063560645606556066560675606856069560705607156072560735607456075560765607756078560795608056081560825608356084560855608656087560885608956090560915609256093560945609556096560975609856099561005610156102561035610456105561065610756108561095611056111561125611356114561155611656117561185611956120561215612256123561245612556126561275612856129561305613156132561335613456135561365613756138561395614056141561425614356144561455614656147561485614956150561515615256153561545615556156561575615856159561605616156162561635616456165561665616756168561695617056171561725617356174561755617656177561785617956180561815618256183561845618556186561875618856189561905619156192561935619456195561965619756198561995620056201562025620356204562055620656207562085620956210562115621256213562145621556216562175621856219562205622156222562235622456225562265622756228562295623056231562325623356234562355623656237562385623956240562415624256243562445624556246562475624856249562505625156252562535625456255562565625756258562595626056261562625626356264562655626656267562685626956270562715627256273562745627556276562775627856279562805628156282562835628456285562865628756288562895629056291562925629356294562955629656297562985629956300563015630256303563045630556306563075630856309563105631156312563135631456315563165631756318563195632056321563225632356324563255632656327563285632956330563315633256333563345633556336563375633856339563405634156342563435634456345563465634756348563495635056351563525635356354563555635656357563585635956360563615636256363563645636556366563675636856369563705637156372563735637456375563765637756378563795638056381563825638356384563855638656387563885638956390563915639256393563945639556396563975639856399564005640156402564035640456405564065640756408564095641056411564125641356414564155641656417564185641956420564215642256423564245642556426564275642856429564305643156432564335643456435564365643756438564395644056441564425644356444564455644656447564485644956450564515645256453564545645556456564575645856459564605646156462564635646456465564665646756468564695647056471564725647356474564755647656477564785647956480564815648256483564845648556486564875648856489564905649156492564935649456495564965649756498564995650056501565025650356504565055650656507565085650956510565115651256513565145651556516565175651856519565205652156522565235652456525565265652756528565295653056531565325653356534565355653656537565385653956540565415654256543565445654556546565475654856549565505655156552565535655456555565565655756558565595656056561565625656356564565655656656567565685656956570565715657256573565745657556576565775657856579565805658156582565835658456585565865658756588565895659056591565925659356594565955659656597565985659956600566015660256603566045660556606566075660856609566105661156612566135661456615566165661756618566195662056621566225662356624566255662656627566285662956630566315663256633566345663556636566375663856639566405664156642566435664456645566465664756648566495665056651566525665356654566555665656657566585665956660566615666256663566645666556666566675666856669566705667156672566735667456675566765667756678566795668056681566825668356684566855668656687566885668956690566915669256693566945669556696566975669856699567005670156702567035670456705567065670756708567095671056711567125671356714567155671656717567185671956720567215672256723567245672556726567275672856729567305673156732567335673456735567365673756738567395674056741567425674356744567455674656747567485674956750567515675256753567545675556756567575675856759567605676156762567635676456765567665676756768567695677056771567725677356774567755677656777567785677956780567815678256783567845678556786567875678856789567905679156792567935679456795567965679756798567995680056801568025680356804568055680656807568085680956810568115681256813568145681556816568175681856819568205682156822568235682456825568265682756828568295683056831568325683356834568355683656837568385683956840568415684256843568445684556846568475684856849568505685156852568535685456855568565685756858568595686056861568625686356864568655686656867568685686956870568715687256873568745687556876568775687856879568805688156882568835688456885568865688756888568895689056891568925689356894568955689656897568985689956900569015690256903569045690556906569075690856909569105691156912569135691456915569165691756918569195692056921569225692356924569255692656927569285692956930569315693256933569345693556936569375693856939569405694156942569435694456945569465694756948569495695056951569525695356954569555695656957569585695956960569615696256963569645696556966569675696856969569705697156972569735697456975569765697756978569795698056981569825698356984569855698656987569885698956990569915699256993569945699556996569975699856999570005700157002570035700457005570065700757008570095701057011570125701357014570155701657017570185701957020570215702257023570245702557026570275702857029570305703157032570335703457035570365703757038570395704057041570425704357044570455704657047570485704957050570515705257053570545705557056570575705857059570605706157062570635706457065570665706757068570695707057071570725707357074570755707657077570785707957080570815708257083570845708557086570875708857089570905709157092570935709457095570965709757098570995710057101571025710357104571055710657107571085710957110571115711257113571145711557116571175711857119571205712157122571235712457125571265712757128571295713057131571325713357134571355713657137571385713957140571415714257143571445714557146571475714857149571505715157152571535715457155571565715757158571595716057161571625716357164571655716657167571685716957170571715717257173571745717557176571775717857179571805718157182571835718457185571865718757188571895719057191571925719357194571955719657197571985719957200572015720257203572045720557206572075720857209572105721157212572135721457215572165721757218572195722057221572225722357224572255722657227572285722957230572315723257233572345723557236572375723857239572405724157242572435724457245572465724757248572495725057251572525725357254572555725657257572585725957260572615726257263572645726557266572675726857269572705727157272572735727457275572765727757278572795728057281572825728357284572855728657287572885728957290572915729257293572945729557296572975729857299573005730157302573035730457305573065730757308573095731057311573125731357314573155731657317573185731957320573215732257323573245732557326573275732857329573305733157332573335733457335573365733757338573395734057341573425734357344573455734657347573485734957350573515735257353573545735557356573575735857359573605736157362573635736457365573665736757368573695737057371573725737357374573755737657377573785737957380573815738257383573845738557386573875738857389573905739157392573935739457395573965739757398573995740057401574025740357404574055740657407574085740957410574115741257413574145741557416574175741857419574205742157422574235742457425574265742757428574295743057431574325743357434574355743657437574385743957440574415744257443574445744557446574475744857449574505745157452574535745457455574565745757458574595746057461574625746357464574655746657467574685746957470574715747257473574745747557476574775747857479574805748157482574835748457485574865748757488574895749057491574925749357494574955749657497574985749957500575015750257503575045750557506575075750857509575105751157512575135751457515575165751757518575195752057521575225752357524575255752657527575285752957530575315753257533575345753557536575375753857539575405754157542575435754457545575465754757548575495755057551575525755357554575555755657557575585755957560575615756257563575645756557566575675756857569575705757157572575735757457575575765757757578575795758057581575825758357584575855758657587575885758957590575915759257593575945759557596575975759857599576005760157602576035760457605576065760757608576095761057611576125761357614576155761657617576185761957620576215762257623576245762557626576275762857629576305763157632576335763457635576365763757638576395764057641576425764357644576455764657647576485764957650576515765257653576545765557656576575765857659576605766157662576635766457665576665766757668576695767057671576725767357674576755767657677576785767957680576815768257683576845768557686576875768857689576905769157692576935769457695576965769757698576995770057701577025770357704577055770657707577085770957710577115771257713577145771557716577175771857719577205772157722577235772457725577265772757728577295773057731577325773357734577355773657737577385773957740577415774257743577445774557746577475774857749577505775157752577535775457755577565775757758577595776057761577625776357764577655776657767577685776957770577715777257773577745777557776577775777857779577805778157782577835778457785577865778757788577895779057791577925779357794577955779657797577985779957800578015780257803578045780557806578075780857809578105781157812578135781457815578165781757818578195782057821578225782357824578255782657827578285782957830578315783257833578345783557836578375783857839578405784157842578435784457845578465784757848578495785057851578525785357854578555785657857578585785957860578615786257863578645786557866578675786857869578705787157872578735787457875578765787757878578795788057881578825788357884578855788657887578885788957890578915789257893578945789557896578975789857899579005790157902579035790457905579065790757908579095791057911579125791357914579155791657917579185791957920579215792257923579245792557926579275792857929579305793157932579335793457935579365793757938579395794057941579425794357944579455794657947579485794957950579515795257953579545795557956579575795857959579605796157962579635796457965579665796757968579695797057971579725797357974579755797657977579785797957980579815798257983579845798557986579875798857989579905799157992579935799457995579965799757998579995800058001580025800358004580055800658007580085800958010580115801258013580145801558016580175801858019580205802158022580235802458025580265802758028580295803058031580325803358034580355803658037580385803958040580415804258043580445804558046580475804858049580505805158052580535805458055580565805758058580595806058061580625806358064580655806658067580685806958070580715807258073580745807558076580775807858079580805808158082580835808458085580865808758088580895809058091580925809358094580955809658097580985809958100581015810258103581045810558106581075810858109581105811158112581135811458115581165811758118581195812058121581225812358124581255812658127581285812958130581315813258133581345813558136581375813858139581405814158142581435814458145581465814758148581495815058151581525815358154581555815658157581585815958160581615816258163581645816558166581675816858169581705817158172581735817458175581765817758178581795818058181581825818358184581855818658187581885818958190581915819258193581945819558196581975819858199582005820158202582035820458205582065820758208582095821058211582125821358214582155821658217582185821958220582215822258223582245822558226582275822858229582305823158232582335823458235582365823758238582395824058241582425824358244582455824658247582485824958250582515825258253582545825558256582575825858259582605826158262582635826458265582665826758268582695827058271582725827358274582755827658277582785827958280582815828258283582845828558286582875828858289582905829158292582935829458295582965829758298582995830058301583025830358304583055830658307583085830958310583115831258313583145831558316583175831858319583205832158322583235832458325583265832758328583295833058331583325833358334583355833658337583385833958340583415834258343583445834558346583475834858349583505835158352583535835458355583565835758358583595836058361583625836358364583655836658367583685836958370583715837258373583745837558376583775837858379583805838158382583835838458385583865838758388583895839058391583925839358394583955839658397583985839958400584015840258403584045840558406584075840858409584105841158412584135841458415584165841758418584195842058421584225842358424584255842658427584285842958430584315843258433584345843558436584375843858439584405844158442584435844458445584465844758448584495845058451584525845358454584555845658457584585845958460584615846258463584645846558466584675846858469584705847158472584735847458475584765847758478584795848058481584825848358484584855848658487584885848958490584915849258493584945849558496584975849858499585005850158502585035850458505585065850758508585095851058511585125851358514585155851658517585185851958520585215852258523585245852558526585275852858529585305853158532585335853458535585365853758538585395854058541585425854358544585455854658547585485854958550585515855258553585545855558556585575855858559585605856158562585635856458565585665856758568585695857058571585725857358574585755857658577585785857958580585815858258583585845858558586585875858858589585905859158592585935859458595585965859758598585995860058601586025860358604586055860658607586085860958610586115861258613586145861558616586175861858619586205862158622586235862458625586265862758628586295863058631586325863358634586355863658637586385863958640586415864258643586445864558646586475864858649586505865158652586535865458655586565865758658586595866058661586625866358664586655866658667586685866958670586715867258673586745867558676586775867858679586805868158682586835868458685586865868758688586895869058691586925869358694586955869658697586985869958700587015870258703587045870558706587075870858709587105871158712587135871458715587165871758718587195872058721587225872358724587255872658727587285872958730587315873258733587345873558736587375873858739587405874158742587435874458745587465874758748587495875058751587525875358754587555875658757587585875958760587615876258763587645876558766587675876858769587705877158772587735877458775587765877758778587795878058781587825878358784587855878658787587885878958790587915879258793587945879558796587975879858799588005880158802588035880458805588065880758808588095881058811588125881358814588155881658817588185881958820588215882258823588245882558826588275882858829588305883158832588335883458835588365883758838588395884058841588425884358844588455884658847588485884958850588515885258853588545885558856588575885858859588605886158862588635886458865588665886758868588695887058871588725887358874588755887658877588785887958880588815888258883588845888558886588875888858889588905889158892588935889458895588965889758898588995890058901589025890358904589055890658907589085890958910589115891258913589145891558916589175891858919589205892158922589235892458925589265892758928589295893058931589325893358934589355893658937589385893958940589415894258943589445894558946589475894858949589505895158952589535895458955589565895758958589595896058961589625896358964589655896658967589685896958970589715897258973589745897558976589775897858979589805898158982589835898458985589865898758988589895899058991589925899358994589955899658997589985899959000590015900259003590045900559006590075900859009590105901159012590135901459015590165901759018590195902059021590225902359024590255902659027590285902959030590315903259033590345903559036590375903859039590405904159042590435904459045590465904759048590495905059051590525905359054590555905659057590585905959060590615906259063590645906559066590675906859069590705907159072590735907459075590765907759078590795908059081590825908359084590855908659087590885908959090590915909259093590945909559096590975909859099591005910159102591035910459105591065910759108591095911059111591125911359114591155911659117591185911959120591215912259123591245912559126591275912859129591305913159132591335913459135591365913759138591395914059141591425914359144591455914659147591485914959150591515915259153591545915559156591575915859159591605916159162591635916459165591665916759168591695917059171591725917359174591755917659177591785917959180591815918259183591845918559186591875918859189591905919159192591935919459195591965919759198591995920059201592025920359204
  1. /* 许钟文修改的 标记 xzw
  2. 另外 所有"matter"字样已被我删除 原因:删除matterport信息
  3. */
  4. window.common = null;
  5. window.MathLight = null;
  6. window.math = null
  7. window.easing = null
  8. window.lerp = null
  9. window.transitions = null
  10. window.browser = null
  11. window.momentTourBlackNewType = 0//true
  12. window.myTimer = null;
  13. g_playAudio = null
  14. // 全屏热点退出按钮
  15. exit = null
  16. g_tourAudio = new Audio
  17. g_tourAudio.loop = !1
  18. g_tourAudio.crossOrigin = "anonymous"
  19. g_tourAudio.addEventListener("ended", function() {
  20. var e = document.createEvent("MouseEvent");
  21. e.initEvent("tourAudioEnded", !0, !0),
  22. window.dispatchEvent(e)
  23. })
  24. g_tourAudio.oncanplaythrough = function() {
  25. if(g_tourAudio.shouldPlay){
  26. g_tourAudio.play();
  27. g_playAudio = g_tourAudio;
  28. }
  29. }
  30. var musicList = {
  31. "0102cp":'3458d3c7ca764ecaa13c88aaa8e0a1a8, 1107bf848a6146059249cc109c6d1472, 8c0e5bcc4a69470aa5f189edde162973, 2d00ef76d93f4a578b356c593da889b0, 61afb8aaf45046be865b1b30d0357754, 0a73cf23993d4f4cbb48337708f8c7b7, 9a32f7d9b29f427182b453b1a8009efc'.split(','),
  32. "04CP":'48930ada7d02438a846f6f6cf5a8693f, d3e00453736549e392ca91e9bd31ee72, b99ae9d8d19144f7866d49ed863a4b84, 14f349b0dd3d4646b2bd98c2ebfeb643'.split(','),
  33. "03cp":'d9b104d7df9244fca5ad5af4d5fca8f7, 2860b361da9246949ab6f57cbb8ce82d, 491d8cce5dfa441db5a52eb248bf4a63'.split(','),
  34. "19CP":'73a354895dc74c30beeb02a8d8bfe328, 256aedca55d6417fb696156279424d42, 10210bebd78b4d33ad05e0bef22cf0a3'.split(','),
  35. "2021cp":'10793e907fa7493c83f73fdcfd7df706, 2e2da10199634b5188c5469c0f52f9f6, 449196f2aa014f9db6a6cda675df7b70'.split(','),
  36. "22cp":'cf2d9fa92e8443aabbcc1a01736a052e, 08967bbdacec4ecf8ff44b219408ac9a, 8d20c6dd62c04564a172430705ba0295, a8a7d94bb9b84e8cb45556bbd548961d'.split(','),
  37. "23cp":'90197f7926e2466498135ef053147aaa, 6138d5511fe546e396a51408dfc9f6c5'.split(','),
  38. "0506CP":'6cee9744a41942f384ca0a9130f65ae8, a1f9e4436ea24f99a360ac327979e555, 8d216c8512264564bcde41c544fdfc69, f8769828fe9f4dda8449cd5d9506eeb4, 12142ab7fbb74122ba0df52eaa5a5363, fb3b381371d04864ab99dfd30a08fe89, 0921140bde3f428180b2d6b603775f51'.split(','),
  39. "07cp":'8902a763387040b2ad15a6325508cfca, 5adf5343a38340de998a0210cc97c00f'.split(','),
  40. "08CP":'f9e6d48c697f455f9b294523a5222624, 4f912bc6dc2848ce924064d025635b81, 518612bb1c884d9bb7aff8d431904f8d'.split(','),
  41. "09cp":'cb5887f7f3da43bf9ce383fbe4bae99b, d236fb56ac954bb29b3a6d0bdbe85588'.split(','),
  42. "10cp":'dca81dee239e4f7e9d8b69c3af629f00, 69ef058f04474e3fbfd4cd22bb440934, 42fe939bbf7c42058f9c32356a08f319'.split(','),
  43. "11cp":'fd62c35e2572460b88fb934e56888a2d, 4836763c382a45dcba1210f616e9e3be'.split(','),
  44. "1213CP":'06fcab3ccc204198ba04bc226d6a049a, c72fe82506234db6bd75919ac0e61ec5, 884d594255f54a88b36f078ec2842669, 921eaf2a769c4f069e9588b0fa99f170, 02abef88316e482b9d4c4f3cb2a34c64'.split(','),
  45. "15cp":'6e4c35329ba1470c8ebdf2ad3f1e92cd'.split(','),
  46. "14cp":'0b168caa5f1848e1b614e97b3cc22923, a05cc1124331484c9d852f4918a3248d'.split(','),
  47. "16cp":'506d2f805551425d938f488746730060, 21fbd2534bc840ebac3a5fac50e54cf5'.split(','),
  48. "17cp":'d756e9288311440599eab62bde2e017e'.split(','),
  49. "18cp":'11bb3c4c831a4151b8c7086f39086878'.split(','),
  50. }
  51. var playMusic = function(pano){//根据漫游点切换bgm
  52. //var describe = player.director.describe();
  53. //manage.bgmShouldPlay
  54. if( g_tourAudio.shouldPlay /* !g_tourAudio.paused */ || g_currentHot )return;
  55. var shouldplayMusic
  56. for(let i in musicList){
  57. if(musicList[i].find(e=>e.includes(pano.id))){
  58. shouldplayMusic = i;
  59. break
  60. }
  61. }
  62. if(shouldplayMusic){
  63. if(!g_bgAudio.src.includes(shouldplayMusic)){
  64. g_bgAudio.src = "music/"+shouldplayMusic+'.mp3'
  65. }
  66. manage.switchBgmState(true)
  67. }else{
  68. g_bgAudio.src = ''
  69. }
  70. }
  71. var dealMap = (map)=>{//使不resize when image is not power of two
  72. map.wrapS = map.wrapT = THREE.ClampToEdgeWrapping;
  73. map.minFilter = THREE.LinearFilter;
  74. map.magFilter = THREE.LinearFilter;
  75. map.generateMipmaps = true;
  76. }
  77. var dom = {//许钟文add
  78. getOffset: function(type, element, parent) {
  79. left = (type == "left") ? element.offsetLeft : element.offsetTop;
  80. if (!parent) parent = $("body")[0];
  81. while (element = element.offsetParent) {
  82. if (element == parent) break;
  83. left += (type == "left") ? element.offsetLeft : element.offsetTop;
  84. }
  85. return left;
  86. }
  87. };
  88. var getTransformSid = function(){
  89. var name
  90. if(player.mode == 'panorama'){
  91. name = player.currentPano ? player.currentPano.id : 'outside'
  92. }else{
  93. name = 'outside'
  94. }
  95. return name
  96. }
  97. var convertTool = {
  98. getPos2d : function(point, camera, dom){//获取一个三维坐标对应屏幕中的二维坐标
  99. var camera = camera || player.camera;
  100. var dom = dom || player.domElement;
  101. 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);
  102. var x,y;
  103. x = (pos.x + 1) / 2 * dom.clientWidth;
  104. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  105. var inSight = x <= dom.clientWidth && x >= 0 //是否在屏幕中
  106. && y <= dom.clientHeight && y >= 0
  107. return {
  108. pos: new THREE.Vector2(x,y), // 屏幕像素坐标
  109. vector: pos, //(范围 -1 ~ 1)
  110. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  111. inSight : inSight //在屏幕范围内可见
  112. };
  113. },
  114. ifShelter: function(pos3d){//检测某点在视线中是否被mesh遮挡
  115. var ori = player.position
  116. var dir = pos3d.clone().sub(ori).normalize()
  117. var ray = new THREE.Raycaster(ori, dir) //由外向里 因为模型从内侧是可见的所以从外侧
  118. /* if(config.isEdit && publicObjectSet.editor.mainDesign.editing){
  119. var o = ray.intersectObjects(publicObjectSet.editor.mainDesign.wallMeshes);
  120. }else{ */
  121. var o = ray.intersectObjects(player.model.colliders);
  122. //}
  123. var len = pos3d.distanceTo(ori);
  124. if (o && o.length) {
  125. for(var i=0;i<o.length;i++){
  126. if(o[i].distance < len){ return true; }//有遮挡
  127. }
  128. }
  129. },
  130. /*
  131. 拖拽时,获取鼠标在拖拽面上的位置(需要借助另一个intersectPlane面来计算,即和相机方向一样的面,可保证铺满屏幕)
  132. 但是不一定能获取到,比如鼠标射线不朝向拖拽面时,即使获取也会是一个意外的反方向的交点。
  133. */
  134. getPosAtPlane : function(pos, info/* , mouse, camera */){ //pos:与intersectPlane的交点 见笔记
  135. var A = pos;
  136. var player = player;
  137. var mouse = player.mouse;
  138. var O = new THREE.Vector3(mouse.x, mouse.y, -1).unproject(player.camera);
  139. if(info.y != void 0){//地面线的
  140. var y = info.y;
  141. if(player.mode == "floorplan"/* || Math.abs(O.x-pos.x)<0.0001 && Math.abs(O.z-pos.z)<0.0001) */){
  142. //intersectPlane和地面平行,无交点
  143. var x = pos.x, z = pos.z;
  144. }else{
  145. if(y<player.camera.position.y && O.y <= A.y /* || y>player.camera.position.y && O.y >= A.y */)return null; //鼠标射线向上。因为相机一定位于地面以上(地面不会抬高到相机上吧?),所以无交点。
  146. if(O.y == A.y){console.log('一样??');return;}
  147. if(A.y == y){console.log('一样2??');return;}
  148. var r = (O.y-y)/(A.y-y);
  149. var x = (r*A.x-O.x)/(r-1);
  150. var z = (r*A.z-O.z)/(r-1);
  151. }
  152. }else{//垂直的也有越过消失点以后反向变化的情况,但使用时影响不大
  153. var N = info.normalVec;
  154. var P = info.pullPos;
  155. if(N.y != 0 ){console.log('N.y != 0');return;} //仅仅支持垂直于地面的的墙壁,目前都是
  156. if(O.z==A.z){console.log('O.z==A.z?');return;}
  157. if(N.z!=0 && N.x != 0){//直接用这个通用的也可以,支持斜线的墙
  158. //console.log('N.z==0 && N.x == 0?');
  159. var c = ( N.x*(A.x-O.x) + N.y*(A.y-O.y) + N.z*(A.z-O.z));
  160. if(c == 0){console.log("分母为0?? return;");return;}
  161. 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
  162. var x = t * (A.x - O.x) + O.x;
  163. var y = t * (A.y - O.y) + O.y;
  164. var z = t * (A.z - O.z) + O.z;
  165. /*原理: 已知空间直线L:(x-a)/m=(x-b)/n=(z-c)/p和空间平面π:Ax+By+Cz+D=0;
  166. 求直线L与平面π的交点的坐标。
  167. 把直线方程改写成参数形式:设(x-a)/m=(x-b)/n=(z-c)/p=t;
  168. 则x=mt+a;y=nt+b;z=pt+c;代入平面π的方程得:
  169. A(mt+a)+B(nt+b)+C(pt+c)+D=0
  170. 由此解得t=-(Aa+Bb+Cc+D)/(Am+Bn+Cp)
  171. 再代入参数方程即得交点的坐标(x,y,z). */
  172. }else if(N.x ==0 ){ //z与pullPos相等
  173. var z = P.z;
  174. if(O.y == A.y){console.log('一样??');return;}
  175. if(A.y == y){console.log('一样2??');return;}
  176. if(A.z == z){console.log('一样3??');return;}
  177. var r = (O.z-z)/(A.z-z);
  178. var x = (r*A.x-O.x)/(r-1);
  179. var y = (r*A.y-O.y)/(r-1);
  180. }else if(N.z == 0){//x与pullPos相等
  181. var x = P.x;
  182. if(O.y == A.y){console.log('一样??');return;}
  183. if(A.y == y){console.log('一样2??');return;}
  184. if(A.x == x){console.log('一样3??');return;}
  185. var r = (O.x-x)/(A.x-x);
  186. var y = (r*A.y-O.y)/(r-1);
  187. var z = (r*A.z-O.z)/(r-1);
  188. }
  189. }
  190. return new THREE.Vector3(x,y,z);
  191. },
  192. getMouseIntersect : function(camera, meshes, mouse){//获取鼠标和meshes交点
  193. var raycaster = new THREE.Raycaster;
  194. camera.updateMatrixWorld();
  195. var origin = new THREE.Vector3(mouse.x,mouse.y,-1).unproject(camera)
  196. , end = new THREE.Vector3(mouse.x,mouse.y,1).unproject(camera);
  197. var dir = end.sub(origin).normalize()
  198. raycaster.set(origin, dir);
  199. var n = raycaster.intersectObjects(meshes);
  200. if (0 === n.length)
  201. return null;
  202. return n[0];
  203. },
  204. ifIntersectChunks : function(A,B,options={}){//获取某个线段/射线和meshes的交点
  205. var dir = B.clone().sub(A).normalize();
  206. var len = options.InfinityLen ? Infinity : A.distanceTo(B) + (options.extLen||0);
  207. var ray = new THREE.Raycaster(A.clone(), dir, 0, len);
  208. var o = ray.intersectObjects(options.model || player.model.colliders);
  209. if (o && o.length)return o;
  210. if(options.throughWidth){ //允许最小宽度,防止穿过极小的缝隙导致撞墙感
  211. var normal = math.getNormal({points:[{x:A.x, y:A.z},{x:B.x, y:B.z}]});//线段法线
  212. normal.multiplyScalar(options.throughWidth)
  213. var normalVec3 = new THREE.Vector3(normal.x, 0, normal.y);
  214. var A2 = A.clone().add(normalVec3)
  215. ray.set(A2, dir);
  216. var o2 = ray.intersectObjects(options.model || player.model.colliders);
  217. ray.set(A.clone().add(normalVec3.negate()), dir);
  218. if (o2 && o2.length)return o2;
  219. var o3 = ray.intersectObjects(options.model || player.model.colliders);
  220. if (o3 && o3.length)return o3;
  221. }
  222. return null;
  223. },
  224. getPosAtSphere : function(pos3d, toPanoPos){
  225. var dir = pos3d.clone().sub(toPanoPos);
  226. dir.normalize();//然后计算在球中
  227. dir.multiplyScalar(Constants.skyRadius);
  228. dir.add(toPanoPos);
  229. return dir;
  230. }
  231. }
  232. var videoPosInfo = {
  233. /* "3458d3c7ca764ecaa13c88aaa8e0a1a8" : [-0.10965598660414333, -0.26776671083073333, 0.2265850992680396],
  234. "1107bf848a6146059249cc109c6d1472":[-0.10965598660414333, -0.26776671083073333, 0.2265850992680396],
  235. "8c0e5bcc4a69470aa5f189edde162973":[-0.10965598660414333, -0.26776671083073333, 0.2265850992680396],//多出的左前
  236. "10444ea5b3ed4629915c3f449b790c58":[0.03080183370988987, -0.26776671083073333, 0.2865850992680396],
  237. "9a32f7d9b29f427182b453b1a8009efc":[0.03080183370988987, -0.26776671083073333, 0.2265850992680396],
  238. "988a92b36f544326896b101b54a69290":[-0.034905996796551514, -0.26776671083073333, 0.3680810776239348],
  239. "a812006399af4c73b6b19941485597a2":[-0.06490599679655151, -0.26776671083073333, 0.3380810776239347],
  240. "9438aaa08cc94456a432ee3a7fa3378f":[-0.06490599679655151, -0.26776671083073333, 0.3380810776239347],
  241. "491d8cce5dfa441db5a52eb248bf4a63": [-0.3375152936642509, -0.26776671083073333, 0.27173181146902703],
  242. */
  243. "3458d3c7ca764ecaa13c88aaa8e0a1a8": [0.15, -0.3, 0.37]
  244. , "1107bf848a6146059249cc109c6d1472" :[0.15, -0.3,0.23]
  245. ,"8c0e5bcc4a69470aa5f189edde162973":[0.08, -0.3,0.25]
  246. ,"9a32f7d9b29f427182b453b1a8009efc" :[ 0.13, -0.3, 0.26]
  247. ,"491d8cce5dfa441db5a52eb248bf4a63":[0.05,-0.3, 0.27 ]
  248. ,"0a73cf23993d4f4cbb48337708f8c7b7":[0.09,-0.3, 0.25 ]
  249. ,"61afb8aaf45046be865b1b30d0357754":[0.290,-0.3,0.38]
  250. ,"58ea5816c49b4c759c26b262f403eab1":[0.034,-0.3,0.38]
  251. ,"6c455875e3834d53b43a2beaba11aa4d":[-0.04,-0.3,0.39]
  252. ,"2d00ef76d93f4a578b356c593da889b0":[0.35,-0.3,0.38]
  253. }
  254. var videoOffset
  255. var videoScale
  256. var loadedVideo = false
  257. var videoMat;
  258. //add 将其中一个曲面材质改成视频
  259. var loadVideo = ()=>{
  260. videoOffset = new THREE.Vector3(0.2638254165649414, -0.039959073066711426, 0.17957305908203125)
  261. videoScale = new THREE.Vector3(1.0199999809265137, 1.0199999809265137, 1.0199999809265137)
  262. //videoScale = new THREE.Vector3(1.02,1.02,1.02)
  263. var video = $('<video controls="controls" loop autoplay x5-playsinline="" webkit-playsinline="true" playsinline="true" controlslist="nodownload"></video>')[0]
  264. video.setAttribute("crossOrigin", 'Anonymous')//要在src设置好前解决跨域
  265. $(video).on('contextmenu', function () { return false; });//禁止右键点击出
  266. setTimeout(()=>{
  267. video.src = manage.dealURL("images/video/濠江战旗别样红_x264.mp4");
  268. },3000)
  269. videoMat = new THREE.MeshBasicMaterial({
  270. map : new THREE.VideoTexture( video )
  271. })
  272. videoMat.map.wrapS = videoMat.map.wrapT = THREE.ClampToEdgeWrapping;
  273. videoMat.map.minFilter = THREE.LinearFilter;
  274. videoMat.map.magFilter = THREE.LinearFilter;
  275. videoMat.map.generateMipmaps = true;
  276. video.volume = 0
  277. video.muted = true
  278. window.videoPlane = player.model.chunks[1];
  279. player.model.chunks.splice(1,1)
  280. window.videoShow = video
  281. //playVideo()
  282. window.videoPlane.name = 'videoPlane'
  283. video.addEventListener('loadeddata', ()=>{
  284. console.log( "video loaded!!!")
  285. loadedVideo = true
  286. })
  287. var btn = addSoundBtn(video)
  288. window.videoPlane.add(btn)
  289. video.btn = btn; btn.video = video
  290. btn.position.set(-11.6,1.02,-8.5);
  291. btn.rotation.y = -0.4
  292. }
  293. var playVideo = (()=>{
  294. var shouldPlay = true //只和用户点击有关,不点击时都是true
  295. return (state)=>{
  296. if(state != void 0) shouldPlay = state
  297. if(shouldPlay){
  298. window.videoShow && window.videoShow.play()
  299. }else{
  300. window.videoShow && window.videoShow.pause()
  301. }
  302. loadedVideo && changeVideoMat()
  303. }
  304. })()
  305. var changeVideoMat = function(){
  306. window.videoPlane.material = videoMat;
  307. }
  308. var updateVideo = (o)=>{//因为漫游中点位不准,所以在不同点更新视频位置
  309. if(!window.videoShow)return;
  310. if(o.type != "flyDone"){
  311. clearInterval(window.transformVideoTimer)
  312. }
  313. if(o.type == "beforeFlyOut"){
  314. window.videoPlane.visible = true;
  315. playVideo()
  316. changeVideoPos(new THREE.Vector3, o.dur/3)
  317. videoPlane.scale.set(1,1,1)
  318. }else{
  319. if( o.type == "beforeFlyIn"){
  320. videoPlane.scale.copy(videoScale)
  321. }
  322. if( o.type == "flyDone"){
  323. if(videoPosInfo[o.pano.id]){
  324. window.videoPlane.visible = true;
  325. playVideo()
  326. }else{
  327. window.videoPlane.visible = false
  328. window.videoShow.pause()
  329. }
  330. }else{
  331. if(videoPosInfo[o.pano.id]){
  332. window.videoPlane.visible = true;
  333. playVideo()
  334. var end = new THREE.Vector3().fromArray(videoPosInfo[o.pano.id])//.add(videoOffset)
  335. changeVideoPos(end, o.dur)
  336. }else{
  337. }
  338. }
  339. }
  340. }
  341. var easeInOutQuad = function(e, t, i, n) {
  342. return e /= n / 2,
  343. e < 1 ? i / 2 * e * e + t : (e--,
  344. -i / 2 * (e * (e - 2) - 1) + t)
  345. }
  346. var linearTween = function(e, t, i, n) {
  347. return i * e / n + t
  348. }
  349. var changeVideoPos = function(end, dur){//开始渐变位置
  350. var start = window.videoPlane.position.clone();
  351. var startTime = new Date().getTime();
  352. window.transformVideoTimer = setInterval(()=>{
  353. var progress = (new Date().getTime() - startTime) / dur;
  354. progress = Math.min(progress, 1);
  355. progress = linearTween(progress,0,1,1)
  356. if(progress >= 1)clearInterval(window.transformVideoTimer)
  357. window.videoPlane.position.copy(new THREE.Vector3().lerpVectors(start, end, progress))
  358. },20)
  359. }
  360. var getScale = function(){
  361. var s = 1.02;
  362. var center = videoPlane.geometry.boundingBox.center()
  363. var matrix1 = new THREE.Matrix4().setPosition(center.clone().negate());
  364. var scaleM = new THREE.Matrix4().makeScale(s,s,s);
  365. var matrix2 = new THREE.Matrix4().setPosition(center.clone());
  366. var scaleMatrix = new THREE.Matrix4().multiplyMatrices(scaleM, matrix1)
  367. scaleMatrix = new THREE.Matrix4().multiplyMatrices(matrix2, scaleMatrix)
  368. var quaterion = new THREE.Quaternion;
  369. var scale = new THREE.Vector3
  370. var position = new THREE.Vector3
  371. scaleMatrix.decompose(position, quaterion, scale)
  372. console.log(scale.toArray())
  373. console.log(position.toArray())
  374. }
  375. var btnMat;
  376. var btnGeo
  377. var soundOnMat, soundOffMat;
  378. var addSoundBtn = function(video){
  379. if(!soundOffMat){
  380. var videoMusicOffMap = Texture.load("images/videoMusicOff.png")
  381. var videoMusicOnMap = Texture.load("images/videoMusicOn.png")
  382. soundOffMat = new THREE.MeshBasicMaterial({
  383. map : videoMusicOffMap ,
  384. transparent:true,
  385. })
  386. soundOnMat = new THREE.MeshBasicMaterial({
  387. map : videoMusicOnMap ,
  388. transparent:true,
  389. })
  390. btnGeo = new THREE.PlaneGeometry(0.17, 0.17,1,1);
  391. }
  392. var btn = new THREE.Mesh(btnGeo, soundOffMat);
  393. btn.name = 'soundBtn'
  394. btn.video = video;
  395. video.btn = btn;
  396. return btn
  397. }
  398. var SoundOnVideo;
  399. var switchSoundBtn = function(video, belong){
  400. if(video.btn.material == soundOffMat){ //开启
  401. if(SoundOnVideo){
  402. SoundOnVideo.btn.material = soundOffMat,
  403. SoundOnVideo.volume = 0,
  404. SoundOnVideo.muted = true
  405. }else{
  406. if(g_bgAudio && !g_bgAudio.paused){
  407. manage.switchBgmState(false);
  408. g_bgAudio.pauseByVideo = true
  409. }
  410. }
  411. video.btn.material = soundOnMat
  412. video.volume = 1
  413. //从头开始放:
  414. video.currentTime = 0
  415. video.muted = false;
  416. if(g_tourAudio)g_tourAudio.pause()
  417. SoundOnVideo = video
  418. video.pauseByHot = video.pauseByTour = false
  419. if(belong instanceof Overlay){
  420. belong.switchPlay(true)
  421. }else{
  422. video.play()
  423. }
  424. }else{//关闭
  425. video.btn.material = soundOffMat
  426. video.volume = 0
  427. video.muted = true
  428. SoundOnVideo = null
  429. if(g_bgAudio && g_bgAudio.pauseByVideo && !video.pauseByHot && !video.pauseByTour){
  430. manage.switchBgmState(true)
  431. }
  432. }
  433. }
  434. var checkSoundBtnClick = function(intersect){
  435. if(intersect && intersect.object.name == "soundBtn"){
  436. switchSoundBtn(intersect.object.video, intersect.object.parent);
  437. return true
  438. }
  439. }
  440. !function() {
  441. "use strict";
  442. function t(t, i) {
  443. return typeof t === i
  444. }
  445. function i(t, i) {
  446. return t instanceof i
  447. }
  448. function n(t) {
  449. return t && t.nodeType
  450. }
  451. function e(t) {
  452. return n(t) ? t : i(t, g) ? t[0] : void 0
  453. }
  454. function o(t, i, n) {
  455. return g.each(t, function(t, e) {
  456. n = i.call(e, n, t, e)
  457. }),
  458. n
  459. }
  460. function r(t, i, n) {
  461. var e, o, r;
  462. if (t === i)
  463. return !0;
  464. if (!t || !i || t.constructor !== i.constructor)
  465. return !1;
  466. for (e = 0,
  467. o = n.length; o > e; e += 1) {
  468. if (r = n[e],
  469. t[r] && y(t[r].equals) && !t[r].equals(i[r]))
  470. return !1;
  471. if (t[r] !== i[r])
  472. return !1
  473. }
  474. return !0
  475. }
  476. function s(t, i, n, e) {
  477. this.left = E(t),
  478. this.top = E(i),
  479. this.width = E(n),
  480. this.height = E(e),
  481. this.right = this.left + this.width,
  482. this.bottom = this.top + this.height
  483. }
  484. function h(t, i, n, e) {
  485. this.visible = t || 0,
  486. this.viewport = i || 0,
  487. this.possible = n || 0,
  488. this.rects = e && T({}, e) || null
  489. }
  490. function l(t, i) {
  491. this.els = t,
  492. this.viewport = i
  493. }
  494. function c(t, i, n) {
  495. var e;
  496. return g.inArray(n, q) >= 0 ? e = s.ofElement(t) : g.inArray(n, S) >= 0 && (e = h.of(t, i)),
  497. e ? e[n] : 0
  498. }
  499. function u(t, i) {
  500. return t.val - i.val
  501. }
  502. function a(t, i) {
  503. return i.val - t.val
  504. }
  505. function f(t) {
  506. var i = s.ofContent(t, !0)
  507. , n = s.ofViewport(t, !0)
  508. , e = i.width - n.width
  509. , o = i.height - n.height;
  510. this.content = i,
  511. this.viewport = n,
  512. this.width = 0 >= e ? null : n.left / e,
  513. this.height = 0 >= o ? null : n.top / o,
  514. this.left = n.left,
  515. this.top = n.top,
  516. this.right = i.right - n.right,
  517. this.bottom = i.bottom - n.bottom
  518. }
  519. function p(t) {
  520. this.el = t || window
  521. }
  522. function d(t, i) {
  523. this.context = t,
  524. this.viewport = i,
  525. this.init()
  526. }
  527. function v(t, i, n, e) {
  528. this.context = new l(t,i),
  529. this.property = n,
  530. this.descending = e,
  531. this.init()
  532. }
  533. function w(t) {
  534. t && t !== window && t !== document ? (this.context = t,
  535. this.$autoTarget = g(t)) : this.context = window,
  536. this.init()
  537. }
  538. var g = jQuery
  539. , m = g(window)
  540. , b = g(document)
  541. , T = g.extend
  542. , y = g.isFunction
  543. , k = Math.max
  544. , V = Math.min
  545. , E = Math.round
  546. , x = function() {
  547. var t = {}
  548. , i = 1;
  549. return function(n) {
  550. return n ? (t[n] || (t[n] = i,
  551. i += 1),
  552. t[n]) : 0
  553. }
  554. }();
  555. T(s.prototype, {
  556. equals: function(t) {
  557. return r(this, t, ["left", "top", "width", "height"])
  558. },
  559. area: function() {
  560. return this.width * this.height
  561. },
  562. relativeTo: function(t) {
  563. return new s(this.left - t.left,this.top - t.top,this.width,this.height)
  564. },
  565. intersection: function(t) {
  566. if (!i(t, s))
  567. return null;
  568. var n = k(this.left, t.left)
  569. , e = V(this.right, t.right)
  570. , o = k(this.top, t.top)
  571. , r = V(this.bottom, t.bottom)
  572. , h = e - n
  573. , l = r - o;
  574. return h >= 0 && l >= 0 ? new s(n,o,h,l) : null
  575. },
  576. envelope: function(t) {
  577. if (!i(t, s))
  578. return this;
  579. var n = V(this.left, t.left)
  580. , e = k(this.right, t.right)
  581. , o = V(this.top, t.top)
  582. , r = k(this.bottom, t.bottom)
  583. , h = e - n
  584. , l = r - o;
  585. return new s(n,o,h,l)
  586. }
  587. }),
  588. T(s, {
  589. ofContent: function(t, i) {
  590. return t && t !== document && t !== window ? i ? new s(0,0,t.scrollWidth,t.scrollHeight) : new s(t.offsetLeft - t.scrollLeft,t.offsetTop - t.scrollTop,t.scrollWidth,t.scrollHeight) : new s(0,0,b.width(),b.height())
  591. },
  592. ofViewport: function(t, i) {
  593. return t && t !== document && t !== window ? i ? new s(t.scrollLeft,t.scrollTop,t.clientWidth,t.clientHeight) : new s(t.offsetLeft,t.offsetTop,t.clientWidth,t.clientHeight) : new s(m.scrollLeft(),m.scrollTop(),m.width(),m.height())
  594. },
  595. ofElement: function(t) {
  596. var i = g(t);
  597. if (!i.is(":visible"))
  598. return null;
  599. var n = i.offset();
  600. return new s(n.left,n.top,i.outerWidth(),i.outerHeight())
  601. }
  602. }),
  603. T(h.prototype, {
  604. equals: function(t) {
  605. return this.fracsEqual(t) && this.rectsEqual(t)
  606. },
  607. fracsEqual: function(t) {
  608. return r(this, t, ["visible", "viewport", "possible"])
  609. },
  610. rectsEqual: function(t) {
  611. return r(this.rects, t.rects, ["document", "element", "viewport"])
  612. }
  613. }),
  614. T(h, {
  615. of: function(t, i) {
  616. var e, o, r;
  617. return t = n(t) && s.ofElement(t) || t,
  618. i = n(i) && s.ofViewport(i) || i || s.ofViewport(),
  619. t instanceof s && (e = t.intersection(i)) ? (o = e.area(),
  620. r = V(t.width, i.width) * V(t.height, i.height),
  621. new h(o / t.area(),o / i.area(),o / r,{
  622. document: e,
  623. element: e.relativeTo(t),
  624. viewport: e.relativeTo(i)
  625. })) : new h
  626. }
  627. });
  628. var q = ["width", "height", "left", "right", "top", "bottom"]
  629. , S = ["possible", "visible", "viewport"];
  630. T(l.prototype, {
  631. sorted: function(t, i) {
  632. var n = this.viewport;
  633. return g.map(this.els, function(i) {
  634. return {
  635. el: i,
  636. val: c(i, n, t)
  637. }
  638. }).sort(i ? a : u)
  639. },
  640. best: function(t, i) {
  641. return this.els.length ? this.sorted(t, i)[0] : null
  642. }
  643. }),
  644. T(f.prototype, {
  645. equals: function(t) {
  646. return r(this, t, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  647. }
  648. }),
  649. T(p.prototype, {
  650. equals: function(t) {
  651. return r(this, t, ["el"])
  652. },
  653. scrollState: function() {
  654. return new f(this.el)
  655. },
  656. scrollTo: function(t, i, n) {
  657. var e = g(this.el === window ? "html,body" : this.el);
  658. t = t || 0,
  659. i = i || 0,
  660. n = isNaN(n) ? 1e3 : n,
  661. e.stop(!0).animate({
  662. scrollLeft: t,
  663. scrollTop: i
  664. }, n)
  665. },
  666. scroll: function(t, i, n) {
  667. var e = this.el === window ? m : g(this.el);
  668. t = t || 0,
  669. i = i || 0,
  670. this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n)
  671. },
  672. scrollToRect: function(t, i, n, e) {
  673. i = i || 0,
  674. n = n || 0,
  675. this.scrollTo(t.left - i, t.top - n, e)
  676. },
  677. scrollToElement: function(t, i, n, e) {
  678. var o = s.ofElement(t).relativeTo(s.ofContent(this.el));
  679. this.scrollToRect(o, i, n, e)
  680. }
  681. });
  682. var C = {
  683. init: function() {
  684. this.callbacks = g.Callbacks("memory unique"),
  685. this.currVal = null,
  686. this.prevVal = null,
  687. this.checkProxy = g.proxy(this.check, this),
  688. this.autoCheck()
  689. },
  690. bind: function(t) {
  691. this.callbacks.add(t)
  692. },
  693. unbind: function(t) {
  694. t ? this.callbacks.remove(t) : this.callbacks.empty()
  695. },
  696. trigger: function() {
  697. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  698. },
  699. check: function(t) {
  700. var i = this.updatedValue(t);
  701. return void 0 !== i && (this.prevVal = this.currVal,
  702. this.currVal = i,
  703. this.trigger(),
  704. !0)
  705. },
  706. $autoTarget: m,
  707. autoEvents: "load resize scroll",
  708. autoCheck: function(t) {
  709. this.$autoTarget[t === !1 ? "off" : "on"](this.autoEvents, this.checkProxy)
  710. }
  711. };
  712. T(d.prototype, C, {
  713. updatedValue: function() {
  714. var t = h.of(this.context, this.viewport);
  715. return this.currVal && this.currVal.equals(t) ? void 0 : t
  716. }
  717. }),
  718. T(v.prototype, C, {
  719. updatedValue: function() {
  720. var t = this.context.best(this.property, this.descending);
  721. return t && (t = t.val > 0 ? t.el : null,
  722. this.currVal !== t) ? t : void 0
  723. }
  724. }),
  725. T(w.prototype, C, {
  726. updatedValue: function() {
  727. var t = new f(this.context);
  728. return this.currVal && this.currVal.equals(t) ? void 0 : t
  729. }
  730. });
  731. var L = function(t, i) {
  732. var n = [].slice
  733. , e = jQuery
  734. , o = e.extend
  735. , r = e.isFunction
  736. , s = o({}, i)
  737. , h = function(i, n, o, s) {
  738. return o = r(o) ? o.apply(i, n) : o,
  739. r(s[o]) ? s[o].apply(i, n) : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
  740. }
  741. , l = function() {
  742. return h(this, n.call(arguments), s.defaultStatic, l)
  743. }
  744. , c = function(t) {
  745. return r(c[t]) ? c[t].apply(this, n.call(arguments, 1)) : h(this, n.call(arguments), s.defaultMethod, c)
  746. }
  747. , u = function(t) {
  748. t && (o(l, t.statics),
  749. o(c, t.methods)),
  750. l.modplug = u
  751. };
  752. u.prev = {
  753. statics: e[t],
  754. methods: e.fn[t]
  755. },
  756. u(i),
  757. e[t] = l,
  758. e.fn[t] = c
  759. }
  760. , M = "fracs";
  761. L(M, {
  762. statics: {
  763. version: "0.15.0",
  764. Rect: s,
  765. Fractions: h,
  766. Group: l,
  767. ScrollState: f,
  768. Viewport: p,
  769. FracsCallbacks: d,
  770. GroupCallbacks: v,
  771. ScrollStateCallbacks: w,
  772. fracs: function(t, i) {
  773. return h.of(t, i)
  774. }
  775. },
  776. methods: {
  777. content: function(t) {
  778. return this.length ? s.ofContent(this[0], t) : null
  779. },
  780. envelope: function() {
  781. return o(this, function(t) {
  782. var i = s.ofElement(this);
  783. return t ? t.envelope(i) : i
  784. })
  785. },
  786. fracs: function(i, n, o) {
  787. t(i, "string") || (o = n,
  788. n = i,
  789. i = null),
  790. y(n) || (o = n,
  791. n = null),
  792. o = e(o);
  793. var r = M + ".fracs." + x(o);
  794. return "unbind" === i ? this.each(function() {
  795. var t = g(this).data(r);
  796. t && t.unbind(n)
  797. }) : "check" === i ? this.each(function() {
  798. var t = g(this).data(r);
  799. t && t.check()
  800. }) : y(n) ? this.each(function() {
  801. var t = g(this)
  802. , i = t.data(r);
  803. i || (i = new d(this,o),
  804. t.data(r, i)),
  805. i.bind(n)
  806. }) : this.length ? h.of(this[0], o) : null
  807. },
  808. intersection: function() {
  809. return o(this, function(t) {
  810. var i = s.ofElement(this);
  811. return t ? t.intersection(i) : i
  812. })
  813. },
  814. max: function(t, i, n) {
  815. return y(i) || (n = i,
  816. i = null),
  817. n = e(n),
  818. i ? (new v(this,n,t,!0).bind(i),
  819. this) : this.pushStack(new l(this,n).best(t, !0).el)
  820. },
  821. min: function(t, i, n) {
  822. return y(i) || (n = i,
  823. i = null),
  824. n = e(n),
  825. i ? (new v(this,n,t).bind(i),
  826. this) : this.pushStack(new l(this,n).best(t).el)
  827. },
  828. rect: function() {
  829. return this.length ? s.ofElement(this[0]) : null
  830. },
  831. scrollState: function(i, n) {
  832. var e = M + ".scrollState";
  833. return t(i, "string") || (n = i,
  834. i = null),
  835. "unbind" === i ? this.each(function() {
  836. var t = g(this).data(e);
  837. t && t.unbind(n)
  838. }) : "check" === i ? this.each(function() {
  839. var t = g(this).data(e);
  840. t && t.check()
  841. }) : y(n) ? this.each(function() {
  842. var t = g(this)
  843. , i = t.data(e);
  844. i || (i = new w(this),
  845. t.data(e, i)),
  846. i.bind(n)
  847. }) : this.length ? new f(this[0]) : null
  848. },
  849. scroll: function(t, i, n) {
  850. return this.each(function() {
  851. new p(this).scroll(t, i, n)
  852. })
  853. },
  854. scrollTo: function(t, i, n, o) {
  855. return g.isNumeric(t) && (o = n,
  856. n = i,
  857. i = t,
  858. t = null),
  859. t = e(t),
  860. this.each(function() {
  861. t ? new p(this).scrollToElement(t, i, n, o) : new p(this).scrollTo(i, n, o)
  862. })
  863. },
  864. scrollToThis: function(t, i, n, o) {
  865. return o = new p(e(o)),
  866. o.scrollToElement(this[0], t, i, n),
  867. this
  868. },
  869. softLink: function(t, i, n, o) {
  870. return o = new p(e(o)),
  871. this.filter("a[href^=#]").each(function() {
  872. var e = g(this);
  873. e.on("click", function() {
  874. o.scrollToElement(g(e.attr("href"))[0], t, i, n)
  875. })
  876. })
  877. },
  878. sort: function(i, n, o) {
  879. return t(n, "boolean") || (o = n,
  880. n = null),
  881. o = e(o),
  882. this.pushStack(g.map(new l(this,o).sorted(i, !n), function(t) {
  883. return t.el
  884. }))
  885. },
  886. viewport: function(t) {
  887. return this.length ? s.ofViewport(this[0], t) : null
  888. }
  889. },
  890. defaultStatic: "fracs",
  891. defaultMethod: "fracs"
  892. })
  893. }();
  894. if ("undefined" == typeof jQuery)
  895. throw new Error("Bootstrap's JavaScript requires jQuery");
  896. +function(t) {
  897. "use strict";
  898. function e(e) {
  899. return this.each(function() {
  900. var o = t(this)
  901. , s = o.data("bs.tooltip")
  902. , n = "object" == typeof e && e;
  903. (s || "destroy" != e) && (s || o.data("bs.tooltip", s = new i(this,n)),
  904. "string" == typeof e && s[e]())
  905. })
  906. }
  907. var i = function(t, e) {
  908. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  909. this.init("tooltip", t, e)
  910. };
  911. i.VERSION = "3.2.0",
  912. i.DEFAULTS = {
  913. animation: !0,
  914. placement: "top",
  915. selector: !1,
  916. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  917. trigger: "hover focus",
  918. title: "",
  919. delay: 0,
  920. html: !1,
  921. container: !1,
  922. viewport: {
  923. selector: "body",
  924. padding: 0
  925. }
  926. },
  927. i.prototype.init = function(e, i, o) {
  928. this.enabled = !0,
  929. this.type = e,
  930. this.$element = t(i),
  931. this.options = this.getOptions(o),
  932. this.$viewport = this.options.viewport && t(this.options.viewport.selector || this.options.viewport);
  933. for (var s = this.options.trigger.split(" "), n = s.length; n--; ) {
  934. var r = s[n];
  935. if ("click" == r)
  936. this.$element.on("click." + this.type, this.options.selector, t.proxy(this.toggle, this));
  937. else if ("manual" != r) {
  938. var a = "hover" == r ? "mouseenter" : "focusin"
  939. , l = "hover" == r ? "mouseleave" : "focusout";
  940. this.$element.on(a + "." + this.type, this.options.selector, t.proxy(this.enter, this)),
  941. this.$element.on(l + "." + this.type, this.options.selector, t.proxy(this.leave, this))
  942. }
  943. }
  944. this.options.selector ? this._options = t.extend({}, this.options, {
  945. trigger: "manual",
  946. selector: ""
  947. }) : this.fixTitle()
  948. }
  949. ,
  950. i.prototype.getDefaults = function() {
  951. return i.DEFAULTS
  952. }
  953. ,
  954. i.prototype.getOptions = function(e) {
  955. return e = t.extend({}, this.getDefaults(), this.$element.data(), e),
  956. e.delay && "number" == typeof e.delay && (e.delay = {
  957. show: e.delay,
  958. hide: e.delay
  959. }),
  960. e
  961. }
  962. ,
  963. i.prototype.getDelegateOptions = function() {
  964. var e = {}
  965. , i = this.getDefaults();
  966. return this._options && t.each(this._options, function(t, o) {
  967. i[t] != o && (e[t] = o)
  968. }),
  969. e
  970. }
  971. ,
  972. i.prototype.enter = function(e) {
  973. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  974. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  975. t(e.currentTarget).data("bs." + this.type, i)),
  976. clearTimeout(i.timeout),
  977. i.hoverState = "in",
  978. i.options.delay && i.options.delay.show ? void (i.timeout = setTimeout(function() {
  979. // "in" == i.hoverState && i.show()
  980. }, i.options.delay.show)) : i.show()
  981. }
  982. ,
  983. i.prototype.leave = function(e) {
  984. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  985. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  986. t(e.currentTarget).data("bs." + this.type, i)),
  987. clearTimeout(i.timeout),
  988. i.hoverState = "out",
  989. i.options.delay && i.options.delay.hide ? void (i.timeout = setTimeout(function() {
  990. "out" == i.hoverState && i.hide()
  991. }, i.options.delay.hide)) : i.hide()
  992. }
  993. ,
  994. i.prototype.show = function() {
  995. var e = t.Event("show.bs." + this.type);
  996. if (this.hasContent() && this.enabled) {
  997. this.$element.trigger(e);
  998. var i = t.contains(document.documentElement, this.$element[0]);
  999. if (e.isDefaultPrevented() || !i)
  1000. return;
  1001. var o = this
  1002. , s = this.tip()
  1003. , n = this.getUID(this.type);
  1004. this.setContent(),
  1005. s.attr("id", n),
  1006. this.$element.attr("aria-describedby", n),
  1007. this.options.animation && s.addClass("fade");
  1008. var r = "function" == typeof this.options.placement ? this.options.placement.call(this, s[0], this.$element[0]) : this.options.placement
  1009. , a = /\s?auto?\s?/i
  1010. , l = a.test(r);
  1011. l && (r = r.replace(a, "") || "top"),
  1012. s.detach().css({
  1013. top: 0,
  1014. left: 0,
  1015. display: "block"
  1016. }).addClass(r).data("bs." + this.type, this),
  1017. this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element);
  1018. var p = this.getPosition()
  1019. , h = s[0].offsetWidth
  1020. , f = s[0].offsetHeight;
  1021. if (l) {
  1022. var u = r
  1023. , c = this.$element.parent()
  1024. , d = this.getPosition(c);
  1025. r = "bottom" == r && p.top + p.height + f - d.scroll > d.height ? "top" : "top" == r && p.top - d.scroll - f < 0 ? "bottom" : "right" == r && p.right + h > d.width ? "left" : "left" == r && p.left - h < d.left ? "right" : r,
  1026. s.removeClass(u).addClass(r)
  1027. }
  1028. var g = this.getCalculatedOffset(r, p, h, f);
  1029. this.applyPlacement(g, r);
  1030. var y = function() {
  1031. o.$element.trigger("shown.bs." + o.type),
  1032. o.hoverState = null
  1033. };
  1034. t.support.transition && this.$tip.hasClass("fade") ? s.one("bsTransitionEnd", y).emulateTransitionEnd(150) : y()
  1035. }
  1036. }
  1037. ,
  1038. i.prototype.applyPlacement = function(e, i) {
  1039. var o = this.tip()
  1040. , s = o[0].offsetWidth
  1041. , n = o[0].offsetHeight
  1042. , r = parseInt(o.css("margin-top"), 10)
  1043. , a = parseInt(o.css("margin-left"), 10);
  1044. isNaN(r) && (r = 0),
  1045. isNaN(a) && (a = 0),
  1046. e.top = e.top + r,
  1047. e.left = e.left + a,
  1048. t.offset.setOffset(o[0], t.extend({
  1049. using: function(t) {
  1050. o.css({
  1051. top: Math.round(t.top),
  1052. left: Math.round(t.left)
  1053. })
  1054. }
  1055. }, e), 0),
  1056. o.addClass("in");
  1057. var l = o[0].offsetWidth
  1058. , p = o[0].offsetHeight;
  1059. "top" == i && p != n && (e.top = e.top + n - p);
  1060. var h = this.getViewportAdjustedDelta(i, e, l, p);
  1061. h.left ? e.left += h.left : e.top += h.top;
  1062. var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p
  1063. , u = h.left ? "left" : "top"
  1064. , c = h.left ? "offsetWidth" : "offsetHeight";
  1065. o.offset(e),
  1066. this.replaceArrow(f, o[0][c], u)
  1067. }
  1068. ,
  1069. i.prototype.replaceArrow = function(t, e, i) {
  1070. this.arrow().css(i, t ? 50 * (1 - t / e) + "%" : "")
  1071. }
  1072. ,
  1073. i.prototype.setContent = function() {
  1074. var t = this.tip()
  1075. , e = this.getTitle();
  1076. t.find(".tooltip-inner")[this.options.html ? "html" : "text"](e),
  1077. t.removeClass("fade in top bottom left right")
  1078. }
  1079. ,
  1080. i.prototype.hide = function() {
  1081. function e() {
  1082. "in" != i.hoverState && o.detach(),
  1083. i.$element.trigger("hidden.bs." + i.type)
  1084. }
  1085. var i = this
  1086. , o = this.tip()
  1087. , s = t.Event("hide.bs." + this.type);
  1088. if (this.$element.removeAttr("aria-describedby"),
  1089. this.$element.trigger(s),
  1090. !s.isDefaultPrevented())
  1091. return o.removeClass("in"),
  1092. t.support.transition && this.$tip.hasClass("fade") ? o.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  1093. this.hoverState = null,
  1094. this
  1095. }
  1096. ,
  1097. i.prototype.fixTitle = function() {
  1098. var t = this.$element;
  1099. (t.attr("title") || "string" != typeof t.attr("data-original-title")) && t.attr("data-original-title", t.attr("title") || "").attr("title", "")
  1100. }
  1101. ,
  1102. i.prototype.hasContent = function() {
  1103. return this.getTitle()
  1104. }
  1105. ,
  1106. i.prototype.getPosition = function(e) {
  1107. e = e || this.$element;
  1108. var i = e[0]
  1109. , o = "BODY" == i.tagName;
  1110. return t.extend({}, "function" == typeof i.getBoundingClientRect ? i.getBoundingClientRect() : null, {
  1111. scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  1112. width: o ? t(window).width() : e.outerWidth(),
  1113. height: o ? t(window).height() : e.outerHeight()
  1114. }, o ? {
  1115. top: 0,
  1116. left: 0
  1117. } : e.offset())
  1118. }
  1119. ,
  1120. i.prototype.getCalculatedOffset = function(t, e, i, o) {
  1121. return "bottom" == t ? {
  1122. top: e.top + e.height,
  1123. left: e.left + e.width / 2 - i / 2
  1124. } : "top" == t ? {
  1125. top: e.top - o,
  1126. left: e.left + e.width / 2 - i / 2
  1127. } : "left" == t ? {
  1128. top: e.top + e.height / 2 - o / 2,
  1129. left: e.left - i
  1130. } : {
  1131. top: e.top + e.height / 2 - o / 2,
  1132. left: e.left + e.width
  1133. }
  1134. }
  1135. ,
  1136. i.prototype.getViewportAdjustedDelta = function(t, e, i, o) {
  1137. var s = {
  1138. top: 0,
  1139. left: 0
  1140. };
  1141. if (!this.$viewport)
  1142. return s;
  1143. var n = this.options.viewport && this.options.viewport.padding || 0
  1144. , r = this.getPosition(this.$viewport);
  1145. if (/right|left/.test(t)) {
  1146. var a = e.top - n - r.scroll
  1147. , l = e.top + n - r.scroll + o;
  1148. a < r.top ? s.top = r.top - a : l > r.top + r.height && (s.top = r.top + r.height - l)
  1149. } else {
  1150. var p = e.left - n
  1151. , h = e.left + n + i;
  1152. p < r.left ? s.left = r.left - p : h > r.width && (s.left = r.left + r.width - h)
  1153. }
  1154. return s
  1155. }
  1156. ,
  1157. i.prototype.getTitle = function() {
  1158. var t, e = this.$element, i = this.options;
  1159. return t = e.attr("data-original-title") || ("function" == typeof i.title ? i.title.call(e[0]) : i.title)
  1160. }
  1161. ,
  1162. i.prototype.getUID = function(t) {
  1163. do
  1164. t += ~~(1e6 * Math.random());
  1165. while (document.getElementById(t));return t
  1166. }
  1167. ,
  1168. i.prototype.tip = function() {
  1169. return this.$tip = this.$tip || t(this.options.template)
  1170. }
  1171. ,
  1172. i.prototype.arrow = function() {
  1173. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  1174. }
  1175. ,
  1176. i.prototype.validate = function() {
  1177. this.$element[0].parentNode || (this.hide(),
  1178. this.$element = null,
  1179. this.options = null)
  1180. }
  1181. ,
  1182. i.prototype.enable = function() {
  1183. this.enabled = !0
  1184. }
  1185. ,
  1186. i.prototype.disable = function() {
  1187. this.enabled = !1
  1188. }
  1189. ,
  1190. i.prototype.toggleEnabled = function() {
  1191. this.enabled = !this.enabled
  1192. }
  1193. ,
  1194. i.prototype.toggle = function(e) {
  1195. var i = this;
  1196. e && (i = t(e.currentTarget).data("bs." + this.type),
  1197. i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  1198. t(e.currentTarget).data("bs." + this.type, i))),
  1199. i.tip().hasClass("in") ? i.leave(i) : i.enter(i)
  1200. }
  1201. ,
  1202. i.prototype.destroy = function() {
  1203. clearTimeout(this.timeout),
  1204. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  1205. }
  1206. ;
  1207. var o = t.fn.tooltip;
  1208. t.fn.tooltip = e,
  1209. t.fn.tooltip.Constructor = i,
  1210. t.fn.tooltip.noConflict = function() {
  1211. return t.fn.tooltip = o,
  1212. this
  1213. }
  1214. }(jQuery);
  1215. !function(e, t, n) {
  1216. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  1217. }("Keen", this, function() {
  1218. "use strict";
  1219. function Keen() {
  1220. return _init.apply(this, arguments)
  1221. }
  1222. function _init(e) {
  1223. if (_isUndefined(e))
  1224. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1225. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  1226. throw new Error("Please provide a projectId");
  1227. this.configure(e)
  1228. }
  1229. function _extend(e) {
  1230. for (var t = 1; t < arguments.length; t++)
  1231. for (var n in arguments[t])
  1232. e[n] = arguments[t][n];
  1233. return e
  1234. }
  1235. function _isUndefined(e) {
  1236. return void 0 === e
  1237. }
  1238. function _type(e) {
  1239. var t = e && e.constructor ? e.constructor.toString() : void 0;
  1240. return t ? t.match(/function (.*)\(/)[1] : "Null"
  1241. }
  1242. function _each(e, t, n) {
  1243. var r;
  1244. if (!e)
  1245. return 0;
  1246. if (n = n ? n : e,
  1247. "array" === _type(e)) {
  1248. for (r = 0; r < e.length; r++)
  1249. if (t.call(n, e[r], r, e) === !1)
  1250. return 0
  1251. } else
  1252. for (r in e)
  1253. if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1)
  1254. return 0;
  1255. return 1
  1256. }
  1257. function _parse_params(e) {
  1258. for (var t, n = {}, r = /\+/g, i = /([^&=]+)=?([^&]*)/g, o = function(e) {
  1259. return decodeURIComponent(e.replace(r, " "))
  1260. }, a = e.split("?")[1]; t = i.exec(a); )
  1261. n[o(t[1])] = o(t[2]);
  1262. return n
  1263. }
  1264. function _set_protocol(e) {
  1265. switch (e) {
  1266. case "http":
  1267. return "http";
  1268. case "auto":
  1269. return location.protocol.replace(/:/g, "");
  1270. case "https":
  1271. case void 0:
  1272. default:
  1273. return "https"
  1274. }
  1275. }
  1276. function _set_request_type(e) {
  1277. var t = e || "jsonp"
  1278. , n = !1;
  1279. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (n = !0),
  1280. null == t || "xhr" == t ? n ? "xhr" : "jsonp" : t
  1281. }
  1282. function _build_url(e) {
  1283. return this.client.endpoint + "/projects/" + this.client.projectId + e
  1284. }
  1285. function _uploadEvent(e, t, n, r, i) {
  1286. var o = _build_url.apply(this, ["/events/" + e])
  1287. , a = {};
  1288. n = n !== !1,
  1289. this.client.globalProperties && (a = this.client.globalProperties(e));
  1290. for (var c in t)
  1291. t.hasOwnProperty(c) && (a[c] = t[c]);
  1292. switch (this.client.requestType) {
  1293. case "xhr":
  1294. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, n, r, i]);
  1295. break;
  1296. case "jsonp":
  1297. var s = JSON.stringify(a)
  1298. , l = Keen.Base64.encode(s);
  1299. o = o + "?api_key=" + this.client.writeKey,
  1300. o = o + "&data=" + l,
  1301. o = o + "&modified=" + (new Date).getTime(),
  1302. _request.jsonp.apply(this, [o, this.client.writeKey, r, i]);
  1303. break;
  1304. case "beacon":
  1305. var s = JSON.stringify(a)
  1306. , l = Keen.Base64.encode(s);
  1307. o = o + "?api_key=" + encodeURIComponent(this.client.writeKey),
  1308. o = o + "&data=" + encodeURIComponent(l),
  1309. o = o + "&modified=" + encodeURIComponent((new Date).getTime()),
  1310. o += "&c=clv1",
  1311. _request.beacon.apply(this, [o, null, r, i])
  1312. }
  1313. }
  1314. Keen.prototype.configure = function(e) {
  1315. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  1316. e.protocol = _set_protocol(e.protocol),
  1317. e.requestType = _set_request_type(e.requestType),
  1318. this.client = {
  1319. projectId: e.projectId,
  1320. writeKey: e.writeKey,
  1321. readKey: e.readKey,
  1322. globalProperties: null,
  1323. endpoint: e.protocol + "://" + e.host,
  1324. requestType: e.requestType
  1325. },
  1326. Keen.trigger("client", this, e),
  1327. this.trigger("ready"),
  1328. this
  1329. }
  1330. ;
  1331. var _request = {
  1332. xhr: function(e, t, n, r, i, o, a, c) {
  1333. if (!i)
  1334. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  1335. var s = new XMLHttpRequest;
  1336. if (s.onreadystatechange = function() {
  1337. if (4 == s.readyState)
  1338. if (s.status >= 200 && s.status < 300) {
  1339. var e;
  1340. try {
  1341. e = JSON.parse(s.responseText)
  1342. } catch (e) {
  1343. Keen.log("Could not JSON parse HTTP response: " + s.responseText),
  1344. c && c(s, e)
  1345. }
  1346. a && e && a(e)
  1347. } else
  1348. Keen.log("HTTP request failed."),
  1349. c && c(s, null)
  1350. }
  1351. ,
  1352. s.open(e, t, o),
  1353. i && s.setRequestHeader("Authorization", i),
  1354. r && s.setRequestHeader("Content-Type", "application/json"),
  1355. n)
  1356. for (var l in n)
  1357. n.hasOwnProperty(l) && s.setRequestHeader(l, n[l]);
  1358. var u = r ? JSON.stringify(r) : null;
  1359. s.send(u)
  1360. },
  1361. jsonp: function(e, t, n, r) {
  1362. if (!t)
  1363. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  1364. if (t && e.indexOf("api_key") < 0) {
  1365. var i = e.indexOf("?") > 0 ? "&" : "?";
  1366. e = e + i + "api_key=" + t
  1367. }
  1368. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  1369. o += "a";
  1370. var a = !1;
  1371. window[o] = function(e) {
  1372. a = !0,
  1373. n && e && n(e),
  1374. window[o] = void 0
  1375. }
  1376. ,
  1377. e = e + "&jsonp=" + o;
  1378. var c = document.createElement("script");
  1379. c.id = "keen-jsonp",
  1380. c.src = e,
  1381. document.getElementsByTagName("head")[0].appendChild(c),
  1382. c.onreadystatechange = function() {
  1383. a === !1 && "loaded" === this.readyState && (a = !0,
  1384. r && r())
  1385. }
  1386. ,
  1387. c.onerror = function() {
  1388. a === !1 && (a = !0,
  1389. r && r())
  1390. }
  1391. },
  1392. beacon: function(e, t, n, r) {
  1393. if (t && e.indexOf("api_key") < 0) {
  1394. var i = e.indexOf("?") > 0 ? "&" : "?";
  1395. e = e + i + "api_key=" + t
  1396. }
  1397. var o = !1
  1398. , a = document.createElement("img");
  1399. a.onload = function() {
  1400. if (o = !0,
  1401. "naturalHeight"in this) {
  1402. if (this.naturalHeight + this.naturalWidth === 0)
  1403. return void this.onerror()
  1404. } else if (this.width + this.height === 0)
  1405. return void this.onerror();
  1406. n && n({
  1407. created: !0
  1408. })
  1409. }
  1410. ,
  1411. a.onerror = function() {
  1412. o = !0,
  1413. r && r()
  1414. }
  1415. ,
  1416. a.src = e
  1417. }
  1418. }
  1419. , Events = Keen.Events = {
  1420. on: function(e, t) {
  1421. this.listeners || (this.listeners = {});
  1422. var n = this.listeners[e] || (this.listeners[e] = []);
  1423. return n.push({
  1424. callback: t
  1425. }),
  1426. this
  1427. },
  1428. off: function(e, t) {
  1429. if (!e && !t)
  1430. return this.listeners = void 0,
  1431. delete this.listeners,
  1432. this;
  1433. for (var n = this.listeners[e] || [], r = n.length; r--; )
  1434. t && t == n[r].callback && this.listeners[e].splice(r, 1),
  1435. t && 0 != n.length || (this.listeners[e] = void 0,
  1436. delete this.listeners[e]);
  1437. return this
  1438. },
  1439. trigger: function(e) {
  1440. if (!this.listeners)
  1441. return this;
  1442. for (var t = Array.prototype.slice.call(arguments, 1), n = this.listeners[e] || [], r = 0; r < n.length; r++)
  1443. n[r].callback.apply(this, t);
  1444. return this
  1445. }
  1446. };
  1447. _extend(Keen.prototype, Events),
  1448. _extend(Keen, Events),
  1449. Keen.loaded = !0,
  1450. Keen.utils = {
  1451. each: _each,
  1452. extend: _extend,
  1453. parseParams: _parse_params
  1454. },
  1455. Keen.ready = function(e) {
  1456. Keen.loaded ? e() : Keen.on("ready", e)
  1457. }
  1458. ,
  1459. Keen.log = function(e) {
  1460. "object" == typeof console && console.log("[Keen IO]", e)
  1461. }
  1462. ;
  1463. var Plugins = Keen.Plugins = {};
  1464. Keen.prototype.addEvent = function() {
  1465. _uploadEvent.apply(this, arguments)
  1466. }
  1467. ,
  1468. Keen.prototype.addEventSync = function(e, t, n, r) {
  1469. _uploadEvent.apply(this, [e, t, !1, n, r])
  1470. }
  1471. ,
  1472. Keen.prototype.trackExternalLink = function(e, t, n, r, i) {
  1473. var o = e
  1474. , a = o.metaKey
  1475. , c = o.target
  1476. , s = !1
  1477. , l = function() {};
  1478. return void 0 === r && (r = 500),
  1479. "A" === c.nodeName ? l = function() {
  1480. a || s || (s = !0,
  1481. window.location = c.href)
  1482. }
  1483. : "FORM" === c.nodeName && (l = function() {
  1484. s || (s = !0,
  1485. c.submit())
  1486. }
  1487. ),
  1488. i && (l = function() {
  1489. s || (s = !0,
  1490. i())
  1491. }
  1492. ),
  1493. _uploadEvent.call(this, t, n, l, l),
  1494. setTimeout(function() {
  1495. l()
  1496. }, r),
  1497. !!a && void 0
  1498. }
  1499. ,
  1500. Keen.prototype.setGlobalProperties = function(e) {
  1501. if (!this.client)
  1502. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1503. if (!e || "function" != typeof e)
  1504. throw new Error("Invalid value for global properties: " + e);
  1505. this.client.globalProperties = e
  1506. }
  1507. ,
  1508. Keen.Base64 = {
  1509. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1510. encode: function(e) {
  1511. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map;
  1512. for (e = this.utf8.encode(e); l < e.length; )
  1513. t = e.charCodeAt(l++),
  1514. n = e.charCodeAt(l++),
  1515. r = e.charCodeAt(l++),
  1516. i = t >> 2,
  1517. o = (3 & t) << 4 | n >> 4,
  1518. a = isNaN(n) ? 64 : (15 & n) << 2 | r >> 6,
  1519. c = isNaN(n) || isNaN(r) ? 64 : 63 & r,
  1520. s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c);
  1521. return s
  1522. },
  1523. decode: function(e) {
  1524. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map, f = String.fromCharCode;
  1525. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1526. t = u.indexOf(e.charAt(l++)),
  1527. n = u.indexOf(e.charAt(l++)),
  1528. r = u.indexOf(e.charAt(l++)),
  1529. i = u.indexOf(e.charAt(l++)),
  1530. o = t << 2 | n >> 4,
  1531. a = (15 & n) << 4 | r >> 2,
  1532. c = (3 & r) << 6 | i,
  1533. s = s + (f(o) + (64 != r ? f(a) : "")) + (64 != i ? f(c) : "");
  1534. return this.utf8.decode(s)
  1535. },
  1536. utf8: {
  1537. encode: function(e) {
  1538. for (var t, n = "", r = 0, i = String.fromCharCode; r < e.length; )
  1539. t = e.charCodeAt(r++),
  1540. n += 128 > t ? i(t) : t > 127 && 2048 > t ? i(t >> 6 | 192) + i(63 & t | 128) : i(t >> 12 | 224) + i(t >> 6 & 63 | 128) + i(63 & t | 128);
  1541. return n
  1542. },
  1543. decode: function(e) {
  1544. for (var t, n, r = "", i = 0, o = String.fromCharCode; i < e.length; )
  1545. n = e.charCodeAt(i),
  1546. r += 128 > n ? [o(n), i++][0] : n > 191 && 224 > n ? [o((31 & n) << 6 | 63 & (t = e.charCodeAt(i + 1))), i += 2][0] : [o((15 & n) << 12 | (63 & (t = e.charCodeAt(i + 1))) << 6 | 63 & (c3 = e.charCodeAt(i + 2))), i += 3][0];
  1547. return r
  1548. }
  1549. }
  1550. },
  1551. "object" != typeof JSON && (JSON = {}),
  1552. function() {
  1553. function f(e) {
  1554. return 10 > e ? "0" + e : e
  1555. }
  1556. function quote(e) {
  1557. return escapable.lastIndex = 0,
  1558. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1559. var t = meta[e];
  1560. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1561. }) + '"' : '"' + e + '"'
  1562. }
  1563. function str(e, t) {
  1564. var n, r, i, o, a, c = gap, s = t[e];
  1565. switch (s && "object" == typeof s && "function" == typeof s.toJSON && (s = s.toJSON(e)),
  1566. "function" == typeof rep && (s = rep.call(t, e, s)),
  1567. typeof s) {
  1568. case "string":
  1569. return quote(s);
  1570. case "number":
  1571. return isFinite(s) ? String(s) : "null";
  1572. case "boolean":
  1573. case "null":
  1574. return String(s);
  1575. case "object":
  1576. if (!s)
  1577. return "null";
  1578. if (gap += indent,
  1579. a = [],
  1580. "[object Array]" === Object.prototype.toString.apply(s)) {
  1581. for (o = s.length,
  1582. n = 0; o > n; n += 1)
  1583. a[n] = str(n, s) || "null";
  1584. return i = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + c + "]" : "[" + a.join(",") + "]",
  1585. gap = c,
  1586. i
  1587. }
  1588. if (rep && "object" == typeof rep)
  1589. for (o = rep.length,
  1590. n = 0; o > n; n += 1)
  1591. "string" == typeof rep[n] && (r = rep[n],
  1592. i = str(r, s),
  1593. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1594. else
  1595. for (r in s)
  1596. Object.prototype.hasOwnProperty.call(s, r) && (i = str(r, s),
  1597. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1598. return i = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + c + "}" : "{" + a.join(",") + "}",
  1599. gap = c,
  1600. i
  1601. }
  1602. }
  1603. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1604. 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
  1605. }
  1606. ,
  1607. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1608. return this.valueOf()
  1609. }
  1610. );
  1611. 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 = {
  1612. "\b": "\\b",
  1613. "\t": "\\t",
  1614. "\n": "\\n",
  1615. "\f": "\\f",
  1616. "\r": "\\r",
  1617. '"': '\\"',
  1618. "\\": "\\\\"
  1619. }, rep;
  1620. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, n) {
  1621. var r;
  1622. if (gap = "",
  1623. indent = "",
  1624. "number" == typeof n)
  1625. for (r = 0; n > r; r += 1)
  1626. indent += " ";
  1627. else
  1628. "string" == typeof n && (indent = n);
  1629. if (rep = t,
  1630. t && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1631. throw new Error("JSON.stringify");
  1632. return str("", {
  1633. "": e
  1634. })
  1635. }
  1636. ),
  1637. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1638. function walk(e, t) {
  1639. var n, r, i = e[t];
  1640. if (i && "object" == typeof i)
  1641. for (n in i)
  1642. Object.prototype.hasOwnProperty.call(i, n) && (r = walk(i, n),
  1643. void 0 !== r ? i[n] = r : delete i[n]);
  1644. return reviver.call(e, t, i)
  1645. }
  1646. var j;
  1647. if (text = String(text),
  1648. cx.lastIndex = 0,
  1649. cx.test(text) && (text = text.replace(cx, function(e) {
  1650. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1651. })),
  1652. /^[\],:{}\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, "")))
  1653. return j = eval("(" + text + ")"),
  1654. "function" == typeof reviver ? walk({
  1655. "": j
  1656. }, "") : j;
  1657. throw new SyntaxError("JSON.parse")
  1658. }
  1659. )
  1660. }(),
  1661. !function(e, t, n) {
  1662. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  1663. }("domready", Keen.utils, function(e) {
  1664. function t(e) {
  1665. for (d = 1; e = r.shift(); )
  1666. e()
  1667. }
  1668. var n, r = [], i = !1, o = document, a = o.documentElement, c = a.doScroll, s = "DOMContentLoaded", l = "addEventListener", u = "onreadystatechange", f = "readyState", p = c ? /^loaded|^c/ : /^loaded|c/, d = p.test(o[f]);
  1669. return o[l] && o[l](s, n = function() {
  1670. o.removeEventListener(s, n, i),
  1671. t()
  1672. }
  1673. , i),
  1674. c && o.attachEvent(u, n = function() {
  1675. /^c/.test(o[f]) && (o.detachEvent(u, n),
  1676. t())
  1677. }
  1678. ),
  1679. e = c ? function(t) {
  1680. self != top ? d ? t() : r.push(t) : function() {
  1681. try {
  1682. a.doScroll("left")
  1683. } catch (n) {
  1684. return setTimeout(function() {
  1685. e(t)
  1686. }, 50)
  1687. }
  1688. t()
  1689. }()
  1690. }
  1691. : function(e) {
  1692. d ? e() : r.push(e)
  1693. }
  1694. });
  1695. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1696. if (loaded && cached) {
  1697. clients = cached.clients || {},
  1698. ready = cached.ready || [];
  1699. for (var instance in clients)
  1700. if (clients.hasOwnProperty(instance)) {
  1701. var client = clients[instance];
  1702. for (var method in Keen.prototype)
  1703. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1704. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1705. ,
  1706. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1707. ,
  1708. client._config && (client.configure.call(client, client._config),
  1709. delete client._config),
  1710. client._setGlobalProperties) {
  1711. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1712. client.setGlobalProperties.apply(client, globals[i]);
  1713. delete client._setGlobalProperties
  1714. }
  1715. if (client._addEvent) {
  1716. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1717. client.addEvent.apply(client, queue[i]);
  1718. delete client._addEvent
  1719. }
  1720. var callback = client._on || [];
  1721. if (client._on) {
  1722. for (var i = 0; i < callback.length; i++)
  1723. client.on.apply(client, callback[i]);
  1724. client.trigger("ready"),
  1725. delete client._on
  1726. }
  1727. }
  1728. for (var i = 0; i < ready.length; i++) {
  1729. var callback = ready[i];
  1730. Keen.on("ready", function() {
  1731. callback()
  1732. })
  1733. }
  1734. }
  1735. return Keen.loaded && setTimeout(function() {
  1736. Keen.utils.domready(function() {
  1737. Keen.trigger("ready")
  1738. })
  1739. }, 0),
  1740. Keen
  1741. });
  1742. !function() {
  1743. var t = window.analytics = window.analytics || [];
  1744. if (!t.initialize) {
  1745. if (t.invoked)
  1746. return void (window.console && console.error && console.error("Segment snippet included twice."));
  1747. t.invoked = !0,
  1748. t.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1749. t.factory = function(e) {
  1750. return function() {
  1751. var n = Array.prototype.slice.call(arguments);
  1752. return n.unshift(e),
  1753. t.push(n),
  1754. t
  1755. }
  1756. }
  1757. ;
  1758. for (var e = 0; e < t.methods.length; e++) {
  1759. var n = t.methods[e];
  1760. t[n] = t.factory(n)
  1761. }
  1762. t.load = function(t) {
  1763. var e = document.createElement("script");
  1764. e.type = "text/javascript",
  1765. e.async = !0,
  1766. e.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + t + "/analytics.min.js";
  1767. var n = document.getElementsByTagName("script")[0];
  1768. n.parentNode.insertBefore(e, n)
  1769. }
  1770. ,
  1771. t.SNIPPET_VERSION = "4.0.0"
  1772. }
  1773. }();
  1774. !function(i, e) {
  1775. "use strict";
  1776. var s = ""
  1777. , r = "?"
  1778. , o = "function"
  1779. , a = "undefined"
  1780. , n = "object"
  1781. , t = "major"
  1782. , d = "model"
  1783. , w = "name"
  1784. , l = "type"
  1785. , p = "vendor"
  1786. , m = "version"
  1787. , c = "architecture"
  1788. , u = "console"
  1789. , g = "mobile"
  1790. , f = "tablet"
  1791. , h = "smarttv"
  1792. , b = {
  1793. has: function(i, e) {
  1794. return e.toLowerCase().indexOf(i.toLowerCase()) !== -1
  1795. },
  1796. lowerize: function(i) {
  1797. return i.toLowerCase()
  1798. }
  1799. }
  1800. , y = {
  1801. rgx: function() {
  1802. for (var i, s, r, t, d, w, l, p = 0, m = arguments; p < m.length; p += 2) {
  1803. var c = m[p]
  1804. , u = m[p + 1];
  1805. if (typeof i === a) {
  1806. i = {};
  1807. for (t in u)
  1808. d = u[t],
  1809. typeof d === n ? i[d[0]] = e : i[d] = e
  1810. }
  1811. for (s = r = 0; s < c.length; s++)
  1812. if (w = c[s].exec(this.getUA())) {
  1813. for (t = 0; t < u.length; t++)
  1814. l = w[++r],
  1815. d = u[t],
  1816. typeof d === n && d.length > 0 ? 2 == d.length ? typeof d[1] == o ? i[d[0]] = d[1].call(this, l) : i[d[0]] = d[1] : 3 == d.length ? typeof d[1] !== o || d[1].exec && d[1].test ? i[d[0]] = l ? l.replace(d[1], d[2]) : e : i[d[0]] = l ? d[1].call(this, l, d[2]) : e : 4 == d.length && (i[d[0]] = l ? d[3].call(this, l.replace(d[1], d[2])) : e) : i[d] = l ? l : e;
  1817. break
  1818. }
  1819. if (w)
  1820. break
  1821. }
  1822. return i
  1823. },
  1824. str: function(i, s) {
  1825. for (var o in s)
  1826. if (typeof s[o] === n && s[o].length > 0) {
  1827. for (var a = 0; a < s[o].length; a++)
  1828. if (b.has(s[o][a], i))
  1829. return o === r ? e : o
  1830. } else if (b.has(s[o], i))
  1831. return o === r ? e : o;
  1832. return i
  1833. }
  1834. }
  1835. , v = {
  1836. browser: {
  1837. oldsafari: {
  1838. major: {
  1839. 1: ["/8", "/1", "/3"],
  1840. 2: "/4",
  1841. "?": "/"
  1842. },
  1843. version: {
  1844. "1.0": "/8",
  1845. 1.2: "/1",
  1846. 1.3: "/3",
  1847. "2.0": "/412",
  1848. "2.0.2": "/416",
  1849. "2.0.3": "/417",
  1850. "2.0.4": "/419",
  1851. "?": "/"
  1852. }
  1853. }
  1854. },
  1855. device: {
  1856. sprint: {
  1857. model: {
  1858. "Evo Shift 4G": "7373KT"
  1859. },
  1860. vendor: {
  1861. HTC: "APA",
  1862. Sprint: "Sprint"
  1863. }
  1864. }
  1865. },
  1866. os: {
  1867. windows: {
  1868. version: {
  1869. ME: "4.90",
  1870. "NT 3.11": "NT3.51",
  1871. "NT 4.0": "NT4.0",
  1872. 2e3: "NT 5.0",
  1873. XP: ["NT 5.1", "NT 5.2"],
  1874. Vista: "NT 6.0",
  1875. 7: "NT 6.1",
  1876. 8: "NT 6.2",
  1877. 8.1: "NT 6.3",
  1878. RT: "ARM"
  1879. }
  1880. }
  1881. }
  1882. }
  1883. , k = {
  1884. browser: [[/(opera\smini)\/((\d+)?[\w\.-]+)/i, /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, /(opera).+version\/((\d+)?[\w\.]+)/i, /(opera)[\/\s]+((\d+)?[\w\.]+)/i], [w, m, t], [/\s(opr)\/((\d+)?[\w\.]+)/i], [[w, "Opera"], m, t], [/(kindle)\/((\d+)?[\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i, /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i, /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i, /(rekonq)((?:\/)[\w\.]+)*/i, /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i], [w, m, t], [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i], [[w, "IE"], m, t], [/(yabrowser)\/((\d+)?[\w\.]+)/i], [[w, "Yandex"], m, t], [/(comodo_dragon)\/((\d+)?[\w\.]+)/i], [[w, /_/g, " "], m, t], [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i], [w, m, t], [/(dolfin)\/((\d+)?[\w\.]+)/i], [[w, "Dolphin"], m, t], [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i], [[w, "Chrome"], m, t], [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i], [m, t, [w, "Mobile Safari"]], [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i], [m, t, w], [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i], [w, [t, y.str, v.browser.oldsafari.major], [m, y.str, v.browser.oldsafari.version]], [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i], [w, m, t], [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i], [[w, "Netscape"], m, t], [/(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i, /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i, /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i, /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i, /(links)\s\(((\d+)?[\w\.]+)/i, /(gobrowser)\/?((\d+)?[\w\.]+)*/i, /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i, /(mosaic)[\/\s]((\d+)?[\w\.]+)/i], [w, m, t], [/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i], [w, m, t], [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i], [w, m], [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i, /(clementine|music player daemon)\s((\d+)[\w\.-]+)/i, /(lg player|nexplayer)\s((\d+)[\d\.]+)/i, /player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(nexplayer)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(flrp)\/((\d+)[\w\.-]+)/i], [[w, "Flip Player"], m, t], [/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i], [w], [/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i], [w, m, t], [/(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i, /(lavf)((\d+)[\d\.]+)/i], [w, m, t], [/(htc_one_s)\/((\d+)[\d\.]+)/i], [[w, /_/g, " "], m, t], [/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i], [w, m], [/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i], [w, m, t], [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i], [w], [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i], [w, m, t], [/(nokia\d+)\/((\d+)[\w\.-]+)/i], [w, m, t], [/\s(songbird)\/((\d+)[\w\.-]+)/i], [w, m, t], [/(winamp)3 version ((\d+)[\w\.-]+)/i, /(winamp)\s((\d+)[\w\.-]+)/i, /(winamp)mpeg\/((\d+)[\w\.-]+)/i], [w, m, t], [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i], [w], [/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i], [w, m, t], [/(smp)((\d+)[\d\.]+)/i], [w, m, t], [/(vlc) media player - version ((\d+)[\w\.]+)/i, /(vlc)\/((\d+)[\w\.-]+)/i, /(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i, /(foobar2000)\/((\d+)[\d\.]+)/i, /(itunes)\/((\d+)[\d\.]+)/i], [w, m, t], [/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i], [[w, /-/g, " "], m, t], [/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i], [m, t, [w, "Windows"]], [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i], [w, m, t], [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i], [[w, "rad.io"], m, t]],
  1885. cpu: [[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i], [[c, "amd64"]], [/(ia32(?=;))/i], [[c, b.lowerize]], [/((?:i[346]|x)86)[;\)]/i], [[c, "ia32"]], [/windows\s(ce|mobile);\sppc;/i], [[c, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i], [[c, /ower/, "", b.lowerize]], [/(sun4\w)[;\)]/i], [[c, "sparc"]], [/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i], [c, b.lowerize]],
  1886. device: [[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i], [d, p, [l, f]], [/applecoremedia\/[\w\.]+ \((ipad)/], [d, [p, "Apple"], [l, f]], [/(apple\s{0,1}tv)/i], [[d, "Apple TV"], [p, "Apple"]], [/(hp).+(touchpad)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i], [p, d, [l, f]], [/\((ip[honed|\s\w*]+);.+(apple)/i], [d, p, [l, g]], [/\((ip[honed|\s\w*]+);/i], [d, [p, "Apple"], [l, g]], [/(blackberry)[\s-]?(\w+)/i, /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i, /(hp)\s([\w\s]+\w)/i, /(asus)-?(\w+)/i], [p, d, [l, g]], [/\((bb10);\s(\w+)/i], [[p, "BlackBerry"], d, [l, g]], [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i], [[p, "Asus"], d, [l, f]], [/(sony)\s(tablet\s[ps])/i], [p, d, [l, f]], [/(nintendo)\s([wids3u]+)/i], [p, d, [l, u]], [/((playstation)\s[3portablevi]+)/i], [[p, "Sony"], d, [l, u]], [/(sprint\s(\w+))/i], [[p, y.str, v.device.sprint.vendor], [d, y.str, v.device.sprint.model], [l, g]], [/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, /(zte)-(\w+)*/i, /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i], [p, [d, /_/g, " "], [l, g]], [/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i, /(mot)[\s-]?(\w+)*/i], [[p, "Motorola"], d, [l, g]], [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i], [[p, "Motorola"], d, [l, f]], [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i], [[p, "Samsung"], d, [l, f]], [/((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i, /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i, /sec-((sgh\w+))/i], [[p, "Samsung"], d, [l, g]], [/(sie)-(\w+)*/i], [[p, "Siemens"], d, [l, g]], [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i], [[p, "Nokia"], d, [l, g]], [/android\s3\.[\s\w-;]{10}((a\d{3}))/i], [[p, "Acer"], d, [l, f]], [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i], [[p, "LG"], d, [l, f]], [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i], [[p, "LG"], d, [l, g]], [/android.+((ideatab[a-z0-9\-\s]+))/i], [[p, "Lenovo"], d, [l, f]], [/(lg) netcast\.tv/i], [p, [l, h]], [/(mobile|tablet);.+rv\:.+gecko\//i], [l, p, d]],
  1887. engine: [[/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i], [w, m], [/rv\:([\w\.]+).*(gecko)/i], [m, w]],
  1888. os: [[/microsoft\s(windows)\s(vista|xp)/i], [w, m], [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i], [w, [m, y.str, v.os.windows.version]], [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i], [[w, "Windows"], [m, y.str, v.os.windows.version]], [/\((bb)(10);/i], [[w, "BlackBerry"], m], [/(blackberry)\w*\/?([\w\.]+)*/i, /(tizen)\/([\w\.]+)/i, /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i], [w, m], [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i], [[w, "Symbian"], m], [/mozilla.+\(mobile;.+gecko.+firefox/i], [[w, "Firefox OS"], m], [/(nintendo|playstation)\s([wids3portablevu]+)/i, /(mint)[\/\s\(]?(\w+)*/i, /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i, /(hurd|linux)\s?([\w\.]+)*/i, /(gnu)\s?([\w\.]+)*/i], [w, m], [/(cros)\s[\w]+\s([\w\.]+\w)/i], [[w, "Chromium OS"], m], [/(sunos)\s?([\w\.]+\d)*/i], [[w, "Solaris"], m], [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i], [w, m], [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i], [[w, "iOS"], [m, /_/g, "."]], [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i], [w, [m, /_/g, "."]], [/(haiku)\s(\w+)/i, /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i, /(unix)\s?([\w\.]+)*/i], [w, m]]
  1889. }
  1890. , x = function(e) {
  1891. var r = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s);
  1892. return this instanceof x ? (this.getBrowser = function() {
  1893. return y.rgx.apply(this, k.browser)
  1894. }
  1895. ,
  1896. this.getCPU = function() {
  1897. return y.rgx.apply(this, k.cpu)
  1898. }
  1899. ,
  1900. this.getDevice = function() {
  1901. return y.rgx.apply(this, k.device)
  1902. }
  1903. ,
  1904. this.getEngine = function() {
  1905. return y.rgx.apply(this, k.engine)
  1906. }
  1907. ,
  1908. this.getOS = function() {
  1909. return y.rgx.apply(this, k.os)
  1910. }
  1911. ,
  1912. this.getResult = function() {
  1913. return {
  1914. ua: this.getUA(),
  1915. browser: this.getBrowser(),
  1916. engine: this.getEngine(),
  1917. os: this.getOS(),
  1918. device: this.getDevice(),
  1919. cpu: this.getCPU()
  1920. }
  1921. }
  1922. ,
  1923. this.getUA = function() {
  1924. return r
  1925. }
  1926. ,
  1927. this.setUA = function(i) {
  1928. return r = i,
  1929. this
  1930. }
  1931. ,
  1932. void this.setUA(r)) : new x(e).getResult()
  1933. };
  1934. if (typeof exports !== a)
  1935. typeof module !== a && module.exports && (exports = module.exports = x),
  1936. exports.UAParser = x;
  1937. else if (i.UAParser = x,
  1938. typeof define === o && define.amd && define(function() {
  1939. return x
  1940. }),
  1941. typeof i.jQuery !== a) {
  1942. var A = i.jQuery
  1943. , _ = new x;
  1944. A.ua = _.getResult(),
  1945. A.ua.get = function() {
  1946. return _.getUA()
  1947. }
  1948. ,
  1949. A.ua.set = function(i) {
  1950. _.setUA(i);
  1951. var e = _.getResult();
  1952. for (var s in e)
  1953. A.ua[s] = e[s]
  1954. }
  1955. }
  1956. }(this);
  1957. window.Modernizr = function(n, e, t) {
  1958. function o(n) {
  1959. d.cssText = n
  1960. }
  1961. function r(n, e) {
  1962. return typeof n === e
  1963. }
  1964. var i, c, u, a = "2.8.2", f = {}, s = e.documentElement, l = "modernizr", p = e.createElement(l), d = p.style, y = ({}.toString,
  1965. {}), w = [], b = w.slice, v = {}.hasOwnProperty;
  1966. u = r(v, "undefined") || r(v.call, "undefined") ? function(n, e) {
  1967. return e in n && r(n.constructor.prototype[e], "undefined")
  1968. }
  1969. : function(n, e) {
  1970. return v.call(n, e)
  1971. }
  1972. ,
  1973. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1974. var e = this;
  1975. if ("function" != typeof e)
  1976. throw new TypeError;
  1977. var t = b.call(arguments, 1)
  1978. , o = function() {
  1979. if (this instanceof o) {
  1980. var r = function() {};
  1981. r.prototype = e.prototype;
  1982. var i = new r
  1983. , c = e.apply(i, t.concat(b.call(arguments)));
  1984. return Object(c) === c ? c : i
  1985. }
  1986. return e.apply(n, t.concat(b.call(arguments)))
  1987. };
  1988. return o
  1989. }
  1990. ),
  1991. y.webgl = function() {
  1992. return !!n.WebGLRenderingContext
  1993. }
  1994. ;
  1995. for (var h in y)
  1996. u(y, h) && (c = h.toLowerCase(),
  1997. f[c] = y[h](),
  1998. w.push((f[c] ? "" : "no-") + c));
  1999. return f.addTest = function(n, e) {
  2000. if ("object" == typeof n)
  2001. for (var o in n)
  2002. u(n, o) && f.addTest(o, n[o]);
  2003. else {
  2004. if (n = n.toLowerCase(),
  2005. f[n] !== t)
  2006. return f;
  2007. e = "function" == typeof e ? e() : e,
  2008. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (e ? "" : "no-") + n),
  2009. f[n] = e
  2010. }
  2011. return f
  2012. }
  2013. ,
  2014. o(""),
  2015. p = i = null,
  2016. f._version = a,
  2017. f
  2018. }(this, this.document);
  2019. !function(e, t, a) {
  2020. "use strict";
  2021. function n(t, h, m) {
  2022. function H(a) {
  2023. var n = 0
  2024. , i = Ee.length;
  2025. if (Ce.old = e.extend({}, Ce),
  2026. Ie = we ? 0 : be[ge.horizontal ? "width" : "height"](),
  2027. ke = Be[ge.horizontal ? "width" : "height"](),
  2028. ze = we ? t : Pe[ge.horizontal ? "outerWidth" : "outerHeight"](),
  2029. Ee.length = 0,
  2030. Ce.start = 0,
  2031. Ce.end = q(ze - Ie, 0),
  2032. Re) {
  2033. n = Ne.length,
  2034. qe = Pe.children(ge.itemSelector),
  2035. Ne.length = 0;
  2036. var r, s = c(Pe, ge.horizontal ? "paddingLeft" : "paddingTop"), o = c(Pe, ge.horizontal ? "paddingRight" : "paddingBottom"), l = "border-box" === e(qe).css("boxSizing"), u = "none" !== qe.css("float"), f = 0, v = qe.length - 1;
  2037. ze = 0,
  2038. qe.each(function(t, a) {
  2039. var n = e(a)
  2040. , i = a.getBoundingClientRect()
  2041. , l = E(ge.horizontal ? i.width || i.right - i.left : i.height || i.bottom - i.top)
  2042. , d = c(n, ge.horizontal ? "marginLeft" : "marginTop")
  2043. , p = c(n, ge.horizontal ? "marginRight" : "marginBottom")
  2044. , h = l + d + p
  2045. , m = !d || !p
  2046. , g = {};
  2047. g.el = a,
  2048. g.size = m ? l : h,
  2049. g.half = g.size / 2,
  2050. g.start = ze + (m ? d : 0),
  2051. g.center = g.start - E(Ie / 2 - g.size / 2),
  2052. g.end = g.start - Ie + g.size,
  2053. t || (ze += s),
  2054. ze += h,
  2055. ge.horizontal || u || p && d && t > 0 && (ze -= N(d, p)),
  2056. t === v && (g.end += o,
  2057. ze += o,
  2058. f = m ? p : 0),
  2059. Ne.push(g),
  2060. r = g
  2061. }),
  2062. Pe[0].style[ge.horizontal ? "width" : "height"] = (l ? ze : ze - s - o) + "px",
  2063. ze -= f,
  2064. Ne.length ? (Ce.start = Ne[0][Me ? "center" : "start"],
  2065. Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start) : Ce.start = Ce.end = 0
  2066. }
  2067. if (Ce.center = E(Ce.end / 2 + Ce.start / 2),
  2068. Q(),
  2069. Se.length && ke > 0 && (ge.dynamicHandle ? (Te = Ce.start === Ce.end ? ke : E(ke * Ie / ze),
  2070. Te = d(Te, ge.minHandleSize, ke),
  2071. Se[0].style[ge.horizontal ? "width" : "height"] = Te + "px") : Te = Se[ge.horizontal ? "outerWidth" : "outerHeight"](),
  2072. xe.end = ke - Te,
  2073. it || j()),
  2074. !we && Ie > 0) {
  2075. var p = Ce.start
  2076. , h = "";
  2077. if (Re)
  2078. e.each(Ne, function(e, t) {
  2079. Me ? Ee.push(t.center) : t.start + t.size > p && p <= Ce.end && (p = t.start,
  2080. Ee.push(p),
  2081. p += Ie,
  2082. p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end))
  2083. });
  2084. else
  2085. for (; p - Ie < Ce.end; )
  2086. Ee.push(p),
  2087. p += Ie;
  2088. if (De[0] && i !== Ee.length) {
  2089. for (var m = 0; m < Ee.length; m++)
  2090. h += ge.pageBuilder.call(ye, m);
  2091. Ae = De.html(h).children(),
  2092. Ae.eq(Oe.activePage).addClass(ge.activeClass)
  2093. }
  2094. }
  2095. if (Oe.slideeSize = ze,
  2096. Oe.frameSize = Ie,
  2097. Oe.sbSize = ke,
  2098. Oe.handleSize = Te,
  2099. Re) {
  2100. a && null != ge.startAt && (W(ge.startAt),
  2101. ye[Le ? "toCenter" : "toStart"](ge.startAt));
  2102. var g = Ne[Oe.activeItem];
  2103. X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end))
  2104. } else
  2105. a ? null != ge.startAt && X(ge.startAt, 1) : X(d(Ce.dest, Ce.start, Ce.end));
  2106. pe("load")
  2107. }
  2108. function X(e, t, a) {
  2109. if (Re && at.released && !a) {
  2110. var n = $(e)
  2111. , i = e > Ce.start && e < Ce.end;
  2112. Le ? (i && (e = Ne[n.centerItem].center),
  2113. Me && ge.activateMiddle && W(n.centerItem)) : i && (e = Ne[n.firstItem].start)
  2114. }
  2115. at.init && at.slidee && ge.elasticBounds ? e > Ce.end ? e = Ce.end + (e - Ce.end) / 6 : e < Ce.start && (e = Ce.start + (e - Ce.start) / 6) : e = d(e, Ce.start, Ce.end),
  2116. et.start = +new Date,
  2117. et.time = 0,
  2118. et.from = Ce.cur,
  2119. et.to = e,
  2120. et.delta = e - Ce.cur,
  2121. et.tweesing = at.tweese || at.init && !at.slidee,
  2122. et.immediate = !et.tweesing && (t || at.init && at.slidee || !ge.speed),
  2123. at.tweese = 0,
  2124. e !== Ce.dest && (Ce.dest = e,
  2125. pe("change"),
  2126. it || Y()),
  2127. K(),
  2128. Q(),
  2129. Z(),
  2130. F()
  2131. }
  2132. function Y() {
  2133. if (ye.initialized) {
  2134. if (!it)
  2135. return it = w(Y),
  2136. void (at.released && pe("moveStart"));
  2137. et.immediate ? Ce.cur = et.to : et.tweesing ? (et.tweeseDelta = et.to - Ce.cur,
  2138. x(et.tweeseDelta) < .1 ? Ce.cur = et.to : Ce.cur += et.tweeseDelta * (at.released ? ge.swingSpeed : ge.syncSpeed)) : (et.time = N(+new Date - et.start, ge.speed),
  2139. Ce.cur = et.from + et.delta * e.easing[ge.easing](et.time / ge.speed, et.time, 0, 1, ge.speed)),
  2140. et.to === Ce.cur ? (Ce.cur = et.to,
  2141. at.tweese = it = 0) : it = w(Y),
  2142. pe("move"),
  2143. we || (f ? Pe[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + -Ce.cur + "px)" : Pe[0].style[ge.horizontal ? "left" : "top"] = -E(Ce.cur) + "px"),
  2144. !it && at.released && pe("moveEnd"),
  2145. j()
  2146. }
  2147. }
  2148. function j() {
  2149. Se.length && (xe.cur = Ce.start === Ce.end ? 0 : ((at.init && !at.slidee ? Ce.dest : Ce.cur) - Ce.start) / (Ce.end - Ce.start) * xe.end,
  2150. xe.cur = d(E(xe.cur), xe.start, xe.end),
  2151. _e.hPos !== xe.cur && (_e.hPos = xe.cur,
  2152. f ? Se[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + xe.cur + "px)" : Se[0].style[ge.horizontal ? "left" : "top"] = xe.cur + "px"))
  2153. }
  2154. function F() {
  2155. Ae[0] && _e.page !== Oe.activePage && (_e.page = Oe.activePage,
  2156. Ae.removeClass(ge.activeClass).eq(Oe.activePage).addClass(ge.activeClass),
  2157. pe("activePage", _e.page))
  2158. }
  2159. function M() {
  2160. tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) || ye.stop(),
  2161. ot = at.init ? w(M) : 0,
  2162. tt.now = +new Date,
  2163. tt.pos = Ce.cur + (tt.now - tt.lastTime) / 1e3 * tt.speed,
  2164. X(at.init ? tt.pos : E(tt.pos)),
  2165. at.init || Ce.cur !== Ce.dest || pe("moveEnd"),
  2166. tt.lastTime = tt.now
  2167. }
  2168. function L(e, t, n) {
  2169. if ("boolean" === i(t) && (n = t,
  2170. t = a),
  2171. t === a)
  2172. X(Ce[e], n);
  2173. else {
  2174. if (Le && "center" !== e)
  2175. return;
  2176. var r = ye.getPos(t);
  2177. r && X(r[e], n, !Le)
  2178. }
  2179. }
  2180. function R(e) {
  2181. return null != e ? l(e) ? e >= 0 && e < Ne.length ? e : -1 : qe.index(e) : -1
  2182. }
  2183. function U(e) {
  2184. return R(l(e) && 0 > e ? e + Ne.length : e)
  2185. }
  2186. function W(e, t) {
  2187. var a = R(e);
  2188. return !(!Re || 0 > a) && ((_e.active !== a || t) && (qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2189. qe.eq(a).addClass(ge.activeClass),
  2190. _e.active = Oe.activeItem = a,
  2191. Z(),
  2192. pe("active", a)),
  2193. a)
  2194. }
  2195. function $(e) {
  2196. e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end);
  2197. var t = {}
  2198. , a = Me ? 0 : Ie / 2;
  2199. if (!we)
  2200. for (var n = 0, i = Ee.length; i > n; n++) {
  2201. if (e >= Ce.end || n === Ee.length - 1) {
  2202. t.activePage = Ee.length - 1;
  2203. break
  2204. }
  2205. if (e <= Ee[n] + a) {
  2206. t.activePage = n;
  2207. break
  2208. }
  2209. }
  2210. if (Re) {
  2211. for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
  2212. if (r === !1 && e <= Ne[c].start + Ne[c].half && (r = c),
  2213. o === !1 && e <= Ne[c].center + Ne[c].half && (o = c),
  2214. c === u - 1 || e <= Ne[c].end + Ne[c].half) {
  2215. s = c;
  2216. break
  2217. }
  2218. t.firstItem = l(r) ? r : 0,
  2219. t.centerItem = l(o) ? o : t.firstItem,
  2220. t.lastItem = l(s) ? s : t.centerItem
  2221. }
  2222. return t
  2223. }
  2224. function Q(t) {
  2225. e.extend(Oe, $(t))
  2226. }
  2227. function Z() {
  2228. var e = Ce.dest <= Ce.start
  2229. , t = Ce.dest >= Ce.end
  2230. , a = (e ? 1 : 0) | (t ? 2 : 0);
  2231. if (_e.slideePosState !== a && (_e.slideePosState = a,
  2232. Je.is("button,input") && Je.prop("disabled", e),
  2233. Ke.is("button,input") && Ke.prop("disabled", t),
  2234. Je.add(Qe)[e ? "addClass" : "removeClass"](ge.disabledClass),
  2235. Ke.add($e)[t ? "addClass" : "removeClass"](ge.disabledClass)),
  2236. _e.fwdbwdState !== a && at.released && (_e.fwdbwdState = a,
  2237. Qe.is("button,input") && Qe.prop("disabled", e),
  2238. $e.is("button,input") && $e.prop("disabled", t)),
  2239. Re && null != Oe.activeItem) {
  2240. var n = 0 === Oe.activeItem
  2241. , i = Oe.activeItem >= Ne.length - 1
  2242. , r = (n ? 1 : 0) | (i ? 2 : 0);
  2243. _e.itemsButtonState !== r && (_e.itemsButtonState = r,
  2244. Ze.is("button,input") && Ze.prop("disabled", n),
  2245. Ge.is("button,input") && Ge.prop("disabled", i),
  2246. Ze[n ? "addClass" : "removeClass"](ge.disabledClass),
  2247. Ge[i ? "addClass" : "removeClass"](ge.disabledClass))
  2248. }
  2249. }
  2250. function G(e, t, a) {
  2251. if (e = U(e),
  2252. t = U(t),
  2253. e > -1 && t > -1 && e !== t && (!a || t !== e - 1) && (a || t !== e + 1)) {
  2254. qe.eq(e)[a ? "insertAfter" : "insertBefore"](Ne[t].el);
  2255. var n = t > e ? e : a ? t : t - 1
  2256. , i = e > t ? e : a ? t + 1 : t
  2257. , r = e > t;
  2258. null != Oe.activeItem && (e === Oe.activeItem ? _e.active = Oe.activeItem = a ? r ? t + 1 : t : r ? t : t - 1 : Oe.activeItem > n && Oe.activeItem < i && (_e.active = Oe.activeItem += r ? 1 : -1)),
  2259. H()
  2260. }
  2261. }
  2262. function J(e, t) {
  2263. for (var a = 0, n = Ve[e].length; n > a; a++)
  2264. if (Ve[e][a] === t)
  2265. return a;
  2266. return -1
  2267. }
  2268. function K() {
  2269. at.released && !ye.isPaused && ye.resume()
  2270. }
  2271. function V(e) {
  2272. return E(d(e, xe.start, xe.end) / xe.end * (Ce.end - Ce.start)) + Ce.start
  2273. }
  2274. function _() {
  2275. at.history[0] = at.history[1],
  2276. at.history[1] = at.history[2],
  2277. at.history[2] = at.history[3],
  2278. at.history[3] = at.delta
  2279. }
  2280. function ee(e) {
  2281. at.released = 0,
  2282. at.source = e,
  2283. at.slidee = "slidee" === e
  2284. }
  2285. function te(t) {
  2286. var a = "touchstart" === t.type
  2287. , n = t.data.source
  2288. , i = "slidee" === n;
  2289. at.init || !a && ie(t.target) || ("handle" !== n || ge.dragHandle && xe.start !== xe.end) && (!i || (a ? ge.touchDragging : ge.mouseDragging && t.which < 2)) && (a || r(t),
  2290. ee(n),
  2291. at.init = 0,
  2292. at.$source = e(t.target),
  2293. at.touch = a,
  2294. at.pointer = a ? t.originalEvent.touches[0] : t,
  2295. at.initX = at.pointer.pageX,
  2296. at.initY = at.pointer.pageY,
  2297. at.initPos = i ? Ce.cur : xe.cur,
  2298. at.start = +new Date,
  2299. at.time = 0,
  2300. at.path = 0,
  2301. at.delta = 0,
  2302. at.locked = 0,
  2303. at.history = [0, 0, 0, 0],
  2304. at.pathToLock = i ? a ? 30 : 10 : 0,
  2305. b.on(a ? z : I, ae),
  2306. ye.pause(1),
  2307. (i ? Pe : Se).addClass(ge.draggedClass),
  2308. pe("moveStart"),
  2309. i && (rt = setInterval(_, 10)))
  2310. }
  2311. function ae(e) {
  2312. if (at.released = "mouseup" === e.type || "touchend" === e.type,
  2313. at.pointer = at.touch ? e.originalEvent[at.released ? "changedTouches" : "touches"][0] : e,
  2314. at.pathX = at.pointer.pageX - at.initX,
  2315. at.pathY = at.pointer.pageY - at.initY,
  2316. at.path = D(A(at.pathX, 2) + A(at.pathY, 2)),
  2317. at.delta = ge.horizontal ? at.pathX : at.pathY,
  2318. at.released || !(at.path < 1)) {
  2319. if (!at.init) {
  2320. if (!(ge.horizontal ? x(at.pathX) > x(at.pathY) : x(at.pathX) < x(at.pathY)))
  2321. return ne();
  2322. at.init = 1
  2323. }
  2324. r(e),
  2325. !at.locked && at.path > at.pathToLock && at.slidee && (at.locked = 1,
  2326. at.$source.on(B, s)),
  2327. at.released && (ne(),
  2328. ge.releaseSwing && at.slidee && (at.swing = (at.delta - at.history[0]) / 40 * 300,
  2329. at.delta += at.swing,
  2330. at.tweese = x(at.swing) > 10)),
  2331. X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta))
  2332. }
  2333. }
  2334. function ne() {
  2335. clearInterval(rt),
  2336. at.released = !0,
  2337. b.off(at.touch ? z : I, ae),
  2338. (at.slidee ? Pe : Se).removeClass(ge.draggedClass),
  2339. setTimeout(function() {
  2340. at.$source.off(B, s)
  2341. }),
  2342. Ce.cur === Ce.dest && at.init && pe("moveEnd"),
  2343. ye.resume(1),
  2344. at.init = 0
  2345. }
  2346. function ie(t) {
  2347. return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive)
  2348. }
  2349. function re() {
  2350. ye.stop(),
  2351. b.off("mouseup", re)
  2352. }
  2353. function se(e) {
  2354. switch (r(e),
  2355. this) {
  2356. case $e[0]:
  2357. case Qe[0]:
  2358. ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy),
  2359. b.on("mouseup", re);
  2360. break;
  2361. case Ze[0]:
  2362. ye.prev();
  2363. break;
  2364. case Ge[0]:
  2365. ye.next();
  2366. break;
  2367. case Je[0]:
  2368. ye.prevPage();
  2369. break;
  2370. case Ke[0]:
  2371. ye.nextPage()
  2372. }
  2373. }
  2374. function oe(e) {
  2375. return nt.curDelta = (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  2376. nt.curDelta /= 1 === e.deltaMode ? 3 : 100,
  2377. Re ? (p = +new Date,
  2378. nt.last < p - nt.resetTime && (nt.delta = 0),
  2379. nt.last = p,
  2380. nt.delta += nt.curDelta,
  2381. x(nt.delta) < 1 ? nt.finalDelta = 0 : (nt.finalDelta = E(nt.delta / 1),
  2382. nt.delta %= 1),
  2383. nt.finalDelta) : nt.curDelta
  2384. }
  2385. function le(e) {
  2386. e.originalEvent[g] = ye;
  2387. var t = +new Date;
  2388. if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window)
  2389. return void (O = t);
  2390. if (ge.scrollBy && Ce.start !== Ce.end) {
  2391. var a = oe(e.originalEvent);
  2392. (ge.scrollTrap || a > 0 && Ce.dest < Ce.end || 0 > a && Ce.dest > Ce.start) && r(e, 1),
  2393. ye.slideBy(ge.scrollBy * a)
  2394. }
  2395. }
  2396. function ce(e) {
  2397. ge.clickBar && e.target === Be[0] && (r(e),
  2398. X(V((ge.horizontal ? e.pageX - Be.offset().left : e.pageY - Be.offset().top) - Te / 2)))
  2399. }
  2400. function de(e) {
  2401. if (ge.keyboardNavBy)
  2402. switch (e.which) {
  2403. case ge.horizontal ? 37 : 38:
  2404. r(e),
  2405. ye["pages" === ge.keyboardNavBy ? "prevPage" : "prev"]();
  2406. break;
  2407. case ge.horizontal ? 39 : 40:
  2408. r(e),
  2409. ye["pages" === ge.keyboardNavBy ? "nextPage" : "next"]()
  2410. }
  2411. }
  2412. function ue(e) {
  2413. return ie(this) ? void (e.originalEvent[g + "ignore"] = !0) : void (this.parentNode !== Pe[0] || e.originalEvent[g + "ignore"] || ye.activate(this))
  2414. }
  2415. function fe() {
  2416. this.parentNode === De[0] && ye.activatePage(Ae.index(this))
  2417. }
  2418. function ve(e) {
  2419. ge.pauseOnHover && ye["mouseenter" === e.type ? "pause" : "resume"](2)
  2420. }
  2421. function pe(e, t) {
  2422. if (Ve[e]) {
  2423. for (me = Ve[e].length,
  2424. T.length = 0,
  2425. he = 0; me > he; he++)
  2426. T.push(Ve[e][he]);
  2427. for (he = 0; me > he; he++)
  2428. T[he].call(ye, e, t)
  2429. }
  2430. }
  2431. var he, me, ge = e.extend({}, n.defaults, h), ye = this, we = l(t), be = e(t), Pe = ge.slidee ? e(ge.slidee).eq(0) : be.children().eq(0), Ie = 0, ze = 0, Ce = {
  2432. start: 0,
  2433. center: 0,
  2434. end: 0,
  2435. cur: 0,
  2436. dest: 0
  2437. }, Be = e(ge.scrollBar).eq(0), Se = Be.children().eq(0), ke = 0, Te = 0, xe = {
  2438. start: 0,
  2439. end: 0,
  2440. cur: 0
  2441. }, De = e(ge.pagesBar), Ae = 0, Ee = [], qe = 0, Ne = [], Oe = {
  2442. firstItem: 0,
  2443. lastItem: 0,
  2444. centerItem: 0,
  2445. activeItem: null,
  2446. activePage: 0
  2447. }, He = new u(be[0]), Xe = new u(Pe[0]), Ye = new u(Be[0]), je = new u(Se[0]), Fe = "basic" === ge.itemNav, Me = "forceCentered" === ge.itemNav, Le = "centered" === ge.itemNav || Me, Re = !we && (Fe || Le || Me), Ue = ge.scrollSource ? e(ge.scrollSource) : be, We = ge.dragSource ? e(ge.dragSource) : be, $e = e(ge.forward), Qe = e(ge.backward), Ze = e(ge.prev), Ge = e(ge.next), Je = e(ge.prevPage), Ke = e(ge.nextPage), Ve = {}, _e = {}, et = {}, tt = {}, at = {
  2448. released: 1
  2449. }, nt = {
  2450. last: 0,
  2451. delta: 0,
  2452. resetTime: 200
  2453. }, it = 0, rt = 0, st = 0, ot = 0;
  2454. we || (t = be[0]),
  2455. ye.initialized = 0,
  2456. ye.frame = t,
  2457. ye.slidee = Pe[0],
  2458. ye.pos = Ce,
  2459. ye.rel = Oe,
  2460. ye.items = Ne,
  2461. ye.pages = Ee,
  2462. ye.isPaused = 0,
  2463. ye.options = ge,
  2464. ye.dragging = at,
  2465. ye.reload = function() {
  2466. H()
  2467. }
  2468. ,
  2469. ye.getPos = function(e) {
  2470. if (Re) {
  2471. var t = R(e);
  2472. return -1 !== t && Ne[t]
  2473. }
  2474. var a = Pe.find(e).eq(0);
  2475. if (a[0]) {
  2476. var n = ge.horizontal ? a.offset().left - Pe.offset().left : a.offset().top - Pe.offset().top
  2477. , i = a[ge.horizontal ? "outerWidth" : "outerHeight"]();
  2478. return {
  2479. start: n,
  2480. center: n - Ie / 2 + i / 2,
  2481. end: n - Ie + i,
  2482. size: i
  2483. }
  2484. }
  2485. return !1
  2486. }
  2487. ,
  2488. ye.moveBy = function(e) {
  2489. tt.speed = e,
  2490. !at.init && tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) && (tt.lastTime = +new Date,
  2491. tt.startPos = Ce.cur,
  2492. ee("button"),
  2493. at.init = 1,
  2494. pe("moveStart"),
  2495. y(ot),
  2496. M())
  2497. }
  2498. ,
  2499. ye.stop = function() {
  2500. "button" === at.source && (at.init = 0,
  2501. at.released = 1)
  2502. }
  2503. ,
  2504. ye.prev = function() {
  2505. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1)
  2506. }
  2507. ,
  2508. ye.next = function() {
  2509. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1)
  2510. }
  2511. ,
  2512. ye.prevPage = function() {
  2513. ye.activatePage(Oe.activePage - 1)
  2514. }
  2515. ,
  2516. ye.nextPage = function() {
  2517. ye.activatePage(Oe.activePage + 1)
  2518. }
  2519. ,
  2520. ye.slideBy = function(e, t) {
  2521. e && (Re ? ye[Le ? "toCenter" : "toStart"](d((Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e, 0, Ne.length)) : X(Ce.dest + e, t))
  2522. }
  2523. ,
  2524. ye.slideTo = function(e, t) {
  2525. X(e, t)
  2526. }
  2527. ,
  2528. ye.toStart = function(e, t) {
  2529. L("start", e, t)
  2530. }
  2531. ,
  2532. ye.toEnd = function(e, t) {
  2533. L("end", e, t)
  2534. }
  2535. ,
  2536. ye.toCenter = function(e, t) {
  2537. L("center", e, t)
  2538. }
  2539. ,
  2540. ye.getIndex = R,
  2541. ye.activate = function(e, t) {
  2542. var a = W(e);
  2543. ge.smart && a !== !1 && (Le ? ye.toCenter(a, t) : a >= Oe.lastItem ? ye.toStart(a, t) : a <= Oe.firstItem ? ye.toEnd(a, t) : K())
  2544. }
  2545. ,
  2546. ye.activatePage = function(e, t) {
  2547. l(e) && X(Ee[d(e, 0, Ee.length - 1)], t)
  2548. }
  2549. ,
  2550. ye.resume = function(e) {
  2551. ge.cycleBy && ge.cycleInterval && ("items" !== ge.cycleBy || Ne[0] && null != Oe.activeItem) && !(e < ye.isPaused) && (ye.isPaused = 0,
  2552. st ? st = clearTimeout(st) : pe("resume"),
  2553. st = setTimeout(function() {
  2554. switch (pe("cycle"),
  2555. ge.cycleBy) {
  2556. case "items":
  2557. ye.activate(Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1);
  2558. break;
  2559. case "pages":
  2560. ye.activatePage(Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1)
  2561. }
  2562. }, ge.cycleInterval))
  2563. }
  2564. ,
  2565. ye.pause = function(e) {
  2566. e < ye.isPaused || (ye.isPaused = e || 100,
  2567. st && (st = clearTimeout(st),
  2568. pe("pause")))
  2569. }
  2570. ,
  2571. ye.toggle = function() {
  2572. ye[st ? "pause" : "resume"]()
  2573. }
  2574. ,
  2575. ye.set = function(t, a) {
  2576. e.isPlainObject(t) ? e.extend(ge, t) : ge.hasOwnProperty(t) && (ge[t] = a)
  2577. }
  2578. ,
  2579. ye.add = function(t, a) {
  2580. var n = e(t);
  2581. Re ? (null == a || !Ne[0] || a >= Ne.length ? n.appendTo(Pe) : Ne.length && n.insertBefore(Ne[a].el),
  2582. null != Oe.activeItem && a <= Oe.activeItem && (_e.active = Oe.activeItem += n.length)) : Pe.append(n),
  2583. H()
  2584. }
  2585. ,
  2586. ye.remove = function(t) {
  2587. if (Re) {
  2588. var a = U(t);
  2589. if (a > -1) {
  2590. qe.eq(a).remove();
  2591. var n = a === Oe.activeItem;
  2592. null != Oe.activeItem && a < Oe.activeItem && (_e.active = --Oe.activeItem),
  2593. H(),
  2594. n && (_e.active = null,
  2595. ye.activate(Oe.activeItem))
  2596. }
  2597. } else
  2598. e(t).remove(),
  2599. H()
  2600. }
  2601. ,
  2602. ye.moveAfter = function(e, t) {
  2603. G(e, t, 1)
  2604. }
  2605. ,
  2606. ye.moveBefore = function(e, t) {
  2607. G(e, t)
  2608. }
  2609. ,
  2610. ye.on = function(e, t) {
  2611. if ("object" === i(e))
  2612. for (var a in e)
  2613. e.hasOwnProperty(a) && ye.on(a, e[a]);
  2614. else if ("function" === i(t))
  2615. for (var n = e.split(" "), r = 0, s = n.length; s > r; r++)
  2616. Ve[n[r]] = Ve[n[r]] || [],
  2617. -1 === J(n[r], t) && Ve[n[r]].push(t);
  2618. else if ("array" === i(t))
  2619. for (var o = 0, l = t.length; l > o; o++)
  2620. ye.on(e, t[o])
  2621. }
  2622. ,
  2623. ye.one = function(e, t) {
  2624. function a() {
  2625. t.apply(ye, arguments),
  2626. ye.off(e, a)
  2627. }
  2628. ye.on(e, a)
  2629. }
  2630. ,
  2631. ye.off = function(e, t) {
  2632. if (t instanceof Array)
  2633. for (var a = 0, n = t.length; n > a; a++)
  2634. ye.off(e, t[a]);
  2635. else
  2636. for (var i = e.split(" "), r = 0, s = i.length; s > r; r++)
  2637. if (Ve[i[r]] = Ve[i[r]] || [],
  2638. null == t)
  2639. Ve[i[r]].length = 0;
  2640. else {
  2641. var o = J(i[r], t);
  2642. -1 !== o && Ve[i[r]].splice(o, 1)
  2643. }
  2644. }
  2645. ,
  2646. ye.destroy = function() {
  2647. return Ue.add(Se).add(Be).add(De).add($e).add(Qe).add(Ze).add(Ge).add(Je).add(Ke).off("." + g),
  2648. b.off("keydown", de),
  2649. Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
  2650. qe && null != Oe.activeItem && qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2651. De.empty(),
  2652. we || (be.off("." + g),
  2653. He.restore(),
  2654. Xe.restore(),
  2655. Ye.restore(),
  2656. je.restore(),
  2657. e.removeData(t, g)),
  2658. Ne.length = Ee.length = 0,
  2659. _e = {},
  2660. ye.initialized = 0,
  2661. ye
  2662. }
  2663. ,
  2664. ye.init = function() {
  2665. if (!ye.initialized) {
  2666. ye.on(m);
  2667. var e = ["overflow", "position"]
  2668. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2669. He.save.apply(He, e),
  2670. Ye.save.apply(Ye, e),
  2671. Xe.save.apply(Xe, t),
  2672. je.save.apply(je, t);
  2673. var a = Se;
  2674. return we || (a = a.add(Pe),
  2675. be.css("overflow", "hidden"),
  2676. f || "static" !== be.css("position") || be.css("position", "relative")),
  2677. f ? v && a.css(f, v) : ("static" === Be.css("position") && Be.css("position", "relative"),
  2678. a.css({
  2679. position: "absolute"
  2680. })),
  2681. ge.forward && $e.on(S, se),
  2682. ge.backward && Qe.on(S, se),
  2683. ge.prev && Ze.on(B, se),
  2684. ge.next && Ge.on(B, se),
  2685. ge.prevPage && Je.on(B, se),
  2686. ge.nextPage && Ke.on(B, se),
  2687. Ue.on(C, le),
  2688. Be[0] && Be.on(B, ce),
  2689. Re && ge.activateOn && be.on(ge.activateOn + "." + g, "*", ue),
  2690. De[0] && ge.activatePageOn && De.on(ge.activatePageOn + "." + g, "*", fe),
  2691. We.on(P, {
  2692. source: "slidee"
  2693. }, te),
  2694. Se && Se.on(P, {
  2695. source: "handle"
  2696. }, te),
  2697. b.on("keydown", de),
  2698. we || (be.on("mouseenter." + g + " mouseleave." + g, ve),
  2699. be.on("scroll." + g, o)),
  2700. ye.initialized = 1,
  2701. H(!0),
  2702. ge.cycleBy && !we && ye[ge.startPaused ? "pause" : "resume"](),
  2703. ye
  2704. }
  2705. }
  2706. }
  2707. function i(e) {
  2708. 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
  2709. }
  2710. function r(e, t) {
  2711. e.preventDefault(),
  2712. t && e.stopPropagation()
  2713. }
  2714. function s(t) {
  2715. r(t, 1),
  2716. e(this).off(t.type, s)
  2717. }
  2718. function o() {
  2719. this.scrollLeft = 0,
  2720. this.scrollTop = 0
  2721. }
  2722. function l(e) {
  2723. return !isNaN(parseFloat(e)) && isFinite(e)
  2724. }
  2725. function c(e, t) {
  2726. return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2727. }
  2728. function d(e, t, a) {
  2729. return t > e ? t : e > a ? a : e
  2730. }
  2731. function u(e) {
  2732. var t = {};
  2733. return t.style = {},
  2734. t.save = function() {
  2735. if (e && e.nodeType) {
  2736. for (var a = 0; a < arguments.length; a++)
  2737. t.style[arguments[a]] = e.style[arguments[a]];
  2738. return t
  2739. }
  2740. }
  2741. ,
  2742. t.restore = function() {
  2743. if (e && e.nodeType) {
  2744. for (var a in t.style)
  2745. t.style.hasOwnProperty(a) && (e.style[a] = t.style[a]);
  2746. return t
  2747. }
  2748. }
  2749. ,
  2750. t
  2751. }
  2752. var f, v, p, h = "sly", m = "Sly", g = h, y = t.cancelAnimationFrame || t.cancelRequestAnimationFrame, w = t.requestAnimationFrame, b = e(document), P = "touchstart." + g + " mousedown." + g, I = "mousemove." + g + " mouseup." + g, z = "touchmove." + g + " touchend." + g, C = (document.implementation.hasFeature("Event.wheel", "3.0") ? "wheel." : "mousewheel.") + g, B = "click." + g, S = "mousedown." + g, k = ["INPUT", "SELECT", "BUTTON", "TEXTAREA"], T = [], x = Math.abs, D = Math.sqrt, A = Math.pow, E = Math.round, q = Math.max, N = Math.min, O = 0;
  2753. b.on(C, function(e) {
  2754. var t = e.originalEvent[g]
  2755. , a = +new Date;
  2756. (!t || t.options.scrollHijack < a - O) && (O = a)
  2757. }),
  2758. function(e) {
  2759. function t(e) {
  2760. var t = (new Date).getTime()
  2761. , n = Math.max(0, 16 - (t - a))
  2762. , i = setTimeout(e, n);
  2763. return a = t,
  2764. i
  2765. }
  2766. w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t;
  2767. var a = (new Date).getTime()
  2768. , n = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.clearTimeout;
  2769. y = function(t) {
  2770. n.call(e, t)
  2771. }
  2772. }(window),
  2773. function() {
  2774. function e(e) {
  2775. for (var n = 0, i = t.length; i > n; n++) {
  2776. var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2777. if (null != a.style[r])
  2778. return r
  2779. }
  2780. }
  2781. var t = ["", "webkit", "moz", "ms", "o"]
  2782. , a = document.createElement("div");
  2783. f = e("transform"),
  2784. v = e("perspective") ? "translateZ(0) " : ""
  2785. }(),
  2786. t[m] = n,
  2787. e.fn[h] = function(t, a) {
  2788. var r, s;
  2789. return e.isPlainObject(t) || (("string" === i(t) || t === !1) && (r = t === !1 ? "destroy" : t,
  2790. s = Array.prototype.slice.call(arguments, 1)),
  2791. t = {}),
  2792. this.each(function(i, o) {
  2793. var l = e.data(o, g);
  2794. l || r ? l && r && l[r] && l[r].apply(l, s) : l = e.data(o, g, new n(o,t,a).init())
  2795. })
  2796. }
  2797. ,
  2798. n.defaults = {
  2799. slidee: null,
  2800. horizontal: !1,
  2801. itemNav: null,
  2802. itemSelector: null,
  2803. smart: !1,
  2804. activateOn: null,
  2805. activateMiddle: !1,
  2806. scrollSource: null,
  2807. scrollBy: 0,
  2808. scrollHijack: 300,
  2809. scrollTrap: !1,
  2810. dragSource: null,
  2811. mouseDragging: !1,
  2812. touchDragging: !1,
  2813. releaseSwing: !1,
  2814. swingSpeed: .2,
  2815. elasticBounds: !1,
  2816. interactive: null,
  2817. scrollBar: null,
  2818. dragHandle: !1,
  2819. dynamicHandle: !1,
  2820. minHandleSize: 50,
  2821. clickBar: !1,
  2822. syncSpeed: .5,
  2823. pagesBar: null,
  2824. activatePageOn: null,
  2825. pageBuilder: function(e) {
  2826. return "<li>" + (e + 1) + "</li>"
  2827. },
  2828. forward: null,
  2829. backward: null,
  2830. prev: null,
  2831. next: null,
  2832. prevPage: null,
  2833. nextPage: null,
  2834. cycleBy: null,
  2835. cycleInterval: 5e3,
  2836. pauseOnHover: !1,
  2837. startPaused: !1,
  2838. moveBy: 300,
  2839. speed: 0,
  2840. easing: "swing",
  2841. startAt: null,
  2842. keyboardNavBy: null,
  2843. draggedClass: "dragged",
  2844. activeClass: "active",
  2845. disabledClass: "disabled"
  2846. }
  2847. }(jQuery, window);
  2848. !function e(t, i, n) {
  2849. function r(a, s) {
  2850. if (!i[a]) {
  2851. if (!t[a]) {
  2852. var l = "function" == typeof require && require;
  2853. if (!s && l)
  2854. return l(a, !0);
  2855. if (o)
  2856. return o(a, !0);
  2857. var c = new Error("Cannot find module '" + a + "'");
  2858. throw c.code = "MODULE_NOT_FOUND",
  2859. c
  2860. }
  2861. var h = i[a] = {
  2862. exports: {}
  2863. };
  2864. t[a][0].call(h.exports, function(e) {
  2865. var i = t[a][1][e];
  2866. return r(i ? i : e)
  2867. }, h, h.exports, e, t, i, n)
  2868. }
  2869. return i[a].exports
  2870. }
  2871. for (var o = "function" == typeof require && require, a = 0; a < n.length; a++)
  2872. r(n[a]);
  2873. return r
  2874. }({
  2875. 1: [function(e, t, i) {
  2876. (function(i) {
  2877. "use strict";
  2878. function n(e) {
  2879. this.player = null,
  2880. this.director = null,
  2881. this.modelManager = null,
  2882. this.container = null,
  2883. this.tagManager = null,
  2884. this.fadeInSpeed = e,
  2885. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2886. }
  2887. var r = e("three")
  2888. , o = e("./util/logger")
  2889. , a = (e("./util/common"),
  2890. e("./enum/PlayerEvents"))
  2891. , s = e("./enum/DirectorEvents")
  2892. , l = e("./settings")
  2893. , c = e("./enum/Viewmode")
  2894. , h = (e("./enum/WarpStyle"),
  2895. e("./enum/BlackoutStyle"),
  2896. e("./enum/ModelManagerEvents"))
  2897. , u = e("./enum/tagEvents")
  2898. , d = e("./util/transitions")
  2899. , p = e("./util/lerp")
  2900. , f = new o(i);
  2901. //window.THREE = r;
  2902. n.prototype.init = function(e, t, i, n, r) {
  2903. window.app = this;
  2904. this.player = t,
  2905. this.director = e,
  2906. this.modelManager = i,
  2907. this.tagManager = n,
  2908. this.container = r,
  2909. this.updateModel(),
  2910. this.bindEvents()
  2911. }
  2912. ,
  2913. n.prototype.bindEvents = function() {
  2914. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  2915. this.player.on(a.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2916. this.player.on(a.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2917. this.player.on(a.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2918. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  2919. this.player.on(a.StartOutside, this.handleStartOutside.bind(this)),
  2920. this.player.on(a.WarpStarted, this.handleWarpStarted.bind(this)),
  2921. this.director.on(s.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2922. this.tagManager.on(u.TagActivated, this.ontagActivated.bind(this)),
  2923. this.tagManager.on(u.TagNavigation, this.onNavigationTotag.bind(this))
  2924. }
  2925. ,
  2926. n.prototype.updateModel = function() {
  2927. //模型this.model
  2928. this.model = this.modelManager.getActiveModel()
  2929. }
  2930. ,
  2931. n.prototype.handleWarpStarted = function() {
  2932. this.hidePlayerReticule()
  2933. }
  2934. ,
  2935. n.prototype.ontagActivated = function() {
  2936. this.hidePlayerReticule()
  2937. }
  2938. ,
  2939. n.prototype.onNavigationTotag = function() {
  2940. this.hidePlayerReticule()
  2941. }
  2942. ,
  2943. n.prototype.handlePlayerModeChanging = function(e, t, i) {
  2944. var n = this.modelManager.getActiveModel()
  2945. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : l[t].markerOpacity;
  2946. n.fadePanoMarkers(r),
  2947. n.setMode(t)
  2948. }
  2949. ,
  2950. n.prototype.handlePlayerModeChanged = function(e, t) {
  2951. var i = this.modelManager.getActiveModel()
  2952. , n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide;
  2953. i.setSide(n),
  2954. i.setMode(t)
  2955. }
  2956. ,
  2957. n.prototype.handleClosestPanoChanging = function(e, t, i) {
  2958. i !== c.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2959. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2960. }
  2961. ,
  2962. n.prototype.handleActionInterruption = function() {}
  2963. ,
  2964. n.prototype.handleStartInside = function(e) {
  2965. var t = l[this.player.mode]
  2966. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2967. this.fadeIn(this.fadeInSpeed),
  2968. this.model.alpha = 0,
  2969. this.model.skybox.material.uniforms.opacity.value = 1,
  2970. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2971. var n = this.player.reticule;
  2972. d.start(p.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2973. }
  2974. ,
  2975. n.prototype.handleStartOutside = function(e) {
  2976. this.fadeIn(e)
  2977. }
  2978. ,
  2979. n.prototype.fadeIn = function(e) {
  2980. null !== e && void 0 !== e || (e = 2e3,
  2981. f.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2982. $(this.container).fadeIn(e)
  2983. }
  2984. ,
  2985. n.prototype.hidePlayerReticule = function() {
  2986. this.player.reticule.hide()
  2987. }
  2988. ,
  2989. t.exports = n
  2990. }
  2991. ).call(this, "/js/DisplayController.js")
  2992. }
  2993. , {
  2994. "./enum/BlackoutStyle": 18,
  2995. "./enum/DirectorEvents": 23,
  2996. "./enum/tagEvents": 32,
  2997. "./enum/ModelManagerEvents": 33,
  2998. "./enum/PlayerEvents": 40,
  2999. "./enum/Viewmode": 51,
  3000. "./enum/WarpStyle": 52,
  3001. "./settings": 166,
  3002. "./util/common": 185,
  3003. "./util/lerp": 188,
  3004. "./util/logger": 189,
  3005. "./util/transitions": 195,
  3006. three: 217
  3007. }],
  3008. 2: [function(e, t, i) {
  3009. "use strict";
  3010. function n() {
  3011. this.baseStartTime = performance.timing.navigationStart,
  3012. this.loadingStartTime = null,
  3013. this.waitingStartTime = null,
  3014. this.appReadyTime = null
  3015. }
  3016. n.prototype.setBaseStartTime = function(e) {
  3017. this.baseStartTime = e || Date.now()
  3018. }
  3019. ,
  3020. n.prototype.setWaitingStartTime = function(e) {
  3021. this.waitingStartTime = e || Date.now()
  3022. }
  3023. ,
  3024. n.prototype.setLoadingStartTime = function(e) {
  3025. this.loadingStartTime = e || Date.now()
  3026. }
  3027. ,
  3028. n.prototype.setAppReadyTime = function(e) {
  3029. this.appReadyTime = e || Date.now()
  3030. }
  3031. ,
  3032. n.prototype.calcFullLoadingTime = function() {
  3033. var e = this.appReadyTime - this.baseStartTime;
  3034. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  3035. e
  3036. }
  3037. ,
  3038. t.exports = n
  3039. }
  3040. , {}],
  3041. 3: [function(e, t, i) {
  3042. (function(i) {
  3043. "use strict";
  3044. function n() {
  3045. return 100 * Math.random()
  3046. }
  3047. var r = e("./util/logger")
  3048. , o = e("./util/browser")
  3049. , a = new r(i)
  3050. , s = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  3051. initialized: !1,
  3052. init: function(e, t) {
  3053. if (t = t || {},
  3054. !this.initialized) {
  3055. this.initialized = !0,
  3056. o.valueFromHash("tilegen") && (t.tilegen = 1 === o.valueFromHash("tilegen", 0)),
  3057. o.valueFromHash("imgopt") && (t.imgopt = 1 === o.valueFromHash("imgopt", 0));
  3058. for (var i in e) {
  3059. var r = i.match("^sc_tilegen_([0-9]+)$");
  3060. r && (s.tilegen = n() < parseInt(r[1]));
  3061. var l = i.match("^sc_imgopt_([0-9]+)$");
  3062. l && (s.imgopt = n() < parseInt(l[1]))
  3063. }
  3064. for (var c in t)
  3065. s[c] = t[c],
  3066. a.debug("A/B override:", c, s[c])
  3067. }
  3068. },
  3069. changeIfTileGenerating: function(e) {
  3070. return s.tilegen && (e += e.indexOf("?") === -1 ? "?" : "&",
  3071. e += ""),
  3072. e
  3073. },
  3074. changeIfImageOptimzing: function(e) {
  3075. return s.imgopt && e.indexOf("imgopt=1") === -1 && (e += e.indexOf("?") === -1 ? "?" : "&",
  3076. e += ""),
  3077. e
  3078. },
  3079. tilegen: !1,
  3080. imgopt: !1
  3081. };
  3082. t.exports = s
  3083. }
  3084. ).call(this, "/js/ab.js")
  3085. }
  3086. , {
  3087. "./util/browser": 182,
  3088. "./util/logger": 189
  3089. }],
  3090. 4: [function(e, t, i) {
  3091. (function(i) {
  3092. "use strict";
  3093. function n() {
  3094. return {
  3095. addons: [{
  3096. name: "keen:ua_parser",
  3097. input: {
  3098. ua_string: "user_agent"
  3099. },
  3100. output: "parsed_user_agent"
  3101. }]
  3102. }
  3103. }
  3104. function r(e, t, i, n) {
  3105. function r(t) {
  3106. l[t.sid] = !0;
  3107. var i = t.billboard.media && t.billboard.media.type
  3108. , n = {
  3109. tag_id: t.sid,
  3110. tags_visited: Object.keys(l).length,
  3111. tag_count: Object.keys(e.tags).length,
  3112. tag_view_count: ++E,
  3113. has_media: !!i
  3114. };
  3115. i && (n.media_type = i),
  3116. u("tag_opened", n)
  3117. }
  3118. var l = {}
  3119. , h = Date.now() - N
  3120. , f = null;
  3121. n && (f = Date.now() - window.navigationStart);
  3122. var g;
  3123. try {
  3124. g = /* e.data.player_options.highlight_reel && */ e.heroLocations.length > 0
  3125. } catch (e) {
  3126. g = !1
  3127. }
  3128. var v, A = e.supportsVR;
  3129. A || (v = "VR disabled at the model/account level",
  3130. m.valueFromHash("vr") === _.NONE ? v = "VR disabled, using &vr=0" : m.detectAndroid() ? b.isDeviceSupported(w.Android) || (v = "VR disabled, unsupported Android version") : m.detectIOS() && (b.isDeviceSupported(w.IOS) || (v = "VR disabled, unsupported iOS version"))),
  3131. u("model_loaded", {
  3132. duration: h,
  3133. duration_from_navigation_start: f,
  3134. has_hlr: g,
  3135. has_vr: A,
  3136. vr_reason: v
  3137. });
  3138. var I = 0;
  3139. e.panos.forEach(function(e) {
  3140. e.on("enter", function() {
  3141. c("pano_viewed", {
  3142. pano_id: e.id,
  3143. pano_view_count: ++I,
  3144. alignment_type: e.alignmentType,
  3145. interaction_source: O,
  3146. navigation_source: p
  3147. })
  3148. })
  3149. });
  3150. var E = 0;
  3151. for (var T in e.tags)
  3152. e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]));
  3153. t.on("tour_auto", function(e) {
  3154. p = "tour_" + e
  3155. }),
  3156. t.on("tour_manual", function(e) {
  3157. O = "gui-" + e,
  3158. p = "tour_manual"
  3159. }),
  3160. i.on(C.InteractionKey, function() {
  3161. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey)
  3162. }),
  3163. i.on(C.InteractionDirect, function() {
  3164. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionDirect)
  3165. }),
  3166. o(t),
  3167. a(),
  3168. s()
  3169. }
  3170. function o(e) {
  3171. I.on(T.OPENED, function() {
  3172. c("showcase_share_intent", {
  3173. pano_id: e.currentPano && e.currentPano.id
  3174. })
  3175. }),
  3176. I.on(T.LINK_CLICKED, function(t) {
  3177. c("showcase_share_action", {
  3178. channel: t.channel,
  3179. pano_id: e.currentPano && e.currentPano.id
  3180. })
  3181. }),
  3182. E.on(x.ORIGIN_LINK_CLICKED, function() {
  3183. c("showcase_share_origin_link_clicked")
  3184. })
  3185. }
  3186. function a() {}
  3187. function s() {
  3188. b.on(S.OPENED, c.bind(this, "showcase_gui", {
  3189. gui_action: "click_vr_button"
  3190. })),
  3191. b.on(S.LAUNCH, function(e) {
  3192. c("showcase_gui", {
  3193. gui_action: "launch_vr",
  3194. vr_platform: e.vr_platform,
  3195. vr_app: e.vr_app
  3196. })
  3197. }),
  3198. b.on(S.PREV, c.bind(this, "showcase_gui", {
  3199. gui_action: "vr_modal_prev"
  3200. })),
  3201. b.on(S.NEXT, function(e) {
  3202. c("showcase_gui", {
  3203. gui_action: e.nextAction
  3204. })
  3205. }),
  3206. b.on(S.CLOSED, c.bind(this, "showcase_gui", {
  3207. gui_action: "vr_modal_close"
  3208. })),
  3209. b.on(S.falseICECHOSEN, function(e) {
  3210. c("showcase_gui", {
  3211. gui_action: e.name + " "
  3212. })
  3213. }),
  3214. b.on(S.STORE, function(e) {
  3215. c("showcase_gui", {
  3216. gui_action: "launch_store",
  3217. store: e
  3218. })
  3219. })
  3220. }
  3221. function l(e, t) {
  3222. if (f)
  3223. try {
  3224. f.addEvent(e, v.extendObject({
  3225. host: window.location.host,
  3226. keen: n(),
  3227. user_agent: "${keen.user_agent}",
  3228. referrer: {
  3229. url: v.normalizeUrl(document.referrer),
  3230. domain: v.domainFromUrl(document.referrer),
  3231. url_original: document.referrer
  3232. },
  3233. embedded: m.inIframe(),
  3234. is_mobile: m.isMobile(),
  3235. version: "2.25.6-0-gd87e5b1"
  3236. }, t))
  3237. } catch (e) {
  3238. P.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  3239. }
  3240. }
  3241. function c(e, t) {
  3242. if (t = t || {},
  3243. L)
  3244. try {
  3245. window.analytics.track(e, v.extendObject(t, B), {
  3246. context: {
  3247. app: {
  3248. name: "showcase",
  3249. version: "2.25.6-0-gd87e5b1"
  3250. },
  3251. screen: {
  3252. width: window.screen.width,
  3253. height: window.screen.height,
  3254. density: window.devicePixelRatio
  3255. }
  3256. }
  3257. })
  3258. } catch (t) {
  3259. console.warn("Failed to send data to segment for " + e)
  3260. }
  3261. }
  3262. function h(e, t) {
  3263. if (t = t || {},
  3264. navigator.sendBeacon && L)
  3265. try {
  3266. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  3267. event: e,
  3268. anonymousId: window.analytics.user().anonymousId(),
  3269. properties: v.extendObject(t, B),
  3270. writeKey: L,
  3271. sentAt: Date.now(),
  3272. type: "track",
  3273. context: {
  3274. userAgent: m.userAgent(),
  3275. library: {
  3276. name: "showcase-beacon",
  3277. version: "2.25.6-0-gd87e5b1"
  3278. },
  3279. app: {
  3280. name: "showcase",
  3281. version: "2.25.6-0-gd87e5b1"
  3282. }
  3283. }
  3284. }))
  3285. } catch (e) {
  3286. console.warn("Failed to send async segment request")
  3287. }
  3288. }
  3289. function u(e, t) {
  3290. t = t || {},
  3291. c(e, t)
  3292. }
  3293. function d(e, t) {
  3294. O = e === C.InteractionGui ? "gui-" + t : e,
  3295. p = "self_guided"
  3296. }
  3297. var p, f, g = (e("three"),
  3298. e("./util/ajax"),
  3299. e("./ab")), m = e("./util/browser"), v = e("./util/common"), A = e("./settings"), y = (e("./localization/localize"),
  3300. e("./enum/Viewmode")), C = e("./enum/ControlEvents"), I = e("./gui/sharing/modal"), E = e("./gui/title/titleBar"), b = e("./gui/vr/vrModal"), w = e("./enum/VRPlatforms"), _ = e("./enum/VROption"), T = e("./gui/sharing/ShareEvents"), x = e("./gui/title/TitleEvents"), S = e("./gui/vr/vrEvent"), M = e("./tag/Billboard/BillboardEvent"), R = e("./util/logger"), P = new R(i), O = (e("./enum/PlayerEvents"),
  3301. "direct"), L = null, D = !1, N = null, B = null, F = v.uuid4();
  3302. t.exports = {
  3303. report: function(e, t, i, n) {
  3304. l("Session starts", {
  3305. model: e,
  3306. status: t,
  3307. loadtime: Date.now() - (N || Date.now()),
  3308. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  3309. autoplay: i,
  3310. quickstart: n,
  3311. ab_tilegen: g.tilegen,
  3312. ab_imgopt: g.imgopt
  3313. })
  3314. },
  3315. impression: function(e) {
  3316. e = e || {};
  3317. var t = void 0 === e.isVisible || e.isVisible
  3318. , i = (void 0 !== e.immediate && e.immediate,
  3319. window.location.search.substr(1).split("&"));
  3320. u("impression", {
  3321. visible: t,
  3322. url_params: i
  3323. })
  3324. },
  3325. initKeen: function(e) {
  3326. return e.token && e.appId ? void (f = new Keen({
  3327. projectId: e.appId,
  3328. writeKey: e.token,
  3329. readKey: "",
  3330. requestType: "xhr"
  3331. })) : void P.warn("no keen token/appId")
  3332. },
  3333. initSegment: function(e) {
  3334. return e.token ? (L = e.token,
  3335. window.analytics.load(e.token),
  3336. B = {
  3337. model_id: e.model,
  3338. start_source: e.startSource,
  3339. autoplay: e.autoplay,
  3340. quickstart: e.quickstart,
  3341. language_tag: A.languageTag,
  3342. is_mobile: m.isMobile(),
  3343. iframe: m.inIframe(),
  3344. aspect_ratio: m.aspectRatio(),
  3345. session_id: F,
  3346. window: {
  3347. width: $("#player").width(),
  3348. height: $("#player").height()
  3349. },
  3350. platform: {
  3351. browser: {
  3352. name: $.ua.browser.name,
  3353. major: $.ua.browser.major,
  3354. version: $.ua.browser.version
  3355. },
  3356. os: {
  3357. name: $.ua.os.name,
  3358. version: $.ua.os.version
  3359. },
  3360. device: {
  3361. vendor: $.ua.device.vendor,
  3362. model: $.ua.device.model,
  3363. type: $.ua.device.type
  3364. }
  3365. }
  3366. },
  3367. D = Math.random() < A.analytics.sessionTrackingRate,
  3368. P.debug("tracking sample rate = " + A.analytics.sessionTrackingRate),
  3369. void P.debug("tracking this session = " + D)) : void P.warn("no segment token")
  3370. },
  3371. sessionStart: function(e) {
  3372. P.debug("analytics user_session_start"),
  3373. c("session_started"),
  3374. N = Date.now(),
  3375. window.addEventListener("unload", function() {
  3376. h("session_ended", {
  3377. duration: Date.now() - N
  3378. })
  3379. })
  3380. },
  3381. modelLoaded: function(e, t, i, n) {
  3382. r(e, t, i, n)
  3383. },
  3384. loadComplete: function(e) {
  3385. var t = {
  3386. time_to_app_start: e
  3387. };
  3388. c("load_times", t)
  3389. },
  3390. track: function(e, t) {
  3391. D && (P.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  3392. c(e, t))
  3393. },
  3394. trackAlways: function(e, t) {
  3395. P.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  3396. c(e, t)
  3397. },
  3398. getSessionId: function() {
  3399. return F
  3400. },
  3401. updateInteraction: d
  3402. }
  3403. }
  3404. ).call(this, "/js/analytics.js")
  3405. }
  3406. , {
  3407. "./ab": 3,
  3408. "./enum/ControlEvents": 21,
  3409. "./enum/PlayerEvents": 40,
  3410. "./enum/VROption": 47,
  3411. "./enum/VRPlatforms": 49,
  3412. "./enum/Viewmode": 51,
  3413. "./gui/sharing/ShareEvents": 76,
  3414. "./gui/sharing/modal": 77,
  3415. "./gui/title/TitleEvents": 80,
  3416. "./gui/title/titleBar": 82,
  3417. "./gui/vr/vrEvent": 85,
  3418. "./gui/vr/vrModal": 87,
  3419. "./localization/localize": 108,
  3420. "./tag/Billboard/BillboardEvent": 120,
  3421. "./settings": 166,
  3422. "./util/ajax": 181,
  3423. "./util/browser": 182,
  3424. "./util/common": 185,
  3425. "./util/logger": 189,
  3426. three: 217
  3427. }],
  3428. 5: [function(e, t, i) {
  3429. "use strict";
  3430. function n() {
  3431. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  3432. this.controls = null
  3433. }
  3434. var r = e("three")
  3435. , o = e("../constants")
  3436. , a = e("../util/cameraLight");
  3437. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3438. n.prototype.updateAspect = function(e) {
  3439. this.aspect = e,
  3440. this.updateProjectionMatrix()
  3441. }
  3442. ,
  3443. t.exports = n
  3444. }
  3445. , {
  3446. "../constants": 8,
  3447. "../util/cameraLight": 184,
  3448. three: 217
  3449. }],
  3450. 6: [function(e, t, i) {
  3451. "use strict";
  3452. function n() {
  3453. var e = $("#player").width() / $("#player").height();
  3454. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  3455. this.controls = null,
  3456. this.updateAspect(e)
  3457. }
  3458. var r = e("three")
  3459. , o = e("../constants");
  3460. n.prototype = Object.create(r.OrthographicCamera.prototype),
  3461. n.prototype.updateAspect = function(e) {
  3462. this.aspect = e,
  3463. this.top = o.orthoBase / e,
  3464. this.bottom = -o.orthoBase / e,
  3465. this.updateProjectionMatrix()
  3466. }
  3467. ,
  3468. t.exports = n
  3469. }
  3470. , {
  3471. "../constants": 8,
  3472. three: 217
  3473. }],
  3474. 7: [function(e, t, i) {
  3475. "use strict";
  3476. function n() {
  3477. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  3478. this.controls = null
  3479. }
  3480. var r = e("three")
  3481. , o = e("../settings")
  3482. , a = e("../util/cameraLight");
  3483. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3484. n.prototype.updateAspect = function(e) {
  3485. this.aspect = e,
  3486. this.updateProjectionMatrix()
  3487. }
  3488. ,
  3489. t.exports = n
  3490. }
  3491. , {
  3492. "../settings": 166,
  3493. "../util/cameraLight": 184,
  3494. three: 217
  3495. }],
  3496. 8: [function(e, t, i) {
  3497. "use strict";
  3498. t.exports = {
  3499. signedUrlDefaultExpireTime: 24e4,
  3500. signedUrlCheckInterval: 1e4,
  3501. signedUrlRefreshBuffer: 15e3,
  3502. dollhouseFOV: 70,
  3503. dollhouseNear: 1,
  3504. dollhouseFar: 5e3,
  3505. insideFOV: 70,
  3506. insideFOVMax: 120,
  3507. insideNear: .1,
  3508. insideFar: 5e3,
  3509. insideLookSpeed: .12,
  3510. insideLookLimitUp: 40,
  3511. insideLookLimitDown: -40,
  3512. orthoNear: 1,
  3513. orthoFar: 5e3,
  3514. orthoBase: 10,
  3515. narrowLandscapeHeight: 290,
  3516. reallyNarrowLandscapeHeight: 250,
  3517. visionTilingStartDate: new Date("8/26/2016"),
  3518. visionTilingStartVersion: "1.1.407.13667",
  3519. windowHeightHighQualityThreshold: 900,
  3520. tourStepDelayDefault: 3500,
  3521. tourStepDelaySlideShow: 5e3,
  3522. workshopApsect: 9 / 16,
  3523. highQualityMaxZoom: 2,
  3524. ultraHighQualityMaxZoom: 3
  3525. }
  3526. }
  3527. , {}],
  3528. 9: [function(e, t, i) {
  3529. "use strict";
  3530. function n() {
  3531. this.activeControl = null,
  3532. this.controls = {},
  3533. this.cameras = {}
  3534. }
  3535. var r = e("./PanoramaControls")
  3536. , o = e("./DollhouseControls")
  3537. , a = e("./FloorplanControls")
  3538. , s = e("../cameras/PanoramaCamera")
  3539. , l = e("../cameras/DollhouseCamera")
  3540. , c = e("../cameras/FloorplanCamera")
  3541. , h = e("events").EventEmitter
  3542. , u = e("../enum/ControlEvents")
  3543. , d = e("../enum/ModelManagerEvents")
  3544. , p = e("../enum/Viewmode")
  3545. , f = e("../settings");
  3546. n.prototype = Object.create(h.prototype),
  3547. n.prototype.init = function(e, t) {
  3548. this.setUpControls(),
  3549. this.bindEvents(e, t)
  3550. }
  3551. ,
  3552. n.prototype.activateControls = function(e) {
  3553. this.activeControl && (this.activeControl.reset(),
  3554. this.activeControl.enabled = !1),
  3555. this.controls[e] && (this.controls[e].enabled = !0),
  3556. this.activeControl = this.controls[e]
  3557. }
  3558. ,
  3559. n.prototype.setUpControls = function() {
  3560. var e = {}
  3561. , t = {}
  3562. , i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3563. , n = [s, l, c]
  3564. , h = [r, o, a];
  3565. i.forEach(function(i, r) {
  3566. e[i] = new n[r],
  3567. t[i] = new h[r](e[i]),
  3568. t[i].on(u.Move, this.emit.bind(this, u.Move)),
  3569. t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
  3570. t[i].on(u.InteractionDirect, this.emit.bind(this, u.InteractionDirect)),
  3571. t[i].on(u.InteractionKey, this.emit.bind(this, u.InteractionKey)),
  3572. t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
  3573. t[i].on(u.Scroll, this.emit.bind(this, u.Scroll))
  3574. }
  3575. .bind(this)),
  3576. this.controls = t,
  3577. this.cameras = e
  3578. }
  3579. ,
  3580. n.prototype.bindEvents = function(e, t) {
  3581. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3582. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3583. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3584. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3585. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this),{ passive: false }),
  3586. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3587. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3588. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3589. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3590. e.addEventListener("contextmenu", function(e) {
  3591. e.preventDefault()
  3592. }),
  3593. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3594. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3595. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3596. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3597. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3598. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3599. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3600. t.on(d.ActiveModelChanged, function(e) {
  3601. this.setModelForControls(e.model)
  3602. }
  3603. .bind(this))
  3604. }
  3605. ,
  3606. n.prototype.setModelForControls = function(e) {
  3607. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3608. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3609. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3610. this.controls[e].setBounds(t)
  3611. }
  3612. .bind(this))
  3613. }
  3614. ,
  3615. n.prototype.onMouseDown = function(e) {
  3616. e.preventDefault(),
  3617. this.activeControl && this.activeControl.onMouseDown(e)
  3618. }
  3619. ,
  3620. n.prototype.onMouseMove = function(e) {
  3621. e.preventDefault(),
  3622. this.activeControl && this.activeControl.onMouseMove(e)
  3623. }
  3624. ,
  3625. n.prototype.onMouseUp = function(e) {
  3626. e.preventDefault(),
  3627. this.activeControl && this.activeControl.onMouseUp(e)
  3628. }
  3629. ,
  3630. n.prototype.onMouseOver = function(e) {
  3631. e.preventDefault(),
  3632. this.activeControl && this.activeControl.onMouseOver(e)
  3633. }
  3634. ,
  3635. n.prototype.onMouseWheel = function(e) {
  3636. e.preventDefault(),
  3637. this.activeControl && this.activeControl.onMouseWheel(e)
  3638. }
  3639. ,
  3640. n.prototype.onTouchStart = function(e) {
  3641. e.preventDefault(),
  3642. this.activeControl && this.activeControl.onTouchStart(e);
  3643. var hotList = $('#hotListWrap')[0];
  3644. hotList.classList.remove('hotListActive');
  3645. $('#hotListContent ul .active').removeClass('active');
  3646. $('#hotList')[0].classList.remove('active')
  3647. }
  3648. ,
  3649. n.prototype.onTouchMove = function(e) {
  3650. e.preventDefault(),
  3651. this.activeControl && this.activeControl.onTouchMove(e)
  3652. }
  3653. ,
  3654. n.prototype.onTouchEnd = function(e) {
  3655. e.preventDefault(),
  3656. this.activeControl && this.activeControl.onTouchEnd(e)
  3657. }
  3658. ,
  3659. n.prototype.onPointerDown = function(e) {
  3660. if (e.preventDefault(),
  3661. this.activeControl)
  3662. switch (e.pointerType) {
  3663. case "mouse":
  3664. this.activeControl.onMouseDown(e);
  3665. break;
  3666. default:
  3667. this.activeControl.onPointerDown(e)
  3668. }
  3669. }
  3670. ,
  3671. n.prototype.onPointerMove = function(e) {
  3672. if (e.preventDefault(),
  3673. this.activeControl)
  3674. switch (e.pointerType) {
  3675. case "mouse":
  3676. this.activeControl.onMouseMove(e);
  3677. break;
  3678. default:
  3679. this.activeControl.onPointerMove(e)
  3680. }
  3681. }
  3682. ,
  3683. n.prototype.onPointerUp = function(e) {
  3684. if (e.preventDefault(),
  3685. this.activeControl)
  3686. switch (e.pointerType) {
  3687. case "mouse":
  3688. this.activeControl.onMouseUp(e);
  3689. break;
  3690. default:
  3691. this.activeControl.onPointerUp(e)
  3692. }
  3693. }
  3694. ,
  3695. n.prototype.onPointerCancel = function(e) {
  3696. e.preventDefault(),
  3697. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3698. }
  3699. ,
  3700. n.prototype.onKeyDown = function(e) {
  3701. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3702. this.activeControl && this.activeControl.onKeyDown(e))
  3703. }
  3704. ,
  3705. n.prototype.onKeyUp = function(e) {
  3706. e.preventDefault(),
  3707. this.activeControl && this.activeControl.onKeyUp(e)
  3708. }
  3709. ,
  3710. t.exports = n
  3711. }
  3712. , {
  3713. "../cameras/DollhouseCamera": 5,
  3714. "../cameras/FloorplanCamera": 6,
  3715. "../cameras/PanoramaCamera": 7,
  3716. "../enum/ControlEvents": 21,
  3717. "../enum/ModelManagerEvents": 33,
  3718. "../enum/Viewmode": 51,
  3719. "../settings": 166,
  3720. "./DollhouseControls": 10,
  3721. "./FloorplanControls": 11,
  3722. "./PanoramaControls": 13,
  3723. events: 202
  3724. }],
  3725. 10: [function(e, t, i) {
  3726. "use strict";
  3727. function n(e) {
  3728. a.call(this, e),
  3729. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3730. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3731. this.minDistance = o.dollhouseDefault.minDistance,
  3732. this.maxDistance = o.dollhouseDefault.maxDistance,
  3733. this.adjustedMinDistance = this.minDistance,
  3734. this.adjustedMaxDistance = this.maxDistance
  3735. }
  3736. var r = e("three")
  3737. , o = e("../settings")
  3738. , a = e("./OutsideControls");
  3739. n.prototype = Object.create(a.prototype),
  3740. n.prototype.pan = function(e, t) {
  3741. this.camera.updateMatrix();
  3742. var i = this.camera.position.clone().sub(this.target).length();
  3743. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3744. this.panLeft(2 * e * i / $("#player").height()),
  3745. this.panUp(-2 * t * i / $("#player").height())
  3746. }
  3747. ,
  3748. n.prototype.updateZoom = function() {
  3749. var e = this.offset.length();
  3750. return e * this.scale
  3751. }
  3752. ,
  3753. n.prototype.setZoomBounds = function(e) {
  3754. var t = e.min.distanceTo(e.max);
  3755. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3756. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3757. this.minDistance = this.adjustedMinDistance,
  3758. this.maxDistance = this.adjustedMaxDistance
  3759. }
  3760. ,
  3761. n.prototype.resetRanges = function(e, t) {
  3762. e ? (this.minDistance = Math.min(e, this.minDistance),
  3763. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3764. this.maxDistance = this.adjustedMaxDistance),
  3765. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3766. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3767. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3768. }
  3769. ,
  3770. n.prototype.toJSON = function() {
  3771. return a.prototype.toJSON.call(this)
  3772. }
  3773. ,
  3774. t.exports = n
  3775. }
  3776. , {
  3777. "../settings": 166,
  3778. "./OutsideControls": 12,
  3779. three: 217
  3780. }],
  3781. 11: [function(e, t, i) {
  3782. "use strict";
  3783. function n(e) {
  3784. a.call(this, e),
  3785. this.minDistance = 15,
  3786. this.maxDistance = 50,
  3787. this.noRotateUpDown = !0,
  3788. this.minPolarAngle = 0,
  3789. this.maxPolarAngle = 0,
  3790. this.mouseActions[l.LEFT] = s.PAN,
  3791. this.mouseActions[l.MIDDLE] = s.DOLLY,
  3792. this.mouseActions[l.RIGHT] = s.ROTATE,
  3793. this.touchActions[1] = s.PAN,
  3794. this.touchActions[2] = s.ROTATE_DOLLY,
  3795. this.absoluteScale = 1,
  3796. this.currentScale = 1
  3797. }
  3798. var r = e("three")
  3799. , o = e("../settings")
  3800. , a = e("./OutsideControls")
  3801. , s = e("../enum/ControlActions")
  3802. , l = e("../enum/MouseButton")
  3803. , c = e("../util/math")
  3804. , h = e("../util/browser");
  3805. n.prototype = Object.create(a.prototype),
  3806. n.prototype.zoomToContain = function(e) {
  3807. this.absoluteScale = this.getDefaultAbsoluteScale(e);
  3808. this.currentScale = this.absoluteScale
  3809. }
  3810. ,
  3811. n.prototype.getDefaultAbsoluteScale = function(modelSize) {
  3812. var t = Math.max(modelSize.x, modelSize.z)
  3813. , i = Math.min(modelSize.x, modelSize.z)
  3814. , n = Math.max(t, i * this.camera.aspect)
  3815. , r = Math.max(i, t * this.camera.aspect);
  3816. var absoluteScale = (h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase * 1.2
  3817. return absoluteScale
  3818. },
  3819. n.prototype.rotateToView = function(e, t) {
  3820. var i = 0
  3821. , n = h.aspectRatio() < 1
  3822. , r = e.x < e.z;
  3823. n === r ? t.z > 0 && (i = Math.PI) : i = t.x > 0 ? Math.PI / 2 : -Math.PI / 2,
  3824. this.rotateLeft(i),
  3825. this.update(0)
  3826. }
  3827. ,
  3828. n.prototype.pan = function(e, t) {
  3829. this.camera.updateMatrix(),
  3830. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3831. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3832. }
  3833. ,
  3834. n.prototype.updateZoom = function() {
  3835. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3836. this.absoluteScale = Math.max(o.zoomNearLimit, Math.min(this.absoluteScale, o.zoomFarLimit)),
  3837. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3838. this.camera.left = -o.orthoBase * this.currentScale,
  3839. this.camera.right = o.orthoBase * this.currentScale,
  3840. this.camera.top = o.orthoBase * this.currentScale / this.camera.aspect,
  3841. this.camera.bottom = -o.orthoBase * this.currentScale / this.camera.aspect,
  3842. this.camera.updateProjectionMatrix(),
  3843. this.offset.length()
  3844. }
  3845. ,
  3846. n.prototype.toJSON = function() {
  3847. var e = new r.Quaternion
  3848. , t = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  3849. , i = new r.Quaternion;
  3850. return function() {
  3851. var n = a.prototype.toJSON.call(this);
  3852. return e.copy(n.camera_quaternion),
  3853. i.copy(t),
  3854. i.multiply(e),
  3855. n.camera_quaternion.x = c.toPrecision(i.x, 4),
  3856. n.camera_quaternion.y = c.toPrecision(i.y, 4),
  3857. n.camera_quaternion.z = c.toPrecision(i.z, 4),
  3858. n.camera_quaternion.w = c.toPrecision(i.w, 4),
  3859. n.ortho_zoom = c.toPrecision(this.currentScale * this.camera.aspect, 4),
  3860. n
  3861. }
  3862. }(),
  3863. t.exports = n
  3864. }
  3865. , {
  3866. "../enum/ControlActions": 20,
  3867. "../enum/MouseButton": 34,
  3868. "../settings": 166,
  3869. "../util/browser": 182,
  3870. "../util/math": 190,
  3871. "./OutsideControls": 12,
  3872. three: 217
  3873. }],
  3874. 12: [function(e, t, i) {
  3875. "use strict";
  3876. function n(e) {
  3877. this.camera = e,
  3878. this.camera.controls = this,
  3879. this.enabled = !1,
  3880. this.target = new r.Vector3,
  3881. this.targetBounds = new r.Box3,
  3882. this.zoomSpeed = 1,
  3883. this.minDistance = 0,
  3884. this.maxDistance = 1 / 0,
  3885. this.noRotateUpDown = !1,
  3886. this.rotateSpeed = 1,
  3887. this.keyboardZoomSpeed = 0,
  3888. this.keyPanSpeed = 7,
  3889. this.autoRotate = !1,
  3890. this.autoRotateSpeed = 2,
  3891. this.autoPan = !1,
  3892. this.autoPanPosition = new r.Vector3,
  3893. this.minPolarAngle = r.Math.degToRad(25),
  3894. this.maxPolarAngle = r.Math.degToRad(65),
  3895. this.rotationAcceleration = new r.Vector2,
  3896. this.rotationSpeed = new r.Vector2,
  3897. this.panAcceleration = new r.Vector2,
  3898. this.panSpeed = new r.Vector2,
  3899. this.rotateStart = new r.Vector2,
  3900. this.rotateEnd = new r.Vector2,
  3901. this.rotateDelta = new r.Vector2,
  3902. this.panStart = new r.Vector2,
  3903. this.panEnd = new r.Vector2,
  3904. this.panDelta = new r.Vector2,
  3905. this.panOffset = new r.Vector3,
  3906. this.offset = new r.Vector3,
  3907. this.dollyStart = new r.Vector2,
  3908. this.dollyEnd = new r.Vector2,
  3909. this.dollyDelta = new r.Vector2,
  3910. this.phiDelta = 0,
  3911. this.thetaDelta = 0,
  3912. this.scale = 1,
  3913. this.panVector = new r.Vector3,
  3914. this.lastPosition = new r.Vector3,
  3915. this.state = c.NONE,
  3916. this.mouseActions = {},
  3917. this.mouseActions[h.LEFT] = c.ROTATE,
  3918. this.mouseActions[h.MIDDLE] = c.DOLLY,
  3919. this.mouseActions[h.RIGHT] = c.PAN,
  3920. this.touchActions = {},
  3921. this.touchActions[1] = c.ROTATE,
  3922. this.touchActions[2] = c.PAN_DOLLY,
  3923. this.lastMoveTime = 0,
  3924. this.pointersLimit = 2,
  3925. this.pointers = []
  3926. }
  3927. var r = e("three")
  3928. , o = e("../settings")
  3929. , a = e("../util/common")
  3930. , s = e("../util/math")
  3931. , l = e("../enum/Vectors")
  3932. , c = e("../enum/ControlActions")
  3933. , h = e("../enum/MouseButton")
  3934. , u = e("../enum/Keys")
  3935. , d = e("../enum/ControlEvents")
  3936. , p = e("events").EventEmitter
  3937. , f = 1e-6;
  3938. n.prototype = Object.create(p.prototype),
  3939. n.prototype.setBounds = function(e) {
  3940. this.targetBounds = e
  3941. }
  3942. ,
  3943. n.prototype.isEngaged = function() {
  3944. return this.state !== c.NONE
  3945. }
  3946. ,
  3947. n.prototype.rotateLeft = function(e) {
  3948. void 0 === e && (e = this.getAutoRotationAngle()),
  3949. this.thetaDelta -= e
  3950. }
  3951. ,
  3952. n.prototype.rotateUp = function(e) {
  3953. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3954. this.phiDelta -= e)
  3955. }
  3956. ,
  3957. n.prototype.panLeft = function(e) {
  3958. var t = this.camera.matrix.elements;
  3959. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3960. this.panOffset.multiplyScalar(-e),
  3961. this.panVector.add(this.panOffset)
  3962. }
  3963. ,
  3964. n.prototype.panUp = function(e) {
  3965. var t = this.camera.matrix.elements;
  3966. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3967. this.panOffset.multiplyScalar(-e),
  3968. this.panVector.add(this.panOffset)
  3969. }
  3970. ,
  3971. n.prototype.startRotating = function(e, t) {
  3972. e && this.navRotationAcc("x", e),
  3973. t && this.navRotationAcc("y", t)
  3974. }
  3975. ,
  3976. n.prototype.stopRotating = function(e) {
  3977. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3978. this.navRotationAcc("x", 0),
  3979. this.navRotationAcc("y", 0)
  3980. }
  3981. ,
  3982. n.prototype.setAutoPanPosition = function(e, t) {
  3983. var i = new r.Vector3
  3984. , n = new r.Vector3;
  3985. return function(e, t) {
  3986. i.copy(this.camera.position),
  3987. void 0 === e && null === e || i.setX(e),
  3988. void 0 === t && null === t || i.setZ(t);
  3989. var r = this.camera.position.distanceTo(this.target)
  3990. , o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3991. this.targetClamped = !1,
  3992. n.copy(i).addScaledVector(o, r),
  3993. this.targetBounds.containsPoint(n) || (this.targetBounds.clampPoint(n, n),
  3994. i.copy(n).addScaledVector(o, -r),
  3995. this.targetClamped = !0),
  3996. this.autoPanPosition.x = i.x,
  3997. this.autoPanPosition.z = i.z,
  3998. this.autoPan && this.stopAutoPanning()
  3999. }
  4000. }(),
  4001. n.prototype.stopAutoPanning = function() {
  4002. var e = this.autoPan;
  4003. this.autoPan = !1,
  4004. this.emit(this.targetClamped ? d.AutoPanClamped : e ? d.AutoPanInterrupt : d.AutoPanComplete)
  4005. }
  4006. ,
  4007. n.prototype.dollyIn = function(e) {
  4008. void 0 === e && (e = this.getZoomScale()),
  4009. this.scale /= e
  4010. }
  4011. ,
  4012. n.prototype.dollyOut = function(e) {
  4013. void 0 === e && (e = this.getZoomScale()),
  4014. this.scale *= e
  4015. }
  4016. ,
  4017. n.prototype.updatePan = function(e) {
  4018. if (this.panSpeed.multiplyScalar(1 - o.panFriction).addScaledVector(this.panAcceleration, o.panAccelerationOutside * e),
  4019. this.pan(-this.panSpeed.x, this.panSpeed.y),
  4020. this.autoPan) {
  4021. var t = (new r.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  4022. t.setY(0).clampLength(0, 50 * e),
  4023. this.target.add(t),
  4024. this.camera.position.add(t),
  4025. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  4026. this.stopAutoPanning())
  4027. }
  4028. }
  4029. ,
  4030. n.prototype.update = function(e) {
  4031. e || (e = 1 / 60),
  4032. this.rotationSpeed.multiplyScalar(1 - o.rotationFriction).addScaledVector(this.rotationAcceleration, o.rotationAccelerationOutside * e),
  4033. this.rotateLeft(-this.rotationSpeed.x),
  4034. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  4035. this.updatePan(e);
  4036. var t = this.camera.position;
  4037. this.offset.copy(t).sub(this.target);
  4038. var i = Math.atan2(this.offset.x, this.offset.z)
  4039. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  4040. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  4041. i += this.thetaDelta,
  4042. n += this.phiDelta,
  4043. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  4044. n = Math.max(f, Math.min(Math.PI - f, n));
  4045. var r = this.updateZoom();
  4046. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  4047. this.target.add(this.panVector),
  4048. this.targetBounds.clampPoint(this.target, this.target),
  4049. this.offset.x = r * Math.sin(n) * Math.sin(i),
  4050. this.offset.y = r * Math.cos(n),
  4051. this.offset.z = r * Math.sin(n) * Math.cos(i),
  4052. t.copy(this.target).add(this.offset),
  4053. this.camera.lookAt(this.target),
  4054. this.thetaDelta = 0,
  4055. this.phiDelta = 0,
  4056. this.scale = 1,
  4057. this.panVector.set(0, 0, 0),
  4058. this.lastPosition.distanceTo(this.camera.position) > 0 && this.lastPosition.copy(this.camera.position)
  4059. }
  4060. ,
  4061. n.prototype.getAutoRotationAngle = function() {
  4062. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  4063. }
  4064. ,
  4065. n.prototype.getZoomScale = function() {
  4066. return Math.pow(.95, this.zoomSpeed)
  4067. }
  4068. ,
  4069. n.prototype.onMouseDown = function(e) {
  4070. if (this.enabled) {
  4071. switch (e.preventDefault(),
  4072. this.stopAutoPanning(),
  4073. this.mouseDown = !0,
  4074. this.state = this.mouseActions[e.button],
  4075. this.state) {
  4076. case c.ROTATE:
  4077. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  4078. this.rotationSpeed.set(0, 0);
  4079. break;
  4080. case c.DOLLY:
  4081. this.dollyStart.set(e.clientX, e.clientY);
  4082. break;
  4083. case c.PAN:
  4084. this.panStart.set(e.clientX, e.clientY)
  4085. }
  4086. this.emit(d.InputStart, "mouse")
  4087. }
  4088. }
  4089. ,
  4090. n.prototype.onMouseMove = function(e) {
  4091. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  4092. switch (e.preventDefault(),
  4093. this.state) {
  4094. case c.ROTATE:
  4095. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  4096. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  4097. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  4098. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  4099. this.rotateStart.copy(this.rotateEnd);
  4100. break;
  4101. case c.DOLLY:
  4102. this.dollyEnd.set(e.clientX, e.clientY),
  4103. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart);
  4104. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut;
  4105. t.call(this),
  4106. this.dollyStart.copy(this.dollyEnd);
  4107. break;
  4108. case c.PAN:
  4109. this.panEnd.set(e.clientX, e.clientY),
  4110. this.panDelta.subVectors(this.panEnd, this.panStart),
  4111. this.pan(this.panDelta.x, this.panDelta.y),
  4112. this.panStart.copy(this.panEnd)
  4113. }
  4114. this.emit(d.Move, "mouse"),
  4115. this.lastMoveTime = e.timeStamp,
  4116. this.update()
  4117. }
  4118. }
  4119. ,
  4120. n.prototype.onMouseUp = function(e) {
  4121. this.enabled && (this.mouseDown = !1,
  4122. this.state = c.NONE,
  4123. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  4124. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  4125. this.update(),
  4126. this.rotationAcceleration.set(0, 0),
  4127. this.rotateDelta.set(0, 0)))
  4128. }
  4129. ,
  4130. n.prototype.onMouseOver = function(e) {
  4131. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4132. }
  4133. ,
  4134. n.prototype.onMouseWheel = function(e) {
  4135. if (this.enabled && o.useWheel) {
  4136. this.emit(d.Move, "wheel");
  4137. var t = e.wheelDelta || -e.detail
  4138. , i = t > 0 ? this.dollyOut : this.dollyIn;
  4139. i.call(this),
  4140. this.update()
  4141. }
  4142. }
  4143. ,
  4144. n.prototype.onKeyDown = function(e) {
  4145. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4146. this.handleKeyDown(e.which)))
  4147. }
  4148. ,
  4149. n.prototype.navRotationAcc = function(e, t) {
  4150. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  4151. }
  4152. ,
  4153. n.prototype.navPanAcc = function(e, t) {
  4154. this.stopAutoPanning(),
  4155. this.panAcceleration[e] = t
  4156. }
  4157. ,
  4158. n.prototype.handleKeyDown = function(e) {
  4159. var t = !0;
  4160. switch (e) {
  4161. case u.UPARROW:
  4162. case u.I:
  4163. this.navRotationAcc("y", 1);
  4164. break;
  4165. case u.DOWNARROW:
  4166. case u.K:
  4167. this.navRotationAcc("y", -1);
  4168. break;
  4169. case u.LEFTARROW:
  4170. case u.J:
  4171. this.navRotationAcc("x", -1);
  4172. break;
  4173. case u.RIGHTARROW:
  4174. case u.L:
  4175. this.navRotationAcc("x", 1);
  4176. break;
  4177. case u.W:
  4178. this.navPanAcc("y", 1);
  4179. break;
  4180. case u.S:
  4181. this.navPanAcc("y", -1);
  4182. break;
  4183. case u.A:
  4184. this.navPanAcc("x", -1);
  4185. break;
  4186. case u.D:
  4187. this.navPanAcc("x", 1);
  4188. break;
  4189. default:
  4190. t = !1
  4191. }
  4192. t && this.emit(d.Move, "key")
  4193. }
  4194. ,
  4195. n.prototype.onKeyUp = function(e) {
  4196. this.enabled && (e.preventDefault(),
  4197. e.stopPropagation(),
  4198. this.handleKeyUp(e.which))
  4199. }
  4200. ,
  4201. n.prototype.handleKeyUp = function(e) {
  4202. switch (e) {
  4203. case u.I:
  4204. case u.K:
  4205. case u.UPARROW:
  4206. case u.DOWNARROW:
  4207. this.keyboardZoomSpeed = 0,
  4208. this.rotationAcceleration.y = 0;
  4209. break;
  4210. case u.J:
  4211. case u.L:
  4212. case u.LEFTARROW:
  4213. case u.RIGHTARROW:
  4214. this.rotationAcceleration.x = 0;
  4215. break;
  4216. case u.S:
  4217. case u.W:
  4218. this.panAcceleration.y = 0;
  4219. break;
  4220. case u.A:
  4221. case u.D:
  4222. this.panAcceleration.x = 0
  4223. }
  4224. }
  4225. ,
  4226. n.prototype.onTouchStart = function(e) {
  4227. if (this.enabled || this.state === c.NONE) {
  4228. e.preventDefault(),
  4229. e.stopPropagation(),
  4230. this.stopAutoPanning();
  4231. var t = function() {
  4232. if (2 === e.touches.length) {
  4233. var t = e.touches[0].pageX - e.touches[1].pageX
  4234. , i = e.touches[0].pageY - e.touches[1].pageY;
  4235. this.dollyStart.set(t, i)
  4236. }
  4237. }
  4238. .bind(this)
  4239. , i = function() {
  4240. this.panStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  4241. }
  4242. .bind(this)
  4243. , n = function() {
  4244. this.rotateStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  4245. }
  4246. .bind(this);
  4247. switch (this.state = this.touchActions[e.touches.length],
  4248. this.state) {
  4249. case c.PAN_DOLLY:
  4250. t();
  4251. case c.PAN:
  4252. i();
  4253. break;
  4254. case c.ROTATE_DOLLY:
  4255. t();
  4256. case c.ROTATE:
  4257. n()
  4258. }
  4259. this.rotationSpeed.set(0, 0),
  4260. this.emit(d.InputStart, "touch")
  4261. }
  4262. }
  4263. ,
  4264. n.prototype.onTouchMove = function(e) {
  4265. if (this.enabled && this.state !== c.NONE) {
  4266. e.preventDefault(),
  4267. e.stopPropagation();
  4268. var t = function() {
  4269. var t = e.touches[0].pageX - e.touches[1].pageX
  4270. , i = e.touches[0].pageY - e.touches[1].pageY;
  4271. this.dollyEnd.set(t, i);
  4272. var n = this.dollyStart.length() - this.dollyEnd.length();
  4273. n > 0 ? this.dollyOut(1 + n / 500) : this.dollyIn(1 - n / 500),
  4274. this.dollyStart.copy(this.dollyEnd)
  4275. }
  4276. .bind(this)
  4277. , i = function() {
  4278. this.panEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  4279. this.panDelta.subVectors(this.panEnd, this.panStart),
  4280. this.pan(this.panDelta.x, this.panDelta.y),
  4281. this.panStart.copy(this.panEnd),
  4282. this.rotateDelta.set(0, 0)
  4283. }
  4284. .bind(this)
  4285. , n = function() {
  4286. this.rotateEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  4287. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  4288. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  4289. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  4290. this.rotateStart.copy(this.rotateEnd)
  4291. }
  4292. .bind(this)
  4293. , r = function() {
  4294. if (2 === e.touches.length) {
  4295. var i = window.devicePixelRatio || 1
  4296. , r = e.touches[1].pageX - e.touches[0].pageX
  4297. , s = e.touches[1].pageY - e.touches[0].pageY
  4298. , l = Math.sqrt(r * r + s * s)
  4299. , h = Math.abs(this.dollyStart.length() - l);
  4300. if (h > o.input.touchMoveThreshold * i)
  4301. this.state = c.DOLLY,
  4302. t();
  4303. else {
  4304. var u = a.average(e.touches, "pageX")
  4305. , d = a.average(e.touches, "pageY")
  4306. , p = this.rotateDelta.set(u, d).sub(this.rotateStart).length();
  4307. p > o.input.touchMoveThreshold && (this.state = c.ROTATE,
  4308. this.rotateStart.set(u, d),
  4309. n())
  4310. }
  4311. }
  4312. }
  4313. .bind(this);
  4314. switch (this.state) {
  4315. case c.PAN_DOLLY:
  4316. t();
  4317. case c.PAN:
  4318. i();
  4319. break;
  4320. case c.ROTATE_DOLLY:
  4321. r();
  4322. break;
  4323. case c.DOLLY:
  4324. t();
  4325. break;
  4326. case c.ROTATE:
  4327. n();
  4328. break;
  4329. default:
  4330. this.state = c.NONE
  4331. }
  4332. this.lastMoveTime = e.timeStamp,
  4333. this.emit(d.Move, "touch")
  4334. }
  4335. }
  4336. ,
  4337. n.prototype.onTouchEnd = function(e) {
  4338. this.enabled && (this.state === c.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  4339. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  4340. this.state = c.NONE,
  4341. this.update(),
  4342. this.rotationAcceleration.set(0, 0),
  4343. this.rotateDelta.set(0, 0))
  4344. }
  4345. ,
  4346. n.prototype.onPointerDown = function(e) {
  4347. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4348. id: e.pointerId,
  4349. pageX: e.pageX,
  4350. pageY: e.pageY
  4351. }),
  4352. e.touches = this.pointers,
  4353. this.onTouchStart(e)),
  4354. this.emit(d.InputStart, "pointer"))
  4355. }
  4356. ,
  4357. n.prototype.onPointerMove = function(e) {
  4358. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  4359. e.pointerId === t.id && (t.pageX = e.pageX,
  4360. t.pageY = e.pageY)
  4361. }),
  4362. e.touches = this.pointers,
  4363. this.onTouchMove(e))
  4364. }
  4365. ,
  4366. n.prototype.onPointerUp = function(e) {
  4367. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  4368. e.pointerId === t.id && this.pointers.splice(i, 1)
  4369. }
  4370. .bind(this)),
  4371. e.touches = this.pointers,
  4372. this.onTouchEnd(e))
  4373. }
  4374. ,
  4375. n.prototype.reset = function() {
  4376. this.state = c.NONE,
  4377. this.stopAutoPanning(),
  4378. this.rotationSpeed.set(0, 0),
  4379. this.rotationAcceleration.set(0, 0),
  4380. this.panSpeed.set(0, 0),
  4381. this.panAcceleration.set(0, 0)
  4382. }
  4383. ,
  4384. n.prototype.toJSON = function() {
  4385. var e = {
  4386. camera_position: {
  4387. x: s.toPrecision(this.camera.position.x, 4),
  4388. y: s.toPrecision(this.camera.position.y, 4),
  4389. z: s.toPrecision(this.camera.position.z, 4)
  4390. },
  4391. camera_quaternion: {
  4392. x: s.toPrecision(this.camera.quaternion.x, 4),
  4393. y: s.toPrecision(this.camera.quaternion.y, 4),
  4394. z: s.toPrecision(this.camera.quaternion.z, 4),
  4395. w: s.toPrecision(this.camera.quaternion.w, 4)
  4396. }
  4397. };
  4398. return e
  4399. }
  4400. ,
  4401. t.exports = n
  4402. }
  4403. , {
  4404. "../enum/ControlActions": 20,
  4405. "../enum/ControlEvents": 21,
  4406. "../enum/Keys": 30,
  4407. "../enum/MouseButton": 34,
  4408. "../enum/Vectors": 50,
  4409. "../settings": 166,
  4410. "../util/common": 185,
  4411. "../util/math": 190,
  4412. events: 202,
  4413. three: 217
  4414. }],
  4415. 13: [function(e, t, i) {
  4416. (function(i) {
  4417. "use strict";
  4418. function n(e) {
  4419. this.camera = e,
  4420. this.camera.controls = this,
  4421. this.target = new r.Vector3(0,0,0),
  4422. this.lookVector = new r.Vector3,
  4423. this.lookSpeed = .05,
  4424. this.rotationAcc = new r.Vector2,
  4425. this.rotationSpeed = new r.Vector2,
  4426. this.lat = 0,
  4427. this.lon = 0,
  4428. this.phi = 0,
  4429. this.theta = 0,
  4430. this.enabled = !1,
  4431. this.locked = !1,
  4432. this.pointer = new r.Vector2(0,0),
  4433. this.rotationHistory = [],
  4434. this.rotationDifference = new r.Vector2,
  4435. this.pointerDragOn = !1,
  4436. this.pointerDragStart = new r.Vector2(0,0),
  4437. this.pinchDistance = 0,
  4438. this.moveStart = new r.Vector2,
  4439. this.moveTolerance = .01,
  4440. this.pointersLimit = 2,
  4441. this.pointers = []
  4442. }
  4443. var r = e("three")
  4444. , o = e("../util/logger")
  4445. , a = e("../settings")
  4446. , s = e("../util/common")
  4447. , l = e("../util/math")
  4448. , c = (e("../enum/Vectors"),
  4449. e("../enum/MouseButton"))
  4450. , h = e("../enum/Keys")
  4451. , u = e("../enum/ControlEvents")
  4452. , d = e("events").EventEmitter;
  4453. new o(i);
  4454. n.prototype = Object.create(d.prototype),
  4455. n.prototype.usable = function() {
  4456. return this.enabled && !this.locked
  4457. }
  4458. ,
  4459. n.prototype.lookAt = function(e) {
  4460. var t = this.camera.position.clone().sub(e)
  4461. , i = Math.atan(t.z / t.x);
  4462. i += t.x < 0 ? Math.PI : 0,
  4463. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  4464. this.lon = r.Math.radToDeg(i) + 180;
  4465. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4466. , o = Math.atan(t.y / n);
  4467. this.lat = -r.Math.radToDeg(o)
  4468. }
  4469. ,
  4470. n.prototype.startRotationFrom = function(e, t) {
  4471. l.convertScreenPositionToNDC(e, t, this.pointer),
  4472. this.pointerDragOn = !0,
  4473. this.pointerDragStart.copy(this.pointer),
  4474. this.moveStart.copy(this.pointer),
  4475. this.rotationHistory = [],
  4476. this.rotationSpeed.set(0, 0)
  4477. }
  4478. ,
  4479. n.prototype.onMouseOver = function(e) {
  4480. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4481. }
  4482. ,
  4483. n.prototype.onTouchStart = function(e) {
  4484. if (this.usable()) {
  4485. switch (e.preventDefault(),
  4486. e.stopPropagation(),
  4487. e.touches.length) {
  4488. case 1:
  4489. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4490. break;
  4491. case 2:
  4492. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4493. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  4494. this.pinchDistance = Math.sqrt(t * t + i * i)
  4495. }
  4496. this.emit(u.InputStart, "touch")
  4497. }
  4498. }
  4499. ,
  4500. n.prototype.onPointerDown = function(e) {
  4501. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4502. id: e.pointerId,
  4503. clientX: e.clientX,
  4504. clientY: e.clientY
  4505. }),
  4506. e.touches = this.pointers,
  4507. this.onTouchStart(e),
  4508. this.emit(u.InputStart, "pointer"))
  4509. }
  4510. ,
  4511. n.prototype.onMouseDown = function(e) {
  4512. if (this.usable()) {
  4513. switch (e.preventDefault(),
  4514. e.stopPropagation(),
  4515. e.button) {
  4516. case c.LEFT:
  4517. this.startRotationFrom(e.clientX, e.clientY)
  4518. }
  4519. this.emit(u.InputStart, "mouse")
  4520. }
  4521. }
  4522. ,
  4523. n.prototype.updateRotation = function() {
  4524. if (this.usable() && this.pointerDragOn) {
  4525. var e = new r.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4526. , t = new r.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4527. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4528. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4529. , o = Math.atan2(e.y, i)
  4530. , a = Math.atan2(t.y, n);
  4531. this.rotationDifference.y = r.Math.radToDeg(o - a),
  4532. e.y = 0,
  4533. t.y = 0;
  4534. var s = Math.acos(e.dot(t) / e.length() / t.length());
  4535. isNaN(s) || (this.rotationDifference.x = r.Math.radToDeg(s),
  4536. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4537. this.pointerDragStart.copy(this.pointer)
  4538. }
  4539. }
  4540. ,
  4541. n.prototype.onMouseMove = function(e) {
  4542. this.usable() && (l.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4543. this.pointerDragOn && (Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance || Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) && this.emit(u.Move, "mouse"))
  4544. }
  4545. ,
  4546. n.prototype.onTouchMove = function(e) {
  4547. if (this.usable())
  4548. switch (this.emit(u.Move, "touch"),
  4549. e.touches.length) {
  4550. case 1:
  4551. l.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4552. break;
  4553. case 2:
  4554. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4555. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4556. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4557. Math.abs(n) > .01 && (this.emit(u.InteractionDirect),
  4558. this.emit(u.Pinch, n),
  4559. this.pinchDistance -= n)
  4560. }
  4561. }
  4562. ,
  4563. n.prototype.onPointerMove = function(e) {
  4564. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  4565. e.pointerId === t.id && (t.clientX = e.clientX,
  4566. t.clientY = e.clientY)
  4567. }),
  4568. e.touches = this.pointers,
  4569. this.onTouchMove(e))
  4570. }
  4571. ,
  4572. n.prototype.endRotation = function() {
  4573. this.pointerDragOn = !1;
  4574. var e = s.averageVectors(this.rotationHistory);
  4575. this.rotationSpeed.set(e.x * a.rotationAfterMoveMultiplier, e.y * a.rotationAfterMoveMultiplier)
  4576. }
  4577. ,
  4578. n.prototype.onTouchEnd = function(e) {
  4579. this.usable() && (e.preventDefault(),
  4580. e.stopPropagation(),
  4581. this.endRotation())
  4582. }
  4583. ,
  4584. n.prototype.onMouseUp = function(e) {
  4585. this.usable() && (e.preventDefault(),
  4586. e.stopPropagation(),
  4587. this.endRotation())
  4588. }
  4589. ,
  4590. n.prototype.onPointerUp = function(e) {
  4591. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  4592. e.pointerId === t.id && this.pointers.splice(i, 1)
  4593. }
  4594. .bind(this)),
  4595. e.touches = this.pointers,
  4596. this.onTouchEnd(e))
  4597. }
  4598. ,
  4599. n.prototype.update = function(e) {
  4600. this.lon,
  4601. this.lat;
  4602. for (this.updateRotation(),
  4603. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > a.rotationAfterMoveHistoryCount; )
  4604. this.rotationHistory.shift();
  4605. this.lon += this.rotationDifference.x,
  4606. this.lat += this.rotationDifference.y,
  4607. this.rotationDifference.set(0, 0),
  4608. this.rotationSpeed.x = this.rotationSpeed.x * (1 - a.rotationFriction) + this.rotationAcc.x * a.rotationAccelerationInside,
  4609. this.rotationSpeed.y = this.rotationSpeed.y * (1 - a.rotationFriction) + this.rotationAcc.y * a.rotationAccelerationInside,
  4610. this.lon += this.rotationSpeed.x * e,
  4611. this.lat += this.rotationSpeed.y * e
  4612. //this.lat = Math.max(a.insideLookLimitDown, Math.min(a.insideLookLimitUp, this.lat)),
  4613. var insideLookLimitDown = a.insideLookLimitDown - a.insideFOV/2 + this.camera.fov / 2
  4614. var insideLookLimitUp = a.insideLookLimitUp + a.insideFOV/2 - this.camera.fov / 2
  4615. 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 );
  4616. this.phi = r.Math.degToRad(90 - this.lat),
  4617. this.theta = r.Math.degToRad(this.lon),
  4618. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4619. this.lookVector.y = Math.cos(this.phi),
  4620. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4621. this.target.copy(this.lookVector).add(this.camera.position),
  4622. this.camera.lookAt(this.target)
  4623. }
  4624. ,
  4625. n.prototype.onMouseWheel = function(e) {
  4626. if (this.usable()) {
  4627. var t = e.wheelDelta || -e.detail;
  4628. this.emit(u.InteractionDirect),
  4629. this.emit(u.Scroll, t)
  4630. }
  4631. }
  4632. ,
  4633. n.prototype.onKeyDown = function(e) {
  4634. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4635. this.handleKeyDown(e.which)))
  4636. }
  4637. ,
  4638. n.prototype.handleKeyDown = function(e) {
  4639. var t = function(e, t) {
  4640. this.rotationAcc[e] = t
  4641. }
  4642. .bind(this);
  4643. this.emit(u.InteractionKey);
  4644. var i = !0;
  4645. switch (e) {
  4646. case h.LEFTARROW:
  4647. case h.J:
  4648. t("x", -1);
  4649. break;
  4650. case h.RIGHTARROW:
  4651. case h.L:
  4652. t("x", 1);
  4653. break;
  4654. case h.I:
  4655. t("y", 1);
  4656. break;
  4657. case h.K:
  4658. t("y", -1);
  4659. break;
  4660. default:
  4661. i = !1
  4662. }
  4663. i && this.emit(u.Move, "key")
  4664. if(e == 27){
  4665. if(exit){
  4666. $(exit).click()
  4667. }
  4668. window.player.closePopup()
  4669. }
  4670. }
  4671. ,
  4672. n.prototype.onKeyUp = function(e) {
  4673. this.usable() && (e.preventDefault(),
  4674. e.stopPropagation(),
  4675. this.handleKeyUp(e.which))
  4676. }
  4677. ,
  4678. n.prototype.handleKeyUp = function(e) {
  4679. switch (e) {
  4680. case h.LEFTARROW:
  4681. case h.J:
  4682. case h.RIGHTARROW:
  4683. case h.L:
  4684. this.rotationAcc.x = 0;
  4685. break;
  4686. case h.I:
  4687. case h.K:
  4688. this.rotationAcc.y = 0
  4689. }
  4690. }
  4691. ,
  4692. n.prototype.startRotating = function(e, t) {
  4693. e && (this.rotationAcc.x = e),
  4694. t && (this.rotationAcc.y = t)
  4695. }
  4696. ,
  4697. n.prototype.stopRotating = function(e) {
  4698. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4699. this.rotationAcc.set(0, 0)
  4700. }
  4701. ,
  4702. n.prototype.reset = function() {
  4703. this.pointerDragOn = !1,
  4704. this.rotationAcc.set(0, 0),
  4705. this.rotationSpeed.set(0, 0),
  4706. this.pointers = []
  4707. }
  4708. ,
  4709. n.prototype.toJSON = function() {
  4710. var e = {
  4711. camera_position: {
  4712. x: l.toPrecision(this.camera.position.x, 4),
  4713. y: l.toPrecision(this.camera.position.y, 4),
  4714. z: l.toPrecision(this.camera.position.z, 4)
  4715. },
  4716. camera_quaternion: {
  4717. x: l.toPrecision(this.camera.quaternion.x, 4),
  4718. y: l.toPrecision(this.camera.quaternion.y, 4),
  4719. z: l.toPrecision(this.camera.quaternion.z, 4),
  4720. w: l.toPrecision(this.camera.quaternion.w, 4)
  4721. }
  4722. };
  4723. return e
  4724. }
  4725. ,
  4726. n.prototype.setStateFromJSON = function(e) {
  4727. this.camera.position.copy(e.camera_position),
  4728. this.camera.quaternion.copy(e.camera_quaternion)
  4729. }
  4730. ,
  4731. t.exports = n
  4732. }
  4733. ).call(this, "/js/controls/PanoramaControls.js")
  4734. }
  4735. , {
  4736. "../enum/ControlEvents": 21,
  4737. "../enum/Keys": 30,
  4738. "../enum/MouseButton": 34,
  4739. "../enum/Vectors": 50,
  4740. "../settings": 166,
  4741. "../util/common": 185,
  4742. "../util/logger": 189,
  4743. "../util/math": 190,
  4744. events: 202,
  4745. three: 217
  4746. }],
  4747. 14: [function(e, t, i) {
  4748. (function(i) {
  4749. "use strict";
  4750. var n = e("three")
  4751. , r = e("../enum/Viewmode")
  4752. , o = e("../util/logger")
  4753. , a = new o(i);
  4754. t.exports = {
  4755. serialize: function(e) {
  4756. return encodeURI(JSON.stringify(e))
  4757. },
  4758. deserialize: function(e) {
  4759. function t(e) {
  4760. function t(e, t) {
  4761. return e && "number" == typeof t && !isNaN(t)
  4762. }
  4763. return e.reduce(t, !0)
  4764. }
  4765. try {
  4766. var i = JSON.parse(decodeURI(e))
  4767. , o = {
  4768. mode: r.fromInt(i.camera_mode),
  4769. panoId: i.scan_id,
  4770. position: (new n.Vector3).copy(i.camera_position),
  4771. quaternion: (new n.Quaternion).copy(i.camera_quaternion),
  4772. zoom: i.ortho_zoom,
  4773. floorVisibility: i.floor_visibility
  4774. }
  4775. , s = o.position;
  4776. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0);
  4777. var l = o.quaternion;
  4778. return t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1),
  4779. o
  4780. } catch (i) {
  4781. a.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4782. try {
  4783. var c = e.split(",")
  4784. , h = {
  4785. x: parseFloat(c[2]),
  4786. y: parseFloat(c[3]),
  4787. z: parseFloat(c[4])
  4788. }
  4789. , u = {
  4790. x: parseFloat(c[5]),
  4791. y: parseFloat(c[6]),
  4792. z: parseFloat(c[7]),
  4793. w: parseFloat(c[8])
  4794. };
  4795. return t([h.x, h.y, h.z]) || (h.x = 0,
  4796. h.y = 0,
  4797. h.z = 0),
  4798. t([u.x, u.y, u.z, u.w]) || (u.x = 0,
  4799. u.y = 0,
  4800. u.z = 0,
  4801. u.w = 1),
  4802. {
  4803. mode: r.fromInt(c[0]),
  4804. panoId: c[1],
  4805. position: (new n.Vector3).copy(h),
  4806. quaternion: (new n.Quaternion).copy(u)
  4807. }
  4808. } catch (t) {
  4809. a.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4810. }
  4811. }
  4812. return null
  4813. }
  4814. }
  4815. }
  4816. ).call(this, "/js/controls/serializer.js")
  4817. }
  4818. , {
  4819. "../enum/Viewmode": 51,
  4820. "../util/logger": 189,
  4821. three: 217
  4822. }],
  4823. 15: [function(e, t, i) {
  4824. (function(i) {
  4825. "use strict";
  4826. function n() {
  4827. this.endlessLoop = a.warp.loop,
  4828. this.clock = new r.Clock(!0),
  4829. this.model = null,
  4830. this.player = null,
  4831. this.currentItem = null,
  4832. this.destinationItem = null,
  4833. this.tourIsPlaying = !1,
  4834. this.transitionStage = y.None,
  4835. this.nextFunc = null,
  4836. this.onTheBus = !1,
  4837. this.tourInProgress = !1,
  4838. this.reachSource = null,
  4839. this.interrupted = !1,
  4840. this.nItems = 0,
  4841. this.walkingSectionPaused = !1
  4842. }
  4843. var r = e("three")
  4844. , o = e("./util/logger")
  4845. , a = e("./settings")
  4846. , s = e("./util/transitions")
  4847. , l = e("events").EventEmitter
  4848. , c = e("./enum/Viewmode")
  4849. , h = e("./analytics")
  4850. , u = e("./enum/WarpStyle")
  4851. , s = e("./util/transitions")
  4852. , d = (e("./model/ModelManager"),
  4853. e("./enum/ModelManagerEvents"))
  4854. , p = e("./enum/DirectorEvents")
  4855. , f = e("./enum/PlayerEvents")
  4856. , g = (e("./enum/ControlEvents"),
  4857. e("./enum/BlackoutStyle"))
  4858. , m = e("./enum/PathDiscardMode")
  4859. , v = e("./enum/PathDisplayMode")
  4860. , A = (e("./player"),
  4861. new o(i))
  4862. , y = Object.freeze({
  4863. None: 0,
  4864. Moving: 1,
  4865. Aiming: 2,
  4866. Interlude: 3
  4867. })
  4868. , C = Object.freeze({
  4869. Forward: 1,
  4870. NoChange: 0,
  4871. Backwards: -1
  4872. })
  4873. , I = s.getUniqueId();
  4874. n.prototype = Object.create(l.prototype),
  4875. n.prototype.init = function(e, t) {
  4876. this.player = e,
  4877. this.modelManager = t,
  4878. this.updateModel(),
  4879. this.resetAll(),
  4880. this.bindEvents()
  4881. }
  4882. ,
  4883. n.prototype.resetAll = function() {
  4884. if (this.currentItem = null,
  4885. this.destinationItem = null,
  4886. this.tourIsPlaying = !1,
  4887. this.bgmReplay(),//xzw
  4888. this.transitionStage = y.None,
  4889. this.nextFunc = null,
  4890. this.onTheBus = !1,
  4891. this.reachSource = null,
  4892. this.interrupted = !1,
  4893. this.model) {
  4894. var e = a.path.typ === u.WALK ? u.WALK : u.STD;
  4895. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && this.model.data.player_options.fast_transitions === !1 ? e : u.BLACK
  4896. } else
  4897. this.defaultWarpStyle = u.BLACK,
  4898. A.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4899. this.resetSpecialTransition()
  4900. }
  4901. ,
  4902. n.prototype.updateModel = function() {
  4903. this.model = this.modelManager.getActiveModel(),
  4904. this.nItems = this.model.heroLocations.length
  4905. }
  4906. ,
  4907. n.prototype.bindEvents = function() {
  4908. this.modelManager.on(d.ActiveModelChanged, this.updateModel.bind(this)),
  4909. this.player.on(f.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4910. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  4911. this.player.on(f.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4912. this.player.on(f.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4913. this.player.on(f.InputStart, this.handlePlayerInputStart.bind(this)),
  4914. this.player.on(f.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4915. this.player.once(f.Move, function() {
  4916. s.cancelById(I)
  4917. })
  4918. }
  4919. ,
  4920. n.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4921. return e === u.WALK && (this.interrupt(g.NONE),
  4922. this.pauseWalkingSection(),
  4923. this.player.fastForwardActivePanoFlight(),
  4924. !0)
  4925. }
  4926. ,
  4927. n.prototype.handlePlayerMove = function(e) {
  4928. this.transitionStage === y.Interlude && this.interrupt(g.NONE),
  4929. this.emit("update.controls")
  4930. }
  4931. ,
  4932. n.prototype.handlePlayerPanoChosen = function(e, t) {
  4933. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4934. this.emit("update.controls"))
  4935. }
  4936. ,
  4937. n.prototype.handlePlayerModeChanged = function(e, t) {
  4938. this.intermediateState() || e === t || (this.onTheBus = !1,
  4939. this.emit("update.controls"))
  4940. }
  4941. ,
  4942. n.prototype.handlePlayerInputStart = function(e) {
  4943. this.transitionStage === y.Interlude && this.interrupt(g.NONE)
  4944. }
  4945. ,
  4946. n.prototype.handlePlayerFlyingStarted = function() {
  4947. this.clearWalkingSectionPaused()
  4948. }
  4949. ,
  4950. n.prototype.describe = function() {
  4951. return {
  4952. nItems: this.nItems,
  4953. currentItem: this.currentItem,
  4954. destinationItem: this.destinationItem,
  4955. tourIsPlaying: this.tourIsPlaying,
  4956. onTheBus: this.onTheBus,
  4957. endlessLoop: this.endlessLoop,
  4958. viewMode: this.player.mode,
  4959. inTransition: this._inTransition(),
  4960. transitionStage: this.transitionStage,
  4961. tourInProgress: this.tourInProgress
  4962. }
  4963. }
  4964. ,
  4965. n.prototype._inTransition = function() {
  4966. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === c.TRANSITIONING || this.tourIsPlaying
  4967. }
  4968. ,
  4969. n.prototype.bounceable = function() {
  4970. var e = this.clock.getDelta();
  4971. return this.isInterrupted() || e < .9 && e > .01 || this.player.flying && !this.player.isWarping()
  4972. }
  4973. ,
  4974. n.prototype.itemCompare = function(item1, item2, type){//add
  4975. if(type == 'equal'){//==
  4976. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  4977. }else if(type == 'less'){//<
  4978. return item1 && item2 && (item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
  4979. }
  4980. }
  4981. n.prototype.currentMoveDirection = function() {
  4982. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4983. 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
  4984. }
  4985. ,
  4986. n.prototype.clearPath = function() {
  4987. this._inTransition() || this.player.path.discardPathObject()
  4988. }
  4989. ,
  4990. n.prototype.allFloors = function() {
  4991. this.model.toggleAllFloors()
  4992. }
  4993. ,
  4994. n.prototype.actionComplete = function(e) {
  4995. if (this.interrupted = !1,
  4996. this.transitionStage = y.None,
  4997. this.resetSpecialTransition(),
  4998. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4999. this.tourIsPlaying || (this.player.disablePreRendering(),
  5000. this.player.mode === c.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  5001. this.emit("update.controls"),
  5002. this.nextFunc) {
  5003. var t = this.nextFunc;
  5004. this.nextFunc = null,
  5005. t()
  5006. }
  5007. }
  5008. ,
  5009. n.prototype.awaitCompletion = function(e, t) {
  5010. this.nextFunc = t,
  5011. e()
  5012. }
  5013. ,
  5014. n.prototype.updateSuccessFunction = function(e) {
  5015. this.nextFunc = e
  5016. }
  5017. ,
  5018. n.prototype.interrupt = function(e, t) {
  5019. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  5020. this.tourIsPlaying = !1,
  5021. this.bgmReplay(),//xzw
  5022. this.interrupted = !0,
  5023. this.nextFunc = null,
  5024. this.emit(p.ActionInterrupted),
  5025. null !== e && void 0 !== e || (e = g.BEGINNING),
  5026. this.player.interruptAndFastForward(e, t),
  5027. !0)
  5028. }
  5029. ,
  5030. n.prototype.wouldInterrupt = function() {
  5031. return this.transitionStage !== y.None
  5032. }
  5033. ,
  5034. n.prototype.intermediateState = function() {
  5035. return this.transitionStage !== y.None
  5036. }
  5037. ,
  5038. n.prototype.isInterrupted = function() {
  5039. return this.interrupted
  5040. }
  5041. ,
  5042. n.prototype.pauseWalkingSection = function() {
  5043. this.walkingSectionPaused = !0
  5044. }
  5045. ,
  5046. n.prototype.clearWalkingSectionPaused = function() {
  5047. this.walkingSectionPaused = !1
  5048. }
  5049. ,
  5050. n.prototype.autoTour = function() {
  5051. var e = Date.now();
  5052. this.model.auxDataPromise.then(function() {
  5053. e = Date.now() - e;
  5054. var t = a.warp.auto
  5055. , i = this.model.data && this.model.data.player_options /* && this.model.data.player_options.highlight_reel */;
  5056. t >= 0 && this.model.heroCount() > 1 && i && s.trigger({
  5057. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  5058. done: function() {
  5059. this.playTour()
  5060. }
  5061. .bind(this),
  5062. name: "_atr",
  5063. id: I
  5064. })
  5065. }
  5066. .bind(this))
  5067. }
  5068. ,
  5069. n.prototype.atDestinationPano = function() {
  5070. if (!this.player.currentPano || null === this.destinationItem)
  5071. return !1;
  5072. var e = this.player.currentPano.id;
  5073. if (void 0 === e)
  5074. return !1;
  5075. var t = this.model.heroLocations;
  5076. //return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  5077. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  5078. return destination && destination.panoId == e
  5079. }
  5080. ,
  5081. n.prototype.redirectToItem = function(e, t) {
  5082. if (null === e || void 0 === e)
  5083. return void A.warn("Director.redirectToItem() -> Redirecting to null item.");
  5084. if (!this.wouldInterrupt())
  5085. return void A.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  5086. if (this.player.mode === c.TRANSITIONING)
  5087. return void A.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  5088. A.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  5089. var i = function() {
  5090. s.setTimeout(function() {
  5091. this.setDestinationItem(e),
  5092. this.goToDestination(!0, g.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
  5093. }
  5094. .bind(this), 0)
  5095. }
  5096. .bind(this);
  5097. this.interrupt(g.END, 0),
  5098. this.updateSuccessFunction(i)
  5099. }
  5100. ,
  5101. n.prototype.useSpecialTransition = function(e) {
  5102. void 0 !== e && this.defaultWarpStyle !== u.BLACK && A.debug("useSpecialTransition(): " + e),
  5103. this.nextWarpStyle = u.BLACK
  5104. }
  5105. ,
  5106. n.prototype.resetSpecialTransition = function() {
  5107. this.nextWarpStyle = this.defaultWarpStyle
  5108. }
  5109. ,
  5110. n.prototype.arrivedAtDestination = function(e) {
  5111. if (this.player.flying || this.player.isWarping())
  5112. A.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  5113. else {
  5114. this.transitionStage = y.Aiming;
  5115. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  5116. this.player.model.fadePanoMarkers(0),
  5117. this.awaitCompletion(function() {
  5118. this.resetSpecialTransition(),
  5119. e ? this.player.aimTourCamera(this.destinationItem, v.Retain, v.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  5120. }
  5121. .bind(this), t)
  5122. }
  5123. }
  5124. ,
  5125. n.prototype.goToDestination = function(e, t, i, n) {
  5126. //音频
  5127. //if(this.destinationItem[1] == 0){//如果是每个folder的起始
  5128. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
  5129. if(musicInfo && musicInfo.music){
  5130. var o = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  5131. let audioSrc1 = g_tourAudio.src.split('/').pop();
  5132. let audioSrc2 = o.split('/').pop();
  5133. if(audioSrc1 == audioSrc2){//应该是继续播放该folder
  5134. if(this.destinationItem[1] == 0){//从头开始播放 因为可能暂停后然后再点该缩略图播
  5135. g_tourAudio.currentTime = 0; g_tourAudio.play();
  5136. }else if(g_tourAudio.paused && g_tourAudio.currentTime < g_tourAudio.duration){//未播完
  5137. g_tourAudio.play();
  5138. }
  5139. g_tourAudio.shouldPlay = true
  5140. }else{//很可能是该folder的起始
  5141. g_tourAudio.src = manage.dealURL(o);
  5142. g_tourAudio.shouldPlay = true
  5143. g_tourAudio.load()
  5144. }
  5145. if(g_bgAudio && !g_bgAudio.paused){
  5146. manage.switchBgmState(false);
  5147. g_bgAudio.pauseByTour = true
  5148. }
  5149. }
  5150. //}
  5151. if (this.onTheBus = !0,
  5152. this.emit("update.controls"),
  5153. this.player.updateLastView(),
  5154. !n && this.atDestinationPano()){
  5155. /*
  5156. // 原地旋转时, 写到_warpCameraAim里,因那有时间
  5157. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  5158. if(r.zoom && r.zoom != this.player.zoomLevel){//add
  5159. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  5160. } */
  5161. return void this.arrivedAtDestination(!0);
  5162. }
  5163. if (this.player.flying || this.player.isWarping())
  5164. A.warn("Cannot go to new destination while player is flying or warping.");
  5165. else {
  5166. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  5167. , o = null
  5168. , a1 = null;
  5169. if (r.isPano()) {
  5170. //var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
  5171. //var walk = window.MP_PREFETCHED_MODELDATA.black ? 'black' : 'walk';
  5172. var s = this.getMomentTour(this.destinationItem) //window.MP_PREFETCHED_MODELDATA.momentTour || "walk";
  5173. a1 = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, m.Slow, s, true, i, this.actionComplete.bind(this)),
  5174. o = this.arrivedAtDestination.bind(this, !0)
  5175. if(s=='black' && r.zoom && r.zoom != this.player.zoomLevel){//add
  5176. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  5177. }
  5178. } else{
  5179. a1 = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  5180. o = this.arrivedAtDestination.bind(this, !1);
  5181. }
  5182. this.transitionStage = y.Moving,
  5183. this.model.fadePanoMarkers(0),
  5184. this.awaitCompletion(function() {
  5185. a1();
  5186. }
  5187. .bind(this), o),
  5188. this.emit("update.controls")
  5189. }
  5190. }
  5191. ,
  5192. n.prototype.tourInterlude = function() {
  5193. if (h.trackAlways("reach_highlight", {
  5194. reach_source: this.reachSource
  5195. }),
  5196. this.model.fadePanoMarkers(0),
  5197. this.emit("update.controls"),
  5198. this.tourIsPlaying)
  5199. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  5200. this.stopTour(true),
  5201. this.emit(p.TourEnd),
  5202. void (this.player.mode === c.PANORAMA && this.model.fadePanoMarkers(a.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  5203. this.transitionStage = y.Interlude,
  5204. this.player.tourInterlude(this.nextItem(this.currentItem),this.actionComplete.bind(this))
  5205. }
  5206. .bind(this), this.goNext.bind(this))
  5207. }
  5208. ,
  5209. n.prototype.playTour = function() {
  5210. if (!this.bounceable())
  5211. return this.tourIsPlaying ? void A.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  5212. this.tourInProgress = !0,
  5213. this.reachSource = "play",
  5214. this.tourIsPlaying = !0,
  5215. this.wasZoomEnabled = this.player.zoomEnabled,
  5216. this.player.zoomEnabled = !1,
  5217. this.resetSpecialTransition(),
  5218. this.emit("update.controls"),
  5219. this.emit(p.TourStart),
  5220. this.player.enablePreRendering(),
  5221. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  5222. this.goToDestination()) : this.goNext()))
  5223. }
  5224. ,
  5225. n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
  5226. //if(g_tourAudio && g_tourAudio.paused && g_bgAudio && g_bgAudio.paused){
  5227. if(g_bgAudio && g_bgAudio.paused && g_bgAudio.pauseByTour){
  5228. g_playAudio = g_bgAudio;
  5229. g_tourAudio && g_tourAudio.pause();
  5230. //window.tourAudio && window.tourAudio.pause();
  5231. //manage.switchBgmState(true);
  5232. playMusic(player.currentPano)
  5233. }
  5234. }
  5235. ,
  5236. n.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  5237. this.isInterrupted() || this.transitionStage === y.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  5238. this.tourIsPlaying = !1,
  5239. (!isAutoStop || g_tourAudio && g_tourAudio.paused )&&this.bgmReplay(),//xzw
  5240. this.interrupt(),
  5241. this.clearWalkingSectionPaused(),
  5242. this.resetSpecialTransition(),
  5243. this.emit("update.controls"))
  5244. //window.tourAudio && window.tourAudio.pause();
  5245. if(!isAutoStop && g_tourAudio && g_tourAudio.paused == false )
  5246. {
  5247. g_tourAudio.pause();
  5248. g_tourAudio.shouldPlay = false
  5249. //g_tourAudio.src = ""
  5250. }
  5251. }
  5252. ,
  5253. n.prototype.endTourProgress = function() {
  5254. this.tourInProgress = !1,
  5255. this.emit("update.controls"),
  5256. this.emit(p.TourEnd)
  5257. }
  5258. ,
  5259. n.prototype.goToHighlight = function(e) {
  5260. if (this.wouldInterrupt())
  5261. this.itemCompare(this.destinationItem,e,'equal') ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  5262. else {
  5263. if (A.debug("<tour.goto " + e + ">"),
  5264. this.isInterrupted())
  5265. return;
  5266. this.clearWalkingSectionPaused(),
  5267. this.setDestinationItem(e),
  5268. this.useSpecialTransition("Hilight"),
  5269. this.goToDestination(),
  5270. h.trackAlways("reach_highlight", {
  5271. reach_source: "thumb"
  5272. })
  5273. }
  5274. }
  5275. ,
  5276. n.prototype.prevHighlight = function() {
  5277. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  5278. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  5279. this.reachSource = "prev",
  5280. this.goPrev()))
  5281. }
  5282. ,
  5283. n.prototype.nextHighlight = function() {
  5284. this.bounceable() || (this.player.emit("tour_manual", "next"),
  5285. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  5286. this.reachSource = "next",
  5287. this.goNext()))
  5288. }
  5289. ,
  5290. n.prototype.changeMode = function(e) {
  5291. var t = $.Deferred()
  5292. , i = t.resolve.bind(t)
  5293. , n = t.reject.bind(t);
  5294. this.emit(p.StartModeChange);
  5295. var r = function() {
  5296. return this.clearWalkingSectionPaused(),
  5297. !!this.wouldInterrupt() && (this.interrupt(),
  5298. !0)
  5299. }
  5300. .bind(this);
  5301. if (!r()) {
  5302. switch (e) {
  5303. case c.PANORAMA:
  5304. this.player.mode === c.PANORAMA ? this.player.currentPano.isAligned() || this.player.goToLastView(!0).done(i).fail(n) : this.player.insideMode(this.player.lastInsideView.pano).done(i).fail(n);
  5305. break;
  5306. case c.DOLLHOUSE:
  5307. case c.FLOORPLAN:
  5308. this.player.flyToNewMode({
  5309. mode: e
  5310. }).done(i).fail(n);
  5311. break;
  5312. case c.OUTDOOR:
  5313. this.player.model.has360Views && (this.player.mode !== c.PANORAMA || this.player.mode === c.PANORAMA && this.player.currentPano.isAligned()) && this.player.goToLastView(!1).done(i).fail(n)
  5314. }
  5315. return t.promise()
  5316. }
  5317. }
  5318. ,
  5319. n.prototype.atEndOfTour = function() {
  5320. //return this.currentItem >= this.nItems - 1
  5321. var end = this.currentItem && this.currentItem[0] >= this.nItems - 1;
  5322. if(end){
  5323. var heroLocations = this.model.heroLocations[this.nItems-1].heroLocations
  5324. if(heroLocations){
  5325. end = this.currentItem[1] >= heroLocations.length - 1
  5326. }
  5327. }
  5328. return end;
  5329. }
  5330. ,
  5331. n.prototype.firstDestination = function() {
  5332. //return 0 < this.nItems ? 0 : null
  5333. return 0 < this.nItems ? [0,0]: null
  5334. }
  5335. ,
  5336. n.prototype.finalDestination = function() {
  5337. //return 0 < this.nItems ? this.nItems - 1 : null
  5338. return 0 < this.nItems ? [this.nItems - 1,0]: null
  5339. }
  5340. ,
  5341. n.prototype.goPrev = function() {
  5342. this.tourAdvance(-1)
  5343. }
  5344. ,
  5345. n.prototype.goNext = function() {
  5346. this.tourAdvance(1)
  5347. }
  5348. ,
  5349. n.prototype.setDestinationItem = function(e) {
  5350. this.destinationItem = e,
  5351. this.emit("update.controls")
  5352. }
  5353. ,
  5354. n.prototype.setCurrentItem = function(e) {
  5355. this.currentItem = e,
  5356. this.emit("update.controls")
  5357. }
  5358. ,
  5359. n.prototype.nextItem = function(currentItem) {
  5360. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  5361. if(currentItem == void 0)return this.firstDestination()
  5362. var currentLocation = this.model.heroLocations[currentItem[0]];
  5363. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  5364. var item;
  5365. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  5366. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  5367. }else{
  5368. item = [currentItem[0] , currentItem[1]+1]
  5369. }
  5370. if(item[0] >= this.nItems ){
  5371. item = this.firstDestination()
  5372. }
  5373. return item;
  5374. //暂时不理会endlessLoop,默认为false
  5375. }
  5376. ,
  5377. n.prototype.prevItem = function(currentItem) {
  5378. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  5379. if(currentItem == void 0)return this.firstDestination()
  5380. var item;
  5381. var lastLocation = this.model.heroLocations[currentItem[0]-1];
  5382. if(!lastLocation) return this.finalDestination()//[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  5383. else{
  5384. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  5385. if(this.currentItem[1] == 0){//子目录中第一个
  5386. return [currentItem[0] - 1, lastChildNum-1]
  5387. }else{
  5388. return [currentItem[0], currentItem[1]-1]
  5389. }
  5390. }
  5391. }
  5392. ,
  5393. n.prototype.tourAdvance = function(e) {//e是1或-1
  5394. A.debug("tourAdvance(" + e + ")")
  5395. if(null === this.currentItem || void 0 === this.currentItem){
  5396. this.setDestinationItem(this.firstDestination())
  5397. }else{
  5398. var item
  5399. if(e == 1){
  5400. item = this.nextItem(this.currentItem)
  5401. }else if(e == -1){
  5402. item = this.prevItem(this.currentItem)
  5403. }
  5404. this.setDestinationItem(item)
  5405. }
  5406. if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')[0] < 0 ){
  5407. this.useSpecialTransition("reverse-looping to end")
  5408. }else if(this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')){
  5409. this.useSpecialTransition("looping back to start")
  5410. }
  5411. /* var momentTour = this.getMomentTour(this.destinationItem);
  5412. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  5413. var zoomLevel = this.player.zoomLevel;
  5414. this.player.zoomEnabled = true;
  5415. var zoom = function(e, d) {
  5416. this.player.zoomTo((1-e)*zoomLevel, true)
  5417. }.bind(this)
  5418. s.start(zoom, 1500, function(){
  5419. }, 0, d.easeOutQuad, "zoom")
  5420. } */
  5421. this.goToDestination()
  5422. }
  5423. ,
  5424. n.prototype.getMomentTour = function(destinationItem) {//add
  5425. var wholeMomentTour = window.MP_PREFETCHED_MODELDATA.momentTour || "walk"; //最外层
  5426. if(!destinationItem) return wholeMomentTour
  5427. else{
  5428. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem)//最内层。 如果有使用最内层
  5429. if(currentLocation.momentTour)return currentLocation.momentTour;
  5430. var currentLocation_ = this.model.heroLocations[destinationItem[0]];
  5431. return currentLocation_.momentTour || wholeMomentTour; //若中间层或最内层有就使用,否则使用最外层
  5432. }
  5433. }
  5434. ,
  5435. t.exports = n
  5436. }
  5437. ).call(this, "/js/director.js")
  5438. }
  5439. , {
  5440. "./analytics": 4,
  5441. "./enum/BlackoutStyle": 18,
  5442. "./enum/ControlEvents": 21,
  5443. "./enum/DirectorEvents": 23,
  5444. "./enum/ModelManagerEvents": 33,
  5445. "./enum/PathDiscardMode": 38,
  5446. "./enum/PathDisplayMode": 39,
  5447. "./enum/PlayerEvents": 40,
  5448. "./enum/Viewmode": 51,
  5449. "./enum/WarpStyle": 52,
  5450. "./model/ModelManager": 140,
  5451. "./player": 155,
  5452. "./settings": 166,
  5453. "./util/logger": 189,
  5454. "./util/transitions": 195,
  5455. events: 202,
  5456. three: 217
  5457. }],
  5458. 16: [function(e, t, i) {
  5459. "use strict";
  5460. var n = e("three")
  5461. , r = e("./enum/Viewmode")
  5462. , o = (e("./settings"),
  5463. e("./util/transitions"))
  5464. , a = e("./enum/PlayerEvents")
  5465. , s = new n.ShaderPass(n.HorizontalBlurShader)
  5466. , l = new n.ShaderPass(n.VerticalBlurShader);
  5467. l.renderToScreen = !0;
  5468. var c = $("#player").width() / $("#player").height();
  5469. isNaN(c) && (c = 1);
  5470. //initTransitionPass(n)
  5471. var h = {
  5472. currentBlur: 0,
  5473. aspect: c,
  5474. blurStrength: 1,
  5475. hblurPass: s,
  5476. vblurPass: l,
  5477. // transitionMaskPass : new n.TransitionPass()
  5478. bindEvents: function(e) {
  5479. e.on(a.ModeChanged, function(e, t) {
  5480. e === r.PANORAMA && (o.cancel(h.blur),
  5481. o.cancel(h.addBlur),
  5482. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  5483. })
  5484. },
  5485. blur: function(e) {
  5486. h.currentBlur = e;
  5487. var t = e * h.blurStrength;
  5488. l.uniforms.v.value = t / 512 * h.aspect,
  5489. s.uniforms.h.value = t / 512
  5490. },
  5491. addBlur: function(e) {
  5492. e = Math.max(e, h.currentBlur),
  5493. h.blur(e)
  5494. },
  5495. removeBlur: function(e) {
  5496. e = Math.min(1 - e, h.currentBlur),
  5497. h.blur(e)
  5498. }
  5499. };
  5500. h.blur(0),
  5501. t.exports = h
  5502. }
  5503. , {
  5504. "./enum/PlayerEvents": 40,
  5505. "./enum/Viewmode": 51,
  5506. "./settings": 166,
  5507. "./util/transitions": 195,
  5508. three: 217
  5509. }],
  5510. 17: [function(e, t, i) {
  5511. "use strict";
  5512. t.exports = {
  5513. UNKNOWN: 0,
  5514. ALIGNED: 1,
  5515. UNALIGNED: 2,
  5516. PLACED: 3
  5517. }
  5518. }
  5519. , {}],
  5520. 18: [function(e, t, i) {
  5521. "use strict";
  5522. t.exports = {
  5523. NONE: 0,
  5524. MIDDLE: 1,
  5525. END: 2,
  5526. BEGINNING: 3,
  5527. FADEIN: 4
  5528. }
  5529. }
  5530. , {}],
  5531. 19: [function(e, t, i) {
  5532. "use strict";
  5533. var n = e("three");
  5534. t.exports = {
  5535. newBlue: new n.Color(4967932),
  5536. altBlue: new n.Color(47355),
  5537. tagDefault: new n.Color(223357),
  5538. classicBlue: new n.Color(53759),
  5539. mpYellow: new n.Color(16502016),
  5540. mpOrange: new n.Color(16428055),
  5541. mpBlue: new n.Color(12096),
  5542. mpLtGrey: new n.Color(13751252),
  5543. mpDkGrey: new n.Color(10000019),
  5544. mpRed: new n.Color(12525854),
  5545. mpOrangeDesat: new n.Color(16764529),
  5546. mpBlueDesat: new n.Color(4034734),
  5547. mpRedDesat: new n.Color(14705505),
  5548. white: new n.Color(16777215),
  5549. black: new n.Color(0),
  5550. _desat: function(e, t) {
  5551. var i = t || .3
  5552. , r = (new n.Color).copy(e).getHSL();
  5553. return (new n.Color).setHSL(r.h, r.s * (1 - i), r.l)
  5554. },
  5555. _darken: function(e, t) {
  5556. var i = t || .2
  5557. , r = e.getHSL();
  5558. return (new n.Color).setHSL(r.h, r.s, r.l * (1 - i))
  5559. }
  5560. }
  5561. }
  5562. , {
  5563. three: 217
  5564. }],
  5565. 20: [function(e, t, i) {
  5566. "use strict";
  5567. t.exports = {
  5568. NONE: -1,
  5569. ROTATE: 0,
  5570. DOLLY: 1,
  5571. PAN: 2,
  5572. ROTATE_DOLLY: 3,
  5573. PAN_DOLLY: 4
  5574. }
  5575. }
  5576. , {}],
  5577. 21: [function(e, t, i) {
  5578. "use strict";
  5579. t.exports = {
  5580. Move: "move",
  5581. InteractionDirect: "interaction.direct",
  5582. InteractionKey: "interaction.key",
  5583. InteractionGui: "interaction.gui",
  5584. FlyInDirection: "fly.direction",
  5585. InputStart: "input.start",
  5586. Pinch: "input.pinch",
  5587. Scroll: "input.scroll",
  5588. AutoPanInterrupt: "autopan.interrupt",
  5589. AutoPanComplete: "autopan.complete",
  5590. AutoPanClamped: "autopan.clamped",
  5591. LongTap: "longtap"
  5592. }
  5593. }
  5594. , {}],
  5595. 22: [function(e, t, i) {
  5596. "use strict";
  5597. t.exports = Object.freeze({
  5598. FORWARD: "FORWARD",
  5599. LEFT: "LEFT",
  5600. RIGHT: "RIGHT",
  5601. BACK: "BACK",
  5602. UP: "UP",
  5603. DOWN: "DOWN"
  5604. })
  5605. }
  5606. , {}],
  5607. 23: [function(e, t, i) {
  5608. "use strict";
  5609. t.exports = {
  5610. ActionInterrupted: "action.interrupted",
  5611. TourStart: "tour.start",
  5612. TourEnd: "tour.end",
  5613. StartModeChange: "mode.startChange"
  5614. }
  5615. }
  5616. , {}],
  5617. 24: [function(e, t, i) {
  5618. "use strict";
  5619. t.exports = Object.freeze({
  5620. None: 0,
  5621. Queued: 1,
  5622. ForceQueued: 2,
  5623. Downloading: 3,
  5624. Downloaded: 4,
  5625. DownloadFailed: 5
  5626. })
  5627. }
  5628. , {}],
  5629. 25: [function(e, t, i) {
  5630. "use strict";
  5631. t.exports = {
  5632. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5633. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5634. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5635. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5636. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5637. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5638. }
  5639. }
  5640. , {}],
  5641. 26: [function(e, t, i) {
  5642. "use strict";
  5643. t.exports = {
  5644. Texture2D: 0,
  5645. TextureCube: 1
  5646. }
  5647. }
  5648. , {}],
  5649. 27: [function(e, t, i) {
  5650. "use strict";
  5651. t.exports = {
  5652. SMALL: "small",
  5653. LARGE: "large"
  5654. }
  5655. }
  5656. , {}],
  5657. 28: [function(e, t, i) {
  5658. "use strict";
  5659. var n = e("./Viewmode")
  5660. , r = {
  5661. LANDING: {},
  5662. NAVIGATION: "navigation",
  5663. MORE_HELP: "moreHelp",
  5664. TOUR_INTERACTION: {}
  5665. };
  5666. r.LANDING[n.PANORAMA] = "panorama.landing",
  5667. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5668. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5669. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5670. r.TOUR_INTERACTION.standard = "standard.tour",
  5671. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5672. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5673. t.exports = r
  5674. }
  5675. , {
  5676. "./Viewmode": 51
  5677. }],
  5678. 29: [function(e, t, i) {
  5679. "use strict";
  5680. var n = {
  5681. UP: 1,
  5682. DOWN: -1,
  5683. LEFT: "L",
  5684. RIGHT: "R",
  5685. FORWARD: "F",
  5686. BACK: "B",
  5687. reverse: {},
  5688. opposite: function(e) {
  5689. return this.reverse[e.toString()]
  5690. }
  5691. };
  5692. !function() {
  5693. n.reverse[n.UP] = n.DOWN,
  5694. n.reverse[n.DOWN] = n.UP,
  5695. n.reverse[n.LEFT] = n.RIGHT,
  5696. n.reverse[n.RIGHT] = n.LEFT,
  5697. n.reverse[n.FORWARD] = n.BACK,
  5698. n.reverse[n.BACK] = n.FORWARD
  5699. }(),
  5700. t.exports = n
  5701. }
  5702. , {}],
  5703. 30: [function(e, t, i) {
  5704. "use strict";
  5705. var n = e("../util/browser")
  5706. , r = {
  5707. ZERO: 48,
  5708. ONE: 49,
  5709. TWO: 50,
  5710. THREE: 51,
  5711. FOUR: 52,
  5712. FIVE: 53,
  5713. SIX: 54,
  5714. SEVEN: 55,
  5715. EIGHT: 56,
  5716. NINE: 57,
  5717. LEFTARROW: 37,
  5718. UPARROW: 38,
  5719. RIGHTARROW: 39,
  5720. DOWNARROW: 40,
  5721. A: 65,
  5722. B: 66,
  5723. C: 67,
  5724. D: 68,
  5725. E: 69,
  5726. F: 70,
  5727. G: 71,
  5728. H: 72,
  5729. I: 73,
  5730. J: 74,
  5731. K: 75,
  5732. L: 76,
  5733. M: 77,
  5734. N: 78,
  5735. O: 79,
  5736. P: 80,
  5737. Q: 81,
  5738. R: 82,
  5739. S: 83,
  5740. T: 84,
  5741. U: 85,
  5742. V: 86,
  5743. W: 87,
  5744. X: 88,
  5745. Y: 89,
  5746. Z: 90,
  5747. SPACE: 32,
  5748. RETURN: 13,
  5749. SEMICOLON: 186,
  5750. PLUSEQUALS: 187,
  5751. DASHUNDERSCORE: 189,
  5752. OPENBRACKET: 219
  5753. };
  5754. n.detectFirefox() && (r.SEMICOLON = 59,
  5755. r.PLUSEQUALS = 61,
  5756. r.DASHUNDERSCORE = 173),
  5757. t.exports = r
  5758. }
  5759. , {
  5760. "../util/browser": 182
  5761. }],
  5762. 31: [function(e, t, i) {
  5763. "use strict";
  5764. t.exports = {
  5765. EN_US: "en-US",
  5766. ES_MX: "es-MX",
  5767. FR_FR: "fr-FR",
  5768. DE_DE: "de-DE",
  5769. RU_RU: "ru-RU",
  5770. CN_CN: "cn-CN",
  5771. JP_JP: "jp-JP"
  5772. }
  5773. }
  5774. , {}],
  5775. 32: [function(e, t, i) {
  5776. "use strict";
  5777. t.exports = {
  5778. TagActivated: "tag.activated",
  5779. TagDismissed: "tag.dismissed",
  5780. TagNavigation: "tag.navigation"
  5781. }
  5782. }
  5783. , {}],
  5784. 33: [function(e, t, i) {
  5785. "use strict";
  5786. t.exports = {
  5787. ModelAdded: "model-added",
  5788. ActiveModelChanged: "active-model-changed"
  5789. }
  5790. }
  5791. , {}],
  5792. 34: [function(e, t, i) {
  5793. "use strict";
  5794. t.exports = {
  5795. LEFT: 0,
  5796. MIDDLE: 1,
  5797. RIGHT: 2
  5798. }
  5799. }
  5800. , {}],
  5801. 35: [function(e, t, i) {
  5802. "use strict";
  5803. t.exports = {
  5804. PanoRenderComplete: "panorama.render.complete",
  5805. TileRenderFailure: "panorama.tile.render.failed",
  5806. TileRenderSuccess: "panorama.tile.render.success",
  5807. TileUploadAttempted: "panorama.tile.upload.attempted",
  5808. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5809. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5810. }
  5811. }
  5812. , {}],
  5813. 36: [function(e, t, i) {
  5814. "use strict";
  5815. t.exports = {
  5816. BASE: 1,
  5817. STANDARD: 2,
  5818. HIGH: 3,
  5819. ULTRAHIGH: 4
  5820. }
  5821. }
  5822. , {}],
  5823. 37: [function(e, t, i) {
  5824. "use strict";
  5825. t.exports = {
  5826. LoadComplete: "panorama.load.complete",
  5827. LoadFailed: "panorama.load.failed",
  5828. TileLoaded: "panorama.tile.loaded"
  5829. }
  5830. }
  5831. , {}],
  5832. 38: [function(e, t, i) {
  5833. "use strict";
  5834. t.exports = Object.freeze({
  5835. Standard: 0,
  5836. Slow: 1,
  5837. Retain: 2
  5838. })
  5839. }
  5840. , {}],
  5841. 39: [function(e, t, i) {
  5842. "use strict";
  5843. t.exports = Object.freeze({
  5844. Show: 0,
  5845. Hide: 1,
  5846. Retain: 2
  5847. })
  5848. }
  5849. , {}],
  5850. 40: [function(e, t, i) {
  5851. "use strict";
  5852. t.exports = {
  5853. Move: "move",
  5854. MoveComplete: "move.complete",
  5855. ModeChanged: "mode.changed",
  5856. ModeChanging: "mode.changing",
  5857. PanoChosen: "pano.chosen",
  5858. ClosestPanoChanging: "closest.pano.changing",
  5859. WarpStarted: "warp.started",
  5860. WarpInterrupted: "warp.interrupted",
  5861. WarpEnded: "warp.ended",
  5862. FlyinFinished: "flyin.finished",
  5863. FlyingStarted: "flying.started",
  5864. FlyingInterrupted: "flying.interrupted",
  5865. FlyingEnded: "flying.ended",
  5866. Ready: "ready",
  5867. StartInside: "start.inside",
  5868. StartOutside: "start.outside",
  5869. ViewChanged: "view.changed",
  5870. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5871. InputStart: "input.start"
  5872. }
  5873. }
  5874. , {}],
  5875. 41: [function(e, t, i) {
  5876. "use strict";
  5877. t.exports = Object.freeze({
  5878. DEFAULT: 0,
  5879. PANOMARKERS: 1,
  5880. RETICULE: 2,
  5881. TAG: 3
  5882. })
  5883. }
  5884. , {}],
  5885. 42: [function(e, t, i) {
  5886. "use strict";
  5887. t.exports = {
  5888. visibleFloor: 1,
  5889. ghostFloor: 3,
  5890. boundingSkybox: 1,
  5891. panoMarker: 2,
  5892. reticule: 3,
  5893. tagStem: 4,
  5894. tagDisc: 5,
  5895. ribbon: 100
  5896. }
  5897. }
  5898. , {}],
  5899. 43: [function(e, t, i) {
  5900. "use strict";
  5901. t.exports = {
  5902. ContextCreated: "scene-renderer-context-created",
  5903. AfterRender: "after-render",
  5904. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5905. }
  5906. }
  5907. , {}],
  5908. 44: [function(e, t, i) {
  5909. "use strict";
  5910. t.exports = {
  5911. IDLE: "idle",
  5912. BROWSE: "browse",
  5913. EXAMINE: "examine"
  5914. }
  5915. }
  5916. , {}],
  5917. 45: [function(e, t, i) {
  5918. "use strict";
  5919. t.exports = {
  5920. TileDownloadSuccess: "tiledownloader.download.success",
  5921. TileDownloadFailure: "tiledownloader.download.failure",
  5922. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5923. }
  5924. }
  5925. , {}],
  5926. 46: [function(e, t, i) {
  5927. "use strict";
  5928. t.exports = {
  5929. CardboardAndroid: "googlevr",
  5930. GearVR: "gearvr",
  5931. CardboardIOS: "googlevrios",
  5932. Cardboard: "googlevr"
  5933. }
  5934. }
  5935. , {}],
  5936. 47: [function(e, t, i) {
  5937. "use strict";
  5938. t.exports = {
  5939. NONE: 0,
  5940. CONTEXTUAL: 1,
  5941. ANDROID: 2
  5942. }
  5943. }
  5944. , {}],
  5945. 48: [function(e, t, i) {
  5946. "use strict";
  5947. var n = {
  5948. Title: 0,
  5949. Cardboard: 1
  5950. }
  5951. , r = {
  5952. Title: 0,
  5953. Cardboard: 1,
  5954. Gear: 2
  5955. };
  5956. !function() {
  5957. [n, r].forEach(function(e) {
  5958. e.pageCount = Object.keys(e).length
  5959. })
  5960. }(),
  5961. t.exports.ios = n,
  5962. t.exports.standard = r
  5963. }
  5964. , {}],
  5965. 49: [function(e, t, i) {
  5966. "use strict";
  5967. t.exports = {
  5968. Android: "android",
  5969. IOS: "ios",
  5970. Desktop: "desktop",
  5971. UnsupportedAndroid: "android-unsupported"
  5972. }
  5973. }
  5974. , {}],
  5975. 50: [function(e, t, i) {
  5976. "use strict";
  5977. var n = e("three");
  5978. t.exports = {
  5979. UP: new n.Vector3(0,1,0),
  5980. DOWN: new n.Vector3(0,-1,0),
  5981. LEFT: new n.Vector3(-1,0,0),
  5982. RIGHT: new n.Vector3(1,0,0),
  5983. FORWARD: new n.Vector3(0,0,-1),
  5984. BACK: new n.Vector3(0,0,1)
  5985. }
  5986. }
  5987. , {
  5988. three: 217
  5989. }],
  5990. 51: [function(e, t, i) {
  5991. "use strict";
  5992. var n = e("../exception/ViewmodeConvertException")
  5993. , r = e("./coreViewmodes")
  5994. , o = e("../util/common")
  5995. , a = {
  5996. MESH: "mesh",
  5997. OUTDOOR: "outdoor",
  5998. TRANSITIONING: "transitioning",
  5999. toInt: function(e) {
  6000. switch (e) {
  6001. case this.PANORAMA:
  6002. return 1;
  6003. case this.DOLLHOUSE:
  6004. return 2;
  6005. case this.FLOORPLAN:
  6006. return 3;
  6007. case this.OUTDOOR:
  6008. return 4;
  6009. case this.TRANSITIONING:
  6010. return -1
  6011. }
  6012. throw new n("No known conversion for Viewmode to int for mode: " + e)
  6013. },
  6014. fromInt: function(e) {
  6015. switch (e) {
  6016. case "1":
  6017. case 1:
  6018. return this.PANORAMA;
  6019. case "2":
  6020. case 2:
  6021. return this.DOLLHOUSE;
  6022. case "3":
  6023. case 3:
  6024. return this.FLOORPLAN;
  6025. case "4":
  6026. case 4:
  6027. return this.OUTDOOR
  6028. }
  6029. throw new n("No known conversion for int to viewmode for int: " + e)
  6030. },
  6031. convertWorkshopModeInt: function(e) {
  6032. switch (e) {
  6033. case "0":
  6034. case 0:
  6035. case undefined: //xzw add
  6036. return this.PANORAMA;
  6037. case "1":
  6038. case 1:
  6039. return this.FLOORPLAN;
  6040. case "2":
  6041. case 2:
  6042. return this.DOLLHOUSE;
  6043. case "3":
  6044. case 3:
  6045. return this.MESH
  6046. }
  6047. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  6048. }
  6049. };
  6050. o.extendObject(a, r),
  6051. t.exports = a
  6052. }
  6053. , {
  6054. "../exception/ViewmodeConvertException": 58,
  6055. "../util/common": 185,
  6056. "./coreViewmodes": 54
  6057. }],
  6058. 52: [function(e, t, i) {
  6059. "use strict";
  6060. t.exports = {
  6061. BLACK: "black",
  6062. STD: "std",
  6063. WALK: "walk"
  6064. }
  6065. }
  6066. , {}],
  6067. 53: [function(e, t, i) {
  6068. "use strict";
  6069. t.exports = {
  6070. ZoomIn: "zoom.in",
  6071. ZoomOut: "zoom.out",
  6072. ZoomMax: "zoom.max",
  6073. ZoomMin: "zoom.min"
  6074. }
  6075. }
  6076. , {}],
  6077. 54: [function(e, t, i) {
  6078. "use strict";
  6079. t.exports = {
  6080. PANORAMA: "panorama",
  6081. DOLLHOUSE: "dollhouse",
  6082. FLOORPLAN: "floorplan"
  6083. }
  6084. }
  6085. , {}],
  6086. 55: [function(e, t, i) {
  6087. "use strict";
  6088. function n(e) {
  6089. this.message = e
  6090. }
  6091. t.exports = n
  6092. }
  6093. , {}],
  6094. 56: [function(e, t, i) {
  6095. "use strict";
  6096. function n(e) {
  6097. r.call(this, e)
  6098. }
  6099. var r = e("./BasicException");
  6100. n.prototype = Object.create(r.prototype),
  6101. t.exports = n
  6102. }
  6103. , {
  6104. "./BasicException": 55
  6105. }],
  6106. 57: [function(e, t, i) {
  6107. "use strict";
  6108. function n(e) {
  6109. r.call(this, e)
  6110. }
  6111. var r = e("./BasicException");
  6112. n.prototype = Object.create(r.prototype),
  6113. t.exports = n
  6114. }
  6115. , {
  6116. "./BasicException": 55
  6117. }],
  6118. 58: [function(e, t, i) {
  6119. "use strict";
  6120. function n(e) {
  6121. r.call(this, e)
  6122. }
  6123. var r = e("./BasicException");
  6124. n.prototype = Object.create(r.prototype),
  6125. t.exports = n
  6126. }
  6127. , {
  6128. "./BasicException": 55
  6129. }],
  6130. 59: [function(e, t, i) {
  6131. (function(i) {
  6132. "use strict";
  6133. function n(e) {
  6134. var t = {};
  6135. if (e) {
  6136. var i = e.flags;
  6137. if (i)
  6138. for (var n in i)
  6139. i.hasOwnProperty(n) && (t[i[n]] = !0);
  6140. return t
  6141. }
  6142. return l.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  6143. null
  6144. }
  6145. var r = e("./util/ajax")
  6146. , o = e("./util/showcase")
  6147. , a = e("./util/logger")
  6148. , s = ""
  6149. , l = new a(i)
  6150. , c = {};
  6151. t.exports = {
  6152. loadFeatureFlags: function(e) {
  6153. var t = $.Deferred();
  6154. return r.get(e.urlBase + s, {
  6155. responseType: "json",
  6156. prefetchFrom: "user",
  6157. auth: o.getAuthorizationHeader()
  6158. }).done(function(e) {
  6159. c = n(e),
  6160. c ? t.resolve(c) : t.reject("loading-failed")
  6161. }).fail(function() {
  6162. l.debug("Retrieval of feature flags failed."),
  6163. t.reject("loading-failed")
  6164. }),
  6165. t.promise()
  6166. },
  6167. getFlags: function() {
  6168. return c
  6169. },
  6170. updateDependentSettings: function(e, t) {
  6171. e = e || c,
  6172. e.labels && (t.labels.enabled = !0),
  6173. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  6174. e.showcase_sdk && (t.sdkInit = !0),
  6175. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  6176. e.showcase_webvr && (t.vr.allowWebVR = !0),
  6177. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  6178. e.hide_sc_sharing && (t.share.enabled = !1)
  6179. }
  6180. }
  6181. }
  6182. ).call(this, "/js/featureflags.js")
  6183. }
  6184. , {
  6185. "./util/ajax": 181,
  6186. "./util/logger": 189,
  6187. "./util/showcase": 193
  6188. }],
  6189. 60: [function(e, t, i) {
  6190. "use strict";
  6191. var n = (e("../util/common"),
  6192. {
  6193. status: 0,
  6194. set: function(e) {
  6195. if (isNaN(e))
  6196. return !1;
  6197. var t = $('.progressbar');
  6198. 0 > e && (e = 0);
  6199. e > 100 && (e = 100);
  6200. var width = parseInt(t.css('width').replace("px",""))/100; //获取进度条总长度除以100
  6201. var barperc = e*width;
  6202. var perc = Math.round(e);
  6203. var labelpos = (parseInt(barperc)-15);
  6204. t.find('.bar').css('width',barperc); //已经再跑颜色的百分比
  6205. t.find('.label').css('left', labelpos); //上面跟着的字的百分比
  6206. t.find('.perc').text(perc+'%'); //具体数字的百分比
  6207. this.status = e
  6208. },
  6209. done: function(e) {
  6210. return e || this.status ? (this.status = null,
  6211. this.set(100)) : this
  6212. }
  6213. });
  6214. t.exports.circleLoader = n
  6215. }
  6216. , {
  6217. "../util/common": 185
  6218. }],
  6219. 61: [function(e, t, i) {
  6220. "use strict";
  6221. t.exports = Object.freeze({
  6222. CLOSE: "modal.closer.close"
  6223. })
  6224. }
  6225. , {}],
  6226. 62: [function(e, t, i) {
  6227. "use strict";
  6228. function n(e, t) {
  6229. t && (t.stopPropagation(),
  6230. t.preventDefault()),
  6231. e && this.emit(l.CLOSE, e),
  6232. g.reset()
  6233. }
  6234. function r(e, t) {
  6235. function i() {
  6236. var t = e.offsetHeight >= $("#player").height() && e.offsetWidth >= $("#player").width();
  6237. t !== f && (f = t,
  6238. t ? (e.classList.add("closeByFooter"),
  6239. h.classList.add("closeByFooter")) : (e.classList.remove("closeByFooter"),
  6240. h.classList.remove("closeByFooter")))
  6241. }
  6242. t ? setTimeout(i, o.guiAnimationSpeed) : i()
  6243. }
  6244. var o = e("../../settings")
  6245. , a = (e("../../tag/Media/MediaEvent"),
  6246. e("../../util/browser"))
  6247. , s = e("../../util/common")
  6248. , l = e("./ModalCloserEvent")
  6249. , c = e("events").EventEmitter
  6250. , h = document.getElementsByClassName("footer")[0]
  6251. , u = h.querySelectorAll(".close")[0]
  6252. , d = null
  6253. , p = null
  6254. , f = null
  6255. , g = (a.isMobile(),
  6256. {
  6257. open: function(e) {
  6258. e && (r(e),
  6259. d && u.removeEventListener("click", d, !0),
  6260. d = n.bind(this, e.id),
  6261. u.addEventListener("click", d, !0),
  6262. p && window.removeEventListener("resize", p, !0),
  6263. p = r.bind(this, e),
  6264. window.addEventListener("resize", p, !0))
  6265. },
  6266. reset: function() {
  6267. h.classList.remove("closeByFooter"),
  6268. u.removeEventListener("click", d, !0),
  6269. window.removeEventListener("resize", p, !0),
  6270. d = p = f = null
  6271. }
  6272. });
  6273. s.extendObject(g, c.prototype),
  6274. t.exports = g
  6275. }
  6276. , {
  6277. "../../tag/Media/MediaEvent": 131,
  6278. "../../settings": 166,
  6279. "../../util/browser": 182,
  6280. "../../util/common": 185,
  6281. "./ModalCloserEvent": 61,
  6282. events: 202
  6283. }],
  6284. 63: [function(e, t, i) {
  6285. "use strict";
  6286. function n(e, t, i) {
  6287. var n = new r.GUI({
  6288. width: 400
  6289. })
  6290. , u = n.addFolder("Flydown from Dollhouse");
  6291. u.add(h.flydown, "movementEasing", Object.keys(a)),
  6292. u.add(h.flydown, "movementDelay", 0, 1).step(.01),
  6293. u.add(h.flydown, "rotationEasing", Object.keys(a)),
  6294. u.add(h.flydown, "rotationDelay", 0, 1).step(.01),
  6295. u.add(h.flydown, "modelTextureDelay", 0, 1).step(.01),
  6296. u.add(h.flydown, "skyboxDelay", 0, 1).step(.01),
  6297. u.add(h.dollhouseDefault, "minPolarAngle", 0, o.Math.degToRad(50)),
  6298. u.add(h.dollhouseDefault, "maxPolarAngle", o.Math.degToRad(50), o.Math.degToRad(170));
  6299. var d = n.addFolder("Transition between panos");
  6300. d.add(h.transition, "blur", 0, 10).onFinishChange(function() {}),
  6301. d.add(h.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  6302. h.transition.flyTime = 0,
  6303. d.__controllers.forEach(function(e) {
  6304. e.updateDisplay()
  6305. })
  6306. }),
  6307. d.add(h.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  6308. h.transition.flySpeed = 0,
  6309. d.__controllers.forEach(function(e) {
  6310. e.updateDisplay()
  6311. })
  6312. }),
  6313. d.add(h.transition, "aimTime", 500, 2500).step(50),
  6314. d.add(h.transition, "aimSlowFactor", 1, 3).step(.1),
  6315. d.add(h.transition, "movementEasing", Object.keys(a));
  6316. var p = n.addFolder("Path Display");
  6317. p.add(h.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  6318. p.add(h.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  6319. p.add(h.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  6320. p.add(h.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  6321. p.add(h.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  6322. p.add(h.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  6323. p.add(h.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  6324. p.add(h.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  6325. p.add(h.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  6326. p.add(h.path, "color", Object.keys(l)).onFinishChange(function() {
  6327. h.path.color = l[h.path.color],
  6328. h.path.colorUp = l._desat(h.path.color),
  6329. h.path.colorDown = l.darken(h.path.color)
  6330. }),
  6331. p.add(h, "reticuleColor", Object.keys(l)).onFinishChange(function() {
  6332. h.reticuleColor = l[h.reticuleColor]
  6333. });
  6334. var f = n.addFolder("Warping")
  6335. , g = f.addFolder("Warp/Teleport");
  6336. g.add(h.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  6337. g.add(h.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  6338. g.add(h.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  6339. g.add(h.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  6340. g.add(h.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  6341. g.add(h.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  6342. g.add(h.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  6343. g.add(h.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  6344. g.add(h.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  6345. g.add(h.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  6346. g.add(h.path, "mapGuides").onFinishChange(function() {}),
  6347. g.add(h.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  6348. g.add(h.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  6349. g.add(h.path, "typ", Object.keys(c)).onFinishChange(function() {
  6350. h.path.typ = c[h.path.typ]
  6351. }),
  6352. g.add(h.warp, "loop").onChange(function() {}).onFinishChange(function() {
  6353. t.endlessLoop = h.warp.loop
  6354. }),
  6355. g.add(h.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  6356. g.add(h.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  6357. g.add(h.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  6358. var m = f.addFolder("Long Warp Only");
  6359. m.add(h.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  6360. h.warp.flySpeed = 0,
  6361. m.__controllers.forEach(function(e) {
  6362. e.updateDisplay()
  6363. })
  6364. }),
  6365. m.add(h.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  6366. m.add(h.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  6367. m.add(h.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  6368. m.add(h.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  6369. m.add(h.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  6370. m.add(h.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  6371. m.add(h.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  6372. m.add(h.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  6373. m.add(h.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  6374. var v = n.addFolder("Warp Esoterica");
  6375. v.add(h.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  6376. v.add(h.warp, "blur", .01, 1).onFinishChange(function() {}),
  6377. v.add(h.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  6378. h.warp.minWarpTime = 0,
  6379. v.__controllers.forEach(function(e) {
  6380. e.updateDisplay()
  6381. })
  6382. }),
  6383. v.add(h.warp, "showBunny").onFinishChange(function() {}),
  6384. v.add(h.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  6385. v.add(h.warp, "movementEasing", Object.keys(a));
  6386. var A = n.addFolder("Misc");
  6387. A.add(h, "dollhouseFOV", 10, 180).onChange(function() {
  6388. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV
  6389. }),
  6390. A.add(h, "insideFOV", 10, 180).onChange(function() {
  6391. i.cameras[s.PANORAMA].fov = h.insideFOV
  6392. }),
  6393. A.add(h, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  6394. A.add(h, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  6395. A.add(h, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  6396. var y = n.addFolder("Navigation");
  6397. y.add(h.navigation, "panoScores").onFinishChange(function() {
  6398. h.navigation.panoScores || e.panos.forEach(function(e) {
  6399. e.floor.remove(e.text3d),
  6400. e.text3d = null
  6401. })
  6402. }),
  6403. y.add(h.navigation, "mouseDirection"),
  6404. y.add(h.navigation, "filterStrictness", 0, 1),
  6405. y.add(h.navigation, "angleFactor", -60, 0),
  6406. y.add(h.navigation, "directionFactor", 1, 20),
  6407. y.add(h.navigation, "distanceFactor", -5, 5),
  6408. y.add(h.navigation, "optionalityFactor", .1, 10);
  6409. var C = n.addFolder("tags")
  6410. , I = C.addFolder("Tag Creation");
  6411. I.add(h.tags.pole, "enabled").name("poleEnabled"),
  6412. I.add(h.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  6413. I.add(h.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  6414. I.add(h.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  6415. var E = C.addFolder("Visibility");
  6416. E.add(h.tags.visibility, "anyDistance"),
  6417. E.add(h.tags.visibility, "visibleDistance", .1, 30).step(.1),
  6418. E.add(h.tags.visibility, "cameraClearance", 0, 1).step(.01),
  6419. E.add(h.tags.visibility, "hideViaFloor"),
  6420. E.add(h.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  6421. E.add(h.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  6422. var b = C.addFolder("Disc Parameters");
  6423. b.add(h.tags.disc.scale, "nearBound", .1, 10).step(.1),
  6424. b.add(h.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  6425. b.add(h.tags.disc.scale, "linkFarBound").onChange(function(e) {
  6426. e && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100))
  6427. }),
  6428. b.add(h.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  6429. h.tags.disc.scale.linkFarBound && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100))
  6430. }),
  6431. b.add(h.tags.disc.scale, "maxSize", 40, 200).step(1),
  6432. b.add(h.tags.disc.scale, "minSize", 20, 100).step(1),
  6433. b.add(h.tags.disc.scale, "responsiveness", 0, 100).step(1);
  6434. var w = C.addFolder("Navigate");
  6435. w.add(h.tags.navigate, "nearestPano").name("nearestPano"),
  6436. w.add(h.tags.navigate, "lineOfSight").name("lineOfSight"),
  6437. w.add(h.tags.navigate, "reactivate").name("reactivate"),
  6438. w.add(h.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  6439. w.add(h.tags.navigate, "tiltTolerance", 0, 50).step(1),
  6440. w.add(h.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  6441. var _ = n.addFolder("Debug");
  6442. _.add(h, "wireframe").onFinishChange(function() {
  6443. e.chunks.forEach(function(t) {
  6444. t.material && (t.wireframeTwin || (t.wireframeTwin = new o.WireframeHelper(t),
  6445. t.wireframeTwin.material.depthWrite = !1,
  6446. t.wireframeTwin.material.depthTest = !1,
  6447. t.wireframeTwin.material.opacity = .5,
  6448. t.wireframeTwin.material.transparent = !0),
  6449. h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin))
  6450. })
  6451. }),
  6452. _.add(h, "skyboxWireframe").onFinishChange(function() {
  6453. h.skyboxWireframe ? (e.skybox.wireframe = new o.WireframeHelper(e.skybox),
  6454. e.add(e.skybox.wireframe)) : (e.remove(e.skybox.wireframe),
  6455. e.skybox.wireframe = null)
  6456. }),
  6457. _.add(h, "showSweeps").onFinishChange(function() {
  6458. e.setSweepVisibility(h.showSweeps)
  6459. }),
  6460. _.add(h, "showMesh").onFinishChange(function() {
  6461. e.chunks.forEach(function(e) {
  6462. e.visible = h.showMesh
  6463. })
  6464. }),
  6465. _.add(h, "showFloors").onFinishChange(function() {
  6466. e.floors.forEach(function(e) {
  6467. e.collider.children.forEach(function(e) {
  6468. e.material.visible = h.showFloors
  6469. })
  6470. })
  6471. }),
  6472. _.add(h, "showSkyboxes").onFinishChange(function() {
  6473. e.panos.forEach(function(e) {
  6474. e.skyboxMesh.visible = h.showSkyboxes
  6475. })
  6476. }),
  6477. _.add(h, "showNeighbors").onChange(function() {}),
  6478. _.add(e, "alpha", 0, 1)
  6479. }
  6480. var r = e("../lib/dat.gui")
  6481. , o = e("three")
  6482. , a = e("../util/easing")
  6483. , s = e("../enum/Viewmode")
  6484. , l = e("../enum/Colors")
  6485. , c = e("../enum/WarpStyle")
  6486. , h = e("../settings");
  6487. e("../tag/tag");
  6488. r.GUI.prototype.removeFolder = function(e) {
  6489. var t = this.__folders[e];
  6490. t && (t.close(),
  6491. this.__ul.removeChild(t.domElement.parentNode),
  6492. delete this.__folders[e],
  6493. this.onResize())
  6494. }
  6495. ,
  6496. t.exports.toggle = n
  6497. }
  6498. , {
  6499. "../enum/Colors": 19,
  6500. "../enum/Viewmode": 51,
  6501. "../enum/WarpStyle": 52,
  6502. "../lib/dat.gui": 93,
  6503. "../tag/tag": 123,
  6504. "../settings": 166,
  6505. "../util/easing": 186,
  6506. three: 217
  6507. }],
  6508. 64: [function(e, t, i) {
  6509. (function(i) {
  6510. "use strict";
  6511. function n(e, t, i, n) {
  6512. $(".gui-error .error-problem-text").text(e),
  6513. $(".gui-error .error-solution-text").text(t),
  6514. $(".gui-error .error-explanation").text(i),
  6515. $(".gui-error .error-actions").html(n),
  6516. $(window).resize(),
  6517. $(".gui-error").fadeIn(),
  6518. $("#bottom-logo").fadeIn()
  6519. }
  6520. function r(e) {
  6521. 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("");
  6522. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  6523. s.isMobile() || $("[rel=tiletip]").tooltip({
  6524. placement: "bottom",
  6525. delay: {
  6526. show: 50,
  6527. hide: 0
  6528. },
  6529. trigger: "hover",
  6530. viewport: {
  6531. selector: "body",
  6532. padding: 10
  6533. }
  6534. })
  6535. }
  6536. function o() {
  6537. var e = s.isMobile() ? "" : '<span class="link install-browser">' + h.ERROR_GENERIC_ACTIONS_2 + "</span>" + h.ERROR_GENERIC_ACTIONS_3
  6538. , t = [h.ERROR_GENERIC_ACTIONS_1, e,].join("");
  6539. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, "", t),
  6540. s.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  6541. e.preventDefault(),
  6542. e.stopPropagation(),
  6543. r(" ")
  6544. })
  6545. }
  6546. function a(e) {
  6547. if ($("head title").text(c.pageTitle),
  6548. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  6549. $("#gui-loading").fadeOut(250),
  6550. $("#quick-blackout").hide(),
  6551. l.track("showcase_error", {
  6552. error_key: e
  6553. }),
  6554. h.locale || h.init(),
  6555. "webgl-unsupported" === e)
  6556. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6557. else if ("webgl-ios" === e)
  6558. n(h.ERROR_WEBGL_IOS_PROBLEM, h.ERROR_WEBGL_IOS_SOLUTION, "", h.ERROR_WEBGL_IOS_ACTIONS_1 + "<strong>" + h.ERROR_WEBGL_IOS_ACTIONS_2 + "</strong>.");
  6559. else if ("webgl-safari" === e)
  6560. n(h.ERROR_WEBGL_SAFARI_PROBLEM, "", "", h.ERROR_WEBGL_SAFARI_ACTIONS_1 + "<strong>" + h.ERROR_WEBGL_SAFARI_ACTIONS_2 + "</strong>. " + h.ERROR_WEBGL_SAFARI_ACTIONS_3 + "<strong>" + h.ERROR_WEBGL_SAFARI_ACTIONS_4 + "</strong>.");
  6561. else if ("webgl-generic" === e)
  6562. o();
  6563. else if ("missing-urls" === e)
  6564. n(h.ERROR_MISSING_URLS_PROBLEM, "", h.ERROR_MISSING_URLS_EXPLANATION);
  6565. else if ("loading-failed" === e)
  6566. n(h.ERROR_LOADING_FAILED_PROBLEM, "", "", h.ERROR_LOADING_FAILED_ACTIONS_1 + '<a class="link" target="_blank" href=' + p + ">" + h.ERROR_LOADING_FAILED_ACTIONS_2 + "</a>.");
  6567. else {
  6568. if ("loading-failed-maintenance" !== e)
  6569. return void d.error("Unhandled error: " + e);
  6570. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION)
  6571. }
  6572. }
  6573. var s = e("./../util/browser")
  6574. , l = e("./../analytics")
  6575. , c = e("./../settings")
  6576. , h = e("../localization/localize")
  6577. , u = e("./../util/logger")
  6578. , d = new u(i)
  6579. , p = '"https://support.port.com/hc/articles/208220058"';
  6580. t.exports.error = a
  6581. }
  6582. ).call(this, "/js/gui/error.js")
  6583. }
  6584. , {
  6585. "../localization/localize": 108,
  6586. "./../analytics": 4,
  6587. "./../settings": 166,
  6588. "./../util/browser": 182,
  6589. "./../util/logger": 189
  6590. }],
  6591. 65: [function(e, t, i) {
  6592. (function(i) {
  6593. "use strict";
  6594. function n() {
  6595. Ue = [],
  6596. je.floors.visible && Ue.push(".gui-floor", ".gui-floor-title"),
  6597. Ue.push(".hideTarget", ".pinTop.right")
  6598. }
  6599. function r() {
  6600. for (var e in je)
  6601. if (je.hasOwnProperty(e)) {
  6602. var t = je[e];
  6603. if (!t.visible)
  6604. for (var i = 0; i < t.elements.length; i++)
  6605. $(t.elements[i]).hide()
  6606. }
  6607. je.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6608. je.tourControls.visible === !1 && $("#drawer").addClass("fullWidth"),
  6609. n()
  6610. }
  6611. function o(e, t) {
  6612. var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying;
  6613. $("#gui-zoomin").toggle(i),
  6614. $("#gui-zoomout").toggle(i)
  6615. }
  6616. function a() {
  6617. c(),
  6618. $(".pinBottom").toggleClass("open"),
  6619. $("#drawer").toggleClass("open"),
  6620. $(".footer").toggleClass("open"),
  6621. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", Re.CLOSE_HIGHLIGHTS),
  6622. Ze("highlights")) : ($("#pullTab .icon").attr("data-original-title", Re.OPEN_HIGHLIGHTS),
  6623. ie.resetDrawer()),
  6624. setTimeout(function() {
  6625. $("#pullTab").toggleClass("opened");
  6626. }, $("#drawer").hasClass("open") ? 0 : Q.highlightAnimationDuration),
  6627. $(".pinBottom").hasClass("open") && s($(".vr-popup")) && $(".vr-popup").is(":visible") && Ae.dismiss()
  6628. }
  6629. function s(e) {
  6630. var t;
  6631. "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6632. t = e.position().top + e.outerHeight(),
  6633. e.attr("style", "display: none"));
  6634. var i = $("#player").outerHeight()
  6635. , n = i - 130;
  6636. return n < t + 25
  6637. }
  6638. function l(e) {
  6639. "touchstart" === e.type && e.preventDefault(),
  6640. e.stopPropagation()
  6641. }
  6642. function c() {
  6643. W && (W.reload(),
  6644. W.init())
  6645. }
  6646. function h(e) {
  6647. ne.show(e),
  6648. r()
  6649. }
  6650. function u(e) {
  6651. ne.progress(e)
  6652. }
  6653. function d(e, t, i) {
  6654. var n = t.player;
  6655. $("#gui-thumb").fadeOut(2500),
  6656. ne.hide(function() {
  6657. Ge = !1
  6658. }),
  6659. me.init(e, i),
  6660. de.finishSetup(Object.keys(e.tags).length),
  6661. i.on(Te.IMAGE_OPENED, Ze.bind(this, "tag"));
  6662. var s = function() {
  6663. i.dismissExaminedTag(),
  6664. i.disableHovering()
  6665. };
  6666. Ae.on(ye.OPENED, s),
  6667. Ce.on(Me.OPENED, s),
  6668. he.on(ue.OPENED, s),
  6669. fe.on(ge.OPENED, s);
  6670. var l = i.enableHovering.bind(i);
  6671. if (Ae.on(ye.CLOSED, l),
  6672. Ce.on(Me.CLOSED, l),
  6673. he.on(ue.CLOSED, l),
  6674. fe.on(ge.CLOSED, l),
  6675. Q.labels.enabled && Object.keys(e.labels).length,
  6676. e.floors.length <= 1 || !je.floors.visible ? je.floors.visible = !1 : (y(e, t),
  6677. C(e.currentFloor, n.mode)),
  6678. getQueryVariable('m') === '372'&& (je.floors.visible = 1, y(e,t)),
  6679. r(),
  6680. o(t, t.player),
  6681. $("#gui").fadeIn(1500),
  6682. je.highlight.visible && (2 !== Q.startHighlights || e.has360Views) && setTimeout(function() {
  6683. a(),
  6684. (!e.has360Views && 1 !== Q.startHighlights || e.has360Views && 0 === Q.startHighlights) && setTimeout(a, 2e3)
  6685. }, 2e3),
  6686. !K.isMobile())
  6687. for (var c = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], h = 0; h < c.length; h++)
  6688. $(c[h]).addClass("hasHover");
  6689. O(e),
  6690. de.setupToggling();
  6691. //xzw:
  6692. window.editHotPanel && editHotPanel();
  6693. //czj
  6694. navBorderRadius(e);
  6695. //czj 编辑界面
  6696. //window.EditingInterface && new EditingInterface(n.sceneRenderer);
  6697. window.EditTools && new EditTools(n.sceneRenderer);
  6698. }
  6699. function navBorderRadius(e){
  6700. var pullTab = $("#pullTab"),
  6701. mobileRadius = {
  6702. "bottom":{"border-bottom-left-radius":"10px","border-bottom-right-radius":"10px"},
  6703. "top":{"border-top-left-radius":"10px","border-top-right-radius":"10px"}
  6704. },
  6705. topRadius = {
  6706. "bottom":{"border-top-right-radius":"10px","border-bottom-right-radius":"10px"},
  6707. "top":{"border-bottom-left-radius":"10px","border-top-left-radius":"10px"}
  6708. };
  6709. function BorderRadius(bottom,top){
  6710. $("#gui-modes-map > div:visible:last").css(bottom);
  6711. if(pullTab.is(':visible')){
  6712. $(".viewContainer > div:visible:first").css(top);
  6713. }else{
  6714. $("#gui-modes-map > div:visible:first").css(top);
  6715. }
  6716. }
  6717. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  6718. BorderRadius(mobileRadius.bottom,mobileRadius.top);
  6719. }else{
  6720. BorderRadius(topRadius.bottom,topRadius.top);
  6721. }
  6722. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  6723. if(window.MP_PREFETCHED_MODELDATA.model.special || window.MP_PREFETCHED_MODELDATA.special){
  6724. window.specialScene && specialScene.special().afterImplement();
  6725. }
  6726. }
  6727. function p(e) {
  6728. e || (e = 0),
  6729. We = !1,
  6730. window.setTimeout(function() {
  6731. We || (ze = !0,
  6732. $("#gui-spinner").stop(!0, !0).show())
  6733. }
  6734. .bind(this), e)
  6735. }
  6736. function f() {
  6737. $("#gui-spinner").stop(!0, !0),
  6738. $("#gui-spinner").fadeOut(1e3),
  6739. We = !0,
  6740. ze = !1
  6741. }
  6742. function g(e, t) {
  6743. // $('#gui-modes-inside img').attr('src','images/inside1.png')
  6744. // $('#gui-modes-dollhouse img').attr('src','images/dollhouse.png')
  6745. // $('#gui-modes-floorplan img').attr('src','images/floor.png')
  6746. var i = e.mode
  6747. , n = t || e.currentPano;
  6748. $("#gui-modes-dollhouse").toggleClass("active", i === _e.DOLLHOUSE),
  6749. $("#gui-modes-floorplan").toggleClass("active", i === _e.FLOORPLAN),
  6750. $("#gui-modes-inside").toggleClass("active", i === _e.PANORAMA),
  6751. i === _e.PANORAMA ? ($("#view-controllers").slideUp(500),
  6752. Q.show360Views.enabled && !n.isAligned() ? (
  6753. $(".gui-floor").addClass("hidden"),
  6754. $("#gui-modes-outside").addClass("desktop-only")) : (
  6755. $(".gui-floor").removeClass("hidden"),
  6756. $("#gui-modes-outside").removeClass("desktop-only")),
  6757. $("#gui-modes-outside").removeClass("hidden")) : i !== _e.TRANSITIONING && (f(),
  6758. Be = i,
  6759. $("#gui-modes-outside").addClass("hidden"),
  6760. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6761. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(Q.guiAnimationSpeed))
  6762. setTimeout(()=>{
  6763. // console.log(1111111,$('#gui-modes-inside').attr('class'));
  6764. if($('#gui-modes-inside').attr('class')==='active'){
  6765. $('#gui-modes-inside img').attr('src','images/inside1.png')
  6766. $('#gui-modes-dollhouse img').attr('src','images/dollhouse.png')
  6767. $('#gui-modes-floorplan img').attr('src','images/floor.png')
  6768. }
  6769. },500)
  6770. }
  6771. function m(e, t) {
  6772. // console.log(1111111);
  6773. var i = t.player;
  6774. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6775. l(e),
  6776. J.updateInteraction(Se.InteractionGui, "inside-button"),
  6777. J.track("USER", {
  6778. event_type: "showcase_gui",
  6779. gui_action: "click_inside_mode_button"
  6780. }),
  6781. t.changeMode(_e.PANORAMA);
  6782. // console.log(333333);
  6783. $('#gui-modes-inside img').attr('src','images/inside1.png')
  6784. $('#gui-modes-dollhouse img').attr('src','images/dollhouse.png')
  6785. $('#gui-modes-floorplan img').attr('src','images/floor.png')
  6786. }),
  6787. // $("#gui-modes-inside").on("click", function(e) {
  6788. // $('#gui-modes-inside img').attr('src','images/inside1.png')
  6789. // $('#gui-modes-dollhouse img').attr('src','images/dollhouse.png')
  6790. // $('#gui-modes-floorplan img').attr('src','images/floor.png')
  6791. // }),
  6792. $("#gui-modes-outside").find("a").on("click", function(e) {
  6793. l(e),
  6794. J.track("showcase_gui", {
  6795. gui_action: "click_outside_mode_button"
  6796. }),
  6797. t.changeMode(Be)
  6798. }),
  6799. $("#gui-modes-floorplan").on("click", function(e) {
  6800. l(e),
  6801. i.mode !== _e.FLOORPLAN && (J.track("showcase_gui", {
  6802. gui_action: "click_floorplan_mode_button"
  6803. }),
  6804. t.changeMode(_e.FLOORPLAN));
  6805. $('#gui-modes-inside img').attr('src','images/inside.png')
  6806. $('#gui-modes-dollhouse img').attr('src','images/dollhouse.png')
  6807. $('#gui-modes-floorplan img').attr('src','images/floor1.png')
  6808. }),
  6809. $("#gui-modes-dollhouse").on("click", function(e) {
  6810. l(e),
  6811. i.mode !== _e.DOLLHOUSE && (J.track("showcase_gui", {
  6812. gui_action: "click_dollhouse_mode_button"
  6813. }),
  6814. t.changeMode(_e.DOLLHOUSE));
  6815. $('#gui-modes-inside img').attr('src','images/inside.png')
  6816. $('#gui-modes-dollhouse img').attr('src','images/dollhouse1.png')
  6817. $('#gui-modes-floorplan img').attr('src','images/floor.png')
  6818. })
  6819. }
  6820. function v(e, t) {
  6821. function i() {
  6822. document.getElementById("vr").classList.remove("hidden"),
  6823. Q.vr.allowWebVR ? K.getVRDisplay().then(function(e) {
  6824. K.supportsFullscreen() ? n(e) : (De.warn("Unable to use WebVR when full screen is not supported"),
  6825. $(".improper-embed").toggleClass("hidden", !1),
  6826. r())
  6827. }, function(e) {
  6828. r()
  6829. }) : r()
  6830. }
  6831. function n(i) {
  6832. De.info(i.displayName + " detected, VR button activates WebVR experience"),
  6833. Ie.init(e.data, t, i, q),
  6834. Ie.on(Ee.OPENED, Ze.bind(gui, "vr")),
  6835. Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe))
  6836. }
  6837. function r() {
  6838. De.info("WebVR support not found, VR button activates native app VR modal"),
  6839. Ae.init(e.data, q),
  6840. Ae.on(ye.OPENED, function() {
  6841. var e = document.getElementById("vr-modal");
  6842. return function() {
  6843. Ze("vr"),
  6844. le.open(e)
  6845. }
  6846. }()),
  6847. Ae.on(ye.CLOSED, le.reset)
  6848. }
  6849. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash("mls", 0)){
  6850. /*********************** 方奕卓 VR功能事件监听 ********************/
  6851. K.isMobile() && $('#vr').css('display', ''); // 显示vr功能按钮
  6852. switch (Q.vr.option) {
  6853. case Pe.CONTEXTUAL:
  6854. i();
  6855. break;
  6856. case Pe.ANDROID:
  6857. K.detectAndroid() && i();
  6858. break;
  6859. case Pe.NONE:
  6860. }
  6861. }
  6862. }
  6863. function A(e, t) {
  6864. $("#play").on("mousedown touchstart", function(e) {
  6865. l(e);
  6866. Ze("tour");
  6867. ve.play();
  6868. J.trackAlways("showcase_gui", {
  6869. gui_action: "play_highlights"
  6870. })
  6871. }),
  6872. window.startAndPlay = function(e) {
  6873. // l(e);
  6874. Ze("tour");
  6875. ve.play();
  6876. J.trackAlways("showcase_gui", {
  6877. gui_action: "play_highlights"
  6878. })
  6879. };
  6880. $("#pause").on("mousedown touchstart", function(e) {
  6881. l(e),
  6882. ve.pause(),
  6883. J.trackAlways("showcase_gui", {
  6884. gui_action: "pause_highlights"
  6885. })
  6886. }),
  6887. $("#gui-zoomin").find("a").on("click", function(e) {
  6888. l(e),
  6889. t.player.zoomInIncrementally()
  6890. }),
  6891. $("#gui-zoomout").find("a").on("click", function(e) {
  6892. l(e),
  6893. t.player.zoomOutIncrementally()
  6894. })
  6895. }
  6896. function y(e, t) {
  6897. for (var i = $(".gui-floor"), n = 0; n < e.floors.length; n++) {
  6898. if(getQueryVariable('m') === '372') continue;
  6899. var r = $('<div class="floorChoice" data-index="' + n + '"></div>').text(e.floors.get(n).name);
  6900. $(".gui-floor").find(".container").prepend(r)
  6901. //cxz 本来一开始是prepend 后来改了append 按顺序插入
  6902. }
  6903. i.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + Re.FLOOR_ALL + "</div>"),
  6904. i.on("click", function(e) {
  6905. l(e),
  6906. Ze("floor"),
  6907. i.toggleClass("open")
  6908. }),
  6909. $(".floorChoice").on("click", function(e) {
  6910. l(e);
  6911. var n = $(this).data("index");
  6912. "all" !== n ? (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6913. t.player.gotoFloor(n),
  6914. J.track("showcase_gui", {
  6915. gui_action: "click_floor_select_button",
  6916. interaction_source: "gui"
  6917. })) : (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6918. Ze("move"),
  6919. t.allFloors(),
  6920. J.track("showcase_gui", {
  6921. gui_action: "click_toggle_all_floors_button",
  6922. interaction_source: "gui"
  6923. })),
  6924. i.removeClass("open")
  6925. })
  6926. }
  6927. function C(e, t) {
  6928. e && (t === _e.DOLLHOUSE || t === _e.FLOORPLAN ? ($(".allFloorBtn").show(),$(".gui-floor-icon").hide(),$(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),$(".gui-floor-icon").show(),$(".gui-floor-title").hide()),
  6929. e.model.allFloorsVisible ? ($(".gui-floor-title").text(Re.FLOOR_ALL),
  6930. $(".gui-floor-number").text(Re.FLOOR_ALL),
  6931. $(".floorChoice").removeClass("active"),
  6932. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6933. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6934. $(".floorChoice").removeClass("active"),
  6935. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6936. }
  6937. function I(e) {
  6938. return e.describe().inTransition
  6939. }
  6940. function b(e, t, i) {
  6941. Fe = e.heroLocations.length;
  6942. var n = '<li class="thumbImg" data-index=""><img src=""></li>'
  6943. , r = 100 / Fe + "%"
  6944. , o = $("#thumb-container")
  6945. , a = $("#progressBar");
  6946. $("#status").find(".totalSteps").text(Fe);
  6947. for (var s = 0; s < Fe; s++) {
  6948. var c = e.heroLocations[s]
  6949. , h = $(n);
  6950. var thumbUrl
  6951. if(c.heroLocations){//有子项,选第一张截图
  6952. thumbUrl = manage.dealURL(c.heroLocations[0].thumbUrl)//.replace('https://','').replace('http://','')
  6953. }else{
  6954. thumbUrl = manage.dealURL(c.thumbUrl)//.replace('https://','').replace('http://','')
  6955. }
  6956. h.attr("data-index", s)
  6957. je.highlight.visible && h.find("img").attr("src", thumbUrl)
  6958. if (c.name) {
  6959. var u = $('<div class="overlay"></div>').text(c.name);
  6960. h.prepend(u)
  6961. }
  6962. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  6963. var d = e.panos.get(c.panoId)
  6964. , p = d && !d.isAligned()
  6965. , f = p ? '<div><img class="mark360View" src="images/mark-360-white-v2.png"></div>' : '<div><img class="markInsideView" src="images/mark-inside-white.png"></div>';
  6966. h.prepend(f)
  6967. }
  6968. o.append(h),
  6969. a.append('<div class="step" data-idx="' + s + '" style="width:' + r + '"></div>')
  6970. }
  6971. j = 144 * Fe,
  6972. Y = 111 * Fe,
  6973. $(".thumbImg").on("mouseover", function() {
  6974. I(t) || i.showPathToHeroLocation([$(this).data("index"),0])//改
  6975. }),
  6976. $(".thumbImg").on("mouseout", function() {
  6977. t.clearPath()
  6978. }),
  6979. //节流处理
  6980. $(".thumbImg").on("click", function(e) {
  6981. if(window.myTimer!==null) return;
  6982. window.myTimer = setTimeout(() => {
  6983. l(e);
  6984. var i = $(this);
  6985. J.updateInteraction(Se.InteractionGui, "thumbnail"),
  6986. J.trackAlways("showcase_gui", {
  6987. gui_action: "click_highlight"
  6988. }),
  6989. t.goToHighlight([i.data("index"),0])//改
  6990. //当定时器执行完毕,重新发开节流阀
  6991. window.myTimer =null;
  6992. },1000);
  6993. }),
  6994. $(".previous").find("a").on("click", function(e) {
  6995. l(e),
  6996. J.trackAlways("showcase_gui", {
  6997. gui_action: "prev_highlight"
  6998. }),
  6999. t.prevHighlight()
  7000. }),
  7001. $(".next").find("a").on("click", function(e) {
  7002. l(e),
  7003. J.trackAlways("showcase_gui", {
  7004. gui_action: "next_highlight"
  7005. }),
  7006. t.nextHighlight()
  7007. }),
  7008. $("#drawer").on("mouseleave", function(e) {
  7009. l(e);
  7010. var t;
  7011. try {
  7012. t = new MouseEvent("mouseup",{
  7013. clientX: e.clientX,
  7014. clientY: e.clientY,
  7015. screenX: e.screenX,
  7016. screenY: e.screenY
  7017. })
  7018. } catch (i) {
  7019. t = document.createEvent("MouseEvents"),
  7020. t.initMouseEvent("mouseup", e.bubbles, e.cancelable, e.view, e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget)
  7021. }
  7022. document.dispatchEvent(t)
  7023. }),
  7024. W = new Sly($("#scrollFrame"),{
  7025. horizontal: !0,
  7026. itemNav: "centered",
  7027. smart: !0,
  7028. scrollTrap: !0,
  7029. scrollBy: 1,
  7030. mouseDragging: !0,
  7031. touchDragging: !0,
  7032. speed: 300,
  7033. dragHandle: !0,
  7034. dynamicHandle: !0,
  7035. clickBar: !0,
  7036. scrollBar: $("#scroller"),
  7037. activateOn: null
  7038. }).init(),
  7039. W.on("active", function(e, t) {
  7040. Ve = t,
  7041. Ze("tour"),
  7042. $(".step").removeClass("active"),
  7043. $("#status").find(".curIdx").text(t + 1);
  7044. for (var i = 0; i <= t; i++)
  7045. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  7046. }),
  7047. w()
  7048. }
  7049. function w() {
  7050. var e = $("#player").width() - 20
  7051. , t = $("#scroller")
  7052. , i = $("#drawer")
  7053. , n = $(".pinBottom");
  7054. if ($("#player").width() < 488 || $("#player").height() < 488)
  7055. t.addClass("hidden"),
  7056. i.addClass("noScroll"),
  7057. n.addClass("noScroll");
  7058. else {
  7059. var r = j > e
  7060. , o = !i.hasClass("noScroll")
  7061. , a = r !== o;
  7062. a && (t.toggleClass("hidden"),
  7063. i.toggleClass("noScroll"),
  7064. n.toggleClass("noScroll"))
  7065. }
  7066. }
  7067. function _(e) {
  7068. je.tourControls.visible = true//e.tour_buttons && K.valueFromHash("gt", 1),
  7069. je.coBrand.visible = e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", !1),
  7070. je.highlight.visible = /* e.highlight_reel && */ 1 !== Q.specialEdition && Q.showHighlights
  7071. }
  7072. function T(e) {
  7073. function t(t, i) {
  7074. return !!e.player_options[t] && e[i || t]
  7075. }
  7076. $(".model-title").text(e.name);
  7077. var i = Q.pageTitle;
  7078. // 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  7079. 2 !== K.valueFromHash("mls", 0) && e.name && (i = e.name),
  7080. document.title = i ,
  7081. K.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  7082. delay: {
  7083. show: 50,
  7084. hide: 0
  7085. },
  7086. trigger: "hover",
  7087. html: !1,
  7088. viewport: {
  7089. selector: "body",
  7090. padding: 10
  7091. }
  7092. }),
  7093. K.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  7094. // t("presented_by") && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", 0) ? document.getElementById("loaderCoBrandName").innerText = t("presented_by") : document.getElementById("loaderCoBrand").classList.add("hidden"),
  7095. de.populate({
  7096. name: t("model_name", "name"),
  7097. coBrand: t("presented_by"),
  7098. description: t("model_summary", "summary") || "暂无内容",
  7099. contactName: t("contact_name"),
  7100. address: t("address"),
  7101. phone: t("contact_phone"),
  7102. formattedPhone: e.formatted_contact_phone,
  7103. email: t("contact_email"),
  7104. url: t("external_url"),
  7105. socialSharing: e.enable_social_sharing && e.is_public
  7106. })
  7107. }
  7108. function x(e, t, i, n, r, o) {
  7109. function a() {
  7110. o.setLoadingStartTime(),
  7111. H(),
  7112. r ? (re.showMessage(t, i, je.coBrand.visible),
  7113. l()) : h(l)
  7114. }
  7115. var s = $.Deferred()
  7116. , l = s.resolve.bind(s);
  7117. return Ge = !0,
  7118. O(e),
  7119. e.data.player_options && _(e.data.player_options),
  7120. 1 === Q.specialEdition && $("body").addClass("specialEdition"),
  7121. Re.localizeGUI(),
  7122. T(e.data),
  7123. r || $(".quick").addClass("hidden"),
  7124. //e.data.image && !r && E(e.data.image),
  7125. n ? (J.impression(),
  7126. a()) : (o.setWaitingStartTime(),
  7127. oe.show(r, a)),
  7128. s
  7129. }
  7130. function S(e, t, i, n, r, a, s) {
  7131. q = s,
  7132. e.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  7133. e.supportedModes[_e.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  7134. ae.init(),
  7135. re.init(e, a),
  7136. Oe.init(e, t, n),
  7137. $(".icon").on("mouseover", function() {
  7138. t.player && t.player.reticule.hide()
  7139. }),
  7140. m(e, t),
  7141. A(e, t),
  7142. e.data.enable_social_sharing && e.data.is_public && Q.share.enabled && (Ce.init(MP_PREFETCHED_MODELDATA.name/* e.data.name */),
  7143. Ce.on(Me.OPENED, function() {
  7144. var e = document.getElementById("share-modal");
  7145. return function() {
  7146. Ze("share"),
  7147. le.open(e)
  7148. }
  7149. }()),
  7150. Ce.on(Me.CLOSED, le.reset)),
  7151. e.heroLocations.length > 0 ? b(e, t, i) : (je.highlight.visible = !1,
  7152. je.tourControls.visible = !1),
  7153. de.on(pe.OPEN_INFO, Ze.bind(this, "info")),
  7154. z(),
  7155. g(i),
  7156. v(e, r),
  7157. e.on("floor.changed", C),
  7158. e.on("waiting", R.bind(this, e)),
  7159. e.on("waiting-done", P.bind(this, e)),
  7160. i.on(xe.ModeChanged, function(e, n) {
  7161. g(i),
  7162. o(t, i),
  7163. n === _e.PANORAMA && i.currentPano && !i.currentPano.isAligned() && (n = _e.OUTDOOR),
  7164. he.updateMode(n)
  7165. }),
  7166. n.on(Se.Move, Ze.bind(this, "move")),
  7167. i.on(xe.Ready, function() {
  7168. ie.init(n, i, i.tagManager, t),
  7169. i.on(xe.ModeChanged, function(e, t) {
  7170. e !== t && $(".vr-popup").is(":visible") && Ae.dismiss()
  7171. })
  7172. }),
  7173. i.on(xe.PanoChosen, function(e, t) {
  7174. g(i, t),
  7175. he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA)
  7176. }),
  7177. le.on(ce.CLOSE, function(e) {
  7178. switch (e) {
  7179. case "vr-modal":
  7180. Ae.dismiss();
  7181. break;
  7182. case "share-modal":
  7183. Ce.hide();
  7184. break;
  7185. case "terms-modal":
  7186. fe.hide()
  7187. }
  7188. });
  7189. var l = $("#play").eq(0)
  7190. , c = $("#pause").eq(0)
  7191. , h = $(".pinBottom").toArray()
  7192. , u = $("#drawer").eq(0)
  7193. , d = $("#playHead").eq(0)
  7194. , p = $("#progressBar").eq(0)
  7195. , f = $("#thumb-container").eq(0)
  7196. , y = f.children()
  7197. , I = p.children();
  7198. t.on("update.controls", function() {
  7199. var n = t.describe();
  7200. n.tourIsPlaying || i.isWarping() ? (je.tourControls.visible && (l.hide(),
  7201. c.show()),
  7202. n.tourInProgress && (h.forEach(function(e) {
  7203. e.classList.add("playing")
  7204. }),
  7205. u.addClass("playing"),
  7206. d.addClass("playing"))) : (je.tourControls.visible && (l.show(),
  7207. c.hide()),
  7208. n.tourInProgress || (ve.stopTour(),
  7209. h.forEach(function(e) {
  7210. e.classList.remove("playing")
  7211. }),
  7212. u.removeClass("playing"),
  7213. d.removeClass("playing")));
  7214. var r, a, s;
  7215. if (null !== n.currentItem) {
  7216. var p, f;
  7217. $("#status").find(".curIdx").text(n.currentItem[0] + 1),
  7218. n.onTheBus ? (p = "active",
  7219. f = "recent") : (f = "active",
  7220. p = "recent");
  7221. var g = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
  7222. for (r = 0; r < e.heroLocations.length; r += 1)
  7223. s = y.eq(r),
  7224. a = I.eq(r),
  7225. s.removeClass(f),
  7226. a.removeClass(f),
  7227. n.onTheBus && r === n.destinationItem[0] ? (s.addClass(p),
  7228. a.addClass(p),
  7229. W.activate(r)) : n.onTheBus && g && r === n.currentItem[0] ? (s.addClass(p),
  7230. a.addClass(p)) : (s.removeClass(p),
  7231. a.removeClass(p))
  7232. } else
  7233. for (r = 0; r < e.heroLocations.length; r += 1)
  7234. s = y.eq(r),
  7235. a = I.eq(r),
  7236. s.removeClass("active recent"),
  7237. a.removeClass("active recent");
  7238. o(t, i)
  7239. }),
  7240. document.addEventListener("keydown", function(n) {
  7241. switch (J.updateInteraction(Se.InteractionKey),
  7242. n.which) {
  7243. case we.ZERO:
  7244. Q.debug && e.toggleAlpha();
  7245. break;
  7246. case we.NINE:
  7247. Q.debug && se.toggle();
  7248. break;
  7249. case we.ONE:
  7250. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA);
  7251. break;
  7252. case we.TWO:
  7253. e.outsideAllowed() && !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) && t.changeMode(_e.DOLLHOUSE);
  7254. break;
  7255. case we.THREE:
  7256. e.outsideAllowed() && !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) && t.changeMode(_e.FLOORPLAN);
  7257. break;
  7258. case we.FOUR:
  7259. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR);
  7260. break;
  7261. case we.SPACE:
  7262. je.tourControls.visible && ($("#playHead").hasClass("playing") || Ze("tour"));
  7263. break;
  7264. case we.RETURN:
  7265. Q.debug && e.toggleExplodeUp();
  7266. break;
  7267. case we.P:
  7268. k();
  7269. break;
  7270. case we.U:
  7271. B();
  7272. break;
  7273. case we.X:
  7274. Q.debug && e.toggleExplode();
  7275. break;
  7276. case we.PLUSEQUALS:
  7277. t.player.activatePersistentZooming(!0),
  7278. ie.hideUi();
  7279. break;
  7280. case we.DASHUNDERSCORE:
  7281. t.player.activatePersistentZooming(!1),
  7282. ie.hideUi();
  7283. break;
  7284. case we.SEVEN:
  7285. De.info("Zoom level: " + t.player.zoomLevel + ", FOV: " + t.player.zoomFov);
  7286. break;
  7287. case we.EIGHT:
  7288. t.player.decreaseZoomSpeed();
  7289. break;
  7290. case we.NINE:
  7291. t.player.increaseZoomSpeed()
  7292. }
  7293. return i && i.reticule.hide(),
  7294. !0
  7295. }
  7296. .bind(this)),
  7297. document.addEventListener("keyup", function(e) {
  7298. switch (e.which) {
  7299. case we.PLUSEQUALS:
  7300. t.player.deactivatePersistentZooming();
  7301. break;
  7302. case we.DASHUNDERSCORE:
  7303. t.player.deactivatePersistentZooming()
  7304. }
  7305. }
  7306. .bind(this)),
  7307. F(e),
  7308. L(e, t.player),
  7309. M(i),
  7310. te.setAutoPlay(e.heroCount()),
  7311. he.init(i, a.mode),
  7312. he.on(ue.OPENED, Ze.bind(this, "help")),
  7313. fe.init(),
  7314. fe.on(ge.OPENED, function() {
  7315. var e = document.getElementById("terms-modal");
  7316. return function() {
  7317. Ze("terms"),
  7318. le.open(e)
  7319. }
  7320. }()),
  7321. fe.on(ge.CLOSED, le.reset),
  7322. Q.quickstart.enabled || re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  7323. (Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
  7324. Q.profiling.enabled && se.show(),
  7325. ve.init(t)
  7326. }
  7327. function M(e) {
  7328. var t = function(e, t) {
  7329. $(e).find("a").each(function(e, i) {
  7330. t ? $(i).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(i).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  7331. i.style.pointerEvents = t ? "auto" : "none"
  7332. })
  7333. }
  7334. , i = function() {
  7335. e.zoomLevel >= Q.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  7336. e.zoomLevel <= Q.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  7337. };
  7338. e.on(Ne.ZoomMax, function() {
  7339. t("#gui-zoomin", !1),
  7340. t("#gui-zoomout", !0)
  7341. }),
  7342. e.on(Ne.ZoomMin, function() {
  7343. t("#gui-zoomin", !0),
  7344. t("#gui-zoomout", !1)
  7345. }),
  7346. e.on(Ne.ZoomIn, function() {
  7347. t("#gui-zoomout", !0)
  7348. }),
  7349. e.on(Ne.ZoomOut, function() {
  7350. t("#gui-zoomin", !0)
  7351. }),
  7352. i()
  7353. }
  7354. function R(e) {
  7355. O(e)
  7356. }
  7357. function P(e) {
  7358. O(e)
  7359. }
  7360. function O(e) {
  7361. var t = e.waitQueue.length;
  7362. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay)
  7363. }
  7364. function L(e, t) {
  7365. He = {
  7366. gui: null,
  7367. visible: !1,
  7368. model: e,
  7369. player: t
  7370. }
  7371. }
  7372. function D(e, t) {
  7373. function i() {
  7374. var i = t.toJSON();
  7375. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + e.sid + "&start=" + be.serialize(i),
  7376. t.tagManager.activeTag && (n.linkToLocation += "&tag=" + t.tagManager.activeTag.sid)
  7377. }
  7378. var n = {}
  7379. , r = new Le.GUI({
  7380. autoPlace: !0,
  7381. width: "60%"
  7382. });
  7383. i(),
  7384. t.on(xe.ViewChanged, i),
  7385. r.add(n, "linkToLocation").name(Re.LINK_TO_LOCATION).listen(),
  7386. r.domElement.id = "datLinks";
  7387. var o = [].slice.call(r.domElement.querySelectorAll(".property-name"));
  7388. return o.forEach(function(e) {
  7389. if (!K.detectSafari()) {
  7390. var t = document.createElement("button");
  7391. t.classList.add("btn-deep-link"),
  7392. t.innerText = Re.MENU_COPY,
  7393. e.nextSibling.appendChild(t);
  7394. var i = function() {
  7395. alert(Re.LINK_ALERT_COPY),
  7396. t.hide()
  7397. };
  7398. t.addEventListener("click", function(e) {
  7399. try {
  7400. var t = e.target.parentNode.childNodes[0];
  7401. t.select();
  7402. var n = document.execCommand("copy");
  7403. t.blur(),
  7404. n || i()
  7405. } catch (e) {
  7406. i()
  7407. }
  7408. })
  7409. }
  7410. }),
  7411. $(r.__closeButton).hide(),
  7412. r
  7413. }
  7414. function N(e) {
  7415. He.gui || (He.gui = D(He.model, He.player)),
  7416. He.visible = e,
  7417. e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide()
  7418. }
  7419. function B() {
  7420. N(!He.visible)
  7421. }
  7422. function F(e) {
  7423. ke = {
  7424. gui: null,
  7425. visible: !1,
  7426. model: e
  7427. }
  7428. }
  7429. function V(e) {
  7430. var t = new Le.GUI;
  7431. return t.add(Q, "showSweeps").name("Show sweeps").onFinishChange(function() {
  7432. e.setSweepVisibility(Q.showSweeps)
  7433. }),
  7434. t.add(Q, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  7435. t.add(Q.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  7436. Q.transition.flySpeed = 0,
  7437. t.__controllers.forEach(function(e) {
  7438. e.updateDisplay()
  7439. })
  7440. }),
  7441. t.add(Q.path, "opacity", 0, 1).name("Path opacity"),
  7442. $(t.__closeButton).hide(),
  7443. t
  7444. }
  7445. function U(e) {
  7446. ke.gui || (ke.gui = V(ke.model)),
  7447. ke.visible = e,
  7448. e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide()
  7449. }
  7450. function k() {
  7451. U(!ke.visible)
  7452. }
  7453. function H() {
  7454. function e(e) {
  7455. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)/* || e.preventDefault()*/
  7456. }
  7457. $("body").css("touch-action", "none"),
  7458. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {
  7459. // e.preventDefault()
  7460. });
  7461. var t = document.getElementById("terms-text")
  7462. , i = document.getElementById("more-help-wrapper")
  7463. , n = (document.getElementById("navigation-help-wrapper"),
  7464. document.getElementById("help-dialog"),
  7465. document.getElementById("tag-billboards"));
  7466. Q.useWheel && (document.body.addEventListener("mousewheel", e, { passive: false }),
  7467. document.body.addEventListener("DOMMouseScroll", e)),
  7468. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  7469. e.stopPropagation()
  7470. })
  7471. }
  7472. function G(e, t) {
  7473. for (var i = []; e; )
  7474. i.push(e),
  7475. e = e.parentNode;
  7476. for (; t && i.indexOf(t) === -1; )
  7477. t = t.parentNode;
  7478. return t
  7479. }
  7480. function z() {
  7481. var e, t = function(t) {
  7482. e = 0 === t.button || 1 === t.which ? t.target : null
  7483. }, i = function(t) {
  7484. e !== t.target && (e = G(e, t.target));
  7485. var i = document.getElementById("gui-parent");
  7486. if (G(i, e) !== i && (e = null),
  7487. e) {
  7488. var n;
  7489. try {
  7490. n = new MouseEvent("click",t)
  7491. } catch (e) {
  7492. n = document.createEvent("MouseEvents"),
  7493. n.initMouseEvent("click", t.bubbles, t.cancelable, t.view, t.detail, t.screenX, t.screenY, t.clientX, t.clientY, t.ctrlKey, t.altKey, t.shiftKey, t.metaKey, t.button, t.relatedTarget)
  7494. }
  7495. n.syntheticClick = !0,
  7496. e.dispatchEvent(n),
  7497. e = null
  7498. }
  7499. };
  7500. document.body.addEventListener("mousedown", t, !0),
  7501. document.body.addEventListener("mouseup", i, !0),
  7502. document.getElementById("gui-parent").addEventListener("click", function(e) {
  7503. e.syntheticClick || (e.stopPropagation(),
  7504. "A" === e.target.nodeName && e.preventDefault())
  7505. }, !0)
  7506. }
  7507. var W, j, Y, X, Z, q, K = (e("three"),
  7508. e("../util/ajax"),
  7509. e("../util/browser")), Q = e("../settings"), J = e("../analytics"), ee = (e("../util/transitions"),
  7510. e("../util/camera"),
  7511. e("../util/logger")), te = (e("../objects/Snapshot"),
  7512. e("./helpManager")), ie = e("./immersiveMode"), ne = e("./loadingScreen"), re = e("./landingScreen"), oe = e("./playButton"), ae = e("./populateModal"), se = e("./memoryUsage"), le = e("./closer/modalCloser"), ce = e("./closer/ModalCloserEvent"), he = e("./help/help"), ue = e("./help/HelpEvent"), de = e("./title/titleBar"), pe = e("./title/TitleEvents"), fe = e("./terms/terms"), ge = e("./terms/TermsEvent"), me = e("./title/tagToggle"), ve = e("./tourInteraction"), Ae = e("./vr/vrModal"), ye = e("./vr/vrEvent"), Ce = e("./sharing/modal"), Ie = e("./webvr/webVRgui"), Ee = e("./webvr/WebVrEvent"), be = e("../controls/serializer"), we = e("../enum/Keys"), _e = e("../enum/Viewmode"), Te = (e("../enum/BlackoutStyle"),
  7513. e("../tag/Media/MediaEvent")), xe = (e("../enum/PathDiscardMode"),
  7514. e("../enum/PathDisplayMode"),
  7515. e("../enum/DirectorEvents"),
  7516. e("../enum/PlayerEvents")), Se = e("../enum/ControlEvents"), Me = e("./sharing/ShareEvents"), Re = e("../localization/localize"), Pe = (e("../enum/Vectors"),
  7517. e("../enum/WarpStyle"),
  7518. e("../enum/AlignmentType"),
  7519. e("../enum/VROption")), Oe = e("./konami"), Le = e("../lib/dat.gui"), De = new ee(i), Ne = (e("../util/showcase"),
  7520. e("../enum/ZoomEvents")), Be = _e.DOLLHOUSE, Fe = 0, Ve = 0, Ue = [".hideTarget"], ke = null, He = null, Ge = !1, ze = !1, We = !1, je = {
  7521. coBrand: {
  7522. visible: !0,
  7523. elements: [".co-brand", "#loaderCoBrand"]
  7524. },
  7525. help: {
  7526. visible: !0,
  7527. elements: [".nav-help", "#nav-help"]
  7528. },
  7529. tourControls: {
  7530. visible: !0,
  7531. elements: [".next", ".previous", "#play"]
  7532. },
  7533. highlight: {
  7534. visible: !0,
  7535. elements: ["#drawer", "#pullTab"]
  7536. },
  7537. share: {
  7538. visible: !0,
  7539. elements: [".socialButton", "#share"]
  7540. },
  7541. fullScreen: {
  7542. visible: !0,
  7543. elements: ["#gui-fullscreen"]
  7544. },
  7545. floors: {
  7546. visible: !0,
  7547. elements: [".gui-floor"]
  7548. }
  7549. }, Ye = function() {
  7550. var e = document.getElementById("drawer");
  7551. return function() {
  7552. $("#player").height() < 400 && e.classList.contains("open") && a()
  7553. }
  7554. }(), Xe = function() {
  7555. var e = document.getElementById("meta-info");
  7556. return function() {
  7557. $("#player").height() < 400 && e.classList.contains("expand") && de.toggleMeta(!0)
  7558. }
  7559. }(), Ze = function(e) {
  7560. function t() {
  7561. u.classList.contains("expand") && de.toggleMeta(!0)
  7562. }
  7563. function i() {
  7564. fe.hide()
  7565. }
  7566. function n() {
  7567. he.close()
  7568. }
  7569. function r() {
  7570. Ae.dismiss()
  7571. }
  7572. function o() {
  7573. p.hasClass("open") && a(!0)
  7574. }
  7575. function l() {
  7576. Ce.hide()
  7577. }
  7578. function c() {
  7579. f.hasClass("open") && f.removeClass("open")
  7580. }
  7581. function h() {
  7582. d.classList.contains("fadeIn") && (d.classList.contains("landing") ? re.dismissModal() : d.classList.contains("tour") && ve.dismissModal())
  7583. }
  7584. var u = document.getElementById("meta-info")
  7585. , d = document.getElementById("interaction-modal")
  7586. , p = $("#drawer").eq(0)
  7587. , f = $(".gui-floor").eq(0)
  7588. , g = $(".vr-popup").eq(0);
  7589. return function(e) {
  7590. switch (e) {
  7591. case "info":
  7592. i(),
  7593. n(),
  7594. Ye(),
  7595. l(),
  7596. c(),
  7597. r(),
  7598. h();
  7599. break;
  7600. case "terms":
  7601. t(),
  7602. n(),
  7603. o(),
  7604. l(),
  7605. c(),
  7606. r(),
  7607. h();
  7608. break;
  7609. case "help":
  7610. t(),
  7611. i(),
  7612. l(),
  7613. c(),
  7614. r(),
  7615. h();
  7616. break;
  7617. case "vr":
  7618. t(),
  7619. i(),
  7620. l(),
  7621. c(),
  7622. n(),
  7623. h(),
  7624. s(g) && o();
  7625. break;
  7626. case "highlights":
  7627. Xe(),
  7628. i(),
  7629. l(),
  7630. c();
  7631. break;
  7632. case "share":
  7633. t(),
  7634. i(),
  7635. n(),
  7636. c(),
  7637. r(),
  7638. h();
  7639. break;
  7640. case "floor":
  7641. i(),
  7642. l(),
  7643. r();
  7644. break;
  7645. case "view":
  7646. c(),
  7647. l(),
  7648. i(),
  7649. r();
  7650. break;
  7651. case "tour":
  7652. i(),
  7653. l(),
  7654. c(),
  7655. r();
  7656. break;
  7657. case "move":
  7658. i(),
  7659. l(),
  7660. c(),
  7661. r();
  7662. break;
  7663. case "resize":
  7664. t(),
  7665. Ye(),
  7666. c();
  7667. break;
  7668. case "tag":
  7669. i(),
  7670. n(),
  7671. l(),
  7672. c(),
  7673. r()
  7674. }
  7675. }
  7676. }();
  7677. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  7678. $("#gui-fullscreen").toggle(!K.isFullscreen()),
  7679. $("#gui-fullscreen-exit").toggle(!!K.isFullscreen()),
  7680. setTimeout(function() {
  7681. $(".icon:visible").hide().show(0)
  7682. }, 100)
  7683. }),
  7684. $("#gui-fullscreen").find("a").on("click", function(e) {
  7685. l(e),
  7686. K.requestFullscreen($("body")[0]),
  7687. J.track("showcase_gui", {
  7688. gui_action: "click_enter_fullscreen",
  7689. interaction_source: "gui"
  7690. })
  7691. //czj
  7692. //W.reload()
  7693. }),
  7694. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  7695. l(e),
  7696. K.exitFullscreen(),
  7697. J.track("showcase_gui", {
  7698. gui_action: "click_exit_fullscreen",
  7699. interaction_source: "gui"
  7700. })
  7701. })
  7702. $(window).on("resize", function(e) {
  7703. var t = e.target.innerHeight
  7704. , i = e.target.innerWidth;
  7705. t === X && i === Z || (je.highlight.visible && w(),
  7706. Ze("resize"),
  7707. $(".pinTop.right").removeClass("hideUnderMeta"),
  7708. c(),
  7709. X = t,
  7710. Z = i)
  7711. }).resize(),
  7712. K.supportsFullscreen() || $("#gui-fullscreen").hide(),
  7713. $("#pullTab").on("click", function(e) {
  7714. l(e),
  7715. $("#drawer").hasClass("open") ? (J.trackAlways("showcase_gui", {
  7716. gui_action: "hide_highlight_reel"
  7717. }),
  7718. $(this).addClass("open").children("img").attr("src","images/auto.png")) : (J.trackAlways("showcase_gui", {
  7719. gui_action: "show_highlight_reel"
  7720. }),
  7721. $(this).removeClass("open").children("img").attr("src","images/auto-suspend.png"));
  7722. a()
  7723. });
  7724. /***********************方奕卓 热点列表事件监听 ************************/
  7725. if(window.MP_PREFETCHED_MODELDATA.showHotListSta) {
  7726. $('#hotList').css('display', '');
  7727. $('#hotList').on('click',function(e){
  7728. l(e);
  7729. var hotList = $('#hotListWrap')[0];
  7730. var isActive = hotList.classList.contains('hotListActive');
  7731. if(isActive){
  7732. hotList.classList.remove('hotListActive');
  7733. this.classList.remove('active')
  7734. }else{
  7735. hotList.classList.add('hotListActive');
  7736. this.classList.add('active')
  7737. }
  7738. }),
  7739. $('#hotListContent ul').on('mouseover', function(e){
  7740. l(e);
  7741. var target = e.target;
  7742. var hotList = document.getElementById('hotListWrap');
  7743. if(target.tagName === 'SPAN'){
  7744. var targetParent = target.parentElement.parentElement;
  7745. if(target.offsetWidth + 116 >= targetParent.clientWidth){
  7746. hotList.style.width = target.offsetWidth + 116 + 'px';
  7747. }else{
  7748. hotList.style.width = '';
  7749. }
  7750. }else if(target.tagName === 'LI'){
  7751. var targetParent = target.parentElement;
  7752. if(target.children[0].offsetWidth + 116 >= targetParent.clientWidth){
  7753. hotList.style.width = target.children[0].offsetWidth + 116 + 'px';
  7754. }else{
  7755. hotList.style.width = ''
  7756. }
  7757. }else {
  7758. hotList.style.width = '';
  7759. }
  7760. });
  7761. $('#hotListContent ul').on('click', function(e){
  7762. l(e);
  7763. this.preElem && this.preElem.classList.remove('active');
  7764. if(e.target.tagName === 'SPAN'){
  7765. e.target.parentElement.classList.add('active');
  7766. e.target.parentElement.hot && e.target.parentElement.hot.examine(window.player,true); // 打开热点
  7767. this.preElem = e.target.parentElement;
  7768. }else{
  7769. e.target.classList.add('active');
  7770. e.target.hot && e.target.hot.examine(window.player,true); // 打开热点
  7771. this.preElem = e.target;
  7772. }
  7773. })
  7774. $('#hotListClose').on('click', function(e){
  7775. l(e);
  7776. var hotList = $('#hotListWrap')[0];
  7777. hotList.classList.remove('hotListActive');
  7778. $('#hotListContent ul .active').removeClass('active');
  7779. $('#hotList')[0].classList.remove('active')
  7780. })
  7781. }
  7782. /*****************************************************************/
  7783. $("#more-menu-button").on("click", function(e) {
  7784. l(e);
  7785. var t = $("#more-menu");
  7786. t.toggleClass("open")
  7787. }),
  7788. t.exports.init = S,
  7789. t.exports.startLoading = x,
  7790. t.exports.endLoading = d,
  7791. t.exports.onProgress = u
  7792. }
  7793. ).call(this, "/js/gui/gui.js")
  7794. }
  7795. , {
  7796. "../analytics": 4,
  7797. "../controls/serializer": 14,
  7798. "../enum/AlignmentType": 17,
  7799. "../enum/BlackoutStyle": 18,
  7800. "../enum/ControlEvents": 21,
  7801. "../enum/DirectorEvents": 23,
  7802. "../enum/Keys": 30,
  7803. "../enum/PathDiscardMode": 38,
  7804. "../enum/PathDisplayMode": 39,
  7805. "../enum/PlayerEvents": 40,
  7806. "../enum/VROption": 47,
  7807. "../enum/Vectors": 50,
  7808. "../enum/Viewmode": 51,
  7809. "../enum/WarpStyle": 52,
  7810. "../enum/ZoomEvents": 53,
  7811. "../lib/dat.gui": 93,
  7812. "../localization/localize": 108,
  7813. "../tag/Media/MediaEvent": 131,
  7814. "../objects/Snapshot": 153,
  7815. "../settings": 166,
  7816. "../util/ajax": 181,
  7817. "../util/browser": 182,
  7818. "../util/camera": 183,
  7819. "../util/logger": 189,
  7820. "../util/showcase": 193,
  7821. "../util/transitions": 195,
  7822. "./closer/ModalCloserEvent": 61,
  7823. "./closer/modalCloser": 62,
  7824. "./help/HelpEvent": 66,
  7825. "./help/help": 67,
  7826. "./helpManager": 68,
  7827. "./immersiveMode": 69,
  7828. "./konami": 70,
  7829. "./landingScreen": 71,
  7830. "./loadingScreen": 72,
  7831. "./memoryUsage": 73,
  7832. "./playButton": 74,
  7833. "./populateModal": 75,
  7834. "./sharing/ShareEvents": 76,
  7835. "./sharing/modal": 77,
  7836. "./terms/TermsEvent": 78,
  7837. "./terms/terms": 79,
  7838. "./title/TitleEvents": 80,
  7839. "./title/tagToggle": 81,
  7840. "./title/titleBar": 82,
  7841. "./tourInteraction": 84,
  7842. "./vr/vrEvent": 85,
  7843. "./vr/vrModal": 87,
  7844. "./webvr/WebVrEvent": 88,
  7845. "./webvr/webVRgui": 89,
  7846. three: 217
  7847. }],
  7848. 66: [function(e, t, i) {
  7849. "use strict";
  7850. t.exports = Object.freeze({
  7851. OPENED: "help.opened",
  7852. CLOSED: "help.closed"
  7853. })
  7854. }
  7855. , {}],
  7856. 67: [function(e, t, i) {
  7857. "use strict";
  7858. function n() {
  7859. g.on("click", function(e) {
  7860. if (S && S !== l.TRANSITIONING) {
  7861. var t = window.getComputedStyle(y).getPropertyValue("opacity") > 0;
  7862. t && !M ? R.close() : r()
  7863. }
  7864. }),
  7865. w.on("click", function(e) {
  7866. R.close()
  7867. }),
  7868. E.on("click", function(e) {
  7869. S && S !== l.TRANSITIONING && (s(),
  7870. o())
  7871. }),
  7872. b.on("click", function(e) {
  7873. s(),
  7874. a()
  7875. })
  7876. }
  7877. function r() {
  7878. S && S !== l.TRANSITIONING && (M = !0,
  7879. setTimeout(function() {
  7880. M = !1
  7881. }, d.help.modalStayDuration),
  7882. R.emit(h.OPENED),
  7883. m.addClass("open " + S),
  7884. g.addClass("open"),
  7885. s(),
  7886. o(),
  7887. y.style.removeProperty ? y.style.removeProperty("display") : y.style.removeAttribute("display"),
  7888. y.classList.add("fadeIn"))
  7889. }
  7890. function o() {
  7891. E.addClass("underline-tab"),
  7892. u.fill(_, c.NAVIGATION, S),
  7893. m.addClass(S)
  7894. }
  7895. function a() {
  7896. b.addClass("underline-tab"),
  7897. u.fill(T, c.MORE_HELP),
  7898. m.addClass("more-help")
  7899. }
  7900. function s(e, t) {
  7901. m.removeClass("more-help " + l.PANORAMA + " " + l.DOLLHOUSE + " " + l.FLOORPLAN + " " + l.OUTDOOR),
  7902. I.forEach(function(e) {
  7903. e.classList.remove("underline-tab")
  7904. })
  7905. }
  7906. var l = e("../../enum/Viewmode")
  7907. , c = e("../../enum/HelpModalType")
  7908. , h = e("./HelpEvent")
  7909. , u = (e("../helpManager"),
  7910. e("./../populateModal"))
  7911. , d = e("../../settings")
  7912. , p = e("../../util/common")
  7913. , f = e("events").EventEmitter
  7914. , g = $(".footer-help").eq(0)
  7915. , m = $("#help-dialog").eq(0)
  7916. , v = document.querySelector("#quick-logo")
  7917. , A = document.querySelector("#loaderCoBrand")
  7918. , y = document.querySelector("#help-dialog")
  7919. , C = document.querySelector(".footer")
  7920. , I = $(".help-tabs").children().toArray()
  7921. , E = $(".navigation-tab").eq(0)
  7922. , b = $(".more-help-tab").eq(0)
  7923. , w = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7924. m.find(".close").eq(0))
  7925. , _ = m.find(".interactions").toArray()
  7926. , T = m.find(".ui-instructions").toArray()
  7927. , x = l.PANORAMA
  7928. , S = l.PANORAMA
  7929. , M = !1
  7930. , R = {
  7931. init: function(e, t) {
  7932. S = t,
  7933. x = t,
  7934. [y, A, v, C].forEach(function(e) {
  7935. e.classList.add(u.deviceType)
  7936. }),
  7937. n()
  7938. },
  7939. close: function() {
  7940. if (m.hasClass("open") && (this.emit(h.CLOSED),
  7941. g.removeClass("open"),
  7942. m.removeClass("open"),
  7943. y.classList.contains("fadeIn"))) {
  7944. y.classList.remove("fadeIn");
  7945. var e = S === l.TRANSITIONING ? x : S;
  7946. u.clear(_, c.NAVIGATION, e)
  7947. }
  7948. },
  7949. updateMode: function(e) {
  7950. x = S,
  7951. S = e
  7952. }
  7953. };
  7954. p.extendObject(R, f.prototype),
  7955. t.exports = R
  7956. }
  7957. , {
  7958. "../../enum/HelpModalType": 28,
  7959. "../../enum/Viewmode": 51,
  7960. "../../settings": 166,
  7961. "../../util/common": 185,
  7962. "../helpManager": 68,
  7963. "./../populateModal": 75,
  7964. "./HelpEvent": 66,
  7965. events: 202
  7966. }],
  7967. 68: [function(e, t, i) {
  7968. (function(i) {
  7969. "use strict";
  7970. var n = e("../util/browser")
  7971. , r = e("./../util/logger")
  7972. , o = e("./../settings")
  7973. , a = new r(i)
  7974. , s = function() {
  7975. var e;
  7976. try {
  7977. return e = window.localStorage.getItem("visitCount") || "0",
  7978. e = (parseFloat(e) + 1).toString(),
  7979. window.localStorage.setItem("visitCount", e),
  7980. a.debug("visitCount = " + e),
  7981. e
  7982. } catch (t) {
  7983. e = "1",
  7984. a.debug("couldn't set local storage")
  7985. }
  7986. }()
  7987. , l = !1;
  7988. t.exports = {
  7989. isHelpDisabled: function() {
  7990. return "0" === n.valueFromHash("help", null) || l
  7991. },
  7992. isLargeHelpEnabled: function() {
  7993. return ("1" === s || "1" === n.valueFromHash("help", null)) && !this.isHelpDisabled()
  7994. },
  7995. isSmallHelpEnabled: function() {
  7996. return "2" === n.valueFromHash("help", null) && !this.isHelpDisabled()
  7997. },
  7998. isHelpEnabled: function() {
  7999. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  8000. },
  8001. setAutoPlay: function(e) {
  8002. l = o.warp.auto >= 0 && e > 1
  8003. }
  8004. }
  8005. }
  8006. ).call(this, "/js/gui/helpManager.js")
  8007. }
  8008. , {
  8009. "../util/browser": 182,
  8010. "./../settings": 166,
  8011. "./../util/logger": 189
  8012. }],
  8013. 69: [function(e, t, i) {
  8014. "use strict";
  8015. function n(e, t, i, n) {
  8016. F = n,
  8017. r(e, t, i, F),
  8018. o(),
  8019. N = t.mode
  8020. }
  8021. function r(e, t, i, n) {
  8022. [C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function(t) {
  8023. e.controls[t].on(v.Move, a),
  8024. e.controls[t].on(v.LongTap, c)
  8025. }),
  8026. M.on("mousewheel DOMMouseScroll", a),
  8027. i.on(m.TagActivated, a),
  8028. i.on(m.TagNavigation, a),
  8029. t.on(A.FlyingEnded, s),
  8030. t.on(A.ModeChanging, function(e, t) {
  8031. B = t !== C.PANORAMA && e !== C.PANORAMA
  8032. }),
  8033. t.on(A.ModeChanged, function(e, i) {
  8034. N = t.mode,
  8035. i !== C.TRANSITIONING ? l() : a("modeChange")
  8036. }),
  8037. n.on(y.TourStart, function() {
  8038. L = !0,
  8039. a()
  8040. }),
  8041. n.on(y.TourEnd, function() {
  8042. L = !1,
  8043. l()
  8044. }),
  8045. n.on(y.ActionInterrupted, function() {
  8046. L = !1
  8047. }),
  8048. R.addEventListener("touchend", function() {
  8049. $("#pullTab").hasClass("opened") && !L && l()
  8050. }, !0)
  8051. }
  8052. function o() {
  8053. p.isMobile() ? (b.forEach(function(e) {
  8054. e.classList.add("mobile")
  8055. }),
  8056. w.click(l)) : (b.forEach(function(e) {
  8057. e.addEventListener("mouseleave", function() {
  8058. !M.is(":hover") && b[0].classList.contains("detectHover") && l()
  8059. }, !0)
  8060. }),
  8061. M.mouseleave(function() {
  8062. b[0].classList.contains("detectHover") && l()
  8063. }))
  8064. }
  8065. function a(e) {
  8066. D || d(e) && _.hasClass("playing") || (clearTimeout(O),
  8067. P = !0,
  8068. g.close(),
  8069. h(e),
  8070. N !== C.DOLLHOUSE && N !== C.FLOORPLAN && (x.hasClass("expand") && !S.hasClass("closed") || 2 === p.valueFromHash("title", 1) ,
  8071. _.hasClass("playing") || (b.forEach(function(e) {
  8072. e.classList.add("detectHover")
  8073. }),
  8074. O = setTimeout(l, f.immersive.timeToShowAgain))))
  8075. }
  8076. function s() {
  8077. _.hasClass("playing") || (clearTimeout(O),
  8078. O = setTimeout(l, f.immersive.timeToShowAgain))
  8079. }
  8080. function l() {
  8081. clearTimeout(O),
  8082. P = !1,
  8083. I.forEach(function(e) {
  8084. e.classList.remove("drawerOpen")
  8085. }),
  8086. L || E.forEach(function(e) {
  8087. e.classList.remove("duringTour")
  8088. }),
  8089. b.forEach(function(e) {
  8090. e.classList.remove("detectHover")
  8091. })
  8092. }
  8093. function c() {
  8094. P ? l() : a(),
  8095. D = !0,
  8096. setTimeout(function() {
  8097. D = !1
  8098. }, f.immersive.uiStayDuration)
  8099. }
  8100. function h(e) {
  8101. !d(e) && L ? E.forEach(function(e) {
  8102. e.classList.remove("drawerOpen"),
  8103. e.classList.add("duringTour")
  8104. }) : _.hasClass("open") ? E.forEach(function(e) {
  8105. e.classList.remove("duringTour"),
  8106. e.classList.add("drawerOpen")
  8107. }) : B || N === C.FLOORPLAN || N === C.DOLLHOUSE || E.forEach(function(e) {
  8108. e.classList.add("fadeOut")
  8109. })
  8110. }
  8111. function u() {
  8112. T.hasClass("duringTour") || (L = !1,
  8113. a("gui"),
  8114. l())
  8115. }
  8116. function d(e) {
  8117. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  8118. }
  8119. var p = e("../util/browser")
  8120. , f = e("../settings")
  8121. , g = e("./help/help")
  8122. , m = e("../enum/tagEvents")
  8123. , v = e("../enum/ControlEvents")
  8124. , A = e("../enum/PlayerEvents")
  8125. , y = e("../enum/DirectorEvents")
  8126. , A = e("../enum/PlayerEvents")
  8127. , C = e("../enum/Viewmode")
  8128. , I = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  8129. , E = $(".pinBottom-container, #drawer-container, .footer").toArray()
  8130. , b = $("#hover-bottom, #hover-top").toArray()
  8131. , w = ($("#pullTab").eq(0),
  8132. $("#playHead").eq(0),
  8133. $(".pinBottom-container").eq(0))
  8134. , _ = $("#drawer").eq(0)
  8135. , T = $("#drawer-container").eq(0)
  8136. , x = $("#meta-info").eq(0)
  8137. , S = $(".pinTop.left").eq(0)
  8138. , M = $("#player").eq(0)
  8139. , R = document.getElementById("pullTab")
  8140. , P = !1
  8141. , O = null
  8142. , L = !1
  8143. , D = !1
  8144. , N = null
  8145. , B = !1
  8146. , F = null;
  8147. t.exports.init = n,
  8148. t.exports.hideUi = a,
  8149. t.exports.resetDrawer = u
  8150. }
  8151. , {
  8152. "../enum/ControlEvents": 21,
  8153. "../enum/DirectorEvents": 23,
  8154. "../enum/tagEvents": 32,
  8155. "../enum/PlayerEvents": 40,
  8156. "../enum/Viewmode": 51,
  8157. "../settings": 166,
  8158. "../util/browser": 182,
  8159. "./help/help": 67
  8160. }],
  8161. 70: [function(e, t, i) {
  8162. (function(i) {
  8163. "use strict";
  8164. function n(e, t, i) {
  8165. l.debug("konami has the modelInstance");
  8166. var n = [];
  8167. $(window).on("keydown", function(e) {
  8168. n.push(e.which),
  8169. n.length > o.secretPanelWord.length && n.shift(),
  8170. s.equalLists(n, o.secretPanelWord) && (l.debug("Developer mode active."),
  8171. o.debug = !0)
  8172. }),
  8173. $(window).on("keydown", function n(r) {
  8174. o.debug && 72 === r.which && (e && i ? (a.toggle(e, t, i),
  8175. $(window).off("keydown", n)) : console.warn("sorry we're not ready yet"))
  8176. })
  8177. }
  8178. var r = e("./../util/logger")
  8179. , o = e("./../settings")
  8180. , a = e("./debug")
  8181. , s = e("./../util/common")
  8182. , l = (e("./gui"),
  8183. new r(i));
  8184. o.console && $("body").append('<div id="debug-console"></div>'),
  8185. t.exports.init = n
  8186. }
  8187. ).call(this, "/js/gui/konami.js")
  8188. }
  8189. , {
  8190. "./../settings": 166,
  8191. "./../util/common": 185,
  8192. "./../util/logger": 189,
  8193. "./debug": 63,
  8194. "./gui": 65
  8195. }],
  8196. 71: [function(e, t, i) {
  8197. "use strict";
  8198. function n(e, t) {
  8199. E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode
  8200. }
  8201. function r(e) {
  8202. var t = $.Deferred();
  8203. e || t.resolve();
  8204. var i = c.startupFlyinDelay;
  8205. return e === p.PANORAMA && (i += c.dollhouse.transitionTime),
  8206. setTimeout(t.resolve.bind(t), i),
  8207. t
  8208. }
  8209. function o(e, t, i) {
  8210. var n = 0;
  8211. c.quickstart.enabled && (a(i),
  8212. n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay);
  8213. var r = function() {
  8214. e.once(g.Move, l),
  8215. t.once(f.TourStart, l)
  8216. };
  8217. s(n, r)
  8218. }
  8219. function a(e) {
  8220. return /* e && (y.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  8221. v.before(y),
  8222. A = $(".quick-brand").toArray()),*/
  8223. m.addClass("fadeOut"),
  8224. setTimeout(function() {
  8225. A.forEach(function(e) {
  8226. e.classList.add("fadeIn")
  8227. })
  8228. }, c.quickstart.showTextDelay),
  8229. setTimeout(function() {
  8230. A.forEach(function(e) {
  8231. e.classList.add("fadeOut")
  8232. })
  8233. }, c.quickstart.fadeOutDelay),
  8234. !0
  8235. }
  8236. function s(e, t) {
  8237. setTimeout(function() {
  8238. if (h.isHelpEnabled()) {
  8239. if (t(),
  8240. u.init(),
  8241. C.addClass("fadeIn landing " + u.deviceType),
  8242. h.isSmallHelpEnabled())
  8243. return void C.addClass("small");
  8244. u.fill(I, d.LANDING[E]),
  8245. C.addClass(E)
  8246. }
  8247. }, e)
  8248. //csz 用户引导界面
  8249. var helpData = {
  8250. "pc":["images/pc_step1.png","images/pc_step2.png","images/pc_step3.png"],
  8251. "mobile":["images/phone_step1.png","images/phone_step2.png","images/phone_step3.png"]
  8252. }
  8253. var navIcon = $(".nav-icon .icon");
  8254. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) navIcon.attr("src",helpData.mobile[0]);
  8255. function paging(id){
  8256. id.on("click",function(){
  8257. var navPage = null;
  8258. $(this).attr("data-id") == "plus" ? navPage = +navIcon.attr("data-page")+1 : navPage = +navIcon.attr("data-page")-1;
  8259. if(navPage > helpData.length || navPage < 1) return false
  8260. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  8261. navIcon.attr({"data-page":navPage,"src":helpData.mobile[navPage - 1]});
  8262. }else{
  8263. navIcon.attr({"data-page":navPage,"src":helpData.pc[navPage - 1]});
  8264. }
  8265. })
  8266. };
  8267. paging($(".next-button"));
  8268. paging($(".prev-button"));
  8269. }
  8270. function l() {
  8271. u.clear(I, d.LANDING[E]),
  8272. C.removeClass("fadeIn")
  8273. }
  8274. var c = e("../settings")
  8275. , h = (e("./help/help"),
  8276. e("./helpManager"))
  8277. , u = e("./populateModal")
  8278. , d = e("../enum/HelpModalType")
  8279. , p = e("../enum/Viewmode")
  8280. , f = e("../enum/DirectorEvents")
  8281. , g = e("../enum/PlayerEvents")
  8282. , m = $("#quick-blackout").eq(0)
  8283. , v = $("#quick-logo").eq(0)
  8284. , A = $(".quick-brand").toArray()
  8285. , y = $("#loaderCoBrand").eq(0)
  8286. , C = $("#interaction-modal").eq(0)
  8287. , I = C.find(".interaction").toArray()
  8288. , E = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  8289. "");
  8290. t.exports.delayLanding = r,
  8291. t.exports.showMessage = o,
  8292. t.exports.init = n,
  8293. t.exports.dismissModal = l
  8294. }
  8295. , {
  8296. "../enum/DirectorEvents": 23,
  8297. "../enum/HelpModalType": 28,
  8298. "../enum/PlayerEvents": 40,
  8299. "../enum/Viewmode": 51,
  8300. "../settings": 166,
  8301. "./help/help": 67,
  8302. "./helpManager": 68,
  8303. "./populateModal": 75
  8304. }],
  8305. 72: [function(e, t, i) {
  8306. "use strict";
  8307. var n = e("./circleLoader").circleLoader;
  8308. t.exports = {
  8309. element: $("#gui-loading"),
  8310. hide: function(e) {
  8311. n.done(),
  8312. this.element.fadeOut(1500, e)
  8313. },
  8314. show: function(e) {
  8315. this.element.fadeIn(500, function() {
  8316. this.element.css("display", "table"),
  8317. e && e()
  8318. }
  8319. .bind(this))
  8320. },
  8321. progress: function(e) {
  8322. n.set(e)
  8323. }
  8324. }
  8325. }
  8326. , {
  8327. "./circleLoader": 60
  8328. }],
  8329. 73: [function(e, t, i) {
  8330. "use strict";
  8331. var n = e("../settings")
  8332. , r = $("#memory-info")
  8333. , o = r.find("#memory-gpu")
  8334. , a = !1;
  8335. t.exports = {
  8336. show: function() {
  8337. n.profiling.enabled && (r.show(),
  8338. a = !0)
  8339. },
  8340. hide: function() {
  8341. r.hide(),
  8342. a = !1
  8343. },
  8344. toggle: function() {
  8345. a ? this.hide() : this.show()
  8346. },
  8347. update: function(e) {
  8348. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  8349. }
  8350. }
  8351. }
  8352. , {
  8353. "../settings": 166
  8354. }],
  8355. 74: [function(e, t, i) {
  8356. "use strict";
  8357. var n = e("../util/browser")
  8358. , r = e("../analytics");
  8359. e("../settings");
  8360. t.exports = {
  8361. show: function(e, t) {
  8362. $("#gui-message").fadeOut(500, function() {
  8363. t()
  8364. })
  8365. }
  8366. }
  8367. }
  8368. , {
  8369. "../analytics": 4,
  8370. "../settings": 166,
  8371. "../util/browser": 182
  8372. }],
  8373. 75: [function(e, t, i) {
  8374. "use strict";
  8375. function n(e, t, i, n) {
  8376. function r(e) {
  8377. return e.classList.contains(a)
  8378. }
  8379. var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType];
  8380. //for (var a in o) {
  8381. //var s = e.find(r);
  8382. //for (var l in o[a]) {
  8383. //var c = o[a][l];
  8384. //if ("top-info" === l || "bottom-info" === l) {
  8385. //var h = n ? c : "";
  8386. //czj 注释掉第一次打开的用户引导
  8387. //s.querySelector("." + l).textContent = h
  8388. //} else {
  8389. //var u = n ? c : "";
  8390. //, d = s.querySelector("." + l);
  8391. //d.src = u,
  8392. //n ? d.classList.remove("hidden") : d.classList.add("hidden")
  8393. //}
  8394. //}
  8395. //}
  8396. //var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  8397. // p.forEach(function(e) {
  8398. // n ? e.classList.remove("hidden") : e.classList.add("hidden")
  8399. // })
  8400. }
  8401. var r = e("../util/browser")
  8402. , o = e("../localization/localize")
  8403. , a = e("../enum/HelpModalType")
  8404. , s = (e("../enum/HelpModalSize"),
  8405. e("../enum/Viewmode"));
  8406. t.exports = {
  8407. init: function() {
  8408. if (!this.hasInitialized) {
  8409. this.hasInitialized = !0,
  8410. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  8411. this.assets = {},
  8412. this.assets[a.LANDING[s.PANORAMA]] = {
  8413. desktop: {
  8414. left: {
  8415. "top-info": o.ROTATE,
  8416. "big-image": "images/nav_help_mouse_drag_left.png",
  8417. keyboard: "images/nav_help_keyboard_left_right.png"
  8418. },
  8419. middle: {
  8420. "top-info": o.MOVE,
  8421. "big-image": "images/nav_help_mouse_click.png",
  8422. keyboard: "images/nav_help_keyboard_up_down.png"
  8423. },
  8424. right: {
  8425. "top-info": o.ZOOM,
  8426. "big-image": "images/nav_help_mouse_zoom.png",
  8427. keyboard: "images/nav_help_zoom_keys.png"
  8428. }
  8429. },
  8430. mobile: {
  8431. left: {
  8432. "top-info": o.ROTATE,
  8433. "big-image": "images/nav_help_gesture_drag.png"
  8434. },
  8435. middle: {
  8436. "top-info": o.MOVE,
  8437. "big-image": "images/nav_help_gesture_tap.png"
  8438. },
  8439. right: {
  8440. "top-info": o.ZOOM,
  8441. "big-image": "images/nav_help_gesture_pinch.png"
  8442. }
  8443. }
  8444. },
  8445. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  8446. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  8447. desktop: {
  8448. left: {
  8449. "top-info": o.ROTATE,
  8450. "big-image": "images/nav_help_mouse_drag_left.png",
  8451. keyboard: "images/nav_help_keyboard_left_right.png"
  8452. },
  8453. middle: {
  8454. "top-info": o.MOVE,
  8455. "big-image": "images/nav_help_mouse_position_right.png"
  8456. }
  8457. },
  8458. mobile: {
  8459. left: {
  8460. "top-info": o.ROTATE,
  8461. "big-image": "images/nav_help_gesture_drag.png"
  8462. },
  8463. middle: {
  8464. "top-info": o.MOVE,
  8465. "big-image": "images/nav_help_gesture_position_two_finger.png"
  8466. }
  8467. }
  8468. },
  8469. this.assets[a.LANDING[s.FLOORPLAN]] = {
  8470. desktop: {
  8471. left: {
  8472. "top-info": o.MOVE,
  8473. "big-image": "images/nav_help_mouse_position_left.png"
  8474. },
  8475. middle: {
  8476. "top-info": o.ROTATE,
  8477. "big-image": "images/nav_help_mouse_drag_right.png",
  8478. keyboard: "images/nav_help_keyboard_left_right.png"
  8479. }
  8480. },
  8481. mobile: {
  8482. left: {
  8483. "top-info": o.MOVE,
  8484. "big-image": "images/nav_help_gesture_position.png"
  8485. },
  8486. middle: {
  8487. "top-info": o.ROTATE,
  8488. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  8489. }
  8490. }
  8491. };
  8492. var e = {
  8493. "top-info": o.INSIDE,
  8494. "big-image": "images/nav_help_click_inside.png",
  8495. keyboard: "images/nav_help_inside_key.png"
  8496. };
  8497. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  8498. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  8499. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  8500. var t = {
  8501. "top-info": o.INSIDE,
  8502. "big-image": "images/nav_help_tap_inside.png"
  8503. };
  8504. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  8505. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  8506. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  8507. this.assets[a.NAVIGATION] = {},
  8508. this.assets[a.NAVIGATION][s.PANORAMA] = {
  8509. desktop: {
  8510. left: {
  8511. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  8512. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  8513. "big-image": "images/nav_help_mouse_drag_left.png",
  8514. keyboard: "images/nav_help_keyboard_left_right.png"
  8515. },
  8516. middle: {
  8517. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  8518. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  8519. "big-image": "images/nav_help_mouse_click.png",
  8520. keyboard: "images/nav_help_keyboard_up_down.png"
  8521. },
  8522. right: {
  8523. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  8524. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  8525. "big-image": "images/nav_help_mouse_zoom.png",
  8526. keyboard: "images/nav_help_zoom_keys.png"
  8527. }
  8528. },
  8529. mobile: {
  8530. left: {
  8531. "top-info": o.HELP_MOBILE_PANORAMA_1,
  8532. "big-image": "images/nav_help_gesture_drag.png"
  8533. },
  8534. middle: {
  8535. "top-info": o.HELP_MOBILE_PANORAMA_2,
  8536. "big-image": "images/nav_help_gesture_tap.png"
  8537. },
  8538. right: {
  8539. "top-info": o.HELP_MOBILE_3,
  8540. "big-image": "images/nav_help_gesture_pinch.png"
  8541. }
  8542. }
  8543. },
  8544. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  8545. desktop: {
  8546. left: {
  8547. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  8548. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  8549. "big-image": "images/nav_help_mouse_drag_left.png",
  8550. keyboard: "images/nav_help_keyboard_all.png"
  8551. },
  8552. middle: {
  8553. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  8554. "big-image": "images/nav_help_mouse_position_right.png"
  8555. },
  8556. right: {
  8557. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  8558. "big-image": "images/nav_help_mouse_zoom.png"
  8559. }
  8560. },
  8561. mobile: {
  8562. left: {
  8563. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  8564. "big-image": "images/nav_help_gesture_drag.png"
  8565. },
  8566. middle: {
  8567. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  8568. "big-image": "images/nav_help_gesture_position_two_finger.png"
  8569. },
  8570. right: {
  8571. "top-info": o.HELP_MOBILE_3,
  8572. "big-image": "images/nav_help_gesture_pinch.png"
  8573. }
  8574. }
  8575. },
  8576. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  8577. desktop: {
  8578. left: {
  8579. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  8580. "big-image": "images/nav_help_mouse_position_left.png"
  8581. },
  8582. middle: {
  8583. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  8584. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  8585. "big-image": "images/nav_help_mouse_drag_right.png",
  8586. keyboard: "images/nav_help_keyboard_left_right.png"
  8587. },
  8588. right: {
  8589. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  8590. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  8591. "big-image": "images/nav_help_mouse_zoom.png",
  8592. keyboard: "images/nav_help_keyboard_up_down.png"
  8593. }
  8594. },
  8595. mobile: {
  8596. left: {
  8597. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  8598. "big-image": "images/nav_help_gesture_position.png"
  8599. },
  8600. middle: {
  8601. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  8602. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  8603. },
  8604. right: {
  8605. "top-info": o.HELP_MOBILE_3,
  8606. "big-image": "images/nav_help_gesture_pinch.png"
  8607. }
  8608. }
  8609. },
  8610. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  8611. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  8612. "top-info": o.HELP_DESKTOP_360_2A,
  8613. "bottom-info": o.HELP_DESKTOP_360_2B,
  8614. "big-image": "images/nav_help_click_inside.png",
  8615. keyboard: "images/nav_help_inside_key.png"
  8616. },
  8617. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  8618. "top-info": o.HELP_MOBILE_360_2,
  8619. "big-image": "images/nav_help_tap_inside.png"
  8620. },
  8621. this.assets[a.MORE_HELP] = {
  8622. desktop: {
  8623. "more-help-hlr": {
  8624. "top-info": o.HELP_MORE_HLR_A,
  8625. "big-image": "images/nav_help_expand.svg",
  8626. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8627. },
  8628. "more-help-dollhouse": {
  8629. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8630. "big-image": "images/nav_help_dollhouse.svg",
  8631. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8632. },
  8633. "more-help-floors": {
  8634. "top-info": o.HELP_MORE_FLOORS_A,
  8635. "big-image": "images/nav_help_floor picker.svg",
  8636. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8637. },
  8638. "more-help-tag": {
  8639. "top-info": o.HELP_MORE_TAG_A,
  8640. "big-image": "images/nav_help_tag.svg",
  8641. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  8642. },
  8643. "more-help-zoom": {
  8644. "top-info": o.HELP_MORE_ZOOM_A,
  8645. "big-image": "images/nav_help_zoom.svg",
  8646. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  8647. },
  8648. "more-help-tour": {
  8649. "top-info": o.HELP_MORE_TOUR_A,
  8650. "big-image": "images/nav_help_play.png",
  8651. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8652. },
  8653. "more-help-inside": {
  8654. "top-info": o.HELP_MORE_INSIDE_A,
  8655. "big-image": "images/nav_help_inside.svg",
  8656. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  8657. },
  8658. "more-help-vr": {
  8659. "top-info": o.HELP_MORE_VR_A,
  8660. "big-image": "images/nav_help_vr.svg",
  8661. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  8662. },
  8663. "more-help-360": {
  8664. "top-info": o.HELP_MORE_360_A,
  8665. "big-image": "images/nav_help_360.svg",
  8666. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  8667. },
  8668. "more-help-fullscreen": {
  8669. "top-info": o.HELP_MORE_FULLSCREEN_A,
  8670. "big-image": "images/nav_help_fullscreen.svg",
  8671. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8672. }
  8673. },
  8674. mobile: {
  8675. "more-help-hlr": {
  8676. "top-info": o.HELP_MORE_HLR_A,
  8677. "big-image": "images/nav_help_expand.svg",
  8678. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8679. },
  8680. "more-help-dollhouse": {
  8681. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8682. "big-image": "images/nav_help_dollhouse.svg",
  8683. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8684. },
  8685. "more-help-floors": {
  8686. "top-info": o.HELP_MORE_FLOORS_A,
  8687. "big-image": "images/nav_help_floor picker.svg",
  8688. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8689. },
  8690. "more-help-tag": {
  8691. "top-info": o.HELP_MORE_TAG_A,
  8692. "big-image": "images/nav_help_tag.svg",
  8693. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8694. },
  8695. "more-help-tour": {
  8696. "top-info": o.HELP_MORE_TOUR_A,
  8697. "big-image": "images/nav_help_play.png",
  8698. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8699. },
  8700. "more-help-inside": {
  8701. "top-info": o.HELP_MORE_INSIDE_A,
  8702. "big-image": "images/nav_help_inside.svg",
  8703. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8704. },
  8705. "more-help-vr": {
  8706. "top-info": o.HELP_MORE_VR_A,
  8707. "big-image": "images/webvr.svg",
  8708. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8709. },
  8710. "more-help-360": {
  8711. "top-info": o.HELP_MORE_360_A,
  8712. "big-image": "images/nav_help_360.svg",
  8713. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8714. }
  8715. }
  8716. },
  8717. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8718. desktop: {
  8719. left: {
  8720. "top-info": o.ROTATE,
  8721. "big-image": "images/nav_help_mouse_drag_left.png",
  8722. keyboard: "images/nav_help_keyboard_left_right.png"
  8723. },
  8724. middle: {
  8725. "top-info": o.MOVE,
  8726. "big-image": "images/nav_help_mouse_click.png",
  8727. keyboard: "images/nav_help_keyboard_up_down.png"
  8728. },
  8729. right: {
  8730. "top-info": o.PLAY,
  8731. "big-image": "images/Desktop-help-play-button.svg",
  8732. keyboard: "images/Desktop-help-spacebar-2.svg"
  8733. }
  8734. },
  8735. mobile: {
  8736. left: {
  8737. "top-info": o.ROTATE,
  8738. "big-image": "images/nav_help_gesture_drag.png"
  8739. },
  8740. middle: {
  8741. "top-info": o.MOVE,
  8742. "big-image": "images/nav_help_gesture_tap.png"
  8743. },
  8744. right: {
  8745. "top-info": o.PLAY,
  8746. "big-image": "images/mobile-help-play-button.svg"
  8747. }
  8748. }
  8749. },
  8750. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8751. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8752. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8753. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8754. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8755. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8756. }
  8757. },
  8758. fill: function(e, t, i) {
  8759. n.call(this, e, t, i, !0)
  8760. },
  8761. clear: function(e, t, i) {
  8762. n.call(this, e, t, i, !1)
  8763. }
  8764. }
  8765. }
  8766. , {
  8767. "../enum/HelpModalSize": 27,
  8768. "../enum/HelpModalType": 28,
  8769. "../enum/Viewmode": 51,
  8770. "../localization/localize": 108,
  8771. "../util/browser": 182
  8772. }],
  8773. 76: [function(e, t, i) {
  8774. "use strict";
  8775. t.exports = Object.freeze({
  8776. OPENED: "share.open",
  8777. CLOSED: "share.closed",
  8778. LINK_CLICKED: "share.linked"
  8779. })
  8780. }
  8781. , {}],
  8782. 77: [function(e, t, i) {
  8783. "use strict";
  8784. function n(e) {
  8785. function t(t, i) {
  8786. var n = window.screenY + ($("#player").height() - i) / 2
  8787. , r = window.screenX + ($("#player").width() - t) / 2
  8788. , o = "top=" + n + ",left=" + r + ",width=" + t + ",height=" + i;
  8789. I.emit(l.LINK_CLICKED, {
  8790. channel: e
  8791. }),
  8792. window.open(C[e], "shareWindow", o)
  8793. }
  8794. switch (e) {
  8795. case y.FACEBOOK:
  8796. t(580, 420);
  8797. break;
  8798. case y.TWITTER:
  8799. t(550, 440);
  8800. break;
  8801. case y.MAIL:
  8802. I.emit(l.LINK_CLICKED, {
  8803. channel: "email"
  8804. }),
  8805. window.open(C[e], "_blank");
  8806. break;
  8807. case y.LINKEDIN:
  8808. }
  8809. }
  8810. function r(e) {
  8811. I.emit(l.LINK_CLICKED, {
  8812. channel: "copylink"
  8813. });
  8814. var t = document.createRange();
  8815. t.selectNodeContents(v);
  8816. var i = window.getSelection();
  8817. i.removeAllRanges(),
  8818. i.addRange(t),
  8819. document.execCommand("copy"),
  8820. A.classList.remove("hidden"),
  8821. v.classList.add("highlighted")
  8822. }
  8823. function o(e) {
  8824. e && (e.stopPropagation(),
  8825. e.target === v) || (window.getSelection().removeAllRanges(),
  8826. v.classList.remove("highlighted"),
  8827. A.classList.add("hidden"))
  8828. }
  8829. var a = e("../../util/browser")
  8830. , s = e("../../localization/localize")
  8831. , l = e("./ShareEvents")
  8832. , c = e("../../util/common")
  8833. , h = e("events").EventEmitter
  8834. , u = document.getElementById("sharing")
  8835. , d = document.getElementById("share-modal")
  8836. , p = document.getElementById("share-close")
  8837. , f = document.getElementById("facebook-share")
  8838. , g = document.getElementById("twitter-share")
  8839. , m = document.getElementById("mail-share")
  8840. , v = document.getElementById("share-url-text")
  8841. , A = document.getElementById("copy-success")
  8842. , y = Object.freeze({
  8843. FACEBOOK: "facebook",
  8844. TWITTER: "twitter",
  8845. MAIL: "mail",
  8846. LINKEDIN: "linkedin"
  8847. })
  8848. , C = {};
  8849. C[y.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8850. C[y.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8851. C[y.MAIL] = "mailto:?subject=";
  8852. var I = {
  8853. init: function(e) {
  8854. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8855. C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8856. C[y.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8857. C[y.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8858. u.addEventListener("click", this.toggle.bind(this)),
  8859. p.addEventListener("click", this.hide.bind(this)),
  8860. v.addEventListener("click", r),
  8861. d.addEventListener("click", o),
  8862. f.addEventListener("click", n.bind(this, y.FACEBOOK)),
  8863. g.addEventListener("click", n.bind(this, y.TWITTER)),
  8864. m.addEventListener("click", n.bind(this, y.MAIL)),
  8865. v.textContent = window.location.href + "&utm_source=4",
  8866. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8867. u.classList.remove("hidden")
  8868. },
  8869. show: function() {
  8870. this.emit(l.OPENED),
  8871. d.classList.add("fadeIn")
  8872. },
  8873. hide: function() {
  8874. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8875. document.selection && document.selection.empty(),
  8876. window.getSelection().removeAllRanges(),
  8877. o(),
  8878. d.classList.remove("fadeIn"))
  8879. },
  8880. toggle: function() {
  8881. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8882. }
  8883. };
  8884. c.extendObject(I, h.prototype),
  8885. t.exports = I
  8886. }
  8887. , {
  8888. "../../localization/localize": 108,
  8889. "../../util/browser": 182,
  8890. "../../util/common": 185,
  8891. "./ShareEvents": 76,
  8892. events: 202
  8893. }],
  8894. 78: [function(e, t, i) {
  8895. "use strict";
  8896. t.exports = Object.freeze({
  8897. OPENED: "terms.opened",
  8898. CLOSED: "terms.closed"
  8899. })
  8900. }
  8901. , {}],
  8902. 79: [function(e, t, i) {
  8903. "use strict";
  8904. var n = e("./TermsEvent")
  8905. , r = e("../../localization/localize")
  8906. , o = e("../../analytics")
  8907. , a = e("../../util/ajax")
  8908. , s = e("../../util/common")
  8909. , l = e("events").EventEmitter
  8910. , c = document.getElementById("terms-modal")
  8911. , h = {
  8912. init: function() {
  8913. $(".footer-terms").on("click", function(e) {
  8914. e.preventDefault(),
  8915. this.show()
  8916. }
  8917. .bind(this)),
  8918. $("#terms-modal .close").on("click", this.hide.bind(this))
  8919. },
  8920. show: function() {
  8921. this.emit(n.OPENED),
  8922. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8923. var t = $("#terms-text").html(e);
  8924. o.track("showcase_gui", {
  8925. gui_action: "click_terms_button",
  8926. interaction_source: "gui"
  8927. }),
  8928. t.find("a").attr("target", "_blank")
  8929. }).fail(function() {
  8930. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8931. }),
  8932. c.classList.add("fadeIn")
  8933. },
  8934. hide: function(e) {
  8935. e && e.preventDefault(),
  8936. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8937. c.classList.remove("fadeIn")
  8938. }
  8939. };
  8940. s.extendObject(h, l.prototype),
  8941. t.exports = h
  8942. }
  8943. , {
  8944. "../../analytics": 4,
  8945. "../../localization/localize": 108,
  8946. "../../util/ajax": 181,
  8947. "../../util/common": 185,
  8948. "./TermsEvent": 78,
  8949. events: 202
  8950. }],
  8951. 80: [function(e, t, i) {
  8952. "use strict";
  8953. t.exports = Object.freeze({
  8954. OPEN_INFO: "title.open.info",
  8955. CLOSE_INFO: "title.close.info",
  8956. SHOW_INFO: "title.show.info",
  8957. HIDE_INFO: "title.hide.info",
  8958. LINK_CLICKED: "title.link.click",
  8959. CONTACT_LINK_CLICKED: "title.contact.click",
  8960. ORIGIN_LINK_CLICKED: "title.origin.click"
  8961. })
  8962. }
  8963. , {}],
  8964. 81: [function(e, t, i) {
  8965. "use strict";
  8966. function n(e, t) {
  8967. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t)
  8968. }
  8969. function r(e, t) {
  8970. function i(i) {
  8971. e.shouldShowtags = "show" === this.value,
  8972. e.shouldShowtags ? t.showAlltags(o.tags.startup.fadeInDuration) : t.hideAlltags(o.tags.startup.fadeInDuration)
  8973. }
  8974. document.getElementById("tag-toggles").classList.remove("hidden"),
  8975. document.getElementById("radio-tag-show").checked = !0;
  8976. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8977. n[r].addEventListener("change", i)
  8978. }
  8979. var o = e("../../settings");
  8980. t.exports.init = n
  8981. }
  8982. , {
  8983. "../../settings": 166
  8984. }],
  8985. 82: [function(e, t, i) {
  8986. (function(i) {
  8987. "use strict";
  8988. function n(e, t) {
  8989. return e && u.valueFromHash("title", 1) && 2 !== u.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e, g_weixinObj.title = e,
  8990. e.length > g.minTooltipCharacters && I.parentElement.setAttribute("data-original-title", e),
  8991. t && 1 !== m.specialEdition && m.brand && !m.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8992. document.getElementById("gui-name").classList.add("noCoBrand"),
  8993. document.getElementById("cobrandTitle").classList.add("hidden")),
  8994. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8995. !1)
  8996. }
  8997. function r(e) {
  8998. return e ? (L = !0,
  8999. void (_.innerHTML = e)) : void _.classList.add("hidden")
  9000. }
  9001. function o(e, t, i, n) {
  9002. if (!e && !t && !i || !m.brand || u.valueFromHash("mls", !1))
  9003. return void T.classList.add("hidden");
  9004. L = !0;
  9005. var r = []
  9006. , o = c(r, "<br>");
  9007. if (e && o('<span id="contactName">' + e + "</span>"),
  9008. t) {
  9009. var a = n || t
  9010. , s = u.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>";
  9011. o(s)
  9012. }
  9013. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  9014. r[0] = "",
  9015. x.innerHTML = r.join("")
  9016. }
  9017. function a(e) {
  9018. if ("string" == typeof e)
  9019. try {
  9020. e = JSON.parse(e)
  9021. } catch (e) {
  9022. return y.warn("Unable to parse address data"),
  9023. void S.parentElement.classList.add("hidden")
  9024. }
  9025. if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)))
  9026. return void S.parentElement.classList.add("hidden");
  9027. L = !0;
  9028. var t = []
  9029. , i = c(t, " ");
  9030. e.address_1 && i(e.address_1),
  9031. e.address_2 && i(e.address_2),
  9032. e.city && i(e.city, ", "),
  9033. e.state && i(e.state, ", "),
  9034. e.zip && i(e.zip, e.state ? " " : ", "),
  9035. t[0] = "",
  9036. S.innerText = t.join("")
  9037. }
  9038. function s(e) {
  9039. var t = document.createElement("a");
  9040. return t.id = "url",
  9041. t.target = "_blank",
  9042. t.href = e,
  9043. t.innerText = e,
  9044. t.addEventListener("click", N.emit.bind(N, v.ORIGIN_LINK_CLICKED)),
  9045. t
  9046. }
  9047. function l(e) {
  9048. return !(!e || u.inIframe() && document.referrer === e) && (R.classList.remove("hidden"),
  9049. P.innerHTML = f.WEBVR_LEARN_MORE + ": ",
  9050. P.appendChild(s(e)),
  9051. O.forEach(function(e) {
  9052. e.classList.add("share-link")
  9053. }),
  9054. !0)
  9055. }
  9056. function c(e, t) {
  9057. var i = e
  9058. , n = t;
  9059. return function(e, t) {
  9060. i.push(t || n, e)
  9061. }
  9062. }
  9063. function h() {
  9064. document.getElementById("title-toggle").addEventListener("click", N.toggleTitle.bind(N)),
  9065. L && I.addEventListener("click", N.toggleMeta.bind(N, !1));
  9066. var e = [].slice.call(_.querySelectorAll("a"));
  9067. e.forEach(function(e) {
  9068. e.addEventListener("click", N.emit.bind(N, v.LINK_CLICKED))
  9069. });
  9070. var t = [].slice.call(T.querySelectorAll("a"));
  9071. t.forEach(function(e) {
  9072. e.addEventListener("click", N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  9073. contact_type: e.getAttribute("id")
  9074. }))
  9075. })
  9076. }
  9077. var u = e("../../util/browser")
  9078. , d = e("../../util/common")
  9079. , p = e("../../util/logger")
  9080. , f = e("../../localization/localize")
  9081. , g = e("./titleBarSettings")
  9082. , m = e("../../settings")
  9083. , v = e("./TitleEvents")
  9084. , A = e("events").EventEmitter
  9085. , y = new p(i)
  9086. , C = document.querySelector(".pinTop.left")
  9087. , I = document.getElementsByClassName("title-container")[0]
  9088. , E = document.getElementById("title-toggle").querySelector("i")
  9089. , b = document.getElementById("meta-info-wrapper")
  9090. , w = document.getElementById("meta-info")
  9091. , _ = document.getElementById("meta-description")
  9092. , T = document.getElementsByClassName("contact-info")[0]
  9093. , x = document.getElementById("contact-data")
  9094. , S = document.getElementById("addressTxt")
  9095. , M = document.getElementById("tag-toggles")
  9096. , R = document.getElementById("share-origin")
  9097. , P = document.getElementById("share-link-wrapper")
  9098. , O = [w, b, I]
  9099. , L = !1
  9100. , D = !1
  9101. , N = {
  9102. populate: function(e) {
  9103. if (n(MP_PREFETCHED_MODELDATA.name, e.coBrand)) {
  9104. if (r(e.description),
  9105. o(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  9106. a(e.address),
  9107. L) {
  9108. var t = document.createElement("br");
  9109. M.insertBefore(t, M.firstElementChild)
  9110. }
  9111. e.socialSharing && m.share.enabled && (D = l(e.url))
  9112. }
  9113. },
  9114. finishSetup: function(e) {
  9115. L = L || !!e,
  9116. h(),
  9117. L || (D ? I.classList.add("share-only") : I.classList.add("no-meta"))
  9118. },
  9119. toggleMeta: function(e, t) {
  9120. var title = document.getElementById("model-title");
  9121. t && t.preventDefault();
  9122. var i = w.classList.contains("expand");
  9123. e && !i || (i ? (O.forEach(function(e) {
  9124. e.classList.remove("expand")
  9125. }),
  9126. this.emit(v.CLOSE_INFO),title.classList.remove("expand")) : (O.forEach(function(e) {
  9127. e.classList.add("expand");
  9128. }),
  9129. title.classList.add("expand"),
  9130. this.emit(v.OPEN_INFO)))
  9131. },
  9132. setupToggling: function() {
  9133. b.style.height = w.offsetHeight + "px",
  9134. w.addEventListener("transitionend", function() {
  9135. b.style.height = w.offsetHeight + "px"
  9136. })
  9137. },
  9138. toggleTitle: function(e) {
  9139. e && e.preventDefault(),
  9140. C.classList.contains("closed") ? (C.classList.add("open"),
  9141. E.classList.remove("icon-dpad-right"),
  9142. E.classList.add("icon-dpad-left"),
  9143. this.emit(v.SHOW_INFO),
  9144. setTimeout(function() {
  9145. C.classList.remove("closed"),
  9146. C.classList.remove("open")
  9147. }, g.removeAnimationClasses)) : (C.classList.add("closed"),
  9148. E.classList.remove("icon-dpad-left"),
  9149. E.classList.add("icon-dpad-right"),
  9150. this.emit(v.HIDE_INFO))
  9151. }
  9152. };
  9153. d.extendObject(N, A.prototype),
  9154. t.exports = N
  9155. }
  9156. ).call(this, "/js/gui/title/titleBar.js")
  9157. }
  9158. , {
  9159. "../../localization/localize": 108,
  9160. "../../settings": 166,
  9161. "../../util/browser": 182,
  9162. "../../util/common": 185,
  9163. "../../util/logger": 189,
  9164. "./TitleEvents": 80,
  9165. "./titleBarSettings": 83,
  9166. events: 202
  9167. }],
  9168. 83: [function(e, t, i) {
  9169. "use strict";
  9170. t.exports = Object.freeze({
  9171. minTooltipCharacters: 19,
  9172. removeAnimationClasses: 500
  9173. })
  9174. }
  9175. , {}],
  9176. 84: [function(e, t, i) {
  9177. "use strict";
  9178. function n(e) {
  9179. C = e,
  9180. P.forEach(function(e) {
  9181. b.addEventListener(e, u.bind(this, !1), !0),
  9182. w.addEventListener(e, u.bind(this, !0), !0),
  9183. E.addEventListener(e, o, !0),
  9184. S.forEach(function(t) {
  9185. t.addEventListener(e, a, !0)
  9186. }),
  9187. $("#drawer img").on(e, a)
  9188. }),
  9189. document.addEventListener("keydown", u.bind(this, !1), !0),
  9190. C.on(v.TourStart, function() {
  9191. E.classList.add("playing")
  9192. })
  9193. }
  9194. function r() {
  9195. C.playTour(),
  9196. I && clearTimeout(I),
  9197. d(),
  9198. _.removeClass("fadeIn")
  9199. }
  9200. function o() {
  9201. E.classList.contains("playing") && (C.stopTour(),
  9202. _.addClass("fadeIn"),
  9203. setTimeout(function() {
  9204. _.removeClass("fadeIn")
  9205. }, p.tourInteraction.showPauseButton),
  9206. O || (clearTimeout(I),
  9207. I = setTimeout(h, p.tourInteraction.showModal)),
  9208. setTimeout(function() {
  9209. E.classList.remove("playing")
  9210. }, p.tourInteraction.allowNextClick))
  9211. }
  9212. function a() {
  9213. C.tourInProgress && (C.stopTour(),
  9214. C.endTourProgress(),
  9215. E.classList.remove("playing"))
  9216. }
  9217. function s() {
  9218. T.is(":visible") ? r() : o()
  9219. }
  9220. function l() {
  9221. x.hasClass("playing") && (clearTimeout(I),
  9222. C.atEndOfTour() ? c() : _.removeClass("fadeIn"))
  9223. }
  9224. function c() {
  9225. E.classList.remove("playing"),
  9226. h()
  9227. }
  9228. function h() {//去掉导览结束时的提示
  9229. /* if (!p.tourInteraction.disabled) {
  9230. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  9231. M.addClass("fadeIn tour " + m.deviceType);
  9232. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  9233. if (!p.tourInteraction.smallModal) {
  9234. var t;
  9235. t = C.player.mode === g.PANORAMA && !C.player.currentPano.isAligned() || C.player.mode === g.DOLLHOUSE ? g.OUTDOOR : C.player.mode === g.FLOORPLAN ? g.FLOORPLAN : g.PANORAMA,
  9236. m.fill(R, A.TOUR_INTERACTION[t]),
  9237. M.addClass(t)
  9238. }
  9239. M.addClass(e)
  9240. } */
  9241. }
  9242. function u(e, t) {
  9243. if (t) {
  9244. var i = "keydown" === t.type
  9245. , n = t.which === f.SPACE || C.tourIsPlaying;
  9246. i && n || e || (O = !0),
  9247. C.atEndOfTour() && d(),
  9248. !C.tourIsPlaying && C.tourInProgress && (_.removeClass("fadeIn"),
  9249. d(),
  9250. t.which !== f.SPACE && a()),
  9251. i && n && s()
  9252. }
  9253. }
  9254. function d() {
  9255. M.removeClass("fadeIn")
  9256. }
  9257. var p = (e("../util/browser"),
  9258. e("../settings"))
  9259. , f = e("../enum/Keys")
  9260. , g = e("../enum/Viewmode")
  9261. , m = (e("./helpManager"),
  9262. e("./populateModal"))
  9263. , v = e("../enum/DirectorEvents")
  9264. , A = e("../enum/HelpModalType")
  9265. , y = e("../enum/HelpModalSize")
  9266. , C = null
  9267. , I = null
  9268. , E = document.getElementById("pause-overlay")
  9269. , b = document.getElementById("player")
  9270. , w = document.getElementById("gui")
  9271. , _ = $("#pause-icon").eq(0)
  9272. , T = $("#play").eq(0)
  9273. , x = $("#playHead").eq(0)
  9274. , S = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  9275. , M = $("#interaction-modal").eq(0)
  9276. , R = $("#interaction-modal .interaction").toArray()
  9277. , P = ["touchstart", "mousedown", "pointerdown"]
  9278. , O = !1;
  9279. t.exports.init = n,
  9280. t.exports.play = r,
  9281. t.exports.pause = o,
  9282. t.exports.pauseWithoutCTA = a,
  9283. t.exports.togglePlay = s,
  9284. t.exports.stopTour = l,
  9285. t.exports.dismissModal = d
  9286. }
  9287. , {
  9288. "../enum/DirectorEvents": 23,
  9289. "../enum/HelpModalSize": 27,
  9290. "../enum/HelpModalType": 28,
  9291. "../enum/Keys": 30,
  9292. "../enum/Viewmode": 51,
  9293. "../settings": 166,
  9294. "../util/browser": 182,
  9295. "./helpManager": 68,
  9296. "./populateModal": 75
  9297. }],
  9298. 85: [function(e, t, i) {
  9299. "use strict";
  9300. t.exports = Object.freeze({
  9301. OPENED: "vr.modal.opened",
  9302. LAUNCH: "vr.modal.launch",
  9303. CLOSED: "vr.modal.closed",
  9304. NEXT: "vr.modal.next",
  9305. PREV: "vr.modal.prev",
  9306. STORE: "vr.modal.store",
  9307. falseICECHOSEN: "vr.modal.device"
  9308. })
  9309. }
  9310. , {}],
  9311. 86: [function(e, t, i) {
  9312. "use strict";
  9313. function n(e, t, i) {
  9314. function n(e, t, n, r) {
  9315. function o() {
  9316. return p + "&m=" + t + "&display=" + e
  9317. }
  9318. function s() {
  9319. var e = "&utm_medium=" + (a.inIframe() ? "embed" : "direct")
  9320. , t = "&utm_source=" + u
  9321. , n = "&utm_showcase_session_id=" + i;
  9322. return e + t + n
  9323. }
  9324. function l() {
  9325. return d + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(n) + "&ld=" + encodeURIComponent(r) + "&display=" + e
  9326. }
  9327. return a.valueFromHash("vrcoll", !1) ? l() + s() : o() + s()
  9328. }
  9329. function r(e, t, i, r) {
  9330. var o = "https://api.branch.io/v1/url"
  9331. , a = n(e, t, i, r)
  9332. , s = {
  9333. responseType: "json",
  9334. data: {
  9335. branch_key: h.appConfig.branch_key,
  9336. data: {
  9337. m: t,
  9338. full_url: a,
  9339. $desktop_url: m,
  9340. $og_app_id: "331853976762864119",
  9341. $og_title: i,
  9342. $og_description: r,
  9343. $og_image_url: location.origin + "/api/v1/player/models/" + t + "/thumb",
  9344. $canonical_url: window.location.href
  9345. }
  9346. }
  9347. };
  9348. c.post(o, s).done(function(t) {
  9349. f[e] = t.url
  9350. }).fail(function(t) {
  9351. f[e] = t
  9352. }
  9353. .bind(this, a))
  9354. }
  9355. function o(e, t, i) {
  9356. for (var r in s) {
  9357. var o = s[r]
  9358. , a = n(o, e, t, i);
  9359. f[o] = a
  9360. }
  9361. }
  9362. var u = a.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  9363. , d = g + "/vr/dlist/?ret=" + u
  9364. , p = g + "/vr/show/?ret=" + u
  9365. , m = "";
  9366. switch (e) {
  9367. case l.IOS:
  9368. r(s.CardboardIOS, t.sid, t.name, t.summary);
  9369. break;
  9370. default:
  9371. o(t.sid, t.name, t.summary)
  9372. }
  9373. }
  9374. function r(e) {
  9375. var t = f[e];
  9376. window.open(t, "_blank")
  9377. }
  9378. function o(e) {
  9379. var t = u[e];
  9380. window.open(t, "_blank")
  9381. }
  9382. var a = e("../../util/browser")
  9383. , s = e("../../enum/VRApps")
  9384. , l = e("../../enum/VRPlatforms")
  9385. , c = e("../../util/ajax")
  9386. , h = e("../../settings")
  9387. , u = {};
  9388. u[s.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  9389. u[s.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  9390. u[s.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=";
  9391. for (var d in s) {
  9392. var p = s[d];
  9393. u[p] += encodeURIComponent(document.referrer + "&display=" + p)
  9394. }
  9395. var f = {}
  9396. , g = function() {
  9397. var e = window.location.host;
  9398. return e.indexOf(".port.com") === -1 && e.indexOf("localhost") === -1 && (e = "my.port.com"),
  9399. "https://" + e
  9400. }();
  9401. t.exports.init = n,
  9402. t.exports.launch = r,
  9403. t.exports.launchStore = o
  9404. }
  9405. , {
  9406. "../../enum/VRApps": 46,
  9407. "../../enum/VRPlatforms": 49,
  9408. "../../settings": 166,
  9409. "../../util/ajax": 181,
  9410. "../../util/browser": 182
  9411. }],
  9412. 87: [function(e, t, i) {
  9413. "use strict";
  9414. function n(e) {
  9415. var t;
  9416. switch (e) {
  9417. case m.IOS:
  9418. return t = p.iosVersion(),
  9419. t.major > 9 || 9 === t.major && t.minor >= 1;
  9420. case m.Android:
  9421. return t = p.androidVersion(),
  9422. t.major > 4 || 4 === t.major && t.minor > 4 || 4 === t.major && 4 === t.minor && t.patch >= 4
  9423. }
  9424. return !1
  9425. }
  9426. function r(e, t) {
  9427. function i(e) {
  9428. K.emit(A.STORE, {
  9429. type: e
  9430. }),
  9431. f.launchStore(e)
  9432. }
  9433. function r(e) {
  9434. switch (e !== _.pageCount && (a(e),
  9435. N.text(e + 1 + " / " + _.pageCount)),
  9436. e) {
  9437. case _.Title:
  9438. O.css("display", "none"),
  9439. L.text(u[e]),
  9440. o(s);
  9441. break;
  9442. case _.Cardboard:
  9443. O.css("display", "block"),
  9444. L.text(u[e]),
  9445. M.filter(".cardboard").off(),
  9446. M.filter(".gearvr").off(),
  9447. c(e, s),
  9448. h(H, X, Z);
  9449. break;
  9450. case _.Gear:
  9451. L.text(u[e]),
  9452. c(e, s),
  9453. T.addClass("lastPage"),
  9454. h(G, X, Z);
  9455. break;
  9456. case _.pageCount:
  9457. T.removeClass("fadeIn"),
  9458. K.emit(A.CLOSED)
  9459. }
  9460. B.filter("[src='']").hide()
  9461. }
  9462. var s = function() {
  9463. return p.detectAndroid() ? p.detectAndroidMobile() && n(m.Android) ? (T.addClass("supported"),
  9464. w = ".show-supported",
  9465. m.Android) : (T.addClass("unsupported"),
  9466. w = ".show-unsupported",
  9467. m.UnsupportedAndroid) : p.detectIPhone() || p.detectIPod() ? (T.addClass("ios"),
  9468. w = ".show-ios",
  9469. _ = v.ios,
  9470. m.IOS) : (T.addClass("desktop"),
  9471. w = ".show-desktop",
  9472. m.Desktop)
  9473. }();
  9474. f.init(s, e, t),
  9475. s !== m.Desktop && T.addClass("mobile");
  9476. var l = function(e) {
  9477. K.emit(A.LAUNCH, {
  9478. vr_platform: s,
  9479. vr_app: e
  9480. }),
  9481. f.launch(e)
  9482. };
  9483. q.cardboardAndroid = l.bind(this, g.CardboardAndroid),
  9484. q.gear = l.bind(this, g.GearVR),
  9485. q.cardboardIOS = l.bind(this, g.CardboardIOS),
  9486. d(),
  9487. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  9488. $(w).show();
  9489. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS]
  9490. , y = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  9491. s === m.IOS && (u.splice(1, 1),
  9492. y.splice(1, 1)),
  9493. $("#vr").on("click", function(e) {
  9494. e.preventDefault();
  9495. if(!window.vrEnabled) { // 开启VR
  9496. window.vrEnabled = true;
  9497. this.classList.add('active');
  9498. $('#gui div').not('#vrOff').addClass('vrHide');
  9499. $('#vrOffImg').css({'display':'inline-block'});
  9500. }else{
  9501. }
  9502. // T.hasClass("fadeIn") ? K.dismiss() : (b = 0,
  9503. // r(b),
  9504. // T.addClass("fadeIn"),
  9505. // K.emit(A.OPENED))
  9506. });
  9507. $('#vrOff').on('click', function(){
  9508. window.vrEnabled = false;
  9509. $('#gui div').not('#vrOff').removeClass('vrHide');
  9510. $('#vrOffImg').css({'display':'none'});
  9511. $('#player canvas').css({width:'', 'height': ''}); // 清楚vr下给canvas设置的宽高, 避免横竖屏切换的时候出现宽高错误的现象
  9512. $('#vr').removeClass('active'); // 清除vr按钮的激活样式
  9513. })
  9514. var I = "https://my.port.com/vr/show/?m=" + e.sid;
  9515. s === m.IOS ? $(".cardboardLink").on("click", i.bind(this, g.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, g.CardboardAndroid)),
  9516. $(".gearLink").on("click", i.bind(this, g.GearVR)),
  9517. $("span.modelLink").text(I),
  9518. O.on("click", function(e) {
  9519. K.emit(A.PREV),
  9520. b--,
  9521. r(b)
  9522. }),
  9523. L.on("click", function(e) {
  9524. L.text();
  9525. K.emit(A.NEXT, {
  9526. nextAction: y[b]
  9527. }),
  9528. b++,
  9529. r(b)
  9530. }),
  9531. T.find(".close").on("click", K.dismiss)
  9532. }
  9533. function o(e) {
  9534. switch (e) {
  9535. case m.Android:
  9536. M.filter(".cardboard").off().on("click", q.cardboardAndroid),
  9537. M.filter(".gearvr").off().on("click", q.gear),
  9538. s(H, G, "logo-button", "same-line");
  9539. break;
  9540. case m.UnsupportedAndroid:
  9541. s("", z, "", "");
  9542. break;
  9543. case m.IOS:
  9544. M.filter(".cardboard").off().on("click", q.cardboardIOS),
  9545. s(H, "", "logo-button", "");
  9546. break;
  9547. case m.Desktop:
  9548. M.filter(".cardboard").off().on("click", l.bind(this, null, F, U)),
  9549. M.filter(".gearvr").off().on("click", l.bind(this, G, V, null)),
  9550. s(H, G, "logo-button", "same-line"),
  9551. Q.cardboard()
  9552. }
  9553. }
  9554. function a(e) {
  9555. $(".p1, .p2, .p3").hide(),
  9556. x.insertAfter(S),
  9557. T.removeClass("front-page"),
  9558. T.removeClass("details-page"),
  9559. T.removeClass("lastPage"),
  9560. M.removeClass("logo-button"),
  9561. M.removeClass("same-line"),
  9562. S.removeClass("headsetOptions"),
  9563. R.attr("src", ""),
  9564. R.filter(".second").removeClass("gear"),
  9565. R.css("display", "inline-block"),
  9566. R.off(),
  9567. P.filter(".second").css("display", ""),
  9568. D.css("display", "none"),
  9569. $(".p" + (e + 1) + w).show(),
  9570. R.filter(".third").insertBefore(P.filter(".third"))
  9571. }
  9572. function s(e, t, i, n) {
  9573. T.addClass("front-page"),
  9574. R.filter(".first").attr("src", e),
  9575. R.filter(".second").attr("src", t),
  9576. M.filter(".first").addClass(i),
  9577. M.filter(".second").addClass(i),
  9578. M.addClass(n),
  9579. ".show-desktop" === w && S.insertAfter(x)
  9580. }
  9581. function l(e, t, i) {
  9582. S.addClass("headsetOptions"),
  9583. M.off(),
  9584. R.filter(".second").attr("src", t),
  9585. D.css("display", "block"),
  9586. P.filter(".second").css("display", "none"),
  9587. D.on("click", function() {
  9588. a(_.Title),
  9589. o(m.Desktop)
  9590. }),
  9591. e && (K.emit(A.falseICECHOSEN, {
  9592. name: g.GearVR
  9593. }),
  9594. R.filter(".first").attr("src", e),
  9595. R.filter(".second").addClass("gear"),
  9596. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9597. Q.gearvr()),
  9598. i && (K.emit(A.falseICECHOSEN, {
  9599. name: g.Cardboard
  9600. }),
  9601. R.filter(".third").attr("src", i),
  9602. R.filter(".third").show(),
  9603. R.filter(".third").insertAfter(R.filter(".second")),
  9604. R.filter(".third").addClass("link"),
  9605. R.filter(".second").addClass("link"),
  9606. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9607. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid)),
  9608. Q.cardboard())
  9609. }
  9610. function c(e, t) {
  9611. switch (t) {
  9612. case m.IOS:
  9613. X = Y,
  9614. Z = j;
  9615. break;
  9616. case m.Desktop:
  9617. e === _.Cardboard ? (X = F,
  9618. Z = U,
  9619. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9620. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid))) : (X = V,
  9621. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9622. Z = "");
  9623. break;
  9624. default:
  9625. e === _.Cardboard ? (X = z,
  9626. Z = j) : (X = k,
  9627. Z = W)
  9628. }
  9629. }
  9630. function h(e, t, i) {
  9631. T.find(".inner").addClass("details-page"),
  9632. T.addClass("details-page"),
  9633. R.filter(".first").attr("src", e),
  9634. R.filter(".second").attr("src", t),
  9635. R.filter(".third").attr("src", i)
  9636. }
  9637. function u() {
  9638. T.hasClass("fadeIn") && (T.removeClass("fadeIn"),
  9639. K.emit(A.CLOSED))
  9640. }
  9641. function d() {
  9642. var e = p.aspectRatio() > 1 && p.isMobile();
  9643. T.toggleClass("landscape", e).toggleClass("portrait", !e),
  9644. T.toggleClass("tiny", $("#player").height() <= y.narrowLandscapeHeight),
  9645. T.toggleClass("tinier", $("#player").height() <= y.reallyNarrowLandscapeHeight)
  9646. }
  9647. var p = e("../../util/browser")
  9648. , f = e("./vrLink")
  9649. , g = e("../../enum/VRApps")
  9650. , m = e("../../enum/VRPlatforms")
  9651. , v = e("../../enum/VRPages")
  9652. , A = e("./vrEvent")
  9653. , y = (e("../../settings"),
  9654. e("../../constants"))
  9655. , C = e("../../localization/localize")
  9656. , I = e("../../util/common")
  9657. , E = e("events").EventEmitter
  9658. , b = 0
  9659. , w = null
  9660. , _ = v.standard
  9661. , T = $(".vr-popup")
  9662. , x = T.find(".vr-popup-body")
  9663. , S = T.find(".vr-images")
  9664. , M = T.find(".img-container")
  9665. , R = T.find(".vr-sm-image")
  9666. , P = M.find(".vr-img-caption")
  9667. , O = $(".vr-buttons").find(".prev-button")
  9668. , L = $(".vr-buttons").find(".next-button")
  9669. , D = S.find(".front-close")
  9670. , N = $(".vr-page")
  9671. , B = T.find("img")
  9672. , F = "images/apple-store.png"
  9673. , V = "images/badge-oculus.png"
  9674. , U = "images/badge-cardboard.png"
  9675. , k = "images/logo-samsung.png"
  9676. , H = "images/headset-cardboard.png"
  9677. , G = "images/headset-gearvr.png"
  9678. , z = "images/ico-android-robot.png"
  9679. , W = "images/ico-gearvr.png"
  9680. , j = "images/ico-vr.png"
  9681. , Y = "images/apple-logo-white.svg"
  9682. , X = null
  9683. , Z = null
  9684. , q = {}
  9685. , K = {
  9686. init: r,
  9687. dismiss: u,
  9688. isDeviceSupported: n
  9689. };
  9690. I.extendObject(K, E.prototype),
  9691. $(window).resize(d);
  9692. var Q = function() {
  9693. var e = P.filter(".first").find(".cardboard")
  9694. , t = P.filter(".first").find(".gearvr");
  9695. return {
  9696. cardboard: function() {
  9697. t.addClass("hidden"),
  9698. e.removeClass("hidden")
  9699. },
  9700. gearvr: function() {
  9701. e.addClass("hidden"),
  9702. t.removeClass("hidden")
  9703. }
  9704. }
  9705. }();
  9706. t.exports = K
  9707. }
  9708. , {
  9709. "../../constants": 8,
  9710. "../../enum/VRApps": 46,
  9711. "../../enum/VRPages": 48,
  9712. "../../enum/VRPlatforms": 49,
  9713. "../../localization/localize": 108,
  9714. "../../settings": 166,
  9715. "../../util/browser": 182,
  9716. "../../util/common": 185,
  9717. "./vrEvent": 85,
  9718. "./vrLink": 86,
  9719. events: 202
  9720. }],
  9721. 88: [function(e, t, i) {
  9722. "use strict";
  9723. t.exports = Object.freeze({
  9724. OPENED: "webvr.modal.opened",
  9725. SHOW_TERMS: "webvr.footer.show.terms"
  9726. })
  9727. }
  9728. , {}],
  9729. 89: [function(e, t, i) {
  9730. (function(i) {
  9731. "use strict";
  9732. function n(e, t, i, n) {
  9733. function r(e) {
  9734. e.preventDefault(),
  9735. a(e.currentTarget.id)
  9736. }
  9737. function a(e) {
  9738. ne[e](),
  9739. Object.keys(ne).map(function(t, i) {
  9740. $("#" + t).toggleClass("tabs-underlined", t === e)
  9741. })
  9742. }
  9743. y = i,
  9744. v = t,
  9745. w.init(E.Android, e, n),
  9746. m();
  9747. var l = new RegExp("daydream","i")
  9748. , c = l.test(y.displayName);
  9749. c ? (a("tabdaydream"),
  9750. B.filter(".device-headset-side").attr("src", H),
  9751. D.find(".title").text(x.localizeText("WEBVR_FOR_DAYDREAM"))) : (a("tabcardboard"),
  9752. B.filter(".device-headset-side").attr("src", Y),
  9753. D.find(".title").text(x.localizeText("WEBVR_FOR_CARDBOARD"))),
  9754. $("#vr").on("click", function(e) {
  9755. e.preventDefault(),
  9756. g("click_webvr_button"),
  9757. L.is(":hidden") && (ie.emit(_.OPENED),
  9758. o())
  9759. }),
  9760. $(".webvr-popup .close").on("click", function(e) {
  9761. e.preventDefault(),
  9762. D.hasClass("hidden") ? (g("webvr_help_close"),
  9763. p()) : s()
  9764. }),
  9765. $("#tabcardboard").on("click", r),
  9766. $("#tabdaydream").on("click", r),
  9767. $("#tabnative").on("click", r),
  9768. $(".webvr-popup .open-with-app").on("click", function(e) {
  9769. e.preventDefault(),
  9770. g("webvr_learn_more"),
  9771. a("tabnative"),
  9772. p()
  9773. }),
  9774. $(".webvr-popup .help").on("click", function(e) {
  9775. e.preventDefault(),
  9776. g(D.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9777. p()
  9778. }),
  9779. $(".webvr-popup .terms").on("click", function(e) {
  9780. e.preventDefault(),
  9781. g("webvr_click_terms"),
  9782. s(),
  9783. ie.emit(_.SHOW_TERMS)
  9784. }),
  9785. F.on("click", function(e) {
  9786. e.preventDefault(),
  9787. g(ee),
  9788. window.open(J, "_blank")
  9789. }),
  9790. V.on("click", function(e) {
  9791. e.preventDefault(),
  9792. g("webvr_phone_link"),
  9793. window.open(te, "_blank")
  9794. }),
  9795. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9796. e.preventDefault(),
  9797. g("webvr_cardboard_link"),
  9798. w.launch(b.CardboardAndroid)
  9799. }),
  9800. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9801. e.preventDefault(),
  9802. g("webvr_oculus_link"),
  9803. w.launch(b.GearVR)
  9804. })
  9805. }
  9806. function r() {
  9807. function e() {
  9808. y.isPresenting || (f(),
  9809. window.removeEventListener("vrdisplaypresentchange", e))
  9810. }
  9811. R.info("Headset mounted"),
  9812. v.suspend();
  9813. var t = document.createElement("canvas");
  9814. for (t.getContext("webgl"),
  9815. t.className = "webvr-canvas",
  9816. document.bgColor = "#000",
  9817. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9818. document.body.removeChild(document.body.firstChild);
  9819. document.body.appendChild(t),
  9820. g("webvr_enter_app"),
  9821. y.requestPresent([{
  9822. source: t,
  9823. predistorted: !0
  9824. }]).catch(function(t) {
  9825. R.error("Failed to present: " + t),
  9826. g("webvr_exit_calibrate"),
  9827. e()
  9828. }),
  9829. A.then(function() {
  9830. window.dispatchEvent(new Event("vrapp-start"))
  9831. }),
  9832. window.addEventListener("vrdisplaypresentchange", e)
  9833. }
  9834. function o() {
  9835. O.fadeOut(I.guiAnimationSpeed),
  9836. L.fadeIn(I.guiAnimationSpeed),
  9837. a()
  9838. }
  9839. function a() {
  9840. if (!A) {
  9841. var e = C.valueFromHash("webvr") || I.appConfig.webvr_version
  9842. , t = "https://static.port.com/webvr/" + e + "/js/main.js";
  9843. A = new Promise(function(e, i) {
  9844. var n = document.createElement("script");
  9845. n.type = "text/javascript",
  9846. n.src = t,
  9847. n.onload = e,
  9848. document.head.appendChild(n)
  9849. }
  9850. )
  9851. }
  9852. D.find(".enter-button").on("click", r)
  9853. }
  9854. function s() {
  9855. g("webvr_modal_close"),
  9856. D.find(".enter-button").off("click", r),
  9857. L.fadeOut(I.guiAnimationSpeed, function() {
  9858. D.toggleClass("hidden", !1),
  9859. N.toggleClass("hidden", !0),
  9860. C.exitFullscreen()
  9861. }),
  9862. O.fadeIn(I.guiAnimationSpeed)
  9863. }
  9864. function l() {
  9865. k.toggleClass("hidden", !1),
  9866. U.toggleClass("hidden", !0)
  9867. }
  9868. function c() {
  9869. k.toggleClass("hidden", !0),
  9870. U.toggleClass("hidden", !1)
  9871. }
  9872. function h() {
  9873. B.filter(".device-headset").attr("src", G),
  9874. B.filter(".device-phone").attr("src", z),
  9875. J = Z,
  9876. ee = K,
  9877. F.text(x.localizeText("WEBVR_DAYDREAM_VIEW")),
  9878. V.text(x.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9879. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9880. c()
  9881. }
  9882. function u() {
  9883. B.filter(".badge-cardboard").attr("src", j),
  9884. B.filter(".badge-oculus").attr("src", X),
  9885. l()
  9886. }
  9887. function d() {
  9888. B.filter(".device-headset").attr("src", Y),
  9889. B.filter(".device-phone").attr("src", W),
  9890. J = q,
  9891. ee = Q,
  9892. F.text(x.localizeText("VR_GOOGLE_CARDBOARD")),
  9893. V.text(x.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9894. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9895. c()
  9896. }
  9897. function p() {
  9898. D.toggleClass("hidden"),
  9899. N.toggleClass("hidden")
  9900. }
  9901. function f() {
  9902. R.info("exiting webVR"),
  9903. g("webvr_exit_app"),
  9904. window.location.search.indexOf("&qs=1") === -1 ? window.location = window.location + "&qs=1" : window.location = window.location
  9905. }
  9906. function g(e) {
  9907. var t = C.isLandscape() ? "landscape" : "portrait";
  9908. T.trackAlways("showcase_gui", {
  9909. gui_action: e,
  9910. orientation: t
  9911. })
  9912. }
  9913. function m() {
  9914. var e = C.isLandscape();
  9915. L.toggleClass("landscape", e).toggleClass("portrait", !e)
  9916. }
  9917. var v, A, y, C = e("../../util/browser"), I = e("../../settings"), E = (e("./../gui"),
  9918. e("../../enum/VRPlatforms")), b = e("../../enum/VRApps"), w = e("./../vr/vrLink"), _ = e("./WebVrEvent"), T = e("../../analytics"), x = (e("../../constants"),
  9919. e("../../localization/localize")), S = e("../../util/common"), M = e("../../util/logger"), R = new M(i), P = e("events").EventEmitter, O = $("#gui"), L = $(".webvr-popup"), D = $(".webvr-popup .page.p1"), N = $(".webvr-popup .page.p2"), B = L.find(".image"), F = $(".webvr-popup .detail.headset"), V = $(".webvr-popup .detail.phone"), U = $(".webvr-popup .tab-content.webvr"), k = $(".webvr-popup .tab-content.native"), H = "images/device-daydream-side.png", G = "images/device-daydream.png", z = "images/device-pixel.png", W = "images/ico-android-robot.png", j = "images/badge-cardboard.png", Y = "images/headset-cardboard.png", X = "images/badge-oculus.png", Z = "https://madeby.google.com/vr/", q = "https://vr.google.com/cardboard/get-cardboard/", K = "webvr_daydream_link", Q = "webvr_cardboard_link", J = Z, ee = K, te = "https://vr.google.com/daydream/phones/", ie = {
  9920. init: n
  9921. }, ne = {
  9922. tabcardboard: d,
  9923. tabdaydream: h,
  9924. tabnative: u
  9925. };
  9926. S.extendObject(ie, P.prototype),
  9927. $(window).resize(m),
  9928. t.exports = ie
  9929. }
  9930. ).call(this, "/js/gui/webvr/webVRgui.js")
  9931. }
  9932. , {
  9933. "../../analytics": 4,
  9934. "../../constants": 8,
  9935. "../../enum/VRApps": 46,
  9936. "../../enum/VRPlatforms": 49,
  9937. "../../localization/localize": 108,
  9938. "../../settings": 166,
  9939. "../../util/browser": 182,
  9940. "../../util/common": 185,
  9941. "../../util/logger": 189,
  9942. "./../gui": 65,
  9943. "./../vr/vrLink": 86,
  9944. "./WebVrEvent": 88,
  9945. events: 202
  9946. }],
  9947. 90: [function(e, t, i) {
  9948. "use strict";
  9949. function n(e, t, i, n, o) {
  9950. n || 0 === n ? this.floorId = n : this.floorId = -1,
  9951. this.roomId = o || "",
  9952. this.labelId = e,
  9953. this.position = (new r.Vector3).copy(t),
  9954. this.text = i
  9955. }
  9956. var r = e("three")
  9957. , o = e("../util/browser");
  9958. n.prototype.build = function() {
  9959. var e = window.document.createElement("div");
  9960. o.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9961. var t = window.document.createElement("div");
  9962. t.setAttribute("class", "gui-floorplan-label-text");
  9963. var i = window.document.createTextNode(this.text);
  9964. t.appendChild(i),
  9965. e.appendChild(t),
  9966. window.document.body.appendChild(e),
  9967. this.labelGui = e,
  9968. this.textBlock = t,
  9969. $(this.labelGui).hide();
  9970. var n = window.getComputedStyle(this.labelGui);
  9971. this.initialTransform = n.transform || n.webkitTransform
  9972. }
  9973. ,
  9974. t.exports = n
  9975. }
  9976. , {
  9977. "../util/browser": 182,
  9978. three: 217
  9979. }],
  9980. 91: [function(e, t, i) {
  9981. "use strict";
  9982. function n() {
  9983. this.player = null,
  9984. this.modelManager = null,
  9985. this.container = null
  9986. }
  9987. var r = e("three")
  9988. , o = (e("../util/common"),
  9989. e("../enum/PlayerEvents"))
  9990. , a = (e("../enum/DirectorEvents"),
  9991. e("../enum/ModelManagerEvents"))
  9992. , s = e("../settings")
  9993. , l = e("../enum/Viewmode")
  9994. , c = (e("../enum/WarpStyle"),
  9995. e("../util/transitions"),
  9996. e("../util/lerp"),
  9997. e("../util/browser"));
  9998. //场景初始化
  9999. n.prototype.init = function(e, t, i) {
  10000. this.player = e,
  10001. this.modelManager = t,
  10002. this.container = i,
  10003. this.updateModel(),
  10004. this.bindEvents()
  10005. }
  10006. ,
  10007. n.prototype.bindEvents = function() {
  10008. this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
  10009. this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  10010. this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  10011. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  10012. this.player.on(o.StartOutside, this.handleStartOutside.bind(this))
  10013. }
  10014. ,
  10015. n.prototype.updateModel = function() {
  10016. this.model = this.modelManager.getActiveModel()
  10017. }
  10018. ,
  10019. n.prototype.handlePlayerViewChanged = function() {
  10020. this.updateLabelVisibility(),
  10021. this.updateLabelDisplay()
  10022. }
  10023. ,
  10024. n.prototype.getLabelsForFloor = function(e, t) {
  10025. return t = t || [],
  10026. t.length = 0,
  10027. this.model.labels.forEach(function(i) {
  10028. this.labelVisibleForFloor(i, e) && t.push(i)
  10029. }
  10030. .bind(this)),
  10031. t
  10032. }
  10033. ,
  10034. n.prototype.getLabelsForCurrentFloor = function(e) {
  10035. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  10036. }
  10037. ,
  10038. n.prototype.labelVisibleForFloor = function(e, t) {
  10039. var i = c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile || !c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop;
  10040. if (!this.model.showingLabels || !e.labelGui || !i)
  10041. return !1;
  10042. var n = e.floorId === this.model.floors.size() - 1;
  10043. return this.model.allFloorsVisible ? n : e.floorId === t
  10044. }
  10045. ,
  10046. n.prototype.updateLabelVisibility = function(e) {
  10047. this.model.labels.forEach(function(e) {
  10048. this.supportedMode() && this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex) ? this.showLabel(e, s.labels.fadeInDelay, s.labels.fadeInDuration) : this.hideLabel(e, s.labels.fadeOutDelay, s.labels.fadeOutDuration)
  10049. }
  10050. .bind(this))
  10051. }
  10052. ,
  10053. n.prototype.showAllLabels = function(e, t) {
  10054. this.model.labels.forEach(function(i) {
  10055. this.showLabel(i, e, t)
  10056. }
  10057. .bind(this))
  10058. }
  10059. ,
  10060. n.prototype.hideAllLabels = function(e, t) {
  10061. this.model.labels.forEach(function(i) {
  10062. this.hideLabel(i, e, t)
  10063. }
  10064. .bind(this))
  10065. }
  10066. ,
  10067. n.prototype.showLabel = function(e, t, i) {
  10068. this.model.showingLabels && (e.visible || (e.visible = !0,
  10069. e.labelGui.style.display = "block",
  10070. e.labelGui.style.opacity = 0,
  10071. $(e.labelGui).delay(t).fadeTo(i, 1)))
  10072. }
  10073. ,
  10074. n.prototype.hideLabel = function(e, t, i) {
  10075. e.visible && (e.visible = !1,
  10076. c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  10077. }
  10078. ,
  10079. n.prototype.supportedMode = function() {
  10080. return this.player.mode === l.FLOORPLAN
  10081. }
  10082. ,
  10083. n.prototype.updateLabelDisplay = function() {
  10084. var e = (new r.Vector3,
  10085. new r.Vector3,
  10086. []);
  10087. return function() {
  10088. var t = this.player.getLabelScaleFactor()
  10089. , i = .6
  10090. , n = 1.2
  10091. , r = (1 - t) * n + i
  10092. , o = c.isMobile() ? s.labels.zoomTruncateThreshhold.mobile : s.labels.zoomTruncateThreshhold.desktop;
  10093. this.getLabelsForCurrentFloor(e);
  10094. for (var a = 0; a < e.length; a++) {
  10095. var l = e[a];
  10096. this.supportedMode() && l.labelGui && (this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
  10097. t >= o && l.text.length >= s.labels.minLengthForTruncate ? l.textBlock.innerText = l.text.substring(0, s.labels.truncateLength) + s.labels.truncateSuffix : l.textBlock.innerText = l.text)
  10098. }
  10099. }
  10100. }(),
  10101. n.prototype.updateProjectedGuiElement = function() {
  10102. var e = new r.Vector3;
  10103. new r.Vector3;
  10104. return function(t, i, n, r, o) {
  10105. i.style.fontSize = 100 * o + "%";
  10106. var a = $("#player").width()
  10107. , s = $("#player").height()
  10108. , l = .5 * a
  10109. , c = .5 * s;
  10110. e.copy(n),
  10111. e.project(this.player.camera);
  10112. var h = e.x * l + l
  10113. , u = -(e.y * c) + c;
  10114. h -= t.offsetWidth / 2,
  10115. u -= t.offsetHeight / 2,
  10116. t.style.left = h + "px",
  10117. t.style.top = u + "px"
  10118. }
  10119. }(),
  10120. n.prototype.handleStartInside = function(e) {
  10121. this.updateLabelVisibility()
  10122. }
  10123. ,
  10124. n.prototype.handleStartOutside = function() {
  10125. this.updateLabelVisibility()
  10126. }
  10127. ,
  10128. t.exports = n
  10129. }
  10130. , {
  10131. "../enum/DirectorEvents": 23,
  10132. "../enum/ModelManagerEvents": 33,
  10133. "../enum/PlayerEvents": 40,
  10134. "../enum/Viewmode": 51,
  10135. "../enum/WarpStyle": 52,
  10136. "../settings": 166,
  10137. "../util/browser": 182,
  10138. "../util/common": 185,
  10139. "../util/lerp": 188,
  10140. "../util/transitions": 195,
  10141. three: 217
  10142. }],
  10143. 92: [function(e, t, i) {
  10144. "use strict";
  10145. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  10146. if (null == this)
  10147. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  10148. if ("function" != typeof e)
  10149. throw new TypeError("predicate must be a function");
  10150. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  10151. if (t = i[o],
  10152. e.call(r, t, o, i))
  10153. return o;
  10154. return -1
  10155. }
  10156. ),
  10157. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  10158. value: function(e) {
  10159. if (null == this)
  10160. throw new TypeError('"this" is null or not defined');
  10161. var t = Object(this)
  10162. , i = t.length >>> 0;
  10163. if ("function" != typeof e)
  10164. throw new TypeError("predicate must be a function");
  10165. for (var n = arguments[1], r = 0; r < i; ) {
  10166. var o = t[r];
  10167. if (e.call(n, o, r, t))
  10168. return o;
  10169. r++
  10170. }
  10171. }
  10172. })
  10173. }
  10174. , {}],
  10175. 93: [function(e, t, i) {
  10176. "use strict";
  10177. var n = n || {};
  10178. t.exports = n,
  10179. n.gui = n.gui || {},
  10180. n.utils = n.utils || {},
  10181. n.controllers = n.controllers || {},
  10182. n.dom = n.dom || {},
  10183. n.color = n.color || {},
  10184. n.utils.css = function() {
  10185. return {
  10186. load: function(e, t) {
  10187. t = t || document;
  10188. var i = t.createElement("link");
  10189. i.type = "text/css",
  10190. i.rel = "stylesheet",
  10191. i.href = e,
  10192. t.getElementsByTagName("head")[0].appendChild(i)
  10193. },
  10194. inject: function(e, t) {
  10195. t = t || document;
  10196. var i = document.createElement("style");
  10197. i.type = "text/css",
  10198. i.innerHTML = e,
  10199. t.getElementsByTagName("head")[0].appendChild(i)
  10200. }
  10201. }
  10202. }(),
  10203. n.utils.common = function() {
  10204. var e = Array.prototype.forEach
  10205. , t = Array.prototype.slice;
  10206. return {
  10207. BREAK: {},
  10208. extend: function(e) {
  10209. return this.each(t.call(arguments, 1), function(t) {
  10210. for (var i in t)
  10211. this.isUndefined(t[i]) || (e[i] = t[i])
  10212. }, this),
  10213. e
  10214. },
  10215. defaults: function(e) {
  10216. return this.each(t.call(arguments, 1), function(t) {
  10217. for (var i in t)
  10218. this.isUndefined(e[i]) && (e[i] = t[i])
  10219. }, this),
  10220. e
  10221. },
  10222. compose: function() {
  10223. var e = t.call(arguments);
  10224. return function() {
  10225. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
  10226. i = [e[n].apply(this, i)];
  10227. return i[0]
  10228. }
  10229. },
  10230. each: function(t, i, n) {
  10231. if (t)
  10232. if (e && t.forEach && t.forEach === e)
  10233. t.forEach(i, n);
  10234. else if (t.length === t.length + 0) {
  10235. for (var r = 0, o = t.length; r < o; r++)
  10236. if (r in t && i.call(n, t[r], r) === this.BREAK)
  10237. return
  10238. } else
  10239. for (var r in t)
  10240. if (i.call(n, t[r], r) === this.BREAK)
  10241. return
  10242. },
  10243. defer: function(e) {
  10244. setTimeout(e, 0)
  10245. },
  10246. toArray: function(e) {
  10247. return e.toArray ? e.toArray() : t.call(e)
  10248. },
  10249. isUndefined: function(e) {
  10250. return void 0 === e
  10251. },
  10252. isNull: function(e) {
  10253. return null === e
  10254. },
  10255. isNaN: function(e) {
  10256. return e !== e
  10257. },
  10258. isArray: Array.isArray || function(e) {
  10259. return e.constructor === Array
  10260. }
  10261. ,
  10262. isObject: function(e) {
  10263. return e === Object(e)
  10264. },
  10265. isNumber: function(e) {
  10266. return e === e + 0
  10267. },
  10268. isString: function(e) {
  10269. return e === e + ""
  10270. },
  10271. isBoolean: function(e) {
  10272. return e === !1 || e === !0
  10273. },
  10274. isFunction: function(e) {
  10275. return "[object Function]" === Object.prototype.toString.call(e)
  10276. }
  10277. }
  10278. }(),
  10279. n.controllers.Controller = function(e) {
  10280. var t = function(e, t) {
  10281. this.initialValue = e[t],
  10282. this.domElement = document.createElement("div"),
  10283. this.object = e,
  10284. this.property = t,
  10285. this.__onChange = void 0,
  10286. this.__onFinishChange = void 0
  10287. };
  10288. return e.extend(t.prototype, {
  10289. onChange: function(e) {
  10290. return this.__onChange = e,
  10291. this
  10292. },
  10293. onFinishChange: function(e) {
  10294. return this.__onFinishChange = e,
  10295. this
  10296. },
  10297. setValue: function(e) {
  10298. return this.object[this.property] = e,
  10299. this.__onChange && this.__onChange.call(this, e),
  10300. this.updateDisplay(),
  10301. this
  10302. },
  10303. getValue: function() {
  10304. return this.object[this.property]
  10305. },
  10306. updateDisplay: function() {
  10307. return this
  10308. },
  10309. isModified: function() {
  10310. return this.initialValue !== this.getValue()
  10311. }
  10312. }),
  10313. t
  10314. }(n.utils.common),
  10315. n.dom.dom = function(e) {
  10316. function t(t) {
  10317. if ("0" === t || e.isUndefined(t))
  10318. return 0;
  10319. var i = t.match(r);
  10320. return e.isNull(i) ? 0 : parseFloat(i[1])
  10321. }
  10322. var i = {
  10323. HTMLEvents: ["change"],
  10324. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  10325. KeyboardEvents: ["keydown"]
  10326. }
  10327. , n = {};
  10328. e.each(i, function(t, i) {
  10329. e.each(t, function(e) {
  10330. n[e] = i
  10331. })
  10332. });
  10333. var r = /(\d+(\.\d+)?)px/
  10334. , o = {
  10335. makeSelectable: function(e, t) {
  10336. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  10337. return !1
  10338. }
  10339. : function() {}
  10340. ,
  10341. e.style.MozUserSelect = t ? "auto" : "none",
  10342. e.style.KhtmlUserSelect = t ? "auto" : "none",
  10343. e.unselectable = t ? "on" : "off")
  10344. },
  10345. makeFullscreen: function(t, i, n) {
  10346. e.isUndefined(i) && (i = !0),
  10347. e.isUndefined(n) && (n = !0),
  10348. t.style.position = "absolute",
  10349. i && (t.style.left = 0,
  10350. t.style.right = 0),
  10351. n && (t.style.top = 0,
  10352. t.style.bottom = 0)
  10353. },
  10354. fakeEvent: function(t, i, r, o) {
  10355. r = r || {};
  10356. var a = n[i];
  10357. if (!a)
  10358. throw new Error("Event type " + i + " not supported.");
  10359. var s = document.createEvent(a);
  10360. switch (a) {
  10361. case "MouseEvents":
  10362. var l = r.x || r.clientX || 0
  10363. , c = r.y || r.clientY || 0;
  10364. s.initMouseEvent(i, r.bubbles || !1, r.cancelable || !0, window, r.clickCount || 1, 0, 0, l, c, !1, !1, !1, !1, 0, null);
  10365. break;
  10366. case "KeyboardEvents":
  10367. var h = s.initKeyboardEvent || s.initKeyEvent;
  10368. e.defaults(r, {
  10369. cancelable: !0,
  10370. ctrlKey: !1,
  10371. altKey: !1,
  10372. shiftKey: !1,
  10373. metaKey: !1,
  10374. keyCode: void 0,
  10375. charCode: void 0
  10376. }),
  10377. h(i, r.bubbles || !1, r.cancelable, window, r.ctrlKey, r.altKey, r.shiftKey, r.metaKey, r.keyCode, r.charCode);
  10378. break;
  10379. default:
  10380. s.initEvent(i, r.bubbles || !1, r.cancelable || !0)
  10381. }
  10382. e.defaults(s, o),
  10383. t.dispatchEvent(s)
  10384. },
  10385. bind: function(e, t, i, n) {
  10386. return n = n || !1,
  10387. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  10388. o
  10389. },
  10390. unbind: function(e, t, i, n) {
  10391. return n = n || !1,
  10392. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  10393. o
  10394. },
  10395. addClass: function(e, t) {
  10396. if (void 0 === e.className)
  10397. e.className = t;
  10398. else if (e.className !== t) {
  10399. var i = e.className.split(/ +/);
  10400. i.indexOf(t) == -1 && (i.push(t),
  10401. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  10402. }
  10403. return o
  10404. },
  10405. removeClass: function(e, t) {
  10406. if (t)
  10407. if (void 0 === e.className)
  10408. ;
  10409. else if (e.className === t)
  10410. e.removeAttribute("class");
  10411. else {
  10412. var i = e.className.split(/ +/)
  10413. , n = i.indexOf(t);
  10414. n != -1 && (i.splice(n, 1),
  10415. e.className = i.join(" "))
  10416. }
  10417. else
  10418. e.className = void 0;
  10419. return o
  10420. },
  10421. hasClass: function(e, t) {
  10422. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  10423. },
  10424. getWidth: function(e) {
  10425. var i = getComputedStyle(e);
  10426. return t(i["border-left-width"]) + t(i["border-right-width"]) + t(i["padding-left"]) + t(i["padding-right"]) + t(i.width)
  10427. },
  10428. getHeight: function(e) {
  10429. var i = getComputedStyle(e);
  10430. return t(i["border-top-width"]) + t(i["border-bottom-width"]) + t(i["padding-top"]) + t(i["padding-bottom"]) + t(i.height)
  10431. },
  10432. getOffset: function(e) {
  10433. var t = {
  10434. left: 0,
  10435. top: 0
  10436. };
  10437. if (e.offsetParent)
  10438. do
  10439. t.left += e.offsetLeft,
  10440. t.top += e.offsetTop;
  10441. while (e = e.offsetParent);return t
  10442. },
  10443. isActive: function(e) {
  10444. return e === document.activeElement && (e.type || e.href)
  10445. }
  10446. };
  10447. return o
  10448. }(n.utils.common),
  10449. n.controllers.OptionController = function(e, t, i) {
  10450. var n = function(e, r, o) {
  10451. n.superclass.call(this, e, r);
  10452. var a = this;
  10453. if (this.__select = document.createElement("select"),
  10454. i.isArray(o)) {
  10455. var s = {};
  10456. i.each(o, function(e) {
  10457. s[e] = e
  10458. }),
  10459. o = s
  10460. }
  10461. i.each(o, function(e, t) {
  10462. var i = document.createElement("option");
  10463. i.innerHTML = t,
  10464. i.setAttribute("value", e),
  10465. a.__select.appendChild(i)
  10466. }),
  10467. this.updateDisplay(),
  10468. t.bind(this.__select, "change", function() {
  10469. var e = this.options[this.selectedIndex].value;
  10470. a.setValue(e)
  10471. }),
  10472. this.domElement.appendChild(this.__select)
  10473. };
  10474. return n.superclass = e,
  10475. i.extend(n.prototype, e.prototype, {
  10476. setValue: function(e) {
  10477. var t = n.superclass.prototype.setValue.call(this, e);
  10478. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10479. t
  10480. },
  10481. updateDisplay: function() {
  10482. return this.__select.value = this.getValue(),
  10483. n.superclass.prototype.updateDisplay.call(this)
  10484. }
  10485. }),
  10486. n
  10487. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10488. n.controllers.NumberController = function(e, t) {
  10489. function i(e) {
  10490. return e = e.toString(),
  10491. e.indexOf(".") > -1 ? e.length - e.indexOf(".") - 1 : 0
  10492. }
  10493. var n = function(e, r, o) {
  10494. n.superclass.call(this, e, r),
  10495. o = o || {},
  10496. this.__min = o.min,
  10497. this.__max = o.max,
  10498. this.__step = o.step,
  10499. t.isUndefined(this.__step) ? 0 == this.initialValue ? this.__impliedStep = 1 : this.__impliedStep = Math.pow(10, Math.floor(Math.log(this.initialValue) / Math.LN10)) / 10 : this.__impliedStep = this.__step,
  10500. this.__precision = i(this.__impliedStep)
  10501. };
  10502. return n.superclass = e,
  10503. t.extend(n.prototype, e.prototype, {
  10504. setValue: function(e) {
  10505. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  10506. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  10507. n.superclass.prototype.setValue.call(this, e)
  10508. },
  10509. min: function(e) {
  10510. return this.__min = e,
  10511. this
  10512. },
  10513. max: function(e) {
  10514. return this.__max = e,
  10515. this
  10516. },
  10517. step: function(e) {
  10518. return this.__step = e,
  10519. this.__impliedStep = e,
  10520. this.__precision = i(e),
  10521. this
  10522. }
  10523. }),
  10524. n
  10525. }(n.controllers.Controller, n.utils.common),
  10526. n.controllers.NumberControllerBox = function(e, t, i) {
  10527. function n(e, t) {
  10528. var i = Math.pow(10, t);
  10529. return Math.round(e * i) / i
  10530. }
  10531. var r = function(e, n, o) {
  10532. function a() {
  10533. var e = parseFloat(d.__input.value);
  10534. i.isNaN(e) || d.setValue(e)
  10535. }
  10536. function s() {
  10537. a(),
  10538. d.__onFinishChange && d.__onFinishChange.call(d, d.getValue())
  10539. }
  10540. function l(e) {
  10541. t.bind(window, "mousemove", c),
  10542. t.bind(window, "mouseup", h),
  10543. u = e.clientY
  10544. }
  10545. function c(e) {
  10546. var t = u - e.clientY;
  10547. d.setValue(d.getValue() + t * d.__impliedStep),
  10548. u = e.clientY
  10549. }
  10550. function h() {
  10551. t.unbind(window, "mousemove", c),
  10552. t.unbind(window, "mouseup", h)
  10553. }
  10554. this.__truncationSuspended = !1,
  10555. r.superclass.call(this, e, n, o);
  10556. var u, d = this;
  10557. this.__input = document.createElement("input"),
  10558. this.__input.setAttribute("type", "text"),
  10559. t.bind(this.__input, "change", a),
  10560. t.bind(this.__input, "blur", s),
  10561. t.bind(this.__input, "mousedown", l),
  10562. t.bind(this.__input, "keydown", function(e) {
  10563. 13 === e.keyCode && (d.__truncationSuspended = !0,
  10564. this.blur(),
  10565. d.__truncationSuspended = !1)
  10566. }),
  10567. this.updateDisplay(),
  10568. this.domElement.appendChild(this.__input)
  10569. };
  10570. return r.superclass = e,
  10571. i.extend(r.prototype, e.prototype, {
  10572. updateDisplay: function() {
  10573. return this.__input.value = this.__truncationSuspended ? this.getValue() : n(this.getValue(), this.__precision),
  10574. r.superclass.prototype.updateDisplay.call(this)
  10575. }
  10576. }),
  10577. r
  10578. }(n.controllers.NumberController, n.dom.dom, n.utils.common),
  10579. n.controllers.NumberControllerSlider = function(e, t, i, n, r) {
  10580. function o(e, t, i, n, r) {
  10581. return n + (r - n) * ((e - t) / (i - t))
  10582. }
  10583. var a = function(e, i, n, r, s) {
  10584. function l(e) {
  10585. t.bind(window, "mousemove", c),
  10586. t.bind(window, "mouseup", h),
  10587. c(e)
  10588. }
  10589. function c(e) {
  10590. e.preventDefault();
  10591. var i = t.getOffset(u.__background)
  10592. , n = t.getWidth(u.__background);
  10593. return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)),
  10594. !1
  10595. }
  10596. function h() {
  10597. t.unbind(window, "mousemove", c),
  10598. t.unbind(window, "mouseup", h),
  10599. u.__onFinishChange && u.__onFinishChange.call(u, u.getValue())
  10600. }
  10601. a.superclass.call(this, e, i, {
  10602. min: n,
  10603. max: r,
  10604. step: s
  10605. });
  10606. var u = this;
  10607. this.__background = document.createElement("div"),
  10608. this.__foreground = document.createElement("div"),
  10609. t.bind(this.__background, "mousedown", l),
  10610. t.addClass(this.__background, "slider"),
  10611. t.addClass(this.__foreground, "slider-fg"),
  10612. this.updateDisplay(),
  10613. this.__background.appendChild(this.__foreground),
  10614. this.domElement.appendChild(this.__background)
  10615. };
  10616. return a.superclass = e,
  10617. a.useDefaultStyles = function() {
  10618. i.inject(r)
  10619. }
  10620. ,
  10621. n.extend(a.prototype, e.prototype, {
  10622. updateDisplay: function() {
  10623. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  10624. return this.__foreground.style.width = 100 * e + "%",
  10625. a.superclass.prototype.updateDisplay.call(this)
  10626. }
  10627. }),
  10628. a
  10629. }(n.controllers.NumberController, n.dom.dom, n.utils.css, n.utils.common, "/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n.slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: '';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}"),
  10630. n.controllers.FunctionController = function(e, t, i) {
  10631. var n = function(e, i, r) {
  10632. n.superclass.call(this, e, i);
  10633. var o = this;
  10634. this.__button = document.createElement("div"),
  10635. this.__button.innerHTML = void 0 === r ? "Fire" : r,
  10636. t.bind(this.__button, "click", function(e) {
  10637. return e.preventDefault(),
  10638. o.fire(),
  10639. !1
  10640. }),
  10641. t.addClass(this.__button, "button"),
  10642. this.domElement.appendChild(this.__button)
  10643. };
  10644. return n.superclass = e,
  10645. i.extend(n.prototype, e.prototype, {
  10646. fire: function() {
  10647. this.__onChange && this.__onChange.call(this),
  10648. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10649. this.getValue().call(this.object)
  10650. }
  10651. }),
  10652. n
  10653. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10654. n.controllers.BooleanController = function(e, t, i) {
  10655. var n = function(e, i) {
  10656. function r() {
  10657. o.setValue(!o.__prev)
  10658. }
  10659. n.superclass.call(this, e, i);
  10660. var o = this;
  10661. this.__prev = this.getValue(),
  10662. this.__checkbox = document.createElement("input"),
  10663. this.__checkbox.setAttribute("type", "checkbox"),
  10664. t.bind(this.__checkbox, "change", r, !1),
  10665. this.domElement.appendChild(this.__checkbox),
  10666. this.updateDisplay()
  10667. };
  10668. return n.superclass = e,
  10669. i.extend(n.prototype, e.prototype, {
  10670. setValue: function(e) {
  10671. var t = n.superclass.prototype.setValue.call(this, e);
  10672. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10673. this.__prev = this.getValue(),
  10674. t
  10675. },
  10676. updateDisplay: function() {
  10677. return this.getValue() === !0 ? (this.__checkbox.setAttribute("checked", "checked"),
  10678. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  10679. n.superclass.prototype.updateDisplay.call(this)
  10680. }
  10681. }),
  10682. n
  10683. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10684. n.color.toString = function(e) {
  10685. return function(t) {
  10686. if (1 == t.a || e.isUndefined(t.a)) {
  10687. for (var i = t.hex.toString(16); i.length < 6; )
  10688. i = "0" + i;
  10689. return "#" + i
  10690. }
  10691. return "rgba(" + Math.round(t.r) + "," + Math.round(t.g) + "," + Math.round(t.b) + "," + t.a + ")"
  10692. }
  10693. }(n.utils.common),
  10694. n.color.interpret = function(e, t) {
  10695. var i, n, r = function() {
  10696. n = !1;
  10697. var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0];
  10698. return t.each(o, function(r) {
  10699. if (r.litmus(e))
  10700. return t.each(r.conversions, function(r, o) {
  10701. if (i = r.read(e),
  10702. n === !1 && i !== !1)
  10703. return n = i,
  10704. i.conversionName = o,
  10705. i.conversion = r,
  10706. t.BREAK
  10707. }),
  10708. t.BREAK
  10709. }),
  10710. n
  10711. }, o = [{
  10712. litmus: t.isString,
  10713. conversions: {
  10714. THREE_CHAR_HEX: {
  10715. read: function(e) {
  10716. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10717. return null !== t && {
  10718. space: "HEX",
  10719. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10720. }
  10721. },
  10722. write: e
  10723. },
  10724. SIX_CHAR_HEX: {
  10725. read: function(e) {
  10726. var t = e.match(/^#([A-F0-9]{6})$/i);
  10727. return null !== t && {
  10728. space: "HEX",
  10729. hex: parseInt("0x" + t[1].toString())
  10730. }
  10731. },
  10732. write: e
  10733. },
  10734. CSS_RGB: {
  10735. read: function(e) {
  10736. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10737. return null !== t && {
  10738. space: "RGB",
  10739. r: parseFloat(t[1]),
  10740. g: parseFloat(t[2]),
  10741. b: parseFloat(t[3])
  10742. }
  10743. },
  10744. write: e
  10745. },
  10746. CSS_RGBA: {
  10747. read: function(e) {
  10748. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10749. return null !== t && {
  10750. space: "RGB",
  10751. r: parseFloat(t[1]),
  10752. g: parseFloat(t[2]),
  10753. b: parseFloat(t[3]),
  10754. a: parseFloat(t[4])
  10755. }
  10756. },
  10757. write: e
  10758. }
  10759. }
  10760. }, {
  10761. litmus: t.isNumber,
  10762. conversions: {
  10763. HEX: {
  10764. read: function(e) {
  10765. return {
  10766. space: "HEX",
  10767. hex: e,
  10768. conversionName: "HEX"
  10769. }
  10770. },
  10771. write: function(e) {
  10772. return e.hex
  10773. }
  10774. }
  10775. }
  10776. }, {
  10777. litmus: t.isArray,
  10778. conversions: {
  10779. RGB_ARRAY: {
  10780. read: function(e) {
  10781. return 3 == e.length && {
  10782. space: "RGB",
  10783. r: e[0],
  10784. g: e[1],
  10785. b: e[2]
  10786. }
  10787. },
  10788. write: function(e) {
  10789. return [e.r, e.g, e.b]
  10790. }
  10791. },
  10792. RGBA_ARRAY: {
  10793. read: function(e) {
  10794. return 4 == e.length && {
  10795. space: "RGB",
  10796. r: e[0],
  10797. g: e[1],
  10798. b: e[2],
  10799. a: e[3]
  10800. }
  10801. },
  10802. write: function(e) {
  10803. return [e.r, e.g, e.b, e.a]
  10804. }
  10805. }
  10806. }
  10807. }, {
  10808. litmus: t.isObject,
  10809. conversions: {
  10810. RGBA_OBJ: {
  10811. read: function(e) {
  10812. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b) && t.isNumber(e.a)) && {
  10813. space: "RGB",
  10814. r: e.r,
  10815. g: e.g,
  10816. b: e.b,
  10817. a: e.a
  10818. }
  10819. },
  10820. write: function(e) {
  10821. return {
  10822. r: e.r,
  10823. g: e.g,
  10824. b: e.b,
  10825. a: e.a
  10826. }
  10827. }
  10828. },
  10829. RGB_OBJ: {
  10830. read: function(e) {
  10831. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
  10832. space: "RGB",
  10833. r: e.r,
  10834. g: e.g,
  10835. b: e.b
  10836. }
  10837. },
  10838. write: function(e) {
  10839. return {
  10840. r: e.r,
  10841. g: e.g,
  10842. b: e.b
  10843. }
  10844. }
  10845. },
  10846. HSVA_OBJ: {
  10847. read: function(e) {
  10848. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v) && t.isNumber(e.a)) && {
  10849. space: "HSV",
  10850. h: e.h,
  10851. s: e.s,
  10852. v: e.v,
  10853. a: e.a
  10854. }
  10855. },
  10856. write: function(e) {
  10857. return {
  10858. h: e.h,
  10859. s: e.s,
  10860. v: e.v,
  10861. a: e.a
  10862. }
  10863. }
  10864. },
  10865. HSV_OBJ: {
  10866. read: function(e) {
  10867. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
  10868. space: "HSV",
  10869. h: e.h,
  10870. s: e.s,
  10871. v: e.v
  10872. }
  10873. },
  10874. write: function(e) {
  10875. return {
  10876. h: e.h,
  10877. s: e.s,
  10878. v: e.v
  10879. }
  10880. }
  10881. }
  10882. }
  10883. }];
  10884. return r
  10885. }(n.color.toString, n.utils.common),
  10886. n.GUI = n.gui.GUI = function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  10887. function g(e, t, i, o) {
  10888. if (void 0 === t[i])
  10889. throw new Error("Object " + t + ' has no property "' + i + '"');
  10890. var a;
  10891. if (o.color)
  10892. a = new h(t,i);
  10893. else {
  10894. var s = [t, i].concat(o.factoryArgs);
  10895. a = n.apply(e, s)
  10896. }
  10897. o.before instanceof r && (o.before = o.before.__li),
  10898. A(e, a),
  10899. p.addClass(a.domElement, "c");
  10900. var l = document.createElement("span");
  10901. p.addClass(l, "property-name"),
  10902. l.innerHTML = a.property;
  10903. var c = document.createElement("div");
  10904. c.appendChild(l),
  10905. c.appendChild(a.domElement);
  10906. var u = m(e, c, o.before);
  10907. return p.addClass(u, V.CLASS_CONTROLLER_ROW),
  10908. p.addClass(u, typeof a.getValue()),
  10909. v(e, u, a),
  10910. e.__controllers.push(a),
  10911. a
  10912. }
  10913. function m(e, t, i) {
  10914. var n = document.createElement("li");
  10915. return t && n.appendChild(t),
  10916. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10917. e.onResize(),
  10918. n
  10919. }
  10920. function v(e, t, i) {
  10921. if (i.__li = t,
  10922. i.__gui = e,
  10923. f.extend(i, {
  10924. options: function(t) {
  10925. return arguments.length > 1 ? (i.remove(),
  10926. g(e, i.object, i.property, {
  10927. before: i.__li.nextElementSibling,
  10928. factoryArgs: [f.toArray(arguments)]
  10929. })) : f.isArray(t) || f.isObject(t) ? (i.remove(),
  10930. g(e, i.object, i.property, {
  10931. before: i.__li.nextElementSibling,
  10932. factoryArgs: [t]
  10933. })) : void 0
  10934. },
  10935. name: function(e) {
  10936. return i.__li.firstElementChild.firstElementChild.innerHTML = e,
  10937. i
  10938. },
  10939. listen: function() {
  10940. return i.__gui.listen(i),
  10941. i
  10942. },
  10943. remove: function() {
  10944. return i.__gui.remove(i),
  10945. i
  10946. }
  10947. }),
  10948. i instanceof l) {
  10949. var n = new s(i.object,i.property,{
  10950. min: i.__min,
  10951. max: i.__max,
  10952. step: i.__step
  10953. });
  10954. f.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10955. var t = i[e]
  10956. , r = n[e];
  10957. i[e] = n[e] = function() {
  10958. var e = Array.prototype.slice.call(arguments);
  10959. return t.apply(i, e),
  10960. r.apply(n, e)
  10961. }
  10962. }),
  10963. p.addClass(t, "has-slider"),
  10964. i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild)
  10965. } else if (i instanceof s) {
  10966. var r = function(t) {
  10967. return f.isNumber(i.__min) && f.isNumber(i.__max) ? (i.remove(),
  10968. g(e, i.object, i.property, {
  10969. before: i.__li.nextElementSibling,
  10970. factoryArgs: [i.__min, i.__max, i.__step]
  10971. })) : t
  10972. };
  10973. i.min = f.compose(r, i.min),
  10974. i.max = f.compose(r, i.max)
  10975. } else
  10976. i instanceof o ? (p.bind(t, "click", function() {
  10977. p.fakeEvent(i.__checkbox, "click")
  10978. }),
  10979. p.bind(i.__checkbox, "click", function(e) {
  10980. e.stopPropagation()
  10981. })) : i instanceof a ? (p.bind(t, "click", function() {
  10982. p.fakeEvent(i.__button, "click")
  10983. }),
  10984. p.bind(t, "mouseover", function() {
  10985. p.addClass(i.__button, "hover")
  10986. }),
  10987. p.bind(t, "mouseout", function() {
  10988. p.removeClass(i.__button, "hover")
  10989. })) : i instanceof h && (p.addClass(t, "color"),
  10990. i.updateDisplay = f.compose(function(e) {
  10991. return t.style.borderLeftColor = i.__color.toString(),
  10992. e
  10993. }, i.updateDisplay),
  10994. i.updateDisplay());
  10995. i.setValue = f.compose(function(t) {
  10996. return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0),
  10997. t
  10998. }, i.setValue)
  10999. }
  11000. function A(e, t) {
  11001. var i = e.getRoot()
  11002. , n = i.__rememberedObjects.indexOf(t.object);
  11003. if (n != -1) {
  11004. var r = i.__rememberedObjectIndecesToControllers[n];
  11005. if (void 0 === r && (r = {},
  11006. i.__rememberedObjectIndecesToControllers[n] = r),
  11007. r[t.property] = t,
  11008. i.load && i.load.remembered) {
  11009. var o, a = i.load.remembered;
  11010. if (a[e.preset])
  11011. o = a[e.preset];
  11012. else {
  11013. if (!a[L])
  11014. return;
  11015. o = a[L]
  11016. }
  11017. if (o[n] && void 0 !== o[n][t.property]) {
  11018. var s = o[n][t.property];
  11019. t.initialValue = s,
  11020. t.setValue(s)
  11021. }
  11022. }
  11023. }
  11024. }
  11025. function y(e, t) {
  11026. return document.location.href + "." + t
  11027. }
  11028. function C(e) {
  11029. var t = e.__save_row = document.createElement("li");
  11030. p.addClass(e.domElement, "has-save"),
  11031. e.__ul.insertBefore(t, e.__ul.firstChild),
  11032. p.addClass(t, "save-row");
  11033. var i = document.createElement("span");
  11034. i.innerHTML = "&nbsp;",
  11035. p.addClass(i, "button gears");
  11036. var n = document.createElement("span");
  11037. n.innerHTML = "Save",
  11038. p.addClass(n, "button"),
  11039. p.addClass(n, "save");
  11040. var r = document.createElement("span");
  11041. r.innerHTML = "New",
  11042. p.addClass(r, "button"),
  11043. p.addClass(r, "save-as");
  11044. var o = document.createElement("span");
  11045. o.innerHTML = "Revert",
  11046. p.addClass(o, "button"),
  11047. p.addClass(o, "revert");
  11048. var a = e.__preset_select = document.createElement("select");
  11049. if (e.load && e.load.remembered ? f.each(e.load.remembered, function(t, i) {
  11050. w(e, i, i == e.preset)
  11051. }) : w(e, L, !1),
  11052. p.bind(a, "change", function() {
  11053. for (var t = 0; t < e.__preset_select.length; t++)
  11054. e.__preset_select[t].innerHTML = e.__preset_select[t].value;
  11055. e.preset = this.value
  11056. }),
  11057. t.appendChild(a),
  11058. t.appendChild(i),
  11059. t.appendChild(n),
  11060. t.appendChild(r),
  11061. t.appendChild(o),
  11062. D) {
  11063. var s = document.getElementById("dg-save-locally")
  11064. , l = document.getElementById("dg-local-explain");
  11065. s.style.display = "block";
  11066. var c = document.getElementById("dg-local-storage");
  11067. "true" === localStorage.getItem(y(e, "isLocal")) && c.setAttribute("checked", "checked");
  11068. var h = function() {
  11069. l.style.display = e.useLocalStorage ? "block" : "none"
  11070. };
  11071. h(),
  11072. p.bind(c, "change", function() {
  11073. e.useLocalStorage = !e.useLocalStorage,
  11074. h()
  11075. })
  11076. }
  11077. var u = document.getElementById("dg-new-constructor");
  11078. p.bind(u, "keydown", function(e) {
  11079. !e.metaKey || 67 !== e.which && 67 != e.keyCode || S.hide()
  11080. }),
  11081. p.bind(i, "click", function() {
  11082. u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2),
  11083. S.show(),
  11084. u.focus(),
  11085. u.select()
  11086. }),
  11087. p.bind(n, "click", function() {
  11088. e.save()
  11089. }),
  11090. p.bind(r, "click", function() {
  11091. var t = prompt("Enter a new preset name.");
  11092. t && e.saveAs(t)
  11093. }),
  11094. p.bind(o, "click", function() {
  11095. e.revert()
  11096. })
  11097. }
  11098. function I(e) {
  11099. function t(t) {
  11100. return t.preventDefault(),
  11101. r = t.clientX,
  11102. p.addClass(e.__closeButton, V.CLASS_DRAG),
  11103. p.bind(window, "mousemove", i),
  11104. p.bind(window, "mouseup", n),
  11105. !1
  11106. }
  11107. function i(t) {
  11108. return t.preventDefault(),
  11109. e.width += r - t.clientX,
  11110. e.onResize(),
  11111. r = t.clientX,
  11112. !1
  11113. }
  11114. function n() {
  11115. p.removeClass(e.__closeButton, V.CLASS_DRAG),
  11116. p.unbind(window, "mousemove", i),
  11117. p.unbind(window, "mouseup", n)
  11118. }
  11119. e.__resize_handle = document.createElement("div"),
  11120. f.extend(e.__resize_handle.style, {
  11121. width: "6px",
  11122. marginLeft: "-3px",
  11123. height: "200px",
  11124. cursor: "ew-resize",
  11125. position: "absolute"
  11126. });
  11127. var r;
  11128. p.bind(e.__resize_handle, "mousedown", t),
  11129. p.bind(e.__closeButton, "mousedown", t),
  11130. e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild)
  11131. }
  11132. function E(e, t) {
  11133. e.domElement.style.width = t + "px",
  11134. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  11135. e.__closeButton && (e.__closeButton.style.width = t + "px")
  11136. }
  11137. function b(e, t) {
  11138. var i = {};
  11139. return f.each(e.__rememberedObjects, function(n, r) {
  11140. var o = {}
  11141. , a = e.__rememberedObjectIndecesToControllers[r];
  11142. f.each(a, function(e, i) {
  11143. o[i] = t ? e.initialValue : e.getValue()
  11144. }),
  11145. i[r] = o
  11146. }),
  11147. i
  11148. }
  11149. function w(e, t, i) {
  11150. var n = document.createElement("option");
  11151. n.innerHTML = t,
  11152. n.value = t,
  11153. e.__preset_select.appendChild(n),
  11154. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  11155. }
  11156. function _(e) {
  11157. for (var t = 0; t < e.__preset_select.length; t++)
  11158. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  11159. }
  11160. function T(e, t) {
  11161. var i = e.__preset_select[e.__preset_select.selectedIndex];
  11162. t ? i.innerHTML = i.value + "*" : i.innerHTML = i.value
  11163. }
  11164. function x(e) {
  11165. 0 != e.length && u(function() {
  11166. x(e)
  11167. }),
  11168. f.each(e, function(e) {
  11169. e.updateDisplay()
  11170. })
  11171. }
  11172. e.inject(i);
  11173. var S, M, R = "dg", P = 72, O = 20, L = "Default", D = function() {
  11174. try {
  11175. return "localStorage"in window && null !== window.localStorage
  11176. } catch (e) {
  11177. return !1
  11178. }
  11179. }(), N = !0, B = !1, F = [], V = function(e) {
  11180. function t() {
  11181. var e = i.getRoot();
  11182. e.width += 1,
  11183. f.defer(function() {
  11184. e.width -= 1
  11185. })
  11186. }
  11187. var i = this;
  11188. this.domElement = document.createElement("div"),
  11189. this.__ul = document.createElement("ul"),
  11190. this.domElement.appendChild(this.__ul),
  11191. p.addClass(this.domElement, R),
  11192. this.__folders = {},
  11193. this.__controllers = [],
  11194. this.__rememberedObjects = [],
  11195. this.__rememberedObjectIndecesToControllers = [],
  11196. this.__listening = [],
  11197. e = e || {},
  11198. e = f.defaults(e, {
  11199. autoPlace: !0,
  11200. width: V.DEFAULT_WIDTH
  11201. }),
  11202. e = f.defaults(e, {
  11203. resizable: e.autoPlace,
  11204. hideable: e.autoPlace
  11205. }),
  11206. f.isUndefined(e.load) ? e.load = {
  11207. preset: L
  11208. } : e.preset && (e.load.preset = e.preset),
  11209. f.isUndefined(e.parent) && e.hideable && F.push(this),
  11210. e.resizable = f.isUndefined(e.parent) && e.resizable,
  11211. e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0);
  11212. var n, r = D && "true" === localStorage.getItem(y(this, "isLocal"));
  11213. if (Object.defineProperties(this, {
  11214. parent: {
  11215. get: function() {
  11216. return e.parent
  11217. }
  11218. },
  11219. scrollable: {
  11220. get: function() {
  11221. return e.scrollable
  11222. }
  11223. },
  11224. autoPlace: {
  11225. get: function() {
  11226. return e.autoPlace
  11227. }
  11228. },
  11229. preset: {
  11230. get: function() {
  11231. return i.parent ? i.getRoot().preset : e.load.preset
  11232. },
  11233. set: function(t) {
  11234. i.parent ? i.getRoot().preset = t : e.load.preset = t,
  11235. _(this),
  11236. i.revert()
  11237. }
  11238. },
  11239. width: {
  11240. get: function() {
  11241. return e.width
  11242. },
  11243. set: function(t) {
  11244. e.width = t,
  11245. E(i, t)
  11246. }
  11247. },
  11248. name: {
  11249. get: function() {
  11250. return e.name
  11251. },
  11252. set: function(t) {
  11253. e.name = t,
  11254. a && (a.innerHTML = e.name)
  11255. }
  11256. },
  11257. closed: {
  11258. get: function() {
  11259. return e.closed
  11260. },
  11261. set: function(t) {
  11262. e.closed = t,
  11263. e.closed ? p.addClass(i.__ul, V.CLASS_CLOSED) : p.removeClass(i.__ul, V.CLASS_CLOSED),
  11264. this.onResize(),
  11265. i.__closeButton && (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED)
  11266. }
  11267. },
  11268. load: {
  11269. get: function() {
  11270. return e.load
  11271. }
  11272. },
  11273. useLocalStorage: {
  11274. get: function() {
  11275. return r
  11276. },
  11277. set: function(e) {
  11278. D && (r = e,
  11279. e ? p.bind(window, "unload", n) : p.unbind(window, "unload", n),
  11280. localStorage.setItem(y(i, "isLocal"), e))
  11281. }
  11282. }
  11283. }),
  11284. f.isUndefined(e.parent)) {
  11285. if (e.closed = !1,
  11286. p.addClass(this.domElement, V.CLASS_MAIN),
  11287. p.makeSelectable(this.domElement, !1),
  11288. D && r) {
  11289. i.useLocalStorage = !0;
  11290. var o = localStorage.getItem(y(this, "gui"));
  11291. o && (e.load = JSON.parse(o))
  11292. }
  11293. this.__closeButton = document.createElement("div"),
  11294. this.__closeButton.innerHTML = V.TEXT_CLOSED,
  11295. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  11296. this.domElement.appendChild(this.__closeButton),
  11297. p.bind(this.__closeButton, "click", function() {
  11298. i.closed = !i.closed
  11299. })
  11300. } else {
  11301. void 0 === e.closed && (e.closed = !0);
  11302. var a = document.createTextNode(e.name);
  11303. p.addClass(a, "controller-name");
  11304. var s = m(i, a)
  11305. , l = function(e) {
  11306. return e.preventDefault(),
  11307. i.closed = !i.closed,
  11308. !1
  11309. };
  11310. p.addClass(this.__ul, V.CLASS_CLOSED),
  11311. p.addClass(s, "title"),
  11312. p.bind(s, "click", l),
  11313. e.closed || (this.closed = !1)
  11314. }
  11315. e.autoPlace && (f.isUndefined(e.parent) && (N && (M = document.createElement("div"),
  11316. p.addClass(M, R),
  11317. p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
  11318. document.body.appendChild(M),
  11319. N = !1),
  11320. M.appendChild(this.domElement),
  11321. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  11322. this.parent || E(i, e.width)),
  11323. p.bind(window, "resize", function() {
  11324. i.onResize()
  11325. }),
  11326. p.bind(this.__ul, "webkitTransitionEnd", function() {
  11327. i.onResize()
  11328. }),
  11329. p.bind(this.__ul, "transitionend", function() {
  11330. i.onResize()
  11331. }),
  11332. p.bind(this.__ul, "oTransitionEnd", function() {
  11333. i.onResize()
  11334. }),
  11335. this.onResize(),
  11336. e.resizable && I(this),
  11337. n = function() {
  11338. D && "true" === localStorage.getItem(y(i, "isLocal")) && localStorage.setItem(y(i, "gui"), JSON.stringify(i.getSaveObject()))
  11339. }
  11340. ,
  11341. this.saveToLocalStorageIfPossible = n;
  11342. i.getRoot();
  11343. e.parent || t()
  11344. };
  11345. return V.toggleHide = function() {
  11346. B = !B,
  11347. f.each(F, function(e) {
  11348. e.domElement.style.zIndex = B ? -999 : 999,
  11349. e.domElement.style.opacity = B ? 0 : 1
  11350. })
  11351. }
  11352. ,
  11353. V.CLASS_AUTO_PLACE = "a",
  11354. V.CLASS_AUTO_PLACE_CONTAINER = "ac",
  11355. V.CLASS_MAIN = "main",
  11356. V.CLASS_CONTROLLER_ROW = "cr",
  11357. V.CLASS_TOO_TALL = "taller-than-window",
  11358. V.CLASS_CLOSED = "closed",
  11359. V.CLASS_CLOSE_BUTTON = "close-button",
  11360. V.CLASS_DRAG = "drag",
  11361. V.DEFAULT_WIDTH = 245,
  11362. V.TEXT_CLOSED = "Close Controls",
  11363. V.TEXT_OPEN = "Open Controls",
  11364. p.bind(window, "keydown", function(e) {
  11365. "text" === document.activeElement.type || e.which !== P && e.keyCode != P || V.toggleHide()
  11366. }, !1),
  11367. f.extend(V.prototype, {
  11368. add: function(e, t) {
  11369. return g(this, e, t, {
  11370. factoryArgs: Array.prototype.slice.call(arguments, 2)
  11371. })
  11372. },
  11373. addColor: function(e, t) {
  11374. return g(this, e, t, {
  11375. color: !0
  11376. })
  11377. },
  11378. remove: function(e) {
  11379. this.__ul.removeChild(e.__li),
  11380. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  11381. var t = this;
  11382. f.defer(function() {
  11383. t.onResize()
  11384. })
  11385. },
  11386. destroy: function() {
  11387. this.autoPlace && M.removeChild(this.domElement)
  11388. },
  11389. addFolder: function(e) {
  11390. if (void 0 !== this.__folders[e])
  11391. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  11392. var t = {
  11393. name: e,
  11394. parent: this
  11395. };
  11396. t.autoPlace = this.autoPlace,
  11397. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  11398. t.load = this.load.folders[e]);
  11399. var i = new V(t);
  11400. this.__folders[e] = i;
  11401. var n = m(this, i.domElement);
  11402. return p.addClass(n, "folder"),
  11403. i
  11404. },
  11405. open: function() {
  11406. this.closed = !1
  11407. },
  11408. close: function() {
  11409. this.closed = !0
  11410. },
  11411. onResize: function() {
  11412. var e = this.getRoot();
  11413. if (e.scrollable) {
  11414. var t = p.getOffset(e.__ul).top
  11415. , i = 0;
  11416. f.each(e.__ul.childNodes, function(t) {
  11417. e.autoPlace && t === e.__save_row || (i += p.getHeight(t))
  11418. }),
  11419. $("#player").height() - t - O < i ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
  11420. e.__ul.style.height = $("#player").height() - t - O + "px") : (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
  11421. e.__ul.style.height = "auto")
  11422. }
  11423. e.__resize_handle && f.defer(function() {
  11424. e.__resize_handle.style.height = e.__ul.offsetHeight + "px"
  11425. }),
  11426. e.__closeButton && (e.__closeButton.style.width = e.width + "px")
  11427. },
  11428. remember: function() {
  11429. if (f.isUndefined(S) && (S = new d,
  11430. S.domElement.innerHTML = t),
  11431. this.parent)
  11432. throw new Error("You can only call remember on a top level GUI.");
  11433. var e = this;
  11434. f.each(Array.prototype.slice.call(arguments), function(t) {
  11435. 0 == e.__rememberedObjects.length && C(e),
  11436. e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t)
  11437. }),
  11438. this.autoPlace && E(this, this.width)
  11439. },
  11440. getRoot: function() {
  11441. for (var e = this; e.parent; )
  11442. e = e.parent;
  11443. return e
  11444. },
  11445. getSaveObject: function() {
  11446. var e = this.load;
  11447. return e.closed = this.closed,
  11448. this.__rememberedObjects.length > 0 && (e.preset = this.preset,
  11449. e.remembered || (e.remembered = {}),
  11450. e.remembered[this.preset] = b(this)),
  11451. e.folders = {},
  11452. f.each(this.__folders, function(t, i) {
  11453. e.folders[i] = t.getSaveObject()
  11454. }),
  11455. e
  11456. },
  11457. save: function() {
  11458. this.load.remembered || (this.load.remembered = {}),
  11459. this.load.remembered[this.preset] = b(this),
  11460. T(this, !1),
  11461. this.saveToLocalStorageIfPossible()
  11462. },
  11463. saveAs: function(e) {
  11464. this.load.remembered || (this.load.remembered = {},
  11465. this.load.remembered[L] = b(this, !0)),
  11466. this.load.remembered[e] = b(this),
  11467. this.preset = e,
  11468. w(this, e, !0),
  11469. this.saveToLocalStorageIfPossible()
  11470. },
  11471. revert: function(e) {
  11472. f.each(this.__controllers, function(t) {
  11473. this.getRoot().load.remembered ? A(e || this.getRoot(), t) : t.setValue(t.initialValue)
  11474. }, this),
  11475. f.each(this.__folders, function(e) {
  11476. e.revert(e)
  11477. }),
  11478. e || T(this.getRoot(), !1)
  11479. },
  11480. listen: function(e) {
  11481. var t = 0 == this.__listening.length;
  11482. this.__listening.push(e),
  11483. t && x(this.__listening)
  11484. }
  11485. }),
  11486. V
  11487. }(n.utils.css, '<div id="dg-save" class="dg dialogue">\n\n Here\'s the new load parameter for your <code>GUI</code>\'s constructor:\n\n <textarea id="dg-new-constructor"></textarea>\n\n <div id="dg-save-locally">\n\n <input id="dg-local-storage" type="checkbox"/> Automatically save\n values to <code>localStorage</code> on exit.\n\n <div id="dg-local-explain">The values saved to <code>localStorage</code> will\n override those passed to <code>dat.GUI</code>\'s constructor. This makes it\n easier to work incrementally, but <code>localStorage</code> is fragile,\n and your friends may not see the same values you do.\n \n </div>\n \n </div>\n\n</div>', ".dg {\n /** Clear list styles */\n /* Auto-place container */\n /* Auto-placed GUI's */\n /* Line items that don't contain folders. */\n /** Folder names */\n /** Hides closed items */\n /** Controller row */\n /** Name-half (left) */\n /** Controller-half (right) */\n /** Controller placement */\n /** Shorter number boxes when slider is present. */\n /** Ensure the entire boolean and function row shows a hand */ }\n .dg ul {\n list-style: none;\n margin: 0;\n padding: 0;\n width: 100%;\n clear: both; }\n .dg.ac {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 0;\n z-index: 0; }\n .dg:not(.ac) .main {\n /** Exclude mains in ac so that we don't hide close button */\n overflow: hidden; }\n .dg.main {\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear; }\n .dg.main.taller-than-window {\n overflow-y: auto; }\n .dg.main.taller-than-window .close-button {\n opacity: 1;\n /* TODO, these are style notes */\n margin-top: -1px;\n border-top: 1px solid #2c2c2c; }\n .dg.main ul.closed .close-button {\n opacity: 1 !important; }\n .dg.main:hover .close-button,\n .dg.main .close-button.drag {\n opacity: 1; }\n .dg.main .close-button {\n /*opacity: 0;*/\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear;\n border: 0;\n position: absolute;\n line-height: 19px;\n height: 20px;\n /* TODO, these are style notes */\n cursor: pointer;\n text-align: center;\n background-color: #000; }\n .dg.main .close-button:hover {\n background-color: #111; }\n .dg.a {\n float: right;\n margin-right: 15px;\n overflow-x: hidden; }\n .dg.a.has-save > ul {\n margin-top: 27px; }\n .dg.a.has-save > ul.closed {\n margin-top: 0; }\n .dg.a .save-row {\n position: fixed;\n top: 0;\n z-index: 1002; }\n .dg li {\n -webkit-transition: height 0.1s ease-out;\n -o-transition: height 0.1s ease-out;\n -moz-transition: height 0.1s ease-out;\n transition: height 0.1s ease-out; }\n .dg li:not(.folder) {\n cursor: auto;\n height: 27px;\n line-height: 27px;\n overflow: hidden;\n padding: 0 4px 0 5px; }\n .dg li.folder {\n padding: 0;\n border-left: 4px solid rgba(0, 0, 0, 0); }\n .dg li.title {\n cursor: pointer;\n margin-left: -4px; }\n .dg .closed li:not(.title),\n .dg .closed ul li,\n .dg .closed ul li > * {\n height: 0;\n overflow: hidden;\n border: 0; }\n .dg .cr {\n clear: both;\n padding-left: 3px;\n height: 27px; }\n .dg .property-name {\n cursor: default;\n float: left;\n clear: left;\n width: 40%;\n overflow: hidden;\n text-overflow: ellipsis; }\n .dg .c {\n float: left;\n width: 60%; }\n .dg .c input[type=text] {\n border: 0;\n margin-top: 4px;\n padding: 3px;\n width: 100%;\n float: right; }\n .dg .has-slider input[type=text] {\n width: 30%;\n /*display: none;*/\n margin-left: 0; }\n .dg .slider {\n float: left;\n width: 66%;\n margin-left: -5px;\n margin-right: 0;\n height: 19px;\n margin-top: 4px; }\n .dg .slider-fg {\n height: 100%; }\n .dg .c input[type=checkbox] {\n margin-top: 9px; }\n .dg .c select {\n margin-top: 5px; }\n .dg .cr.function,\n .dg .cr.function .property-name,\n .dg .cr.function *,\n .dg .cr.boolean,\n .dg .cr.boolean * {\n cursor: pointer; }\n .dg .selector {\n display: none;\n position: absolute;\n margin-left: -9px;\n margin-top: 23px;\n z-index: 10; }\n .dg .c:hover .selector,\n .dg .selector.drag {\n display: block; }\n .dg li.save-row {\n padding: 0; }\n .dg li.save-row .button {\n display: inline-block;\n padding: 0px 6px; }\n .dg.dialogue {\n background-color: #222;\n width: 460px;\n padding: 15px;\n font-size: 13px;\n line-height: 15px; }\n\n/* TODO Separate style and structure */\n#dg-new-constructor {\n padding: 10px;\n color: #222;\n font-family: Monaco, monospace;\n font-size: 10px;\n border: 0;\n resize: none;\n box-shadow: inset 1px 1px 1px #888;\n word-wrap: break-word;\n margin: 12px 0;\n display: block;\n width: 440px;\n overflow-y: scroll;\n height: 100px;\n position: relative; }\n\n#dg-local-explain {\n display: none;\n font-size: 11px;\n line-height: 17px;\n border-radius: 3px;\n background-color: #333;\n padding: 8px;\n margin-top: 10px; }\n #dg-local-explain code {\n font-size: 10px; }\n\n#dat-gui-save-locally {\n display: none; }\n\n/** Main type */\n.dg {\n color: #eee;\n font: 11px 'Lucida Grande', sans-serif;\n text-shadow: 0 -1px 0 #111;\n /** Auto place */\n /* Controller row, <li> */\n /** Controllers */ }\n .dg.main {\n /** Scrollbar */ }\n .dg.main::-webkit-scrollbar {\n width: 5px;\n background: #1a1a1a; }\n .dg.main::-webkit-scrollbar-corner {\n height: 0;\n display: none; }\n .dg.main::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: #676767; }\n .dg li:not(.folder) {\n background: #1a1a1a;\n border-bottom: 1px solid #2c2c2c; }\n .dg li.save-row {\n line-height: 25px;\n background: #dad5cb;\n border: 0; }\n .dg li.save-row select {\n margin-left: 5px;\n width: 108px; }\n .dg li.save-row .button {\n margin-left: 5px;\n margin-top: 1px;\n border-radius: 2px;\n font-size: 9px;\n line-height: 7px;\n padding: 4px 4px 5px 4px;\n background: #c5bdad;\n color: #fff;\n text-shadow: 0 1px 0 #b0a58f;\n box-shadow: 0 -1px 0 #b0a58f;\n cursor: pointer; }\n .dg li.save-row .button.gears {\n background: #c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;\n height: 7px;\n width: 8px; }\n .dg li.save-row .button:hover {\n background-color: #bab19e;\n box-shadow: 0 -1px 0 #b0a58f; }\n .dg li.folder {\n border-bottom: 0; }\n .dg li.title {\n padding-left: 16px;\n background: black url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;\n cursor: pointer;\n border-bottom: 1px solid rgba(255, 255, 255, 0.2); }\n .dg .closed li.title {\n background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==); }\n .dg .cr.boolean {\n border-left: 3px solid #806787; }\n .dg .cr.function {\n border-left: 3px solid #e61d5f; }\n .dg .cr.number {\n border-left: 3px solid #2fa1d6; }\n .dg .cr.number input[type=text] {\n color: #2fa1d6; }\n .dg .cr.string {\n border-left: 3px solid #1ed36f; }\n .dg .cr.string input[type=text] {\n color: #1ed36f; }\n .dg .cr.function:hover, .dg .cr.boolean:hover {\n background: #111; }\n .dg .c input[type=text] {\n background: #303030;\n outline: none; }\n .dg .c input[type=text]:hover {\n background: #3c3c3c; }\n .dg .c input[type=text]:focus {\n background: #494949;\n color: #fff; }\n .dg .c .slider {\n background: #303030;\n cursor: ew-resize; }\n .dg .c .slider-fg {\n background: #2fa1d6; }\n .dg .c .slider:hover {\n background: #3c3c3c; }\n .dg .c .slider:hover .slider-fg {\n background: #44abda; }\n", n.controllers.factory = function(e, t, i, n, r, o, a) {
  11488. return function(s, l) {
  11489. var c = s[l];
  11490. return a.isArray(arguments[2]) || a.isObject(arguments[2]) ? new e(s,l,arguments[2]) : a.isNumber(c) ? a.isNumber(arguments[2]) && a.isNumber(arguments[3]) ? new i(s,l,arguments[2],arguments[3]) : new t(s,l,{
  11491. min: arguments[2],
  11492. max: arguments[3]
  11493. }) : a.isString(c) ? new n(s,l) : a.isFunction(c) ? new r(s,l,"") : a.isBoolean(c) ? new o(s,l) : void 0
  11494. }
  11495. }(n.controllers.OptionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.StringController = function(e, t, i) {
  11496. var n = function(e, i) {
  11497. function r() {
  11498. a.setValue(a.__input.value)
  11499. }
  11500. function o() {
  11501. a.__onFinishChange && a.__onFinishChange.call(a, a.getValue())
  11502. }
  11503. n.superclass.call(this, e, i);
  11504. var a = this;
  11505. this.__input = document.createElement("input"),
  11506. this.__input.setAttribute("type", "text"),
  11507. t.bind(this.__input, "keyup", r),
  11508. t.bind(this.__input, "change", r),
  11509. t.bind(this.__input, "blur", o),
  11510. t.bind(this.__input, "keydown", function(e) {
  11511. 13 === e.keyCode && this.blur()
  11512. }),
  11513. this.updateDisplay(),
  11514. this.domElement.appendChild(this.__input)
  11515. };
  11516. return n.superclass = e,
  11517. i.extend(n.prototype, e.prototype, {
  11518. updateDisplay: function() {
  11519. return t.isActive(this.__input) || (this.__input.value = this.getValue()),
  11520. n.superclass.prototype.updateDisplay.call(this)
  11521. }
  11522. }),
  11523. n
  11524. }(n.controllers.Controller, n.dom.dom, n.utils.common), n.controllers.FunctionController, n.controllers.BooleanController, n.utils.common), n.controllers.Controller, n.controllers.BooleanController, n.controllers.FunctionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.OptionController, n.controllers.ColorController = function(e, t, i, n, r) {
  11525. function o(e, t, i, n) {
  11526. e.style.background = "",
  11527. r.each(l, function(r) {
  11528. e.style.cssText += "background: " + r + "linear-gradient(" + t + ", " + i + " 0%, " + n + " 100%); "
  11529. })
  11530. }
  11531. function a(e) {
  11532. e.style.background = "",
  11533. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  11534. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11535. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11536. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11537. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  11538. }
  11539. var s = function(e, l) {
  11540. function c(e) {
  11541. p(e),
  11542. t.bind(window, "mousemove", p),
  11543. t.bind(window, "mouseup", h)
  11544. }
  11545. function h() {
  11546. t.unbind(window, "mousemove", p),
  11547. t.unbind(window, "mouseup", h)
  11548. }
  11549. function u() {
  11550. var e = n(this.value);
  11551. e !== !1 ? (g.__color.__state = e,
  11552. g.setValue(g.__color.toOriginal())) : this.value = g.__color.toString()
  11553. }
  11554. function d() {
  11555. t.unbind(window, "mousemove", f),
  11556. t.unbind(window, "mouseup", d)
  11557. }
  11558. function p(e) {
  11559. e.preventDefault();
  11560. var i = t.getWidth(g.__saturation_field)
  11561. , n = t.getOffset(g.__saturation_field)
  11562. , r = (e.clientX - n.left + document.body.scrollLeft) / i
  11563. , o = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11564. return o > 1 ? o = 1 : o < 0 && (o = 0),
  11565. r > 1 ? r = 1 : r < 0 && (r = 0),
  11566. g.__color.v = o,
  11567. g.__color.s = r,
  11568. g.setValue(g.__color.toOriginal()),
  11569. !1
  11570. }
  11571. function f(e) {
  11572. e.preventDefault();
  11573. var i = t.getHeight(g.__hue_field)
  11574. , n = t.getOffset(g.__hue_field)
  11575. , r = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11576. return r > 1 ? r = 1 : r < 0 && (r = 0),
  11577. g.__color.h = 360 * r,
  11578. g.setValue(g.__color.toOriginal()),
  11579. !1
  11580. }
  11581. s.superclass.call(this, e, l),
  11582. this.__color = new i(this.getValue()),
  11583. this.__temp = new i(0);
  11584. var g = this;
  11585. this.domElement = document.createElement("div"),
  11586. t.makeSelectable(this.domElement, !1),
  11587. this.__selector = document.createElement("div"),
  11588. this.__selector.className = "selector",
  11589. this.__saturation_field = document.createElement("div"),
  11590. this.__saturation_field.className = "saturation-field",
  11591. this.__field_knob = document.createElement("div"),
  11592. this.__field_knob.className = "field-knob",
  11593. this.__field_knob_border = "2px solid ",
  11594. this.__hue_knob = document.createElement("div"),
  11595. this.__hue_knob.className = "hue-knob",
  11596. this.__hue_field = document.createElement("div"),
  11597. this.__hue_field.className = "hue-field",
  11598. this.__input = document.createElement("input"),
  11599. this.__input.type = "text",
  11600. this.__input_textShadow = "0 1px 1px ",
  11601. t.bind(this.__input, "keydown", function(e) {
  11602. 13 === e.keyCode && u.call(this)
  11603. }),
  11604. t.bind(this.__input, "blur", u),
  11605. t.bind(this.__selector, "mousedown", function(e) {
  11606. t.addClass(this, "drag").bind(window, "mouseup", function(e) {
  11607. t.removeClass(g.__selector, "drag")
  11608. })
  11609. });
  11610. var m = document.createElement("div");
  11611. r.extend(this.__selector.style, {
  11612. width: "122px",
  11613. height: "102px",
  11614. padding: "3px",
  11615. backgroundColor: "#222",
  11616. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  11617. }),
  11618. r.extend(this.__field_knob.style, {
  11619. position: "absolute",
  11620. width: "12px",
  11621. height: "12px",
  11622. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  11623. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  11624. borderRadius: "12px",
  11625. zIndex: 1
  11626. }),
  11627. r.extend(this.__hue_knob.style, {
  11628. position: "absolute",
  11629. width: "15px",
  11630. height: "2px",
  11631. borderRight: "4px solid #fff",
  11632. zIndex: 1
  11633. }),
  11634. r.extend(this.__saturation_field.style, {
  11635. width: "100px",
  11636. height: "100px",
  11637. border: "1px solid #555",
  11638. marginRight: "3px",
  11639. display: "inline-block",
  11640. cursor: "pointer"
  11641. }),
  11642. r.extend(m.style, {
  11643. width: "100%",
  11644. height: "100%",
  11645. background: "none"
  11646. }),
  11647. o(m, "top", "rgba(0,0,0,0)", "#000"),
  11648. r.extend(this.__hue_field.style, {
  11649. width: "15px",
  11650. height: "100px",
  11651. display: "inline-block",
  11652. border: "1px solid #555",
  11653. cursor: "ns-resize"
  11654. }),
  11655. a(this.__hue_field),
  11656. r.extend(this.__input.style, {
  11657. outline: "none",
  11658. textAlign: "center",
  11659. color: "#fff",
  11660. border: 0,
  11661. fontWeight: "bold",
  11662. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  11663. }),
  11664. t.bind(this.__saturation_field, "mousedown", c),
  11665. t.bind(this.__field_knob, "mousedown", c),
  11666. t.bind(this.__hue_field, "mousedown", function(e) {
  11667. f(e),
  11668. t.bind(window, "mousemove", f),
  11669. t.bind(window, "mouseup", d)
  11670. }),
  11671. this.__saturation_field.appendChild(m),
  11672. this.__selector.appendChild(this.__field_knob),
  11673. this.__selector.appendChild(this.__saturation_field),
  11674. this.__selector.appendChild(this.__hue_field),
  11675. this.__hue_field.appendChild(this.__hue_knob),
  11676. this.domElement.appendChild(this.__input),
  11677. this.domElement.appendChild(this.__selector),
  11678. this.updateDisplay()
  11679. };
  11680. s.superclass = e,
  11681. r.extend(s.prototype, e.prototype, {
  11682. updateDisplay: function() {
  11683. var e = n(this.getValue());
  11684. if (e !== !1) {
  11685. var t = !1;
  11686. r.each(i.COMPONENTS, function(i) {
  11687. if (!r.isUndefined(e[i]) && !r.isUndefined(this.__color.__state[i]) && e[i] !== this.__color.__state[i])
  11688. return t = !0,
  11689. {}
  11690. }, this),
  11691. t && r.extend(this.__color.__state, e)
  11692. }
  11693. r.extend(this.__temp.__state, this.__color.__state),
  11694. this.__temp.a = 1;
  11695. var a = this.__color.v < .5 || this.__color.s > .5 ? 255 : 0
  11696. , s = 255 - a;
  11697. r.extend(this.__field_knob.style, {
  11698. marginLeft: 100 * this.__color.s - 7 + "px",
  11699. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11700. backgroundColor: this.__temp.toString(),
  11701. border: this.__field_knob_border + "rgb(" + a + "," + a + "," + a + ")"
  11702. }),
  11703. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11704. this.__temp.s = 1,
  11705. this.__temp.v = 1,
  11706. o(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11707. r.extend(this.__input.style, {
  11708. backgroundColor: this.__input.value = this.__color.toString(),
  11709. color: "rgb(" + a + "," + a + "," + a + ")",
  11710. textShadow: this.__input_textShadow + "rgba(" + s + "," + s + "," + s + ",.7)"
  11711. })
  11712. }
  11713. });
  11714. var l = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11715. return s
  11716. }(n.controllers.Controller, n.dom.dom, n.color.Color = function(e, t, i, n) {
  11717. function r(e, t, i) {
  11718. Object.defineProperty(e, t, {
  11719. get: function() {
  11720. return "RGB" === this.__state.space ? this.__state[t] : (a(this, t, i),
  11721. this.__state[t])
  11722. },
  11723. set: function(e) {
  11724. "RGB" !== this.__state.space && (a(this, t, i),
  11725. this.__state.space = "RGB"),
  11726. this.__state[t] = e
  11727. }
  11728. })
  11729. }
  11730. function o(e, t) {
  11731. Object.defineProperty(e, t, {
  11732. get: function() {
  11733. return "HSV" === this.__state.space ? this.__state[t] : (s(this),
  11734. this.__state[t])
  11735. },
  11736. set: function(e) {
  11737. "HSV" !== this.__state.space && (s(this),
  11738. this.__state.space = "HSV"),
  11739. this.__state[t] = e
  11740. }
  11741. })
  11742. }
  11743. function a(e, i, r) {
  11744. if ("HEX" === e.__state.space)
  11745. e.__state[i] = t.component_from_hex(e.__state.hex, r);
  11746. else {
  11747. if ("HSV" !== e.__state.space)
  11748. throw "Corrupted color state";
  11749. n.extend(e.__state, t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  11750. }
  11751. }
  11752. function s(e) {
  11753. var i = t.rgb_to_hsv(e.r, e.g, e.b);
  11754. n.extend(e.__state, {
  11755. s: i.s,
  11756. v: i.v
  11757. }),
  11758. n.isNaN(i.h) ? n.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = i.h
  11759. }
  11760. var l = function() {
  11761. if (this.__state = e.apply(this, arguments),
  11762. this.__state === !1)
  11763. throw "Failed to interpret color arguments";
  11764. this.__state.a = this.__state.a || 1
  11765. };
  11766. return l.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11767. n.extend(l.prototype, {
  11768. toString: function() {
  11769. return i(this)
  11770. },
  11771. toOriginal: function() {
  11772. return this.__state.conversion.write(this)
  11773. }
  11774. }),
  11775. r(l.prototype, "r", 2),
  11776. r(l.prototype, "g", 1),
  11777. r(l.prototype, "b", 0),
  11778. o(l.prototype, "h"),
  11779. o(l.prototype, "s"),
  11780. o(l.prototype, "v"),
  11781. Object.defineProperty(l.prototype, "a", {
  11782. get: function() {
  11783. return this.__state.a
  11784. },
  11785. set: function(e) {
  11786. this.__state.a = e
  11787. }
  11788. }),
  11789. Object.defineProperty(l.prototype, "hex", {
  11790. get: function() {
  11791. return "HEX" !== !this.__state.space && (this.__state.hex = t.rgb_to_hex(this.r, this.g, this.b)),
  11792. this.__state.hex
  11793. },
  11794. set: function(e) {
  11795. this.__state.space = "HEX",
  11796. this.__state.hex = e
  11797. }
  11798. }),
  11799. l
  11800. }(n.color.interpret, n.color.math = function() {
  11801. var e;
  11802. return {
  11803. hsv_to_rgb: function(e, t, i) {
  11804. var n = Math.floor(e / 60) % 6
  11805. , r = e / 60 - Math.floor(e / 60)
  11806. , o = i * (1 - t)
  11807. , a = i * (1 - r * t)
  11808. , s = i * (1 - (1 - r) * t)
  11809. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11810. return {
  11811. r: 255 * l[0],
  11812. g: 255 * l[1],
  11813. b: 255 * l[2]
  11814. }
  11815. },
  11816. rgb_to_hsv: function(e, t, i) {
  11817. var n, r, o = Math.min(e, t, i), a = Math.max(e, t, i), s = a - o;
  11818. return 0 == a ? {
  11819. h: NaN,
  11820. s: 0,
  11821. v: 0
  11822. } : (r = s / a,
  11823. n = e == a ? (t - i) / s : t == a ? 2 + (i - e) / s : 4 + (e - t) / s,
  11824. n /= 6,
  11825. n < 0 && (n += 1),
  11826. {
  11827. h: 360 * n,
  11828. s: r,
  11829. v: a / 255
  11830. })
  11831. },
  11832. rgb_to_hex: function(e, t, i) {
  11833. var n = this.hex_with_component(0, 2, e);
  11834. return n = this.hex_with_component(n, 1, t),
  11835. n = this.hex_with_component(n, 0, i)
  11836. },
  11837. component_from_hex: function(e, t) {
  11838. return e >> 8 * t & 255
  11839. },
  11840. hex_with_component: function(t, i, n) {
  11841. return n << (e = 8 * i) | t & ~(255 << e)
  11842. }
  11843. }
  11844. }(), n.color.toString, n.utils.common), n.color.interpret, n.utils.common), n.utils.requestAnimationFrame = function() {
  11845. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11846. window.setTimeout(e, 1e3 / 60)
  11847. }
  11848. }(), n.dom.CenteredDiv = function(e, t) {
  11849. var i = function() {
  11850. this.backgroundElement = document.createElement("div"),
  11851. t.extend(this.backgroundElement.style, {
  11852. backgroundColor: "rgba(0,0,0,0.8)",
  11853. top: 0,
  11854. left: 0,
  11855. display: "none",
  11856. zIndex: "1000",
  11857. opacity: 0,
  11858. WebkitTransition: "opacity 0.2s linear"
  11859. }),
  11860. e.makeFullscreen(this.backgroundElement),
  11861. this.backgroundElement.style.position = "fixed",
  11862. this.domElement = document.createElement("div"),
  11863. t.extend(this.domElement.style, {
  11864. position: "fixed",
  11865. display: "none",
  11866. zIndex: "1001",
  11867. opacity: 0,
  11868. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  11869. }),
  11870. document.body.appendChild(this.backgroundElement),
  11871. document.body.appendChild(this.domElement);
  11872. var i = this;
  11873. e.bind(this.backgroundElement, "click", function() {
  11874. i.hide()
  11875. })
  11876. };
  11877. return i.prototype.show = function() {
  11878. var e = this;
  11879. this.backgroundElement.style.display = "block",
  11880. this.domElement.style.display = "block",
  11881. this.domElement.style.opacity = 0,
  11882. this.domElement.style.webkitTransform = "scale(1.1)",
  11883. this.layout(),
  11884. t.defer(function() {
  11885. e.backgroundElement.style.opacity = 1,
  11886. e.domElement.style.opacity = 1,
  11887. e.domElement.style.webkitTransform = "scale(1)"
  11888. })
  11889. }
  11890. ,
  11891. i.prototype.hide = function() {
  11892. var t = this
  11893. , i = function() {
  11894. t.domElement.style.display = "none",
  11895. t.backgroundElement.style.display = "none",
  11896. e.unbind(t.domElement, "webkitTransitionEnd", i),
  11897. e.unbind(t.domElement, "transitionend", i),
  11898. e.unbind(t.domElement, "oTransitionEnd", i)
  11899. };
  11900. e.bind(this.domElement, "webkitTransitionEnd", i),
  11901. e.bind(this.domElement, "transitionend", i),
  11902. e.bind(this.domElement, "oTransitionEnd", i),
  11903. this.backgroundElement.style.opacity = 0,
  11904. this.domElement.style.opacity = 0,
  11905. this.domElement.style.webkitTransform = "scale(1.1)"
  11906. }
  11907. ,
  11908. i.prototype.layout = function() {
  11909. this.domElement.style.left = $("#player").width() / 2 - e.getWidth(this.domElement) / 2 + "px",
  11910. this.domElement.style.top = $("#player").height() / 2 - e.getHeight(this.domElement) / 2 + "px"
  11911. }
  11912. ,
  11913. i
  11914. }(n.dom.dom, n.utils.common), n.dom.dom, n.utils.common)
  11915. }
  11916. , {}],
  11917. 94: [function(e, t, i) {
  11918. (function(e) {
  11919. "use strict";
  11920. function i(t) {
  11921. function i(e) {
  11922. 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++) {
  11923. var n = _((t[i] * e + 50) / 100);
  11924. n < 1 ? n = 1 : n > 255 && (n = 255),
  11925. T[G[i]] = n
  11926. }
  11927. 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++) {
  11928. var a = _((r[o] * e + 50) / 100);
  11929. a < 1 ? a = 1 : a > 255 && (a = 255),
  11930. x[G[o]] = a
  11931. }
  11932. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11933. for (var h = 0; h < 8; h++)
  11934. S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8),
  11935. M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8),
  11936. l++
  11937. }
  11938. function n(e, t) {
  11939. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11940. for (var a = 1; a <= e[o]; a++)
  11941. r[t[n]] = [],
  11942. r[t[n]][0] = i,
  11943. r[t[n]][1] = o,
  11944. n++,
  11945. i++;
  11946. i *= 2
  11947. }
  11948. return r
  11949. }
  11950. function r() {
  11951. C = n(z, W),
  11952. I = n(X, Z),
  11953. E = n(j, Y),
  11954. b = n(q, K)
  11955. }
  11956. function o() {
  11957. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11958. for (var n = e; n < t; n++)
  11959. P[32767 + n] = i,
  11960. R[32767 + n] = [],
  11961. R[32767 + n][1] = i,
  11962. R[32767 + n][0] = n;
  11963. for (var r = -(t - 1); r <= -e; r++)
  11964. P[32767 + r] = i,
  11965. R[32767 + r] = [],
  11966. R[32767 + r][1] = i,
  11967. R[32767 + r][0] = t - 1 + r;
  11968. e <<= 1,
  11969. t <<= 1
  11970. }
  11971. }
  11972. function a() {
  11973. for (var e = 0; e < 256; e++)
  11974. H[e] = 19595 * e,
  11975. H[e + 256 >> 0] = 38470 * e,
  11976. H[e + 512 >> 0] = 7471 * e + 32768,
  11977. H[e + 768 >> 0] = -11059 * e,
  11978. H[e + 1024 >> 0] = -21709 * e,
  11979. H[e + 1280 >> 0] = 32768 * e + 8421375,
  11980. H[e + 1536 >> 0] = -27439 * e,
  11981. H[e + 1792 >> 0] = -5329 * e
  11982. }
  11983. function s(e) {
  11984. for (var t = e[0], i = e[1] - 1; i >= 0; )
  11985. t & 1 << i && (N |= 1 << B),
  11986. i--,
  11987. B--,
  11988. B < 0 && (255 == N ? (l(255),
  11989. l(0)) : l(N),
  11990. B = 7,
  11991. N = 0)
  11992. }
  11993. function l(e) {
  11994. D.push(e)
  11995. }
  11996. function c(e) {
  11997. l(e >> 8 & 255),
  11998. l(255 & e)
  11999. }
  12000. function h(e, t) {
  12001. var i, n, r, o, a, s, l, c, h, u = 0, d = 8, p = 64;
  12002. for (h = 0; h < d; ++h) {
  12003. i = e[u],
  12004. n = e[u + 1],
  12005. r = e[u + 2],
  12006. o = e[u + 3],
  12007. a = e[u + 4],
  12008. s = e[u + 5],
  12009. l = e[u + 6],
  12010. c = e[u + 7];
  12011. var f = i + c
  12012. , g = i - c
  12013. , m = n + l
  12014. , v = n - l
  12015. , A = r + s
  12016. , y = r - s
  12017. , C = o + a
  12018. , I = o - a
  12019. , E = f + C
  12020. , b = f - C
  12021. , w = m + A
  12022. , _ = m - A;
  12023. e[u] = E + w,
  12024. e[u + 4] = E - w;
  12025. var T = .707106781 * (_ + b);
  12026. e[u + 2] = b + T,
  12027. e[u + 6] = b - T,
  12028. E = I + y,
  12029. w = y + v,
  12030. _ = v + g;
  12031. var x = .382683433 * (E - _)
  12032. , S = .5411961 * E + x
  12033. , M = 1.306562965 * _ + x
  12034. , R = .707106781 * w
  12035. , P = g + R
  12036. , L = g - R;
  12037. e[u + 5] = L + S,
  12038. e[u + 3] = L - S,
  12039. e[u + 1] = P + M,
  12040. e[u + 7] = P - M,
  12041. u += 8
  12042. }
  12043. for (u = 0,
  12044. h = 0; h < d; ++h) {
  12045. i = e[u],
  12046. n = e[u + 8],
  12047. r = e[u + 16],
  12048. o = e[u + 24],
  12049. a = e[u + 32],
  12050. s = e[u + 40],
  12051. l = e[u + 48],
  12052. c = e[u + 56];
  12053. var D = i + c
  12054. , N = i - c
  12055. , B = n + l
  12056. , F = n - l
  12057. , V = r + s
  12058. , U = r - s
  12059. , k = o + a
  12060. , H = o - a
  12061. , G = D + k
  12062. , z = D - k
  12063. , W = B + V
  12064. , j = B - V;
  12065. e[u] = G + W,
  12066. e[u + 32] = G - W;
  12067. var Y = .707106781 * (j + z);
  12068. e[u + 16] = z + Y,
  12069. e[u + 48] = z - Y,
  12070. G = H + U,
  12071. W = U + F,
  12072. j = F + N;
  12073. var X = .382683433 * (G - j)
  12074. , Z = .5411961 * G + X
  12075. , q = 1.306562965 * j + X
  12076. , K = .707106781 * W
  12077. , Q = N + K
  12078. , J = N - K;
  12079. e[u + 40] = J + Z,
  12080. e[u + 24] = J - Z,
  12081. e[u + 8] = Q + q,
  12082. e[u + 56] = Q - q,
  12083. u++
  12084. }
  12085. var $;
  12086. for (h = 0; h < p; ++h)
  12087. $ = e[h] * t[h],
  12088. O[h] = $ > 0 ? $ + .5 | 0 : $ - .5 | 0;
  12089. return O
  12090. }
  12091. function u() {
  12092. c(65504),
  12093. c(16),
  12094. l(74),
  12095. l(70),
  12096. l(73),
  12097. l(70),
  12098. l(0),
  12099. l(1),
  12100. l(1),
  12101. l(0),
  12102. c(1),
  12103. c(1),
  12104. l(0),
  12105. l(0)
  12106. }
  12107. function d(e, t) {
  12108. c(65472),
  12109. c(17),
  12110. l(8),
  12111. c(t),
  12112. c(e),
  12113. l(3),
  12114. l(1),
  12115. l(17),
  12116. l(0),
  12117. l(2),
  12118. l(17),
  12119. l(1),
  12120. l(3),
  12121. l(17),
  12122. l(1)
  12123. }
  12124. function p() {
  12125. c(65499),
  12126. c(132),
  12127. l(0);
  12128. for (var e = 0; e < 64; e++)
  12129. l(T[e]);
  12130. l(1);
  12131. for (var t = 0; t < 64; t++)
  12132. l(x[t])
  12133. }
  12134. function f() {
  12135. c(65476),
  12136. c(418),
  12137. l(0);
  12138. for (var e = 0; e < 16; e++)
  12139. l(z[e + 1]);
  12140. for (var t = 0; t <= 11; t++)
  12141. l(W[t]);
  12142. l(16);
  12143. for (var i = 0; i < 16; i++)
  12144. l(j[i + 1]);
  12145. for (var n = 0; n <= 161; n++)
  12146. l(Y[n]);
  12147. l(1);
  12148. for (var r = 0; r < 16; r++)
  12149. l(X[r + 1]);
  12150. for (var o = 0; o <= 11; o++)
  12151. l(Z[o]);
  12152. l(17);
  12153. for (var a = 0; a < 16; a++)
  12154. l(q[a + 1]);
  12155. for (var s = 0; s <= 161; s++)
  12156. l(K[s])
  12157. }
  12158. function g() {
  12159. c(65498),
  12160. c(12),
  12161. l(3),
  12162. l(1),
  12163. l(0),
  12164. l(2),
  12165. l(17),
  12166. l(3),
  12167. l(17),
  12168. l(0),
  12169. l(63),
  12170. l(0)
  12171. }
  12172. function m(e, t, i, n, r) {
  12173. for (var o, a = r[0], l = r[240], c = 16, u = 63, d = 64, p = h(e, t), f = 0; f < d; ++f)
  12174. L[G[f]] = p[f];
  12175. var g = L[0] - i;
  12176. i = L[0],
  12177. 0 == g ? s(n[0]) : (o = 32767 + g,
  12178. s(n[P[o]]),
  12179. s(R[o]));
  12180. for (var m = 63; m > 0 && 0 == L[m]; m--)
  12181. ;
  12182. if (0 == m)
  12183. return s(a),
  12184. i;
  12185. for (var v, A = 1; A <= m; ) {
  12186. for (var y = A; 0 == L[A] && A <= m; ++A)
  12187. ;
  12188. var C = A - y;
  12189. if (C >= c) {
  12190. v = C >> 4;
  12191. for (var I = 1; I <= v; ++I)
  12192. s(l);
  12193. C &= 15
  12194. }
  12195. o = 32767 + L[A],
  12196. s(r[(C << 4) + P[o]]),
  12197. s(R[o]),
  12198. A++
  12199. }
  12200. return m != u && s(a),
  12201. i
  12202. }
  12203. function v() {
  12204. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  12205. k[t] = e(t)
  12206. }
  12207. function A(e) {
  12208. if (e <= 0 && (e = 1),
  12209. e > 100 && (e = 100),
  12210. w != e) {
  12211. var t = 0;
  12212. t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e),
  12213. i(t),
  12214. w = e
  12215. }
  12216. }
  12217. function y() {
  12218. var e = (new Date).getTime();
  12219. t || (t = 50),
  12220. v(),
  12221. r(),
  12222. o(),
  12223. a(),
  12224. A(t);
  12225. (new Date).getTime() - e
  12226. }
  12227. var C, I, E, b, w, _ = (Math.round,
  12228. Math.floor), T = new Array(64), x = new Array(64), S = new Array(64), M = new Array(64), R = new Array(65535), P = new Array(65535), O = new Array(64), L = new Array(64), D = [], N = 0, B = 7, F = new Array(64), V = new Array(64), U = new Array(64), k = new Array(256), H = new Array(2048), G = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63], z = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], W = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], j = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125], Y = [1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250], X = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], Z = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], q = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119], K = [0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250];
  12229. this.encode = function(t, i) {
  12230. var n = ((new Date).getTime(),
  12231. i.quality);
  12232. n && A(n),
  12233. D = new Array,
  12234. N = 0,
  12235. B = 7,
  12236. c(65496),
  12237. u(),
  12238. p(),
  12239. d(t.width, t.height),
  12240. f(),
  12241. g();
  12242. var r = 0
  12243. , o = 0
  12244. , a = 0;
  12245. N = 0,
  12246. B = 7,
  12247. this.encode.displayName = "_encode_";
  12248. for (var l, h, v, y, w, _, T, x, R, P = t.data, O = t.width, L = t.height, k = i.flipY, G = 4 * O, z = k ? L : 0, W = k ? -8 : 8; k && z > 0 || !k && z < L; ) {
  12249. for (l = 0; l < G; ) {
  12250. for (w = G * z + l,
  12251. _ = w,
  12252. T = -1,
  12253. x = 0,
  12254. R = 0; R < 64; R++)
  12255. x = (k ? 63 - R : R) >> 3,
  12256. T = 4 * (7 & R),
  12257. _ = w + x * G + T,
  12258. z + x >= L && (_ -= G * (z + 1 + x - L)),
  12259. l + T >= G && (_ -= l + T - G + 4),
  12260. h = P[_++],
  12261. v = P[_++],
  12262. y = P[_++],
  12263. F[R] = (H[h] + H[v + 256 >> 0] + H[y + 512 >> 0] >> 16) - 128,
  12264. V[R] = (H[h + 768 >> 0] + H[v + 1024 >> 0] + H[y + 1280 >> 0] >> 16) - 128,
  12265. U[R] = (H[h + 1280 >> 0] + H[v + 1536 >> 0] + H[y + 1792 >> 0] >> 16) - 128;
  12266. r = m(F, S, r, C, E),
  12267. o = m(V, M, o, I, b),
  12268. a = m(U, M, a, I, b),
  12269. l += 32
  12270. }
  12271. z += W
  12272. }
  12273. if (B >= 0) {
  12274. var j = [];
  12275. j[1] = B + 1,
  12276. j[0] = (1 << B + 1) - 1,
  12277. s(j)
  12278. }
  12279. return c(65497),
  12280. new e(D)
  12281. }
  12282. ,
  12283. y()
  12284. }
  12285. function n(e, t) {
  12286. t = t || {},
  12287. t.quality = t.quality || 50;
  12288. var n = t.quality
  12289. , r = new i(n)
  12290. , o = r.encode(e, t);
  12291. return {
  12292. data: o,
  12293. width: e.width,
  12294. height: e.height
  12295. }
  12296. }
  12297. t.exports.encode = n
  12298. }
  12299. ).call(this, e("buffer").Buffer)
  12300. }
  12301. , {
  12302. buffer: 198
  12303. }],
  12304. 95: [function(e, t, i) {
  12305. "use strict";
  12306. !function() {
  12307. if ("performance"in window == !1 && (window.performance = {}),
  12308. Date.now = Date.now || function() {
  12309. return (new Date).getTime()
  12310. }
  12311. ,
  12312. "now"in window.performance == !1) {
  12313. var e = Date.now();
  12314. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  12315. window.performance.now = function() {
  12316. return Date.now() - e
  12317. }
  12318. }
  12319. }()
  12320. }
  12321. , {}],
  12322. 96: [function(e, t, i) {
  12323. "use strict";
  12324. var n = e("three");
  12325. n.EffectComposer = function(e, t) {
  12326. if (this.renderer = e,
  12327. void 0 === t) {
  12328. var i = {
  12329. minFilter: n.LinearFilter,
  12330. magFilter: n.LinearFilter,
  12331. format: n.RGBAFormat,
  12332. stencilBuffer: !1
  12333. }
  12334. , r = e.getSize();
  12335. t = new n.WebGLRenderTarget(r.width,r.height,i)
  12336. }
  12337. this.renderTarget1 = t,
  12338. this.renderTarget2 = t.clone(),
  12339. this.writeBuffer = this.renderTarget1,
  12340. this.readBuffer = this.renderTarget2,
  12341. this.passes = [],
  12342. void 0 === n.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  12343. this.copyPass = new n.ShaderPass(n.CopyShader)
  12344. }
  12345. ,
  12346. n.EffectComposer.prototype = {
  12347. swapBuffers: function() {
  12348. var e = this.readBuffer;
  12349. this.readBuffer = this.writeBuffer,
  12350. this.writeBuffer = e
  12351. },
  12352. addPass: function(e) {
  12353. this.passes.push(e)
  12354. },
  12355. insertPass: function(e, t) {
  12356. this.passes.splice(t, 0, e)
  12357. },
  12358. render: function(e) {
  12359. this.writeBuffer = this.renderTarget1,
  12360. this.readBuffer = this.renderTarget2;
  12361. var t, i, r = !1, o = this.passes.length;
  12362. for (i = 0; i < o; i++)
  12363. if (t = this.passes[i],
  12364. t.enabled) {
  12365. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, r),
  12366. t.needsSwap) {
  12367. if (r) {
  12368. var a = this.renderer.context;
  12369. a.stencilFunc(a.NOTEQUAL, 1, 4294967295),
  12370. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  12371. a.stencilFunc(a.EQUAL, 1, 4294967295)
  12372. }
  12373. this.swapBuffers()
  12374. }
  12375. t instanceof n.MaskPass ? r = !0 : t instanceof n.ClearMaskPass && (r = !1)
  12376. }
  12377. },
  12378. reset: function(e) {
  12379. if (void 0 === e) {
  12380. var t = this.renderer.getSize();
  12381. e = this.renderTarget1.clone(),
  12382. e.setSize(t.width, t.height)
  12383. }
  12384. this.renderTarget1.dispose(),
  12385. this.renderTarget2.dispose(),
  12386. this.renderTarget1 = e,
  12387. this.renderTarget2 = e.clone(),
  12388. this.writeBuffer = this.renderTarget1,
  12389. this.readBuffer = this.renderTarget2
  12390. },
  12391. setSize: function(e, t) {
  12392. this.renderTarget1.setSize(e, t),
  12393. this.renderTarget2.setSize(e, t)
  12394. }
  12395. }
  12396. }
  12397. , {
  12398. three: 217
  12399. }],
  12400. 97: [function(e, t, i) {
  12401. "use strict";
  12402. var n = e("three");
  12403. n.MaskPass = function(e, t) {
  12404. this.scene = e,
  12405. this.camera = t,
  12406. this.enabled = !0,
  12407. this.clear = !0,
  12408. this.needsSwap = !1,
  12409. this.inverse = !1
  12410. }
  12411. ,
  12412. n.MaskPass.prototype = {
  12413. render: function(e, t, i, n) {
  12414. var r = e.context;
  12415. r.colorMask(!1, !1, !1, !1),
  12416. r.depthMask(!1);
  12417. var o, a;
  12418. this.inverse ? (o = 0,
  12419. a = 1) : (o = 1,
  12420. a = 0),
  12421. r.enable(r.STENCIL_TEST),
  12422. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  12423. r.stencilFunc(r.ALWAYS, o, 4294967295),
  12424. r.clearStencil(a),
  12425. e.render(this.scene, this.camera, i, this.clear),
  12426. e.render(this.scene, this.camera, t, this.clear),
  12427. r.colorMask(!0, !0, !0, !0),
  12428. r.depthMask(!0),
  12429. r.stencilFunc(r.EQUAL, 1, 4294967295),
  12430. r.stencilOp(r.KEEP, r.KEEP, r.KEEP)
  12431. }
  12432. },
  12433. n.ClearMaskPass = function() {
  12434. this.enabled = !0
  12435. }
  12436. ,
  12437. n.ClearMaskPass.prototype = {
  12438. render: function(e, t, i, n) {
  12439. var r = e.context;
  12440. r.disable(r.STENCIL_TEST)
  12441. }
  12442. }
  12443. }
  12444. , {
  12445. three: 217
  12446. }],
  12447. 98: [function(e, t, i) {
  12448. "use strict";
  12449. var n = e("three");
  12450. n.RenderPass = function(e, t, i, r, o) {
  12451. this.scene = e,
  12452. this.camera = t,
  12453. this.overrideMaterial = i,
  12454. this.clearColor = r,
  12455. this.clearAlpha = void 0 !== o ? o : 1,
  12456. this.oldClearColor = new n.Color,
  12457. this.oldClearAlpha = 1,
  12458. this.enabled = !0,
  12459. this.clear = !0,
  12460. this.needsSwap = !1
  12461. }
  12462. ,
  12463. n.RenderPass.prototype = {
  12464. render: function(e, t, i, n) {
  12465. this.scene.overrideMaterial = this.overrideMaterial,
  12466. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  12467. this.oldClearAlpha = e.getClearAlpha(),
  12468. e.setClearColor(this.clearColor, this.clearAlpha)),
  12469. e.render(this.scene, this.camera, i, this.clear),
  12470. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  12471. this.scene.overrideMaterial = null
  12472. }
  12473. }
  12474. }
  12475. , {
  12476. three: 217
  12477. }],
  12478. 99: [function(e, t, i) {
  12479. "use strict";
  12480. var n = e("three");
  12481. n.ShaderPass = function(e, t) {
  12482. this.textureID = void 0 !== t ? t : "tDiffuse",
  12483. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  12484. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  12485. this.material = new n.ShaderMaterial({
  12486. defines: e.defines || {},
  12487. uniforms: this.uniforms,
  12488. vertexShader: e.vertexShader,
  12489. fragmentShader: e.fragmentShader
  12490. })),
  12491. this.renderToScreen = !1,
  12492. this.enabled = !0,
  12493. this.needsSwap = !0,
  12494. this.clear = !1,
  12495. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  12496. this.scene = new n.Scene,
  12497. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  12498. this.scene.add(this.quad)
  12499. }
  12500. ,
  12501. n.ShaderPass.prototype = {
  12502. render: function(e, t, i, n) {
  12503. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  12504. this.quad.material = this.material,
  12505. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  12506. }
  12507. }
  12508. }
  12509. , {
  12510. three: 217
  12511. }],
  12512. 100: [function(e, t, i) {
  12513. "use strict";
  12514. var n = e("three");
  12515. n.CopyShader = {
  12516. uniforms: {
  12517. tDiffuse: {
  12518. type: "t",
  12519. value: null
  12520. },
  12521. opacity: {
  12522. type: "f",
  12523. value: 1
  12524. }
  12525. },
  12526. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12527. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  12528. }
  12529. }
  12530. , {
  12531. three: 217
  12532. }],
  12533. 101: [function(e, t, i) {
  12534. "use strict";
  12535. var n = e("three");
  12536. n.HorizontalBlurShader = {
  12537. uniforms: {
  12538. tDiffuse: {
  12539. type: "t",
  12540. value: null
  12541. },
  12542. h: {
  12543. type: "f",
  12544. value: 1 / 512
  12545. }
  12546. },
  12547. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12548. 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")
  12549. }
  12550. }
  12551. , {
  12552. three: 217
  12553. }],
  12554. 102: [function(e, t, i) {
  12555. "use strict";
  12556. var n = e("three");
  12557. n.VerticalBlurShader = {
  12558. uniforms: {
  12559. tDiffuse: {
  12560. type: "t",
  12561. value: null
  12562. },
  12563. v: {
  12564. type: "f",
  12565. value: 1 / 512
  12566. }
  12567. },
  12568. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12569. 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")
  12570. }
  12571. }
  12572. , {
  12573. three: 217
  12574. }],
  12575. 103: [function(e, t, i) {
  12576. "use strict";
  12577. var n = e("three");
  12578. !function() {
  12579. if ("performance"in window == 0 && (window.performance = {}),
  12580. "now"in window.performance == 0) {
  12581. var e = Date.now();
  12582. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  12583. window.performance.now = function() {
  12584. return Date.now() - e
  12585. }
  12586. }
  12587. }(),
  12588. n.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  12589. var t, i = this.extensions, r = this.context;
  12590. if (e === n.RepeatWrapping)
  12591. return r.REPEAT;
  12592. if (e === n.ClampToEdgeWrapping)
  12593. return r.CLAMP_TO_EDGE;
  12594. if (e === n.MirroredRepeatWrapping)
  12595. return r.MIRRORED_REPEAT;
  12596. if (e === n.NearestFilter)
  12597. return r.NEAREST;
  12598. if (e === n.NearestMipMapNearestFilter)
  12599. return r.NEAREST_MIPMAP_NEAREST;
  12600. if (e === n.NearestMipMapLinearFilter)
  12601. return r.NEAREST_MIPMAP_LINEAR;
  12602. if (e === n.LinearFilter)
  12603. return r.LINEAR;
  12604. if (e === n.LinearMipMapNearestFilter)
  12605. return r.LINEAR_MIPMAP_NEAREST;
  12606. if (e === n.LinearMipMapLinearFilter)
  12607. return r.LINEAR_MIPMAP_LINEAR;
  12608. if (e === n.UnsignedByteType)
  12609. return r.UNSIGNED_BYTE;
  12610. if (e === n.UnsignedShort4444Type)
  12611. return r.UNSIGNED_SHORT_4_4_4_4;
  12612. if (e === n.UnsignedShort5551Type)
  12613. return r.UNSIGNED_SHORT_5_5_5_1;
  12614. if (e === n.UnsignedShort565Type)
  12615. return r.UNSIGNED_SHORT_5_6_5;
  12616. if (e === n.ByteType)
  12617. return r.BYTE;
  12618. if (e === n.ShortType)
  12619. return r.SHORT;
  12620. if (e === n.UnsignedShortType)
  12621. return r.UNSIGNED_SHORT;
  12622. if (e === n.IntType)
  12623. return r.INT;
  12624. if (e === n.UnsignedIntType)
  12625. return r.UNSIGNED_INT;
  12626. if (e === n.FloatType)
  12627. return r.FLOAT;
  12628. if (t = i.get("OES_texture_half_float"),
  12629. null !== t && e === n.HalfFloatType)
  12630. return t.HALF_FLOAT_OES;
  12631. if (e === n.AlphaFormat)
  12632. return r.ALPHA;
  12633. if (e === n.RGBFormat)
  12634. return r.RGB;
  12635. if (e === n.RGBAFormat)
  12636. return r.RGBA;
  12637. if (e === n.LuminanceFormat)
  12638. return r.LUMINANCE;
  12639. if (e === n.LuminanceAlphaFormat)
  12640. return r.LUMINANCE_ALPHA;
  12641. if (e === n.AddEquation)
  12642. return r.FUNC_ADD;
  12643. if (e === n.SubtractEquation)
  12644. return r.FUNC_SUBTRACT;
  12645. if (e === n.ReverseSubtractEquation)
  12646. return r.FUNC_REVERSE_SUBTRACT;
  12647. if (e === n.ZeroFactor)
  12648. return r.ZERO;
  12649. if (e === n.OneFactor)
  12650. return r.ONE;
  12651. if (e === n.SrcColorFactor)
  12652. return r.SRC_COLOR;
  12653. if (e === n.OneMinusSrcColorFactor)
  12654. return r.ONE_MINUS_SRC_COLOR;
  12655. if (e === n.SrcAlphaFactor)
  12656. return r.SRC_ALPHA;
  12657. if (e === n.OneMinusSrcAlphaFactor)
  12658. return r.ONE_MINUS_SRC_ALPHA;
  12659. if (e === n.DstAlphaFactor)
  12660. return r.DST_ALPHA;
  12661. if (e === n.OneMinusDstAlphaFactor)
  12662. return r.ONE_MINUS_DST_ALPHA;
  12663. if (e === n.DstColorFactor)
  12664. return r.DST_COLOR;
  12665. if (e === n.OneMinusDstColorFactor)
  12666. return r.ONE_MINUS_DST_COLOR;
  12667. if (e === n.SrcAlphaSaturateFactor)
  12668. return r.SRC_ALPHA_SATURATE;
  12669. if (t = i.get("WEBGL_compressed_texture_s3tc"),
  12670. null !== t) {
  12671. if (e === n.RGB_S3TC_DXT1_Format)
  12672. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  12673. if (e === n.RGBA_S3TC_DXT1_Format)
  12674. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  12675. if (e === n.RGBA_S3TC_DXT3_Format)
  12676. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  12677. if (e === n.RGBA_S3TC_DXT5_Format)
  12678. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  12679. }
  12680. if (t = i.get("WEBGL_compressed_texture_pvrtc"),
  12681. null !== t) {
  12682. if (e === n.RGB_PVRTC_4BPPV1_Format)
  12683. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  12684. if (e === n.RGB_PVRTC_2BPPV1_Format)
  12685. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  12686. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  12687. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  12688. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  12689. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  12690. }
  12691. if (t = i.get("WEBGL_compressed_texture_etc1"),
  12692. null !== t && e === n.RGB_ETC1_Format)
  12693. return t.COMPRESSED_RGB_ETC1_WEBGL;
  12694. if (t = i.get("EXT_blend_minmax"),
  12695. null !== t) {
  12696. if (e === n.MinEquation)
  12697. return t.MIN_EXT;
  12698. if (e === n.MaxEquation)
  12699. return t.MAX_EXT
  12700. }
  12701. return 0
  12702. }
  12703. ,
  12704. n.WebGLState = function(e, t, i) {
  12705. var r = this
  12706. , o = new n.Vector4
  12707. , a = e.getParameter(e.MAX_VERTEX_ATTRIBS)
  12708. , s = new Uint8Array(a)
  12709. , l = new Uint8Array(a)
  12710. , c = new Uint8Array(a)
  12711. , h = {}
  12712. , u = null
  12713. , d = null
  12714. , p = null
  12715. , f = null
  12716. , g = null
  12717. , m = null
  12718. , v = null
  12719. , A = null
  12720. , y = !1
  12721. , C = null
  12722. , I = null
  12723. , E = null
  12724. , b = null
  12725. , w = null
  12726. , _ = null
  12727. , T = null
  12728. , x = null
  12729. , S = null
  12730. , M = null
  12731. , R = null
  12732. , P = null
  12733. , O = null
  12734. , L = null
  12735. , D = null
  12736. , N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  12737. , B = void 0
  12738. , F = {}
  12739. , V = new n.Vector4
  12740. , U = null
  12741. , k = null
  12742. , H = new n.Vector4
  12743. , G = new n.Vector4;
  12744. this.init = function() {
  12745. this.clearColor(0, 0, 0, 1),
  12746. this.clearDepth(1),
  12747. this.clearStencil(0),
  12748. this.enable(e.DEPTH_TEST),
  12749. e.depthFunc(e.LEQUAL),
  12750. e.frontFace(e.CCW),
  12751. e.cullFace(e.BACK),
  12752. this.enable(e.CULL_FACE),
  12753. this.enable(e.BLEND),
  12754. e.blendEquation(e.FUNC_ADD),
  12755. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  12756. }
  12757. ,
  12758. this.initAttributes = function() {
  12759. for (var e = 0, t = s.length; e < t; e++)
  12760. s[e] = 0
  12761. }
  12762. ,
  12763. this.enableAttribute = function(i) {
  12764. if (s[i] = 1,
  12765. 0 === l[i] && (e.enableVertexAttribArray(i),
  12766. l[i] = 1),
  12767. 0 !== c[i]) {
  12768. var n = t.get("ANGLE_instanced_arrays");
  12769. n.vertexAttribDivisorANGLE(i, 0),
  12770. c[i] = 0
  12771. }
  12772. }
  12773. ,
  12774. this.enableAttributeAndDivisor = function(t, i, n) {
  12775. s[t] = 1,
  12776. 0 === l[t] && (e.enableVertexAttribArray(t),
  12777. l[t] = 1),
  12778. c[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  12779. c[t] = i)
  12780. }
  12781. ,
  12782. this.disableUnusedAttributes = function() {
  12783. for (var t = 0, i = l.length; t < i; t++)
  12784. l[t] !== s[t] && (e.disableVertexAttribArray(t),
  12785. l[t] = 0)
  12786. }
  12787. ,
  12788. this.enable = function(t) {
  12789. h[t] !== !0 && (e.enable(t),
  12790. h[t] = !0)
  12791. }
  12792. ,
  12793. this.disable = function(t) {
  12794. h[t] !== !1 && (e.disable(t),
  12795. h[t] = !1)
  12796. }
  12797. ,
  12798. this.getCompressedTextureFormats = function() {
  12799. if (null === u && (u = [],
  12800. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  12801. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  12802. u.push(i[n]);
  12803. return u
  12804. }
  12805. ,
  12806. this.setBlending = function(t, r, o, a, s, l, c, h) {
  12807. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  12808. t === d && h === y || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12809. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  12810. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12811. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12812. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12813. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12814. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12815. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12816. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  12817. d = t,
  12818. y = h),
  12819. t === n.CustomBlending ? (s = s || r,
  12820. l = l || o,
  12821. c = c || a,
  12822. r === p && s === m || (e.blendEquationSeparate(i(r), i(s)),
  12823. p = r,
  12824. m = s),
  12825. o === f && a === g && l === v && c === A || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  12826. f = o,
  12827. g = a,
  12828. v = l,
  12829. A = c)) : (p = null,
  12830. f = null,
  12831. g = null,
  12832. m = null,
  12833. v = null,
  12834. A = null)
  12835. }
  12836. ,
  12837. this.setDepthFunc = function(t) {
  12838. if (C !== t) {
  12839. if (t)
  12840. switch (t) {
  12841. case n.NeverDepth:
  12842. e.depthFunc(e.NEVER);
  12843. break;
  12844. case n.AlwaysDepth:
  12845. e.depthFunc(e.ALWAYS);
  12846. break;
  12847. case n.LessDepth:
  12848. e.depthFunc(e.LESS);
  12849. break;
  12850. case n.LessEqualDepth:
  12851. e.depthFunc(e.LEQUAL);
  12852. break;
  12853. case n.EqualDepth:
  12854. e.depthFunc(e.EQUAL);
  12855. break;
  12856. case n.GreaterEqualDepth:
  12857. e.depthFunc(e.GEQUAL);
  12858. break;
  12859. case n.GreaterDepth:
  12860. e.depthFunc(e.GREATER);
  12861. break;
  12862. case n.NotEqualDepth:
  12863. e.depthFunc(e.NOTEQUAL);
  12864. break;
  12865. default:
  12866. e.depthFunc(e.LEQUAL)
  12867. }
  12868. else
  12869. e.depthFunc(e.LEQUAL);
  12870. C = t
  12871. }
  12872. }
  12873. ,
  12874. this.setDepthTest = function(t) {
  12875. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  12876. }
  12877. ,
  12878. this.setDepthWrite = function(t) {
  12879. I !== t && (e.depthMask(t),
  12880. I = t)
  12881. }
  12882. ,
  12883. this.setColorWrite = function(t) {
  12884. E !== t && (e.colorMask(t, t, t, t),
  12885. E = t)
  12886. }
  12887. ,
  12888. this.setStencilFunc = function(t, i, n) {
  12889. w === t && _ === i && T === n || (e.stencilFunc(t, i, n),
  12890. w = t,
  12891. _ = i,
  12892. T = n)
  12893. }
  12894. ,
  12895. this.setStencilOp = function(t, i, n) {
  12896. x === t && S === i && M === n || (e.stencilOp(t, i, n),
  12897. x = t,
  12898. S = i,
  12899. M = n)
  12900. }
  12901. ,
  12902. this.setStencilTest = function(t) {
  12903. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  12904. }
  12905. ,
  12906. this.setStencilWrite = function(t) {
  12907. b !== t && (e.stencilMask(t),
  12908. b = t)
  12909. }
  12910. ,
  12911. this.setFlipSided = function(t) {
  12912. R !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  12913. R = t)
  12914. }
  12915. ,
  12916. this.setLineWidth = function(t) {
  12917. t !== P && (e.lineWidth(t),
  12918. P = t)
  12919. }
  12920. ,
  12921. this.setPolygonOffset = function(t, i, n) {
  12922. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  12923. !t || O === i && L === n || (e.polygonOffset(i, n),
  12924. O = i,
  12925. L = n)
  12926. }
  12927. ,
  12928. this.getScissorTest = function() {
  12929. return D
  12930. }
  12931. ,
  12932. this.setScissorTest = function(t) {
  12933. D = t,
  12934. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  12935. }
  12936. ,
  12937. this.activeTexture = function(t) {
  12938. void 0 === t && (t = e.TEXTURE0 + N - 1),
  12939. B !== t && (e.activeTexture(t),
  12940. B = t)
  12941. }
  12942. ,
  12943. this.bindTexture = function(t, i) {
  12944. void 0 === B && r.activeTexture();
  12945. var n = F[B];
  12946. void 0 === n && (n = {
  12947. type: void 0,
  12948. texture: void 0
  12949. },
  12950. F[B] = n),
  12951. n.type === t && n.texture === i || (e.bindTexture(t, i),
  12952. n.type = t,
  12953. n.texture = i)
  12954. }
  12955. ,
  12956. this.compressedTexImage2D = function() {
  12957. try {
  12958. e.compressedTexImage2D.apply(e, arguments)
  12959. } catch (e) {
  12960. console.error(e)
  12961. }
  12962. }
  12963. ,
  12964. this.texImage2D = function() {
  12965. try {
  12966. e.texImage2D.apply(e, arguments)
  12967. } catch (e) {
  12968. console.error(e)
  12969. }
  12970. }
  12971. ,
  12972. this.clearColor = function(t, i, n, r) {
  12973. o.set(t, i, n, r),
  12974. V.equals(o) === !1 && (e.clearColor(t, i, n, r),
  12975. V.copy(o))
  12976. }
  12977. ,
  12978. this.clearDepth = function(t) {
  12979. U !== t && (e.clearDepth(t),
  12980. U = t)
  12981. }
  12982. ,
  12983. this.clearStencil = function(t) {
  12984. k !== t && (e.clearStencil(t),
  12985. k = t)
  12986. }
  12987. ,
  12988. this.scissor = function(t) {
  12989. H.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  12990. H.copy(t))
  12991. }
  12992. ,
  12993. this.viewport = function(t) {
  12994. G.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  12995. G.copy(t))
  12996. }
  12997. ,
  12998. this.reset = function() {
  12999. for (var t = 0; t < l.length; t++)
  13000. 1 === l[t] && (e.disableVertexAttribArray(t),
  13001. l[t] = 0);
  13002. h = {},
  13003. u = null,
  13004. B = void 0,
  13005. F = {},
  13006. d = null,
  13007. E = null,
  13008. I = null,
  13009. b = null,
  13010. R = null
  13011. }
  13012. }
  13013. }
  13014. , {
  13015. three: 217
  13016. }],
  13017. 104: [function(e, t, i) {
  13018. (function(i, n) {
  13019. "use strict";
  13020. function r(e) {
  13021. this.urls = e;
  13022. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  13023. this.builder = a.loadProto(t),
  13024. this.decoder = this.builder.build("binary_mesh")
  13025. }
  13026. var o = e("three")
  13027. , a = e("protobufjs")
  13028. , s = e("../util/logger")
  13029. , l = (e("../util/common"),
  13030. e("../util/ajax"))
  13031. , c = e("../objects/Chunk")
  13032. , h = new s(n);
  13033. r.prototype = {
  13034. constructor: r,
  13035. load: function(e, t, i, n) {
  13036. return h.time("download"),
  13037. l.get(e, {
  13038. responseType: "arraybuffer"
  13039. }).done(function(r) {
  13040. h.timeEnd("download"),
  13041. this.parse(r, e, t, i, n)
  13042. }
  13043. .bind(this)).fail(n)
  13044. },
  13045. parse: function(e, t, i, n, r) {
  13046. var o = this.readProtobuf(e);
  13047. if (!o)
  13048. return r();
  13049. try {
  13050. h.time("convert to webgl"),
  13051. this.convertProtobufToSceneObject(o, t, i, n, r),
  13052. h.timeEnd("convert to webgl")
  13053. } catch (e) {
  13054. return h.error("failed parsing .dam"),
  13055. h.error(e.message),
  13056. r()
  13057. }
  13058. },
  13059. readProtobuf: function(e) {
  13060. var t;
  13061. try {
  13062. h.time("parse proto"),
  13063. t = this.decoder.decode(e),
  13064. h.timeEnd("parse proto")
  13065. } catch (e) {
  13066. return h.error("failed parsing proto for .dam"),
  13067. h.error(e.message),
  13068. null
  13069. }
  13070. return t
  13071. },
  13072. convertProtobufToSceneObject: function(e, t, i, n, r) {
  13073. function a(e) {
  13074. var i = new o.BufferGeometry;
  13075. return i.addAttribute("position", new o.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  13076. e.vertices.uv.length > 0 && i.addAttribute("uv", new o.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  13077. i.setIndex(new o.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  13078. i.applyMatrix(s),
  13079. i.computeBoundingBox(),
  13080. new c({
  13081. geometry: i,
  13082. textureName: e.material_name,
  13083. name: e.chunk_name,
  13084. meshUrl: t
  13085. })
  13086. }
  13087. if (0 === e.chunk.length)
  13088. return h.warn("No chunks in damfile..."),
  13089. i([]);
  13090. var s = new o.Matrix4;
  13091. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  13092. var l = e.chunk.map(a);
  13093. return l ? i(l) : (h.error(".dam protobuf came out with no chunks..."),
  13094. r())
  13095. }
  13096. },
  13097. t.exports = r
  13098. }
  13099. ).call(this, e("buffer").Buffer, "/js/loaders/DamLoader.js")
  13100. }
  13101. , {
  13102. "../objects/Chunk": 144,
  13103. "../util/ajax": 181,
  13104. "../util/common": 185,
  13105. "../util/logger": 189,
  13106. buffer: 198,
  13107. protobufjs: 214,
  13108. three: 217
  13109. }],
  13110. 105: [function(e, t, i) {
  13111. (function(i) {
  13112. "use strict";
  13113. var n = (e("three"),
  13114. e("../settings"),
  13115. e("../util/browser"),
  13116. e("./DamLoader"))
  13117. , r = e("../util/logger")
  13118. , o = (e("../ab"),
  13119. new r(i));
  13120. t.exports = {
  13121. getLoaders: function() {
  13122. return [["_50k", ".dam", n], ["", ".dam", n]]
  13123. },
  13124. load: function(e, t, i, n, r, a) {
  13125. var s = this.getLoaders();
  13126. a = a || 0;
  13127. var l = s[a];
  13128. if (!l)
  13129. return void (r && r("No suitable model file found..."));
  13130. var c = l[0]
  13131. , h = l[1]
  13132. , u = new l[2](t)
  13133. , d = t.get(e + c + h);
  13134. d ? (o.debug("Trying " + c + h),
  13135. u.load(d, i, n, function() {
  13136. this.load(e, t, i, n, r, ++a)
  13137. }
  13138. .bind(this))) : (o.debug("Skipping " + h + ", not available"),
  13139. this.load(e, t, i, n, r, ++a))
  13140. }
  13141. }
  13142. }
  13143. ).call(this, "/js/loaders/ModelLoader.js")
  13144. }
  13145. , {
  13146. "../ab": 3,
  13147. "../settings": 166,
  13148. "../util/browser": 182,
  13149. "../util/logger": 189,
  13150. "./DamLoader": 104,
  13151. three: 217
  13152. }],
  13153. 106: [function(e, t, i) {
  13154. (function(i) {
  13155. "use strict";
  13156. var n = e("../util/common")
  13157. , r = e("../util/texture")
  13158. , o = e("../util/browser")
  13159. , a = e("../util/logger")
  13160. , s = e("../settings")
  13161. , l = new a(i);
  13162. t.exports = {
  13163. load: function(e, t) {
  13164. function i(e, i) {
  13165. e || (t.push(i),
  13166. p++,
  13167. d.notify(p, a),
  13168. p === a && d.resolve())
  13169. }
  13170. if (!e.chunks[0] || !e.chunks[0].meshUrl)
  13171. return $.when();
  13172. var a = n.countUnique(e.chunks.map(function(e) {
  13173. return e.textureName
  13174. }))
  13175. , c = e.chunks[0].meshUrl.indexOf("_50k") !== -1 ? "_50k" : ""
  13176. , h = "_50k" === c ? "high" : "low";
  13177. s.minimalMemoryMode && "high" === h && (o.detectSamsungS6() ? (l.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  13178. h = "low") : a > s.maxMobileTextures && (l.warn("Model probably too large for mobile, turning down quality."),
  13179. h = "low"));
  13180. var u = e.data.job.uuid + c + "_texture_jpg_" + h + "/"
  13181. , d = $.Deferred()
  13182. , p = 0;
  13183. return e.chunks.forEach(function(t) {
  13184. if (!t.material.map && t.textureName) {
  13185. var n = e.urls.get(u + t.textureName);
  13186. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))))
  13187. }
  13188. }),
  13189. d.promise()
  13190. }
  13191. }
  13192. }
  13193. ).call(this, "/js/loaders/ModelTextureLoader.js")
  13194. }
  13195. , {
  13196. "../settings": 166,
  13197. "../util/browser": 182,
  13198. "../util/common": 185,
  13199. "../util/logger": 189,
  13200. "../util/texture": 194
  13201. }],
  13202. 107: [function(e, t, i) {
  13203. (function(i, n) {
  13204. "use strict";
  13205. function r(e) {
  13206. this.model = e,
  13207. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  13208. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  13209. var t = i("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  13210. , n = o.loadProto(t);
  13211. this.decoder = n.build("VisionModeldata")
  13212. }
  13213. var o = e("protobufjs")
  13214. , a = e("../util/ajax")
  13215. , s = (e("../util/common"),
  13216. e("../util/math"))
  13217. , l = e("../util/logger")
  13218. , c = new l(n);
  13219. r.prototype.load = function() {
  13220. return this.modelDataPath ? (c.info("Using vision.modeldata"),
  13221. this.loadVisionModelData()) : this.sweepLocationsPath ? (c.warn("Using sweep_locations.csv"),
  13222. this.loadSweepLocationsCSV()) : (c.warn("No sweep file found"),
  13223. $.when([]))
  13224. }
  13225. ,
  13226. r.prototype.loadVisionModelData = function() {
  13227. return a.get(this.modelDataPath, {
  13228. responseType: "arraybuffer"
  13229. }).then(function(e) {
  13230. var t;
  13231. try {
  13232. t = this.decoder.decode(e)
  13233. } catch (e) {
  13234. return c.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  13235. this.loadSweepLocationsCSV()
  13236. }
  13237. var i = t.sweepLocations.map(function(e) {
  13238. return {
  13239. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  13240. position: {
  13241. x: e.pose.translation.x,
  13242. y: e.pose.translation.y,
  13243. z: e.pose.translation.z
  13244. },
  13245. quaternion: {
  13246. x: e.pose.rotation.x,
  13247. y: e.pose.rotation.y,
  13248. z: e.pose.rotation.z,
  13249. w: e.pose.rotation.w
  13250. },
  13251. puck: {
  13252. x: e.puck.x,
  13253. y: e.puck.y,
  13254. z: e.puck.z
  13255. },
  13256. floor: e.group,
  13257. neighbours: e.visibles,
  13258. alignmentType: e.alignment_type
  13259. }
  13260. }).map(function(e) {
  13261. return e.position = s.convertVisionVector(e.position),
  13262. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  13263. e.puck = s.convertVisionVector(e.puck),
  13264. e
  13265. });
  13266. return i.forEach(function(e) {
  13267. e.neighbours = e.neighbours.map(function(e) {
  13268. return i[e].uuid
  13269. })
  13270. }),
  13271. i
  13272. }
  13273. .bind(this), function() {
  13274. return c.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  13275. this.loadSweepLocationsCSV()
  13276. }
  13277. .bind(this))
  13278. }
  13279. ,
  13280. r.prototype.loadSweepLocationsCSV = function() {
  13281. return a.get(this.sweepLocationsPath).then(function(e) {
  13282. var t = e.split("\n").map(function(e) {
  13283. return e.split(", ")
  13284. }).filter(function(e) {
  13285. return e.length > 1
  13286. }).map(function(e) {
  13287. return {
  13288. uuid: e[0],
  13289. position: {
  13290. x: parseFloat(e[1]),
  13291. y: parseFloat(e[2]),
  13292. z: parseFloat(e[3])
  13293. },
  13294. quaternion: {
  13295. x: parseFloat(e[4]),
  13296. y: parseFloat(e[5]),
  13297. z: parseFloat(e[6]),
  13298. w: parseFloat(e[7])
  13299. }
  13300. }
  13301. }).map(function(e) {
  13302. return e.position = s.convertVisionVector(e.position),
  13303. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  13304. e
  13305. });
  13306. return t
  13307. }).fail(function() {
  13308. c.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  13309. })
  13310. }
  13311. ,
  13312. t.exports = r
  13313. }
  13314. ).call(this, e("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  13315. }
  13316. , {
  13317. "../util/ajax": 181,
  13318. "../util/common": 185,
  13319. "../util/logger": 189,
  13320. "../util/math": 190,
  13321. buffer: 198,
  13322. protobufjs: 214
  13323. }],
  13324. 108: [function(e, t, i) {
  13325. (function(i) {
  13326. "use strict";
  13327. function n() {
  13328. this.locale = null
  13329. }
  13330. var r = e("../settings")
  13331. , o = e("../util/common")
  13332. , a = e("../util/logger")
  13333. , s = e("../enum/Locale")
  13334. , l = new a(i);
  13335. n.prototype.init = function() {
  13336. var t;
  13337. switch (r.languageTag) {
  13338. case null:
  13339. case "en":
  13340. case s.EN_US:
  13341. this.locale = s.EN_US,
  13342. t = e("./strings-en-US");
  13343. break;
  13344. case "es":
  13345. case s.ES_MX:
  13346. this.locale = s.ES_MX,
  13347. t = e("./strings-es-MX");
  13348. break;
  13349. case "fr":
  13350. case s.FR_FR:
  13351. this.locale = s.FR_FR,
  13352. t = e("./strings-fr-FR");
  13353. break;
  13354. case "de":
  13355. case s.DE_DE:
  13356. this.locale = s.DE_DE,
  13357. t = e("./strings-de-DE");
  13358. break;
  13359. case "ru":
  13360. case s.RU_RU:
  13361. this.locale = s.RU_RU,
  13362. t = e("./strings-ru-RU");
  13363. break;
  13364. case "cn":
  13365. case s.CN_CN:
  13366. this.locale = s.CN_CN,
  13367. t = e("./strings-cn-CN");
  13368. break;
  13369. case "jp":
  13370. case s.JP_JP:
  13371. this.locale = s.JP_JP,
  13372. t = e("./strings-jp-JP");
  13373. break;
  13374. default:
  13375. l.info("Unsupported language tag, defaulting to 'en-US'"),
  13376. this.locale = s.EN_US,
  13377. t = e("./strings-en-US")
  13378. }
  13379. l.info("Using locale '" + this.locale + "'"),
  13380. o.extendObject(this, t)
  13381. }
  13382. ,
  13383. n.prototype.localizeGUI = function() {
  13384. var e = document.querySelector("#gui-parent");
  13385. this.localizeTree(e),
  13386. this.localizeLoadingText()
  13387. }
  13388. ,
  13389. n.prototype.localizeLoadingText = function() {
  13390. // var e = document.querySelector("#loader-cont")
  13391. // , t = e.getAttribute("title");
  13392. // e.removeAttribute("title"),
  13393. // e.setAttribute("data-status", t),
  13394. // e.classList.add(this.locale),
  13395. document.querySelector("#help-dialog").classList.add(this.locale),
  13396. document.querySelector("#interaction-modal").classList.add(this.locale),
  13397. document.querySelector("#gui").classList.add(this.locale);
  13398. }
  13399. ,
  13400. n.prototype.localizeTree = function(e) {
  13401. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  13402. if (e.nodeType === Node.TEXT_NODE)
  13403. t = e.data.match(n),
  13404. t && (i = t[1],
  13405. e.data = this.localizeText(i) || i);
  13406. else if (e.nodeType === Node.ELEMENT_NODE) {
  13407. var r = e.getAttribute("title");
  13408. r && (t = r.match(n),
  13409. t && (i = t[1],
  13410. e.setAttribute("title", this.localizeText(i) || i)))
  13411. }
  13412. for (e = e.firstChild; e; )
  13413. this.localizeTree(e),
  13414. e = e.nextSibling
  13415. }
  13416. ,
  13417. n.prototype.localizeText = function(t) {
  13418. var i = this[t];
  13419. return i || this.locale === s.EN_US || (l.warn("Localization key '" + t + "' not available for locale '" + this.locale + "', defaulting to English."),
  13420. i = e("./strings-en-US")[t]),
  13421. i || l.warn("Localization key '" + t + "' not available for locale 'en-US'"),
  13422. i
  13423. }
  13424. ,
  13425. t.exports = new n
  13426. }
  13427. ).call(this, "/js/localization/localize.js")
  13428. }
  13429. , {
  13430. "../enum/Locale": 31,
  13431. "../settings": 166,
  13432. "../util/common": 185,
  13433. "../util/logger": 189,
  13434. "./strings-cn-CN": 109,
  13435. "./strings-de-DE": 110,
  13436. "./strings-en-US": 111,
  13437. "./strings-es-MX": 112,
  13438. "./strings-fr-FR": 113,
  13439. "./strings-jp-JP": 114,
  13440. "./strings-ru-RU": 115
  13441. }],
  13442. 109: [function(e, t, i) {
  13443. "use strict";
  13444. t.exports = {
  13445. PAGE_TITLE: "",
  13446. LOADING: "正在加载",
  13447. PRESENTED_BY_CAPS: "呈现者:",
  13448. POWERED_BY: "技术支持:",
  13449. POWERED_BY_CAPS: "技术支持:",
  13450. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  13451. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  13452. PRESENTED_BY: "呈现者:",
  13453. MORE: "更多 ",
  13454. LESS: "更少 ",
  13455. TAG_CONTENT: "tag™ 内容",
  13456. SHOW: "显示",
  13457. HIDE: "隐藏",
  13458. DOLLHOUSE: "场景屋",
  13459. FLOOR_PLAN: "楼层平面图",
  13460. OPEN_HIGHLIGHTS: "打开精彩片段",
  13461. CLOSE_HIGHLIGHTS: "关闭",
  13462. PREVIOUS: "上一个",
  13463. PLAY: "播放",
  13464. PAUSE: "暂停",
  13465. NEXT: "下一个",
  13466. EXPLORE_3D_SPACE: "探索 3D 空间",
  13467. VIEW_DOLLHOUSE: "观看场景屋",
  13468. SOCIAL_SHARING: "分享这个空间",
  13469. VIEW_IN_VR: "以 VR 观看",
  13470. VIEW_FULLSCREEN: "全屏观看",
  13471. EXIT_FULLSCREEN: " 退出全屏",
  13472. ZOOM_IN: "放大",
  13473. ZOOM_OUT: "缩小",
  13474. FLOOR_NAME: "楼层",
  13475. FLOOR_ALL: "ALL",
  13476. FLOOR_Lang: ["Floor",""],
  13477. TERMS: "条款",
  13478. PORT_TERMS: "port 条款",
  13479. TERMS_OF_USE: "使用条款",
  13480. CLOSE_TERMS: "关闭",
  13481. TERMS_TEXT_FILE: "terms-cn-CN.html",
  13482. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  13483. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  13484. WEBVR_ENTER_WEBVR: "进入 VR",
  13485. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  13486. WEBVR_LEARN_MORE: "了解更多",
  13487. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  13488. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  13489. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  13490. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  13491. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  13492. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  13493. VR_LEARN_MORE_CAPS: "了解更多",
  13494. VR_PREVIOUS_CAPS: "上一个’,",
  13495. VR_NEXT_CAPS: "下一个",
  13496. VR_GOT_IT_CAPS: "明白了",
  13497. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  13498. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  13499. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  13500. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  13501. VR_WHAT_YOU_NEED: "关于...您需要什么",
  13502. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  13503. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  13504. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  13505. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  13506. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13507. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13508. VR_APP: "port VR 应用程序",
  13509. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13510. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13511. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  13512. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  13513. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  13514. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  13515. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  13516. VR_ANDROID_DVICES: "Android 设备",
  13517. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  13518. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  13519. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  13520. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  13521. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  13522. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  13523. VR_DOWNLOAD_HERE: "在此下载",
  13524. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  13525. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  13526. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  13527. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  13528. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  13529. SHARE_TO: "分享到",
  13530. SHARE_LINK: "直接链接",
  13531. SHARE_EXPLORE: "探索",
  13532. SHARE_AT: "在",
  13533. SHARE_WITH: "使用",
  13534. SHARE_3D: "以 3D",
  13535. SHARE_COPIED: "已复制!",
  13536. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  13537. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  13538. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  13539. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  13540. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  13541. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  13542. ERROR_GENERIC_ACTIONS_3: " 或",
  13543. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  13544. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  13545. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  13546. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  13547. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  13548. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  13549. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  13550. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  13551. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  13552. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  13553. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  13554. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  13555. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  13556. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  13557. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  13558. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  13559. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  13560. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  13561. LINK_TO_LOCATION: "地点链接",
  13562. MENU_COPY: "复制",
  13563. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  13564. ROTATE: "旋转",
  13565. MOVE: "移动",
  13566. INSIDE: "内部",
  13567. ZOOM: "缩放",
  13568. HELP: "小帮手",
  13569. HELP_NAVIGATION_TAB: "导航",
  13570. HELP_MORE_HELP_TAB: "更多帮助",
  13571. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  13572. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  13573. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  13574. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  13575. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  13576. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  13577. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  13578. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  13579. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  13580. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  13581. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  13582. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  13583. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  13584. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  13585. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  13586. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  13587. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  13588. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  13589. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  13590. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  13591. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  13592. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  13593. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  13594. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  13595. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  13596. HELP_MORE_HLR_A: "精彩片段集锦",
  13597. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  13598. HELP_MORE_DOLLHOUSE_A: "场景屋",
  13599. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  13600. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  13601. HELP_MORE_FLOORS_A: "楼层选择器",
  13602. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  13603. HELP_MORE_TAG_A: "tag™ 贴文",
  13604. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  13605. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  13606. HELP_MORE_ZOOM_A: "缩放控件",
  13607. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  13608. HELP_MORE_TOUR_A: "导览控件",
  13609. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  13610. HELP_MORE_INSIDE_A: "内部视图",
  13611. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  13612. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  13613. HELP_MORE_VR_A: "VR 模式",
  13614. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  13615. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  13616. HELP_MORE_360_A: "360° 视图",
  13617. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  13618. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  13619. HELP_MORE_FULLSCREEN_A: "全屏",
  13620. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  13621. CLOSE: "关闭"
  13622. }
  13623. }
  13624. , {}],
  13625. 110: [function(e, t, i) {
  13626. "use strict";
  13627. t.exports = {
  13628. PAGE_TITLE: "",
  13629. LOADING: "Lädt",
  13630. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  13631. POWERED_BY: "Angetrieben von",
  13632. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  13633. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13634. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13635. PRESENTED_BY: "Präsentiert von ",
  13636. MORE: "Mehr ",
  13637. LESS: "Weniger ",
  13638. TAG_CONTENT: "tag™ Inhalt",
  13639. SHOW: "Anzeigen",
  13640. HIDE: "Verbergen",
  13641. DOLLHOUSE: "Puppenhaus",
  13642. FLOOR_PLAN: "Grundriss",
  13643. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  13644. CLOSE_HIGHLIGHTS: "Schließen",
  13645. PREVIOUS: "Vorheriges",
  13646. PLAY: "Abspielen",
  13647. PAUSE: "Pausieren",
  13648. NEXT: "Nächstes",
  13649. EXPLORE_3D_SPACE: "Innenraum betreten",
  13650. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  13651. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  13652. VIEW_IN_VR: "In VR ansehen",
  13653. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  13654. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  13655. ZOOM_IN: "Vergrößern",
  13656. ZOOM_OUT: "Verkleinern",
  13657. FLOOR_NAME: "Etage ",
  13658. FLOOR_ALL: "Alle",
  13659. TERMS: "Bedingungen",
  13660. PORT_TERMS: "port Bedingungen",
  13661. TERMS_OF_USE: "Nutzungsbedingungen",
  13662. TERMS_TEXT_FILE: "terms-de-DE.html",
  13663. CLOSE_TERMS: "Schließen",
  13664. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  13665. HELP: "Hilfe",
  13666. HELP_NAVIGATION_TAB: "Navigation",
  13667. HELP_MORE_HELP_TAB: "Hilfe-Details",
  13668. CLOSE: "Schließen",
  13669. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  13670. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  13671. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13672. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  13673. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  13674. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  13675. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  13676. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  13677. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  13678. 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.",
  13679. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13680. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  13681. 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.",
  13682. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  13683. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13684. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  13685. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  13686. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  13687. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  13688. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  13689. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  13690. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  13691. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  13692. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  13693. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  13694. HELP_MORE_HLR_A: "Liste das Highlight",
  13695. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  13696. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  13697. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13698. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13699. HELP_MORE_FLOORS_A: "Etage auswählen",
  13700. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  13701. HELP_MORE_TAG_A: "tag™ Posts",
  13702. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  13703. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  13704. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  13705. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  13706. HELP_MORE_TOUR_A: "Tour Steuerung",
  13707. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  13708. HELP_MORE_INSIDE_A: "Innenansicht",
  13709. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  13710. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  13711. HELP_MORE_VR_A: "VR Modus",
  13712. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  13713. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  13714. HELP_MORE_360_A: "360° Views Ansicht ",
  13715. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13716. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13717. HELP_MORE_FULLSCREEN_A: "Vollbild",
  13718. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  13719. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  13720. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  13721. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  13722. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  13723. WEBVR_LEARN_MORE: "Mehr Infos",
  13724. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13725. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13726. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13727. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  13728. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  13729. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13730. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13731. VR_APP: "port VR App",
  13732. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  13733. 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",
  13734. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  13735. VR_APP_FOR_ANDROID: "port VR app für Android",
  13736. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13737. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13738. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  13739. VR_PREVIOUS_CAPS: "ZURÜCK",
  13740. VR_NEXT_CAPS: "WEITER",
  13741. VR_GOT_IT_CAPS: "VERSTANDEN",
  13742. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  13743. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  13744. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  13745. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  13746. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  13747. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  13748. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13749. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13750. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13751. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  13752. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  13753. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  13754. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13755. VR_ANDROID_DVICES: "Android Geräte",
  13756. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  13757. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  13758. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  13759. VR_DOWNLOAD_HERE: "Hier runterladen",
  13760. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  13761. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  13762. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  13763. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  13764. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13765. SHARE_TO: "Teilen auf",
  13766. SHARE_LINK: "Direkter Link",
  13767. SHARE_EXPLORE: "Umsehen",
  13768. SHARE_AT: "auf",
  13769. SHARE_WITH: "mit",
  13770. SHARE_3D: "in 3D",
  13771. SHARE_COPIED: "Kopiert!",
  13772. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13773. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13774. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13775. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13776. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13777. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13778. ERROR_GENERIC_ACTIONS_3: " oder ",
  13779. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13780. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13781. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13782. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13783. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13784. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13785. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13786. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13787. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13788. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13789. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13790. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13791. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13792. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13793. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13794. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13795. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13796. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13797. LINK_TO_LOCATION: "Link zu",
  13798. MENU_COPY: "Kopieren",
  13799. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13800. ROTATE: "Drehen",
  13801. INSIDE: "Drinnen",
  13802. MOVE: "Bewegen",
  13803. ZOOM: "Vergrößern"
  13804. }
  13805. }
  13806. , {}],
  13807. 111: [function(e, t, i) {
  13808. "use strict";
  13809. t.exports = {
  13810. PAGE_TITLE: "",
  13811. LOADING: "Loading",
  13812. PRESENTED_BY_CAPS: "PRESENTED BY",
  13813. POWERED_BY: "powered by ",
  13814. POWERED_BY_CAPS: "POWERED BY",
  13815. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13816. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13817. PRESENTED_BY: "Presented by ",
  13818. MORE: "More ",
  13819. LESS: "Less ",
  13820. TAG_CONTENT: "tag™ Content",
  13821. SHOW: "Show",
  13822. HIDE: "Hide",
  13823. DOLLHOUSE: "Dollhouse",
  13824. FLOOR_PLAN: "Floor plan",
  13825. OPEN_HIGHLIGHTS: "Open Highlights",
  13826. CLOSE_HIGHLIGHTS: "Close",
  13827. PREVIOUS: "Previous",
  13828. PLAY: "Play",
  13829. PAUSE: "Pause",
  13830. NEXT: "Next",
  13831. EXPLORE_3D_SPACE: "Explore 3D Space",
  13832. VIEW_DOLLHOUSE: "View dollhouse",
  13833. SOCIAL_SHARING: "Share this Space",
  13834. VIEW_IN_VR: "View in VR",
  13835. VIEW_FULLSCREEN: "全屏",
  13836. EXIT_FULLSCREEN: "退出全屏",
  13837. ZOOM_IN: "Zoom in",
  13838. ZOOM_OUT: "Zoom out",
  13839. FLOOR_NAME: "Floor ",
  13840. FLOOR_ALL: "全部",
  13841. TERMS: "Terms",
  13842. PORT_TERMS: "port terms",
  13843. TERMS_OF_USE: "Terms of Use",
  13844. TERMS_TEXT_FILE: "terms-en-US.html",
  13845. CLOSE_TERMS: "Close",
  13846. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13847. HELP: "Help",
  13848. HELP_NAVIGATION_TAB: "Navigation",
  13849. HELP_MORE_HELP_TAB: "More Help",
  13850. CLOSE: "Close",
  13851. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13852. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13853. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13854. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13855. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13856. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13857. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13858. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13859. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13860. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13861. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13862. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13863. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13864. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13865. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13866. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13867. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13868. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13869. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13870. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13871. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13872. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13873. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13874. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13875. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13876. HELP_MORE_HLR_A: "Highlight Reel",
  13877. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13878. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13879. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13880. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13881. HELP_MORE_FLOORS_A: "Floor Selector",
  13882. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13883. HELP_MORE_TAG_A: "tag™ Posts",
  13884. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13885. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13886. HELP_MORE_ZOOM_A: "Zoom Controls",
  13887. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13888. HELP_MORE_TOUR_A: "Tour Controls",
  13889. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13890. HELP_MORE_INSIDE_A: "Inside View",
  13891. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13892. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13893. HELP_MORE_VR_A: "VR Mode",
  13894. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13895. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13896. HELP_MORE_360_A: "360° Views",
  13897. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13898. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13899. HELP_MORE_FULLSCREEN_A: "Full screen",
  13900. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13901. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13902. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13903. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13904. WEBVR_ENTER_WEBVR: "ENTER VR",
  13905. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13906. WEBVR_LEARN_MORE: "Learn more",
  13907. WEBVR_VIEW_SPACE: "View Space in VR",
  13908. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13909. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13910. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13911. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13912. VR_PREVIOUS_CAPS: "PREVIOUS",
  13913. VR_NEXT_CAPS: "NEXT",
  13914. VR_GOT_IT_CAPS: "GOT IT",
  13915. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13916. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13917. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13918. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13919. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13920. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13921. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13922. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13923. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13924. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13925. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13926. VR_APP: "port VR App",
  13927. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13928. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13929. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13930. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13931. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13932. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13933. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13934. VR_ANDROID_DVICES: "Android Devices",
  13935. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13936. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13937. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13938. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13939. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13940. VR_APP_OPEN: "Open with the port VR app instead",
  13941. VR_DOWNLOAD_HERE: "Download here",
  13942. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13943. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13944. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13945. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13946. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13947. SHARE_TO: "Share to",
  13948. SHARE_LINK: "Direct Link",
  13949. SHARE_EXPLORE: "Explore ",
  13950. SHARE_AT: "at",
  13951. SHARE_WITH: "with",
  13952. SHARE_3D: " in 3D",
  13953. SHARE_COPIED: "Copied!",
  13954. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13955. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13956. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13957. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13958. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13959. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13960. ERROR_GENERIC_ACTIONS_3: " or ",
  13961. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13962. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13963. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13964. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13965. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13966. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13967. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13968. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13969. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13970. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13971. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13972. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13973. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13974. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13975. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13976. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13977. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13978. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13979. LINK_TO_LOCATION: "Link to location",
  13980. MENU_COPY: "Copy",
  13981. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13982. ROTATE: "Rotate",
  13983. INSIDE: "Inside",
  13984. MOVE: "Move",
  13985. ZOOM: "Zoom"
  13986. }
  13987. }
  13988. , {}],
  13989. 112: [function(e, t, i) {
  13990. "use strict";
  13991. t.exports = {
  13992. PAGE_TITLE: "",
  13993. LOADING: "Cargando",
  13994. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13995. POWERED_BY: "potenciando por ",
  13996. POWERED_BY_CAPS: "POTENCIADO POR ",
  13997. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13998. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13999. PRESENTED_BY: "Presentado por ",
  14000. MORE: "Más ",
  14001. LESS: "Menos ",
  14002. TAG_CONTENT: "Contenido de tag™",
  14003. SHOW: "Mostrar",
  14004. HIDE: "Ocultar",
  14005. DOLLHOUSE: "Dollhouse",
  14006. FLOOR_PLAN: "Planos",
  14007. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  14008. CLOSE_HIGHLIGHTS: "Cerrar",
  14009. PREVIOUS: "Anterior",
  14010. PLAY: "Play",
  14011. PAUSE: "Pausa",
  14012. NEXT: "Siguiente",
  14013. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  14014. VIEW_DOLLHOUSE: "Ver dollhouse",
  14015. SOCIAL_SHARING: "Compartir este espacio",
  14016. VIEW_IN_VR: "Ver en realidad virtual",
  14017. VIEW_FULLSCREEN: "Ver en pantalla completa",
  14018. EXIT_FULLSCREEN: "Salir de pantalla completa",
  14019. ZOOM_IN: "Acercar",
  14020. ZOOM_OUT: "Alejar",
  14021. FLOOR_NAME: "Piso ",
  14022. FLOOR_ALL: "Todas",
  14023. TERMS: "Condiciones",
  14024. PORT_TERMS: "port términos de uso",
  14025. TERMS_OF_USE: "Términos de uso",
  14026. TERMS_TEXT_FILE: "terms-es-MX.html",
  14027. CLOSE_TERMS: "Cerrar",
  14028. 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.",
  14029. HELP: "Ayuda",
  14030. HELP_NAVIGATION_TAB: "Navegación",
  14031. HELP_MORE_HELP_TAB: "Más Ayuda",
  14032. CLOSE: "Cerrar",
  14033. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  14034. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  14035. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  14036. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  14037. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  14038. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  14039. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  14040. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  14041. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  14042. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  14043. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  14044. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  14045. 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.",
  14046. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  14047. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  14048. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  14049. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  14050. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  14051. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  14052. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  14053. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  14054. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  14055. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  14056. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  14057. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  14058. HELP_MORE_HLR_A: "Galería destacada",
  14059. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  14060. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  14061. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  14062. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  14063. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  14064. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  14065. HELP_MORE_TAG_A: "tag™ Posts",
  14066. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  14067. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  14068. HELP_MORE_ZOOM_A: "Controles de zoom",
  14069. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  14070. HELP_MORE_TOUR_A: "Controles de recorrido",
  14071. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  14072. HELP_MORE_INSIDE_A: "Vista interior",
  14073. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  14074. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  14075. HELP_MORE_VR_A: "Modo de realidad virtual",
  14076. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  14077. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  14078. HELP_MORE_360_A: "360° Views",
  14079. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  14080. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  14081. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  14082. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  14083. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  14084. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  14085. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  14086. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  14087. WEBVR_LEARN_MORE: "Más información",
  14088. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  14089. WEBVR_DAYDREAM_VIEW: "Daydream View",
  14090. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  14091. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  14092. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  14093. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  14094. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  14095. VR_APP: "port VR App",
  14096. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  14097. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  14098. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  14099. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  14100. VR_LEARN_MORE_CAPS: "SABER MÁS",
  14101. VR_PREVIOUS_CAPS: "ANTERIOR",
  14102. VR_NEXT_CAPS: "SIGUIENTE",
  14103. VR_GOT_IT_CAPS: "COMPRENDIDO",
  14104. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  14105. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  14106. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  14107. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  14108. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  14109. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  14110. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  14111. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14112. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14113. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14114. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  14115. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  14116. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  14117. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  14118. VR_ANDROID_DVICES: "Dispositivos Android",
  14119. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  14120. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  14121. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  14122. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  14123. VR_DOWNLOAD_HERE: "Descargar aquí",
  14124. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  14125. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  14126. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  14127. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  14128. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  14129. SHARE_TO: "Compartir en",
  14130. SHARE_LINK: "Enlace directo",
  14131. SHARE_EXPLORE: "Explorar ",
  14132. SHARE_AT: "en",
  14133. SHARE_WITH: "con",
  14134. SHARE_3D: " en 3D",
  14135. SHARE_COPIED: "¡Copiado!",
  14136. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  14137. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  14138. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  14139. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  14140. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  14141. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  14142. ERROR_GENERIC_ACTIONS_3: " o ",
  14143. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  14144. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  14145. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  14146. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  14147. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  14148. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  14149. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  14150. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  14151. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  14152. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  14153. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  14154. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  14155. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  14156. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  14157. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  14158. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  14159. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  14160. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  14161. LINK_TO_LOCATION: "Enlace a la ubicación",
  14162. MENU_COPY: "Copiar",
  14163. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  14164. ROTATE: "Girar",
  14165. INSIDE: "Interior",
  14166. MOVE: "Moverse",
  14167. ZOOM: "Acercar o alejar"
  14168. }
  14169. }
  14170. , {}],
  14171. 113: [function(e, t, i) {
  14172. "use strict";
  14173. t.exports = {
  14174. PAGE_TITLE: "",
  14175. LOADING: "Chargement",
  14176. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  14177. POWERED_BY: "alimenté par ",
  14178. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  14179. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  14180. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  14181. PRESENTED_BY: "Présenté par ",
  14182. MORE: "Plus ",
  14183. LESS: "Moins ",
  14184. TAG_CONTENT: "Contenu tag™",
  14185. SHOW: "Montrer",
  14186. HIDE: "Cacher",
  14187. DOLLHOUSE: "Dollhouse",
  14188. FLOOR_PLAN: "Plan de sol",
  14189. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  14190. CLOSE_HIGHLIGHTS: "Fermer",
  14191. PREVIOUS: "Précédent",
  14192. PLAY: "Lecture",
  14193. PAUSE: "Pause",
  14194. NEXT: "Suivant",
  14195. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  14196. VIEW_DOLLHOUSE: "Voir dollhouse",
  14197. SOCIAL_SHARING: "Partager cet espace",
  14198. VIEW_IN_VR: "Voir en VR",
  14199. VIEW_FULLSCREEN: "Plein écran",
  14200. EXIT_FULLSCREEN: "Fermer plein écran",
  14201. ZOOM_IN: "Zoom avant",
  14202. ZOOM_OUT: "Zoom arrière",
  14203. FLOOR_NAME: "Étage ",
  14204. FLOOR_ALL: "Tous",
  14205. TERMS: "Mentions légales",
  14206. PORT_TERMS: "port mentions légales",
  14207. TERMS_OF_USE: "Conditions d'utilisation",
  14208. TERMS_TEXT_FILE: "terms-fr-FR.html",
  14209. CLOSE_TERMS: "Fermer",
  14210. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  14211. HELP: "Aide",
  14212. HELP_NAVIGATION_TAB: "Navigation",
  14213. HELP_MORE_HELP_TAB: "Aide",
  14214. CLOSE: "Fermer",
  14215. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  14216. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  14217. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  14218. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  14219. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  14220. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  14221. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  14222. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  14223. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  14224. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  14225. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  14226. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  14227. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  14228. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  14229. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  14230. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  14231. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  14232. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  14233. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  14234. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  14235. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  14236. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  14237. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  14238. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  14239. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  14240. HELP_MORE_HLR_A: "Carrousel",
  14241. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  14242. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  14243. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  14244. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  14245. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  14246. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  14247. HELP_MORE_TAG_A: "tag™ Posts",
  14248. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  14249. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  14250. HELP_MORE_ZOOM_A: "Commandes de zoom",
  14251. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  14252. HELP_MORE_TOUR_A: "Commandes de la visite",
  14253. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  14254. HELP_MORE_INSIDE_A: "Vue intérieure",
  14255. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  14256. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  14257. HELP_MORE_VR_A: "Mode RV",
  14258. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  14259. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  14260. HELP_MORE_360_A: "Vues 360°",
  14261. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  14262. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  14263. HELP_MORE_FULLSCREEN_A: "Plein écran",
  14264. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  14265. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  14266. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  14267. WEBVR_ENTER_WEBVR: "ENTRER VR",
  14268. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  14269. WEBVR_LEARN_MORE: "En savoir plus",
  14270. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  14271. WEBVR_DAYDREAM_VIEW: "Daydream View",
  14272. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  14273. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  14274. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  14275. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  14276. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  14277. VR_NEXT_CAPS: "SUIVANT",
  14278. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  14279. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  14280. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  14281. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  14282. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  14283. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  14284. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  14285. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  14286. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  14287. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  14288. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14289. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14290. VR_APP: "port VR App",
  14291. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14292. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14293. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  14294. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  14295. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  14296. 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",
  14297. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  14298. VR_ANDROID_DVICES: "Appareils Android",
  14299. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  14300. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  14301. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  14302. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  14303. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  14304. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  14305. VR_DOWNLOAD_HERE: "Télécharger ici",
  14306. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  14307. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  14308. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  14309. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  14310. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  14311. SHARE_TO: "Partager sur",
  14312. SHARE_LINK: "Lien direct",
  14313. SHARE_EXPLORE: "Explorer ",
  14314. SHARE_AT: "à",
  14315. SHARE_WITH: "avec",
  14316. SHARE_3D: " en 3D",
  14317. SHARE_COPIED: "Copié!",
  14318. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  14319. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  14320. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  14321. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  14322. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  14323. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  14324. ERROR_GENERIC_ACTIONS_3: " ou ",
  14325. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  14326. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  14327. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  14328. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  14329. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  14330. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  14331. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  14332. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  14333. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  14334. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  14335. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  14336. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  14337. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  14338. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  14339. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  14340. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  14341. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  14342. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  14343. LINK_TO_LOCATION: "Lien vers l'emplacement",
  14344. MENU_COPY: "Copie",
  14345. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  14346. ROTATE: "Faire pivoter",
  14347. INSIDE: "Intérieure",
  14348. MOVE: "Se déplacer",
  14349. ZOOM: "Zoom"
  14350. }
  14351. }
  14352. , {}],
  14353. 114: [function(e, t, i) {
  14354. "use strict";
  14355. t.exports = {
  14356. PAGE_TITLE: "",
  14357. LOADING: "読み込み中",
  14358. PRESENTED_BY_CAPS: "PRESENTED BY",
  14359. POWERED_BY: "powered by",
  14360. POWERED_BY_CAPS: "POWERED BY",
  14361. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  14362. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  14363. PRESENTED_BY: "Presented by ",
  14364. MORE: "全て表示 ",
  14365. LESS: "閉じる ",
  14366. TAG_CONTENT: "tag™コンテンツ ",
  14367. SHOW: "表示",
  14368. HIDE: "非表示",
  14369. DOLLHOUSE: "ドールハウス",
  14370. FLOOR_PLAN: "フロアプラン",
  14371. OPEN_HIGHLIGHTS: "ハイライトを開く",
  14372. CLOSE_HIGHLIGHTS: "閉じる",
  14373. PREVIOUS: "前へ",
  14374. PLAY: "再生",
  14375. PAUSE: "一時停止",
  14376. NEXT: "次へ",
  14377. EXPLORE_3D_SPACE: "3DSpaceの探索",
  14378. VIEW_DOLLHOUSE: "ドールハウスの表示",
  14379. SOCIAL_SHARING: "このSpaceを共有する",
  14380. VIEW_IN_VR: "VRで表示",
  14381. VIEW_FULLSCREEN: "フルスクリーン表示",
  14382. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  14383. ZOOM_IN: "ズームイン",
  14384. ZOOM_OUT: "ズームアウト",
  14385. FLOOR_NAME: "フロア ",
  14386. FLOOR_ALL: "すべて",
  14387. TERMS: "規約",
  14388. PORT_TERMS: "port規約",
  14389. TERMS_OF_USE: "利用規約",
  14390. CLOSE_TERMS: "閉じる",
  14391. TERMS_TEXT_FILE: "terms-jp-JP.html",
  14392. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  14393. WEBVR_FOR_DAYDREAM: "Daydream View用",
  14394. WEBVR_ENTER_WEBVR: "VRに入る",
  14395. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  14396. WEBVR_LEARN_MORE: "もっと詳しく",
  14397. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  14398. WEBVR_DAYDREAM_VIEW: "Daydream View",
  14399. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  14400. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  14401. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  14402. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  14403. VR_LEARN_MORE_CAPS: "もっと詳しく",
  14404. VR_PREVIOUS_CAPS: "前へ",
  14405. VR_NEXT_CAPS: "次へ",
  14406. VR_GOT_IT_CAPS: "了解",
  14407. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  14408. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  14409. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  14410. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  14411. VR_WHAT_YOU_NEED: "必要なもの",
  14412. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  14413. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  14414. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  14415. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  14416. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14417. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14418. VR_APP: "port VRアプリ",
  14419. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14420. VR_COMPATIBLE_IPHONES_1: "iPhone",
  14421. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  14422. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  14423. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  14424. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  14425. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  14426. VR_ANDROID_DVICES: "Androidデバイス",
  14427. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  14428. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  14429. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  14430. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  14431. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  14432. VR_APP_OPEN: "port VRアプリで開く",
  14433. VR_DOWNLOAD_HERE: "ここからダウンロード",
  14434. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  14435. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  14436. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  14437. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  14438. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  14439. SHARE_TO: "共有先",
  14440. SHARE_LINK: "ダイレクトリンク",
  14441. SHARE_EXPLORE: "探索",
  14442. SHARE_AT: "場所",
  14443. SHARE_WITH: "使用アプリ",
  14444. SHARE_3D: "3Dで",
  14445. SHARE_COPIED: "コピーされました!",
  14446. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  14447. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  14448. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  14449. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  14450. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  14451. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  14452. ERROR_GENERIC_ACTIONS_3: "または",
  14453. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  14454. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  14455. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  14456. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  14457. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  14458. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  14459. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  14460. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  14461. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  14462. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  14463. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  14464. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  14465. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  14466. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  14467. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  14468. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  14469. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  14470. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  14471. LINK_TO_LOCATION: "ロケーションへのリンク",
  14472. MENU_COPY: "コピー",
  14473. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  14474. ROTATE: "回転",
  14475. MOVE: "移動",
  14476. INSIDE: "内側",
  14477. ZOOM: "ズーム",
  14478. HELP: "ヘルプ",
  14479. HELP_NAVIGATION_TAB: "ナビゲーション",
  14480. HELP_MORE_HELP_TAB: "その他のヘルプ",
  14481. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  14482. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  14483. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14484. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  14485. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  14486. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  14487. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  14488. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  14489. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  14490. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  14491. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14492. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  14493. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  14494. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  14495. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14496. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  14497. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  14498. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  14499. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  14500. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  14501. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  14502. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  14503. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  14504. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  14505. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  14506. HELP_MORE_HLR_A: "ハイライト",
  14507. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  14508. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  14509. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  14510. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  14511. HELP_MORE_FLOORS_A: "フロアセレクター",
  14512. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  14513. HELP_MORE_TAG_A: "tag™ Posts",
  14514. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  14515. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  14516. HELP_MORE_ZOOM_A: "ズームコントロール",
  14517. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  14518. HELP_MORE_TOUR_A: "ツアーコントロール",
  14519. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  14520. HELP_MORE_INSIDE_A: "内側ビュー",
  14521. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  14522. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  14523. HELP_MORE_VR_A: "VRモード",
  14524. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  14525. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  14526. HELP_MORE_360_A: "360° Views",
  14527. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  14528. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  14529. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  14530. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  14531. CLOSE: "閉じる"
  14532. }
  14533. }
  14534. , {}],
  14535. 115: [function(e, t, i) {
  14536. "use strict";
  14537. t.exports = {
  14538. PAGE_TITLE: "",
  14539. LOADING: "Загрузка",
  14540. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  14541. POWERED_BY: "разработано на платформе ",
  14542. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  14543. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  14544. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  14545. PRESENTED_BY: "Представлено ",
  14546. MORE: "Больше ",
  14547. LESS: "Меньше ",
  14548. TAG_CONTENT: "tag™ Контент",
  14549. SHOW: "Показать",
  14550. HIDE: "Скрыть",
  14551. DOLLHOUSE: "Dollhouse",
  14552. FLOOR_PLAN: "Планировка",
  14553. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  14554. CLOSE_HIGHLIGHTS: "Закрыть",
  14555. PREVIOUS: "Предыдущий",
  14556. PLAY: "Воспроизвести",
  14557. PAUSE: "Пауза",
  14558. NEXT: "Следующий",
  14559. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  14560. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  14561. SOCIAL_SHARING: "Поделиться этой моделью",
  14562. VIEW_IN_VR: "Посмотреть в VR",
  14563. VIEW_FULLSCREEN: "Полный экран",
  14564. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  14565. ZOOM_IN: "Увеличить",
  14566. ZOOM_OUT: "Уменьшить",
  14567. FLOOR_NAME: "Этаж ",
  14568. FLOOR_ALL: "Все",
  14569. TERMS: "Условия",
  14570. PORT_TERMS: "Правила пользования",
  14571. TERMS_OF_USE: "Условия использования",
  14572. TERMS_TEXT_FILE: "terms-ru-RU.html",
  14573. CLOSE_TERMS: "Закрыть",
  14574. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  14575. HELP: "Помощь",
  14576. HELP_NAVIGATION_TAB: "Навигация",
  14577. HELP_MORE_HELP_TAB: "Доп. Помощь",
  14578. CLOSE: "Закрыть",
  14579. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  14580. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  14581. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  14582. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  14583. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  14584. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  14585. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14586. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  14587. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  14588. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  14589. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14590. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  14591. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  14592. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  14593. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14594. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  14595. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  14596. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  14597. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  14598. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  14599. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14600. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  14601. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  14602. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  14603. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  14604. HELP_MORE_HLR_A: "Фотоколлаж",
  14605. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  14606. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  14607. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14608. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14609. HELP_MORE_FLOORS_A: "Выбор Этажа",
  14610. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  14611. HELP_MORE_TAG_A: "tag™ Posts",
  14612. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  14613. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  14614. HELP_MORE_ZOOM_A: "Масштаб",
  14615. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  14616. HELP_MORE_TOUR_A: "Управление Туром",
  14617. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  14618. HELP_MORE_INSIDE_A: "Вид Изнутри",
  14619. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14620. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14621. HELP_MORE_VR_A: "Режим VR",
  14622. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14623. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14624. HELP_MORE_360_A: "360° Views",
  14625. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14626. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14627. HELP_MORE_FULLSCREEN_A: "Полный экран",
  14628. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  14629. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  14630. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  14631. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  14632. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  14633. WEBVR_LEARN_MORE: "Узнать больше",
  14634. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  14635. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  14636. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14637. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  14638. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  14639. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14640. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14641. VR_APP: "port VR App",
  14642. VR_APP_OPEN: "Или открыть через приложение port VR",
  14643. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  14644. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  14645. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  14646. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  14647. VR_VIEW_SPACE: "Запустить модель в VR",
  14648. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  14649. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  14650. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  14651. VR_GOT_IT_CAPS: "ЯСНО",
  14652. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  14653. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  14654. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  14655. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  14656. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  14657. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  14658. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14659. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14660. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14661. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  14662. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  14663. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  14664. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  14665. VR_ANDROID_DVICES: "Android устройства",
  14666. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  14667. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  14668. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  14669. VR_DOWNLOAD_HERE: "Скачать здесь",
  14670. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  14671. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  14672. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  14673. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  14674. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  14675. SHARE_TO: "Поделиться",
  14676. SHARE_LINK: "Прямая ссылка",
  14677. SHARE_EXPLORE: "просмотреть",
  14678. SHARE_AT: "на",
  14679. SHARE_WITH: "с",
  14680. SHARE_3D: "в 3D",
  14681. SHARE_COPIED: "Скопировано!",
  14682. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  14683. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  14684. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  14685. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  14686. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  14687. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  14688. ERROR_GENERIC_ACTIONS_3: " или ",
  14689. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  14690. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  14691. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  14692. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  14693. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  14694. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  14695. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  14696. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  14697. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  14698. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  14699. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  14700. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  14701. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  14702. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  14703. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  14704. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  14705. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  14706. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  14707. LINK_TO_LOCATION: "Ссылка на местоположение",
  14708. MENU_COPY: "Копировать",
  14709. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  14710. ROTATE: "Вращать",
  14711. MOVE: "Передвигаться",
  14712. INSIDE: "Вид изнутри",
  14713. ZOOM: "Масштаб"
  14714. }
  14715. }
  14716. , {}],
  14717. 116: [function(e, t, i) {//main.js
  14718. (function(t) {
  14719. "use strict";
  14720. var modelProgressBase = 0.4;
  14721. var progressUpdate = function(e){ // 0 <= e <= 1
  14722. console.log('e1:'+e)
  14723. e = Math.round(modelProgressBase * e * 100);
  14724. console.log('e2:'+e)
  14725. var t = $('.progressbar');
  14726. t.find('.bar').css('width',e+'%');
  14727. t.find('.label').css('left', t.width() * e / 100 - 15 + 'px' ); //上面跟着的字的百分比
  14728. t.find('.perc').text(e +'%'); //具体数字的百分比
  14729. }
  14730. $('#gui-loading').fadeIn(200);
  14731. progressUpdate(0.1)
  14732. var fileName = g_version ? 'modeldata.js' : 'someData.json' ;
  14733. $.ajax(g_Prefix + "data/"+window.number+"/"+fileName+"?"+randomTime().getTime(),{dataType: "json"}).done( function(e){ //改
  14734. var data = matcher(e);
  14735. data.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}",window.number);
  14736. data.user = {
  14737. "is_authenticated": false,
  14738. "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"]
  14739. }
  14740. try{//处理一下导览数据
  14741. data.model.images = data.model.images.filter(e=>{
  14742. if(!e.locations && !e.thumbnail_signed_src)return; //旧的曾有导览数据是错误的,将它删除
  14743. if(e.locations && e.locations.length == 0)return;
  14744. return e
  14745. })
  14746. }catch(e){console.log(e) }
  14747. window.MP_PREFETCHED_MODELDATA = data;
  14748. data.model.summary = data.summary
  14749. data.model.name = data.name
  14750. for(let i in data){
  14751. data[i] == "false" && (data[i] = false)
  14752. }
  14753. progressUpdate(0.7);
  14754. StartLoad(); //xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  14755. if(data.weixinDesc){
  14756. g_weixinObj.desc = data.weixinDesc;
  14757. }
  14758. if(data.shareImgUrl){
  14759. g_weixinObj.imgUrl = data.shareImgUrl
  14760. }
  14761. window.wx && manage.weixinShare();
  14762. //初始画面
  14763. data.camera_start && data.camera_start.thumbImg && E(data.camera_start.thumbImg)
  14764. function E(e) {
  14765. $("<img/>").attr("src", e).on("load", function() {
  14766. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  14767. $(this).remove()
  14768. })
  14769. }
  14770. })
  14771. function StartLoad(){//当加载完data后
  14772. function i() {
  14773. var e = Y.getModelIDFromQueryString();
  14774. if (!e)
  14775. return b(null, "loading-failed");
  14776. var t = Y.parseSidUrl(e)
  14777. , i = l()
  14778. , a = c()
  14779. , s = o()
  14780. , u = V.quickstart.enabled
  14781. , g = null
  14782. , m = null
  14783. , v = null
  14784. , w = null
  14785. , T = null
  14786. , x = null
  14787. , S = null
  14788. , M = null
  14789. , R = null
  14790. , P = null
  14791. , O = null
  14792. , L = null
  14793. , N = new ue;
  14794. r(s);
  14795. h({ //MP开头写法
  14796. urlBase: t.urlBase
  14797. }).then(function() {
  14798. return re.init(),
  14799. d(t, e) //getModel and load
  14800. }).then(function(e) {
  14801. progressUpdate(0.9)
  14802. return P = e,
  14803. p(P, V.appConfig.segment_key, V.appConfig.keen_write_key, V.appConfig.keen_project_id, {
  14804. startSource: i,
  14805. autoplay: V.autoplay,
  14806. quickstart: u
  14807. }),
  14808. P.urls.init()
  14809. }).then(function() {
  14810. return P.loadPanos()
  14811. }).then(function() {
  14812. m = X.getStartCameraOptions(P, P.panos),
  14813. S = A(P),
  14814. O = y(u, m.mode),
  14815. v = O.controls,
  14816. w = O.player,
  14817. T = O.director,
  14818. x = O.tagManager,
  14819. M = O.tileDownloader,
  14820. R = O.qualityManager,
  14821. L = O.panoRenderer,
  14822. C(P, S, O, s),
  14823. w.director = T,//xzw add
  14824. P.supportsTiles && M.start(),
  14825. !u || m.mode === D.PANORAMA && m.pano || (de.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14826. u = !1);
  14827. var e = null;
  14828. if (u) {
  14829. de.warn("Quickstart engaged. Hold on to your knickers.");
  14830. var t = v.controls[D.PANORAMA];
  14831. g = new ie(R,S.scene,S.camera,t,s),
  14832. _(S, s, P),
  14833. e = g.load(m).then(function() {
  14834. S.addComponent(g),
  14835. S.once(le.AfterRender, function() {
  14836. de.warn("First render after quickstart load finished.")
  14837. })
  14838. })
  14839. }
  14840. window.flyToFirst = function(){//xzw add
  14841. var pano = w.model.panos.get("8d778e19657f433fb9cf8947d823bb70");
  14842. var q = new _x.Quaternion(0.7099827027821568,-0.07708150183830938,0.6958985789714591,0.07555241737970636);
  14843. var lookAtPoint = new _x.Vector3(0,0,-1).applyQuaternion(q).add(pano.position);
  14844. w.flyToPano({pano:pano, lookAtPoint:lookAtPoint})
  14845. };
  14846. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N))
  14847. }).then(function() {
  14848. return f(P, U.onProgress, i, !u, a)
  14849. }).then(function() {
  14850. if (m.quickstart = u,
  14851. I(P, S, O, s),
  14852. S.started || _(S, s, P),
  14853. H.modelLoaded(P, w, v, V.autoplay),
  14854. E(w, P, m, V.autoplay).done(function() {
  14855. T.autoTour()
  14856. }),
  14857. !P.supportsTiles) {
  14858. var e = new Z(P,w);
  14859. e.start()
  14860. }
  14861. u && (S.removeComponent(g),
  14862. g.destroy(),
  14863. m.pano.enter()),
  14864. U.init(P, T, w, v, S, m, H.getSessionId()),
  14865. U.endLoading(P, T, x),
  14866. S.once(le.AfterRender, function() {
  14867. N.setAppReadyTime();
  14868. var e = N.calcFullLoadingTime();
  14869. de.warn("Total load time: " + e / 1e3),
  14870. H.loadComplete(e),
  14871. de.warn("First render after model load finished.")
  14872. }),
  14873. S.on(le.MemoryUsageUpdated, n)
  14874. }).fail(b.bind(this, e))
  14875. }
  14876. function n(e) {
  14877. ce.update(e)
  14878. }
  14879. function r(e) {
  14880. de.info("Version", "2.25.6-0-gd87e5b1"),
  14881. q.defaultMaxListeners = 1e3,
  14882. a(e),
  14883. s()
  14884. }
  14885. function o() {
  14886. return document.getElementById("player")
  14887. }
  14888. function a(e) {
  14889. e.addEventListener("dragenter", T, !1),
  14890. e.addEventListener("dragover", T, !1)
  14891. }
  14892. function s() {
  14893. F.valueFromHash("title", !0) || $(document).ready(function() {
  14894. var e = $(".model-title");
  14895. e.hide()
  14896. })
  14897. }
  14898. function l() {
  14899. return F.valueFromHash("play", !1) ? "autoplay" : F.inIframe() ? "click" : "fullpage"
  14900. }
  14901. function c() {
  14902. return {
  14903. panoElementsToLoad: 6,
  14904. modelElementsToLoad: 0,
  14905. totalElementsLoaded: 0,
  14906. totalElementsToLoad: 0,
  14907. totalPercentageLoaded: 0,
  14908. progressCallback: null
  14909. }
  14910. }
  14911. function h(e) {
  14912. return K.loadFeatureFlags(e).done(function(e) {
  14913. K.updateDependentSettings(e, V)
  14914. })
  14915. }
  14916. // function u(e) {
  14917. // return Q.get(e.urlBase + "/api/v1/config/showcase", {
  14918. // responseType: "json",
  14919. // prefetchFrom: "config"
  14920. // }).then(function(e) {
  14921. // return e ? void j.extendObject(V.appConfig, e) : {}
  14922. // }, function(e) {
  14923. // return de.warn("Failed loading runtime config, using defaults."),
  14924. // $.when({})
  14925. // })
  14926. // }
  14927. function d(e, t) {
  14928. var i = B.getModel({
  14929. url: t,
  14930. floors: F.valueFromHash("f", !0),
  14931. autoload: !1
  14932. })
  14933. ;
  14934. return $.when(i, n).then(null, function(e) {
  14935. return this
  14936. })
  14937. }
  14938. function p(e, t, i, n, r) {
  14939. de.info("Model data loaded"),
  14940. de.debug("UUID: " + e.data.job.uuid),
  14941. J.init(K.getFlags()),
  14942. i && H.initKeen({
  14943. token: i,
  14944. appId: n
  14945. }),
  14946. H.initSegment({
  14947. model: e.sid,
  14948. version: "2.25.6-0-gd87e5b1",
  14949. startSource: r.startSource,
  14950. token: t,
  14951. autoplay: r.autoplay,
  14952. quickstart: r.quickstart
  14953. })
  14954. }
  14955. function f(e, t, i, n, r) {
  14956. return r.progressCallback = t,
  14957. H.sessionStart(),
  14958. e.load(n).progress(g.bind(this, r))
  14959. }
  14960. function g(e, t) {
  14961. e.modelElementsToLoad = t[1],
  14962. v(e),
  14963. m(e)
  14964. }
  14965. function m(e) {
  14966. e.totalElementsLoaded++,
  14967. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14968. //----许钟文-----------------模型进度条向后调整
  14969. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0);
  14970. e.totalPercentageLoaded = modelProgressBase + (1-modelProgressBase)*e.totalPercentageLoaded;
  14971. console.log('pro:'+e.totalPercentageLoaded)
  14972. //---------------------------
  14973. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14974. }
  14975. function v(e) {
  14976. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14977. }
  14978. function A(e) {
  14979. var t = new x.PerspectiveCamera;
  14980. t.layers.enable(he.PANOMARKERS),
  14981. t.layers.enable(he.RETICULE),
  14982. t.layers.enable(he.TAG);
  14983. var i = new x.Scene
  14984. , n = new x.AmbientLight(16777215);
  14985. i.add(n),
  14986. // i.skybox = new W,
  14987. // i.add(i.skybox),
  14988. i.plane = new x.Mesh(new x.PlaneBufferGeometry(1e5,1e5),new x.RawShaderMaterial({
  14989. side: x.DoubleSide
  14990. })),
  14991. i.plane.position.y = 0,
  14992. i.plane.rotateX(-Math.PI / 2),
  14993. i.plane.material.visible = !1,
  14994. i.add(i.plane),
  14995. i.updateMatrixWorld(),
  14996. V.showScreenshotLocations && e.data.images.forEach(function(e) {
  14997. if (e.metadata && e.metadata.camera_position) {
  14998. var t = e.metadata.camera_position
  14999. , n = new x.Mesh(new x.BoxGeometry(.3,.3,.3));
  15000. n.position = t.clone(),
  15001. i.add(n);
  15002. var r = e.metadata.camera_quaternion
  15003. , o = new x.Vector3(0,0,-1).applyQuaternion(r);
  15004. i.add(new x.ArrowHelper(o,t.clone(),1,16711680))
  15005. }
  15006. }),
  15007. V.showAxis && (i.add(new x.ArrowHelper(new x.Vector3(0,1,0),new x.Vector3(0,0,0),1,255)),
  15008. i.add(new x.ArrowHelper(new x.Vector3(0,0,1),new x.Vector3(0,0,0),1,16711680)),
  15009. i.add(new x.ArrowHelper(new x.Vector3(1,0,0),new x.Vector3(0,0,0),1,65280)));
  15010. var r = new te(i,t,z);
  15011. return r
  15012. }
  15013. function y(e, t) {
  15014. var i = e ? 1 : 1e3
  15015. , n = J.tilegen || J.imgopt ? 6 : 2;
  15016. n = F.valueFromHash("tileconc", n);
  15017. var r = new ne
  15018. , o = new ae({
  15019. concurrentDownloads: n
  15020. })
  15021. , a = new se
  15022. , s = new P
  15023. , l = new M
  15024. , c = new S(t)
  15025. , h = new R
  15026. , u = new O(i)
  15027. , d = new L
  15028. , p = new oe;
  15029. return {
  15030. qualityManager: r,
  15031. panoRenderer: a,
  15032. tileDownloader: o,
  15033. player: c,
  15034. director: l,
  15035. modelManager: s,
  15036. tagManager: p,
  15037. displayController: u,
  15038. labelDisplayController: d,
  15039. controls: h
  15040. }
  15041. }
  15042. function C(e, t, i, n) {
  15043. var r = i.controls
  15044. , o = i.qualityManager
  15045. , a = i.panoRenderer
  15046. , s = i.tileDownloader
  15047. , l = i.modelManager;
  15048. r.init(n, l),
  15049. ee.init(i.director, r, i.player, l, t),
  15050. o.init(l),
  15051. s.init(o),
  15052. a.init(t, s, o),
  15053. l.init(s, a, o),
  15054. l.addModel(e),
  15055. t.addComponent(G)
  15056. }
  15057. function I(e, t, i, n) {
  15058. var r = i.qualityManager
  15059. , o = i.panoRenderer
  15060. , a = i.tileDownloader
  15061. , s = i.modelManager
  15062. , l = i.player
  15063. , c = i.director
  15064. , h = i.tagManager
  15065. , u = i.displayController
  15066. , d = i.labelDisplayController
  15067. , p = i.controls;
  15068. t.scene.add(e),
  15069. t.qualityManager = r;
  15070. var f = {
  15071. camera: t.camera,
  15072. director: c,
  15073. modelManager: s,
  15074. tileDownloader: a,
  15075. panoRenderer: o,
  15076. qualityManager: r,
  15077. tagManager: h,
  15078. container: n,
  15079. controls: p
  15080. };
  15081. l.init(f),
  15082. l.setScene(t.scene),
  15083. h.init(s, l),
  15084. c.init(l, s),
  15085. u.init(c, l, s, h, n),
  15086. d.init(l, s, n),
  15087. z.bindEvents(l),
  15088. t.addComponent(h),
  15089. t.addComponent(l),
  15090. t.addComponent(o),
  15091. l.sceneRenderer = t; //xzw add 方便resize
  15092. }
  15093. function E(e, t, i, n) {
  15094. return de.info("Starting player in " + i.mode),
  15095. H.report(t.sid, "started-playing", n, i.quickstart),
  15096. e.start(i)
  15097. }
  15098. function b(e, t) {
  15099. de.error(t),
  15100. k.error(t),
  15101. H.report(e, "error-" + t)
  15102. }
  15103. function w(e) {
  15104. var t = F.details();
  15105. t && "Safari" === t.name && t.version > 500 && t.version < 600 ? (k.error("webgl-safari"),
  15106. H.report(e, "error-webgl-safari")) : (k.error("webgl-generic"),
  15107. H.report(e, "error-webgl-generic"))
  15108. }
  15109. function _(e, t, i) {
  15110. try {
  15111. e.start(t)
  15112. } catch (e) {
  15113. throw de.warn(e.message),
  15114. w(i.sid),
  15115. e
  15116. }
  15117. }
  15118. function T(e) {
  15119. e.stopPropagation(),
  15120. e.preventDefault()
  15121. }
  15122. //czj 判断someData 有没有hoticon字段 修改热点的样式
  15123. if (window.MP_PREFETCHED_MODELDATA.hoticon){
  15124. g_HotImage = {
  15125. point: window.MP_PREFETCHED_MODELDATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  15126. point2: window.MP_PREFETCHED_MODELDATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  15127. } ;
  15128. }
  15129. //czj 判断someData 有没有backgroundMusic 添加音乐
  15130. if (window.MP_PREFETCHED_MODELDATA.backgroundMusic) {
  15131. if(window.isLocal) g_bgAudio.src = manage.dealURL(window.MP_PREFETCHED_MODELDATA.backgroundMusic) ;
  15132. //else g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic.substr(0,4)=="http" ? window.MP_PREFETCHED_MODELDATA.backgroundMusic : "//" + window.MP_PREFETCHED_MODELDATA.backgroundMusic;
  15133. else g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic
  15134. $("#volume").show();
  15135. }else if (g_version === "one"){
  15136. g_bgAudio.src = g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3";
  15137. //g_bgAudio.src = manage.dealURL(src) ;
  15138. }
  15139. //隐藏公司logo
  15140. if(window.MP_PREFETCHED_MODELDATA.loadlogo){
  15141. showLogo();
  15142. }
  15143. e("./lib/three75-shim"),
  15144. e("./lib/array-polyfill"),
  15145. e("./lib/performance-polyfill"),
  15146. e("./lib/shaders/CopyShader.js"),
  15147. e("./lib/shaders/HorizontalBlurShader.js"),
  15148. e("./lib/shaders/VerticalBlurShader.js"),
  15149. e("./lib/postprocessing/EffectComposer.js"),
  15150. e("./lib/postprocessing/RenderPass.js"),
  15151. e("./lib/postprocessing/MaskPass.js"),
  15152. e("./lib/postprocessing/ShaderPass.js"),
  15153. window.Promise || (window.Promise = e("promise-polyfill"));
  15154. var x = e("three")
  15155. , _x = e("three")
  15156. , S = (e("./util/sentry"),
  15157. e("./player"))
  15158. , M = e("./director")
  15159. , R = e("./controls/CameraControls")
  15160. , P = e("./model/ModelManager")
  15161. , O = e("./DisplayController")
  15162. , L = e("./label/LabelDisplayController")
  15163. , D = e("./enum/Viewmode")
  15164. , N = e("./util/logger")
  15165. , B = e("./showcase")
  15166. , F = e("./util/browser")
  15167. , V = e("./settings")
  15168. , U = e("./gui/gui")
  15169. , k = e("./gui/error")
  15170. , H = e("./analytics")
  15171. , G = e("./util/transitions")
  15172. , z = e("./effects")
  15173. , W = e("./objects/Skybox")
  15174. , j = e("./util/common")
  15175. , Y = (e("./util/PanoramaCollection"),
  15176. e("./util/math"),
  15177. e("./util/showcase"))
  15178. , X = e("./util/camera")
  15179. , Z = (e("./objects/Panorama"),
  15180. e("./cameras/PanoramaCamera"),
  15181. e("./preloaders"))
  15182. , q = e("events").EventEmitter
  15183. , K = e("./featureflags")
  15184. , Q = (e("./util/lerp"),
  15185. e("./util/ajax"))
  15186. , J = e("./ab")
  15187. , ee = e("./sdk/automation.js")
  15188. , te = e("./scene/SceneRenderer")
  15189. , ie = e("./scene/QuickstartManager")
  15190. , ne = e("./tile/QualityManager.js")
  15191. , re = e("./localization/localize")
  15192. , oe = e("./tag/tagManager")
  15193. , ae = e("./tile/TileDownloader")
  15194. , se = e("./tile/PanoRenderer")
  15195. , le = (e("./enum/PanoSizeClass"),
  15196. e("./enum/PanoramaEvents"),
  15197. e("./enum/SceneRendererEvents"))
  15198. , ce = e("./gui/memoryUsage")
  15199. , he = e("./enum/RenderLayers")
  15200. , ue = e("./TimingData")
  15201. , de = new N(t);
  15202. N.level = V.logLevel,
  15203. N.consoleEnabled = V.console,
  15204. i()
  15205. }
  15206. }
  15207. ).call(this, "/js/main.js")
  15208. }
  15209. , {
  15210. "./DisplayController": 1,
  15211. "./TimingData": 2,
  15212. "./ab": 3,
  15213. "./analytics": 4,
  15214. "./cameras/PanoramaCamera": 7,
  15215. "./controls/CameraControls": 9,
  15216. "./director": 15,
  15217. "./effects": 16,
  15218. "./enum/PanoSizeClass": 36,
  15219. "./enum/PanoramaEvents": 37,
  15220. "./enum/RenderLayers": 41,
  15221. "./enum/SceneRendererEvents": 43,
  15222. "./enum/Viewmode": 51,
  15223. "./featureflags": 59,
  15224. "./gui/error": 64,
  15225. "./gui/gui": 65,
  15226. "./gui/memoryUsage": 73,
  15227. "./label/LabelDisplayController": 91,
  15228. "./lib/array-polyfill": 92,
  15229. "./lib/performance-polyfill": 95,
  15230. "./lib/postprocessing/EffectComposer.js": 96,
  15231. "./lib/postprocessing/MaskPass.js": 97,
  15232. "./lib/postprocessing/RenderPass.js": 98,
  15233. "./lib/postprocessing/ShaderPass.js": 99,
  15234. "./lib/shaders/CopyShader.js": 100,
  15235. "./lib/shaders/HorizontalBlurShader.js": 101,
  15236. "./lib/shaders/VerticalBlurShader.js": 102,
  15237. "./lib/three75-shim": 103,
  15238. "./localization/localize": 108,
  15239. "./tag/tagManager": 124,
  15240. "./model/ModelManager": 140,
  15241. "./objects/Panorama": 148,
  15242. "./objects/Skybox": 152,
  15243. "./player": 155,
  15244. "./preloaders": 156,
  15245. "./scene/QuickstartManager": 157,
  15246. "./scene/SceneRenderer": 158,
  15247. "./sdk/automation.js": 164,
  15248. "./settings": 166,
  15249. "./showcase": 168,
  15250. "./tile/PanoRenderer": 169,
  15251. "./tile/QualityManager.js": 170,
  15252. "./tile/TileDownloader": 171,
  15253. "./util/PanoramaCollection": 178,
  15254. "./util/ajax": 181,
  15255. "./util/browser": 182,
  15256. "./util/camera": 183,
  15257. "./util/common": 185,
  15258. "./util/lerp": 188,
  15259. "./util/logger": 189,
  15260. "./util/math": 190,
  15261. "./util/sentry": 192,
  15262. "./util/showcase": 193,
  15263. "./util/transitions": 195,
  15264. events: 202,
  15265. "promise-polyfill": 213,
  15266. three: 217
  15267. }],
  15268. 117: [function(e, t, i) {
  15269. "use strict";
  15270. function n(e) {
  15271. e = e || {}
  15272. r.RawShaderMaterial.call(this, a.extendObject({
  15273. fragmentShader: o.cube.fragmentShader,
  15274. vertexShader: o.cube.vertexShader,
  15275. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  15276. name: "CubemapMaterial",
  15277. }, e))
  15278. }
  15279. var r = e("three")
  15280. , o = e("../shaders")
  15281. , a = e("../util/common");
  15282. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  15283. n.prototype.constructor = n,
  15284. t.exports = n
  15285. }
  15286. , {
  15287. "../shaders": 167,
  15288. "../util/common": 185,
  15289. three: 217
  15290. }],
  15291. 118: [function(e, t, i) {
  15292. "use strict";
  15293. function n(e) {
  15294. e = e || {}
  15295. r.RawShaderMaterial.call(this, a.extendObject({
  15296. fragmentShader: o.model.fragmentShader,
  15297. vertexShader: o.model.vertexShader,
  15298. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  15299. name: "ModelTextureMaterial",
  15300. }, e))
  15301. }
  15302. var r = e("three")
  15303. , o = e("../shaders")
  15304. , a = e("../util/common");
  15305. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  15306. n.prototype.constructor = n,
  15307. n.prototype.setProjectedPanos = function(e, t, i) {
  15308. i && (this.uniforms.progress.value = 0),
  15309. e.ensureSkyboxReadyForRender(),
  15310. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  15311. this.uniforms.pano0Position.value.copy(e.position),
  15312. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  15313. t.ensureSkyboxReadyForRender(),
  15314. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  15315. this.uniforms.pano1Position.value.copy(t.position),
  15316. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  15317. }
  15318. /* n.prototype.setEyeDir = function(dir, pos) {//加
  15319. this.uniforms.eyeDir.value.copy(dir)
  15320. this.uniforms.eyePos.value.copy(pos)
  15321. }
  15322. n.prototype.setBendCameraQua = function(matrix) {//加
  15323. this.uniforms.cameraDeltaMatrix.value.copy(matrix)
  15324. } */
  15325. ,
  15326. t.exports = n
  15327. }
  15328. , {
  15329. "../shaders": 167,
  15330. "../util/common": 185,
  15331. three: 217
  15332. }],
  15333. 119: [function(e, t, i) {
  15334. (function(i) {
  15335. "use strict";
  15336. function n(e, t, i, n) {
  15337. this.div = null,
  15338. this.body = null,
  15339. this.label = e,
  15340. this.description = t,
  15341. this.parsedDescription = [],
  15342. this.media = i || {
  15343. type: null
  15344. },
  15345. this.loadingSpinner = null,
  15346. this.parser = new r({
  15347. supportLinks: !u.valueFromHash("mls"),
  15348. keepLinkLabels: !0
  15349. }),
  15350. this.state = I.CLOSED,
  15351. this.orientation = "",
  15352. this.initialTransform = "",
  15353. this.hovering = !1,
  15354. this.openTransition = null,
  15355. this.closeTransition = null,
  15356. this.openPromise = null,
  15357. this.closePromise = null,
  15358. this.animationTransition = null,
  15359. this.animationScale = 0
  15360. }
  15361. var r = e("../Parser/DescriptionParser")
  15362. , o = e("../Media/Link")
  15363. , a = e("../Media/Image")
  15364. , s = e("../Media/EmbedlyPlayer")
  15365. , l = e("../Media/EmbedlyEmbed")
  15366. , c = e("../../util/transitions")
  15367. , h = e("../../util/lerp")
  15368. , u = e("../../util/browser")
  15369. , d = e("./BillboardEvent")
  15370. , p = e("../Media/MediaEvent")
  15371. , f = e("../Parser/DescriptionChunkType")
  15372. , g = e("events").EventEmitter
  15373. , m = e("./billboardSettings")
  15374. , v = e("./overlaySettings")
  15375. , A = e("../../util/logger")
  15376. , y = new A(i)
  15377. , C = document.getElementById("tag-billboards");
  15378. C.addEventListener("touchend", function(e) {
  15379. C.style.pointerEvents = "none"
  15380. }),
  15381. C.addEventListener("touchcancel", function(e) {
  15382. C.style.pointerEvents = "none"
  15383. });
  15384. var I = {
  15385. CLOSED: "closed",
  15386. OPENING: "opening",
  15387. OPEN: "open",
  15388. CLOSING: "closing",
  15389. ACTIVE: "active"
  15390. };
  15391. n.prototype = Object.create(g.prototype),
  15392. n.prototype.build = function(e) {
  15393. this.parsedDescription = this.parser.parse(this.description);
  15394. var t = document.createElement("div");
  15395. t.className = "tag-container has-hotzone",
  15396. this.div = t,
  15397. this.body = document.createElement("div"),
  15398. this.body.className = "tag-body";
  15399. var i = document.createElement("div");
  15400. i.classList.add("tag-content");
  15401. var n = document.createElement("div");
  15402. n.classList.add("tag-text-content");
  15403. var r = document.createElement("div");
  15404. r.className = "tag-label",
  15405. r.textContent = this.label,
  15406. n.appendChild(r);
  15407. var o = document.createElement("div");
  15408. o.className = "tag-desc",
  15409. n.appendChild(o),
  15410. i.appendChild(n),
  15411. this.body.appendChild(i),
  15412. this.appendDescriptionElements(this.parsedDescription, o),
  15413. this.appendMedia(),
  15414. t.appendChild(this.body),
  15415. C.appendChild(t),
  15416. this.bindEvents(t, this.body)
  15417. }
  15418. ,
  15419. n.prototype.bindEvents = function(e, t) {
  15420. var i = function(e) {
  15421. return function(t) {
  15422. if (!this.div.classList.contains("overlay")) {
  15423. var i, n = document.getElementById("player");
  15424. try {
  15425. i = new MouseEvent(e,t)
  15426. } catch (n) {
  15427. i = document.createEvent("MouseEvents"),
  15428. i.initMouseEvent(e, t.bubbles, t.cancelable, t.view, t.detail, t.screenX, t.screenY, t.clientX, t.clientY, t.ctrlKey, t.altKey, t.shiftKey, t.metaKey, t.button, t.relatedTarget)
  15429. }
  15430. n.dispatchEvent(i)
  15431. }
  15432. }
  15433. };
  15434. t.addEventListener("mousedown", function(e) {
  15435. e.stopPropagation()
  15436. }),
  15437. t.addEventListener("mouseup", function(e) {
  15438. e.stopPropagation()
  15439. }),
  15440. e.addEventListener("touchstart", function(e) {
  15441. C.style.pointerEvents = "auto"
  15442. }),
  15443. e.addEventListener("mousedown", i("mousedown").bind(this)),
  15444. e.addEventListener("mouseup", i("mouseup").bind(this)),
  15445. t.addEventListener("mouseover", function(t) {
  15446. this.state === I.OPEN && e.classList.remove("has-hotzone")
  15447. }
  15448. .bind(this)),
  15449. e.addEventListener("mouseenter", function(e) {
  15450. this.state !== I.CLOSING && (this.hovering = !0,
  15451. this.emit(d.ENTER))
  15452. }
  15453. .bind(this)),
  15454. e.addEventListener("mouseleave", function(e) {
  15455. this.hovering = !1,
  15456. this.emit(d.LEAVE)
  15457. }
  15458. .bind(this)),
  15459. e.addEventListener("gesturestart", function(e) {
  15460. e.preventDefault()
  15461. });
  15462. var n = e.querySelector(".tag-text-content")
  15463. , r = 0;
  15464. n.addEventListener("touchstart", function(e) {
  15465. r = e.changedTouches[0].clientY
  15466. }),
  15467. n.addEventListener("touchmove", function(t) {
  15468. function i(e) {
  15469. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight === 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  15470. }
  15471. return e.classList.contains("overlay") ? i(this.querySelector(".tag-desc")) : void i(this)
  15472. }),
  15473. e.addEventListener("touchmove", function(e) {
  15474. 0 === (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  15475. })
  15476. }
  15477. ,
  15478. n.prototype.appendDescriptionElements = function(e, t) {
  15479. e.length > 0 && this.div.classList.add("has-text"),
  15480. e.forEach(function(e, i) {
  15481. switch (e.type) {
  15482. case f.TEXT:
  15483. t.appendChild(this.createTextElement(e.text));
  15484. break;
  15485. case f.LINK:
  15486. t.appendChild(this.createLinkElement(e.link))
  15487. }
  15488. }
  15489. .bind(this))
  15490. }
  15491. ,
  15492. n.prototype.appendLoadingSpinner = function() {
  15493. this.loadingSpinner = document.createElement("div"),
  15494. this.loadingSpinner.classList.add("loading-spinner");
  15495. var e = document.createElement("div");
  15496. e.classList.add("gui-spinner-icon"),
  15497. this.loadingSpinner.appendChild(e),
  15498. this.body.appendChild(this.loadingSpinner)
  15499. }
  15500. ,
  15501. n.prototype.onMediaLoadFinished = function() {
  15502. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  15503. this.applyOrientation(this.orientation),
  15504. this.loadingSpinner = null)
  15505. }
  15506. ,
  15507. n.prototype.appendMedia = function() {
  15508. if (this.media && this.media.type && "error" !== this.media.type && (!u.valueFromHash("mls", 0) || this.media.type === f.IMAGE)) {
  15509. this.appendLoadingSpinner();
  15510. var e = document.createElement("div");
  15511. e.classList.add("tag-media-content");
  15512. var t = document.createElement("i");
  15513. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  15514. t.classList.add(e)
  15515. }),
  15516. this.body.appendChild(t),
  15517. this.body.appendChild(e),
  15518. this.media.type) {
  15519. case f.IMAGE:
  15520. e.appendChild(this.createImageElement(this.media, this.body));
  15521. break;
  15522. case f.VIDEO:
  15523. e.appendChild(this.createVideoElement(this.media, this.body));
  15524. break;
  15525. case f.RICH:
  15526. e.appendChild(this.createEmbedElement(this.media, this.body))
  15527. }
  15528. }
  15529. }
  15530. ,
  15531. n.prototype.createTextElement = function(e) {
  15532. var t = document.createElement("span");
  15533. return t.textContent = e,
  15534. t
  15535. }
  15536. ;
  15537. n.prototype.createLinkElement = function(e) {
  15538. var t = new o(e);
  15539. return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)),
  15540. t.createDomElement()
  15541. }
  15542. ,
  15543. n.prototype.createImageElement = function(e, t) {
  15544. function i() {
  15545. function e() {
  15546. m || (r.classList.remove("view-image"),
  15547. c.classList.add("overlay"),
  15548. i(),
  15549. window.addEventListener("resize", b),
  15550. c.addEventListener("click", a),
  15551. g.addEventListener("click", l),
  15552. f.addEventListener("click", s),
  15553. m = !0,
  15554. o.emit(p.IMAGE_OPENED))
  15555. }
  15556. function i() {
  15557. t.classList.add("show-info"),
  15558. h.classList.remove("collapsible"),
  15559. h.style.height = "";
  15560. var e = parseFloat(getComputedStyle(I).lineHeight)
  15561. , i = y + e
  15562. , r = c.clientWidth - 2 * v.boundaryWidth - C
  15563. , a = c.clientHeight - 2 * v.boundaryHeight - C - i
  15564. , s = a
  15565. , l = s * n.aspect;
  15566. l > r && (l = r,
  15567. s = l / n.aspect),
  15568. s > a && (s = a,
  15569. l = s * n.aspect),
  15570. l += C,
  15571. s += C + i,
  15572. t.style.width = l + "px",
  15573. t.style.height = s + "px",
  15574. u.style.paddingTop = e + C + "px",
  15575. o.description.length > 0 && (h.classList.add("collapsible"),
  15576. h.style.height = h.clientHeight + 12 + "px",
  15577. E.style.height = "calc(100% - " + I.clientHeight + "px)")
  15578. }
  15579. function a(e) {
  15580. e.target === c && s()
  15581. }
  15582. function s() {
  15583. m && (m = !1,
  15584. r.classList.add("view-image"),
  15585. c.classList.remove("overlay"),
  15586. h.style.height = "",
  15587. u.style.paddingTop = "",
  15588. t.style.width = "",
  15589. t.style.height = "",
  15590. window.removeEventListener("resize", b),
  15591. c.removeEventListener("click", a),
  15592. g.removeEventListener("click", l),
  15593. f.removeEventListener("click", s),
  15594. o.emit(p.IMAGE_CLOSED),
  15595. o.close(!0))
  15596. }
  15597. function l(e) {
  15598. t.classList.toggle("show-info")
  15599. }
  15600. var c = o.div
  15601. , h = c.getElementsByClassName("tag-content")[0]
  15602. , u = c.getElementsByClassName("tag-media-content")[0]
  15603. , f = t.getElementsByClassName("close")[0]
  15604. , g = h.getElementsByClassName("tag-label")[0];
  15605. c.classList.add("has-image"),
  15606. r.classList.add("view-image"),
  15607. c.classList.add(n.aspect >= 1 ? "image-landscape" : "image-portrait"),
  15608. o.applyOrientation(o.orientation);
  15609. var m = !1
  15610. , A = getComputedStyle(h)
  15611. , y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom)
  15612. , C = 2 * parseFloat(getComputedStyle(u).paddingLeft)
  15613. , I = h.querySelector(".tag-label")
  15614. , E = h.querySelector(".tag-desc")
  15615. , b = function() {
  15616. var e, t, n = 0;
  15617. return function() {
  15618. clearInterval(e),
  15619. clearTimeout(t),
  15620. e = setInterval(function() {
  15621. var e = c.clientHeight;
  15622. n !== e && (i(),
  15623. n = e)
  15624. }, 100),
  15625. t = setTimeout(clearInterval.bind(this, e), 1e3)
  15626. }
  15627. }();
  15628. n.on(p.IMAGE_OPENING, e),
  15629. o.on(d.ACTIVATE, e),
  15630. o.on(p.IMAGE_CLOSED, n.onClosed.bind(n)),
  15631. o.on(d.CLOSING, s)
  15632. }
  15633. var n = new a
  15634. , r = n.createDomElement();
  15635. this.once(d.OPENED, function() {
  15636. n.load(e.src).then(i).catch(function(t) {
  15637. y.warn("Failed to load image:", e.src),
  15638. y.warn("with error:", t)
  15639. }).then(this.onMediaLoadFinished.bind(this))
  15640. });
  15641. var o = this;
  15642. return r
  15643. }
  15644. ,
  15645. n.prototype.createVideoElement = function(e, t) {
  15646. var i = new s({
  15647. autoPlay: !0,
  15648. autoResume: !0,
  15649. startMuted: !1,
  15650. loop: !1
  15651. })
  15652. , n = i.createDomElement();
  15653. return this.once(d.OPENED, function() {
  15654. i.load(e.src).then(function() {
  15655. this.div.classList.add("has-video"),
  15656. this.state !== I.OPEN && this.state !== I.ACTIVE || (i.show(),
  15657. i.play()),
  15658. this.on(d.OPENING, i.show.bind(i)),
  15659. this.on(d.OPENED, i.play.bind(i)),
  15660. this.on(d.CLOSING, i.pause.bind(i)),
  15661. this.on(d.CLOSED, i.hide.bind(i))
  15662. }
  15663. .bind(this)).catch(function(t) {
  15664. y.warn("Failed to embed video:", e.src),
  15665. y.warn("with error:", t)
  15666. }).then(this.onMediaLoadFinished.bind(this))
  15667. }
  15668. .bind(this)),
  15669. n
  15670. }
  15671. ,
  15672. n.prototype.createEmbedElement = function(e, t) {
  15673. var i = new l
  15674. , n = i.createDomElement();
  15675. return this.once(d.OPENED, function() {
  15676. i.load(e.src).then(function() {
  15677. this.div.classList.add("has-embed"),
  15678. this.state !== I.OPEN && this.state !== I.ACTIVE || i.show(),
  15679. this.applyOrientation(this.orientation),
  15680. this.on(d.OPENING, i.show.bind(i)),
  15681. this.on(d.CLOSED, i.hide.bind(i))
  15682. }
  15683. .bind(this)).catch(function(t) {
  15684. y.warn("Failed to embed:", e.src),
  15685. y.warn("with error:", t)
  15686. }).then(this.onMediaLoadFinished.bind(this))
  15687. }
  15688. .bind(this)),
  15689. n
  15690. }
  15691. ,
  15692. n.prototype.open = function(e) {
  15693. return this.openPromise = $.Deferred(),
  15694. this.state === I.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  15695. this.openTransition ? e && this.setActiveState() : this.openTransition = c.setTimeout(function() {
  15696. this.state !== I.OPEN && (this.emit(d.OPENING),
  15697. e && this.emit(d.ACTIVATING),
  15698. this.state = I.OPENING,
  15699. this.animateOpen(function() {
  15700. e && this.setActiveState(),
  15701. this.openPromise.resolve()
  15702. }
  15703. .bind(this)))
  15704. }
  15705. .bind(this), m.animation.openDelay),
  15706. c.cancel(this.closeTransition),
  15707. this.closePromise && this.closePromise.reject(),
  15708. this.closeTransition = void 0,
  15709. this.openPromise.promise())
  15710. }
  15711. ,
  15712. n.prototype.close = function(e) {
  15713. return this.closePromise = $.Deferred(),
  15714. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = c.setTimeout(function() {
  15715. this.state !== I.CLOSED && (this.emit(d.CLOSING),
  15716. this.state = I.CLOSING,
  15717. this.animateClose())
  15718. }
  15719. .bind(this), m.animation.closeDelay)),
  15720. c.cancel(this.openTransition),
  15721. this.openPromise && this.openPromise.reject(),
  15722. this.openTransition = void 0,
  15723. this.closePromise.resolve(),
  15724. this.closePromise.promise())
  15725. }
  15726. ,
  15727. n.prototype.setActiveState = function() {
  15728. this.state !== I.CLOSED && (this.state = I.ACTIVE,
  15729. this.emit(d.ACTIVATE),
  15730. this.div.classList.remove("has-hotzone"))
  15731. }
  15732. ,
  15733. n.prototype.animateOpen = function(e) {
  15734. if (this.state === I.OPENING) {
  15735. if (c.cancel(this.animationTransition),
  15736. u.detectSamsungNative())
  15737. return this.boardOrientation = null,
  15738. this.div.style.visibility = "visible",
  15739. this.emit(d.OPENED),
  15740. this.state = I.OPEN,
  15741. void (e && e());
  15742. this.div.style.webkitTransform = "scale(0)",
  15743. this.div.style.transform = "scale(0)",
  15744. this.div.style.visibility = "visible",
  15745. this.animationTransition = c.start(h.property(this, "animationScale", 1), m.animation.openDuration, function() {
  15746. this.emit(d.OPENED),
  15747. this.state = I.OPEN,
  15748. e && e()
  15749. }
  15750. .bind(this))
  15751. }
  15752. }
  15753. ,
  15754. n.prototype.animateClose = function(e) {
  15755. this.state === I.CLOSING && (c.cancel(this.animationTransition),
  15756. this.animationTransition = c.start(h.property(this, "animationScale", 0), m.animation.closeDuration, function() {
  15757. this.emit(d.CLOSED),
  15758. this.state = I.CLOSED,
  15759. this.div.style.visibility = "hidden",
  15760. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  15761. e && e()
  15762. }
  15763. .bind(this)))
  15764. }
  15765. ,
  15766. n.prototype.needsUpdate = function() {
  15767. return this.state !== I.CLOSED
  15768. }
  15769. ,
  15770. n.prototype.update = function(e, t) {
  15771. if (this.needsUpdate()) {
  15772. var i = (this.updateOrientation(e),
  15773. this.calcScale(t))
  15774. , n = {
  15775. x: (e.x + 1) * $("#player").width() / 2,
  15776. y: (e.y + 1) * $("#player").height() / 2
  15777. };
  15778. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  15779. this.div.style.webkitTransform = this.div.screenTransform,
  15780. this.div.style.transform = this.div.screenTransform
  15781. }
  15782. }
  15783. ,
  15784. n.prototype.getDimensions = function() {
  15785. return this.div.getBoundingClientRect()
  15786. }
  15787. ,
  15788. n.prototype.calcScale = function(e) {
  15789. return Math.sqrt(e / 40) * m.boardToDiscRatio
  15790. }
  15791. ,
  15792. n.prototype.updateOrientation = function(e) {
  15793. if (this.state !== I.ACTIVE) {
  15794. var t = 1 / 3
  15795. , i = e.y < -t ? 0 : e.y < t ? 1 : 2
  15796. , n = e.x < -t ? 0 : e.x < t ? 1 : 2
  15797. , r = "";
  15798. r += 0 === n ? "right" : 2 === n ? "left" : "",
  15799. r += 0 === i ? "-down" : 2 === i ? "-up" : "",
  15800. 1 === n && (r = 0 === i ? "bottom" : 2 === i ? "top" : "",
  15801. 1 === i && (r = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  15802. 1 === n && 1 === i && r === this.orientation || this.applyOrientation(r)
  15803. }
  15804. }
  15805. ,
  15806. n.prototype.applyOrientation = function(e) {
  15807. this.div.style.transform = this.div.style.webkitTransform = "",
  15808. this.div.classList.remove("tag-container-" + this.orientation),
  15809. this.div.classList.add("tag-container-" + e);
  15810. var t = window.getComputedStyle(this.div);
  15811. this.initialTransform = t.transform || t.webkitTransform,
  15812. "none" === this.initialTransform && (this.initialTransform = "");
  15813. var i = t.transform.slice(7, -1).split(",")
  15814. , n = -i[4]
  15815. , r = -i[5];
  15816. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  15817. this.div.style.transformOrigin = n + "px " + r + "px",
  15818. this.orientation = e
  15819. }
  15820. ,
  15821. t.exports = n
  15822. }
  15823. ).call(this, "/js/tag/Billboard/Billboard.js")
  15824. }
  15825. , {
  15826. "../../util/browser": 182,
  15827. "../../util/lerp": 188,
  15828. "../../util/logger": 189,
  15829. "../../util/transitions": 195,
  15830. "../Media/EmbedlyEmbed": 125,
  15831. "../Media/EmbedlyPlayer": 126,
  15832. "../Media/Image": 128,
  15833. "../Media/Link": 129,
  15834. "../Media/MediaEvent": 131,
  15835. "../Parser/DescriptionChunkType": 133,
  15836. "../Parser/DescriptionParser": 134,
  15837. "./BillboardEvent": 120,
  15838. "./billboardSettings": 121,
  15839. "./overlaySettings": 122,
  15840. events: 202
  15841. }],
  15842. 120: [function(e, t, i) {
  15843. "use strict";
  15844. t.exports = Object.freeze({
  15845. ENTER: "billboard.enter",
  15846. LEAVE: "billboard.leave",
  15847. OPENING: "billboard.opening",
  15848. OPENED: "billboard.open",
  15849. CLOSING: "billboard.closing",
  15850. CLOSED: "billboard.closed",
  15851. ACTIVATING: "billboard.activating",
  15852. ACTIVATE: "billboard.activate"
  15853. })
  15854. }
  15855. , {}],
  15856. 121: [function(e, t, i) {
  15857. "use strict";
  15858. t.exports = Object.freeze({
  15859. animation: Object.freeze({
  15860. hoverOnClosing: !1,
  15861. openDelay: 100,
  15862. closeDelay: 50,
  15863. openDuration: 200,
  15864. closeDuration: 100
  15865. }),
  15866. boardToDiscRatio: 1.2
  15867. })
  15868. }
  15869. , {}],
  15870. 122: [function(e, t, i) {
  15871. "use strict";
  15872. t.exports = Object.freeze({
  15873. boundaryWidth: 30,
  15874. boundaryHeight: 0
  15875. })
  15876. }
  15877. , {}],
  15878. /*********************************创建热点模型************************************************** */
  15879. "hot": [function(e, t, i) {//热点
  15880. "use strict";
  15881. function hot(sid,d,model){
  15882. this.sid = sid;
  15883. /* this.position = (new r.Vector3).fromArray( this.conversionArray(d.position) )
  15884. if(d.quaternion){
  15885. this.quaternion = d.quaternion;
  15886. }else{
  15887. this.rotation = this.conversionArray(d.rotation)
  15888. } */
  15889. this.position = this.convertValue(d.position, r.Vector3)
  15890. if(d.quaternion){
  15891. this.quaternion = this.convertValue(d.quaternion, r.Quaternion)
  15892. }else{
  15893. this.rotation = new r.Euler().setFromVector3(this.convertValue(d.rotation, r.Vector3 ))
  15894. }
  15895. this.quaternion || (this.quaternion = new THREE.Quaternion().setFromEuler(this.rotation))
  15896. this.isSprite = d.isSprite
  15897. this.actionType = (d.noAction ? 'noAction' : d.actionType) || "common"
  15898. this.linkType = d.linkType || "common"
  15899. this.link = d.link;
  15900. this.model = model;
  15901. this.size = d.size;
  15902. this.infoAttribute = d.infoAttribute || {};
  15903. this.styleImg = [] // 存储热点icon的图片 [{src:...}, {src:...} ] 最多两个,里面是带有src的object, 可以是img
  15904. this.transformAtPanos = d.transformAtPanos || {}
  15905. for (let i in this.transformAtPanos) {
  15906. this.transformAtPanos[i].pos = new THREE.Vector3().fromArray(this.transformAtPanos[i].pos)
  15907. this.transformAtPanos[i].qua && (this.transformAtPanos[i].qua = new THREE.Quaternion().fromArray(this.transformAtPanos[i].qua))
  15908. }
  15909. this.build();
  15910. d.infoAttribute && d.infoAttribute.title && this.setTitleElem(d.infoAttribute.title)
  15911. this.changeTex()
  15912. this.visibleData = d.visiblePanos
  15913. //this.setVisiblePanos(d.visiblePanos);
  15914. }
  15915. var r = e("three")
  15916. , f = e("../shaders")
  15917. , a = e("../settings")
  15918. , s = e("../enum/Viewmode")
  15919. , p = e("../objects/Panorama")
  15920. , math = e("../util/math")
  15921. , te = e("../util/texture");
  15922. var raycaster = new r.Raycaster;
  15923. //热点大小
  15924. var geometry = new r.PlaneBufferGeometry( g_HotMeshSize.g_HotMeshWidth, g_HotMeshSize.g_HotMeshHeight,1,1);
  15925. var defaultTex1 = te.load(g_HotImage.point);
  15926. var defaultTex2 = te.load(g_HotImage.point2);
  15927. hot.prototype.changeTex = function(){
  15928. var u = this.mesh.material.uniforms
  15929. if(this.styleImg.length){
  15930. u.texture1.value = te.load(this.styleImg[0].src);
  15931. u.texture2.value = te.load(this.styleImg[1]&&this.styleImg[1].src || this.styleImg[0].src);
  15932. }else{
  15933. u.texture1.value = defaultTex1;
  15934. u.texture2.value = defaultTex2;
  15935. }
  15936. }
  15937. hot.prototype.initStyleImg = function(t){
  15938. this.styleImg = []
  15939. t.styleImg = t.styleImg || [];
  15940. t.styleImg.forEach((src)=>{
  15941. this.styleImg.push({src:manage.dealURL(src)})
  15942. })
  15943. this.changeTex()
  15944. }
  15945. hot.prototype.update = function(camera) {
  15946. if(this.isSprite){
  15947. this.mesh.quaternion.copy(camera.quaternion)
  15948. }
  15949. //this.showTitle()
  15950. }
  15951. hot.prototype.setVisiblePanos = function(visibleData){
  15952. this.visiblePanos = [];
  15953. this.model.panos.list.forEach((pano)=>{// 模型遮挡的, 直接不可见
  15954. if(visibleData && !visibleData.includes(pano.id))return; //在热点可视中设置过,不可见
  15955. var isShelter = convertTool.ifIntersectChunks(pano.position, this.position, {model: this.model.colliders});
  15956. if(!isShelter){
  15957. this.visiblePanos.push(pano.id)
  15958. }
  15959. })
  15960. }
  15961. //绘制热点
  15962. hot.prototype.build = function(){
  15963. var t = r.UniformsUtils.clone(f.hot.uniforms);
  15964. var shaderMaterial = new r.ShaderMaterial({
  15965. uniforms: t,
  15966. vertexShader: f.hot.vertexShader,
  15967. fragmentShader: f.hot.fragmentShader,
  15968. transparent: !0
  15969. })
  15970. var sprite = new r.Mesh( geometry, shaderMaterial );
  15971. var hotIconScale = parseFloat(this.infoAttribute.hotIconScale || window.MP_PREFETCHED_MODELDATA.hotIconScale);
  15972. sprite.dynamic = true;
  15973. sprite.position.copy(this.position);
  15974. sprite.quaternion.copy(this.quaternion)
  15975. hotIconScale && sprite.scale.set(hotIconScale, hotIconScale, hotIconScale)
  15976. // this.size && sprite.scale.set(this.size,this.size,this.size);
  15977. sprite.name = this.sid;
  15978. sprite.type = "hotSprite";
  15979. sprite.belongHot = this;
  15980. if(this.link) sprite.hotLink = this.link;
  15981. this.mesh = sprite;
  15982. this.model.add(sprite);
  15983. g_HotMeshes.push(sprite);
  15984. }
  15985. hot.prototype.setTitleElem = function(title){
  15986. var root = $("#hot");
  15987. var elem = $(`<div> ${title}</div>`)
  15988. root.append(elem);
  15989. this.titleElem = elem;
  15990. }
  15991. hot.prototype.showTitle = function(){
  15992. if(!this.titleElem)return;
  15993. var pos = math.getPos2d(this.position, player.camera, $("#player")[0])
  15994. if(pos.trueSide){//inSight
  15995. this.titleElem.css( { "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
  15996. this.titleElem.css("display","block");
  15997. }else{
  15998. this.titleElem.css("display","none");
  15999. }
  16000. }
  16001. /* hot.prototype.showTitle = function(){//一直显示title的话
  16002. if(!this.titleElem)return;
  16003. var unvisi = ()=>{
  16004. this.titleElem.css("display","none");
  16005. }
  16006. var visi = ()=>{
  16007. var pos = math.getPos2d(this.position, player.camera, $("#player")[0])
  16008. if(pos.trueSide){//inSight
  16009. this.titleElem.css( { "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
  16010. this.titleElem.css("display","block");
  16011. }else{
  16012. unvisi()
  16013. }
  16014. }
  16015. if(this.mesh.visible){
  16016. if(player.mode == 'panorama'){
  16017. visi()
  16018. }else{
  16019. var ifShelter = convertTool.ifShelter(this.position)
  16020. if(ifShelter)unvisi()
  16021. else visi()
  16022. }
  16023. }else{
  16024. unvisi()
  16025. }
  16026. }
  16027. */
  16028. hot.prototype.hideTitle = function(){
  16029. if(!this.titleElem)return;
  16030. this.titleElem.css("display","none");
  16031. }
  16032. hot.prototype.closestPanoTowardTag = function(e, t) {
  16033. var i = []
  16034. , o = []
  16035. , l = this.mesh.position;
  16036. if (e === s.PANORAMA) {
  16037. var c = .5
  16038. , h = t.position.clone().sub(l).normalize();
  16039. // 方奕卓 注释掉下面的筛选条件, 使热点列表能点击过渡
  16040. // i.push(p.filters.isPanoAligned()),
  16041. // i.push(p.filters.inPanoDirection(l, h, c)),
  16042. // i.push(p.filters.isNeighbourPanoTo(t)),
  16043. o.push(p.scoreFunctions.direction(l, h))
  16044. }
  16045. var u = new r.Vector3
  16046. , d = function(e) {
  16047. u.copy(l).sub(e.position);
  16048. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  16049. , i = a.tags.navigate.tiltTolerance;
  16050. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  16051. }
  16052. , f = function(e) {
  16053. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  16054. };
  16055. i.push(f, d, (pano)=>{ // add
  16056. return player.checkHasNeighbor(pano)
  16057. }),
  16058. o.push(p.scoreFunctions.distanceSquared(this.mesh, -2));
  16059. var g = t.model.panos.sortByScore(i, o);
  16060. if (g && a.tags.navigate.lineOfSight) {
  16061. for (var m = 0; m < g.length; m++) {
  16062. var v = g[m].pano
  16063. , A = v.position.distanceTo(l);
  16064. raycaster.set(v.position, l.clone().sub(v.position).normalize());
  16065. var y = raycaster.intersectObjects(t.model.colliders);
  16066. // return g[0].pano;
  16067. if (0 === y.length || y[0].distance > A) {
  16068. console.log(m);
  16069. return v
  16070. }
  16071. }
  16072. return null
  16073. }
  16074. return g && g.length > 0 && g[0].pano
  16075. }
  16076. var getLink = function(link){
  16077. var src = '';
  16078. var r = link.substring(link.indexOf("html") + 4)//给热点后面加上随机数,让热点确保是最新的
  16079. , o = "en" == manage.number("lang") ? "&lang=" + manage.number("lang") : "";//如果热点的内容是英文版的
  16080. -1 == r.indexOf("?") ? src = link + "?time=" + randomTime().getTime() + "&id=" + window.number + o : src = link + "&time=" + randomTime().getTime() + "&id=" + window.number + o
  16081. return src
  16082. }
  16083. var musicOff = function(){
  16084. //打开热点的时候把背景音乐关闭了,避免与热点里面的音乐冲突
  16085. //g_bgAudio && g_bgAudio.pause();
  16086. if(g_bgAudio && !g_bgAudio.paused){
  16087. manage.switchBgmState(false);
  16088. g_bgAudio.pauseByHot = true
  16089. }
  16090. if(SoundOnVideo){
  16091. SoundOnVideo.pauseByHot = true
  16092. switchSoundBtn(SoundOnVideo)
  16093. }
  16094. if(g_tourAudio)g_tourAudio.pause()
  16095. }
  16096. hot.prototype.examine = function(e, options) {
  16097. try{
  16098. window.parent.postMessage("clickHot",'*')
  16099. //$("#app .aside li" , parent.document)[0].click();
  16100. }catch(e){
  16101. console.log(e)
  16102. }
  16103. options = options || {}
  16104. if(this.actionType == 'noAction' )return;
  16105. if(this.linkType!="common" && this.infoAttribute.iframe && this.infoAttribute.iframe[0] && !options.dontOpen){
  16106. var src = getLink(this.infoAttribute.iframe[0]);
  16107. if(this.linkType=="jumpLink"){
  16108. /* var newPage = window.open(src, "_blank" );
  16109. newPage.focus(); */
  16110. var href = window.location.href
  16111. var index = href.indexOf("&")
  16112. if(index>-1) href = href.substr(0,index) /* pushState replaceState*/
  16113. history.pushState(null, "", href+'&qs=1&firstView=pano:'+player.currentPano.id+',qua:'+ player.quaternion.toArray());
  16114. window.location.href = src
  16115. }else if(this.linkType=="iframeDiv"){
  16116. var div = document.createElement("div");
  16117. $("body").append(div);
  16118. div.style.position = 'fixed';
  16119. div.style.width = div.style.height = "100%";
  16120. div.style.left = div.style.top = '0';
  16121. div.style["z-index"] = "999"
  16122. exit = document.createElement("div");
  16123. exit.id ='myColne'
  16124. exit.style["background-image"] = "url(images/close1.png)";
  16125. exit.style.position = 'absolute';
  16126. exit.style.width = exit.style.height = "50px";
  16127. exit.style.right = '17px'; exit.style.top = "20px"
  16128. exit.style.cursor = "pointer";
  16129. exit.style["background-repeat"] = "no-repeat";
  16130. exit.style["background-size"] = "100%,100%";
  16131. exit.style["background-position"] = "center center";
  16132. exit.style["background-color"] = "rgba(0, 0, 0, 0.2)";
  16133. exit.style["border-radius"] = "50%";
  16134. exit.style["z-index"] = "3"
  16135. exit.onclick = ()=>{
  16136. $(div).remove()
  16137. if(g_bgAudio && g_bgAudio.pauseByHot){
  16138. manage.switchBgmState(true)
  16139. }
  16140. try{
  16141. window.parent.postMessage("closeHot",'*')
  16142. }catch(e){
  16143. console.log(e)
  16144. }
  16145. }
  16146. var myElement = document.createElement("iframe");
  16147. myElement.style.position = 'absolute';
  16148. myElement.style.width = myElement.style.height = "100%";
  16149. myElement.style.left = myElement.style.top = '0';
  16150. myElement.src = src
  16151. div.appendChild(exit);
  16152. div.appendChild(myElement)
  16153. musicOff()
  16154. /* //打开热点的时候把背景音乐关闭了,避免与热点里面的音乐冲突
  16155. //g_bgAudio && g_bgAudio.pause();
  16156. if(g_bgAudio && !g_bgAudio.paused){
  16157. manage.switchBgmState(false);
  16158. g_bgAudio.pauseByHot = true
  16159. }
  16160. if(g_tourAudio)g_tourAudio.pause()
  16161. */
  16162. }
  16163. return;
  16164. }
  16165. if(settings.dontExamHot || this.actionType == 'dontExam'){
  16166. o();
  16167. return;
  16168. }
  16169. if(!player.currentPano)return;
  16170. var hotPop = document.getElementById('popup');
  16171. //获取那个热点的链接
  16172. if(this.link){
  16173. g_currentHot = this;
  16174. hotPop.style.display = "block";
  16175. hotPop.classList.add("wait");
  16176. var myElement = document.createElement("iframe");
  16177. //打开热点的时候把背景音乐关闭了,避免与热点里面的音乐冲突
  16178. //g_bgAudio && g_bgAudio.pause();
  16179. /* if(g_bgAudio && !g_bgAudio.paused){
  16180. manage.switchBgmState(false);
  16181. g_bgAudio.pauseByHot = true
  16182. }
  16183. if(g_tourAudio)g_tourAudio.pause()*/
  16184. musicOff()
  16185. var src = getLink(this.link )
  16186. myElement.src = src;
  16187. myElement.id = "id1";
  16188. myElement.allowTransparency = "true";
  16189. // myElement.scrolling = "no";
  16190. var element=document.getElementById("id1"); //判断页面是否有iframe
  16191. if (typeof(element)== "undefined" || element == null){
  16192. document.querySelector(".popup-content").appendChild(myElement);
  16193. //移动端自动播放
  16194. var videoLoaddingResult = false
  16195. window.loaddingSuccess = function() {
  16196. videoLoaddingResult = true
  16197. }
  16198. setTimeout(function func() {
  16199. if (videoLoaddingResult) {
  16200. var $iframe = document.querySelector('#id1').contentWindow.document;
  16201. if($iframe.querySelector('video')){
  16202. $iframe.querySelector('video').play();
  16203. // alert($iframe.querySelector('video'));
  16204. if(!$iframe.querySelector('video').paused && $iframe.querySelector('.playPause')){
  16205. $iframe.querySelector('.playPause').classList.add("fa-pause");
  16206. }
  16207. }
  16208. if($iframe.querySelector('audio')){
  16209. $iframe.querySelector('audio').play();
  16210. }
  16211. } else {
  16212. setTimeout(func, 300)
  16213. }
  16214. }, 800);
  16215. }
  16216. //setTimeout(function(){$('#player').on("click",e.closePopup);},20)
  16217. }
  16218. // if(hotListSta) {
  16219. // hotPop.classList.remove("wait");
  16220. // return;
  16221. // }
  16222. var t = e.mode
  16223. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  16224. , n = this.mesh.position;
  16225. e.flyingToTag = true;
  16226. var o = function() {
  16227. e.flyingToTag = false;
  16228. if(this.link){
  16229. hotPop.classList.remove("wait");
  16230. }
  16231. }.bind(this);
  16232. if(settings.dontExamHot){
  16233. o();
  16234. return;
  16235. }
  16236. if (t === s.PANORAMA){
  16237. var l = {
  16238. pano: i,
  16239. lookAtPoint: n,
  16240. duration: null,
  16241. maxDistanceOverride: null,
  16242. skipWarpingCheck: !1
  16243. };
  16244. e.flyToPano(l, o)
  16245. }else {
  16246. var c = {
  16247. pano: i
  16248. };
  16249. if (n) {
  16250. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  16251. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  16252. }
  16253. c.callback = o,
  16254. c.duration = 1500,
  16255. c.mode = s.PANORAMA,
  16256. e.flyToNewMode(c)
  16257. }
  16258. },
  16259. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  16260. // if(window.MP_PREFETCHED_MODELDATA.special){
  16261. // specialScene.special().beforeImplement();
  16262. // }
  16263. //czj 判断是否是数组 如果不是将对象转换为数组
  16264. /* hot.prototype.conversionArray = function(obj){
  16265. if(Object.prototype.toString.call(obj)=='[object Array]') return obj;
  16266. var arr = []
  16267. for (var i in obj) {
  16268. arr.push(obj[i]); //属性
  16269. }
  16270. return arr
  16271. } */
  16272. hot.prototype.convertValue = function(v ,Type){
  16273. var value;
  16274. if(v instanceof Array){
  16275. v.forEach((v1)=>{v1 = parseFloat(v1)})
  16276. value = new Type().fromArray(v);
  16277. }else{
  16278. for(let i in v){v[i] = parseFloat(v[i])}
  16279. value = new Type().copy(v);
  16280. }
  16281. return value
  16282. }
  16283. t.exports = hot;
  16284. }
  16285. , {
  16286. three: 217,
  16287. "../shaders":167,
  16288. "../enum/Viewmode":51,
  16289. "../objects/Panorama":148,
  16290. "../util/texture":194,
  16291. "../settings":166,
  16292. "../util/math": 190,
  16293. }],
  16294. /************************************创建热点模型************************************ */
  16295. 123: [function(e, t, i) {//tag
  16296. (function(i) {
  16297. "use strict";
  16298. function n(e, t, i) {
  16299. var n = i.version || "0";
  16300. "0" !== n && I.info("tag defined using version " + n),
  16301. this.model = e,
  16302. this.sid = t,
  16303. this.color = (new r.Color).set(i.color || l.tagDefault),
  16304. this.hoverColor = l._darken(this.color, .2),
  16305. this.floor = null,
  16306. this.floorIndex = i.floor,
  16307. this.mode = s.PANORAMA,
  16308. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  16309. this.obj3d = null,
  16310. this.disc = null,
  16311. this.materials = {
  16312. disc: null,
  16313. pole: null
  16314. },
  16315. this.position = (new r.Vector3).copy(i.position),
  16316. this.discPosition = (new r.Vector3).copy(i.stem.direction),
  16317. this.discWorldPosition = null,
  16318. this.discScale = .05,
  16319. this.poleEnabled = i.stem.enabled,
  16320. this.billboard = new o(i.label,i.description,i.media,this),
  16321. this.visibleTransition = null,
  16322. this.hoveringDisc = !1
  16323. }
  16324. var r = e("three")
  16325. , o = e("./Billboard/Billboard")
  16326. , a = e("../settings")
  16327. , s = e("../enum/Viewmode")
  16328. , l = e("../enum/Colors")
  16329. , c = e("../enum/RenderLayers")
  16330. , h = e("../enum/RenderOrder")
  16331. , u = (e("../util/common"),
  16332. e("../util/math"))
  16333. , d = e("../util/texture")
  16334. , p = e("../objects/Panorama")
  16335. , f = e("../shaders")
  16336. , g = e("../util/transitions")
  16337. , m = e("../util/lerp")
  16338. , v = e("../util/easing")
  16339. , A = e("./Billboard/BillboardEvent")
  16340. , y = e("events").EventEmitter
  16341. , C = e("../util/logger")
  16342. , I = new C(i)
  16343. , E = d.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFigDGhCnowAABQFJREFUeNrtXTtyFEEMHXX5FK7iAiYFQ+KAiMyZCQnxRXwVFwkngSKD2BQXEYlNLXaZnZ7RX0/xbrek96RW9/RnWSCthSoaxcys4iwiAgGagN2FFATQe5OBAHpvMhBA700GAvC9iUBVgZd2dmTd9siIAvxOB9/RI9GI3kftf3a0t0YG2OOEaOk0qy2UyWFZKutMthGc09tWiuyQKkuvke2miE6ouOYe1QcE4HsTgSIY2gX4iP4ZHcFn5kt+KpfmFfhK2zXXDMgR/FdE9D3ivNyaqMz8YlmW3x46kIfjNQyxXlnzskG6X8psQJjlVGObJPtLqXj1DSGWvhyZFI70EUVTv3tf3VkEAWmDLwV8xmmehe17+6DIymFHkL6fKaJS2BFk5+8RzUlVwY9qG0ViY2XwLfyzpV2KoEQX4C18NdsmAfzeJBiRDekg3ruGhpCi7wC+eXH4XqI9kc+Rs4wE+DZ+XNPeiKY0MoHtUHCyU6nTLOBnISoz84yuRETP6bqmLdrjiMhOjXw0zJKsx9oaxcC/1j4atizLdaah4GidYEEAbfC9NpVGsmsrVgTwe5PgZEkqUbaSP+iRds9CxuiPeo4ggr2z2A1Efg/dNs0CokV/Bgd7b3mf7X9EWQCpFF2ZhqiZDHDqFf0p79/zXYhajRWt7cgr/Wc/OOrli7U4DmllAb6eDRr4jKhAVDoyHtl/otNAfOrNt9YwIoJX8lr2QDYdYh1xIehN4QB+G46YUtW/2GHF4tfFWPvpGK7RMsCvBsP4F2SAptHv4atVGQDVe9/ZxLEh4AOiP+aMYMLnH48OAUj/fYeBsUBaCwgAAtQYEzvWAcgAEBAA4kwArCHknkkgAyADQEAACAgAAQEgIMC8dH3vJ4JI+B4ZABkAAgI4S8fFpCg2IwMgA0BAgOfT1BVclH6o+S+GR++3wbawmOO/BC5/t4RhLt93DWFUiwxU/ygCIZIEsH4FnJk/FY5+Edsk6zJa82McEI2V/qUKwH8yQNTz6wBfrwAUrwEwm7AFz6wI9GBvpSwQ2X9Dml3RbsWqBL4GPjOvhp2hHsihOzO/1FgH+Dnx2/PuJFDQecanP1ZnhBnlcVl0Dttn8Btahnnfmg3w5YcAzKcLDlVp3wyKNhxkfC1kWRK/GfRgbPVHo7RlbGGedy3wWBdmvnEA/qb0s3GSw4BlpFgQLqIdKgTISgINIrR8OnZFxxeRa4RDsf6/oZ27MCBthlUrmipFv8g6gMeb9wBfLphEnoxh5luQwBz8W4n2TNMNhgMb3820J7YUvAVMZAL/wBHvHJnAF/zZNkkj2rdGdhciaPlnS7ubUzBIkB980RpAaoGicl2wA3y1U9q0E2TWBLNKNtD2w572h6Zh96uoF3vaz5wR9urPzBfaQSZ1no8NouD1sixfk2B/TkTfovtUjACWCkceGiztk+rL/JNpxYMj1jZJ9ueyc7fCjmEvG1zOBko75r44vJXu91C0CjqN9pn51itw1Cps64slJHSLpIuVbmoLQTOXGFjvLKJnxBj4iwhBQlEY7hWBHhLJJ9TRaADvQIAtlXoVIkS2m6I7IzMRMthqfjh0S8F1sDv7LAHoZ1u2knt990h7rq7S4VBPWyi787ycWOVy7DCvh0t8M38kV4JgX0meFIr0mTtkcVV1W1jEYjZ0dY0dQc0JkJkMWaaubebXAL0QASKRIftqJa5lbwQ2BPJE/gA4gL5xbiNHuQAAAABJRU5ErkJggg==")
  16344. , b = d.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFgoIKnA4CwAAAkVJREFUeNrt3Uluw0AMRFHTvv+NrSibBAgyILGjodn16gbS/yxyYUOXi0SnZnyodV3XXV5WVREgBHaKFAV6tgwFerYMBXq2DAV8tggFfLYIBXy2CAV8tggFfrYEBXy2CAV+tgQFfrYEBXy2CAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgRXry5cHNOf3QIFfrYEBX62BG4AN4DpT26BAj9bAivACjD9yS2gATSA6U9uAQ2gAUx/cgtoAA1g+pNbQAOEhwBWgPpPXgMawAoQK0D9x64BDWAFiBWg/mPXgAawAoQAQgAJPgIdgLmHoAawAoQAQgAhgBBACCAEEAIIAYQAQgAhgBBACCAEEAIIAYQAQgAhgEwQfw1LBe+vYUIAIQAB3rIsy4vXEXwEOgTzDkArQAhgBXyKNZBT/xpACGAFfBNrIKP+NYAQwAr4IdbA/PWvAcR3A5OnXwOIbwcnT78GkN8bQAvMO/1/bgA/FglvAC0w5/Q/JAAJ5oPvCJTHGkALzDX9TwlAgnngPy0ACeaA7waQ5xtAC/Sf/n8LQILe8DcRgAR94W8mAAl6wt9UABL0g7+5ACToBX8XAUjQB/5uApCgB/xdBSDB+PB3F4AEY8M/RAAijAn+cAFIMB78wwUgwVjwTxGACGOAf8/1zAf2a+Nz4Z/aANrgXPBDCZAmwgjghxRgdhFGAj+0ALOJMCL4FgJ0lmFk6C0F6CBDF+jtBfiY+/2+3G63K+ihAhzZEN1hi3zJK04kLKvtOfg1AAAAAElFTkSuQmCC")
  16345. , w = new r.PlaneBufferGeometry(1,1);
  16346. n.prototype = Object.create(y.prototype),
  16347. n.raycaster = new r.Raycaster,
  16348. n.prototype.bindEvents = function() {
  16349. this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
  16350. this.billboard.on(A.LEAVE, this.setFreeState.bind(this))
  16351. }
  16352. ,
  16353. n.prototype.build = function() {
  16354. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  16355. this.floor && (this.billboard.build(this.model.sid),
  16356. this.obj3d = this.buildObject3D(),
  16357. this.floor.add(this.obj3d)),
  16358. this
  16359. }
  16360. ,
  16361. n.prototype.buildObject3D = function() {
  16362. var e = new r.Object3D;
  16363. e.position.copy(this.position);
  16364. var t = r.UniformsUtils.clone(f.tagDisc.uniforms);
  16365. t.bg.value = b,
  16366. t.mask.value = E,
  16367. t.color.value.copy(this.color),
  16368. this.materials.disc = new r.RawShaderMaterial({
  16369. transparent: !0,
  16370. vertexShader: f.tagDisc.vertexShader,
  16371. fragmentShader: f.tagDisc.fragmentShader,
  16372. uniforms: t
  16373. }),
  16374. this.disc = new r.Mesh(w,this.materials.disc),
  16375. this.disc.layers.set(c.TAG),
  16376. this.disc.position.copy(this.discPosition),
  16377. this.disc.renderOrder = h.tagDisc,
  16378. this.disc.tag = this;
  16379. var i = this.buildPole();
  16380. return i.layers.set(c.TAG),
  16381. i.renderOrder = h.tagStem,
  16382. e.add(i),
  16383. e.layers.set(c.TAG),
  16384. e.add(this.disc)
  16385. }
  16386. ,
  16387. n.prototype.buildPole = function() {
  16388. var e = new r.BufferGeometry
  16389. , t = new Float32Array(6);
  16390. return t[0] = t[1] = t[2] = 0,
  16391. t[3] = this.discPosition.x,
  16392. t[4] = this.discPosition.y,
  16393. t[5] = this.discPosition.z,
  16394. e.addAttribute("position", new r.BufferAttribute(t,3)),
  16395. this.materials.pole = new r.LineBasicMaterial({
  16396. linewidth: a.tags.pole.width,
  16397. color: a.tags.pole.color,
  16398. opacity: 0,
  16399. visible: this.poleEnabled,
  16400. transparent: !0,
  16401. depthWrite: !1
  16402. }),
  16403. new r.Line(e,this.materials.pole)
  16404. }
  16405. ,
  16406. n.prototype.setFreeState = function(e) {
  16407. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  16408. this.materials.disc.uniforms.color.value = this.color
  16409. }
  16410. .bind(this))
  16411. }
  16412. ,
  16413. n.prototype.setHoverState = function(e) {
  16414. this.billboard.open(e),
  16415. this.materials.disc.uniforms.color.value = this.hoverColor
  16416. }
  16417. ,
  16418. n.prototype.hide = function(e, t) {
  16419. var i = $.Deferred();
  16420. if (0 === this.materials.disc.uniforms.opacity.value && !g.isRunning(this.visibleTransition))
  16421. return i.resolve().promise();
  16422. e = e || 0,
  16423. t = t || 0,
  16424. g.cancel(this.visibleTransition);
  16425. var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity
  16426. , r = t + e
  16427. , o = t / r;
  16428. return this.visibleTransition = g.start(function(e) {
  16429. var t = m.property(e.materials.disc.uniforms.opacity, "value", 0)
  16430. , i = m.property(e.materials.pole, "opacity", 0);
  16431. return function(n) {
  16432. t(n),
  16433. e.materials.pole && i(n)
  16434. }
  16435. }(this), r * n, function() {
  16436. i.resolve()
  16437. }, o, v[a.warp.blendEasing]),
  16438. i.promise()
  16439. }
  16440. ,
  16441. n.prototype.show = function(e, t) {
  16442. var i = $.Deferred();
  16443. if (this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity && !g.isRunning(this.visibleTransition))
  16444. return i.resolve().promise();
  16445. e = e || 0,
  16446. t = t || 0,
  16447. g.cancel(this.visibleTransition);
  16448. var n = (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / a.tags.disc.opacity
  16449. , r = t + e
  16450. , o = t / r;
  16451. return this.visibleTransition = g.start(function(e) {
  16452. var t = m.property(e.materials.disc.uniforms.opacity, "value", a.tags.disc.opacity)
  16453. , i = m.property(e.materials.pole, "opacity", a.tags.pole.opacity);
  16454. return function(n) {
  16455. t(n),
  16456. e.materials.pole && i(n)
  16457. }
  16458. }(this), r * n, function() {
  16459. i.resolve()
  16460. }, o, v[a.warp.blendEasing]),
  16461. i.promise()
  16462. }
  16463. ,
  16464. n.prototype.closestPanoTowardTag = function(e, t) {
  16465. var i = []
  16466. , o = []
  16467. , l = this.disc.getWorldPosition();
  16468. if (e === s.PANORAMA) {
  16469. var c = .5
  16470. , h = t.position.clone().sub(l).normalize();
  16471. i.push(p.filters.isPanoAligned()),
  16472. i.push(p.filters.inPanoDirection(l, h, c)),
  16473. i.push(p.filters.isNeighbourPanoTo(t)),
  16474. o.push(p.scoreFunctions.direction(l, h))
  16475. }
  16476. var u = new r.Vector3
  16477. , d = function(e) {
  16478. u.copy(l).sub(e.position);
  16479. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  16480. , i = a.tags.navigate.tiltTolerance;
  16481. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  16482. }
  16483. , f = function(e) {
  16484. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  16485. };
  16486. i.push(f, d),
  16487. o.push(p.scoreFunctions.distanceSquared(this, -2));
  16488. var g = this.model.panos.sortByScore(i, o);
  16489. if (a.tags.navigate.lineOfSight) {
  16490. for (var m = 0; m < g.length; m++) {
  16491. var v = g[m].pano
  16492. , A = v.position.distanceTo(l);
  16493. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
  16494. return null;
  16495. n.raycaster.set(v.position, l.clone().sub(v.position).normalize());
  16496. var y = n.raycaster.intersectObjects(this.model.colliders);
  16497. if (0 === y.length || y[0].distance > A)
  16498. return v
  16499. }
  16500. return null
  16501. }
  16502. return g.length > 0 && g[0].pano
  16503. }
  16504. ,
  16505. n.prototype.examine = function(e) {
  16506. var t = e.mode
  16507. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  16508. , n = this.disc.getWorldPosition();
  16509. this.billboard.setActiveState();
  16510. var o = function() {
  16511. var t = this.billboard.getDimensions()
  16512. , n = new r.Vector3;
  16513. u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
  16514. n.unproject(e.camera),
  16515. e.flyToPano({
  16516. pano: i,
  16517. lookAtPoint: n
  16518. })
  16519. }
  16520. .bind(this);
  16521. if (t === s.PANORAMA)
  16522. if (i !== e.currentPano) {
  16523. var l = {
  16524. pano: i,
  16525. lookAtPoint: n,
  16526. duration: null,
  16527. maxDistanceOverride: null,
  16528. skipWarpingCheck: !1
  16529. };
  16530. e.flyToPano(l, o)
  16531. } else
  16532. setTimeout(function() {
  16533. this.billboard.open().then(function() {
  16534. o()
  16535. })
  16536. }
  16537. .bind(this), 0);
  16538. else {
  16539. var c = {
  16540. pano: i
  16541. };
  16542. if (n) {
  16543. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  16544. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  16545. }
  16546. c.callback = o,
  16547. c.duration = 1500,
  16548. c.mode = s.PANORAMA,
  16549. e.flyToNewMode(c)
  16550. }
  16551. }
  16552. ,
  16553. n.prototype.update = function(e, t) {
  16554. var i = new r.Vector3;
  16555. return function(e, t) {
  16556. this.discWorldPosition = this.disc.getWorldPosition(),
  16557. this.updateDisc(e, t),
  16558. this.billboard.needsUpdate() && (i.copy(this.discWorldPosition).project(t),
  16559. i.z < 1 && (i.y *= -1,
  16560. this.billboard.update(i, this.getDiscRadius(i, t))))
  16561. }
  16562. }(),
  16563. n.prototype.updateDisc = function(e, t) {
  16564. var i = new r.Vector3
  16565. , o = new r.Vector3
  16566. , l = new r.Vector3
  16567. , c = new r.Vector3
  16568. , h = new r.Vector3;
  16569. return function(e, t) {
  16570. var u = a.tags.visibility
  16571. , d = a.tags.disc.scale
  16572. , p = e === s.DOLLHOUSE || e === s.FLOORPLAN ? a.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  16573. if (this.obj3d.visible = 0 !== this.disc.material.opacity && (u.anyDistance || p <= u.visibleDistance || e === s.TRANSITIONING) && (!u.hideViaFloor || this.tagVisibleOnCurrentFloor(e)) && (!u.hideOffScreenDisc || !this.offScreen(this.disc, t)) && (!u.hideOffScreenObject || !this.offScreen(this.obj3d, t)),
  16574. this.obj3d.visible) {
  16575. this.disc.quaternion.copy(t.quaternion);
  16576. var f = d.maxSize - (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound);
  16577. i.copy(this.discWorldPosition).project(t),
  16578. o.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(i),
  16579. l.set(f / 2, 0, 0).add(o),
  16580. c.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(l),
  16581. h.copy(c).unproject(t);
  16582. var g = h.distanceTo(this.discWorldPosition)
  16583. , m = 1 + a.tags.disc.scale.responsiveness / 100 * (n.viewportScale() - 1);
  16584. this.discScale = g * m,
  16585. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  16586. }
  16587. }
  16588. }(),
  16589. n.prototype.getDiscRadius = function(e, t) {
  16590. var i = new r.Vector3;
  16591. return function(e, t) {
  16592. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  16593. Math.abs(e.x - i.x) * $("#player").width()
  16594. }
  16595. }(),
  16596. n.prototype.tagVisibleOnCurrentFloor = function(e) {
  16597. return !(e === s.DOLLHOUSE || e === s.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  16598. }
  16599. ,
  16600. n.prototype.offScreen = function(e, t) {
  16601. var i = e.getWorldPosition().project(t);
  16602. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  16603. }
  16604. ,
  16605. n.viewportScale = function() {
  16606. return n.viewportWidth === $("#player").width() && n.viewportHeight === $("#player").height() || (n.viewportWidth = $("#player").width(),
  16607. n.viewportHeight = $("#player").height(),
  16608. n.currentViewportScale = Math.sqrt(Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize)),
  16609. n.currentViewportScale
  16610. }
  16611. ,
  16612. t.exports = n
  16613. }
  16614. ).call(this, "/js/tag/tag.js")
  16615. }
  16616. , {
  16617. "../enum/Colors": 19,
  16618. "../enum/RenderLayers": 41,
  16619. "../enum/RenderOrder": 42,
  16620. "../enum/Viewmode": 51,
  16621. "../objects/Panorama": 148,
  16622. "../settings": 166,
  16623. "../shaders": 167,
  16624. "../util/common": 185,
  16625. "../util/easing": 186,
  16626. "../util/lerp": 188,
  16627. "../util/logger": 189,
  16628. "../util/math": 190,
  16629. "../util/texture": 194,
  16630. "../util/transitions": 195,
  16631. "./Billboard/Billboard": 119,
  16632. "./Billboard/BillboardEvent": 120,
  16633. events: 202,
  16634. three: 217
  16635. }],
  16636. 124: [function(e, t, i) {
  16637. (function(i) {
  16638. "use strict";
  16639. function n() {
  16640. this.tagState = y.IDLE,
  16641. this.intersectTag = null,
  16642. this.hoveredTag = null,
  16643. this.activeTag = null,
  16644. this.tagDiscs = [],
  16645. this.raycaster = new r.Raycaster,
  16646. this.modelManager = null,
  16647. this.player = null,
  16648. this.totaltags = 0,
  16649. this.navigatingViaTag = !1,
  16650. this.enabled = !1
  16651. }
  16652. var r = e("three")
  16653. , o = e("../util/logger")
  16654. , a = e("../util/common")
  16655. , s = e("../controls/serializer")
  16656. , l = e("../objects/Snapshot")
  16657. , c = e("../settings")
  16658. , h = e("./Billboard/BillboardEvent")
  16659. , u = e("./Media/MediaEvent")
  16660. , d = e("./Media/LinkType")
  16661. , p = e("../enum/Viewmode")
  16662. , f = e("../enum/WarpStyle")
  16663. , g = e("../enum/BlackoutStyle")
  16664. , m = e("../enum/ModelManagerEvents")
  16665. , v = e("../enum/tagEvents")
  16666. , A = e("../enum/PlayerEvents")
  16667. , y = (e("../util/lerp"),
  16668. e("../enum/TagStates"))
  16669. , C = e("events").EventEmitter
  16670. , I = new o(i);
  16671. a.extend(n, C),
  16672. n.prototype.init = function(e, t) {
  16673. this.modelManager = e,
  16674. this.player = t,
  16675. this.updateModel(),
  16676. this.bindEvents()
  16677. }
  16678. ,
  16679. n.prototype.update = function(e) {
  16680. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  16681. }
  16682. ,
  16683. n.prototype.updateTags = function(e, t, i, n) {
  16684. for (var r in this.model.tags)
  16685. this.model.tags[r].update(e, t, i, n)
  16686. }
  16687. ,
  16688. n.prototype.updateModel = function() {
  16689. this.model = this.modelManager.getActiveModel(),
  16690. this.gettagsFromModel(),
  16691. this.totaltags = Object.keys(this.model.tags).length
  16692. }
  16693. ,
  16694. n.prototype.gettagsFromModel = function() {
  16695. this.tagDiscs = [];
  16696. for (var e in this.model.tags) {
  16697. var t = this.model.tags[e].disc;
  16698. t && this.tagDiscs.push(t)
  16699. }
  16700. }
  16701. ,
  16702. n.prototype.bindEvents = function() {
  16703. function e() {
  16704. Object.keys(this.model.tags).forEach(function(e) {
  16705. var t = this.model.tags[e];
  16706. t.bindEvents(),
  16707. t.billboard.on(u.LINK_CLICK, function(e) {
  16708. e.type === d.NAVIGATION && this.navigateViaLink(e.url)
  16709. }
  16710. .bind(this)),
  16711. t.billboard.on(u.IMAGE_OPENED, function() {
  16712. this.tagState = y.EXAMINE,
  16713. this.emit(u.IMAGE_OPENED)
  16714. }
  16715. .bind(this)),
  16716. t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this))
  16717. }
  16718. .bind(this))
  16719. }
  16720. this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
  16721. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  16722. this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
  16723. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  16724. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  16725. this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  16726. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  16727. this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  16728. e.call(this)
  16729. }
  16730. ,
  16731. n.prototype.navigateViaLink = function(e) {
  16732. var t = s.deserialize(e);
  16733. if (t)
  16734. if (t.mode === p.PANORAMA) {
  16735. try {
  16736. this.player.model.panos.get(t.panoId)
  16737. } catch (e) {
  16738. return void I.warn("Unable to find panorama location", t.panoId)
  16739. }
  16740. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK)
  16741. } else {
  16742. var i = {
  16743. cameraMode: t.mode,
  16744. position: t.position,
  16745. quaternion: t.quaternion,
  16746. scanId: t.panoId,
  16747. orthoZoom: t.zoom,
  16748. floorVisibility: t.floorVisibility,
  16749. thumbUrl: null,
  16750. name: null
  16751. };
  16752. this.player.flyToNewMode({
  16753. mode: t.mode,
  16754. duration: c.warp.outsideTime,
  16755. warpDest: new l(i),
  16756. force: !0
  16757. })
  16758. }
  16759. }
  16760. ,
  16761. n.prototype.handleWarpStart = function(e, t, i, n) {
  16762. this.dismissExaminedTag(),
  16763. t === f.BLACK && (null !== n && void 0 !== n || (n = c.warp.teleportTime),
  16764. e && (i = g.END),
  16765. this.hideShowTagsForBlackoutStyle(i, n))
  16766. }
  16767. ,
  16768. n.prototype.handleWarpInterruption = function(e, t, i) {
  16769. null !== i && void 0 !== i || (i = c.warp.teleportTime),
  16770. this.hideShowTagsForBlackoutStyle(t, i)
  16771. }
  16772. ,
  16773. n.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  16774. var i = 0
  16775. , n = 0
  16776. , r = t / 2;
  16777. switch (null !== e && void 0 !== e || (e = g.MIDDLE),
  16778. e) {
  16779. case g.END:
  16780. this.hideAlltags(r);
  16781. break;
  16782. case g.BEGINNING:
  16783. this.hideAlltags().done(this.showAlltags.bind(this, r));
  16784. break;
  16785. case g.NONE:
  16786. break;
  16787. case g.MIDDLE:
  16788. i = r,
  16789. n = r,
  16790. this.hideAlltags(n),
  16791. setTimeout(function() {
  16792. this.showAlltags(i)
  16793. }
  16794. .bind(this), n);
  16795. break;
  16796. case g.FADEIN:
  16797. setTimeout(function() {
  16798. this.showAlltags(r)
  16799. }
  16800. .bind(this), r)
  16801. }
  16802. }
  16803. ,
  16804. n.prototype.onPlayerModeChanging = function(e, t) {
  16805. t !== p.PANORAMA && this.dismissExaminedTag(),
  16806. t === p.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = p.OUTDOOR);
  16807. var i = t !== p.OUTDOOR;
  16808. i !== this.model.tagsShown && (i ? this.showAlltags(c.tags.startup.fadeInDuration) : this.hideAlltags(c.tags.startup.fadeInDuration))
  16809. }
  16810. ,
  16811. n.prototype.onPanoChange = function(e, t) {
  16812. var i = this.navigatingViaTag;
  16813. if (this.navigatingViaTag = !1,
  16814. !i) {
  16815. this.dismissExaminedTag();
  16816. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA
  16817. , r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA;
  16818. n !== r && (r === p.PANORAMA ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(c.tags.startup.fadeInDuration))
  16819. }
  16820. }
  16821. ,
  16822. n.prototype.onPlayerReady = function(e, t, i) {
  16823. this.startAlltags(e, t ? i : null)
  16824. }
  16825. ,
  16826. n.prototype.onPlayerFlyingEnded = function(e, t) {
  16827. this.updateClosestTags(e)
  16828. }
  16829. ,
  16830. n.prototype.dismissExaminedTag = function() {
  16831. this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(),
  16832. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  16833. this.hoveredTag = null)
  16834. }
  16835. ,
  16836. n.prototype.startAlltags = function(e, t) {
  16837. this.model.shouldShowtags = c.tags.enabled,
  16838. this.enabled = !0,
  16839. e || (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
  16840. t && setTimeout(function() {
  16841. this.activateTag(this.model.getTagBySid(t))
  16842. }
  16843. .bind(this), c.tags.startup.fadeInDuration / 2))
  16844. }
  16845. ,
  16846. n.prototype.showAlltags = function(e, t, i) {
  16847. function n() {
  16848. o++,
  16849. o === this.totaltags && (this.model.tagsShown = !0,
  16850. r.resolve())
  16851. }
  16852. var r = $.Deferred();
  16853. if (!i && this.player.mode === p.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  16854. return r.resolve().promise();
  16855. var o = 0;
  16856. for (var a in this.model.tags) {
  16857. var s = this.model.tags[a];
  16858. s.show(e, t).done(n.bind(this))
  16859. }
  16860. return r.promise()
  16861. }
  16862. ,
  16863. n.prototype.hideAlltags = function(e, t) {
  16864. function i() {
  16865. r++,
  16866. r === this.totaltags && (this.model.tagsShown = !1,
  16867. n.resolve())
  16868. }
  16869. var n = $.Deferred()
  16870. , r = 0;
  16871. for (var o in this.model.tags) {
  16872. var a = this.model.tags[o];
  16873. a.hide(e, t).done(i.bind(this)),
  16874. a === this.activeTag && this.dismissActiveTag()
  16875. }
  16876. return n.promise()
  16877. }
  16878. ,
  16879. n.prototype.enableHovering = function() {
  16880. this.enabled = !0
  16881. }
  16882. ,
  16883. n.prototype.disableHovering = function() {
  16884. this.enabled = !1
  16885. }
  16886. ,
  16887. n.prototype.activateTag = function(e, t) {
  16888. t = t || y.EXAMINE,
  16889. this.activeTag = e,
  16890. this.activeTag.hoveringDisc = !0,
  16891. this.activeTag.setHoverState(t === y.EXAMINE),
  16892. this.tagState = t,
  16893. this.emit(v.TagActivated, e)
  16894. }
  16895. ,
  16896. n.prototype.dismissActiveTag = function() {
  16897. this.activeTag.hoveringDisc = !1,
  16898. this.activeTag.setFreeState(!0);
  16899. var e = this.activeTag;
  16900. this.activeTag = null,
  16901. this.tagState = y.IDLE,
  16902. this.emit(v.TagDismissed, e)
  16903. }
  16904. ,
  16905. n.prototype.clickedOnTag = function(e) {
  16906. var t = function() {
  16907. this.navigatingViaTag = !0,
  16908. this.activeTag.examine(this.player),
  16909. this.emit(v.TagNavigation, this.activeTag)
  16910. }
  16911. .bind(this);
  16912. return this.tagState !== y.EXAMINE ? (this.activateTag(this.intersectTag, y.EXAMINE),
  16913. this.activeTag = this.intersectTag,
  16914. t(),
  16915. !0) : (this.dismissActiveTag(),
  16916. !1)
  16917. }
  16918. ,
  16919. n.prototype.intersecttag = function() {
  16920. var e = new r.Vector3
  16921. , t = new r.Vector3
  16922. , i = new r.Vector3;
  16923. return function(n, r, o) {
  16924. if (!this.enabled)
  16925. return null;
  16926. var a = null
  16927. , s = this.tagDiscs.filter(function(e) {
  16928. return e.parent.visible
  16929. });
  16930. if (s.length > 0) {
  16931. var l = this.model.floors.reduce(function(e, t) {
  16932. return t.hidden ? e : e.concat(t.collider.children)
  16933. }, s);
  16934. e.set(n.x, n.y, -1).unproject(o),
  16935. t.set(n.x, n.y, 1).unproject(o),
  16936. i.copy(t).sub(e).normalize(),
  16937. this.raycaster.set(e, i);
  16938. var c = this.raycaster.intersectObjects(l);
  16939. c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag)
  16940. }
  16941. return this.intersectTag = a,
  16942. r && (this.activeTag && a !== this.activeTag && (this.tagState === y.BROWSE || this.tagState === y.EXAMINE && a) && this.dismissActiveTag(),
  16943. a && a !== this.activeTag && (a.listeners(h.ENTER).length < 1 && (a.billboard.on(h.ENTER, function() {
  16944. this.hoveredTag = a
  16945. }
  16946. .bind(this)),
  16947. a.billboard.on(h.LEAVE, function() {
  16948. this.hoveredTag = null
  16949. }
  16950. .bind(this))),
  16951. this.activateTag(a, y.BROWSE))),
  16952. a
  16953. }
  16954. }(),
  16955. n.prototype.rankedtagInDirection = function() {
  16956. var e = []
  16957. , t = []
  16958. , i = new r.Vector3
  16959. , n = new r.Vector3
  16960. , o = new r.Vector3;
  16961. return function(r, a, s, l) {
  16962. var c = 0;
  16963. t.length = 0;
  16964. for (var h = 0; h < this.closesttags.length; h++) {
  16965. var u = this.closesttags[h];
  16966. n.copy(u.position),
  16967. n.add(u.discPosition),
  16968. i.copy(a),
  16969. i.sub(n).negate(),
  16970. i.normalize();
  16971. var d = i.dot(l);
  16972. if (d >= 0) {
  16973. o.copy(n),
  16974. o.project(s);
  16975. var p = this.intersecttag(o, !1, s);
  16976. if (p) {
  16977. if (c >= e.length)
  16978. for (var f = 0; f < 64; f++)
  16979. e.push({
  16980. tag: u,
  16981. dot: d
  16982. });
  16983. var g = e[c];
  16984. g.tag = u,
  16985. g.dot = d,
  16986. g.position = math.projectPositionToCanvas(n, s),
  16987. t.push(g),
  16988. c++
  16989. }
  16990. }
  16991. }
  16992. return t.sort(function(e, t) {
  16993. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  16994. }),
  16995. r < t.length ? t[r].tag : null
  16996. }
  16997. }(),
  16998. n.prototype.updateClosestTags = function() {
  16999. var e = new r.Vector3
  17000. , t = 30;
  17001. return function(i) {
  17002. this.closesttags || (this.closesttags = []),
  17003. this.closesttags.length = 0;
  17004. var n = this.model.tags;
  17005. if (n)
  17006. for (var r in n)
  17007. if (n.hasOwnProperty(r)) {
  17008. var o = n[r]
  17009. , a = o.position;
  17010. e.copy(i),
  17011. e.sub(a).negate();
  17012. var s = e.lengthSq();
  17013. s < t && this.closesttags.push(o)
  17014. }
  17015. }
  17016. }(),
  17017. t.exports = n
  17018. }
  17019. ).call(this, "/js/tag/tagManager.js")
  17020. }
  17021. , {
  17022. "../controls/serializer": 14,
  17023. "../enum/BlackoutStyle": 18,
  17024. "../enum/tagEvents": 32,
  17025. "../enum/ModelManagerEvents": 33,
  17026. "../enum/PlayerEvents": 40,
  17027. "../enum/TagStates": 44,
  17028. "../enum/Viewmode": 51,
  17029. "../enum/WarpStyle": 52,
  17030. "../objects/Snapshot": 153,
  17031. "../settings": 166,
  17032. "../util/common": 185,
  17033. "../util/lerp": 188,
  17034. "../util/logger": 189,
  17035. "./Billboard/BillboardEvent": 120,
  17036. "./Media/LinkType": 130,
  17037. "./Media/MediaEvent": 131,
  17038. events: 202,
  17039. three: 217
  17040. }],
  17041. 125: [function(e, t, i) {
  17042. (function(i) {
  17043. "use strict";
  17044. function n() {
  17045. this.embedWrapper = null,
  17046. this.embedElement = null
  17047. }
  17048. var r = e("../../util/ajax")
  17049. , o = e("./mediaSettings")
  17050. , a = e("../../settings")
  17051. , s = e("../../util/logger")
  17052. , l = new s(i);
  17053. n.prototype.createDomElement = function() {
  17054. return this.embedWrapper = document.createElement("div"),
  17055. this.embedWrapper.classList.add("tag-embed"),
  17056. this.embedWrapper.classList.add("hidden"),
  17057. this.embedWrapper
  17058. }
  17059. ,
  17060. n.prototype.load = function(e) {
  17061. var t = "https://api.embedly.com/1/oembed?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + o.maxEmbedWidth;
  17062. return new Promise(function(e, i) {
  17063. r.get(t).then(function(t) {
  17064. if (t = JSON.parse(t),
  17065. t.html && t.html.indexOf("<script") === -1) {
  17066. this.embedWrapper.innerHTML = t.html;
  17067. var n = Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth;
  17068. if (this.embedWrapper.style.width = n + "px",
  17069. t.height) {
  17070. var r = t.height / t.width;
  17071. this.embedWrapper.style.height = n * r + "px"
  17072. }
  17073. this.embedElement = this.embedWrapper.firstChild;
  17074. var a = [];
  17075. try {
  17076. a = [].slice.call(this.embedElement.querySelectorAll("a"))
  17077. } catch (e) {
  17078. l.debug("Error getting `a` elements for embed; was it an iframe?")
  17079. }
  17080. a.forEach(function(e) {
  17081. e.setAttribute("target", "_blank")
  17082. }),
  17083. this.embedElement.classList.add("hidden"),
  17084. this.embedWrapper.classList.remove("hidden"),
  17085. e()
  17086. } else
  17087. i("Not a valid embed")
  17088. }
  17089. .bind(this), function(e) {
  17090. i(e.response)
  17091. })
  17092. }
  17093. .bind(this))
  17094. }
  17095. ,
  17096. n.prototype.show = function() {
  17097. this.embedElement && this.embedElement.classList.remove("hidden")
  17098. }
  17099. ,
  17100. n.prototype.hide = function() {
  17101. this.embedElement && this.embedElement.classList.add("hidden")
  17102. }
  17103. ,
  17104. t.exports = n
  17105. }
  17106. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  17107. }
  17108. , {
  17109. "../../settings": 166,
  17110. "../../util/ajax": 181,
  17111. "../../util/logger": 189,
  17112. "./mediaSettings": 132
  17113. }],
  17114. 126: [function(e, t, i) {
  17115. (function(i) {
  17116. "use strict";
  17117. function n(e) {
  17118. o.call(this),
  17119. this.options = e,
  17120. this.playerControls = null,
  17121. this.state = s.NOT_READY
  17122. }
  17123. var r = e("../../util/browser")
  17124. , o = e("./EmbedlyEmbed")
  17125. , a = e("../../util/logger")
  17126. , s = (new a(i),
  17127. Object.freeze({
  17128. NOT_READY: "player.not.ready",
  17129. CUED: "player.cued",
  17130. PLAYING: "player.playing",
  17131. PAUSED: "player.paused"
  17132. }));
  17133. n.prototype = Object.create(o.prototype),
  17134. n.prototype.createDomElement = function() {
  17135. return this.embedWrapper = document.createElement("div"),
  17136. this.embedWrapper.classList.add("tag-video"),
  17137. this.embedWrapper.classList.add("hidden"),
  17138. this.embedWrapper
  17139. }
  17140. ,
  17141. n.prototype.load = function(e) {
  17142. var t = function() {
  17143. function e(e) {
  17144. this.playerState = s.CUED,
  17145. this.options.startMuted && this.playerControls.mute()
  17146. }
  17147. function t(e) {
  17148. this.playerState = e
  17149. }
  17150. function i(e) {
  17151. this.playerControls.setCurrentTime(0),
  17152. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  17153. }
  17154. this.playerControls = new playerjs.Player(this.embedElement),
  17155. this.playerControls.on("ready", e.bind(this)),
  17156. this.playerControls.on("play", t.bind(this, s.PLAYING)),
  17157. this.playerControls.on("pause", t.bind(this, s.PAUSED)),
  17158. this.playerControls.on("ended", i.bind(this))
  17159. }
  17160. .bind(this);
  17161. return o.prototype.load.call(this, e).then(t.bind(this))
  17162. }
  17163. ,
  17164. n.prototype.play = function() {
  17165. var e = r.isMobile();
  17166. return function() {
  17167. this.playerState !== s.NOT_READY && this.playerControls && !e && (this.state === s.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  17168. }
  17169. }(),
  17170. n.prototype.pause = function() {
  17171. this.playerState !== s.NOT_READY && this.playerControls && this.playerControls.pause()
  17172. }
  17173. ,
  17174. t.exports = n
  17175. }
  17176. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  17177. }
  17178. , {
  17179. "../../util/browser": 182,
  17180. "../../util/logger": 189,
  17181. "./EmbedlyEmbed": 125
  17182. }],
  17183. 127: [function(e, t, i) {
  17184. (function(i) {
  17185. "use strict";
  17186. function n(e) {
  17187. function t() {
  17188. return a.debug("requesting file from embedly:", e.href),
  17189. r.get(e.href, {
  17190. responseType: e.responseType
  17191. }).then(function(t) {
  17192. return a.debug("requesting file finished:", e.href),
  17193. t
  17194. })
  17195. }
  17196. function i() {}
  17197. return s = new Promise(function(e, n) {
  17198. s.catch(i).then(function() {
  17199. t().then(e, n)
  17200. })
  17201. }
  17202. )
  17203. }
  17204. var r = e("../../util/ajax")
  17205. , o = (e("./mediaSettings"),
  17206. e("../../util/logger"))
  17207. , a = new o(i)
  17208. , s = Promise.resolve();
  17209. t.exports.enqueue = n
  17210. }
  17211. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  17212. }
  17213. , {
  17214. "../../util/ajax": 181,
  17215. "../../util/logger": 189,
  17216. "./mediaSettings": 132
  17217. }],
  17218. 128: [function(e, t, i) {
  17219. (function(i) {
  17220. "use strict";
  17221. function n() {
  17222. this.imageWrapper = null,
  17223. this.width = 0,
  17224. this.height = 0,
  17225. this.aspect = 1
  17226. }
  17227. var r = e("./MediaEvent")
  17228. , o = e("./EmbedlyQueue")
  17229. , a = e("events").EventEmitter
  17230. , s = e("../../util/logger")
  17231. , l = e("../../settings");
  17232. new s(i);
  17233. n.prototype = Object.create(a.prototype),
  17234. n.prototype.createDomElement = function() {
  17235. return this.imageWrapper = document.createElement("div"),
  17236. this.imageWrapper.classList.add("tag-image"),
  17237. this.imageWrapper.classList.add("hidden"),
  17238. this.imageWrapper.addEventListener("click", function(e) {
  17239. e.stopPropagation(),
  17240. this.emit(r.IMAGE_OPENING),
  17241. this.imageWrapper.style.pointerEvents = "none"
  17242. }
  17243. .bind(this)),
  17244. this.imageWrapper
  17245. }
  17246. ,
  17247. n.prototype.onClosed = function() {
  17248. this.imageWrapper.style.pointerEvents = "auto"
  17249. }
  17250. ,
  17251. n.prototype.load = function(e) {
  17252. var t = Math.max(window.screen.height, window.screen.width)
  17253. , i = "https://i.embed.ly/1/display/resize?key=" + l.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  17254. return new Promise(function(e, t) {
  17255. function n(t) {
  17256. var i = t.target;
  17257. this.width = i.naturalWidth,
  17258. this.height = i.naturalHeight,
  17259. this.aspect = this.width / this.height;
  17260. var n = t.target.src;
  17261. this.imageWrapper.style.backgroundImage = 'url("' + n + '")',
  17262. this.imageWrapper.style.width = this.width + "px",
  17263. this.imageWrapper.style.height = this.height + "px",
  17264. this.imageWrapper.classList.remove("hidden"),
  17265. e()
  17266. }
  17267. o.enqueue({
  17268. href: i,
  17269. responseType: "arraybuffer"
  17270. }).then(function(e) {
  17271. var t = new Uint8Array(e)
  17272. , i = new Blob([t])
  17273. , r = new window.Image;
  17274. r.addEventListener("load", n.bind(this));
  17275. var o = URL.createObjectURL(i);
  17276. r.src = o
  17277. }
  17278. .bind(this), t)
  17279. }
  17280. .bind(this))
  17281. }
  17282. ,
  17283. t.exports = n
  17284. }
  17285. ).call(this, "/js/tag/Media/Image.js")
  17286. }
  17287. , {
  17288. "../../settings": 166,
  17289. "../../util/logger": 189,
  17290. "./EmbedlyQueue": 127,
  17291. "./MediaEvent": 131,
  17292. events: 202
  17293. }],
  17294. 129: [function(e, t, i) {
  17295. "use strict";
  17296. function n(e) {
  17297. this.label = e.label,
  17298. this.href = e.url,
  17299. this.type = this.updateLinkForType(),
  17300. this.domElement = null,
  17301. this.id = c++
  17302. }
  17303. var r = e("./LinkType")
  17304. , o = e("./MediaEvent")
  17305. , a = e("../../util/browser")
  17306. , s = e("../../analytics")
  17307. , l = e("events").EventEmitter
  17308. , c = 0;
  17309. n.prototype = Object.create(l.prototype),
  17310. n.prototype.updateLinkForType = function() {
  17311. function e(e) {
  17312. var t = new RegExp("[#&?]start=([^#&?]*)")
  17313. , i = t.exec(e);
  17314. return i[1]
  17315. }
  17316. function t(e) {
  17317. return e + "&play=1"
  17318. }
  17319. var i = a.valueFromHash("m") || a.valueFromHash("model");
  17320. return this.href.indexOf("port.com/show") !== -1 || this.href.indexOf(window.location.host + "/show") !== -1 ? this.href.indexOf(i) !== -1 && this.href.indexOf("start=") !== -1 ? (this.href = e(this.href),
  17321. r.NAVIGATION) : (this.href = t(this.href),
  17322. r.MODEL) : r.EXT_LINK
  17323. }
  17324. ;
  17325. var h = {};
  17326. n.prototype.createDomElement = function() {
  17327. function e(e) {
  17328. switch (e.stopPropagation(),
  17329. h[this.id] = !0,
  17330. s.trackAlways("click_tag_link", {
  17331. link_type: this.type,
  17332. link_count: c,
  17333. links_clicked: Object.keys(h).length
  17334. }),
  17335. this.type) {
  17336. case r.MODEL:
  17337. window.location.replace(this.href);
  17338. break;
  17339. case r.EXT_LINK:
  17340. window.open(this.href, "_blank")
  17341. }
  17342. this.emit(o.LINK_CLICK, {
  17343. type: this.type,
  17344. url: this.href
  17345. })
  17346. }
  17347. if (this.domElement = document.createElement("a"),
  17348. this.domElement.classList.add("tag-link"),
  17349. this.domElement.textContent = this.label,
  17350. this.type === r.EXT_LINK) {
  17351. this.domElement.textContent += " ";
  17352. var t = document.createElement("i");
  17353. t.classList.add("icon-ext-link"),
  17354. t.title = "Link to external web site",
  17355. this.domElement.appendChild(t)
  17356. }
  17357. return this.domElement.addEventListener("click", e.bind(this)),
  17358. this.domElement
  17359. }
  17360. ,
  17361. t.exports = n
  17362. }
  17363. , {
  17364. "../../analytics": 4,
  17365. "../../util/browser": 182,
  17366. "./LinkType": 130,
  17367. "./MediaEvent": 131,
  17368. events: 202
  17369. }],
  17370. 130: [function(e, t, i) {
  17371. "use strict";
  17372. t.exports = {
  17373. NAVIGATION: "navigation",
  17374. MODEL: "model",
  17375. EXT_LINK: "ext-link"
  17376. }
  17377. }
  17378. , {}],
  17379. 131: [function(e, t, i) {
  17380. "use strict";
  17381. t.exports = Object.freeze({
  17382. LINK_CLICK: "mtmedia.link",
  17383. IMAGE_LOADED: "mtmedia.image.loaded",
  17384. IMAGE_OPENING: "mtmedia.image.opening",
  17385. IMAGE_OPENED: "mtmedia.image.opened",
  17386. IMAGE_CLOSING: "mtmedia.image.closing",
  17387. IMAGE_CLOSED: "mtmedia.image.closed",
  17388. VIDEO_START: "mtmedia.video.start",
  17389. VIDEO_PAUSE: "mtmedia.video.pause",
  17390. VIDEO_ENDED: "mtmedia.video.end"
  17391. })
  17392. }
  17393. , {}],
  17394. 132: [function(e, t, i) {
  17395. "use strict";
  17396. t.exports = Object.freeze({
  17397. maxEmbedWidth: 350,
  17398. defaultAspectRatio: .75
  17399. })
  17400. }
  17401. , {}],
  17402. 133: [function(e, t, i) {
  17403. "use strict";
  17404. t.exports = Object.freeze({
  17405. TEXT: "text",
  17406. LINK: "link",
  17407. IMAGE: "photo",
  17408. VIDEO: "video",
  17409. RICH: "rich"
  17410. })
  17411. }
  17412. , {}],
  17413. 134: [function(e, t, i) {
  17414. "use strict";
  17415. function n(e) {
  17416. this.capabilities = {
  17417. links: {
  17418. enable: e.supportLinks,
  17419. keepLabels: e.keepLinkLabels
  17420. }
  17421. }
  17422. }
  17423. var r = e("./DescriptionChunkType");
  17424. n.prototype.parse = function(e, t) {
  17425. var i = []
  17426. , n = e.split("[").map(function(e, t) {
  17427. return 0 === t ? e : "[" + e
  17428. });
  17429. return n.forEach(function(e) {
  17430. var n = this.findMarkdown(e);
  17431. if (n) {
  17432. if (n.url.indexOf("javascript:") !== -1)
  17433. return;
  17434. this.addLinkChunk(i, n, t),
  17435. this.addTextChunk(i, e.slice(n.markdown.length))
  17436. } else
  17437. this.addTextChunk(i, e)
  17438. }
  17439. .bind(this)),
  17440. i
  17441. }
  17442. ,
  17443. n.prototype.findMarkdown = function(e) {
  17444. var t = /\[([^\]]*)\]\((.*)\)/
  17445. , i = e.match(t);
  17446. if (i) {
  17447. for (var n = i[2], r = 1, o = 0; o < n.length && ("(" === n[o] ? r++ : ")" === n[o] && r--,
  17448. 0 !== r); )
  17449. o++;
  17450. var a = n.length - o;
  17451. return {
  17452. markdown: i[0].substring(0, i[0].length - a),
  17453. label: i[1],
  17454. url: i[2].substring(0, o)
  17455. }
  17456. }
  17457. }
  17458. ,
  17459. n.prototype.addTextChunk = function(e, t) {
  17460. 0 !== t.length && e.push({
  17461. type: r.TEXT,
  17462. text: t
  17463. })
  17464. }
  17465. ,
  17466. n.prototype.addLinkChunk = function(e, t) {
  17467. if (!this.capabilities.links.enable)
  17468. return void (this.capabilities.links.keepLabels && this.addTextChunk(e, t.label));
  17469. var i = {
  17470. label: t.label,
  17471. url: t.url
  17472. };
  17473. i.url.indexOf("://") === -1 && (i.url = "http://" + i.url),
  17474. e.push({
  17475. type: r.LINK,
  17476. link: i
  17477. })
  17478. }
  17479. ,
  17480. t.exports = n
  17481. }
  17482. , {
  17483. "./DescriptionChunkType": 133
  17484. }],
  17485. 135: [function(e, t, i) {
  17486. (function(i) {
  17487. "use strict";
  17488. var n = e("../util/logger")
  17489. , r = new n(i)
  17490. , o = {
  17491. parseIdsFromChunkName: function(e, t) {
  17492. t.floorId = o.parseFloor(e),
  17493. t.roomId = o.parseRoom(e)
  17494. },
  17495. parseFloor: function(e) {
  17496. var t = e.match(/_group([0-9]+)/);
  17497. if (!t)
  17498. return 0;
  17499. try {
  17500. return parseInt(t[1], 10)
  17501. } catch (e) {
  17502. return r.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  17503. 0
  17504. }
  17505. },
  17506. parseRoom: function(e) {
  17507. var t = e.match(/_sub([0-9]+)/);
  17508. if (!t)
  17509. return -1;
  17510. try {
  17511. return parseInt(t[1], 10)
  17512. } catch (e) {
  17513. return r.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  17514. 0
  17515. }
  17516. }
  17517. };
  17518. t.exports = o
  17519. }
  17520. ).call(this, "/js/model/Chunks.js")
  17521. }
  17522. , {
  17523. "../util/logger": 189
  17524. }],
  17525. 136: [function(e, t, i) {
  17526. (function(i) {
  17527. "use strict";
  17528. function n(e) {
  17529. s.call(this),
  17530. this.model = e,
  17531. this.exploded = !1
  17532. }
  17533. var r = e("../objects/Floor")
  17534. , o = (e("../settings"),
  17535. e("../util/logger"))
  17536. , a = e("../util/transitions")
  17537. , s = e("../util/IndexedCollection")
  17538. , l = e("../util/common")
  17539. , c = e("../util/easing");
  17540. new o(i);
  17541. l.inherit(n, s),
  17542. n.prototype.add = function(e) {
  17543. s.prototype.add.call(this, e),
  17544. this.model.add(e)
  17545. }
  17546. ,
  17547. n.prototype.getIndex = function(e) {
  17548. return e.floorIndex
  17549. }
  17550. ,
  17551. n.prototype.build = function() {
  17552. this.list.forEach(function(e) {
  17553. e.build()
  17554. })
  17555. }
  17556. ,
  17557. n.prototype.size = function() {
  17558. return this.length
  17559. }
  17560. ,
  17561. n.prototype.sort = function() {
  17562. s.prototype.sort.call(this, function(e, t) {
  17563. return e.floorIndex - t.floorIndex
  17564. })
  17565. }
  17566. ,
  17567. n.prototype.nextFloor = function(e, t) {
  17568. return this.index[e.floorIndex + t] || null
  17569. }
  17570. ,
  17571. n.prototype.getFloorAtPoint = function(e) {
  17572. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  17573. var r = this.list[n]
  17574. , o = r.distanceToPoint(e);
  17575. (!t || i > o) && (i = o,
  17576. t = r)
  17577. }
  17578. return t
  17579. }
  17580. ,
  17581. n.prototype.getOrMakeFloor = function(e) {
  17582. var t = this.index[e];
  17583. return t || (t = new r(this.model,e),
  17584. this.add(t)),
  17585. t
  17586. }
  17587. ,
  17588. n.prototype.hide = function() {
  17589. this.list.forEach(function(e) {
  17590. e.hide()
  17591. })
  17592. }
  17593. ,
  17594. n.prototype.show = function() {
  17595. this.list.forEach(function(e) {
  17596. e.show()
  17597. })
  17598. }
  17599. ,
  17600. n.prototype.names = function() {
  17601. return this.list.reduce(function(e, t) {
  17602. return e.concat(t.name)
  17603. }, [])
  17604. }
  17605. ,
  17606. n.prototype.toggleExplodeHorizontal = function() {
  17607. function e(e, t) {
  17608. r.copy(e.position),
  17609. e.position.x = i[e.floorIndex] * t,
  17610. e.position.y = 1 * e.floorIndex * t,
  17611. r.sub(e.position).multiplyScalar(-1),
  17612. e.panos.forEach(function(e) {
  17613. e.translate(r)
  17614. })
  17615. }
  17616. var t, i = [], n = 0;
  17617. this.list.forEach(function(e, r, o) {
  17618. t = r > 0 ? Math.max(o[r - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  17619. n += t,
  17620. i[r] = n
  17621. }),
  17622. i = i.map(function(e) {
  17623. return e - n / 2
  17624. });
  17625. var r = this.list[0].position.clone();
  17626. this.exploded ? this.list.forEach(function(t) {
  17627. a.start(function(i) {
  17628. e(t, 1 - i)
  17629. }, 1500, null, 0, c.easeOutExpo)
  17630. }) : this.list.forEach(function(t) {
  17631. a.start(function(i) {
  17632. e(t, i)
  17633. }, 1500, null, 0, c.easeOutExpo)
  17634. }),
  17635. this.exploded = !this.exploded
  17636. }
  17637. ,
  17638. n.prototype.toggleExplodeVertical = function() {
  17639. function e(e, i) {
  17640. var n = n.copy(e.position);
  17641. e.position.y = (5 * e.floorIndex - t.y / 2) * i,
  17642. n.sub(e.position).multiplyScalar(-1),
  17643. e.panos.forEach(function(e) {
  17644. e.translate(n)
  17645. })
  17646. }
  17647. var t = this.model.size;
  17648. this.list[0].position.clone();
  17649. this.exploded ? this.list.forEach(function(t) {
  17650. a.start(function(i) {
  17651. e(t, 1 - i)
  17652. }, 1500, null, 0, c.easeOutExpo)
  17653. }) : this.list.forEach(function(t) {
  17654. a.start(function(i) {
  17655. e(t, i)
  17656. }, 1500, null, 0, c.easeOutExpo)
  17657. }),
  17658. this.exploded = !this.exploded
  17659. }
  17660. ,
  17661. t.exports = n
  17662. }
  17663. ).call(this, "/js/model/FloorCollection.js")
  17664. }
  17665. , {
  17666. "../objects/Floor": 146,
  17667. "../settings": 166,
  17668. "../util/IndexedCollection": 175,
  17669. "../util/common": 185,
  17670. "../util/easing": 186,
  17671. "../util/logger": 189,
  17672. "../util/transitions": 195
  17673. }],
  17674. 137: [function(e, t, i) {
  17675. (function(i) {
  17676. "use strict";
  17677. function n() {
  17678. c.call(this)
  17679. }
  17680. var r = e("../settings")
  17681. , o = e("../util/logger")
  17682. , a = e("../enum/Viewmode")
  17683. , s = e("../objects/Snapshot")
  17684. , l = (e("../util/math"),
  17685. e("../util/common"))
  17686. , c = e("../util/IndexedCollection")
  17687. , h = new o(i);
  17688. l.inherit(n, c),
  17689. n.prototype.getImage = function(e) {
  17690. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  17691. }
  17692. ,
  17693. n.prototype.filterByModesAndReel = function(e, t) {
  17694. for (var i = [], n = 0; n < t.length; n += 1) {
  17695. var r = t[n]
  17696. , o = this.index[r.sid];
  17697. o && i.push(o)
  17698. }
  17699. var s = e[a.DOLLHOUSE]
  17700. , l = e[a.FLOORPLAN];
  17701. i = i.filter(function(e) {
  17702. if (!e.metadata || void 0 === e.metadata.camera_mode)
  17703. return !0;
  17704. var t;
  17705. try {
  17706. t = a.convertWorkshopModeInt(e.metadata.camera_mode)
  17707. } catch (e) {
  17708. return h.debug(e.message),
  17709. !1
  17710. }
  17711. return t === a.PANORAMA || t === a.FLOORPLAN && l || t === a.DOLLHOUSE && s
  17712. }),
  17713. i.length !== this.list.length && h.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  17714. this.list = i,
  17715. this.reIndex()
  17716. }
  17717. ,
  17718. n.prototype.getHeroLocations = function(panos) {//改 增加二级location
  17719. if (0 === this.list.length)
  17720. return [];
  17721. var locations = [];
  17722. var deal = (info, container)=>{
  17723. var src = info.thumbnail_signed_src,
  17724. o = info.name || "";
  17725. if (info.metadata && void 0 !== info.metadata.camera_quaternion) {
  17726. if (!r.show360Views.enabled && info.metadata.scan_id) {
  17727. let a = panos.get(info.metadata.scan_id);
  17728. if (a && !a.isAligned()) return
  17729. }
  17730. var cameraMode = a.convertWorkshopModeInt(info.metadata.camera_mode);
  17731. if (cameraMode === a.MESH) return
  17732. if(window.isLocal)src = manage.dealURL(src)
  17733. else src = "one" === g_version ? g_Prefix + src + "?" + randomTime().getTime() : src + "?" + randomTime().getTime()
  17734. var l = {
  17735. cameraMode: cameraMode,
  17736. position: info.metadata.camera_position,
  17737. quaternion: info.metadata.camera_quaternion,
  17738. zoom: info.metadata.zoom,
  17739. panoId: info.metadata.scan_id,
  17740. orthoZoom: info.metadata.ortho_zoom,
  17741. floorVisibility: void 0 !== info.metadata.floor_visibility ? info.metadata.floor_visibility.slice(0) : [],
  17742. thumbUrl: src,
  17743. name: n.filterImageName(o),
  17744. sid: info.sid
  17745. }
  17746. var item = new s(l);
  17747. item.momentTour = info.momentTour
  17748. container.push(item)
  17749. return item
  17750. }
  17751. }
  17752. this.list.forEach(image=>{
  17753. if(image.images){
  17754. var folder = $.extend({}, image )
  17755. folder.heroLocations = [];
  17756. image.images.list.forEach(child=>{
  17757. deal(child, folder.heroLocations);
  17758. })
  17759. folder.musicInfo = folder.musicInfo || {}
  17760. locations.push(folder)
  17761. delete folder.images;
  17762. delete folder.locations;
  17763. }else{
  17764. var item = deal(image, locations);
  17765. item.musicInfo = image.musicInfo || g_data2.tourAudio[item.sid] || {}//新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  17766. }
  17767. })
  17768. return locations
  17769. }
  17770. ,
  17771. n.prototype.getIndex = function(e) {
  17772. return e.sid
  17773. }
  17774. ,
  17775. n.filterImageName = function(e) {
  17776. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  17777. }
  17778. ,
  17779. t.exports = n
  17780. }
  17781. ).call(this, "/js/model/ImageCollection.js")
  17782. }
  17783. , {
  17784. "../enum/Viewmode": 51,
  17785. "../objects/Snapshot": 153,
  17786. "../settings": 166,
  17787. "../util/IndexedCollection": 175,
  17788. "../util/common": 185,
  17789. "../util/logger": 189,
  17790. "../util/math": 190
  17791. }],
  17792. 138: [function(e, t, i) {
  17793. (function(i) {
  17794. "use strict";
  17795. function n() {
  17796. u.call(this)
  17797. }
  17798. var r = e("../label/Label")
  17799. , o = e("../settings")
  17800. , a = e("../util/logger")
  17801. , s = e("../util/math")
  17802. , l = e("../util/ajax")
  17803. , c = e("./RoomCollection")
  17804. , h = e("../util/common")
  17805. , u = e("../util/IndexedCollection");
  17806. new a(i);
  17807. h.inherit(n, u),
  17808. n.prototype.getIndex = function(e) {
  17809. return e.labelId
  17810. }
  17811. ,
  17812. n.prototype.associateWithRooms = function(e) {
  17813. this.forEach(function(t) {
  17814. e.forEach(function(e) {
  17815. e.roomId === t.roomId && (t.room = e)
  17816. })
  17817. })
  17818. }
  17819. ,
  17820. n.prototype.createFromLabelData = function(e) {
  17821. e.forEach(function(e) {
  17822. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  17823. t = c.generateRoomId(e.floorId, t);
  17824. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  17825. i.position = s.convertWorkshopVector(i.position),
  17826. this.add(i),
  17827. i.build()
  17828. }
  17829. .bind(this))
  17830. }
  17831. ,
  17832. n.prototype.load = function(e, t) {
  17833. return l.get(e, {
  17834. responseType: "json",
  17835. auth: t ? o.authorizationHeader : null
  17836. }).done(function(e) {
  17837. var t = [];
  17838. for (var i in e) {
  17839. var n = e[i];
  17840. t.push(n)
  17841. }
  17842. this.createFromLabelData(t)
  17843. }
  17844. .bind(this))
  17845. }
  17846. ,
  17847. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  17848. var t = -1;
  17849. if (e) {
  17850. if(typeof e == 'number'){
  17851. t = parseInt(e)
  17852. }else{
  17853. var i = e.split("_");
  17854. t = parseInt(i[0])
  17855. }
  17856. }
  17857. return t
  17858. }
  17859. ,
  17860. t.exports = n
  17861. }
  17862. ).call(this, "/js/model/LabelCollection.js")
  17863. }
  17864. , {
  17865. "../label/Label": 90,
  17866. "../settings": 166,
  17867. "../util/IndexedCollection": 175,
  17868. "../util/ajax": 181,
  17869. "../util/common": 185,
  17870. "../util/logger": 189,
  17871. "../util/math": 190,
  17872. "./RoomCollection": 141
  17873. }],
  17874. 139: [function(e, t, i) {
  17875. (function(i) {
  17876. "use strict";
  17877. function n(e, t) {
  17878. o.Object3D.call(this)
  17879. this.sid = window.number;//t.sid,
  17880. this.data = t,
  17881. this.options = e,
  17882. this.urls = new s(e.urlFiles),
  17883. this.isPublic = void 0 !== t.is_public && t.is_public,
  17884. //创建heroLocations
  17885. this.images = new _(this),
  17886. this.images.extend(t.images),
  17887. this.images.forEach((info)=>{
  17888. if(info.locations){
  17889. info.images = new _(this);
  17890. info.images.extend(info.locations)
  17891. }
  17892. })
  17893. this.heroLocations = []
  17894. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  17895. this.outdoorPanoLocations = [],
  17896. this.floors = new d(this),
  17897. this.floorsEnabled = void 0 === e.floors || e.floors,
  17898. this.changingFloor = !1,
  17899. this.chunks = [],
  17900. this.panos = new A,
  17901. this.colliders = [],
  17902. this.loadPanosPromise = null,
  17903. this.loadMeshTexturesPromise = null,
  17904. this.auxDataPromise = null,
  17905. this.meshTexturesLoaded = !1,
  17906. this.meshTextures = [],
  17907. this.tags = {},
  17908. this.tagsShown = !1,
  17909. this.shouldShowtags = !1,
  17910. this.has360Views = !1,
  17911. this.showingLabels = f.labels.enabled && t.player_options.labels,
  17912. this.supportedModes = {},
  17913. this.supportedModes[c.PANORAMA] = !0,
  17914. this.supportedModes[c.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && w.valueFromHash("dh", 1),
  17915. this.supportedModes[c.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && w.valueFromHash("dh", 1),
  17916. this.supportedModes[c.TRANSITIONING] = !0,
  17917. this.supportsTiles = this.configureTiling(),
  17918. // this.supportsVR = t.is_vr,
  17919. this.supportsVR = window.MP_PREFETCHED_MODELDATA.supportsVR || false//true; // 方奕卓 VR功能可配置
  17920. this.mode = c.DOLLHOUSE,
  17921. this.size = null,
  17922. this.center = null,
  17923. this.boundingBox = new o.Box3,
  17924. this.currentFloor = null,
  17925. this.allFloorsVisible = !0,
  17926. this.projectedPano0 = null,
  17927. this.projectedPano1 = null,
  17928. this.floorsEnabled && t.floors && t.floors.indexOf(",") !== -1 && t.floors.split(",").forEach(function(e, t) {
  17929. this.addFloor(new u(this,t,e.trim()))
  17930. }
  17931. .bind(this)),
  17932. this.waitQueue = [],
  17933. this.on("load", function(e) {
  17934. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  17935. return !e.isLoadedCallback()
  17936. }),
  17937. 0 === this.waitQueue.length && this.emit("waiting-done"))
  17938. }
  17939. .bind(this)),
  17940. this.setupCustomProperties()
  17941. this.hots = {};
  17942. }
  17943. function r() {
  17944. try {
  17945. var e = document.createElement("canvas")
  17946. , t = e.getContext("webgl");
  17947. t || (t = e.getContext("experimental-webgl"));
  17948. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE);
  17949. return i
  17950. } catch (e) {
  17951. return 0
  17952. }
  17953. }
  17954. var o = e("three")
  17955. , a = e("../util/ajax")
  17956. , s = e("../util/ModelUrls")
  17957. , l = e("../objects/BoundingTextureSkybox")
  17958. , c = e("../enum/Viewmode")
  17959. , h = e("../enum/RenderOrder")
  17960. , u = (e("../enum/AlignmentType"),
  17961. e("../objects/Floor"))
  17962. , d = e("./FloorCollection")
  17963. , p = e("../objects/Chunk")
  17964. , f = (e("../objects/Room"),
  17965. e("../objects/Snapshot"),
  17966. e("../label/Label"),
  17967. e("../util/math"),
  17968. e("../settings"))
  17969. ,ss = e("../shaders")
  17970. , g = e("../util/logger")
  17971. , m = e("../tag/tag")
  17972. , v = (e("../tag/tagManager"),
  17973. e("../objects/Panorama"))
  17974. , A = e("../util/PanoramaCollection")
  17975. , y = e("../loaders/ModelLoader")
  17976. , C = e("../loaders/ModelTextureLoader")
  17977. , I = e("../loaders/SweepDataLoader")
  17978. , E = e("../util/transitions")
  17979. , b = e("../util/common")
  17980. , es = e("../util/easing")
  17981. ,lerp = e("../util/lerp")
  17982. ,tex = e("../util/texture")
  17983. , w = e("./../util/browser")
  17984. , _ = e("./ImageCollection")
  17985. , T = e("./RoomCollection")
  17986. , x = e("./LabelCollection")
  17987. , S = e("./Chunks")
  17988. , M = e("./../util/showcase")
  17989. , R = e("../exception/BasicException")
  17990. , P = (e("../constants")
  17991. ,e("events").EventEmitter)
  17992. ,Hot = e("hot")
  17993. , O = new g(i);
  17994. n.prototype = Object.create(o.Object3D.prototype),
  17995. b.extend(n, P),
  17996. n.prototype.setupCustomProperties = function() {
  17997. var e = f.modelAlpha;
  17998. Object.defineProperty(this, "alpha", {
  17999. get: function() {
  18000. return e
  18001. },
  18002. set: function(t) {
  18003. e = t,
  18004. this.chunks.forEach(function(t) {
  18005. t.material && t.material.uniforms.modelAlpha && (t.material.uniforms.modelAlpha.value = e)
  18006. })
  18007. }
  18008. })
  18009. }
  18010. ,
  18011. n.prototype.configureTiling = function() {
  18012. var e = r();
  18013. if (e < 2048)
  18014. return !1;
  18015. O.warn("Max cube texture size: " + e);
  18016. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  18017. var i = f.tiling.tilingFlagNames[t];
  18018. if ("1" === w.valueFromHash(i, null))
  18019. return !0;
  18020. if ("0" === w.valueFromHash(i, null))
  18021. return !1
  18022. }
  18023. //--------------------------------------------许钟文-------------------------------------------
  18024. //return true;
  18025. return !!M.modelDataPromisesTiles(this.data) //免去访问mdoeldata.json的vision_version,不明白这是什么
  18026. //--------------------------------------------e n d -------------------------------------------
  18027. }
  18028. ,
  18029. n.prototype.toggleAlpha = function() {
  18030. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  18031. }
  18032. ,
  18033. n.prototype.load = function(e) {
  18034. var t = function() {
  18035. return $.when(this.loadPanos(), this.loadMesh())
  18036. }
  18037. , i = this.urls.init().then(t.bind(this));
  18038. return e ? i = i.then(this.loadMeshTextures.bind(this)) : i.then(this.loadMeshTextures.bind(this)),
  18039. this.auxDataPromise = $.when( /*this.loadHighlightReel(), this.loadtags() */this.loadhots(), this.loadLabels()),
  18040. $.when(i, this.auxDataPromise).done(this.build.bind(this)) //不要另外使用active_reel文件
  18041. }
  18042. ,
  18043. n.prototype.loadMesh = function() {
  18044. function e(e) {
  18045. O.error(e),
  18046. n.reject("loading-failed")
  18047. }
  18048. function t(e, t) {
  18049. n.notify(e, t)
  18050. }
  18051. function i(e, t) {
  18052. if (0 === e.length) {
  18053. O.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  18054. r.supportedModes[c.DOLLHOUSE] = !1,
  18055. r.supportedModes[c.FLOORPLAN] = !1;
  18056. var i = new p({
  18057. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  18058. });
  18059. i.material.visible = !1,
  18060. i.rotateX(-Math.PI / 2),
  18061. i.geometry.computeBoundingBox(),
  18062. e = [i]
  18063. }
  18064. e.forEach(function(e) {
  18065. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0;
  18066. r.addChunk(t, e)
  18067. }),
  18068. r.floors.sort(),
  18069. n.resolve(r)
  18070. }
  18071. var n = $.Deferred()
  18072. , r = this;
  18073. return y.load(r.data.job.uuid, r.urls, i, t, e),
  18074. n.promise()
  18075. }
  18076. ,
  18077. n.prototype.loadMeshTextures = function() {
  18078. return this.loadTexturesPromise ? this.loadTexturesPromise : (this.loadTexturesPromise = C.load(this, this.meshTextures).then(function() {
  18079. this.meshTexturesLoaded = !0
  18080. }
  18081. .bind(this)),
  18082. this.loadTexturesPromise)
  18083. }
  18084. ,
  18085. /* n.prototype.loadtags = function() {//xzw改
  18086. var e = $.Deferred();
  18087. if (!f.tags.enabled)
  18088. return e.resolve();
  18089. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  18090. t = "data/" + this.sid + "/tags.json"
  18091. return a.get(t, {
  18092. responseType: "json",
  18093. auth: this.isPublic ? null : f.authorizationHeader
  18094. }).done(function(t) {
  18095. var i = 0
  18096. , n = 0;
  18097. for (var r in t) {
  18098. var o = t[r];
  18099. o.enabled && (n++,
  18100. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  18101. i++))
  18102. }
  18103. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  18104. e.resolve()
  18105. }
  18106. .bind(this)).fail(function() {
  18107. O.warn("Getting tags failed, not displaying tags."),
  18108. e.resolve()
  18109. }),
  18110. e
  18111. } */
  18112. n.prototype.shineHots = function(){ //xzw
  18113. E.trigger({
  18114. func: function(e) {
  18115. var opa = e <= .5 ? 2 * e : -2 * e + 2
  18116. for(var i in this.hots){
  18117. this.hots[i].mesh.material.uniforms.opac.value = opa;
  18118. }
  18119. }.bind(this),
  18120. cycling: true,
  18121. duration: 3000,
  18122. //easing: "easeInOutQuad",
  18123. name: "hotShine"
  18124. })
  18125. },
  18126. n.prototype.createHotItem = function(data, hots) {
  18127. var docFragment = document.createDocumentFragment();
  18128. var keyAry = Object.keys(data);
  18129. for(var i = 0; i < keyAry.length; i++){
  18130. var li = document.createElement('li');
  18131. var span = document.createElement('span');
  18132. span.innerHTML = data[keyAry[i]].title || data[keyAry[i]].infoAttribute.title || '热点';
  18133. // console.log(span.innerHTML);
  18134. li.hot = hots[keyAry[i]]; // 列表每一项对应一个热点
  18135. li.appendChild(span);
  18136. docFragment.appendChild(li);
  18137. }
  18138. var ul = document.querySelector('#hotListContent ul');
  18139. ul.appendChild(docFragment);
  18140. console.log(docFragment);
  18141. }
  18142. n.prototype.loadOverlays = function(overlays){
  18143. var overlays = window.data2 && window.data2.overlays
  18144. overlays && overlays.forEach((info)=>{
  18145. //if(info.file.includes('20210312_112357584.mp4') /* || info.animateInfo */ )return;
  18146. new Overlay(info)
  18147. })
  18148. setTimeout(Overlay.load, 300)
  18149. }
  18150. n.prototype.loadhots = function() {//xzw
  18151. var e = $.Deferred();
  18152. var t = g_Prefix+"data/" + this.sid + "/data2.js" +'?'+ randomTime().getTime();
  18153. return a.get(t, {
  18154. responseType: "json",
  18155. auth: this.isPublic ? null : f.authorizationHeader
  18156. }).done(function(t) {
  18157. window.data2 = t;
  18158. if(!t){
  18159. console.error("data2 is null")
  18160. }else{
  18161. g_data2 = hotMatcher(t);
  18162. this.hotsCount = 0;
  18163. /* for(var i in t.hots){
  18164. this.hotsCount ++;
  18165. this.hots[i] = new Hot(i, t.hots[i], this);
  18166. t.hots[i].infoAttribute || (t.hots[i].infoAttribute = {})
  18167. this.hots[i].initStyleImg(t.hots[i].infoAttribute);
  18168. };
  18169. window.hotData = t.hots
  18170. t.hots && this.createHotItem(t.hots, this.hots); */
  18171. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  18172. window.hotData = {}
  18173. if(t.hots){
  18174. var sids = Object.keys(t.hots).sort((a,b)=>{return t.hots[a].order - t.hots[b].order});
  18175. sids.forEach((sid)=>{
  18176. this.hotsCount++,
  18177. this.hots[sid] = new Hot(sid,t.hots[sid] ,this);
  18178. t.hots[sid].infoAttribute || (t.hots[sid].infoAttribute = {})
  18179. this.hots[sid].initStyleImg(t.hots[sid].infoAttribute);
  18180. window.hotData[sid] = t.hots[sid];
  18181. })
  18182. }
  18183. this.createHotItem(window.hotData, this.hots);
  18184. g_index = w.valueFromHash("m");
  18185. /* if(t.tourAudio){
  18186. g_tourAudio = new Audio;
  18187. g_tourAudio.loop = false;
  18188. g_tourAudio.addEventListener('ended', function () {
  18189. var ev = document.createEvent("MouseEvent");
  18190. ev.initEvent("tourAudioEnded",true,true);
  18191. window.dispatchEvent(ev);
  18192. });
  18193. }; */
  18194. }
  18195. /***************************方奕卓 请求data.js数据, 用于初始化热点列表 ****************************/
  18196. /* var dataJsPromise = $.Deferred();
  18197. var dataJsUrl = g_Prefix+"data/" + this.sid + "/hot/js/data.js" +'?'+ randomTime().getTime();
  18198. a.get(dataJsUrl,{
  18199. responseType: "json",
  18200. auth: this.isPublic ? null : f.authorizationHeader
  18201. }).done(function(data) {
  18202. window.hotData = data;
  18203. this.createHotItem(data, this.hots);
  18204. for(let i in this.hots){//add
  18205. data[i] && this.hots[i].initStyleImg(data[i]);
  18206. }
  18207. dataJsPromise.resolve();
  18208. }.bind(this)).fail(function(){
  18209. console.log('Data.js is empty');
  18210. dataJsPromise.resolve();
  18211. }) */
  18212. e.resolve();
  18213. }.bind(this)).fail(function() {
  18214. console.log('没有热点');
  18215. e.resolve()
  18216. }),
  18217. e
  18218. }
  18219. ,
  18220. n.prototype.loadPanos = function() {
  18221. if (this.loadPanosPromise)
  18222. return this.loadPanosPromise;
  18223. var e = new I(this);
  18224. return this.loadPanosPromise = e.load().then(function(e) {
  18225. return this.data.sweeps && Object.keys(this.data.sweeps).length > 0 && (e = e.filter(function(e) {
  18226. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  18227. else console.log(e.uuid)
  18228. }
  18229. .bind(this))),
  18230. this.panos.extend(e.map(function(e) {
  18231. return new v(this,e.uuid,e,this.supportsTiles)
  18232. }
  18233. .bind(this))),
  18234. this.panos.forEach(function(e) {
  18235. e.neighbourUUIDs && (e.neighbourUUIDs.forEach(function(t) {
  18236. var i = this.panos.get(t);
  18237. i && this.panos.setNeighbour(e, i, !0)
  18238. }
  18239. .bind(this)),
  18240. e.neighbourPanos = this.panos.getNeighbours(e) || this.panos.setNeighbour(e, e, !0))
  18241. }
  18242. .bind(this)),
  18243. 0 === this.panos.length && (O.warn("Model has no panos, turning off inside mode"),
  18244. this.supportedModes[c.PANORAMA] = !1),
  18245. $.when(this)
  18246. }
  18247. .bind(this)),
  18248. this.loadPanosPromise
  18249. }
  18250. ,
  18251. n.prototype.loadHighlightReel = function() {//xzw
  18252. var e = $.Deferred()
  18253. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  18254. ,t = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  18255. return a.get(t, {
  18256. responseType: "json",
  18257. auth: this.isPublic ? null : f.authorizationHeader
  18258. }).done(function(t) {
  18259. t.reel ? (O.info("Got highlight reel with " + t.reel.length + " items"),
  18260. this.images.filterByModesAndReel(this.supportedModes, t.reel)) : O.info("No highlight reel found"),
  18261. e.resolve()
  18262. }
  18263. .bind(this)).fail(function() {
  18264. O.warn("Getting highlight reel failed, no highlights available"),
  18265. e.resolve()
  18266. }),
  18267. e
  18268. }
  18269. ,
  18270. n.prototype.waitForLoad = function(e, t) {
  18271. t() || (this.waitQueue.push({
  18272. object: e,
  18273. isLoadedCallback: t
  18274. }),
  18275. 1 === this.waitQueue.length && this.emit("waiting"))
  18276. }
  18277. ,
  18278. n.prototype.hide = function() {
  18279. this.floors.hide()
  18280. }
  18281. ,
  18282. n.prototype.show = function() {
  18283. this.floors.show()
  18284. }
  18285. ,
  18286. n.prototype.floorNames = function() {
  18287. return this.floors.names()
  18288. }
  18289. ,
  18290. n.prototype.warpDestFloors = function(e, t) {
  18291. if (!e || this.floors.length !== e.length)
  18292. return void this.toggleAllFloors(!0);
  18293. var i = e.findIndex(function(e) {
  18294. return e
  18295. }
  18296. .bind(this));
  18297. i !== -1 && this.setFloor(this.floors.list[i], null, t)
  18298. }
  18299. ,
  18300. n.prototype.setFloor = function(e, t, i) {
  18301. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  18302. this.allFloorsVisible = !1,
  18303. this._setFloor(e, t, i)
  18304. }
  18305. ,
  18306. n.prototype.toggleAllFloors = function(e) {
  18307. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  18308. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  18309. this._setFloor(this.currentFloor)
  18310. }
  18311. ,
  18312. n.prototype._setFloor = function(e, t, i) {
  18313. t = t || this.mode,
  18314. this.emit("floor.changed", e, t, this.currentFloor),
  18315. this.currentFloor = e;
  18316. var n;
  18317. if (t === c.PANORAMA) {
  18318. if (this.show(),
  18319. this.shouldShowtags && this.tagsShown)
  18320. for (n in this.tags)
  18321. this.tags[n].show(f.showFloorDuration)
  18322. } else if ((t === c.FLOORPLAN || t === c.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  18323. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  18324. }
  18325. .bind(this)),
  18326. this.shouldShowtags && this.tagsShown))
  18327. for (n in this.tags) {
  18328. var r = this.tags[n];
  18329. this.allFloorsVisible ? r.show(f.showFloorDuration) : r.floor === this.currentFloor ? r.show(f.showFloorDuration, f.showFloorDelay) : r.hide(f.hideFloorDuration, f.hideFloorDelay)
  18330. }
  18331. var o = this
  18332. , a = e;
  18333. E.start(function() {}, f.showFloorDelay, function() {
  18334. o.floors.forEach(function(e) {
  18335. e.chunks.forEach(function(t) {
  18336. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor
  18337. })
  18338. })
  18339. }
  18340. .bind(this))
  18341. }
  18342. ,
  18343. n.prototype.toggleExplode = function() {
  18344. this.floors.toggleExplodeHorizontal()
  18345. }
  18346. ,
  18347. n.prototype.toggleExplodeUp = function() {
  18348. this.floors.toggleExplodeVertical()
  18349. }
  18350. ,
  18351. n.prototype.nextFloor = function(e) {
  18352. return this.floors.nextFloor(this.currentFloor, e)
  18353. }
  18354. ,
  18355. n.prototype.addFloor = function(e) {
  18356. this.floors.add(e)
  18357. }
  18358. ,
  18359. n.prototype.getFloorAtPoint = function(e) {
  18360. return this.floors.getFloorAtPoint(e)
  18361. }
  18362. ,
  18363. n.prototype.getTagBySid = function(e) {
  18364. return this.tags[e]
  18365. }
  18366. ,
  18367. n.prototype.addChunk = function(e, t) {
  18368. this.floors.getOrMakeFloor(e).addChunk(t),
  18369. this.chunks.push(t)
  18370. }
  18371. ,
  18372. n.prototype.setMode = function(e) {
  18373. if (!this.supportedModes[e])
  18374. throw new R("Mode not supported for this model: " + e);
  18375. this.mode = e;
  18376. this.skybox.material.transparent = e == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  18377. this.chunks.forEach(function(t) {
  18378. t.setMode(e)
  18379. })
  18380. }
  18381. ,
  18382. n.prototype.build = function() {
  18383. this.heroLocations = this.images.getHeroLocations(this.panos);
  18384. var e = function() {
  18385. 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()
  18386. }
  18387. .bind(this)();
  18388. this.has360Views = f.show360Views.enabled && this.heroLocations.some(function(e) {
  18389. return e.cameraMode === c.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  18390. }
  18391. .bind(this)) || e,
  18392. null === this.heroImage && O.warn("No hero image defined."),
  18393. this.currentFloor = this.floors.last(),
  18394. this.floors.build(),
  18395. this.colliders = this.floors.reduce(function(e, t) {
  18396. return e.concat(t.collider.children)
  18397. }, []),
  18398. this.panos.forEach(function(e) {
  18399. e.build1(),
  18400. e.on("enter", function() {
  18401. e.floor !== this.currentFloor && this.setFloor(e.floor)
  18402. }
  18403. .bind(this))
  18404. }
  18405. .bind(this)),
  18406. this.panos.forEach(function(e) {
  18407. e.build2()
  18408. }),
  18409. this.floors.forEach(function(e) {
  18410. this.boundingBox.union(e.boundingBox)
  18411. }
  18412. .bind(this)),
  18413. this.size = this.boundingBox.size(),
  18414. this.center = this.boundingBox.center(),
  18415. this.floors.forEach(function(e) {
  18416. O.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  18417. }
  18418. .bind(this)),
  18419. this.panos.populate_path_graph(),
  18420. this.skybox = new l(this.boundingBox),
  18421. this.skybox.matrixWorldNeedsUpdate = !0,
  18422. this.add(this.skybox);
  18423. setTimeout(function(){
  18424. this.hotsCount && this.shineHots();
  18425. }.bind(this),1300);//xzw 热点开始闪烁
  18426. for (var t in this.tags)
  18427. this.tags[t].build();
  18428. //add-----
  18429. for(let i in this.hots){
  18430. this.hots[i].setVisiblePanos(this.hots[i].visibleData);
  18431. }
  18432. //---------
  18433. this.createFloorLogo()
  18434. return O.debug("Done building model"),
  18435. v.raycastsDone > 0 && (O.warn("raycasts: " + v.raycastsDone),
  18436. O.warn("raycasts skipped: " + v.raycastsSkipped)),
  18437. this.buildRooms(),
  18438. this.labels.associateWithRooms(this.rooms),
  18439. $.when(this)
  18440. }
  18441. ,
  18442. n.prototype.createFloorLogo = function(){
  18443. console.log('createFloorLogo')
  18444. if(this.floorLogos || !settings.floorlogoURL)return;
  18445. var url = settings.floorlogoURL
  18446. var map = tex.load(url);//可以追加done
  18447. this.floorLogos = [];
  18448. for(var i=0; i<2; i++){ //不可共用uniforms等 [0]在上一个位置,[1]是下一个位置、 是飞入及飞出后的位置
  18449. var material = new o.MeshBasicMaterial({
  18450. opacity:0,
  18451. map:map,
  18452. side: o.DoubleSide,
  18453. transparent: !0,
  18454. depthWrite: !1,
  18455. depthTest:false//改 在chunk\skybox外也可看到
  18456. });
  18457. var logo = new o.Mesh(new o.PlaneGeometry(2,2,1,1),material);
  18458. //var s = (Store.metadata.floorLogoSize || 100)/100;
  18459. //logo.scale.set(s,s,s);
  18460. logo.position.set(0,-1.5,0);
  18461. logo.lookAt(logo.position.clone().add(new o.Vector3(0,1,0)));
  18462. logo.renderOrder = 100;//cover the videoSkybox
  18463. //logo.layers.set(0)
  18464. this.add(logo);
  18465. this.floorLogos.push(logo);
  18466. }
  18467. this.floorLogos[1].visible = false;
  18468. }
  18469. n.prototype.adjustfloorLogoHeight = function(o){
  18470. var h = player.currentPano.floorPosition.y + 0.01;
  18471. this.floorLogos[1].position.setY(h);
  18472. this.floorLogos[0].position.setY(h);
  18473. //publicObjectSet.player.path.currentPanoMarker.mesh.position.y = h
  18474. },
  18475. n.prototype.changefloorLogoOpa = function(o){//改 i, opacity, time, delay
  18476. if(!this.floorLogos) return;
  18477. E.cancelById("flOpa_"+o.index);//先停止之前该logo的透明度变化
  18478. if(o.from!=void 0)this.floorLogos[o.index].material.opacity = o.from;//初始透明度
  18479. if(!o.dur){//立刻
  18480. //this.floorLogos[o.index].material.uniforms.opacity.value = o.opa;
  18481. this.floorLogos[o.index].material.opacity = o.opa;
  18482. }else{
  18483. //E.start(lerp.uniform(this.floorLogos[o.index], "opacity", o.opa), o.dur || 0, null,
  18484. E.start(lerp.property(this.floorLogos[o.index].material, "opacity", o.opa), o.dur || 0, null,
  18485. o.delay||0, es["easeInQuad"], "changefloorLogoOpa", "flOpa_"+o.index)
  18486. }
  18487. },
  18488. n.prototype.updateFloorlogo = function() { //xzw add 更新地标的旋转
  18489. var lastQ, lastP;
  18490. var equals = function(v1, v2, min){
  18491. return Math.abs(v1-v2) < min
  18492. }
  18493. var isSame = function(now, last, k){//如果和上次相同就不改变
  18494. if(!last)return false;
  18495. var R = k.sceneRenderer;
  18496. //var min = R.AFPS < 38 ? 0.005 : R.AFPS < 45 ? 0.0008 : R.AFPS < 50 ? 0.0006 : 0.0003;
  18497. //暂时:
  18498. var min = 0.0008
  18499. var same = equals(now.x , last.x, min) && equals(now.y , last.y, min) && equals(now.z , last.z, min)
  18500. && (now.w!=void 0 ? equals(now.w , last.w, min) : true)
  18501. return same;
  18502. }
  18503. return function(Q, k){
  18504. if(!Q)return;
  18505. /* if(Config.ifFish && window.lowFPS){
  18506. this.fLCompute++;
  18507. if(R.AFPS < 38){
  18508. if(k.flyingToTag && k.flying && k.fLCompute %4 !=1) return; //点击tag过渡
  18509. else if(k.flying && k.fLCompute%2 !=1) return;
  18510. k.fLCompute %= 4;
  18511. }else if(R.AFPS < 45){
  18512. if(k.flyingToTag && k.flying && k.fLCompute %3 !=1) return; //点击tag过渡
  18513. else if(k.flying && k.fLCompute%2 !=1) return;
  18514. k.fLCompute %= 6;
  18515. }else{
  18516. if(k.flyingToTag && k.flying && k.fLCompute %2 !=1) return;
  18517. //else if(k.flying && k.fLCompute%2 !=1) return;
  18518. k.fLCompute %= 2;
  18519. }
  18520. } */
  18521. var sameQ, sameP, quaternion, visible;
  18522. for(var i=0;i<2;i++){
  18523. var logo = this.floorLogos[i];
  18524. if(!logo.visible || logo.material.uniforms.opacity.value==0) continue;
  18525. visible = true;
  18526. }
  18527. if(!visible)return; //如果两个都不可见,就不更改,如果有一个可见,就都改
  18528. var c = k.cameraControls.activeControl;
  18529. var sameQ = c ? ( c.lat < 10 ? equals(c.lon, lastQ, 0.1) : equals(c.lon, lastQ, 1) ): false;
  18530. sameQ || (lastQ = c ? c.lon : null); //相机旋转是否改变了
  18531. for(var i=0;i<2;i++){
  18532. var logo = this.floorLogos[i];
  18533. if(!sameQ){
  18534. if(!quaternion){
  18535. var a = new THREE.Vector3(0,0,-1);
  18536. a.applyQuaternion(Q);
  18537. a.setY(0);
  18538. var _ = (new THREE.Matrix4).lookAt(a,new THREE.Vector3, new THREE.Vector3(0,1,0));
  18539. quaternion = (new THREE.Quaternion).setFromRotationMatrix(_)
  18540. var a = new THREE.Quaternion( 0, 0.7071067811865476, 0.7071067811865476 , 0)//计算得
  18541. quaternion.multiply(a);
  18542. }
  18543. logo.quaternion.copy(quaternion);
  18544. }
  18545. }
  18546. }
  18547. }()
  18548. n.prototype.loadLabels = function() {//xzw
  18549. this.labels = new x(this);
  18550. var e = $.Deferred();
  18551. //加载俯视图的标签 注释这个备注就会加载
  18552. //原先是labels, 改为showLabels,因为之前的somedata写的labels都是true
  18553. //window.MP_PREFETCHED_MODELDATA.showingLabels ? this.showingLabels = true : '';
  18554. /* if (!this.showingLabels)
  18555. return e.resolve(); */
  18556. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  18557. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  18558. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  18559. O.warn("Getting labels failed, not displaying labels."),
  18560. e.resolve()
  18561. }),
  18562. e
  18563. }
  18564. ,
  18565. n.prototype.buildRooms = function() {
  18566. this.rooms = new T(this),
  18567. this.rooms.createFromChunks(this.chunks),
  18568. this.rooms.calcRoomBoundaries()
  18569. }
  18570. ,
  18571. n.prototype.updateProjectedPanos = function() {
  18572. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  18573. }
  18574. ,
  18575. n.prototype.setProjectedPanos = function(e, t, i) {
  18576. void 0 !== i && null !== i || (i = !0),
  18577. i = !!i,
  18578. this.projectedPano0 = e,
  18579. this.projectedPano1 = t,
  18580. this.skybox.material.setProjectedPanos(e, t, i),
  18581. this.chunks.forEach(function(n) {
  18582. n.materialInside.setProjectedPanos(e, t, i)
  18583. })
  18584. }
  18585. ,
  18586. n.prototype.setSide = function(e) {
  18587. this.floors.forEach(function(t) {
  18588. t.collider.material.side = e
  18589. })
  18590. }
  18591. ,
  18592. n.prototype.heroCount = function() {
  18593. return this.heroLocations ? this.heroLocations.length : 0
  18594. }
  18595. ,
  18596. n.prototype.getHeroDescriptorByIndex = function(e=[]) {//改 因增加了二级目录
  18597. if (e[0] < 0)
  18598. return O.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  18599. null;
  18600. if (this.heroCount() < 1)
  18601. return O.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  18602. null;
  18603. var t = this.heroLocations[e[0]];
  18604. if(t.heroLocations && e[1]!=void 0){
  18605. t = t.heroLocations[e[1]];
  18606. }
  18607. return void 0 === t ? (O.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  18608. null) : t
  18609. }
  18610. ,
  18611. n.prototype.findPanoramicHero = function() {
  18612. for (var e in this.heroLocations)
  18613. if (this.heroLocations[e].cameraMode === c.PANORAMA)
  18614. return this.heroLocations[e];
  18615. return null
  18616. }
  18617. ,
  18618. n.prototype.listImagePanos = function() {
  18619. var e = []
  18620. , t = this;
  18621. return this.images.forEach(function(i) {
  18622. if (i.metadata && i.metadata.scan_id) {
  18623. var n = t.panos.get(i.metadata.scan_id);
  18624. n && (t.supportsTiles || n.isLoaded("high") || e.push(n))
  18625. }
  18626. }),
  18627. e
  18628. }
  18629. ,
  18630. n.prototype.fadePanoMarkers = function(e, t) {
  18631. this.panos.fadeMarkerOpacity(e, t)
  18632. }
  18633. ,
  18634. n.prototype.setSweepVisibility = function(e) {
  18635. this.panos.forEach(function(t) {
  18636. t.marker && (t.marker.visible = e)
  18637. })
  18638. }
  18639. ,
  18640. n.prototype.outsideAllowed = function() {
  18641. return this.supportedModes[c.DOLLHOUSE] && this.supportedModes[c.FLOORPLAN]
  18642. }
  18643. ,
  18644. t.exports = n
  18645. }
  18646. ).call(this, "/js/model/Model.js")
  18647. }
  18648. , {
  18649. "../constants": 8,
  18650. "../enum/AlignmentType": 17,
  18651. "../enum/RenderOrder": 42,
  18652. "../enum/Viewmode": 51,
  18653. "../exception/BasicException": 55,
  18654. "../label/Label": 90,
  18655. "../loaders/ModelLoader": 105,
  18656. "../loaders/ModelTextureLoader": 106,
  18657. "../loaders/SweepDataLoader": 107,
  18658. "../tag/tag": 123,
  18659. "../tag/tagManager": 124,
  18660. "../objects/BoundingTextureSkybox": 143,
  18661. "../objects/Chunk": 144,
  18662. "../objects/Floor": 146,
  18663. "../objects/Panorama": 148,
  18664. "../objects/Room": 150,
  18665. "../objects/Snapshot": 153,
  18666. "../settings": 166,
  18667. "../shaders": 167,
  18668. "../util/ModelUrls": 177,
  18669. "../util/PanoramaCollection": 178,
  18670. "../util/ajax": 181,
  18671. "../util/common": 185,
  18672. "../util/easing": 186,
  18673. "../util/lerp": 188,
  18674. "../util/logger": 189,
  18675. "../util/math": 190,
  18676. "../util/texture": 194,
  18677. "../util/transitions": 195,
  18678. "./../util/browser": 182,
  18679. "./../util/showcase": 193,
  18680. "./Chunks": 135,
  18681. "./FloorCollection": 136,
  18682. "./ImageCollection": 137,
  18683. "./LabelCollection": 138,
  18684. "./RoomCollection": 141,
  18685. events: 202,
  18686. three: 217,
  18687. "hot": "hot"
  18688. }],
  18689. 140: [function(e, t, i) {
  18690. "use strict";
  18691. function n() {
  18692. this.modelMap = {},
  18693. this.activeModel = null,
  18694. this.modelCount = 0,
  18695. this.tileDownloader = null,
  18696. this.panoRenderer = null
  18697. }
  18698. var r = (e("three"),
  18699. e("../util/common"))
  18700. , o = e("../exception/BasicException")
  18701. , a = e("../enum/ModelManagerEvents")
  18702. , s = e("../enum/PanoRendererEvents")
  18703. , l = e("events").EventEmitter;
  18704. n.prototype.init = function(e, t, i) {
  18705. this.tileDownloader = e,
  18706. this.panoRenderer = t,
  18707. this.qualityManager = i,
  18708. this.bindEvents()
  18709. }
  18710. ,
  18711. n.prototype.bindEvents = function() {
  18712. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  18713. }
  18714. ,
  18715. n.prototype.onTileRendered = function(e, t, i, n) {}
  18716. ,
  18717. n.prototype.addModel = function(e) {
  18718. this.modelMap[e.sid] = e,
  18719. 0 === this.modelCount && this.activateModel(e.sid),
  18720. this.modelCount++,
  18721. this.emit(a.ModelAdded)
  18722. }
  18723. ,
  18724. n.prototype.getModel = function(e) {
  18725. return this.modelMap[e]
  18726. }
  18727. ,
  18728. n.prototype.activateModel = function(e) {
  18729. var t = this.modelMap[e];
  18730. if (!t)
  18731. throw new o("Tried to activate invalid model!");
  18732. var i = this.activeModel;
  18733. this.activeModel = t,
  18734. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  18735. this.tileDownloader.setUrls(t.urls),
  18736. t.panos.forEach(function(e) {
  18737. e.attachToPanoRenderer(this.panoRenderer),
  18738. e.tileDownloader = this.tileDownloader,
  18739. e.qualityManager = this.qualityManager
  18740. }
  18741. .bind(this)),
  18742. this.emit(a.ActiveModelChanged, {
  18743. oldModel: i,
  18744. model: t
  18745. })
  18746. }
  18747. ,
  18748. n.prototype.getActiveModel = function() {
  18749. return this.activeModel
  18750. }
  18751. ,
  18752. r.extend(n, l),
  18753. t.exports = n
  18754. }
  18755. , {
  18756. "../enum/ModelManagerEvents": 33,
  18757. "../enum/PanoRendererEvents": 35,
  18758. "../exception/BasicException": 55,
  18759. "../util/common": 185,
  18760. events: 202,
  18761. three: 217
  18762. }],
  18763. 141: [function(e, t, i) {
  18764. (function(i) {
  18765. "use strict";
  18766. function n() {
  18767. s.call(this)
  18768. }
  18769. var r = e("../objects/Room")
  18770. , o = (e("../settings"),
  18771. e("../util/logger"))
  18772. , a = (e("../util/transitions"),
  18773. e("../util/easing"),
  18774. e("../util/common"))
  18775. , s = e("../util/IndexedCollection")
  18776. , l = e("./Chunks");
  18777. new o(i);
  18778. a.inherit(n, s),
  18779. n.prototype.getIndex = function(e) {
  18780. return e.roomId
  18781. }
  18782. ,
  18783. n.prototype.calcRoomBoundaries = function() {
  18784. this.forEach(function(e) {
  18785. e.calcBoundaries()
  18786. })
  18787. }
  18788. ,
  18789. n.prototype.createFromChunks = function(e) {
  18790. var t = {
  18791. floorId: -1,
  18792. roomId: -1
  18793. }
  18794. , i = {};
  18795. e.forEach(function(e) {
  18796. l.parseIdsFromChunkName(e.name, t);
  18797. var o = i[t.roomId];
  18798. if (!o) {
  18799. var a = n.generateRoomId(t.floorId, t.roomId);
  18800. o = new r(t.floorId,a),
  18801. this.add(o),
  18802. i[t.roomId] = o
  18803. }
  18804. o.addChunk(e)
  18805. }
  18806. .bind(this)),
  18807. this.calcRoomBoundaries()
  18808. }
  18809. ,
  18810. n.generateRoomId = function(e, t) {
  18811. return e + "_" + t
  18812. }
  18813. ,
  18814. t.exports = n
  18815. }
  18816. ).call(this, "/js/model/RoomCollection.js")
  18817. }
  18818. , {
  18819. "../objects/Room": 150,
  18820. "../settings": 166,
  18821. "../util/IndexedCollection": 175,
  18822. "../util/common": 185,
  18823. "../util/easing": 186,
  18824. "../util/logger": 189,
  18825. "../util/transitions": 195,
  18826. "./Chunks": 135
  18827. }],
  18828. 142: [function(e, t, i) {
  18829. "use strict";
  18830. function n(e, t, i) {
  18831. e = e.clone().expandByScalar(0.01);//改
  18832. var n = e.size()
  18833. , o = new r.BoxGeometry(n.x,n.y,n.z);
  18834. o.boundingBox = e,
  18835. r.Mesh.call(this, o, t),
  18836. this.position.copy(e.center()),
  18837. this.frustumCulled = !1,
  18838. i && this.add(new r.WireframeHelper(this))
  18839. }
  18840. var r = e("three");
  18841. n.prototype = Object.create(r.Mesh.prototype),
  18842. n.prototype.constructor = n,
  18843. t.exports = n
  18844. }
  18845. , {
  18846. three: 217
  18847. }],
  18848. 143: [function(e, t, i) {
  18849. (function(i) {
  18850. "use strict";
  18851. function n(e) {
  18852. h.time("Computing a nice bounding cubemap");
  18853. var t = new a({
  18854. side: r.BackSide,
  18855. transparent: !0
  18856. });
  18857. t.uniforms.modelAlpha.value = 0,
  18858. t.uniforms.opacity.value = 1 - s.modelAlpha,
  18859. this.renderOrder = l.boundingSkybox,
  18860. o.call(this, e, t),
  18861. h.timeEnd("Computing a nice bounding cubemap")
  18862. }
  18863. var r = e("three")
  18864. , o = (e("../enum/Viewmode"),
  18865. e("../shaders"),
  18866. e("./BoundingMesh"))
  18867. , a = e("../materials/ModelTextureMaterial")
  18868. , s = e("../settings")
  18869. , l = e("../enum/RenderOrder")
  18870. , c = e("../util/logger")
  18871. , h = new c(i);
  18872. n.prototype = Object.create(o.prototype),
  18873. n.prototype.constructor = n,
  18874. t.exports = n
  18875. }
  18876. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  18877. }
  18878. , {
  18879. "../enum/RenderOrder": 42,
  18880. "../enum/Viewmode": 51,
  18881. "../materials/ModelTextureMaterial": 118,
  18882. "../settings": 166,
  18883. "../shaders": 167,
  18884. "../util/logger": 189,
  18885. "./BoundingMesh": 142,
  18886. three: 217
  18887. }],
  18888. 144: [function(e, t, i) {
  18889. "use strict";
  18890. function n(e) {
  18891. this.materialInside = new s({
  18892. side: r.DoubleSide
  18893. });
  18894. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  18895. this.materialOutside = new r.RawShaderMaterial({
  18896. fragmentShader: o.modelOutside.fragmentShader,
  18897. vertexShader: o.modelOutside.vertexShader,
  18898. uniforms: t,
  18899. side: r.FrontSide,
  18900. name: "chunkOut"
  18901. }),
  18902. r.Mesh.call(this, e.geometry, this.materialInside),
  18903. this.name = e.name || "",
  18904. this.textureName = e.textureName,
  18905. this.meshUrl = e.meshUrl
  18906. }
  18907. var r = e("three")
  18908. , o = e("../shaders")
  18909. , a = e("../enum/Viewmode")
  18910. , s = e("../materials/ModelTextureMaterial");
  18911. n.prototype = Object.create(r.Mesh.prototype),
  18912. n.prototype.setTextureMap = function(e) {
  18913. this.materialInside.uniforms.map.value = e,
  18914. this.materialOutside.uniforms.map.value = e
  18915. }
  18916. ,
  18917. n.prototype.setMode = function(e) {
  18918. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  18919. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  18920. t.transparent = this.material.transparent,
  18921. t.uniforms.opacity.value = this.material.uniforms.opacity.value,
  18922. this.material = t
  18923. }
  18924. ,
  18925. t.exports = n
  18926. }
  18927. , {
  18928. "../enum/Viewmode": 51,
  18929. "../materials/ModelTextureMaterial": 118,
  18930. "../shaders": 167,
  18931. three: 217
  18932. }],
  18933. 145: [function(e, t, i) {
  18934. "use strict";
  18935. function n(e) {
  18936. this.chunksize = e || 10,
  18937. this.chunks = {},
  18938. this.boundingBoxes = {},
  18939. this.children = [],
  18940. this.offset = new r.Vector3(0,.5,0),
  18941. this.material = new r.MeshBasicMaterial({
  18942. color: 16777215 * Math.random(),
  18943. side: r.DoubleSide
  18944. })
  18945. }
  18946. var r = e("three");
  18947. e("../enum/Viewmode");
  18948. n.prototype.add = function(e) {
  18949. var t, i, n, o, a, s, l, c, h, u, d, p, f, g, m = e.attributes;
  18950. m ? (t = m.position.array,
  18951. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  18952. n = e.faces);
  18953. var v = new r.Vector3;
  18954. if (i)
  18955. for (o = 0,
  18956. a = i.length; o < a; o += 3) {
  18957. var A = 3 * i[o]
  18958. , y = 3 * i[o + 1]
  18959. , C = 3 * i[o + 2];
  18960. s = (t[A] + t[y] + t[C]) / 3,
  18961. l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3,
  18962. c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3,
  18963. h = Math.floor(s / this.chunksize),
  18964. u = Math.floor(l / this.chunksize),
  18965. d = Math.floor(c / this.chunksize),
  18966. p = h + "." + u + "." + d,
  18967. p in this.chunks ? (g = this.chunks[p],
  18968. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18969. f = this.boundingBoxes[p] = new r.Box3),
  18970. g.push(t[A], t[A + 1], t[A + 2], t[y], t[y + 1], t[y + 2], t[C], t[C + 1], t[C + 2]),
  18971. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  18972. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  18973. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]))
  18974. }
  18975. else
  18976. for (o = 0,
  18977. a = t.length; o < a; o += 9)
  18978. s = (t[o] + t[o + 3] + t[o + 6]) / 3,
  18979. l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3,
  18980. c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3,
  18981. h = Math.floor(s / this.chunksize),
  18982. u = Math.floor(l / this.chunksize),
  18983. d = Math.floor(c / this.chunksize),
  18984. p = h + "." + u + "." + d,
  18985. p in this.chunks ? (g = this.chunks[p],
  18986. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18987. f = this.boundingBoxes[p] = new r.Box3),
  18988. g.push(t[o], t[o + 1], t[o + 2], t[o + 3], t[o + 4], t[o + 5], t[o + 6], t[o + 7], t[o + 8]),
  18989. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  18990. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  18991. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]))
  18992. }
  18993. ,
  18994. n.prototype.build = function() {
  18995. var e = new r.Object3D;
  18996. e.material = this.material;
  18997. for (var t in this.chunks) {
  18998. var i = this.chunks[t]
  18999. , n = new r.BufferGeometry;
  19000. n.addAttribute("position", new r.BufferAttribute(new Float32Array(i),3)),
  19001. n.boundingBox = this.boundingBoxes[t];
  19002. var o = new r.Mesh(n,this.material);
  19003. o.material.visible = !1,
  19004. e.add(o),
  19005. this.chunks[t] = []
  19006. }
  19007. return e
  19008. }
  19009. ,
  19010. t.exports = n
  19011. }
  19012. , {
  19013. "../enum/Viewmode": 51,
  19014. three: 217
  19015. }],
  19016. 146: [function(e, t, i) {
  19017. "use strict";
  19018. var r = e("three")
  19019. , o = e("../settings")
  19020. , a = e("../util/common")
  19021. , s = e("../util/lerp")
  19022. , l = e("./ChunkedCollider")
  19023. , c = e("../util/transitions")
  19024. , h = e("../util/easing")
  19025. , u = (e("../objects/Panorama"),
  19026. e("../enum/RenderOrder"))
  19027. , d = e("../localization/localize");
  19028. function n(e, t, i) {
  19029. r.Object3D.call(this),
  19030. this.model = e,
  19031. this.floorIndex = t,
  19032. this.lang = o.languageTag,
  19033. this.name = i || o.languageTag === "cn" ? "Floor " + (t + 1) + "" : "第" + (t + 1) + "层",
  19034. this.panos = [],
  19035. this.chunks = [],
  19036. this.colliderBuilder = new l(3),
  19037. this.collider = null,
  19038. this.center = null,
  19039. this.boundingBox = new r.Box3,
  19040. this.size = null,
  19041. this.hidden = !1,
  19042. this.conservativeBoundingBox = new r.Box3,
  19043. this.debugColor = 16777215 * Math.random(),
  19044. this.transition = null
  19045. }
  19046. n.prototype = Object.create(r.Object3D.prototype),
  19047. n.prototype.enter = function(e) {
  19048. this.model.setFloor(this, e)
  19049. }
  19050. ,
  19051. n.prototype.hide = function(e) {
  19052. if (!this.hidden || this.transition) {
  19053. this.chunks.forEach(function(e) {
  19054. e.material.transparent = !0
  19055. }),
  19056. c.cancel(this.transition);
  19057. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay
  19058. , i = e ? 0 : o.hideFloorDelay / t;
  19059. this.transition = c.start(s.allUniforms(this.chunks, "opacity", .08), t, function() {
  19060. this.hidden = !0
  19061. }
  19062. .bind(this), i, h.easeInOutQuad)
  19063. }
  19064. }
  19065. ,
  19066. n.prototype.show = function(e) {
  19067. if (this.hidden || this.transition) {
  19068. this.hidden = !1,
  19069. c.cancel(this.transition);
  19070. var t = e ? o.showFloorDuration : o.showFloorDuration + o.showFloorDelay
  19071. , i = e ? 0 : o.showFloorDelay / t;
  19072. this.transition = c.start(s.allUniforms(this.chunks, "opacity", 1), t, function() {
  19073. this.hidden || this.chunks.forEach(function(e) {
  19074. e.material.transparent = !1
  19075. })
  19076. }
  19077. .bind(this), i, h.easeInOutQuad)
  19078. }
  19079. }
  19080. ,
  19081. n.prototype.toggle = function(e, t) {
  19082. e = void 0 === e ? this.hidden : e,
  19083. e ? this.show(t) : this.hide(t)
  19084. }
  19085. ,
  19086. n.prototype.containsPoint = function(e) {
  19087. return this.collider.children.some(function(t) {
  19088. return t.geometry.boundingBox || t.geometry.computeBoundingBox(),
  19089. t.geometry.boundingBox.containsPoint(e)
  19090. })
  19091. }
  19092. ,
  19093. n.prototype.distanceToPoint = function(e) {
  19094. var t = null
  19095. , i = 1 / 0;
  19096. return this.collider.children.forEach(function(n) {
  19097. n.geometry.boundingBox || n.geometry.computeBoundingBox();
  19098. var r = n.geometry.boundingBox.distanceToPoint(e);
  19099. (!t || i > r) && (i = r,
  19100. t = n)
  19101. }),
  19102. i
  19103. }
  19104. ,
  19105. n.prototype.addChunk = function(e) {
  19106. e.renderOrder = u.ghostFloor,
  19107. this.add(e),
  19108. this.chunks.push(e),
  19109. this.boundingBox.union(e.geometry.boundingBox),
  19110. this.size = this.boundingBox.size(),
  19111. this.colliderBuilder.add(e.geometry)
  19112. }
  19113. ,
  19114. n.prototype.addPano = function(e) {
  19115. this.panos.push(e),
  19116. this.add(e.skyboxMesh),
  19117. e.marker && this.add(e.marker);
  19118. var t = new r.Vector3(1,1,1)
  19119. , i = (new r.Box3).setFromCenterAndSize(e.position, t);
  19120. this.boundingBox.union(i)
  19121. }
  19122. ,
  19123. n.prototype.build = function() {
  19124. this.collider = this.colliderBuilder.build(!0),
  19125. this.add(this.collider),
  19126. this.center = this.boundingBox.center(),
  19127. this.conservativeBoundingBox.copy(this.boundingBox),
  19128. this.conservativeBoundingBox.min.y = a.lowerMedian(this.collider.children.map(function(e) {
  19129. return e.geometry.boundingBox.min.y
  19130. }), 5),
  19131. this.conservativeBoundingBox.max.y = a.lowerMedian(this.collider.children.map(function(e) {
  19132. return e.geometry.boundingBox.max.y
  19133. }), 5),
  19134. this.colliderBuilder = null
  19135. }
  19136. ,
  19137. n.prototype.toShortString = function() {
  19138. return a.nth(this.floorIndex + 1)
  19139. }
  19140. ,
  19141. n.prototype.toString = function() {
  19142. return this.name
  19143. }
  19144. ,
  19145. t.exports = n
  19146. }
  19147. , {
  19148. "../enum/RenderOrder": 42,
  19149. "../localization/localize": 108,
  19150. "./strings-cn-CN": 109,
  19151. "../objects/Panorama": 148,
  19152. "../settings": 166,
  19153. "../util/common": 185,
  19154. "../util/easing": 186,
  19155. "../util/lerp": 188,
  19156. "../util/transitions": 195,
  19157. "./ChunkedCollider": 145,
  19158. three: 217
  19159. }],
  19160. 147: [function(e, t, i) {
  19161. "use strict";
  19162. function n(e) {
  19163. this.player = e,
  19164. this.obj3d = null,
  19165. this.UP = new r.Vector3(0,1,0)
  19166. }
  19167. var r = e("three")
  19168. , o = e("../settings");
  19169. n.prototype.prefs = {
  19170. linewidth: 3,
  19171. height: .07,
  19172. opacity: .45,
  19173. endScale: .05
  19174. },
  19175. n.prototype.discard = function() {
  19176. if (this.obj3d) {
  19177. var e = this.obj3d.parent;
  19178. e && e.remove(this.obj3d)
  19179. }
  19180. this.obj3d = null
  19181. }
  19182. ,
  19183. n.prototype.draw = function() {
  19184. if (this.discard(),
  19185. o.showNeighbors) {
  19186. var e = this.player.currentPano.floor;
  19187. this.obj3d = new r.Object3D;
  19188. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  19189. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  19190. i.y += this.prefs.height;
  19191. var n = .1525
  19192. , a = .127
  19193. , s = .0127
  19194. , l = .1
  19195. , c = .19
  19196. , h = .2032
  19197. , u = .2286
  19198. , d = .255
  19199. , p = new r.Matrix4;
  19200. for (var f in t)
  19201. if (t[f]) {
  19202. var g = this.player.model.panos.get(f)
  19203. , m = (g.position.clone().sub(this.player.model.position),
  19204. g.position.clone().sub(g.floorPosition))
  19205. , v = g.floorPosition.clone().sub(this.player.model.position);
  19206. v.y += this.prefs.height;
  19207. var A = new r.Geometry;
  19208. A.vertices.push(new r.Vector3(0,-s,0), new r.Vector3(-s,0,0), new r.Vector3(0,s,0), new r.Vector3(s,0,0), new r.Vector3(0,-s,0)),
  19209. A.vertices.push(new r.Vector3(0,-d,0), new r.Vector3(d,-d,0), new r.Vector3(d,n,0), new r.Vector3(-n,n,0), new r.Vector3(-n,a,0), new r.Vector3(-c,l,0), new r.Vector3(-c,-h,0), new r.Vector3(-n,-u,0), new r.Vector3(-n,-d,0), new r.Vector3(0,-d,0)),
  19210. p.identity().setPosition(m),
  19211. A.applyMatrix(p),
  19212. A.vertices.push(new r.Vector3(0,-this.prefs.endScale,0)),
  19213. A.vertices.push(new r.Vector3(-this.prefs.endScale,-this.prefs.endScale,0), new r.Vector3(-this.prefs.endScale,this.prefs.endScale,0), new r.Vector3(this.prefs.endScale,this.prefs.endScale,0), new r.Vector3(this.prefs.endScale,-this.prefs.endScale,0)),
  19214. p.lookAt(v, i, this.UP).setPosition(v),
  19215. A.applyMatrix(p),
  19216. A.vertices.push(v, i);
  19217. var y = new r.Line(A,new r.LineBasicMaterial({
  19218. color: g.debugColor.getHex(),
  19219. transparent: !0,
  19220. opacity: this.prefs.opacity,
  19221. depthWrite: !1,
  19222. name: "sLine" + f,
  19223. linewidth: this.prefs.linewidth
  19224. }));
  19225. this.obj3d.add(y)
  19226. }
  19227. e.add(this.obj3d)
  19228. }
  19229. }
  19230. ,
  19231. n.prototype.update = function() {
  19232. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  19233. }
  19234. ,
  19235. t.exports = n
  19236. }
  19237. , {
  19238. "../settings": 166,
  19239. three: 217
  19240. }],
  19241. 148: [function(e, t, i) {
  19242. (function(i) {
  19243. "use strict";
  19244. function n(e, t, i, n) {
  19245. this.model = e,
  19246. this.id = t,
  19247. this.alignmentType = i.alignmentType || l.ALIGNED,
  19248. this.neighbourUUIDs = i.neighbours || null,
  19249. this.neighbourPanos = null,
  19250. this.floor = null,
  19251. this.floorIndex = i.floor,
  19252. this.failedLoadingAt = 0,
  19253. this.maxLoadRetries = 4,
  19254. this.origin = i.position.clone(),
  19255. this.position = this.alignmentType === l.UNALIGNED ? new r.Vector3(0,-5,0) : i.position.clone(),
  19256. this.quaternion = i.quaternion.clone(),
  19257. this.skyboxMesh = new r.Mesh(E),
  19258. this.skyboxMesh.position.copy(this.position),
  19259. this.skyboxMesh.quaternion.copy(this.quaternion),
  19260. this.skyboxMesh.name = "skybox",
  19261. this.skyboxMesh.visible = !1,
  19262. this.skyboxMesh.updateMatrix(),
  19263. this.skyboxMesh.updateMatrixWorld(),
  19264. this.marker = null,
  19265. this.showFloorMarker = !window.MP_PREFETCHED_MODELDATA.hideFloorMarker;
  19266. this.isAligned() && (this.marker = new r.Mesh(b,new r.MeshBasicMaterial({
  19267. map: w,
  19268. side: r.DoubleSide,
  19269. opacity: 0,
  19270. transparent: !0,
  19271. depthWrite: !1
  19272. })),
  19273. this.marker.visible = this.showFloorMarker,
  19274. this.marker.renderOrder = s.panoMarker,
  19275. this.marker.name = "marker",
  19276. this.marker.pano = this,
  19277. this.marker.layers.set(v.PANOMARKERS),
  19278. this.marker.updateMatrixWorld(),
  19279. a.colorMarkerOnLoad && this.on("load", function() {
  19280. this.marker.material.color.set(65280)
  19281. })),
  19282. this.debugColor = (new r.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  19283. this.floorPosition = i.puck ? i.puck.clone() : null,
  19284. this.tiled = n,
  19285. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new r.Texture([null, null, null, null, null, null]),
  19286. this.solidSkybox.flipY = !1,
  19287. a.minimalMemoryMode && (this.solidSkybox.minFilter = r.LinearFilter,
  19288. this.solidSkybox.magFilter = r.LinearFilter,
  19289. this.solidSkybox.generateMipmaps = !1)),
  19290. this.zoomed = !1,
  19291. this.panoRenderer = null,
  19292. this.qualityManager = null,
  19293. this.tileDownloader = null,
  19294. this.tiledPanoRenderTarget = null,
  19295. this.minimumTiledPanoLoaded = !1,
  19296. this.highestPartialTileRenderOpCompleted = 0,
  19297. this.highestFullTileRenderOpCompleted = 0,
  19298. this.shouldRedrawOnBaseLoaded = !1,
  19299. this.lockUntilRenderingComplete = !1,
  19300. a.colorMarkerOnLoad && this.on("load", function() {
  19301. this.marker.material.color.set(65280)
  19302. });
  19303. /********************************************************************fyz改vr from徐世廷*************************************************************/
  19304. var e = new r.TextureLoader;
  19305. e.setCrossOrigin(!0);
  19306. var g = e.load("images/texture.jpg");
  19307. if (this.vrMarker = new r.Mesh(new r.OctahedronGeometry(.1,0),new r.MeshLambertMaterial({
  19308. color: 16777215,
  19309. transparent: !0,
  19310. opacity: .75,
  19311. map: g
  19312. })),
  19313. this.vrMarker.boluoType = "vr",
  19314. this.vrMarker.position.z = 1,
  19315. this.vrMarker.enabled = !0,
  19316. this.vrMarker.visible = !1,
  19317. window.vrMarkers = window.vrMarkers || [],
  19318. window.vrMarkers.push(this.vrMarker),
  19319. this.marker && this.marker.add(this.vrMarker),
  19320. a.showAxis && (this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,1,0),new r.Vector3(0,0,0),1,255)),
  19321. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,0,1),new r.Vector3(0,0,0),1,16711680)),
  19322. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(1,0,0),new r.Vector3(0,0,0),1,65280))),
  19323. this.adjustAngleEnable) {
  19324. var i = new r.Quaternion;
  19325. i.setFromAxisAngle(new r.Vector3(1,0,0), this.adjustAngleX),
  19326. this.skyboxMesh.quaternion.multiply(i);
  19327. var m = new r.Quaternion;
  19328. m.setFromAxisAngle(new r.Vector3(0,1,0), this.adjustAngleY),
  19329. this.skyboxMesh.quaternion.multiply(m);
  19330. var n = new r.Quaternion;
  19331. n.setFromAxisAngle(new r.Vector3(0,0,1), this.adjustAngleZ),
  19332. this.skyboxMesh.quaternion.multiply(n),
  19333. this.skyboxMesh.updateMatrix(),
  19334. this.skyboxMesh.updateMatrixWorld(),
  19335. this.model.updateProjectedPanos()
  19336. }
  19337. /**************************************************************************************************************************************/
  19338. }
  19339. var r = e("three")
  19340. , o = e("../util/logger")
  19341. , a = e("../settings")
  19342. , s = (e("../enum/Viewmode"),
  19343. e("../enum/RenderOrder"))
  19344. , l = e("../enum/AlignmentType")
  19345. , c = (e("../util/common"),
  19346. e("../util/transitions"))
  19347. , h = e("../util/lerp")
  19348. , u = e("../util/ajax")
  19349. , d = e("../util/texture")
  19350. , p = e("../util/panorama")
  19351. , f = (e("../enum/TileDownloaderEvents"),
  19352. e("../enum/PanoramaEvents"))
  19353. , g = e("../enum/PanoRendererEvents")
  19354. , m = e("../enum/PanoSizeClass")
  19355. , v = e("../enum/RenderLayers")
  19356. , A = (e("../scene/SceneRenderer"),
  19357. e("../enum/GLCubeFaces"),
  19358. e("../exception/BasicException"))
  19359. , y = e("../tile/TileUtils")
  19360. , C = e("events").EventEmitter
  19361. , I = new o(i)
  19362. , E = new r.SphereBufferGeometry(.1)
  19363. , b = new r.PlaneBufferGeometry(.4,.4,1,1)
  19364. , w = d.load("images/marker-256x256.png");
  19365. n.prototype = Object.create(C.prototype),
  19366. n.prototype.enter = function() {
  19367. var e = null;
  19368. return function() {
  19369. this.setZoomed(!1),
  19370. this.emit("enter", {
  19371. oldPano: e,
  19372. newPano: this
  19373. }),
  19374. e = this
  19375. playMusic(this)
  19376. }
  19377. }(),
  19378. n.prototype.exit = function() {
  19379. this.tiled ? (this.clearWaitDeferreds(),
  19380. this.minimumTiledPanoLoaded = !1,
  19381. this.tiledPanoRenderTarget = null,
  19382. this.setZoomed(!1),
  19383. this.panoRenderer.deactivateTiledPano(this),
  19384. this.highestPartialTileRenderOpCompleted = 0,
  19385. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  19386. this.solidSkybox.loaded = !1,
  19387. this.solidSkybox.version = 0),
  19388. this.emit("exit")
  19389. }
  19390. ,
  19391. n.prototype.hoverOn = function(e) {
  19392. this.marker && (c.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  19393. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  19394. }
  19395. ,
  19396. n.prototype.hoverOff = function(e) {
  19397. this.marker && c.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  19398. }
  19399. ,
  19400. n.prototype.build1 = function() {
  19401. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  19402. this.floor.addPano(this),
  19403. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  19404. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  19405. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  19406. }
  19407. ,
  19408. n.prototype.build2 = function() {
  19409. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  19410. this.height = this.position.distanceTo(this.floorPosition),
  19411. this.placeMarker()
  19412. }
  19413. ,
  19414. n.prototype.interpolateFloorPosition = function() {
  19415. var e = this.model.panos.filter(n.filters.isNeighbourPanoTo(this)).filter(function(e) {
  19416. return !!e.floorPosition
  19417. }).sort(function(e, t) {
  19418. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  19419. }
  19420. .bind(this))
  19421. , t = this.position.clone();
  19422. return e.length >= 2 ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  19423. t
  19424. }
  19425. ,
  19426. n.prototype.raycastFloorPosition = function() {
  19427. I.warn("Performance warning: Raycasting to find floor position");
  19428. var e = new r.Raycaster(this.position,new r.Vector3(0,-1,0))
  19429. , t = e.intersectObjects(this.model.colliders);
  19430. return t.length ? t[0].point : null
  19431. }
  19432. ,
  19433. n.prototype.raycastToFindFloor = function() {
  19434. var e = [new r.Vector3(0,-1,0), new r.Vector3(1,-1,0), new r.Vector3(0,-1,1), new r.Vector3(-1,-1,0), new r.Vector3(0,-1,-1), new r.Vector3(1,0,0), new r.Vector3(0,0,1), new r.Vector3(-1,0,0), new r.Vector3(0,0,-1)];
  19435. return function() {
  19436. I.warn("Performance warning: Raycasting to find floor index");
  19437. for (var t = 0; t < e.length; t++) {
  19438. var i = new r.Raycaster(this.position.clone(),e[t].clone())
  19439. , n = i.intersectObjects(this.model.colliders);
  19440. if (n.length)
  19441. return n[0].object.parent.parent
  19442. }
  19443. return null
  19444. }
  19445. }(),
  19446. n.prototype.placeMarker = function() {
  19447. this.marker && (this.marker.position.copy(this.floorPosition),
  19448. this.marker.position.y += .05,
  19449. this.marker.lookAt(new r.Vector3(0,1,0).add(this.marker.position)))
  19450. }
  19451. ,
  19452. n.prototype.translate = function(e) {
  19453. this.position.add(e),
  19454. this.floorPosition.add(e)
  19455. }
  19456. ,
  19457. n.prototype.findClosestMidtpointPanoTo = function(e) {
  19458. (new r.Vector3).addVectors(this.position, e.position).divideScalar(2);
  19459. return this.model.panos.find([n.filters.notIn([this, e])], [n.sortFunctions.distanceToPoint(point)])
  19460. }
  19461. ,
  19462. n.prototype.attachToPanoRenderer = function(e) {
  19463. this.panoRenderer = e,
  19464. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  19465. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  19466. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  19467. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  19468. }
  19469. ;
  19470. var _ = {};
  19471. n.prototype.getWaitDeferred = function(e) {
  19472. var t = _[this.id];
  19473. t || (t = {},
  19474. _[this.id] = t);
  19475. var i = t[e];
  19476. return i || (i = {
  19477. deferred: $.Deferred(),
  19478. active: !1
  19479. },
  19480. t[e] = i),
  19481. i
  19482. }
  19483. ,
  19484. n.prototype.resetWaitDeferred = function(e) {
  19485. var t = this.getWaitDeferred(e);
  19486. t.active = !1,
  19487. t.deferred = $.Deferred()
  19488. }
  19489. ,
  19490. n.prototype.clearWaitDeferreds = function() {
  19491. var e = _[this.id];
  19492. e || (e = {},
  19493. _[this.id] = e);
  19494. for (var t in e)
  19495. if (e.hasOwnProperty(t)) {
  19496. var i = e[t];
  19497. i.active = !1,
  19498. i.deferred = $.Deferred()
  19499. }
  19500. }
  19501. ,
  19502. n.prototype.loadTiledPano = function() {
  19503. var e = (new r.Vector3,
  19504. [])
  19505. , t = [];
  19506. return function(i, n, r, o, a, s) {
  19507. null !== o && void 0 !== o || (o = !0),
  19508. null !== a && void 0 !== a || (a = !0);
  19509. var l = this.getWaitDeferred(i)
  19510. , c = l.deferred
  19511. , h = null
  19512. , u = null;
  19513. if (r && ("number" == typeof r ? h = r : (h = r.hFov,
  19514. u = r.vFov)),
  19515. !this.isLoaded(i)) {
  19516. if (!l.active) {
  19517. if (l.active = !0,
  19518. r) {
  19519. var d = y.matchingTilesInDirection(this, i, n, h, u);
  19520. e[this.id + ":" + i] = {
  19521. tileCount: 0,
  19522. targetTileCount: d
  19523. },
  19524. I.info("Loading partial pano: " + this.id + " with " + d + " tiles")
  19525. }
  19526. t[this.id] || (t[this.id] = !0,
  19527. this.on(f.LoadComplete, function(e, t) {
  19528. var i = this.getWaitDeferred(e).deferred;
  19529. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  19530. this.resetWaitDeferred(e))
  19531. }
  19532. .bind(this)),
  19533. this.on(f.LoadFailed, function(e) {
  19534. var t = this.getWaitDeferred(e).deferred;
  19535. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  19536. this.resetWaitDeferred(e))
  19537. }
  19538. .bind(this)),
  19539. this.on(f.TileLoaded, function(t, i, n) {
  19540. var r = this.getWaitDeferred(t).deferred;
  19541. if (r && "pending" === r.state()) {
  19542. r.notify(t, i, n);
  19543. var o = e[this.id + ":" + t];
  19544. o && (o.tileCount++,
  19545. o.tileCount === o.targetTileCount && (this.onPanoRendered(this.id, t, n, !0),
  19546. r.resolve(t, n),
  19547. this.resetWaitDeferred(t)))
  19548. }
  19549. }
  19550. .bind(this)))
  19551. }
  19552. this.tileDownloader.clearForceQueue(),
  19553. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, u, s),
  19554. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), o),
  19555. this.panoRenderer.renderPanoTiles(this.id, n, a)
  19556. }
  19557. return c.promise()
  19558. }
  19559. }(),
  19560. n.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  19561. if (e === this.id) {
  19562. var n = this.qualityManager.getPanoSize(m.BASE);
  19563. t === n && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  19564. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  19565. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  19566. }
  19567. }
  19568. ,
  19569. n.prototype.onTileRendered = function(e, t, i, n) {
  19570. e === this.id && this.emit(f.TileLoaded, t, i, n)
  19571. }
  19572. ,
  19573. n.prototype.onPanoRendered = function(e, t, i, n) {
  19574. e === this.id && (this.minimumTiledPanoLoaded = !0,
  19575. this.updateSkyboxForZoomLevel(),
  19576. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  19577. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  19578. this.emit("load", t),
  19579. this.model.emit("load", this),
  19580. this.emit(f.LoadComplete, t, i))
  19581. }
  19582. ,
  19583. n.prototype.setZoomed = function(e) {
  19584. this.zoomed = e,
  19585. this.updateSkyboxForZoomLevel()
  19586. }
  19587. ,
  19588. n.prototype.ensureSkyboxReadyForRender = function() {
  19589. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  19590. this.solidSkybox.loaded = !0)
  19591. }
  19592. ,
  19593. n.prototype.updateSkyboxForZoomLevel = function() {
  19594. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  19595. }
  19596. ,
  19597. n.prototype.getSkyboxTexture = function() {
  19598. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  19599. }
  19600. ,
  19601. n.prototype.onTileRenderFail = function(e, t, i) {
  19602. e === this.id && this.emit(f.LoadFailed, t)
  19603. }
  19604. ,
  19605. n.prototype.isLoaded = function(e) {
  19606. if (this.tiled) {
  19607. if (e && "string" == typeof e)
  19608. throw new A("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  19609. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  19610. }
  19611. if (e && "number" == typeof e)
  19612. throw new A("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  19613. return !!this.solidSkybox.high || e in this.solidSkybox
  19614. }
  19615. ,
  19616. n.prototype.loadCube = function(e) {
  19617. if (this.isLoaded(e))
  19618. return I.info("Skipping load of pano, already loaded"),
  19619. $.when();
  19620. this.emit("loading", e),
  19621. this.model.emit("loading", this);
  19622. var t = p.getCubemapUrls(this.model.urls, this.id, e)
  19623. , i = t.filter(function(e) {
  19624. return !e
  19625. });
  19626. "low" === e && i.length > 0 && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  19627. e = "high",
  19628. t = p.getCubemapUrls(this.model.urls, this.id, e));
  19629. var n = 0
  19630. , r = [0, 1, 2, 3, 4, 5].map(function(e, i, n) {
  19631. return u.getImage(t[i])
  19632. }
  19633. .bind(this));
  19634. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(function(t, i, n, r, o, a) {
  19635. return this.solidSkybox[e] = [t, i, n, r, o, a],
  19636. "high" !== e && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[e],
  19637. this.solidSkybox.low = null),
  19638. this.solidSkybox.needsUpdate = !0,
  19639. this.emit("load", e),
  19640. this.model.emit("load", this),
  19641. this
  19642. }
  19643. .bind(this), function() {
  19644. I.error("Downloading cubemap for pano", this.id, "failed"),
  19645. this.failedLoadingAt = Date.now()
  19646. }
  19647. .bind(this), function() {
  19648. return $.when(++n, 6)
  19649. })
  19650. }
  19651. ,
  19652. n.raycastsSkipped = 0,
  19653. n.raycastsDone = 0,
  19654. n.prototype.findNeighourPanos = function() {
  19655. return this.model.panos.setNeighbour(this.id, this.id, !1),
  19656. this.model.panos.forEach(function(e) {
  19657. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  19658. var t = this.position.distanceTo(e.position);
  19659. if (t > a.panoramaNeighbourMaxDistance)
  19660. return this.model.panos.setNeighbour(this, e, !1),
  19661. void n.raycastsSkipped++;
  19662. var i = e.position.clone().sub(this.position).normalize()
  19663. , o = new r.Raycaster(this.position,i.clone(),0,t)
  19664. , s = o.intersectObjects(this.model.colliders);
  19665. n.raycastsDone++,
  19666. this.model.panos.setNeighbour(this, e, 0 === s.length),
  19667. a.showNeighbourRaycasts && (s.length ? this.floor.model.add(new r.ArrowHelper(i,this.position,s[0].distance,16711680)) : this.floor.model.add(new r.ArrowHelper(i,this.position,t,16777215,0,0)))
  19668. }
  19669. }
  19670. .bind(this)),
  19671. this.model.panos.neighbourMap[this.id]
  19672. }
  19673. ,
  19674. n.prototype.worldPosition = function() {
  19675. return this.position
  19676. }
  19677. ,
  19678. n.prototype.addTextSprite = function(e, t) {
  19679. this.removeTextSprite();
  19680. var i = document.createElement("canvas")
  19681. , n = i.getContext("2d");
  19682. i.width = 256,
  19683. i.height = 256;
  19684. var o = "Arial"
  19685. , a = 60;
  19686. n.font = "bold " + a + "px " + o,
  19687. n.fillStyle = "white";
  19688. var s = n.measureText(e).width;
  19689. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  19690. var l = new r.Texture(i);
  19691. l.needsUpdate = !0;
  19692. var c = new r.SpriteMaterial({
  19693. map: l,
  19694. color: t || 16428055
  19695. });
  19696. this.text3d = new r.Sprite(c),
  19697. this.text3d.position.copy(this.skyboxMesh.position),
  19698. this.floor.add(this.text3d)
  19699. }
  19700. ,
  19701. n.prototype.removeTextSprite = function() {
  19702. this.text3d && (this.floor.remove(this.text3d),
  19703. this.text3d = null)
  19704. }
  19705. ,
  19706. n.prototype.isAligned = function() {
  19707. return this.alignmentType === l.ALIGNED
  19708. }
  19709. ,
  19710. n.filters = {
  19711. inDirection: function(e, t, i) {
  19712. return function(n) {
  19713. var r = n.position.clone().sub(e).normalize();
  19714. return r.dot(t) > i
  19715. }
  19716. },
  19717. inFloorDirection: function(e, t, i) {
  19718. return function(n) {
  19719. var r = n.floorPosition.clone().sub(e).normalize();
  19720. return r.dot(t) > i
  19721. }
  19722. },
  19723. inPanoDirection: function(e, t, i) {
  19724. return i = a.navigation.panoScores ? a.navigation.filterStrictness : i,
  19725. function(n) {
  19726. var r = n.floorPosition.clone().sub(e).normalize()
  19727. , o = n.position.clone().sub(e).normalize();
  19728. return r.dot(t) > i || o.dot(t) > i
  19729. }
  19730. },
  19731. atFloor: function(e) {
  19732. return function(t) {
  19733. return !e || t.floor === e
  19734. }
  19735. },
  19736. not: function(e) {
  19737. return function(t) {
  19738. return t !== e
  19739. }
  19740. },
  19741. notIn: function(e) {
  19742. return function(t) {
  19743. return e.indexOf(t) === -1
  19744. }
  19745. },
  19746. isLoaded: function() {
  19747. return function(e) {
  19748. return e.isLoaded()
  19749. }
  19750. },
  19751. isNotLoaded: function() {
  19752. return function(e) {
  19753. return !e.isLoaded()
  19754. }
  19755. },
  19756. isCloseEnoughTo: function(e, t) {
  19757. return function(i) {
  19758. return e.distanceTo(i.floorPosition) < t
  19759. }
  19760. },
  19761. hasMinimumHeightDifferenceTo: function(e, t) {
  19762. return function(i) {
  19763. return Math.abs(i.position.y - e.y) > t
  19764. }
  19765. },
  19766. isNotBehindNormal: function(e, t) {
  19767. var i = new r.Vector3;
  19768. return t = t.clone(),
  19769. function(n) {
  19770. var r = i.copy(n.position).sub(e).normalize();
  19771. return r.dot(t) > 0
  19772. }
  19773. },
  19774. isNeighbourPanoTo: function(e) {
  19775. return function(t) {
  19776. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id]
  19777. }
  19778. },
  19779. isNeighbourOfNeighbourTo: function(e) {
  19780. return function(t) {
  19781. return !!e.neighbourPanos[t.id] || e.neighbourUUIDs.some(function(i) {
  19782. var n = e.model.panos.get(i);
  19783. return !!n && n.neighbourPanos[t.id]
  19784. })
  19785. }
  19786. },
  19787. isNotRecentlyFailed: function(e) {
  19788. return function(t) {
  19789. return Date.now() - t.failedLoadingAt > e
  19790. }
  19791. },
  19792. isOnVisibleFloor: function() {
  19793. return function(e) {
  19794. return !e.floor.hidden
  19795. }
  19796. },
  19797. isPanoAligned: function() {
  19798. return function(e) {
  19799. return e.isAligned()
  19800. }
  19801. }
  19802. },
  19803. n.sortFunctions = {
  19804. distanceToPoint: function(e) {
  19805. return function(t, i) {
  19806. return t.position.distanceTo(e) - i.position.distanceTo(e)
  19807. }
  19808. },
  19809. floorDistanceToPoint: function(e) {
  19810. return function(t, i) {
  19811. return t.floorPosition.distanceTo(e) - i.floorPosition.distanceTo(e)
  19812. }
  19813. },
  19814. choose: function(e) {
  19815. return function(t, i) {
  19816. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0
  19817. }
  19818. }
  19819. },
  19820. n.scoreFunctions = {
  19821. distance: function(e, t) {
  19822. return t = t || a.navigation.distanceFactor,
  19823. function(i) {
  19824. return e ? e.position.distanceTo(i.position) * t : 0
  19825. }
  19826. },
  19827. distanceSquared: function(e, t) {
  19828. return t = t || a.navigation.distanceFactor,
  19829. function(i) {
  19830. return e ? e.position.distanceToSquared(i.position) * t : 0
  19831. }
  19832. },
  19833. direction: function(e, t) {
  19834. return function(i) {
  19835. var n = i.position.clone().sub(e).normalize();
  19836. return n.dot(t) * a.navigation.directionFactor
  19837. }
  19838. },
  19839. angle: function(e, t) {
  19840. return function(i) {
  19841. var n = i.position.clone().sub(e).normalize();
  19842. return n.angleTo(t) * a.navigation.angleFactor
  19843. }
  19844. },
  19845. inFieldOfView: function(e, t) {
  19846. return function(i) {
  19847. var n = i.position.clone().sub(e).normalize();
  19848. return n.dot(t) > .75 ? 10 : -1
  19849. }
  19850. },
  19851. optionality: function(e) {
  19852. return function(t) {
  19853. var i = t.neighbourUUIDs.filter(function(t) {
  19854. return !(t in e.neighbourUUIDs) && t !== e.id
  19855. });
  19856. return i.length * a.navigation.optionalityFactor
  19857. }
  19858. },
  19859. penalizeHeightDifferenceUnder: function(e, t) {
  19860. return function(i) {
  19861. return e.y - i.position.y < t ? -20 : 0
  19862. }
  19863. }
  19864. },
  19865. t.exports = n
  19866. }
  19867. ).call(this, "/js/objects/Panorama.js")
  19868. }
  19869. , {
  19870. "../enum/AlignmentType": 17,
  19871. "../enum/GLCubeFaces": 25,
  19872. "../enum/PanoRendererEvents": 35,
  19873. "../enum/PanoSizeClass": 36,
  19874. "../enum/PanoramaEvents": 37,
  19875. "../enum/RenderLayers": 41,
  19876. "../enum/RenderOrder": 42,
  19877. "../enum/TileDownloaderEvents": 45,
  19878. "../enum/Viewmode": 51,
  19879. "../exception/BasicException": 55,
  19880. "../scene/SceneRenderer": 158,
  19881. "../settings": 166,
  19882. "../tile/TileUtils": 174,
  19883. "../util/ajax": 181,
  19884. "../util/common": 185,
  19885. "../util/lerp": 188,
  19886. "../util/logger": 189,
  19887. "../util/panorama": 191,
  19888. "../util/texture": 194,
  19889. "../util/transitions": 195,
  19890. events: 202,
  19891. three: 217
  19892. }],
  19893. 149: [function(e, t, i) {
  19894. "use strict";
  19895. function n(e) {
  19896. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  19897. t.map.value = d,
  19898. t.opacity.value = 0,
  19899. t.color.value.set(o.reticuleColor),
  19900. t.showMouseMarker = !window.MP_PREFETCHED_MODELDATA.hideMouseMarker;
  19901. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  19902. side: r.DoubleSide,
  19903. depthWrite: !1,
  19904. depthTest: !1,
  19905. transparent: !0,
  19906. vertexShader: c.waypoint.vertexShader,
  19907. fragmentShader: c.waypoint.fragmentShader,
  19908. uniforms: t,
  19909. name: "waypoint",
  19910. opacity: 0,
  19911. visible: t.showMouseMarker // 显示/隐藏鼠标标志
  19912. })),
  19913. this.layers.set(h.RETICULE),
  19914. this.renderOrder = u.reticule,
  19915. this.player = e,
  19916. this.direction = new r.Vector3,
  19917. this.hidden = !0,
  19918. this.mouseLastMoveTime = Date.now()
  19919. }
  19920. var r = e("three")
  19921. , o = e("../settings")
  19922. , a = e("../util/transitions")
  19923. , s = e("../util/texture")
  19924. , l = e("../util/lerp")
  19925. , c = e("../shaders")
  19926. , h = e("../enum/RenderLayers")
  19927. , u = e("../enum/RenderOrder")
  19928. , d = s.load("images/reticule-256x256.png");
  19929. n.prototype = Object.create(r.Mesh.prototype),
  19930. n.prototype.move = function(e, t, i) {
  19931. this.hidden = i,
  19932. this.mouseLastMoveTime = Date.now()
  19933. }
  19934. ,
  19935. n.prototype.hide = function() {
  19936. this.hidden || (this.hidden = !0,
  19937. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  19938. }
  19939. ,
  19940. n.prototype.show = function() {
  19941. this.hidden = !1,
  19942. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  19943. }
  19944. ,
  19945. n.prototype.update = function() {
  19946. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  19947. }
  19948. ,
  19949. n.prototype.updatePosition = function(e, t) {
  19950. if (!this.hidden) {
  19951. if (!t)
  19952. return this.hide();
  19953. var i = t.point
  19954. , n = e.distanceTo(i)
  19955. , r = 1 + .01 * n;
  19956. n < 1 && (r -= 1 - n),
  19957. this.show(),
  19958. this.scale.set(r, r, r),
  19959. this.direction = this.direction.multiplyScalar(.8),
  19960. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  19961. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  19962. this.lookAt(this.position.clone().add(this.direction))
  19963. }
  19964. }
  19965. ,
  19966. n.prototype.writeAstag = function() {
  19967. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  19968. , t = new Date;
  19969. this.tagCount = "undefined" == typeof this.tagCount ? 1 : this.tagCount + 1;
  19970. var i = {
  19971. enabled: !0,
  19972. version: "0",
  19973. created: t.toISOString(),
  19974. created_by: "APITest",
  19975. position: this.position.clone(),
  19976. stem: {
  19977. enabled: o.tags.pole.enabled,
  19978. direction: this.direction.multiplyScalar(o.tags.pole.height)
  19979. },
  19980. label: "tag " + this.tagCount,
  19981. description: "Description " + e,
  19982. floor: function(e) {
  19983. if (e.currentFloor) {
  19984. var t = e.floors.indexOf(e.currentFloor);
  19985. return t > -1 ? t : void 0
  19986. }
  19987. }(this.player.model),
  19988. type: "info",
  19989. metadata: {
  19990. preferred_camera: {
  19991. mode: this.player.mode
  19992. }
  19993. }
  19994. };
  19995. console.log("--------------------------"),
  19996. console.log(JSON.stringify(i));
  19997. var n = this.player.model.addtag(e, i).build();
  19998. n && (n.disc && this.player.tagDiscs.push(n.disc),
  19999. n.visible || n.show(o.tags.startup.fadeInDuration))
  20000. }
  20001. ,
  20002. t.exports = n
  20003. }
  20004. , {
  20005. "../enum/RenderLayers": 41,
  20006. "../enum/RenderOrder": 42,
  20007. "../settings": 166,
  20008. "../shaders": 167,
  20009. "../util/lerp": 188,
  20010. "../util/texture": 194,
  20011. "../util/transitions": 195,
  20012. three: 217
  20013. }],
  20014. 150: [function(e, t, i) {
  20015. "use strict";
  20016. function n(e, t) {
  20017. this.chunks = [],
  20018. this.floorId = e,
  20019. this.roomId = t,
  20020. this.position = new r.Vector3
  20021. }
  20022. var r = e("three");
  20023. n.prototype.addChunk = function(e) {
  20024. this.chunks.push(e)
  20025. }
  20026. ,
  20027. n.prototype.calcBoundaries = function() {
  20028. for (var e = new r.Vector3, t = new r.Vector3(0,0,0), i = new r.Vector3(0,0,0), n = new r.Vector3(0,0,0), o = 0, a = 0; a < this.chunks.length; a++) {
  20029. var s = this.chunks[a]
  20030. , l = s.geometry.attributes.position;
  20031. if (l)
  20032. for (var c = 0; c < l.array.length; c += 3)
  20033. e.set(l.array[c], l.array[c + 1], l.array[c + 2]),
  20034. t.add(e),
  20035. 0 === c ? (i.copy(e),
  20036. n.copy(e)) : (i.max(e),
  20037. n.min(e)),
  20038. o++
  20039. }
  20040. o > 0 ? (t.multiplyScalar(1 / o),
  20041. this.average = t) : this.average = null,
  20042. this.boundsMax = i,
  20043. this.boundsMin = n,
  20044. this.center = new r.Vector3,
  20045. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  20046. }
  20047. ,
  20048. t.exports = n
  20049. }
  20050. , {
  20051. three: 217
  20052. }],
  20053. 151: [function(e, t, i) {
  20054. (function(i) {
  20055. "use strict";
  20056. function n(e, t, i) {
  20057. this.obj3d = null,
  20058. this.nodes = [],
  20059. this.colorHull = [],
  20060. this.shortPaths = {},
  20061. this.floorHull = null,
  20062. this.cameraHull = null,
  20063. this.floorPathDistance = 0,
  20064. this.floorCurvePoints = null,
  20065. this.floorCurveColors = null,
  20066. this.camCurvePoints = null,
  20067. this.warpDestHeroLoc = null,
  20068. this.warpDestPano = null,
  20069. this.warpPathPoints = null,
  20070. this.warpPathLengths = [0],
  20071. this.warpLength = 0,
  20072. this.closeWarpDistance = 4,
  20073. this.UP = A.UP.clone(),
  20074. this.longestStep = 0,
  20075. this.upcomingTransType = null,
  20076. this.burnsDir = 1, //导览在DOLLHOUSE停留时的旋转方向 1 或 -1
  20077. this.prevNextDist = 0,
  20078. this.nextI = 0,
  20079. this.activeTransType = null,
  20080. this.lastTransType = null,
  20081. this.bunnyObj = null,
  20082. this.director = e,
  20083. this.player = t,
  20084. this.playerControls = i,
  20085. this.modelManager = t.modelManager,
  20086. this.updateModel(),
  20087. this.updateDefaultsFromModelData(),
  20088. this.bindEvents(),
  20089. this.warping = !1,
  20090. this.waitingToWarp = !1,
  20091. this.warpInterrupted = !1,
  20092. this.warpInterruptionBlackoutStyle = null,
  20093. this.warpInterruptionTravelTime = null
  20094. }
  20095. var r = e("three")
  20096. , o = e("../util/logger")
  20097. , a = e("../enum/Viewmode")
  20098. , s = e("../enum/RenderOrder")
  20099. , l = e("../enum/WarpStyle")
  20100. , c = e("../settings")
  20101. , h = e("../util/math")
  20102. , u = e("../util/lerp")
  20103. , d = e("../util/easing")
  20104. , p = e("../util/transitions")
  20105. , f = e("../objects/Snapshot")
  20106. , g = e("../effects")
  20107. , m = e("../shaders")
  20108. , v = (e("../gui/gui"),
  20109. e("../util/texture"))
  20110. , A = e("../enum/Vectors")
  20111. , y = (e("../model/ModelManager"),
  20112. new o(i))
  20113. , C = e("../enum/PlayerEvents")
  20114. , I = e("../enum/BlackoutStyle")
  20115. , E = e("../enum/ModelManagerEvents")
  20116. , b = e("../constants")
  20117. , w = {
  20118. path: v.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAAAgCAYAAADaInAlAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKxGlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjarZZnUFP5Gsbfc046CS0hAlJCb4IU6dJrAAXpYCMkIQmEEFJQsKEiruBaEBHBsqIrIAquBZC1IBZsi2DvC7IoqOtiwYbK/cAS7r1z74c7c9+ZM/ObZ97/c57/OV8eAOogRyoVo5oA2RKFLDYskJWcksoi/g54oIEmUMCUw5VLA2JiouA/DwLw4Q4gAAA37TlSqRj+t9Hi8eVcACQGANJ5cm42AHIMAOniSmUKAKwIAMwWKaQKAKwOABiy5JRUAOwkADAE49wNAIz0cf4DABiy+NggAOwTAInK4cgEAFQcALDyuAIFANUcABwlPJEEgBoPAL5cIYcHQC0HgGnZ2Tk8AGo7AFin/5OP4F8801WeHI5AxeN3AQAAUrBILhVz8uH/Pdli5cQ7TAGAKpSFxwKAJQBSl5UTqWJJ+uzoCRbxACZYqAxPmGCuPCh1gnmc4MgJVmYlBEwwRzZ5VqRgx0+wLCdW5c+Xh8Sp/PnsKFUG8WwVZ4hC2RNcIIxPmuA8UeLsCZZnxUVO7gSpdJkyVpU5QxaqumO2fDIblzOZQSGMD5/MlqzKwOMHh6h0SYJqX6oIVHlKxTGqfb44TKXL8+JUZxWyeJWeyYmImfSJUX0fiAchKEECPOCDDNIhB8SgABYEgwjkIAUxcCAfQMFfrAAACMqR5stEAqGCFSCVivkstoTrMI3l7OjkCpCcksoa/+XvmIAAAMK8MqnltgN4lgAggkmNYwZw4hkA/cOkZvYWgLoJ4FQ3VynLG9dwAAB4oIAGMEAPjMAMrMEenMENvMEfQiACoiEeUmABcEEI2SCDRbAUVkIxlMIm2ApVsBv2Qh0cgiPQAifhLFyEq9ANt+Eh9MIAvIRh+ACjCIIQERpCR/QQY8QCsUOcEQ/EFwlBopBYJAVJQwSIBFEiS5HVSClShlQhe5B65BfkBHIWuYz0IPeRPmQIeYt8QTGUijJQQ9QSnY56oAFoJBqPzkcFaC5agBahG9BKtAY9iDajZ9Gr6G20F32JjmCAqWFMzASzxzywICwaS8UyMBm2HCvBKrAarBFrwzqxm1gv9gr7jCPg6DgWzh7njQvHJeC4uFzcctx6XBWuDteMO4+7ievDDeO+42l4A7wd3gvPxifjBfhF+GJ8BX4//jj+Av42fgD/gUAgMAlWBHdCOCGFkElYQlhP2EloIrQTegj9hBEikahHtCP6EKOJHKKCWEzcTjxIPEO8QRwgfiKpkYxJzqRQUipJQlpFqiAdIJ0m3SA9J42SNckWZC9yNJlHzidvJO8jt5GvkwfIoxQtihXFhxJPyaSspFRSGikXKI8o79TU1EzVPNXmqInUCtUq1Q6rXVLrU/tM1abaUoOo86hK6gZqLbWdep/6jkajWdL8aak0BW0DrZ52jvaE9kmdru6gzlbnqa9Qr1ZvVr+h/lqDrGGhEaCxQKNAo0LjqMZ1jVeaZE1LzSBNjuZyzWrNE5p3NUe06FpOWtFa2VrrtQ5oXdYa1CZqW2qHaPO0i7T3ap/T7qdjdDN6EJ1LX03fR79AH2AQGFYMNiOTUco4xOhiDOto68zQSdRZrFOtc0qnl4kxLZlsppi5kXmEeYf5ZYrhlIAp/CnrpjROuTHlo+5UXX9dvm6JbpPubd0veiy9EL0svc16LXqP9XH6tvpz9Bfp79K/oP9qKmOq91Tu1JKpR6Y+MEANbA1iDZYY7DW4ZjBiaGQYZig13G54zvCVEdPI3yjTqNzotNGQMd3Y11hkXG58xvgFS4cVwBKzKlnnWcMmBibhJkqTPSZdJqOmVqYJpqtMm0wfm1HMPMwyzMrNOsyGzY3NZ5kvNW8wf2BBtvCwEFpss+i0+GhpZZlkudayxXLQSteKbVVg1WD1yJpm7Weda11jfcuGYONhk2Wz06bbFrV1tRXaVttet0Pt3OxEdjvteqbhp3lOk0yrmXbXnmofYJ9n32Df58B0iHJY5dDi8Hq6+fTU6Zund07/7ujqKHbc5/jQSdspwmmVU5vTW2dbZ65ztfMtF5pLqMsKl1aXNzPsZvBn7Jpxz5XuOst1rWuH6zc3dzeZW6PbkLu5e5r7Dve7HgyPGI/1Hpc88Z6Bnis8T3p+9nLzUngd8frL2947y/uA9+BMq5n8mftm9vuY+nB89vj0+rJ803x/8u31M/Hj+NX4PfU38+f57/d/HmATkBlwMOB1oGOgLPB44Mcgr6BlQe3BWHBYcElwV4h2SEJIVciTUNNQQWhD6HCYa9iSsPZwfHhk+Obwu2xDNpddzx6OcI9YFnE+khoZF1kV+TTKNkoW1TYLnRUxa8usR7MtZktmt0RDNDt6S/TjGKuY3Jhf5xDmxMypnvMs1il2aWxnHD1uYdyBuA/xgfEb4x8mWCcoEzoSNRLnJdYnfkwKTipL6k2enrws+WqKfooopTWVmJqYuj91ZG7I3K1zB+a5ziued2e+1fzF8y8v0F8gXnBqocZCzsKjafi0pLQDaV850Zwazkg6O31H+jA3iLuN+5LnzyvnDfF9+GX85xk+GWUZgwIfwRbBkNBPWCF8JQoSVYneZIZn7s78mBWdVZs1Jk4SN2WTstOyT0i0JVmS8zlGOYtzeqR20mJpb65X7tbcYVmkbL8ckc+XtyoYCqnimtJauUbZl+ebV533aVHioqOLtRZLFl/Lt81fl/+8ILTg5yW4JdwlHUtNlq5c2rcsYNme5cjy9OUdK8xWFK0YKAwrrFtJWZm18rdVjqvKVr1fnbS6rciwqLCof03YmoZi9WJZ8d213mt3/4D7QfRD1zqXddvXfS/hlVwpdSytKP26nrv+yo9OP1b+OLYhY0PXRreNuzYRNkk23dnst7muTKusoKx/y6wtzeWs8pLy91sXbr1cMaNi9zbKNuW23sqoytbt5ts3bf9aJay6XR1Y3bTDYMe6HR938nbe2OW/q3G34e7S3V9+Ev10b0/YnuYay5qKvYS9eXuf7Uvc1/mzx8/1+/X3l+7/Viup7a2LrTtf715ff8DgwMYGtEHZMHRw3sHuQ8GHWhvtG/c0MZtKD8Nh5eEXv6T9cudI5JGOox5HG49ZHNtxnH68pBlpzm8ebhG29LamtPaciDjR0ebddvxXh19rT5qcrD6lc2rjacrpotNjZwrOjLRL21+dFZzt71jY8fBc8rlb5+ec77oQeeHSxdCL5zoDOs9c8rl08rLX5RNXPK60XHW72nzN9drx31x/O97l1tV83f16a7dnd1vPzJ7TN/xunL0ZfPPiLfatq7dn3+65k3Dn3t15d3vv8e4N3hfff/Mg78How8JH+EcljzUfVzwxeFLzu83vTb1uvaf6gvuuPY17+rCf2//yD/kfXweKntGeVTw3fl4/6Dx4cih0qPvF3BcDL6UvR18V/6n1547X1q+P/eX/17Xh5OGBN7I3Y2/Xv9N7V/t+xvuOkZiRJx+yP4x+LPmk96nus8fnzi9JX56PLvpK/Fr5zeZb2/fI74/GssfGpBwZBwAAMABAMzIA3tYC0FIA6N0AFPXxzvx310cmW/9/4/FeDQAAbgC1/gAJhQBR7QC72gEsCse7dQwAxPsD6uKiev4eeYaL87gXVQaA/zQ29s4QgNgG8E02Nja6c2zs2z4A7D5Ae+54VwcAIGgClFnpWusMd8e8L/z3zvwPWFMLsyHkoksAAD+UaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/Pgo8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjYtYzA2NyA3OS4xNTc3NDcsIDIwMTUvMDMvMzAtMjM6NDA6NDIgICAgICAgICI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIKICAgICAgICAgICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICAgICAgICAgICB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIKICAgICAgICAgICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgICAgICAgICAgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiCiAgICAgICAgICAgIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwveG1wOkNyZWF0b3JUb29sPgogICAgICAgICA8eG1wOkNyZWF0ZURhdGU+MjAxNS0wNy0yMVQxODoyMDo1My0wNzowMDwveG1wOkNyZWF0ZURhdGU+CiAgICAgICAgIDx4bXA6TWV0YWRhdGFEYXRlPjIwMTUtMDctMjFUMTg6MjE6MzgtMDc6MDA8L3htcDpNZXRhZGF0YURhdGU+CiAgICAgICAgIDx4bXA6TW9kaWZ5RGF0ZT4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC94bXA6TW9kaWZ5RGF0ZT4KICAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9wbmc8L2RjOmZvcm1hdD4KICAgICAgICAgPHhtcE1NOkluc3RhbmNlSUQ+eG1wLmlpZDoyYWI5MzcwNS0xYjZjLTQ1ZGMtYTQyNy1jYWQzOGNiZTUxYjM8L3htcE1NOkluc3RhbmNlSUQ+CiAgICAgICAgIDx4bXBNTTpEb2N1bWVudElEPmFkb2JlOmRvY2lkOnBob3Rvc2hvcDpjYjc1NjFhOC03MDlhLTExNzgtOTQ1Zi1kNDlkZmJlYjBjMWE8L3htcE1NOkRvY3VtZW50SUQ+CiAgICAgICAgIDx4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3htcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPHhtcE1NOkhpc3Rvcnk+CiAgICAgICAgICAgIDxyZGY6U2VxPgogICAgICAgICAgICAgICA8cmRmOmxpIHJkZjpwYXJzZVR5cGU9IlJlc291cmNlIj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmFjdGlvbj5jcmVhdGVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6Y2Y4NGFiMzItZTUwNi00ZGM1LThlMWQtNTI4MTI4YTdjZTljPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIwOjUzLTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MWIzNzcxZGMtZGU3Ni00YTQ4LTkzNjEtMGQ4NzdkOWY0ODkwPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPmNvbnZlcnRlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5mcm9tIGFwcGxpY2F0aW9uL3ZuZC5hZG9iZS5waG90b3Nob3AgdG8gaW1hZ2UvcG5nPC9zdEV2dDpwYXJhbWV0ZXJzPgogICAgICAgICAgICAgICA8L3JkZjpsaT4KICAgICAgICAgICAgICAgPHJkZjpsaSByZGY6cGFyc2VUeXBlPSJSZXNvdXJjZSI+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDphY3Rpb24+ZGVyaXZlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5jb252ZXJ0ZWQgZnJvbSBhcHBsaWNhdGlvbi92bmQuYWRvYmUucGhvdG9zaG9wIHRvIGltYWdlL3BuZzwvc3RFdnQ6cGFyYW1ldGVycz4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MmFiOTM3MDUtMWI2Yy00NWRjLWE0MjctY2FkMzhjYmU1MWIzPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgIDwvcmRmOlNlcT4KICAgICAgICAgPC94bXBNTTpIaXN0b3J5PgogICAgICAgICA8eG1wTU06RGVyaXZlZEZyb20gcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICA8c3RSZWY6aW5zdGFuY2VJRD54bXAuaWlkOjFiMzc3MWRjLWRlNzYtNGE0OC05MzYxLTBkODc3ZDlmNDg5MDwvc3RSZWY6aW5zdGFuY2VJRD4KICAgICAgICAgICAgPHN0UmVmOmRvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3N0UmVmOmRvY3VtZW50SUQ+CiAgICAgICAgICAgIDxzdFJlZjpvcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3N0UmVmOm9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPC94bXBNTTpEZXJpdmVkRnJvbT4KICAgICAgICAgPHBob3Rvc2hvcDpDb2xvck1vZGU+MzwvcGhvdG9zaG9wOkNvbG9yTW9kZT4KICAgICAgICAgPHBob3Rvc2hvcDpJQ0NQcm9maWxlPkRpc3BsYXk8L3Bob3Rvc2hvcDpJQ0NQcm9maWxlPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICAgICA8dGlmZjpYUmVzb2x1dGlvbj43MjAwMDAvMTAwMDA8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDx0aWZmOllSZXNvbHV0aW9uPjcyMDAwMC8xMDAwMDwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgICAgPHRpZmY6UmVzb2x1dGlvblVuaXQ+MjwvdGlmZjpSZXNvbHV0aW9uVW5pdD4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT42NTUzNTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+MTI4PC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxZRGltZW5zaW9uPjMyPC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz6SKsKfAAAAIGNIUk0AAG11AABzoAAA/N0AAINkAABw6AAA7GgAADA+AAAQkOTsmeoAAAOCSURBVHja7FtRi9ZADJxETzkQRf3/P9FTREQ9bXwpUvYyk+x3PiawtPS6/UozmUyyexYROO0OwItzOICX57g7j68u4/U57pfzewDvAXxcjh8AvAPwFsCb83ljuf0G8A3A13N8AvAZwMN5/gDgC4DvAH4s4+d5fATw6xyPAP5cjtfx6JcfjuRl7Lxu5GXjcp8lc7Nnx/hY2rGcW/JNlU+c+Mmyb+/EYdlEBpDKjABkjH8vFWxVAAW5toIgGFquL2FLlDNErUyRzTnGt20LcW7NAFTs/G+uF2hhP+KCKa7zjuQ5wwR7LGDi75mTbbkWimFcUHYkkRwLSNRLZekjRgO0GSAKBr4y7yGeIwOuKwI7uSrIvLhBNwwD8MCCCFBbwGCVCPeGas9yfZYmgoDGyH1jmgGy75h9a1tYg6Vny0Dhzei2BTSWRPmKNicIHOs5nwWlCjQIFo+MNZQIZKVHCJa4vtQxOf9Z9B8b6ZcBKEQpHkwDmEgHVb8gA5VNBXAzC1jBBkyrHYSln1Rj3mwmdOlGiZVhg9t6AJ0G3CHmKuBQAFTlBFP4saA3EqEyVqcAE9VUFdVW9A7QqQKqvn6QFzVRekxLuA+AaDR/lJ+iUVmEEoHsWizAMdK06LDHWG4H8kWfTipQ5XkKHm+gMaOnIDUmGtXD2F4TKDYYuttClhrARPSuVBJCcIAgeVLAfi+ARXrcEHBWlYEg9T2aFAQiTGJRrGO6CjiEAOyIvRDs0C4DoxB1IdgkCmCM5eaLg00wg9Jrnvgy1kDsVgHMwUaYIjufdYB9HRBLjW8bDBJFKvEqBWTNhm6f2gn9T/T3HFh1ZdVyPBORqU7zotbPqAmiCcQ0wUT/bTqAAcFEeraiX1NWAQwMCkms73y93wcEWzoA4Ov+rETMloplC943Kagj8kB+eNLAXjMoim+WNdiOokfwBAzVaiCr7x29JUlLxOCwQC0A15EtrWe7fzos29IAlbiIhgaYrWDPF4HVPUpzKT+VKSCj8o6g6+wDHCDsCUGgXvQxUSGorfo0BWRUrh6OQm3OruD9FACiqyqwOPQ+AroaaM2HZ6jKjtYUk2M5vXvh8Crdtpp83U2h1b8lOZ5uCwv09reN1WW4LeLbGvpKtfFlCsjyjxGVupYfFVCGBfZKwayFfv3G3mQUxhyt/QBRqFRD/m9hPj78byxggnUrMW7Kn38HAONAllI0EmS1AAAAAElFTkSuQmCC"),
  20119. pathEnd: v.load("images/End.png"),
  20120. pathStart: v.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAM6VJREFUeAHtfQl0HNWZ7r3VXd2SLLEa2xgc2ySGxwOMiSRsC2IsG1vbMCGGsCYsWcibGSAhEEJeFkyIhyRAkknmvXOGJBMggQAhDAlIsjFY4NjCtqSwH55xDjYDAWN2JGvp6q77vr/UMpLcS3V3Lbeqbx3L3V1177989///uvvlTF2BRmBx96uVNbFpsyMiMpcx83Cu8UOh0FQm6FMcyuk7YwcLxivwGWOcxXEvxgSLW7/xH64E7o8I+hRshH5zJobx+R7uvc0Yf4dx8Q5+vy1M+tTeSPHUzv7EnleebJg1hPvqCigCsAV1yY7A0q6uaGVlw9EiwuZzTTueC34UnBsOz+dwzmb4Kb8QbDdk2QVZdgouXham+TxPsWeHhrpferyxMemnbIp3fgRUAMiPkacplnbtrKioObIOBbOQMz4fzjWfcX4sftMbOzAXag4jTIgXERieFUzgj20d7n+t9/HGuVSzUJckCKgA4HNBtGzsP4xVVZ4CRz9F4wyfvBYixXwWyy32CejZZwq2GXpuZoNDmzuX1LzlFjNFNz8CKgDkx8jRFLW9vfoMduKpqDq3oPregrf78Y4yCBoxIZ4HFp3AonM3e2ZTX12dETQVgiyvCgAelN6KTXtn6nH9DDg7nJ4vB8tqD9gGkcWAEOIxNB06jRHjofWnTnk9iEoESWYVAFwqreVbBqbH9djZ6LA7V3B+KoBWWBeANfoM0KcoNuG/e0eMxP2PLap+s4DsKqlNBJRR2gTKTrKm7g8OieiVn8Wb/ly86U9DHs1OPpUmLwImagZPoGZwb8oY+sO6hgPfzZtDJbCFgAoAtmDKnai5x1iqcf5lpFqFtiyNt6vLJQTQX0CjCA8gIvxybb3+uEtsyoasCgBFFvXKzf3TIrGKSzSNfQm1+3lFklHZSkJA7DBN9qtUYvj2R06p2VMSqTLNrAJAgQXftDVxYiSqXY0Zc+fhba8XmF0ldwEB1AoM9LDck0qat65bGHvGBRahJakCgM2ibe4zmiKMXYO3/ek2s6hkviAgHk0xdsvaWn2dL+wDxlQFgFwFdt99kZa5Z16IDr1r8HdCrqTqmVwIoNPwOfzd0rnzwbvYOecgJqgrEwIqAGRCZfVqrbXtW+cyrq2G4x+dKYm6FwwEEAReYsJc3dF+071s9WozGFJ7J6UKABOx5q09SfTkixswlHfcxEfqV6AREOIFIfj1HfXRB6AHphmoixBQASBtB609xgqg8WO88Rco0wgvAqgRPA33v7ajXl8fXi3ta1b2AWDFluF5uh65FSvvzrAPm0oZdASwQvEhw0hdvX5RxY6g61KK/GUbAFq2vHMAix7wXUzguRIAhnX1XSm2UQ55E5hQ9HOW/PDGzkWHflgOCk/WsSwDQOu2xKUsov0Qyk+bDIj6XX4IoENgD0uZ13WcHPtNuWlfVgGgqXv4E5FY5Da08xvLraCVvvkRQP9AVyqRumxdQ8Xf8qcOR4qyCADWllrVp34d1f3V6OirDEfRKS1cQUCwITQLVg8NbPpJOWxpFvoA0NKTOAlv/F/j7yRXDEYRDSUCqA08hb8vdtbHngqlgmmlQr1ctaUv8TXOta3K+cNswu7oRjZDtkM25A4HOaiGsgbQ9pf3DxaVU36DQvy0HDArKYKMAGoCf+JDey9t/9RB7wVZj0yyhy4AtPYmFmIK771QbHYmhdU9hUAxCGCk4BVMKT63oy62tZj8suYJVROgtdf4Ojbh+YtyflnNLbhyjdqU9pdRGwuuHpMlD0UNwNqKK151u5rNN7l41W83EKBZhKmRwUvCsDVZ4ANA81ZjcSTC78Hw3sfcKGxFUyGQEQHB/juVEuetXag/mfF5QG4GuQnAW/uMb2gRvlE5f0CsLUxi4oVDtkc2CLUC+yINpOB0fFbVAUfehSr/qjDZlNIlmAigSfDA4IevXRjEY88CFwBO7333wBiv+TOcf0kwzUVJHUYEEAQ2JkT/Pz5ad8gHQdIvUAGgqXfv4REeWwvnx6GZ6lIIyIUAgsCzKZFoXlc35Q25JMsuTWACwOi6/egjEHhOdnXUE4WAvwhgvsAuw0iuDMo+A4EIAK1bE3UsqnVA2MP8LV7FXSGQHwEEgbdY0mztWBjrzZ/a3xTSjwK09Rin86jWpZzfX0NR3O0jQLZKNku2az+XPymlDgDNPSPnMY23Axp1mq4/9qG4Fo9ANdmuZcPF03A9p7QBoK03cYWmRe4GAmq7LtfNQDFwCYEY2TDZskv0SyYrZR8AJldcj57+1SVrV2YE0PbcixN0X8IqyO3Y1OIljYm3hckGBNf6hSb6IymGT7PfNMx+QzP6d7/yaj9BNGP2rBrd1Gs0XavhplaTijB88houzBqusWqT8anYTOVorIo7BtulHw2jmVJm0JasLkYIVnfU6jeUTMhhAtIFACtacu3nDusZNnKvw9Gfg8Nv50xsT5l8OzeN7Z2Lql7zQtGWLYNHCk0/JqKJYwTjx8CIKDDQyUkzveAfWB7CvLK9LvYLmeSXKgBQe4mqTBBKKrn8LjCrV1mwLixH3WCkzA2yDjFZQ7URbRmWY+OPNaIQ1ajNOONBOQrTTF2wtj5+z7jbvn6VxtGsHtPRDj/V5mfsfVS3n4C9bMBfV0dd/HlYCewnUBdv7R05HrG8EX/L0Cw5DdIfFCgN3BE2wUzR1l6vP+oO+cKoShEAaJyfhk0gevn29gu0zzm73zTFnWvb12wM3Tl2OG+xue3bSzSNX8QFOxs1hJrCTDVUqQdE0myUYZ6A7wEgPcNvMwQpv+qiYCnBxXpmmne+Z+x58MmGWUOhMvMsyizufrXyYH3amUzTEAw4HcmGk9fL60J17i3MGDzF7+acrwFgdG5/vBtCzCmz4n9GCHYnM0fu7ji5end56T5R29ZtAzOYFr+Ac3YRmgonTnwa7l8IArtSYqTBz7UDvgWA9Kq+jWW0sMdEz/0DjIsfttfG+sJt2sVp19aXqGWCX4cRBVrmLe0cleK0y5yLFhBhFeESv1YR+hIA0uv515XDkl686ZOo4v6eJ1I3tS+Ov5jZDNTd8Qi0PTlyrIhFvoVuz/NRM4iOfxbG7wgCG7GfQJMf+wn4EQB4W6/xR0T5z4SxMMfplMD3242k8cNHFlbuHHdffbWJwMqtQ3P1qH4dkl+Cv1CPDiEIPICJQmdDT7QMvLs8DwAtPca16An+kXcqesxJsEFU9W8bMoxbNjRU/d1j7qFkt6x78IhKXb8GL43LUJuqCqWSUApB4FoEgZu91M/TAEAbeNI+aqGt1gn2h6FE4irl+O6YsBUIYrGfIgh81h0O/lKl5qKZEku83GjUswBAW3dHY1OeQuGFcPdescMU7PLOOv0Rf02oPLi39BorNc7+HaMG80KnMXYbTib2nuTVluNe9bTyCPbtD53zj54k+z3zzV0nKOf3zhUJa8IcC56+h3pzuOZO4AVp+YpHcHpSA0DEvhqryW7xSCdP2GCqbnsylbxCdfB5AndWJtRRGI1Ef4Gpxm1ZEwXwAYLbNQh0t7otuusBAKerLuJCo3a/7rYyntAX7E201b7SUR/9kyf8FBNbCLT2JD8NG/sP1DKn28ogeSLYmCG4uaSzNrbFTVFdDQDWKb1V1U+ByWw3lfCKNt76XZi9d0G5z97zCu9C+aRnFd6N2kBjoXllTI/xwFf44MBJbp5K7GofgHVEdzic3xSmuKHj4TWnK+eX0VVGZaKyoTKissIdU15J7UlGL07yIXupi0sFHu5crT2Jq7im/cQd6t5RRVVsNxbsXNhZq2NprrqCgkBLn7EMC43uQrNgRlBkzianycyr0BT4Wbbnpdx3JQA09SY+GWHaluC3+8Vjw8bIhY8tqn6zFJBVXn8QWL5lYHqFHr8Lw4XL/ZHAGa5Wf4AwF3bWx55yhuJHVBxvAizt6opGGP9VkJ0fbS9MyhLXtz+0ZqVy/o+MJWjfqOyoDKksrTINmgJpecmX0K/xa/Itp1VwvAYQ9Km+FG1NkbpIpm2bnC70cqRnbTfHI3cG+cWEzWK+2Vmv/9jJ8nM0ADR1D38iGos+i6GYSieF9JDWADqQVnXU6+s95KlYeYRAa4+xgmv8AbAL5s5TmPSUTCTnr2uo+JtTkDnaBIjEIrcF1flRRXzL2qZJOb9TtiUdHQrsVMZU1tIJZ0cgvFgtH7OT1mYaxwJAS0/iC0Edf4VB7GLJ5Kky7NFms9xUsiIRsMoYZW2VeZE0/MxGPta6LXGpUzI40gRo2fLOAVw/cAeITXNKMK/oYHLPcymWaPJzWyavdFV8PkLA2o6OxdbBoeg8g0BdCF57hPHBvM5Fh35YquDO1ACiB3w3kM7PRPdg/8AS5fylmlHw8lOZU9ljuKc7aNJbvgafc0LukmsAtKtvTI/SvvWB2rGF3vxkAI83Hvy+E0AqGsFEYGnXewdV1VRjrUrgagKJhJE8vtRdhUuuAeh6hFYsBcv5aTdWVPuV8wfTaZ2UmmyAbCGAfQKxtO+VBEdJNYD0sEqgNsFAQb812uFX8VJJyKnMoUKgdevw0Swa3QSHCNT5FBi2XlnKsHUpNQBs6sscnZTggUUNYNOl1o6Fyvk9wDpQLCybgG1A6IFACT7qg0W/yIsOAFh/vQrtpgVBAcuaT02TfBbGeoMis5LTWwTINmgiGNmKt5yL50Y+SL5YLIXiAgDOeePcWnJZLF9P86Haj3JNXVRKVclTgRUz3xAgGyFbIZvxTYgCGVu+CJ8sMJuVvKiqQ2vPyPkcx3gXw9CPPLR3HLZXutEP3opnMBHA2RXfwzbkNwRFeoFjxzvq478vVN7Co8Z992Gxn7a6UEb+pRePdT68Zo1//BXnICLQ/vCaH6AS8FhgZCefJN8s8Cq4BoApvxdpmnZHgXx8SY623O6R5PACtaQ3M/y0XyM9cXvfuczc5b9L+wnEoxVPYwVhIDYVMU3zYuwZcGchyBZcA0Dj/xuFMPAxrUk7+Sjnz14CGtO+Sn/ZU5T3E7IdsiGgEIjtxdAheE2hJVZQAGjuM5rQLjq+UCZ+pEev341qG6/syK/YtHcmakhn0R99z56yvJ+QDZEtBQEFms1o+WgBwhYUANDAKDjCFCCLY0lp996O9jXfd4xgCAnF4rF/Gd1phun0PYQqOqYS2ZK1I7RjFN0jVKiP2u4DaNqaODEa1Z52T3SHKNO+/ebwArV7b3Y86Xj2KTWzXsVErqlWKsHe3tv/6iw/jqfOLqVcT2jLca5VPA3MpD93IJk0F6xbGHvGDoK2awCRqHa1HYJ+p0GV9ivK+XOXwpTqIy7c5/yUFIHAupc7W1k/JZsi2woCCIX4qq0AQL2hmBZxnuzKo5r2sDqxJ38pCY1fOTlVpnuT05T7b7It2Fi79DjAVy2ftSGorQAQi8Qvln4zRdovLZXcz7BtYFBWSTDBpRGLOOZPVpru0bPJ99XviQjQeZCyH0hKvko+O1HyzL9sBQBNY1/KnF2eu9jY4V/VQZ35ywPzW7MO++V6lp9yeaQgGzOZuEl2be36bN4A0NxjLJX/HHaxQ+zZdbPsheK3fHSSLoaKzsgmBz2jNNmeq/tpBPbswipYsUNuPPi8Ud/NLWXeAICJP1/OTcL/p6Zgl3e2zhvxXxK5JYhGo1dAwlxlrqXTyK2Iz9KRrZHN+SxGXvZ2fDfnMGBT9weHROJTXkeieF5ufiUQ7A/tddFz/GIfFL5Lu/ZUV9Uc8hrahwfmkhk93R8M9r975OON04K1Lj6XUi49a+tN3ocRlM+6RL5ksijL4VRi7xHrGg58NxuxXG8DFolVniO58w8OJRJXZVNO3f8Igcrqgy7J5/yUmtJQ2o9yqm/ZELBsT7DBbM/9vo+yrCAfziVHzgAAc8iZORdhT54JcduGhqq/e8Ir2EzQvOdU/bd1pdPmrB3aIhTyRJbtwQblVjO3D2cNANbMJ85Pk1i5xJBh3CKxfNKI1tyTbIFTH21XIEpLeeymL+d0aRtMyIoByvI08uVs8mUNAKj/n4VM2Z9no+jRfQxZ/Ua9/e2BrXGRdegvG4Vi8mSjFeb7ZINkixLrqKV9OaOIWR2cC35uxhwS3ETnRjKZNH4kgSjSi7Cyd+R/oGG/omBBkcfKW3DG8stAtkg2KavmuXw5YwCwlopyfqqsCqHn9fdq0o+90omyyFfRmC+4PU95KK89LuWdyrJF2KSsKAj4crYl3xkDgB7XzyjGaDwCwOSJlPQzsTzCIicbOvUGrv/5nIlyPURei0auNOqZhUDaJqXcOIR8mXw6U1FlDACoMsrbASTEA+2L4y9mUkbdm4hA1QHVX0bhT5l41/4vyks07Oco35SWTcI2pUUgi0/vFwBqe3t19Bwul1WRZADmYUuBnbVBJHdgow/QKGKzSSkw8FoILn7oNUu7/Minybcnp98vAMxgJ1Lbv3pyQjl+i2fW1cX+KocsckvROnfVmXiDzy5VSqJBtEqlUw7522tjfVgjYGsjDh/wqE779gTW+wUA9GZKW/2HbHdOkF79yIoADotwrAPPSVpZBQ7JA5ltNJNv7xcAMH1QzgAgWIqZI4E5jMRPe27dlliAfpxPOSYDaFk0HSMYYkJko2SrEl6ZfHtCAGjZ2H8YDEfKXX+xPfN6tdWXPavimvY1eyntp3KDpn3uwUlpbR0GW5VSYvi25ePjhJsQAFhV5Snjnsn11TRV9d9Giazc3D9NcOe3byOaRNuGCCqJzLY6yccnBgAm5AwAgvW/Z+x5UFlWfgT0eMX/Qsed48u3iSbRzi+BSmHZKmxWTiQm+viEAKBxJmUAwNvn/icbZg3JCag8UtEwj2DcNScl2pmGkuRBQA5JyFbJZuWQZqIUk318XwCgveIxYah2YnI5fpmmUNV/G0UxwzzhXHT0HG4jaVFJiDbxKCpzmWWS12Z57aivjxbIvgBQUXNkHW7FJCyn99e2r9kooVzSiSQi2pVuC+UFD7d18IJ+2mbf94JXgTxiaV+3su0LAGjjLSyQkCfJsQ/7E2z1ainnWHsCgE0mbduMBmztXW8zedHJiAfxKppAuWSEzVq2K6G+4319XADYf694OWQXG+SQQ24pcLCHYxN/8mnqJa98ssj9XE7bHX8uxL4AgCmM82UEMynkBFEmrFq2DB4JeVZ5KNOqNE8PWQaPlby2+5GvWwFgaVdXFBOAjpUNYuy08tYj9fEXZJNLNnl4VKeTfqNeyUW8iKdX/ILKh2yXbFg6+eHrls9DMCsAVFY2HO3G2HHJigvWBRrAUF3ZEFjc/WolqnSeL9klnsQ7m1zqvoUADqyybFgqOMjXyedJKCsAiAiTsvrPhKna/3lM56D49M9h049D8yRz/jF4WrydpxwuipLa8JjPWwEA87ylnP9vpFQAyOcNmtj/pN98eZx67idvp3Rwm46sNjzm81YA0Bj/uNtAFEH/9fWLKnYUka9ssjRvM5b7ungLi0ssGcoG8cIVTdvw64XndDcHNgo9ijiMNgGEmOMuuyKoC/FcEbnKKosWyX7Sr1dAyCCDV7oWzUdKWxZzSR8rAGAK8Bx8l+pCz992qQSSTJiW3uGPoyOuzW+xSAaSxW85ZOYvpy3zOYSZZvUic5b15BBK5MfFmVABIAfwnEXynfSbI7ejj7C+xJLFUaJhIiajLWModwb5vlYTmzZbRrBTJlcBIEvBnLLprRrU2i7N8tiH2/zSUZl8YB0AlrLaMvm+FhERqy0gG47cNFQAyFIoB1YceCki+AFZHnt+m2QhmTxnHBCGstoy+T76AMzDZcMRbaa9nYuqXpNNLknkwQ7P/HJJZNknRlomvu+G+rIPAbJlsul9N6T5Yh6ucY17P4kkDwBcqPZ/Noha+5Lo+OPzsj337z6fNyqbfxJIzVmIl2STj3yfRgGmyiYYdp5R1f8shYIOJc9W/WURIettmWXLKrRnD/j/84yVfUZTNSbkqwEwCaOlfUzdS9myZeR/4u1/unscSqXMTx+VsVQ64cuPRQHyTWqD76MGIKSrAeAginfCZwKla6Tp8p/WGwQZSy+JwingTft24bncziGmYgzXh4UkefTChor9eZKU3eOm7g8Owcqyz0mvOGS0ZJVeUG8FlNGmyfexnoMd4i0UNriZmgoAk2CKxqq+jFV/VZNuy/cTMlqyyieZvxLJadMHUx+A43vIl4o0TgFSAWA8iDidFx2jgdmAw5JVnSg8vgThZvLZNMqpgkYB5AsAKdUEGG89bUetWoXJNrPG35P5O8lKMssso9eyCTltOo6VwPJtBa5FzAGvC0hmfuhBlnboLxtuQZQ5my5O3JfSpuH71Ako3VkApmGqJkDa6tr6ErWYZSfliU25HINkJtlzpSmnZzLaNPk++gDkawIYmqECQNo7BNMC9/Yfc+wgyz6mg1OfUto0fJ/6AKSrAex+5VUVAFAwy7cMTEeUDuxRXCQ76eCUEwWZjqQ2jRqAuqRFIB6J/xOEky5AFwBYLK1DAVlUUi8RoACQ8JKhHV4zZs/Cevfyvo6774UY2tGunfTrFbqkA+niFT9Z+Uhq0wkaBRiRDTTd1Ms+AHxs7rzzUDbBrz5DB0sX2YzMY3mktGn4voZ1ytLVADRdK/sAoGn+bffttG+ESZdisZHRpsn3aRRAuhoAN8s7ADT3Gqdi1V+IhtB47ahOxbpP8PNJadPwfSn7AFIRVtY1gAjzf7tvp10ujDoVgpGkNp3ARCAxXIgiXqTlJi/bALBy2yCm/PLPeIGztzz4Z0Z185arLNxktGnyfaoBvCcLSGNycGGWbQCIRvTL0fmHF2bILuhk6RYyteyqI6lNv0edgO/YVcKrdFxj1V7xkolPbe/rVVg29iWZZHJUFuhm6ego0WAQk9Gm4ftvowbApdupxGRcul2KvDCz6WLq57GSTr79GRxSnnQjHR0iFygycto0fwfzAOTbfkvj/OhAla5TwoZo6C8rJOWgYwblpbRp+D71AUhXAxBCHJMBw1Dfau0xVuCcPWz6Ge6LdCRdw63l/tpJatNva8KUrwaAI6/LrwbAwzf0t78bpO+Uk65jIEho0+T7qAFob4zJKMsnVpFNadkyeKQs8rgtR1P38CcQ9Frd5iMNfehq6SyNQO4KQrZMNu0ul2Koa29oKZ7aWUxWt/MITS+bZoAWi14JA8G/8rhIV9K5PLTFxvuS2jL5vtaf2POKjAUR0cqjH6BlyzsHoBp2iYxl4KZMpDPp7iYPWWjLasvk+9qTDbOGhGC7ZQFrTA7sWFoeNQC95gt495ffxCfSmXQvg0tGWyafJ99HIKZL7LI+JPoP1cTwB4DVqzUutMslgt1TUSzdgYGnTH1gJqctj/p8GnwuXz8A5yf4UFaesmxu+84/YHLMxz1lKhEz0p0wkEgkd0SR0pZHfd4KADi04GV3NC+J6swVW4YlPAa7JJ0mZMbrP7Abfk5QpIQfYccgbcMzS4DIlaxjPj8aAEzzeVe4lEhUj2jLSiQhbfaVPSPHY7us0OpnF3jCgLCwmz5o6WS1YZH2eSsA8BR7VkpgeXgDQJTLf9KvVzYRaiwkteExn7cCwNBQ90tYGSTdzkDoHW+EEaIPJVzX8q0fHgqlLgyXVsVrQ1gQJsVTkDYnZj5bNiyVgOTr5PMklBUAHm9sTDIhXpRKSggDwzgM1cPjZJOrVHnikcrLoFxlqXRCkx9YWJiERqFRRVp70cyDDUunFnzd8nkIZgWAUQG5lM2AaMjayUu7uqIIbf8snVH4LhD/51FsfBfEQQF4o4PEHCT1ka/vCwA4zFHKAABnWeag5r6TqpzScBaGv8pmnYNdwAkTwsZu+mCkk9N2x/v6uADAtsoIKnqJT2MhmiyiRYJ71p/b9hEqbGiSF9muhBf6APb5+r4AMNz/Wi9kle6MAMh0UHPbt5dIiGPBIjVvS9SjRrO44Ixlk4EvHsUo+AqnbfYgCTVJpH3dEm1fAHi8cS52BxZ9EgrMcLDERTLKVahMEU29/fNhFhaM5LVZ0Tfq66MlsS8A0E9TsM35CsiP51ywsxd3vxroXvOm3r2Ho+p1jh/4BYknYURYBUnmybKSrZLNTr4vw+/JPj4hAKB6KmUAwJBZzcH6tDNlALBYGaIs9k/o6NKLzV8u+QgjwirI+lq2Sqsdpbwm+vjEADA4JGcAICA1LbDNgJaOHXHB+VektAcJhSKsCDMJRbMnksy2OsnHJwSAziU1b2FCkJTrArjgK1q3DcywVwJypeLTZ5+PCSHT5JJKXmkIK8JMXgmzS0Y2SraaPYWPT+Dblo+PE2FCAKD72Cigc9xzeb7SaTla/AJ5BCpAEsHLftVfAWiNJg0qZmSjkp7slMm39wsAaIPJGQBgFpAtcM2A1m3GEowHLyjYAco8A2FG2AUNBpltNJNv7xcAdrNnNgH0ATmB5ye29SWCdWx2pIy2+3baaAKG3aht8hOdhsEhegNp355Abr8A0FdXZ+AQg8cmpJLph+DXySROLllaNw/NRnvw07nSqGfZESDsCMPsKSR7IrFtkk+Tb09GbL8AYCUQQtpmANoBq9qeHDl2siIy/hbxaDhP+vUKbLSlLQy94lcCH8smYZslkHA3axafzhgAjBHjIUzIwD8pL03EIt+SUrJxQq1ct3sKJoPLfdIvjfhIOuozBiVhSFiO/Zb1M22TGf3Jb5nJl8mnM8mRUeD1p055nQtBfQFyXoKdv3Lr0Fw5hRuVKnLoIdRhKd1ccPQEv4u//5tKmSe31+kn0B99p3v0TEJMD0pjKaFooyJZtgiblFVA8mXy6UzyZQwAlBCbBt6bKYMM99CbGdWjusx9ATgOnktz8g0cmzZ86UCd7pxXXt5+eEdd9F/WnhzrGStL+k736BmlobRWnrEEPn+mscT0ADkvskWySTmly+3LWUFdvmVgeoVeQVEja5DwWeHE0EjiqA0NVX/3WY792Df3GU0Rxtfu98DrG6jeC87uZKmR33acXF3Q4S/WpKtI/POY034R+l1837QzxUTz2lp9ndcQ5uO3rHvwiMp47GWki+VL69Nzc9gYnvnYouo3M/HP6tyUAT2HT2TKJMm9WKWuXyOJLBPEAKj+TfwR7B1hsv8jkmY9Ve87avWbC3V+UobyUF6iQbSIJmoH70xQ1MMfvmKaQ8+0Dcrq/KjMiSeyOT+plTUAWDoLeZsBlnycX0YR2PouyX+tW4ePxpSlZi/Foeo6CrrdNNlnd728fWZHffTyjoUx2t/BkYtoEU2iTTyIl/dNBN48iq0jKjlCxLI92KAjxNwikseHc7ZbUsbQHyKxKT9D+6bCLflKostZVWUs9lPQkGeZrebhSb+jPfh3jCRHfpsrypeE8bjML5xzXOIFxu7HrfutJmI0/nl8v9iLJgLaqjhJzDpR+PJxIvn61bI92KCvQuRgjiA9TD6cIwltvJv7au1N3oUAIPUcfFOIps46/ZHcmrj/9PTedw+M8wNeA6dq17hRNZyz32P3htvba2NSbOAyOgNOuwRNhPMhm5vbew+MiA+PfLTukA9cw9cm4ZZeYyWGKKXrkxgvPgLA3ejczbn9fO4mAKjBuX45nqiM3zXO/l2G5aMxVvNF4OO486er+A+jHX42VcPba6NXyOL8ZA8kC8lEspGMaCI87FIToTqNsa9mSLZGNuerEDaY2/HdvDUA4tPWZ7yEGtg8Gzx9SwJlv4dawI2+CYBNINv+4Tt/wxtwrlMywJGewySOOxLJkd95UcV3Sm6iQ02EWDT+ORjYxVjYc4JjtAXb2f7wDz6BjWJNx2gWSAhv/+/i7f/9ArN5nFzsaK/V0R+V+7IVAFp6jGuxx9mPcpPy+algQ0bKOO6RhZU7/ZCkpTd5Jt4K/1Uyb1TxYdl3m6jir6uL/bVkehIQaOpNfFJj2iWobtJS2ZKbCNjW6jOdddEH/VCNJv3oEf0F6FHpB3+7PE1TfLOzXv9xvvR5mwBEIJUYvh1Vuv0WEuQj7ulzFEg0Ev2FpzzHMdNY8Sf9WlV8Jh5iKXYWVaNh3FeGxfkJItKFdCLdSEfsS/9QKU2EUrAeV2RFfbVsTHLnJ18ln7WjoK0aABFq7UveicTU6yv1hTbomRiy+pOXQjZvGZkf0SPPFMrTOqBBsDuSI8O/e+SUmj2F5g9y+pWb+6dF4xWfw5v0YhygN79QXVJG6sS1i+KeHmbjWC2vUGULTI9m4287aqM0FT3vZTsANG1NnBiNak/npeh3AsHeFObwgmImvxQreltf8tfI+wVb+QV7G45/N9r3t3fWx56ylSfkiVp6Eiehn+ASBAJqIky1qe5/ouOROl09uaytvrSKpyHfdE8YlsAkmTQXrFsYs/VCstUEIFlGCYpHS5DLm6xUQFr8bq9OE1ra++FUVLlyDpOOVnfFn1OMrdrNnp7ZUad/VTn/R+ZAWBAmhA1hhNnrf87XRCDMCfuPqLj4jU6mIpsKgPMDu0ftOj8hZrsGQImlmeNOwuS5hClu6KjXV+dJVvLjth7j20zjP8hMSDwDOe4QQyO/m7wZY+b06u4YAi0b+w/jlRhF0PjFMNMTx+5P+DTFd9rr9TUT7rnwo7XHWA05rneBtOMkC10zUVAAIGlbe41nHR3WcRyCfQQxa1Ws6KzVN+y74/CX2t5efQZfsAtkZ+4jPVrFvwsTKG7vODkmf5Npn+DyfmndlliAIHsJmggX4pU1/q3/+m7x9JxMO904pU1Ln7EMqxHXg57t2rJTvAulQ8PGqEkV1J9SsFJgckuhgvmUXsOWUnfReLRb/KeLE84G7ZmojtI2an+i4al0Ff9ryvmdQ52whGF/jbAljAlrwpywT5eBc8zGUSLbIRvCrYL9ZBwZ774KcXOhzApWrHPng3ehADAxSP4LU5hnVOjxu1zrD9Aip2G8/ioxOHQEDPRMGpt2820kP+LuSkjYEsaENWFO2DOUgStc0e4n2yEbcoW+w0TJJzt2Pnh3oWQLbgIQg9aekfO5FimYWaHCOZZeiOuxrPX7jtFThEKPQFuv8T0scrohKIoKM3VBR30ca0QKuwquARD5jvab7sVCYywMC8aFo6ZWN/eMnBcMaZWUfiNAtkI247cctvnDFy2ftJ3ho4RF1QAoe2tP8izse3X/R6Tk/ma1GYVow8gAdeioSyGQEQH0+K/Am78dVX89YwIJb9ICLEx++2MxohUdAMCMY0TgrxgRWFAMY5/yDGB3m0YnN8vwSQ/F1gUEWrcm6nhU6wJpx1d0uiCuRRJtf+og/SR+iGJ4FNUESDPChDZ2bTFMfcxTzaJah2w7y/iIh2KdRsCyCdgGfgbG+S3RR32wKOen/KUEAEbVaVrYYQkSkP9Q5TmMRaPrmnr3Hh4QkZWYLiNg2QJswrINl3k5SZ58r9QmbUkBgJQxjNTV+Eg4qZjbtFDQcyIstm5p13sHuc1L0ZcbAbIBsgWyCbkl3U+6RNr39ntQyI2SA8D6RRU7sBnHzwthKkNams1YdUB1uwoCMpSGPzJQ2ZMNBGRm6wSQyOfI9ybcLOJHyQHA4pn88EY0QgK3nBVTSxuqaqo3quZAEZYT8CxU5lT2ZANBU8XyNficE3I7EgA6Fx36IUuZMp/UkxUriv4RHu9WHYNZIQrdAyprKvMgvvmtwoCvWT7nQMmg6ePchWHBDQC10TmK3lFCVH2LJc1WNUToHeZ+cKKhPhoJguEf5gf/Unli2K8Lw37LSqUzlt+RGsAYsVQidRmGBofGfgfpkwyCxoCtiSBBElzJahsBKlsq46A6P/mW5WO2Nc6f0NEAsK6h4m/onFidn620KappFpiaNixt+RQtmFWmKFsQCNY4/ziNybfIx8bdKvmrowGApBka2PQTVFMCu9UVTQHVsNDJWgxCO8GoK9gI0HbtWNhDZRqk6b2TQSefIt+afL/U36gNOX+N7vGmbQ0y4KOoiMeGjZELg7Ynv/MlGkyK1vFltByc8eXB1CBthdZ+E+ZCN7aRc+UNR4IKbgZtmnAGG+HL49GKp2lXmAwP1S2JEaAyo7ILuvMTxORLbjg/0XYlABDhztrYz1Bt8XR7buLr9IVazAzaEor2hXNtYxGnhS5neqjyU1lRmVHZBR0K8iHyJbf0cKUJMCZs21/eP1hUVT8FJrPH7gX5E4XRxcyRC7zccjzIeHktO23dTbv3BnUoejJeGJp+hQ8OnNT+qYPem/zMqd+uBgASsrU3sRAVjb8Evz8gDTmdOyDYV7w+fMSpAg8rHexP8WnY2H9g01DX9oD0ErvRPQ/NT3XUxba6ydf1AEDCY4LQ1xGVb3VTEa9pozbQnkwlr/DrLEKv9ZWVH53VR8d1wb7aZJWxGLlgX1djwo/jvf6TZfEkABDT1j7jz5h3fcZkAQL9GxMzsCTzX8WeXTd3ts4bCbQuAROejujm0+Z8Azb1v/HWl/qgzkKhtZb51ur/WGi+YtK71gk4WZjUyOAlmMn035PvB/o3DA9vnhu16XOew5HRKwOtS4CEJ6wJc8I+bM5PPmL5ikfl4VkNgPRp3mos1iJ8I9pqUY/085aNYH8YSiSu2tBQ9XdvGZcHt2Xdg0dUxmI/hdN/Nowao92fNFNiydqF+pNe6edpACCl0BSgalvec8u9AsBxPoINYsfk24YM4xYVCJxB13J8Xb8G07Qvg/NXOUNVPiqo+l/bUasXfLhHKZp4HgAgLEcQuB9BAIdAhvpKYBjnN8mk8SPVUVhcOVMHnx7VaZn5JfiLFUclGLng/A/A+emkKZiNd5cfAYAt7dpZUXXAkdiGiS/xTlV/OFG1Dm+t3/NE6qb2xfEX/ZEiWFzbnhw5VsQi34IrnB/a5uK4IoHzbxz88LWmxxvnDo+77clXXwIAaXZ677sHxngN7chS0GGGnqDiDhOcVSoeYFz8sL021ucOi2BTbetL1GLe63Wo6lPt0LMOaj9Rg/M/mxD9Sx6tO+QDP+TwLQCQsrQtk7UzC2Nz/FDeP544NlywOzGr8O5yn1WYnr13Ad70F6F1mPkYcP8KylXOqOvvSomRhnV1U95wlVEO4r4GAJJrxZbheboe3QxBArlDSw5s8z8SLCW4WM9M8873jD0PPtkwK5CbqeRXdGKKxd2vVh6sTzuTadpFOH0XJ/GwyMQU4f8F53/LMJKnOLGxZylo+R4ASPggnshSCugZ8wrWLzi73zTFnWvb12zEwiMzY7qg3sQinea2by/RNA6nZ2fD6WuCqooDcktzQpUUAYAAbesxTmeatWNLqHt7bRrP+5gK+gQ6hDckhdjwSH38BeTztHfYppy5kvGVPSPHRTlfhqr9MkzaOQ2J1TkMdIaGKdra6/VHc4Hn1TNpAgApTNs2WTu3wGK8AiAIfKi6CPfvYsLcYKTMDX5XG7NhZjXnItoyxumPNaIQy69Zlw0c3Ec5ChPHeK+tj9+TI5mnj6RztLbexBUwoMAdNOJpqTH2OkYUnoNBbedMbE+ZfDs3je2di6pe80KOli2DRwpNPyaiiWME48fAiI5Bz/0J4D3TC/6B5SHMK9vrYr+QSX7pAgCBg4lC12N4cLVMQAVBFgSEvVyI7XBK/IkdGhNvo1+hn5ka+hdEv0ixfi1iDpiG2W9oRv/uV17tJ71mzJ5Vo5t6jaZrNWZKq+YRVoPOuRqmmfhkNSbjU1Ee8xBsjhHccvgpQcBDKhmFuL69Tv++VDJBGCkDAIFENQHBtX+DgNLKKFthKnnkQ4Cq/VyYX5XtzT+GlNTORX0CES1yB4RVHYNjJaY+g4RAImWmLpapzT8ZPKkDAAmbHh34L3wN7H7uk0FXv8sCgQH09n9Glt7+bIhLHwBI8KAf55QNfHU/nAig2h+YY+YCEQDITNIzBh+BwHPCaTZKqzAgAOffhRl+K2Udqp2McWAWXBCgNG+aFk9MVkL9VgjIgADZJtloUJyfMAtMACBhadEErZwC0Bvpt7oUArIgQDZJtunnwp5isAhUACAFadkkrZ0G4A8Uo7DKoxBwGgGyRbJJv5b0lqJPYPoAMijJW3qwvRjna8ph04gM+qtbPiNAm71gzca3O+utbbzQ/A/eFeQAYKFNG41GIvweTBf6WPDgVxIHFgHavTclzvNyA083sApcE2AyCFQAycTek1ANe2jyM/VbIeAGAmRrZHNBd37CJvA1gHEFzLFf/NcxZ/0mNAn0cffVV4WAIwigym/A+b/VOXpiTyCr/JOBCFMAsHSzziLk2r1QbPZkZdVvhUCxCMDbX8Fi3nPdPquvWPmKzRf4JsBkxamA6ERVdM4E/mjyybqp3/4gQLZENhU25yc0Q1cDGG8irT2Jq7C3wI9Uk2A8Kuq7XQSoyo+3/jc76nEaUUivUAcAKrOWnsRJGCr8Nf5OCmkZKrVcQABv/afw98XO+thTLpCXhmTomgCTkaUCHOzfdDI22/wm9mQqi113J2OgfheAAGyEbIVsJuzOT6iEvgYwvuibuoc/EYlFbkNtoHH8ffVdIUAI4I3flUqkLlvXUPG3ckGkrALAWKGiWfAFrmk3QflpY/fUZ/kigB7+PSxlXtdxcuw35YZC6JsAmQoUVbv/FMYH80whbsHzRKY06l5ZIJAgGyBbKEfnpxIuyxrAeNMe3WcgcismEJ0x/r76Hm4EaDafYaSuDtLSXTdKpOwDwBiorT0GHVH1Y/QPLBi7pz7DhwDa+U+jM/jajnp9ffi0K1wjFQAmYsZbe5KrOBc3YJ/74yY+Ur8CjYAQLwjBr++oj9IycjT71UUIlGUfQI6iFzCQP7Y/vGa+wAkueFu8lCOtehQABKgMqSypTKlsIbJy/nHlpmoA48DY7+t990Va5p55ocb5N1AjOH6/5+qGvAgI8Tw6+G7u3PngXeycc1LyCuqvZCoA2MS/uc9owhnW16Df9HSbWVQyXxAQj8Lbb1lbq6/zhX3AmKoAUGCBNW1NnBiJalejInmeWmNQIHguJbfm7HN2Typp3rpuYewZl9iEkqwKAEUW6/ItA9NjkfjFmsa+hFrBvCLJqGwlISB2mCb7VSI1csdji6rfLIlUmWZWAcCBgm/uMZain+DLGEY8C4DGHSCpSGRBAD14I6h9/RHt+1+urdcfz5JM3baJgAoANoGyk6yp+4NDIrHKc1AjOAfzCU5DHjXKYge4/Gng7+IJdODfl0oM3beu4cB382dRKewgoAKAHZSKSNO6bWAGi8TOwjHb5+JI7VMBtMK6ABzxpsepumIT/ruXpRJ/7Di5encB2VVSmwgoo7QJVCnJVmzaO1OP62dgKLEFNYPloKUOOs0M6ADe9I9hWV6nMWI8tP7UKa9nTqbuOoWACgBOIWmTznH3vRCbc9TRp6DnGsGAtZT9/AKM1wOLTmDRuZs9s6mvrs6wCaVK5gACKgA4AGIpJFo29h/GqipPQY33FI0zfPJa0IuVQlPivFh5KfpMwTZDz81scGhz55KatySWN/SiqQAgWREv7dpZUVFzZB0KZiFWKM6Hw8xHLeFY/A7U6MJob714EY7+LFbe4Y9tHe5/rffxxrnDkkFe1uKoABCA4l/a1RWtrGw4WkTYfGxkcjw6Fo9CYJgL55qDqvMMP1VA9R2dc2IXZNmJDruXhWk+z1Ps2aGh7pceb2xM+imb4p0fARUA8mMkdYrF3a9W1sSmzY6ICAKCeTjX+KEQeCr60PEppqKA6ffBgvEKfMYxFhHDvRjG0qlGMdbUSOD+CN7SCdynDVJGOBP0pn4P996Bc7/NuMAne1uY9Km9keKpnf2JPa882TBL7bMIYIJ6/X8QmpCW0hsGOwAAAABJRU5ErkJggg==")
  20121. };
  20122. n.prototype.setScene = function(e) {
  20123. this.createCpm(e),
  20124. this.createBunnyObj(e)
  20125. }
  20126. ,
  20127. n.prototype.updateModel = function() {
  20128. this.model = this.modelManager.getActiveModel()
  20129. }
  20130. ,
  20131. n.prototype.bindEvents = function() {
  20132. this.modelManager.on(E.ActiveModelChanged, this.updateModel.bind(this))
  20133. }
  20134. ,
  20135. n.prototype.updateDefaultsFromModelData = function() {
  20136. this.model.data
  20137. }
  20138. ,
  20139. n.prototype.pointPathDistance = function(e) {
  20140. for (var t = 0, i = 1; i < e.length; i += 1)
  20141. t += e[i - 1].distanceTo(e[i]);
  20142. return t
  20143. }
  20144. ,
  20145. n.prototype.pointPathLengths = function(e) {
  20146. for (var t = [0], i = 1; i < e.length; i += 1)
  20147. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  20148. return t
  20149. }
  20150. ,
  20151. n.prototype.interpAlongPath = function(e, t, i) {
  20152. var n, o = new r.Vector3, a = t[t.length - 1];
  20153. if (i < 1) {
  20154. n = i * a;
  20155. for (var s = 1; s < t.length; s += 1)
  20156. if (t[s] > n) {
  20157. var l = (n - t[s - 1]) / (t[s] - t[s - 1]);
  20158. return o.copy(e[s]),
  20159. o.sub(e[s - 1]),
  20160. o.multiplyScalar(l),
  20161. o.add(e[s - 1]),
  20162. o
  20163. }
  20164. } else
  20165. o.copy(e[e.length - 1]);
  20166. return o
  20167. }
  20168. ,
  20169. n.prototype.pathHeight = function() {
  20170. return this.player.mode !== a.FLOORPLAN ? c.path.height : c.path.outsideHeight
  20171. }
  20172. ,
  20173. n.prototype.createBunnyObj = function(e) {
  20174. this.bunnyObj || (this.bunnyObj = new r.AxisHelper(.1),
  20175. this.bunnyObj.visible = c.warp.showBunny),
  20176. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  20177. e.add(this.bunnyObj)
  20178. }
  20179. ,
  20180. n.prototype.createCpm = function(e) {
  20181. if (!this.currentPanoMarker) {
  20182. var t = this.makeWaypointObj(w.pathEnd, "Current");
  20183. t.material.uniforms.opacity.value = 0,
  20184. this.currentPanoMarker = {
  20185. mesh: t,
  20186. placed: !1
  20187. }
  20188. }
  20189. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  20190. this.placeCpm(),
  20191. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  20192. }
  20193. ,
  20194. n.prototype.placeCpm = function() {
  20195. if (c.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  20196. var e = this.player.currentPano.floor;
  20197. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  20198. e.add(this.currentPanoMarker.mesh)),
  20199. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  20200. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  20201. this.currentPanoMarker.placed = !0
  20202. } else
  20203. this.popOutCpm()
  20204. }
  20205. ,
  20206. n.prototype.fadeInCpm = function(e) {
  20207. this.player.mode === a.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || c.path.mapGuides && this.currentPanoMarker.placed && p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 1), e)
  20208. }
  20209. ,
  20210. n.prototype.fadeOutCpm = function(e) {
  20211. p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  20212. }
  20213. ,
  20214. n.prototype.popInCpm = function() {
  20215. c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  20216. }
  20217. ,
  20218. n.prototype.popOutCpm = function() {
  20219. this.fadeOutCpm(2)
  20220. }
  20221. ,
  20222. n.prototype.brushPrefs = {
  20223. linewidth: 7,
  20224. strokeWidth: 15,
  20225. cvSegments: 48,
  20226. paveStep: .1,
  20227. paveWidth: .2,
  20228. lookBlendDist: 3,
  20229. maxTurn: r.Math.degToRad(2)
  20230. },
  20231. n.prototype.panoPathDistance = function(e) {
  20232. var t = this.model.panos;
  20233. if (!e || e.length < 2)
  20234. return 0;
  20235. for (var i = [], n = 0; n < e.length; n += 1)
  20236. i.push(t.get(e[n]).floorPosition);
  20237. return this.pointPathDistance(i)
  20238. }
  20239. ,
  20240. n.prototype.loadTileTexture = function(e) {
  20241. var t = v.load(e, function(t) {
  20242. t.wrapS = r.RepeatWrapping,
  20243. t.wrapT = r.RepeatWrapping,
  20244. t.needsUpdate = !0,
  20245. y.debug('path texture "' + e + '" is ready')
  20246. }, function() {
  20247. y.error('path texture "' + e + '" failed')
  20248. });
  20249. return t.mapping = r.UVMapping,
  20250. t
  20251. }
  20252. ,
  20253. n.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  20254. var a = {
  20255. cameraMode: n,
  20256. position: e,
  20257. quaternion: t,
  20258. panoId: i,
  20259. orthoZoom: o,
  20260. floorVisibility: r,
  20261. thumbUrl: null,
  20262. name: null
  20263. };
  20264. return new f(a)
  20265. }
  20266. ,
  20267. n.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  20268. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  20269. }
  20270. ,
  20271. n.prototype.setWarpDestination = function(e) {
  20272. this.warpDestHeroLoc = e
  20273. }
  20274. ,
  20275. n.prototype.setWarpDestinationByHeroIndex = function(e) {
  20276. var t = this.getHeroDescriptorByHeroIndex(e);
  20277. return null !== t && (this.setWarpDestination(t),
  20278. !0)
  20279. }
  20280. ,
  20281. n.prototype.setWarpDestinationByPano = function(e, t) {
  20282. var i = this.model.panos.get(e.id);
  20283. return !!i && this.setWarpDestinationByPanoId(e.id, t)
  20284. }
  20285. ,
  20286. n.prototype.setWarpDestinationByPanoId = function(e, t) {
  20287. var i = this.model.panos.get(e);
  20288. if (i) {
  20289. t = t || new r.Quaternion;
  20290. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  20291. return this.setWarpDestination(n),
  20292. !0
  20293. }
  20294. return !1
  20295. }
  20296. ,
  20297. n.prototype.getHeroDescriptorByHeroIndex = function(e) {
  20298. var t = this.model.heroCount();
  20299. /* if (null !== this.warpDestHeroLoc && t < 2)
  20300. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  20301. this.model.getHeroDescriptorByIndex(0); */
  20302. var i = this.model.getHeroDescriptorByIndex(e);
  20303. if (i) {
  20304. var n = i.isPano() ? i.panoId : i.cameraMode;
  20305. y.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  20306. }
  20307. return i
  20308. }
  20309. ,
  20310. n.prototype.getHeroDescriptorByPano = function(e) {
  20311. var t = this.model.panos.get(e.id);
  20312. return t ? this.getHeroDescriptorByPanoId(e.id) : null
  20313. }
  20314. ,
  20315. n.prototype.getHeroDescriptorByPanoId = function(e) {
  20316. var t = this.getHeroIndexFromPanoId(e);
  20317. return this.getHeroDescriptorByHeroIndex(t)
  20318. }
  20319. ,
  20320. n.prototype.getHeroIndexFromPanoId = function(e) {
  20321. for (var t = 0; t < this.model.heroLocations.length; t++) {
  20322. var i = this.model.heroLocations[t]
  20323. , n = this.getHeroId(i);
  20324. if (n && n === e)
  20325. return t
  20326. }
  20327. return -1
  20328. }
  20329. ,
  20330. n.prototype.getHeroPano = function(e) {
  20331. if (null === e)
  20332. return y.warn("getHeroPano(): no destination"),
  20333. null;
  20334. var t = this.getHeroId(e)
  20335. , i = this.model.panos.get(t);
  20336. return void 0 === i && (i = null,
  20337. "" !== t && y.debug('unable to find pano "' + t + '"')),
  20338. i
  20339. }
  20340. ,
  20341. n.prototype.getHeroId = function(e) {
  20342. return e.panoId
  20343. }
  20344. ,
  20345. n.prototype.setWarpDestPano = function() {
  20346. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  20347. this.warpDestPano
  20348. }
  20349. ,
  20350. n.prototype.brushToWarpPano = function(e, t) {
  20351. if (this.discardPathObject(),
  20352. !this.setWarpDestPano())
  20353. return !1;
  20354. if (this.warpDestHeroLoc.cameraMode !== a.PANORAMA && y.warn("Can only brush from pano to pano"),
  20355. !this.warpDestPano)
  20356. return y.info("No brush"),
  20357. !1;
  20358. if (!this.player.currentPano)
  20359. return y.debug("No current pano, visibility undefined"),
  20360. !1;
  20361. if (!this.warpDestPano)
  20362. return y.info("No wPano, visibility undefined"),
  20363. !1;
  20364. if (!this.warpDestPano.isAligned())
  20365. return y.debug("Cannot brush to unaligned pano"),
  20366. !1;
  20367. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides
  20368. , n = !0;
  20369. if (this.player.currentPano.id === this.warpDestPano.id)
  20370. y.debug("Already at destination pano");
  20371. else {
  20372. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  20373. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  20374. this.obj3d = new r.Object3D,
  20375. y.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  20376. n ? (y.info('No "walkable" route, using fall-back warp style transition'),
  20377. e = t) : (this.setPathHulls(this.nodes),
  20378. this.setFloorCurves(),
  20379. i && ("chevron" === c.path.style ? this.obj3d.add(this.drawPathPavement(this.floorCurvePoints)) : "ribbon" === c.path.style && this.obj3d.add(this.drawPathRibbon(this.floorCurvePoints, this.floorCurveColors)))),
  20380. this.player.currentPano.floor.add(this.obj3d);
  20381. var o = this.player.mode === a.DOLLHOUSE || this.player.mode === a.FLOORPLAN
  20382. , s = e === l.STD;
  20383. if (!n && (i || s)) {
  20384. if (o) {
  20385. var h = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  20386. this.obj3d.add(h)
  20387. }
  20388. var u = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  20389. this.obj3d.add(u)
  20390. }
  20391. this.appearSlow()
  20392. }
  20393. return this.upcomingTransType = e,
  20394. !n
  20395. }
  20396. ,
  20397. n.prototype.findShortestPath = function(e, t) {
  20398. if (!e || !t)
  20399. return null;
  20400. var i = c.warp.walkExtraPanosDistance
  20401. , n = e.id + ":" + t.id + ":" + i;
  20402. if (this.shortPaths.hasOwnProperty(n))
  20403. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  20404. var r = t.id + ":" + e.id + ":" + i;
  20405. if (this.shortPaths.hasOwnProperty(r))
  20406. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  20407. var o = this.model.panos.aStarSearch(e, t);
  20408. return this.model.panos.includeNodesNearPath(o, i),
  20409. this.shortPaths[n] = o ? o.slice() : null,
  20410. o
  20411. }
  20412. ,
  20413. n.prototype.makePathHulls = function(e) {
  20414. var t, i, n, r, o, a = 0, s = [], l = [], h = [], u = this.model.panos;
  20415. t = u.get(e[0]),
  20416. r = t.floor.floorIndex;
  20417. for (var d = 0; d < e.length; d += 1)
  20418. t = u.get(e[d]),
  20419. i = t.floorPosition.clone().sub(this.model.position),
  20420. i.y += this.pathHeight(),
  20421. s.push(i),
  20422. l.push(t.position.clone()),
  20423. n = t.floor.floorIndex,
  20424. h.push(n > r ? c.path.colorUp : n < r ? c.path.colorDown : c.path.color),
  20425. d > 0 && (o = l[d].distanceTo(l[d - 1]),
  20426. o > a && (a = o));
  20427. return a > this.longestStep && (this.longestStep = a,
  20428. y.debug("path contains " + a + " meter segment")),
  20429. {
  20430. floor: s,
  20431. camera: l,
  20432. color: h
  20433. }
  20434. }
  20435. ,
  20436. n.prototype.makeFloorCurves = function(e, t, i) {
  20437. var n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  20438. , o = this.pointPathDistance(e) - 2 * n
  20439. , s = e.slice(0)
  20440. , l = s[1].clone().sub(s[0]);
  20441. l.y = 0,
  20442. l.normalize().multiplyScalar(n),
  20443. s[0] = (new r.Vector3).copy(s[0]).add(l),
  20444. l = s[s.length - 2].clone().sub(s[s.length - 1]),
  20445. l.y = 0,
  20446. l.normalize().multiplyScalar(n),
  20447. s[s.length - 1] = (new r.Vector3).copy(s[s.length - 1]).add(l);
  20448. var h = new r.CatmullRomCurve3(s)
  20449. , u = Math.floor(o / i);
  20450. u = 4 * Math.floor(u / 4),
  20451. u = Math.max(4, u);
  20452. for (var d, p, f, g = h.getSpacedPoints(u), m = [], v = new r.Vector3, A = 0; A < g.length; A += 1) {
  20453. f = 0,
  20454. d = g[A].distanceTo(e[0]);
  20455. for (var y = 1; y < e.length; y += 1)
  20456. v.copy(g[A]).sub(e[y]),
  20457. v.y *= 4,
  20458. p = v.length(),
  20459. p < d && (f = y);
  20460. m.push(t[f])
  20461. }
  20462. return {
  20463. distance: o,
  20464. points: g,
  20465. colors: m
  20466. }
  20467. }
  20468. ,
  20469. n.prototype.makeCameraCurvePoints = function(e, t) {
  20470. var i = this.pointPathDistance(e)
  20471. , n = new r.CatmullRomCurve3(e);
  20472. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)))
  20473. }
  20474. ,
  20475. n.prototype.makeCameraCurveTangents = function(e, t) {
  20476. var i = this.pointPathDistance(e)
  20477. , n = new r.CatmullRomCurve3(e)
  20478. , o = Math.max(2, Math.floor(i / t));
  20479. o || (o = 5);
  20480. for (var a = [], s = 0; s <= o; s++)
  20481. a.push(n.getTangentAt(s / o));
  20482. return a
  20483. }
  20484. ,
  20485. n.prototype.setPathHulls = function(e) {
  20486. var t = this.makePathHulls(e);
  20487. this.floorHull = t.floor,
  20488. this.cameraHull = t.camera,
  20489. this.colorHull = t.color
  20490. }
  20491. ,
  20492. n.prototype.setFloorCurves = function() {
  20493. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  20494. this.floorPathDistance = e.distance,
  20495. this.floorCurvePoints = e.points,
  20496. this.floorCurveColors = e.colors
  20497. }
  20498. ,
  20499. n.prototype.setCameraCurvePoints = function() {
  20500. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, c.warp.stepFactor * this.brushPrefs.paveStep)
  20501. }
  20502. ,
  20503. n.prototype.chooseWarpPath = function(e) {
  20504. var t, i, n, o = this.playerControls.cameras[a.PANORAMA];
  20505. if (this.player.currentPano === this.warpDestPano || !e)
  20506. return this.warpPathPoints = null,
  20507. this.warpLength = 0,
  20508. !1;
  20509. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  20510. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (y.debug("warp path to unreachable node"),
  20511. t = this.warpDestPano.position.clone().sub(o.position),
  20512. i = t.clone().negate(),
  20513. t.multiplyScalar(.15).add(o.position),
  20514. i.multiplyScalar(.15).add(this.warpDestPano.position),
  20515. t.y = o.position.y,
  20516. i.y = this.warpDestPano.position.y,
  20517. n = new r.CubicBezierCurve3(o.position.clone(),t,i,this.warpDestPano.position.clone()),
  20518. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (y.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  20519. this.setCameraCurvePoints(),
  20520. this.warpPathPoints = this.camCurvePoints.slice(0)),
  20521. this.warpLength = 0,
  20522. this.warpPathLengths = [0];
  20523. for (var s = new r.Vector3, l = new r.Vector3, h = Math.cos(r.Math.degToRad(c.warp.minBrakeAngle)), u = Math.cos(r.Math.degToRad(c.warp.maxBrakeAngle)), d = 1; d < this.warpPathPoints.length; d += 1) {
  20524. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d]);
  20525. var p = s.length();
  20526. s.y *= c.warp.climbEffort;
  20527. var f = s.length() / p;
  20528. if (d > 1) {
  20529. s.setY(0).normalize(),
  20530. l.copy(this.warpPathPoints[d - 2]).sub(this.warpPathPoints[d - 1]).setY(0).normalize();
  20531. var g = Math.min(1, s.dot(l))
  20532. , m = 1 + (c.warp.brakeStrength - 1) * (1 - r.Math.smoothstep(g, u, h));
  20533. f = Math.max(m, f)
  20534. }
  20535. this.warpLength += p * f,
  20536. this.warpPathLengths[d] = this.warpLength
  20537. }
  20538. return !0
  20539. }
  20540. ,
  20541. n.prototype.drawPathRibbon = function(e, t) {
  20542. this.bunnyObj.visible = c.warp.showBunny;
  20543. for (var i = .6 * c.path.ribbonWidth * .5, n = new r.Vector3, o = new r.Vector3(0,this.pathHeight(),0), l = new r.Geometry, h = new r.Vector3, u = 0; u < e.length; u += 1) {
  20544. h.copy(e[u]),
  20545. 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(),
  20546. h.normalize(),
  20547. n.crossVectors(h, A.UP),
  20548. n.multiplyScalar(i);
  20549. var d = (new r.Vector3).copy(e[u]).add(o);
  20550. d.sub(n),
  20551. l.vertices.push(d),
  20552. d = (new r.Vector3).copy(e[u]).add(o),
  20553. d.add(n),
  20554. l.vertices.push(d)
  20555. }
  20556. var p, f = 0;
  20557. for (u = 0; u < e.length - 1; u += 1) {
  20558. var g = 2 * u
  20559. , v = f;
  20560. f += e[u + 1].distanceTo(e[u]);
  20561. var y = f
  20562. , C = t[u]
  20563. , I = t[u + 1];
  20564. p = new r.Face3(g,g + 1,g + 2),
  20565. p.vertexColors = [new r.Color(C), new r.Color(C), new r.Color(I)],
  20566. l.faces.push(p),
  20567. l.faceVertexUvs[0].push([new r.Vector2(0,v), new r.Vector2(1,v), new r.Vector2(0,y)]),
  20568. p = new r.Face3(g + 2,g + 1,g + 3),
  20569. p.vertexColors = [new r.Color(I), new r.Color(C), new r.Color(I)],
  20570. l.faces.push(p),
  20571. l.faceVertexUvs[0].push([new r.Vector2(0,y), new r.Vector2(1,v), new r.Vector2(1,y)])
  20572. }
  20573. l.computeFaceNormals(),
  20574. l.computeVertexNormals();
  20575. var E, b;
  20576. this.player.mode === a.PANORAMA ? (b = r.UniformsUtils.clone(m.ribbon.uniforms),
  20577. b.map.value = w.path,
  20578. b.opacity.value = 0,
  20579. b.color.value.set(c.path.color),
  20580. E = new r.RawShaderMaterial({
  20581. side: r.DoubleSide,
  20582. depthWrite: !1,
  20583. transparent: !0,
  20584. vertexShader: m.ribbon.vertexShader,
  20585. fragmentShader: m.ribbon.fragmentShader,
  20586. uniforms: b,
  20587. name: "ribbonT",
  20588. opacity: 0
  20589. })) : E = new r.MeshBasicMaterial({
  20590. color: 16777215,
  20591. side: r.DoubleSide,
  20592. name: "ribbonOut",
  20593. vertexColors: r.VertexColors
  20594. });
  20595. var _ = new r.Mesh(l,E);
  20596. return _.name = "ribbon",
  20597. this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon),
  20598. _
  20599. }
  20600. ,
  20601. n.prototype.drawPathPavement = function(e) {
  20602. for (var t, i = .25, n = new r.Vector3, o = new r.Geometry, s = new r.Vector3, l = 0; l < e.length; l += 1)
  20603. s.copy(e[l]),
  20604. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  20605. s.normalize(),
  20606. n.crossVectors(s, A.UP),
  20607. n.multiplyScalar(this.brushPrefs.paveWidth),
  20608. t = (new r.Vector3).copy(e[l]),
  20609. t.sub(n),
  20610. o.vertices.push(t),
  20611. o.vertices.push((new r.Vector3).copy(e[l])),
  20612. t = (new r.Vector3).copy(e[l]),
  20613. t.add(n),
  20614. o.vertices.push(t);
  20615. var h, u, d;
  20616. for (l = 0; l < e.length - 1; l += 1)
  20617. h = 3 * l + 1,
  20618. u = l * i,
  20619. d = u + i,
  20620. o.faces.push(new r.Face3(h - 1,h,h + 3)),
  20621. o.faceVertexUvs[0].push([new r.Vector2(0,u), new r.Vector2(.5,u), new r.Vector2(.5,d)]),
  20622. o.faces.push(new r.Face3(h + 3,h + 2,h - 1)),
  20623. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(0,d), new r.Vector2(0,u)]),
  20624. o.faces.push(new r.Face3(h + 3,h,h + 1)),
  20625. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(.5,u), new r.Vector2(1,u)]),
  20626. o.faces.push(new r.Face3(h + 3,h + 1,h + 4)),
  20627. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(1,u), new r.Vector2(1,d)]);
  20628. var p = this.player.mode === a.PANORAMA ? new r.MeshBasicMaterial({
  20629. color: c.path.color,
  20630. side: r.DoubleSide,
  20631. transparent: !0,
  20632. depthWrite: !1,
  20633. opacity: 0,
  20634. name: "paveT",
  20635. map: w.path
  20636. }) : new r.MeshBasicMaterial({
  20637. color: c.path.color,
  20638. side: r.DoubleSide,
  20639. transparent: !0,
  20640. depthWrite: !1,
  20641. opacity: 1,
  20642. name: "paveO",
  20643. map: w.path
  20644. });
  20645. return new r.Mesh(o,p)
  20646. }
  20647. ,
  20648. n.prototype.hintPrefs = {
  20649. rad: .18,
  20650. width: .0125,
  20651. depth: .0625,
  20652. setBack: -.04,
  20653. markRad: .25,
  20654. markInnerRad: .16
  20655. },
  20656. n.prototype.makeWaypointObj = function(e, t) {
  20657. var i = new r.Geometry
  20658. , n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  20659. , o = this.pathHeight();
  20660. i.vertices.push(new r.Vector3(-n,o,n), new r.Vector3(-n,o,-n), new r.Vector3(n,o,-n), new r.Vector3(n,o,n)),
  20661. i.faces.push(new r.Face3(0,1,2), new r.Face3(2,3,0)),
  20662. i.faceVertexUvs[0].push([new r.Vector2(0,0), new r.Vector2(1,0), new r.Vector2(1,1)]),
  20663. i.faceVertexUvs[0].push([new r.Vector2(1,1), new r.Vector2(0,1), new r.Vector2(0,0)]);
  20664. var s = r.UniformsUtils.clone(m.waypoint.uniforms);
  20665. s.map.value = e,
  20666. s.opacity.value = 0,
  20667. s.color.value.set(c.path.color);
  20668. var l = {
  20669. side: r.DoubleSide,
  20670. depthWrite: !1,
  20671. transparent: !0,
  20672. vertexShader: m.waypoint.vertexShader,
  20673. fragmentShader: m.waypoint.fragmentShader,
  20674. uniforms: s,
  20675. name: "waypoint",
  20676. opacity: 0
  20677. };
  20678. this.player.mode !== a.PANORAMA && (l.depthTest = !1,
  20679. l.name = "wayPtOut");
  20680. var h = new r.RawShaderMaterial(l)
  20681. , u = new r.Mesh(i,h);
  20682. return u.name = t,
  20683. u
  20684. }
  20685. ,
  20686. n.prototype.makeStartMarker = function(e, t) {
  20687. var i = (new r.Vector3).copy(t[1]).sub(t[0]);
  20688. i.y = 0,
  20689. i.normalize();
  20690. var n = Math.acos(i.x)
  20691. , o = this.makeWaypointObj(w.pathStart, "Start");
  20692. return o.rotateOnAxis(new r.Vector3(0,1,0), n),
  20693. o.position.copy(e),
  20694. o
  20695. }
  20696. ,
  20697. n.prototype.makeEndMarker = function(e) {
  20698. var t = this.makeWaypointObj(w.pathEnd, "End")
  20699. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  20700. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  20701. return i < n ? t.material.uniforms.color.value.set(c.path.colorUp) : i > n && t.material.uniforms.color.value.set(c.path.colorDown),
  20702. t.position.copy(e),
  20703. t
  20704. }
  20705. ,
  20706. n.prototype.pathClean = function(e) {
  20707. if (e) {
  20708. for (var t in e.children)
  20709. this.pathClean(e.children[t]);
  20710. e.geometry && e.geometry.dispose(),
  20711. e.material && e.material.dispose()
  20712. }
  20713. }
  20714. ,
  20715. n.prototype.discardPathObject = function() {
  20716. if (this.obj3d) {
  20717. var e = this.obj3d.parent;
  20718. e && e.remove(this.obj3d),
  20719. this.pathClean(this.obj3d)
  20720. }
  20721. this.obj3d = null,
  20722. this.popInCpm()
  20723. }
  20724. ,
  20725. n.prototype.discardSlow = function() {
  20726. if (this.obj3d) {
  20727. if (this.player.mode !== a.PANORAMA)
  20728. return void this.discardPathObject();
  20729. for (var e, t = this, i = 0, n = function() {
  20730. this.discardPathObject()
  20731. }
  20732. .bind(this), r = 0; r < t.obj3d.children.length; r += 1)
  20733. e = t.obj3d.children[r],
  20734. void 0 !== e.material && e.material.transparent === !0 && (void 0 !== e.material.uniforms ? p.start(u.property(e.material.uniforms.opacity, "value", 0), c.path.fadeOutTime, n, 0, d[c.warp.blendEasing]) : p.start(u.property(e.material, "opacity", 0), c.path.fadeOutTime, n, 0, d[c.warp.blendEasing]),
  20735. i += 1,
  20736. n = null);
  20737. 0 === i && this.discardPathObject(),
  20738. this.player.mode !== a.PANORAMA && this.fadeInCpm(c.path.fadeInTime - 3)
  20739. }
  20740. }
  20741. ,
  20742. n.prototype.appearSlow = function() {
  20743. var e, t = this;
  20744. this.fadeOutCpm(c.path.fadeInTime);
  20745. for (var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1, n = 0; n < t.obj3d.children.length; n += 1)
  20746. e = t.obj3d.children[n],
  20747. void 0 !== e.material && e.material.transparent === !0 && (void 0 !== e.material.uniforms ? p.start(u.property(e.material.uniforms.opacity, "value", i), c.path.fadeInTime, null, 0, d[c.warp.blendEasing]) : p.start(u.property(e.material, "opacity", i), c.path.fadeInTime, null, 0, d[c.warp.blendEasing]))
  20748. }
  20749. ,
  20750. n.prototype.update = function() {
  20751. this.obj3d && this.obj3d.updateMatrixWorld()
  20752. }
  20753. ,
  20754. n.prototype.calcBurnsAmount = function(e) {//计算导览点旋转角
  20755. var t = r.Math.degToRad(c.warp.burnsAngle);
  20756. if (this.player.mode === a.PANORAMA) {
  20757. var i = this.burnsDir * t;
  20758. if (this.upcomingTransType === l.BLACK)
  20759. return i;
  20760. var n = e;
  20761. if (null === n)
  20762. return y.warn("Transition request for non-highlight"),
  20763. i;
  20764. var o = this.getHeroDescriptorByHeroIndex(n);
  20765. if (null === o)
  20766. return i;
  20767. if (!o.isPano())
  20768. return i;
  20769. var s = this.getHeroPano(o)
  20770. , h = this.playerControls.cameras[a.PANORAMA]
  20771. , u = A.FORWARD.clone().applyQuaternion(h.quaternion).setY(0).normalize()
  20772. , d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t)
  20773. , p = function(e) {
  20774. var i = Math.acos(Math.min(1, e.dot(u)))
  20775. , n = (new r.Vector3).crossVectors(u, e);
  20776. return Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y)
  20777. };
  20778. if (s === this.player.currentPano)
  20779. return i = p(A.FORWARD.clone().applyQuaternion(o.quaternion).setY(0).normalize());
  20780. var f = this.findShortestPath(this.player.currentPano, s);
  20781. if (void 0 === f || null === f || f.length < 1)
  20782. return y.debug("Empty path ahead..."),
  20783. i;
  20784. var g = this.makePathHulls(f)
  20785. , m = new r.CatmullRomCurve3(g.camera)
  20786. , v = Math.min(.1, c.warp.lookAheadDist / m.getLength());
  20787. return i = p(m.getPointAt(v).clone().sub(h.position).setY(0).normalize())
  20788. }
  20789. return this.player.mode === a.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir
  20790. }
  20791. ,
  20792. n.prototype.waitNextStep = function(e, t, time) {//xzw 改时间
  20793. var i = (time==void 0)? c.warp.tourStepDelay : time;
  20794. i || (i = this.lastTransType === l.BLACK ? b.tourStepDelaySlideShow : b.tourStepDelayDefault);
  20795. var n = new r.Euler
  20796. , o = new r.Vector3;
  20797. y.debug("Starting wait: " + (void 0 !== t));
  20798. var s = this.calcBurnsAmount(e)
  20799. , h = function() {
  20800. this.endWarpState(),
  20801. this.player.mode === a.DOLLHOUSE && (this.playerControls.cameras[a.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  20802. t && t()
  20803. }
  20804. .bind(this)
  20805. , u = function(e, t) {
  20806. if (this.warpInterrupted)
  20807. return h(),
  20808. !0;
  20809. var r = t || 1e3 / 60;
  20810. if (c.warp.doBurns)
  20811. if (this.player.mode === a.PANORAMA) {
  20812. var l = this.playerControls.cameras[a.PANORAMA];
  20813. n.setFromQuaternion(l.quaternion, c.warp.eOrder);
  20814. var u = r * s / i;
  20815. //u = /* Math.sign(u) * */ Math.max(u, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  20816. u = -1* Math.abs(u);
  20817. n.y += u,
  20818. o.set(0, 0, -1),
  20819. o.applyEuler(n),
  20820. o.add(l.position),
  20821. l.controls.lookAt(o),
  20822. l.controls.lookVector.copy(o)
  20823. ,l.lookAt(o)
  20824. } else
  20825. this.player.mode === a.DOLLHOUSE ? this.playerControls.controls[a.DOLLHOUSE].rotationAcceleration.x = s : this.playerControls.controls[a.FLOORPLAN].absoluteScale *= .9996
  20826. }
  20827. .bind(this);
  20828. this.startWarpState(),
  20829. p.start(u, i, h, 0, d.easeInOutQuad, "wait")
  20830. }
  20831. ,
  20832. n.prototype.warpToNonPano = function(e) {
  20833. if (this.discardPathObject(),
  20834. this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === a.FLOORPLAN) {
  20835. var t = function() {
  20836. e && e()
  20837. }
  20838. .bind(this);
  20839. this.player.flyToNewMode({
  20840. mode: this.warpDestHeroLoc.cameraMode,
  20841. duration: c.warp.outsideTime,
  20842. warpDest: this.warpDestHeroLoc,
  20843. callback: t,
  20844. force: !0
  20845. })
  20846. } else
  20847. y.warn("no warp destination!!!"),
  20848. e && e()
  20849. }
  20850. ,
  20851. n.prototype._resetWarpShaderParams = function(e) {//
  20852. this.player.mode === a.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  20853. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  20854. /* if(momentTourBlackNewType && "newBlack" in e.material.defines){
  20855. delete e.material.defines.newBlack;
  20856. e.material.needsUpdate = true
  20857. } */
  20858. }
  20859. ,
  20860. n.prototype._clearWarpShading = function() {
  20861. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  20862. this._resetWarpShaderParams(e[t]),
  20863. e[t].visible = !0;
  20864. this._resetWarpShaderParams(this.model.skybox)
  20865. }
  20866. ,
  20867. n.prototype._warpStopFlying = function() {
  20868. this.activeTransType = null,
  20869. this.placeCpm()
  20870. }
  20871. ,
  20872. n.prototype._wrapupTravelOnlyBits = function() {
  20873. this._warpStopFlying(),
  20874. this.warpPathPoints && (this.player.currentPano.exit(),
  20875. this.warpDestPano.enter(),
  20876. this.player.currentPano = this.warpDestPano),
  20877. this.player.spider.draw(),
  20878. this.placeCpm()
  20879. }
  20880. ,
  20881. n.prototype._wrapupTravel = function(e) {
  20882. this._wrapupTravelOnlyBits(),
  20883. this.warpCameraAim(e)
  20884. }
  20885. ,
  20886. n.prototype._wrapupWarpShading = function(e) {
  20887. this._clearWarpShading(),
  20888. this._wrapupTravel(e)
  20889. }
  20890. ,
  20891. n.prototype.wrapupWarpShadingOnly = function(e, t) {
  20892. t !== I.END && this._clearWarpShading(),
  20893. this._wrapupTravelOnlyBits(),
  20894. this.upcomingTransType = null,
  20895. e && e()
  20896. }
  20897. ,
  20898. n.prototype._warpCameraAim = function(e, t) {//到每个片段终点时转向终点朝向。
  20899. var i = this.warpDestHeroLoc.quaternion
  20900. , n = this.playerControls.cameras[a.PANORAMA]
  20901. , o = new r.Vector3(0,0,1).applyQuaternion(i).normalize()
  20902. , s = new r.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize()
  20903. , l = s.dot(o)
  20904. , u = r.Math.radToDeg(Math.acos(l))
  20905. , f = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(i, c.warp.eOrder)
  20906. , g = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  20907. , m = new r.Euler(f.x - g.x,f.y - g.y,f.z - g.z,c.warp.eOrder);
  20908. m.y = h.constrainedTurn(m.y),
  20909. this.burnsDir = Math.sign(m.y);
  20910. var v = new r.Euler(0,0,0,c.warp.eOrder)
  20911. , A = new r.Vector3
  20912. , C = function(e, t) {
  20913. return !!this.warpInterrupted || (v.x = g.x + e * m.x,
  20914. v.y = g.y + e * m.y,
  20915. v.z = g.z + e * m.z,
  20916. A.set(0, 0, -1),
  20917. A.applyEuler(v),
  20918. A.add(n.position),
  20919. n.controls.lookAt(A),
  20920. n.controls.lookVector.copy(A),
  20921. void n.lookAt(A))
  20922. }
  20923. .bind(this);
  20924. /* return u > c.warp.minRotation ? (p.start(C, e, t, 0, d[c.warp.movementEasing])
  20925. ,(this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  20926. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  20927. ):
  20928. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  20929. ,void (t && t())
  20930. ) */
  20931. (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  20932. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  20933. return u > c.warp.minRotation ? p.start(C, e, t, 0, d[c.warp.movementEasing]) :
  20934. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  20935. ,void (t && t())
  20936. )
  20937. }
  20938. ,
  20939. n.prototype._warpBendAim = function(e, t, i, n) {
  20940. var o = n || 0
  20941. , s = this.playerControls.cameras[a.PANORAMA]
  20942. , l = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20943. , u = (new r.Euler).setFromQuaternion(s.quaternion, c.warp.eOrder)
  20944. , f = new r.Euler(l.x - u.x,l.y - u.y,l.z - u.z,c.warp.eOrder);
  20945. f.y = h.constrainedTurn(f.y);
  20946. var g = Math.min(r.Math.degToRad(c.warp.softBendTilt), Math.abs(f.x));
  20947. f.x = g * Math.sign(f.x),
  20948. g = Math.min(r.Math.degToRad(Math.max(0, c.warp.softBendAngle)), g),
  20949. this.burnsDir = Math.sign(f.y),
  20950. g *= Math.sign(f.y),
  20951. f.y = g;
  20952. var m = new r.Euler(0,0,0,c.warp.eOrder)
  20953. , v = new r.Vector3
  20954. , A = function(e, t) {
  20955. if (e < .5)
  20956. m.x = u.x + e * f.x,
  20957. m.y = u.y + e * f.y,
  20958. m.z = u.z + e * f.z;
  20959. else {
  20960. var i = (1 - e) * c.warp.softBendEnd;
  20961. m.x = l.x - i * f.x,
  20962. m.y = l.y - i * f.y,
  20963. m.z = l.z - i * f.z
  20964. }
  20965. v.set(0, 0, -1),
  20966. v.applyEuler(m),
  20967. v.add(s.position);
  20968. s.controls.lookAt(v),
  20969. s.controls.lookVector.copy(v),
  20970. s.lookAt(v);
  20971. }
  20972. .bind(this);
  20973. if(momentTourBlackNewType){
  20974. A(1)
  20975. }else return p.start(A, t, i, o, d[c.warp.movementEasing])
  20976. }
  20977. ,
  20978. n.prototype._warpStepCameraAim = function(e, t, i) {
  20979. var n = this.playerControls.cameras[a.PANORAMA]
  20980. , o = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20981. , s = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  20982. , l = new r.Euler(o.x - s.x,o.y - s.y,o.z - s.z,c.warp.eOrder);
  20983. l.y = h.constrainedTurn(l.y),
  20984. this.burnsDir = Math.sign(l.y);
  20985. var u = new r.Euler(0,0,0,c.warp.eOrder)
  20986. , f = new r.Vector3
  20987. , g = function(e, t) {
  20988. e < .5 ? u.copy(s) : u.copy(o),
  20989. f.set(0, 0, -1),
  20990. f.applyEuler(u),
  20991. f.add(n.position),
  20992. n.controls.lookAt(f),
  20993. n.controls.lookVector.copy(f),
  20994. n.lookAt(f)
  20995. }
  20996. .bind(this);
  20997. return p.start(g, t, i, 0, d[c.warp.movementEasing])
  20998. }
  20999. ,
  21000. n.prototype.setBurnsDir = function() {
  21001. var e = this.playerControls.cameras[a.PANORAMA]
  21002. , t = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  21003. , i = (new r.Euler).setFromQuaternion(e.quaternion, c.warp.eOrder)
  21004. , n = new r.Euler(t.x - i.x,t.y - i.y,t.z - i.z,c.warp.eOrder);
  21005. n.y = h.constrainedTurn(n.y),
  21006. this.burnsDir = Math.sign(n.y)
  21007. }
  21008. ,
  21009. n.prototype.stepWarpPath = function(e, t) {
  21010. var i = this.playerControls.cameras[a.PANORAMA];
  21011. if (!this.warpPathPoints)
  21012. return i.position.copy(this.warpDestPano.position),
  21013. !0;
  21014. var n = this.warpPathPoints[0]
  21015. , o = this.warpDestPano.position;
  21016. if (null !== this.nodes && this.cameraHull.length > 1) {
  21017. var s = new r.Vector3;
  21018. e < .5 ? s.copy(this.cameraHull[1]).sub(n).normalize().multiplyScalar(c.warp.softPushDist * e).add(n) : s.copy(this.cameraHull[this.cameraHull.length - 2]).sub(o).normalize().multiplyScalar(c.warp.softPushDist * c.warp.softPushEnd * (1 - e)).add(o),
  21019. i.position.copy(s)
  21020. } else
  21021. e < .5 ? i.position.copy(n) : i.position.copy(o)
  21022. }
  21023. ,
  21024. n.prototype.interruptAndFastForward = function(e, t) {
  21025. this.warping && (this.warpInterrupted = !0,
  21026. this.warpInterruptionBlackoutStyle = e,
  21027. this.warpInterruptionTravelTime = t,
  21028. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  21029. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = c.minWarpTime))
  21030. }
  21031. ,
  21032. n.prototype.warpCameraAim = function(e) {
  21033. var t = c.warp.minWarpTime;
  21034. if (this.upcomingTransType === l.BLACK)
  21035. t = c.warp.teleportTime;
  21036. else {
  21037. var i = this.playerControls.cameras[a.PANORAMA]
  21038. , n = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  21039. , o = (new r.Euler).setFromQuaternion(i.quaternion, c.warp.eOrder)
  21040. , s = new r.Euler(n.x - o.x,n.y - o.y,n.z - o.z,c.warp.eOrder);
  21041. s.y = h.constrainedTurn(s.y);
  21042. var u = 1e3 * Math.abs(s.y) / r.Math.degToRad(c.warp.maxAimPerSec);
  21043. t = Math.max(t, u)
  21044. }
  21045. var d = function() {
  21046. this._warpStopFlying(),
  21047. this.discardSlow(),
  21048. e && e()
  21049. }
  21050. .bind(this);
  21051. this._warpCameraAim(t, d)
  21052. }
  21053. ,
  21054. n.prototype.warpCommonParameters = function(e, t, i, n) {
  21055. this.model.skybox.material.uniforms.blackout.value = n;
  21056. var r = u.uniform(this.model.skybox, "progress", 1)
  21057. , o = u.allUniforms(this.model.chunks, "progress", 1)
  21058. , a = !1
  21059. , s = function() {
  21060. if (this.warpInterrupted)
  21061. return a = !0,
  21062. !0
  21063. }
  21064. .bind(this)
  21065. , l = function(e, t) {
  21066. return i && a ? (this.model.skybox.material.uniforms.progress.value = 0,
  21067. !0) : void r(e, t)
  21068. }
  21069. .bind(this)
  21070. , h = function(e, t) {
  21071. return i && a ? (o(0),
  21072. !0) : void o(e, t)
  21073. }
  21074. .bind(this);
  21075. p.start(s, e, null, t, null, "safeHaltWatch"),
  21076. p.start(l, e, null, t, d[c.warp.blendEasing], "skyboxProgress"),
  21077. p.start(h, e, null, t, d[c.warp.blendEasing], "chunkProgress")
  21078. }
  21079. ,
  21080. n.prototype.warpTravel_STD = function(e) {
  21081. var t, i = Math.min(c.warp.lookAheadMax, c.warp.lookAheadDist / this.warpLength), n = this.playerControls.cameras[a.PANORAMA], o = (Math.min(.25, 3 / this.warpLength),
  21082. Math.min(.35, 7 / this.warpLength)), s = new r.Euler(0,0,0,c.warp.eOrder), f = new r.Vector3, m = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder), v = (new r.Euler).copy(m), C = n.position.clone(), E = new r.Matrix4, b = new r.Euler, w = c.warp.minWarpTime;
  21083. w += this.warpLength * c.warp.timePerMeter,
  21084. c.warp.flySpeed > .01 && (w = 1e3 * this.warpLength / c.warp.flySpeed);
  21085. var _ = !1
  21086. , T = this.warpDestHeroLoc.quaternion
  21087. , x = new r.Vector3(0,0,-1).applyQuaternion(T).normalize()
  21088. , S = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  21089. , M = S.dot(x)
  21090. , R = r.Math.radToDeg(Math.acos(M))
  21091. , P = function(e) {
  21092. var t = o
  21093. , i = r.Math.smoothstep(e, 0, t) * (1 - r.Math.smoothstep(e, 1 - t, 1));
  21094. return i
  21095. }
  21096. , O = function() {
  21097. return E.lookAt(C, t, A.UP),
  21098. s.setFromRotationMatrix(E, c.warp.eOrder),
  21099. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  21100. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  21101. h.constrainedTurn(b.y)
  21102. }
  21103. .bind(this)
  21104. , L = function(e, t) {
  21105. if (this.warpInterrupted)
  21106. return _ = !0,
  21107. !0
  21108. }
  21109. .bind(this)
  21110. , D = function(e, t) {
  21111. return _ || !this.warpPathPoints ? (g.blur(0),
  21112. !0) : void g.blur(e)
  21113. }
  21114. .bind(this)
  21115. , N = u.allUniforms(this.model.chunks, "modelAlpha", 1)
  21116. , B = function(e, t) {
  21117. return _ || !this.warpPathPoints ? (N(0),
  21118. !0) : void N(e, t)
  21119. }
  21120. .bind(this)
  21121. , F = function(e, t) {
  21122. if (!this.warpPathPoints)
  21123. return n.position.copy(this.warpDestPano.position),
  21124. !0;
  21125. if (_)
  21126. return !0;
  21127. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  21128. n.position.copy(i),
  21129. C = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  21130. }
  21131. .bind(this)
  21132. , V = function(e, n) {
  21133. return this.warpPathPoints ? !!_ || void (t = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + i, 1))) : (y.debug("Lost bunny."),
  21134. !0)
  21135. }
  21136. .bind(this)
  21137. , U = function(e, o) {
  21138. if (_)
  21139. return y.debug(">>>> Walkthrough interupted at t=" + e),
  21140. !0;
  21141. if (!this.warpPathPoints)
  21142. return !0;
  21143. var a = this.warpLength * e
  21144. , l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist)
  21145. , u = r.Math.smoothstep(a, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  21146. c.warp.matchCam && (l *= 1 - u),
  21147. E.lookAt(C, t, A.UP),
  21148. s.setFromRotationMatrix(E, c.warp.eOrder),
  21149. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  21150. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  21151. b.y = h.constrainedTurn(b.y),
  21152. s.x = m.x + l * b.x,
  21153. s.y = m.y + l * b.y,
  21154. s.z = m.z + l * b.z,
  21155. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  21156. b.y = h.constrainedTurn(b.y);
  21157. var d = r.Math.degToRad(c.warp.maxTurnPerSec) * o / 1e3;
  21158. b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y)),
  21159. v.x = v.x + b.x * c.warp.turnFriction,
  21160. v.y = v.y + b.y * c.warp.turnFriction,
  21161. v.z = v.z + b.z * c.warp.turnFriction,
  21162. v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x);
  21163. var p = t.clone().sub(C).normalize();
  21164. if (R < c.warp.maxAimRotation && u > 0) {
  21165. var g = 1 - u;
  21166. p.x = p.x * g + u * S.x,
  21167. p.y = p.y * g + u * S.y,
  21168. p.z = p.z * g + u * S.z,
  21169. p.normalize()
  21170. }
  21171. this.bunnyObj.position.copy(n.position).add(p),
  21172. f.set(0, 0, -1).applyEuler(v).normalize(),
  21173. f.multiplyScalar(8),
  21174. f.add(n.position),
  21175. e > 1 - i && c.warp.matchCam || (n.controls.lookAt(f),
  21176. n.controls.lookVector.copy(f),
  21177. n.lookAt(f))
  21178. }
  21179. .bind(this)
  21180. , k = function() {
  21181. _ ? (this.discardSlow(),
  21182. this.upcomingTransType = l.BLACK,
  21183. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, I.BEGINNING, e)) : this._wrapupWarpShading(e)
  21184. }
  21185. .bind(this);
  21186. V(0);
  21187. var H = c.warp.motionLeadTime + 1e3 * Math.abs(O()) / r.Math.degToRad(c.warp.maxTurnPerSec);
  21188. w += H;
  21189. var G = H / w;
  21190. this.warpCommonParameters(w, G, !0, I.NONE),
  21191. p.start(L, w, null, 0, null, "_haltWatcher"),
  21192. c.warp.blur > 0 && (g.blurStrength = c.warp.blur,
  21193. p.start(D, w, null, G, P, "blurring")),
  21194. p.start(B, w, null, G, P, "modelAlpha"),
  21195. p.start(F, w, null, G, d[c.warp.blendEasing], "followPath"),
  21196. p.start(V, w, null, G, d[c.warp.blendEasing], "goBunny"),
  21197. p.start(U, w, k, 0, d[c.warp.blendEasing], "lookAtBunny")
  21198. }
  21199. ,
  21200. n.prototype.warpTravel_BLACK = function(e, t, i, n) {
  21201. var r = e || 0;
  21202. void 0 !== t && null !== t || (t = c.warp.teleportTime)
  21203. updateVideo({type:"beforeFlytopano", pano : player.currentPano, dur:t})//add
  21204. if(momentTourBlackNewType){
  21205. player.sceneRenderer.effects.transitionMaskPass.start(player.sceneRenderer)
  21206. var camera = this.playerControls.cameras[a.PANORAMA];
  21207. var end = this.warpDestHeroLoc.position
  21208. camera.position.copy(end)
  21209. setTimeout(()=>{
  21210. player.sceneRenderer.effects.transitionMaskPass.stop()
  21211. updateVideo({type:"flyDone", pano : player.currentPano})//add
  21212. this.wrapupWarpShadingOnly(n, i);
  21213. },t)
  21214. }else{
  21215. var o = function() {
  21216. this.wrapupWarpShadingOnly(n, i);
  21217. updateVideo({type:"flyDone", pano:player.currentPano})//add
  21218. }
  21219. .bind(this);
  21220. p.start(this.stepWarpPath.bind(this), t, o, r, d[c.warp.blendEasing], "stepMotion")
  21221. }
  21222. this.warpCommonParameters(t, r, !1, i)
  21223. this.model.chunks.concat(this.model.skybox).forEach(function(e) {// 改
  21224. if(window.momentTourBlackNewType){
  21225. e.material.uniforms.blackout.value = 5//i 改
  21226. //e.material.defines.newBlack = ''
  21227. //e.material.needsUpdate = true
  21228. }else{
  21229. e.material.uniforms.blackout.value = i
  21230. }
  21231. }),
  21232. this._warpBendAim(null, t, null, r);
  21233. }
  21234. ,
  21235. n.prototype.flightStepWalk = function(e, t, i) {
  21236. var n = .001
  21237. , o = 1
  21238. , a = 1.2
  21239. , s = new r.Vector3
  21240. , h = new r.Vector3
  21241. , u = function(e, t) {
  21242. var i = Math.min(this.player.position.distanceTo(e.position), c.transition.flytimeMaxDistanceThreshold)
  21243. , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  21244. h.copy(A.FORWARD),
  21245. this.player.getDirection(h),
  21246. s.copy(t).sub(e.position).normalize();
  21247. var l = s.dot(h)
  21248. , u = Math.acos(l)
  21249. , d = u / r;
  21250. return d > n && (r *= d / n,
  21251. u < o && (r *= a)),
  21252. r
  21253. };
  21254. return function(e, t, i) {
  21255. if (this.warpInterrupted)
  21256. i && i();
  21257. else if (this.activeTransType !== l.WALK)
  21258. this._clearWarpShading(),
  21259. this._warpStopFlying(),
  21260. this.player.spider.draw(),
  21261. this.placeCpm(),
  21262. i && i();
  21263. else if (this.player.currentPano !== e) {
  21264. var n = {
  21265. pano: e,
  21266. lookAtPoint: t,
  21267. duration: null,
  21268. maxDistanceOverride: c.warp.walkMaxDist,
  21269. skipWarpingCheck: !1,
  21270. constantMoveSpeed: !0
  21271. };
  21272. if(e == this.warpDestPano){//到达终点前,放大到终点的zoom
  21273. n.zoomLevel = this.warpDestHeroLoc.zoom
  21274. }
  21275. n.duration = u.call(this, e, t),
  21276. this.player.nonInterruptingFlyToPano(n, i)
  21277. } else
  21278. i && i()
  21279. }
  21280. }(),
  21281. n.prototype.makeWalkFlightFunc = function(e, t, i) {
  21282. return this.flightStepWalk.bind(this, e, t, i)
  21283. }
  21284. ,
  21285. n.prototype.warpTravel_WALK = function() {
  21286. var e = [];
  21287. return function(t) {
  21288. var i = this.player.model.panos;
  21289. e.length = 0;
  21290. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  21291. var s = this.nodes[a]
  21292. , l = i.get(s);
  21293. a === this.nodes.length - 1;
  21294. o = n && l.position.distanceTo(n.position) < c.warp.walkMinDist,
  21295. n && o || (e.push(s),
  21296. n = l)
  21297. }
  21298. o && this.nodes.length > 1 && (e[e.length - 1] = this.nodes[this.nodes.length - 1]);
  21299. var h = e.length
  21300. , u = i.get(e[h - 1])
  21301. , d = new Array(h + 1);
  21302. d[d.length - 1] = function() {
  21303. t && t()
  21304. }
  21305. .bind(this);
  21306. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  21307. var g = e[p];
  21308. u = i.get(g);
  21309. var m = new r.Vector3;
  21310. this.getLookAtForWalkingTourNode(e, p, m),
  21311. d[f - 1] = this.makeWalkFlightFunc(u, m, d[f]),
  21312. p--
  21313. }
  21314. d[0]()
  21315. }
  21316. }(),
  21317. n.prototype.getLookAtForWalkingTourNode = function() {
  21318. var e = new r.Vector3
  21319. , t = new r.Vector3
  21320. , i = new r.Vector3
  21321. , n = new r.Vector3
  21322. , o = new r.Vector3
  21323. , a = .65
  21324. , s = .75
  21325. , l = .2
  21326. , c = .4
  21327. , h = .2
  21328. , u = 3;
  21329. return function(r, d, p) {
  21330. var f = r.length;
  21331. if (d >= f)
  21332. return !1;
  21333. var g = 1
  21334. , m = 1;
  21335. t.set(0, 0, 0),
  21336. o.set(0, 0, 0);
  21337. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  21338. if (v = this.player.model.panos.get(r[A]),
  21339. this.getOrientationForWalkingTourNode(r, A, i),
  21340. A === d && e.copy(i),
  21341. n.copy(i),
  21342. A > d) {
  21343. var y = n.dot(e) < a;
  21344. g *= y ? l : s,
  21345. m *= y ? h : c
  21346. }
  21347. i.multiplyScalar(g),
  21348. t.add(i),
  21349. o.lerp(v.position, m)
  21350. }
  21351. return t.normalize(),
  21352. p.copy(o),
  21353. p.add(t),
  21354. !0
  21355. }
  21356. }(),
  21357. n.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  21358. var n = e.length;
  21359. if (t >= n)
  21360. return !1;
  21361. if (t === n - 1)
  21362. i.copy(A.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  21363. else {
  21364. var r = this.player.model.panos.get(e[t])
  21365. , o = this.player.model.panos.get(e[t + 1]);
  21366. i.copy(o.position).sub(r.position)
  21367. }
  21368. return i.normalize(),
  21369. !0
  21370. }
  21371. ,
  21372. n.prototype.warpCameraTravel = function(e, t, i, n) {
  21373. if (this.activeTransType = this.upcomingTransType,
  21374. this.lastTransType = this.activeTransType,
  21375. this.upcomingTransType = null,
  21376. !e) {
  21377. var r = function() {
  21378. this._wrapupTravel(n)
  21379. }
  21380. .bind(this)
  21381. , o = {
  21382. pano: this.warpDestPano,
  21383. lookAtPoint: null,
  21384. duration: null,
  21385. maxDistanceOverride: null,
  21386. skipWarpingCheck: !1
  21387. };
  21388. return void this.player.flyToPano(o, r)
  21389. }
  21390. this.activeTransType === l.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === l.WALK ? this.warpTravel_WALK(function() {
  21391. this._clearWarpShading(),
  21392. this._warpStopFlying(),
  21393. this.player.spider.draw(),
  21394. this.placeCpm(),
  21395. n && n()
  21396. }
  21397. .bind(this)) : this.warpTravel_STD(n)
  21398. }
  21399. ,
  21400. n.prototype.startWarpState = function() {
  21401. this.warping = !0,
  21402. this.warpInterrupted = !1,
  21403. this.warpInterruptionBlackoutStyle = null,
  21404. this.warpInterruptionTravelTime = null
  21405. }
  21406. ,
  21407. n.prototype.endWarpState = function() {
  21408. this.warping = !1
  21409. }
  21410. ,
  21411. n.prototype.warpToPano = function(e, t, i, n) {
  21412. if (this.warping)
  21413. return void y.warn("Cannot warp when already warping");
  21414. if (this.upcomingTransType = e,
  21415. this.activeTransType = null,
  21416. !this.setWarpDestPano())
  21417. return this.upcomingTransType = null,
  21418. void this.warpToNonPano(n);
  21419. if (this.player.mode !== a.PANORAMA)
  21420. return this.upcomingTransType = null,
  21421. this.discardSlow(),
  21422. void this.player.flyToNewMode({
  21423. mode: a.PANORAMA,
  21424. pano: this.warpDestPano,
  21425. duration: c.warp.outsideTime,
  21426. warpDest: this.warpDestHeroLoc,
  21427. callback: n,
  21428. force: !0
  21429. });
  21430. if (!this.warpDestPano)
  21431. return y.warn("no warp destination, callback dropped"),
  21432. void (this.upcomingTransType = null);
  21433. var r = !(this.model.panos.isNeighbour(this.player.currentPano, this.warpDestPano) && this.warpDestPano !== this.player.currentPano && this.warpDestPano.position.distanceTo(this.player.currentPano.position) < c.warp.nearPanoDist)
  21434. , o = this.chooseWarpPath(r);
  21435. if (o && this.upcomingTransType !== l.WALK) {
  21436. var s = function() {
  21437. this.waitingToWarp = !1,
  21438. this.warpToPano(e, t, i, n)
  21439. }
  21440. .bind(this);
  21441. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, s))
  21442. return void (this.waitingToWarp = !0)
  21443. }
  21444. this.player.currentPano || (y.warn("Arrived at a very strange spot!"),
  21445. this.player.currentPano = this.warpDestPano,
  21446. this.placeCpm(),
  21447. this.fadeOutCpm(c.path.fadeOutTime),
  21448. this.player.spider.draw()),
  21449. y.debug("Warping to pano ", this.warpDestPano.position),
  21450. this.upcomingTransType !== l.WALK && this.player.emit(C.PanoChosen, this.player.currentPano, this.warpDestPano),
  21451. this.startWarpState();
  21452. var h = function() {
  21453. this.endWarpState(),
  21454. n && n()
  21455. }
  21456. .bind(this);
  21457. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h)
  21458. //this.player.smoothZoomToDefault(c.zoom.restoreTime);
  21459. }
  21460. ,
  21461. t.exports = n
  21462. }
  21463. ).call(this, "/js/objects/ShowPath.js")
  21464. }
  21465. , {
  21466. "../constants": 8,
  21467. "../effects": 16,
  21468. "../enum/BlackoutStyle": 18,
  21469. "../enum/ModelManagerEvents": 33,
  21470. "../enum/PlayerEvents": 40,
  21471. "../enum/RenderOrder": 42,
  21472. "../enum/Vectors": 50,
  21473. "../enum/Viewmode": 51,
  21474. "../enum/WarpStyle": 52,
  21475. "../gui/gui": 65,
  21476. "../model/ModelManager": 140,
  21477. "../objects/Snapshot": 153,
  21478. "../settings": 166,
  21479. "../shaders": 167,
  21480. "../util/easing": 186,
  21481. "../util/lerp": 188,
  21482. "../util/logger": 189,
  21483. "../util/math": 190,
  21484. "../util/texture": 194,
  21485. "../util/transitions": 195,
  21486. three: 217
  21487. }],
  21488. 152: [function(e, t, i) {
  21489. "use strict";
  21490. function n() {
  21491. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  21492. , t = new r.RawShaderMaterial({
  21493. fragmentShader: o.skysphere.fragmentShader,
  21494. vertexShader: o.skysphere.vertexShader,
  21495. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  21496. side: r.BackSide,
  21497. name: "skysphere"
  21498. });
  21499. t.uniforms.radius.value = e.parameters.radius,
  21500. r.Mesh.call(this, e, t)
  21501. }
  21502. var r = e("three")
  21503. , o = e("../shaders")
  21504. , a = e("../settings");
  21505. n.prototype = Object.create(r.Mesh.prototype),
  21506. n.prototype.constructor = n,
  21507. t.exports = n
  21508. }
  21509. , {
  21510. "../settings": 166,
  21511. "../shaders": 167,
  21512. three: 217
  21513. }],
  21514. 153: [function(e, t, i) {
  21515. (function(i) {
  21516. "use strict";
  21517. function n(e) {
  21518. o.call(this, e),
  21519. this.sid = e.sid,//xzw add
  21520. this.panoId = e.panoId,
  21521. this.orthoZoom = e.orthoZoom,
  21522. this.floorVisibility = e.floorVisibility,
  21523. this.thumbUrl = e.thumbUrl,
  21524. this.name = e.name,
  21525. this.zoom = e.zoom
  21526. }
  21527. var r = (e("three"),
  21528. e("../util/logger"))
  21529. , o = (e("../settings"),
  21530. e("../enum/Viewmode"),
  21531. e("../util/common"),
  21532. e("../util/transitions"),
  21533. e("../util/lerp"),
  21534. e("../util/ajax"),
  21535. e("../util/texture"),
  21536. e("./View"));
  21537. e("events").EventEmitter,
  21538. new r(i);
  21539. n.prototype = Object.create(o.prototype),
  21540. n.prototype.isPano = function() {
  21541. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  21542. }
  21543. ,
  21544. t.exports = n
  21545. }
  21546. ).call(this, "/js/objects/Snapshot.js")
  21547. }
  21548. , {
  21549. "../enum/Viewmode": 51,
  21550. "../settings": 166,
  21551. "../util/ajax": 181,
  21552. "../util/common": 185,
  21553. "../util/lerp": 188,
  21554. "../util/logger": 189,
  21555. "../util/texture": 194,
  21556. "../util/transitions": 195,
  21557. "./View": 154,
  21558. events: 202,
  21559. three: 217
  21560. }],
  21561. 154: [function(e, t, i) {
  21562. (function(i) {
  21563. "use strict";
  21564. function n(e) {
  21565. e = e || {},
  21566. this.position = new r.Vector3,
  21567. this.quaternion = new r.Quaternion,
  21568. this.update(e)
  21569. }
  21570. var r = e("three")
  21571. , o = e("../util/logger")
  21572. , a = (e("../settings"),
  21573. e("../enum/Viewmode"),
  21574. e("../util/common"),
  21575. e("../util/transitions"),
  21576. e("../util/lerp"),
  21577. e("../util/ajax"),
  21578. e("../util/texture"),
  21579. e("events").EventEmitter);
  21580. new o(i);
  21581. n.prototype = Object.create(a.prototype),
  21582. n.prototype.isValid = function() {
  21583. return !!this.cameraMode
  21584. }
  21585. ,
  21586. n.prototype.update = function(e) {
  21587. return this.cameraMode = e.cameraMode || this.cameraMode,
  21588. this.pano = e.pano || this.pano,
  21589. e.position && this.position.copy(e.position),
  21590. e.quaternion && this.quaternion.copy(e.quaternion),
  21591. this
  21592. }
  21593. ,
  21594. t.exports = n
  21595. }
  21596. ).call(this, "/js/objects/View.js")
  21597. }
  21598. , {
  21599. "../enum/Viewmode": 51,
  21600. "../settings": 166,
  21601. "../util/ajax": 181,
  21602. "../util/common": 185,
  21603. "../util/lerp": 188,
  21604. "../util/logger": 189,
  21605. "../util/texture": 194,
  21606. "../util/transitions": 195,
  21607. events: 202,
  21608. three: 217
  21609. }],
  21610. 155: [function(e, t, i) {//player.js
  21611. (function(i) {
  21612. "use strict";
  21613. function n(e) {
  21614. this.currentPano = null,
  21615. this.nextPano = null,
  21616. this.camera = null,
  21617. this.paused = !1,
  21618. this.flying = !1,
  21619. this.sceneIntersectionPlane = null,
  21620. this.target = new r.Vector3,
  21621. this.mouse = new r.Vector3(1.1,1.1,.5),
  21622. this.mouseAtMouseDown = new r.Vector2,
  21623. this.mouseCouldBeClickToMove = !1,
  21624. this.mouseLastMoveTime = Date.now(),
  21625. this.mouseDown = !1,
  21626. this.mouseDownTimer = null,
  21627. this.couldBeLongTap = !1,
  21628. this.containsMouse = !1, //
  21629. this.isTouchEvent = !1,
  21630. this.isPanoHover = !1,
  21631. this.reticule = new a(this),
  21632. this.panoMarkers = [],
  21633. this.spider = new h(this),
  21634. this.quaternion = new r.Quaternion,
  21635. this.position = new r.Vector3(15,10,15),
  21636. this.previousState = null,
  21637. this.lastInsideView = new c,
  21638. this.last360View = new c,
  21639. this.raycaster = new r.Raycaster,
  21640. this.intersect = null,
  21641. this.lastChangeTime = Date.now(),
  21642. this.history = new I,
  21643. this.cameraControls = null,
  21644. this.path = null,
  21645. this.model = null,
  21646. this.domElement = null,
  21647. this.cachedPanoCandidates = null,
  21648. this.basePanoSize = 0,
  21649. this.standardPanoSize = 0,
  21650. this.highPanoSize = 0,
  21651. this.ultraHighPanoSize = 0,
  21652. this.zoomLevel = 1,
  21653. this.zooming = 0,
  21654. this.zoomSpeed = .5,
  21655. this.scrollZoomSpeed = .06,
  21656. this.zoomSpeedAdjust = .05,
  21657. this.defaultZoomIncrement = .2,
  21658. this.baseFov = f.insideFOV,
  21659. this.zoomFov = this.baseFov,
  21660. this.zoomEnabled = !0,
  21661. this.preRenderingEnabled = !1,
  21662. this.setupCustomProperties(e),
  21663. this.zoomStats = new L
  21664. }
  21665. var r = e("three")
  21666. , o = e("./util/logger")
  21667. , a = e("./objects/Reticule")
  21668. , s = e("./objects/Panorama")
  21669. , l = e("./objects/ShowPath")
  21670. , c = e("./objects/View")
  21671. , h = (e("./objects/Snapshot"),
  21672. e("./objects/NSpider"))
  21673. , u = e("./enum/Viewmode")
  21674. , d = (e("./enum/TagStates"),
  21675. e("./enum/Vectors"))
  21676. , p = e("./enum/Keys")
  21677. , f = (e("./enum/AlignmentType"),
  21678. e("./settings"))
  21679. , g = e("./util/common")
  21680. , m = (e("./util/browser"),
  21681. e("./util/math"))
  21682. , v = e("./util/lerp")
  21683. , A = e("./util/easing")
  21684. , y = e("./util/transitions")
  21685. , C = e("events").EventEmitter
  21686. , I = (e("./shaders"),
  21687. e("./util/history"))
  21688. , E = (e("./util/camera"),
  21689. e("./model/ModelManager"),
  21690. e("./enum/PathDiscardMode"))
  21691. , b = e("./enum/PathDisplayMode")
  21692. , w = e("./enum/PlayerEvents")
  21693. , _ = e("./enum/ControlEvents")
  21694. , T = e("./enum/ModelManagerEvents")
  21695. , x = e("./enum/WarpStyle")
  21696. , S = e("./enum/BlackoutStyle")
  21697. , M = e("./exception/BasicException")
  21698. , R = e("./enum/PanoSizeClass")
  21699. , P = (e("./tile/TileDownloader"),
  21700. e("./tile/TilePrioritizer"))
  21701. , O = (e("./enum/PanoramaEvents"),
  21702. e("./enum/ZoomEvents"))
  21703. , L = e("./util/ZoomStats")
  21704. , D = e("./constants")
  21705. , N = e("./util/common")
  21706. , B = e("./util/cameraLight")
  21707. , Hot = e('hot')
  21708. , F = new o(i)
  21709. , V = Object.freeze({
  21710. FlyToPano: y.getUniqueId(),
  21711. FlyToNewMode: y.getUniqueId(),
  21712. FlyToSameMode: y.getUniqueId(),
  21713. FlyToViewFloor: y.getUniqueId(),
  21714. LookTransition: y.getUniqueId(),
  21715. ZoomTransition: y.getUniqueId()
  21716. });
  21717. n.prototype = Object.create(C.prototype),
  21718. n.prototype.init = function(e) {
  21719. window.player = this
  21720. this.modelManager = e.modelManager,
  21721. this.tileDownloader = e.tileDownloader,
  21722. this.panoRenderer = e.panoRenderer,
  21723. this.qualityManager = e.qualityManager,
  21724. this.domElement = e.container,
  21725. this.camera = e.camera,
  21726. this.tagManager = e.tagManager,
  21727. this.cameraControls = e.controls,
  21728. this.path = new l(e.director,this,e.controls),
  21729. this.basePanoSize = this.qualityManager.getPanoSize(R.BASE),
  21730. this.standardPanoSize = this.qualityManager.getPanoSize(R.STANDARD),
  21731. this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH),
  21732. this.ultraHighPanoSize = this.qualityManager.getPanoSize(R.ULTRAHIGH),
  21733. this.tileDownloader.processPriorityQueue = !1,
  21734. this.tileDownloader.tilePrioritizer = new P(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  21735. this.bindEvents(e.container),
  21736. this.updateModel()
  21737. }
  21738. //xzw add: 截图
  21739. function dataURLtoBlob(dataurl) {
  21740. var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
  21741. bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
  21742. while(n--){
  21743. u8arr[n] = bstr.charCodeAt(n);
  21744. };
  21745. return new Blob([u8arr], {type:mime});
  21746. }
  21747. n.prototype.screenShot = function(o){
  21748. if(this.flying || this.flyingToTag) return;
  21749. var R = this.sceneRenderer;
  21750. R.updateScreenSize(o);
  21751. for(var i in this.model.panos.index){
  21752. if(!this.model.panos.index[i].marker) continue;
  21753. this.model.panos.index[i].marker.forceHide = this.model.panos.index[i].marker.visible;
  21754. this.model.panos.index[i].marker.visible = false;
  21755. }
  21756. for(var i in this.model.hots){
  21757. this.model.hots[i].mesh.visible = false;
  21758. }
  21759. this.reticule.visible = false;
  21760. this.reticule.forceUnvisible = true;
  21761. this.path.currentPanoMarker.mesh.visible = false;
  21762. setTimeout(function(){//因resize效用没办法立即生效(原因未知),故而延后
  21763. R.renderer.clear(true,true,true);
  21764. R.renderer.render(R.scene, R.camera);
  21765. var imgData = R.renderer.domElement.toDataURL(o.type,0.9);
  21766. o.f && o.f(imgData)
  21767. R.updateScreenSize({resize:true});
  21768. this.reticule.visible = true;
  21769. for(var i in this.model.hots){
  21770. this.model.hots[i].mesh.visible = true;
  21771. }
  21772. for(var i in this.model.panos.index){
  21773. this.model.panos.index[i].marker.visible = this.model.panos.index[i].marker.forceHide;
  21774. }
  21775. this.path.currentPanoMarker.mesh.visible = true;
  21776. R.renderer.render(R.scene, R.camera);
  21777. }.bind(this),30) //这个数字不能太小
  21778. }
  21779. var scaleImg = e("scaleImg");
  21780. var ResizeImg = function(img, option){
  21781. var img2; //不能直接改img 否则可能触发第二次img.onload
  21782. var compress = function(ratio,type){
  21783. var image = img2 || img;
  21784. var c = document.createElement('canvas');
  21785. c.width = image.width; c.height = image.height;
  21786. var ctx = c.getContext('2d');
  21787. ctx.drawImage(image,0,0,image.width,image.height);
  21788. img2 = scaleImg(ratio/* option.maxSize/oldSize */, c, type/* option.type||"png" */);//最大不能超过0.8M
  21789. }
  21790. var reCom = function(){ //如果有了img2 就只需要img2 否则创造新的img2
  21791. var image = img2 || img;
  21792. var blob = dataURLtoBlob(image.src);
  21793. if(option.maxWeight && blob.size > option.maxWeight){
  21794. compress(option.maxWeight/blob.size, "jpeg")
  21795. blob = dataURLtoBlob(image.src);
  21796. }
  21797. if(!img2){
  21798. img2 = new Image();
  21799. }
  21800. img2.base64Src = image.src;
  21801. img2.src = window.URL.createObjectURL(blob);
  21802. }
  21803. var oldSize = Math.max(img.width, img.height);
  21804. if(option.toType != "png"){//不是非要png的话
  21805. if(option.oldType == "jpeg"){//jpeg先判断尺寸,然后是尺寸
  21806. if(oldSize > option.maxSize){
  21807. compress(option.maxSize/oldSize, "jpeg");
  21808. }
  21809. reCom();
  21810. }else if(option.oldType == "png"){//png先判断数据量 如果数据量达标,就无视大小(有可能超出大小)
  21811. if(option.maxWeight && option.weight > option.maxWeight){//如果一开始大小不大就不压缩 还是png
  21812. compress(oldSize>option.maxSize ? option.maxSize/oldSize : 1, "jpeg");
  21813. reCom();
  21814. }
  21815. }
  21816. }else{
  21817. //?貌似png会越压缩越大?
  21818. }
  21819. return img2 || img;
  21820. }
  21821. var _fixType=function(type) {
  21822. type = type.toLowerCase().replace(/jpg/i, 'jpeg');
  21823. var r = type.match(/png|jpeg|bmp|gif/)[0];
  21824. return 'image/' + r;
  21825. };
  21826. var saveFile=function(data, filename){
  21827. var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
  21828. save_link.href = data;
  21829. save_link.download = filename;
  21830. var event = document.createEvent('MouseEvents');
  21831. event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  21832. save_link.dispatchEvent(event);
  21833. };
  21834. n.prototype.getWrapShot = function(){ //获取导览点截图/初始画面和信息
  21835. var info = this.getSnapAngleInfo();
  21836. var str = ',{\r\t' + info;
  21837. var arg = arguments[0];
  21838. this.screenShot({ width:g_snapShotWidth*4, height:g_snapShotHeight*4, type:"image/jpeg", f:function(imgData){
  21839. if (arg && arg.__callback) {
  21840. return arg.__callback(imgData, info)
  21841. }
  21842. var img = new Image();
  21843. img.src = imgData;
  21844. img.onload = function(){
  21845. var img2 = ResizeImg(this,{maxSize: g_snapShotWidth, oldType:"jpeg"}); //暂定缩略图大小
  21846. img2.src.replace(_fixType("image/jpeg"),'image/octet-stream');
  21847. var filename = "snap" + (new Date()).getTime();
  21848. saveFile(img2.src,filename + ".jpg");
  21849. str +=(',\r\t"thumbnail_signed_src":"'+filename+'.jpg",');
  21850. str +=('\r\t"sid":"'+filename+'",');
  21851. str +=('\r\t"name":"'+filename+'"\r}');
  21852. logData(str)
  21853. }
  21854. }});
  21855. }
  21856. ,
  21857. n.prototype.getSnapAngleInfo = function(){
  21858. var info = {};
  21859. var str = '"metadata":{';
  21860. var q = this.camera.quaternion.clone();
  21861. switch (this.mode) {
  21862. case "panorama":
  21863. info.scan_id = this.currentPano.id;
  21864. str += ('"scan_id":"'+this.currentPano.id+'",');
  21865. break;
  21866. case "floorplan":
  21867. info.camera_mode = 1;
  21868. q = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  21869. q.multiply(this.camera.quaternion);
  21870. str += ('"camera_mode":1,');
  21871. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  21872. str += ('"ortho_zoom":'+ m.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  21873. break;
  21874. case "dollhouse":
  21875. info.camera_mode = 2;
  21876. str += ('"camera_mode":2,');
  21877. break;
  21878. }
  21879. info.camera_position = m.toPrecision(this.camera.position.toArray(),4);
  21880. console.log(info.camera_position)
  21881. if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的
  21882. /**fyz 对相机截屏的角度进行校对 */
  21883. var out = new r.Quaternion(q.x, q.y, q.z, q.w)
  21884. out.multiply(new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  21885. out.x *= -1;
  21886. out.w *= -1;
  21887. info.camera_quaternion = m.toPrecision(out.toArray(),4);
  21888. }else{
  21889. info.camera_quaternion = m.toPrecision(q.toArray(),4);;
  21890. }
  21891. info.zoom = this.zoomLevel;
  21892. console.log(info.camera_quaternion)
  21893. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  21894. // fyz 扩展编辑页面, 加上导览点缩放值
  21895. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  21896. return str;
  21897. }
  21898. //------end
  21899. n.prototype.closePopup = function() {//xzw 关闭热点页面
  21900. if(!g_currentHot) return;
  21901. g_currentHot = null;
  21902. var hotPop = document.getElementById('popup');
  21903. hotPop.style.display = "none";
  21904. document.querySelector(".popup-content").removeChild(document.getElementById("id1"));
  21905. $("#popup iframe:last").remove();
  21906. var _bgaudio = document.getElementById("bgaudio");
  21907. try{
  21908. window.parent.postMessage("closeHot",'*')
  21909. }catch(e){
  21910. console.log(e)
  21911. }
  21912. //判断音乐是否暂停或者是否存在
  21913. /* if(g_bgAudio && g_bgAudio.paused && g_bgAudio.readyState != 0 && g_play === 1)
  21914. {
  21915. //g_bgAudio.play();
  21916. manage.switchBgmState(true)
  21917. }; */
  21918. if(g_bgAudio && g_bgAudio.pauseByHot){
  21919. manage.switchBgmState(true)
  21920. }
  21921. playMusic(player.currentPano)
  21922. //$('#player').off("click",this.closePopup);
  21923. return false
  21924. }
  21925. n.prototype.setupCustomProperties = function(e) {
  21926. var t = e || u.PANORAMA;
  21927. Object.defineProperty(this, "mode", {
  21928. get: function() {
  21929. return t
  21930. },
  21931. set: function(e) {
  21932. var i = t;
  21933. t = e,
  21934. this.onModeUpdated(i, t)
  21935. }
  21936. })
  21937. }
  21938. ,
  21939. n.prototype.isInMode = function() {
  21940. for (var e = 0; e < arguments.length; e++)
  21941. if (this.mode === arguments[e])
  21942. return !0;
  21943. return !1
  21944. }
  21945. ,
  21946. n.prototype.isOutsideMode = function(e) {
  21947. return e = e || this.mode,
  21948. e === u.DOLLHOUSE || e === u.FLOORPLAN
  21949. }
  21950. ,
  21951. n.prototype.is360View = function(e, t) {
  21952. return e === u.PANORAMA && t && !t.isAligned()
  21953. }
  21954. ,
  21955. n.prototype.setScene = function(e) {
  21956. this.sceneIntersectionPlane = e.plane,
  21957. this.path.setScene(e),
  21958. this.moveReticuleToScene(e)
  21959. }
  21960. ,
  21961. n.prototype.moveReticuleToScene = function(e) {
  21962. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  21963. e.add(this.reticule)
  21964. }
  21965. ,
  21966. n.prototype.updateModel = function() {
  21967. function e(e, t, n) {
  21968. this.mode === u.DOLLHOUSE && e !== n && i.call(this, e.center.y)
  21969. }
  21970. function t(e, t) {
  21971. if (this.mode === u.DOLLHOUSE) {
  21972. var n = e ? this.model.center.y : n = t.center.y;
  21973. i.call(this, n)
  21974. }
  21975. }
  21976. function i(e) {
  21977. var t = this.cameraControls.cameras[u.DOLLHOUSE]
  21978. , i = this.cameraControls.controls[u.DOLLHOUSE]
  21979. , n = t.position.y + (e - i.target.y)
  21980. , r = f.showFloorDuration + f.showFloorDelay;
  21981. y.start(v.property(i.target, "y", e), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor),
  21982. y.start(v.property(t.position, "y", n), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor)
  21983. }
  21984. this.model = this.modelManager.getActiveModel(),
  21985. this.model.on("floor.changed", e.bind(this)),
  21986. this.model.on("allfloors.toggled", t.bind(this)),
  21987. this.on(w.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  21988. /*******************************************************************VR fyz改 from徐世廷*******************************************************************/
  21989. var e2 = this;
  21990. this.model.panos.list.forEach(function(a) {
  21991. a.vrMarker.addEventListener("click", function() {
  21992. e2.flyToPano({
  21993. pano: a
  21994. })
  21995. })
  21996. })
  21997. /********************************************************************************************************************************************/
  21998. }
  21999. ,
  22000. n.prototype.updateModelDependentData = function() {
  22001. this.cameraControls.setModelForControls(this.model),
  22002. this.getPanoMarkersFromModel(this.model)
  22003. }
  22004. ,
  22005. n.prototype.onModelChanged = function() {
  22006. this.updateModel(),
  22007. this.updateModelDependentData()
  22008. }
  22009. ,
  22010. n.prototype.getPanoMarkersFromModel = function(e) {
  22011. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  22012. return t.marker ? e.concat(t.marker) : e
  22013. }, [])
  22014. }
  22015. ,
  22016. n.prototype.handleControlMove = function(e) {
  22017. this.emit(w.Move, e)
  22018. }
  22019. ,
  22020. n.prototype.handleControlInputStart = function(e) {
  22021. this.emit(w.InputStart, e)
  22022. }
  22023. ,
  22024. n.prototype.onModeUpdated = function(e, t) {
  22025. this.cameraControls.activateControls(t),
  22026. this.emit(w.ModeChanged, e, t)
  22027. }
  22028. ,
  22029. n.prototype.isWarping = function() {
  22030. return this.path.warping
  22031. }
  22032. ,
  22033. n.prototype.isWaitingToWarp = function() {
  22034. return this.path.waitingToWarp
  22035. }
  22036. ,
  22037. n.prototype.getLabelScaleFactor = function() {
  22038. if (this.isOutsideMode()) {
  22039. var e = 10
  22040. , t = Math.sqrt(this.cameraControls.controls[u.FLOORPLAN].currentScale / e);
  22041. return t
  22042. }
  22043. return .5
  22044. }
  22045. ,
  22046. n.prototype.changeMusic = function() {//xzw add
  22047. /* if(!this.director.tourIsPlaying && g_play && g_bgAudio){
  22048. g_playAudio = g_bgAudio;
  22049. //g_bgAudio.play();
  22050. manage.switchBgmState(true)
  22051. }else{
  22052. if(!g_play){
  22053. g_playAudio = g_bgAudio;
  22054. }else{//防止再次播放时重播一遍
  22055. g_playAudio = null;
  22056. }
  22057. } */
  22058. /* if(!this.director.tourIsPlaying && g_bgAudio){
  22059. manage.switchBgmState(true)
  22060. } */
  22061. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  22062. }
  22063. ,
  22064. n.prototype.bindEvents = function(e) {
  22065. e !== document && e.setAttribute("tabindex", -1),
  22066. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  22067. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  22068. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  22069. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  22070. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  22071. this.modelManager.on(T.ActiveModelChanged, this.onModelChanged.bind(this)),
  22072. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  22073. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  22074. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  22075. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  22076. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  22077. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  22078. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  22079. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  22080. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  22081. this.cameraControls.on(_.Move, this.handleControlMove.bind(this)),
  22082. this.cameraControls.on(_.InputStart, this.handleControlInputStart.bind(this)),
  22083. this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
  22084. this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this)),
  22085. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),//xzw add
  22086. window.addEventListener("tourAudioEnded", this.changeMusic.bind(this));//xzw add
  22087. // lzb
  22088. window.getSeft && getSeft(this);
  22089. //判断是否是移动端,如果是给关闭按钮添加touchstart事件
  22090. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  22091. $('#closepop').on("touchstart",this.closePopup.bind(this));
  22092. }else{
  22093. $('#closepop').on("click",this.closePopup.bind(this));
  22094. }
  22095. }
  22096. ,
  22097. n.prototype.onMouseDown = function(e) {
  22098. e.currentTarget !== document && e.currentTarget.focus(),
  22099. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  22100. this.updateIntersect())
  22101. }
  22102. ,
  22103. n.prototype.onMouseMove = function(e) {
  22104. this.isTouchEvent = !1,
  22105. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  22106. }
  22107. ,
  22108. n.prototype.onMouseOver = function(e) {
  22109. this.containsMouse = !0,
  22110. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  22111. }
  22112. ,
  22113. n.prototype.onMouseOut = function(e) {
  22114. this.containsMouse = !1
  22115. }
  22116. ,
  22117. n.prototype.onMouseUp = function(e) {
  22118. this.handleInputEnd.call(this, e.clientX, e.clientY, !1);
  22119. }
  22120. ,
  22121. n.prototype.onTouchStart = function(e) {
  22122. if (e.currentTarget !== document && e.currentTarget.focus(),
  22123. !this.mouseDown) {
  22124. this.couldBeLongTap = !0;
  22125. var t = g.average(e.changedTouches, "clientX")
  22126. , i = g.average(e.changedTouches, "clientY");
  22127. this.handleInputStart.call(this, t, i, !0),
  22128. this.mouseDownTimer = setTimeout(function() {
  22129. this.updateIntersect(),
  22130. this.handleInputEnd.call(this, t, i, !0)
  22131. }
  22132. .bind(this), f.input.longTapThreshold)
  22133. }
  22134. }
  22135. ,
  22136. n.prototype.onTouchMove = function(e) {
  22137. var t = g.average(e.changedTouches, "clientX")
  22138. , i = g.average(e.changedTouches, "clientY");
  22139. this.handleInputMove.call(this, t, i, !0)
  22140. }
  22141. ,
  22142. n.prototype.onTouchEnd = function(e) {
  22143. if (clearTimeout(this.mouseDownTimer),
  22144. this.mouseDown) {
  22145. this.couldBeLongTap = !1,
  22146. this.updateIntersect();
  22147. var t = g.average(e.changedTouches, "clientX")
  22148. , i = g.average(e.changedTouches, "clientY");
  22149. this.handleInputEnd.call(this, t, i, !0)
  22150. }
  22151. }
  22152. ,
  22153. n.prototype.onPointerDown = function(e) {
  22154. return e.currentTarget !== document && e.currentTarget.focus(),
  22155. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  22156. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  22157. void (this.mouseDownTimer = setTimeout(function() {
  22158. this.updateIntersect(),
  22159. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  22160. }
  22161. .bind(this), f.input.longTapThreshold)))
  22162. }
  22163. ,
  22164. n.prototype.onPointerMove = function(e) {
  22165. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  22166. }
  22167. ,
  22168. n.prototype.onPointerUp = function(e) {
  22169. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  22170. this.couldBeLongTap = !1,
  22171. this.updateIntersect(),
  22172. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  22173. }
  22174. ,
  22175. n.prototype.onPointerOut = function(e) {
  22176. this.mouseDown = !1
  22177. }
  22178. ,
  22179. n.prototype.onPointerCancel = function(e) {
  22180. this.mouseDown = !1
  22181. }
  22182. ,
  22183. n.prototype.onKeyDown = function(e) {
  22184. var t = function() {
  22185. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, "key")
  22186. }
  22187. .bind(this)
  22188. , i = e.which;
  22189. switch (i) {
  22190. case p.F:
  22191. t(),
  22192. this.changeFloor(-1);
  22193. break;
  22194. case p.R:
  22195. t(),
  22196. this.changeFloor(1)
  22197. }
  22198. if (this.mode === u.PANORAMA)
  22199. switch (i) {
  22200. case p.UPARROW:
  22201. case p.W:
  22202. this.flyLocalDirection(d.FORWARD.clone());
  22203. break;
  22204. case p.DOWNARROW:
  22205. case p.S:
  22206. this.flyLocalDirection(d.BACK.clone());
  22207. break;
  22208. case p.A:
  22209. this.flyLocalDirection(d.LEFT.clone());
  22210. break;
  22211. case p.D:
  22212. this.flyLocalDirection(d.RIGHT.clone())
  22213. }
  22214. }
  22215. ,
  22216. n.prototype.handleScrollPinchZoom = function() {
  22217. return function(e) {
  22218. var t = e
  22219. , i = this.zoomLevel;
  22220. this.zoomBy(t),
  22221. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  22222. }
  22223. }(),
  22224. n.prototype.handleControlPinch = function(e) {
  22225. f.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new r.Vector3(0,0,e).normalize())
  22226. }
  22227. ,
  22228. n.prototype.handleControlScroll = function(e) {
  22229. f.zoom.enabled ? (e > 0 ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  22230. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new r.Vector3(0,0,-e).normalize())
  22231. }
  22232. ,
  22233. n.prototype.handleInputStart = function(e, t, i) {
  22234. //许钟文加
  22235. var pad = this.handelPadding(e, t);
  22236. e = pad.x;
  22237. t = pad.y;
  22238. this.isTouchEvent = i,
  22239. m.convertScreenPositionToNDC(e, t, this.mouse),
  22240. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  22241. this.mouseCouldBeClickToMove = !0,
  22242. this.mouseDown = !0;
  22243. if (this.mouseCouldBeClickToMove) {
  22244. //window.DownInterface && new DownInterface().state(this,Hot);
  22245. window.Hotpoint && new Hotpoint().state(this,Hot);
  22246. }
  22247. if(!this.overlayInitedPlay /* && !settings.isEdit */ && this.overlayGroup.children.length){
  22248. this.overlayGroup.children.forEach((overlay)=>{
  22249. overlay.overlayType == "video" && overlay.plane.material.map.image.play()
  22250. })
  22251. this.overlayInitedPlay = true
  22252. playVideo()//add
  22253. }
  22254. /* this.overlayGroup.children.forEach((overlay)=>{
  22255. overlay.overlayType == "video" && overlay.visible && overlay.inSight() && overlay.videoControl(true)
  22256. }) */
  22257. }
  22258. ,
  22259. n.prototype.handelPadding = function(x, y) {
  22260. //去除player左边和上面的宽高,因为pc的player左上有其他element 许钟文
  22261. if (!this.pad)
  22262. this.pad = {
  22263. x: dom.getOffset("left", $("#player")[0]),
  22264. y: dom.getOffset("top", $("#player")[0])
  22265. }
  22266. return {
  22267. x: x - this.pad.x,
  22268. y: y - this.pad.y
  22269. }
  22270. }
  22271. n.prototype.handleInputMove = function(e, t, i) {
  22272. //许钟文加
  22273. var pad = this.handelPadding(e, t);
  22274. e = pad.x;
  22275. t = pad.y;
  22276. this.isTouchEvent = i,
  22277. m.convertScreenPositionToNDC(e, t, this.mouse),
  22278. this.mouseAtMouseDown.distanceTo(this.mouse) > f.input.moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  22279. this.couldBeLongTap = !1,
  22280. clearTimeout(this.mouseDownTimer)),
  22281. this.mouseLastMoveTime = Date.now(),
  22282. this.reticule.move(e, t, i)
  22283. }
  22284. ,
  22285. n.prototype.handleInputEnd = function(e, t, i) {//xzw
  22286. if (this.isTouchEvent = i,
  22287. this.mouseDown = !1,
  22288. this.cameraControls.controls[u.PANORAMA].emit("interaction.direct"),
  22289. !i && this.couldBeLongTap)
  22290. return !0;
  22291. if (this.handleLongTap())
  22292. return !0;
  22293. if (this.mouseCouldBeClickToMove) {
  22294. if (this.flying)
  22295. return this.path.activeTransType === x.WALK && this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType),
  22296. !0;
  22297. //add----
  22298. if(this.checkHotClick())//add
  22299. return !0;
  22300. if(checkSoundBtnClick(this.intersect))//add
  22301. return !0;
  22302. if(this.hoveringPlane){
  22303. this.clickOverlay(this.hoveringPlane)
  22304. return;
  22305. }
  22306. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, this.isTouchEvent ? "touch" : "mouse"),
  22307. this.history.invalidate(),
  22308. this.intersect)
  22309. return this.flyToPanoClosestToMouse();
  22310. if (this.mode === u.PANORAMA) {
  22311. var n = this.closestPanoInDirection(this.getMouseDirection());
  22312. return n ? this.flyToPano({
  22313. pano: n
  22314. }) : this.bump(this.getMouseDirection())
  22315. }
  22316. }
  22317. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  22318. }
  22319. ,
  22320. n.prototype.handleLongTap = function() {
  22321. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== u.PANORAMA))
  22322. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.LongTap, "touch"),
  22323. !0
  22324. }
  22325. ,
  22326. n.prototype.checktagClick = function() {
  22327. if (this.tagManager.intersectTag) {
  22328. var e = this.isTouchEvent
  22329. , t = this.tagManager.clickedOnTag(e, this);
  22330. return e || t || y.cancelById(V.LookTransition),
  22331. !0
  22332. }
  22333. if (this.tagManager.activeTag)
  22334. return this.tagManager.dismissActiveTag(),
  22335. !1
  22336. }
  22337. ,
  22338. n.prototype.rankedtagInDirection = function(e, t) {
  22339. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  22340. }
  22341. ,
  22342. n.prototype.start = function(e) {
  22343. //-------------------
  22344. window.initOverlay(r)
  22345. this.model.loadOverlays()
  22346. loadVideo();//add
  22347. //-------------------
  22348. var t = e.mode
  22349. , i = e.pano
  22350. , n = e.position
  22351. , rr = e.quaternion
  22352. , o = e.tag
  22353. , a = e.quickstart
  22354. , s = $.Deferred();
  22355. this.updateModelDependentData(),
  22356. this.updateFromControls(),
  22357. this.findDefaultViews();
  22358. var l = this.is360View(t, i);
  22359. return !this.model.outsideAllowed() || l || a ? (updateVideo({type:"beforeFlyIn", pano:i, dur:0}),
  22360. this.startInside(i, n, rr, o, s)) : this.startOutside(e, s),
  22361. s.done(function(e) {
  22362. this.emit(w.Ready, l, e, o)
  22363. }
  22364. .bind(this)),
  22365. s.promise()
  22366. }
  22367. ,
  22368. n.prototype.startOutside = function(e, t) {
  22369. var i = e.mode
  22370. , n = e.pano
  22371. , r = e.position
  22372. , o = e.quaternion
  22373. , a = e.zoom
  22374. , s = e.floorVisibility
  22375. , l = e.tag;
  22376. this.emit(w.StartOutside, f[i].transitionTime),
  22377. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  22378. y.cancelById(V.FlyToViewFloor),
  22379. i === u.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  22380. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  22381. }
  22382. ,
  22383. n.prototype.startInside = function(e, t, i, n, r) {
  22384. r = r || $.Deferred(),
  22385. this.currentPano = e;
  22386. var o = e && !e.isAligned();
  22387. if (t = o ? e.position : t || e.position,
  22388. i = i || e.quaternion,
  22389. e) {
  22390. var a = this.startInside.bind(this, e, t, i, n, r);
  22391. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  22392. return
  22393. }
  22394. //add
  22395. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  22396. this.updateHotVisible()
  22397. return this.mode = u.PANORAMA,
  22398. e.floor.enter(this.mode),
  22399. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  22400. this.switchCameraMode(this.mode, i),
  22401. this.emit(w.StartInside, o),
  22402. r.resolve(!0),
  22403. r
  22404. }
  22405. ,
  22406. n.prototype.startInsideWithFlyin = function(e, t, i, n, r) {
  22407. if (r = r || $.Deferred(),
  22408. this.dollhouseMode(),
  22409. !e)
  22410. return F.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  22411. r.resolve(!1),
  22412. r;
  22413. t = t || e.position;
  22414. var o = i || this.cameraControls.activeControl.camera.quaternion
  22415. , a = e.position;
  22416. return this.fitDollhouse(a, t, o),
  22417. setTimeout(function(t) {
  22418. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = t);
  22419. var n = {
  22420. mode: u.PANORAMA,
  22421. pano: e,
  22422. quaternion: i,
  22423. callback: function() {
  22424. this.emit(w.FlyinFinished),
  22425. r.resolve(!0)
  22426. }
  22427. .bind(this)
  22428. };
  22429. this.flyToNewMode(n)
  22430. }.bind(this, this.cameraControls.activeControl.maxDistance), f.startupFlyinDelay),
  22431. r
  22432. }
  22433. ,
  22434. n.prototype.checkAndWaitForPanoLoad = function() {
  22435. var e = {}
  22436. , t = {}
  22437. , i = 5e3
  22438. , n = function() {
  22439. for (var n in e)
  22440. if (e.hasOwnProperty(n) && e[n]) {
  22441. var r = performance.now() - t[n];
  22442. if (r < i)
  22443. return !0
  22444. }
  22445. return !1
  22446. };
  22447. return function(r, o, a, s, l, c, h, u, d, p) {
  22448. if (n())
  22449. return !0;
  22450. var f = function(t, i, n) {
  22451. N.delayOneFrame(function() {
  22452. e[t] = !1,
  22453. l && l(i, n)
  22454. }
  22455. .bind(this))
  22456. }
  22457. .bind(this, r.id)
  22458. , g = function(t, i) {
  22459. N.delayOneFrame(function() {
  22460. e[t] = !1,
  22461. c && c(i)
  22462. }
  22463. .bind(this))
  22464. }
  22465. .bind(this, r.id);
  22466. try {
  22467. return null !== u && void 0 !== u || (u = !0),
  22468. this.model.supportsTiles ? e[r.id] = this.checkAndWaitForTiledPanoLoad(r, s, f, g, h, u, d, p) : e[r.id] = this.checkAndWaitForWholePanoLoad(r, o, a, f, u),
  22469. e[r.id] && (t[r.id] = performance.now()),
  22470. e[r.id]
  22471. } catch (n) {
  22472. throw e[r.id] = !1,
  22473. t[r.id] = performance.now() - i,
  22474. n
  22475. }
  22476. }
  22477. }(),
  22478. n.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  22479. if (!e)
  22480. throw new M("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  22481. return r && this.model.waitForLoad(e, function() {
  22482. return e.isLoaded(i)
  22483. }),
  22484. !e.isLoaded(t) && (e.loadCube(t).done(n),
  22485. !0)
  22486. }
  22487. ,
  22488. n.prototype.checkAndWaitForTiledPanoLoad = function() {
  22489. var e = new r.Vector3;
  22490. return function(t, i, n, r, o, a, s, l) {
  22491. if (!t)
  22492. throw new M("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  22493. return e.copy(d.FORWARD),
  22494. this.getDirection(e),
  22495. !t.isLoaded(i) && (a && this.model.waitForLoad(t, function() {
  22496. return t.isLoaded(i)
  22497. }),
  22498. t.loadTiledPano(i, e, null, s, l).done(function(e, t) {
  22499. n && n(e, t)
  22500. }
  22501. .bind(this)).fail(function(e) {
  22502. r && r(e)
  22503. }
  22504. .bind(this)).progress(function(e, t, i) {
  22505. o && o(e, t, i)
  22506. }
  22507. .bind(this)),
  22508. !0)
  22509. }
  22510. }(),
  22511. n.prototype.switchCameraMode = function(e, t) {
  22512. var i = this.cameraControls.controls[e]
  22513. , n = i.camera;
  22514. switch (e) {
  22515. case u.PANORAMA:
  22516. n.position.copy(this.currentPano.position);
  22517. var o = t ? d.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  22518. i.lookAt(o.add(n.position));
  22519. break;
  22520. case u.DOLLHOUSE:
  22521. /* var a = this.position.clone();
  22522. this.mode === u.PANORAMA ? a.add(new r.Vector3(0,6,0)).add(this.getDirection().multiplyScalar(-10)) : a.add(d.DOWN.clone().applyQuaternion(this.quaternion).multiplyScalar(6)).setY(6),
  22523. n.position.copy(a),
  22524. i.target.copy(this.target.clone().setY(this.model.center.y));
  22525. break; */
  22526. //for多楼层 且 让模型刚好适应屏幕
  22527. var box = this.model.boundingBox.clone();
  22528. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  22529. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  22530. var fov = B.getHFOVFromVFOV(f.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  22531. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  22532. console.log(boxSize.x,distance, boxSize.length() / 2)
  22533. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  22534. if(this.mode === u.PANORAMA){
  22535. i.target.copy(this.model.center);
  22536. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  22537. }else{
  22538. i.target.copy(this.target.clone().setY(this.model.center.y))
  22539. var vec = d.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  22540. }
  22541. vec.multiplyScalar(distance )
  22542. n.position.copy(i.target.clone().add(vec))
  22543. break
  22544. case u.FLOORPLAN:
  22545. n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
  22546. i.target.copy(this.model.center).setY(0),
  22547. i.zoomToContain(this.model.size),
  22548. i.rotateToView(this.model.size, this.getDirection())
  22549. }
  22550. i.update(0)
  22551. }
  22552. ,
  22553. n.prototype.update = function() {
  22554. var e = (new r.Vector3,
  22555. {})
  22556. , t = [];
  22557. return function(i) {
  22558. this.updatePersistentZooming(i),
  22559. this.updateFromControls(i),
  22560. this.getCurrentNodePanos(t)
  22561. if(this.hasChanged(e) ) {
  22562. this.lastChangeTime = Date.now(),
  22563. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  22564. this.emit(w.ViewChanged),
  22565. this.intersectHot && this.intersectHot.showTitle()
  22566. this.intersect && this.magnifier && this.magnifier.update(this.intersect.point)
  22567. }
  22568. if(e.cameraChanged){
  22569. //this.controlVideosPlay()
  22570. for(var i in this.model.hots){
  22571. this.model.hots[i].update(this.camera)
  22572. }
  22573. this.overlayGroup.children.forEach(overlay=>{
  22574. overlay.update()
  22575. })
  22576. }
  22577. this.model.supportsTiles && (this.updateTileDownloader(t),
  22578. this.updatePanoRenderer(t)),
  22579. this.updatePreRendering(t),
  22580. this.reticule.update(),
  22581. this.path.update(),
  22582. this.spider.update(),
  22583. this.cachedPanoCandidates && f.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  22584. this.updateControlLocks(),
  22585. this.model.supportsTiles && this.updateZoomPano()
  22586. }
  22587. }(),
  22588. /* n.prototype.controlVideosPlay = function() {//判断box视频是否可见 不可见就暂停
  22589. var lastMode, lastPano;
  22590. return function(){
  22591. var mode = this.mode;
  22592. var pano = mode == "panorama" ? this.currentPano : "";
  22593. if(mode != "panorama" || pano != lastPano){
  22594. overlay.noBlock = null
  22595. }
  22596. this.overlayGroup.children.forEach((overlay)=>{
  22597. if(overlay.overlayType == "video" ){
  22598. var matrix = overlay.plane.matrixWorld;
  22599. var inSight = false;
  22600. var cameraDir = this.getDirection();
  22601. var planeDir = (new r.Vector3).copy(d.FORWARD).applyQuaternion(overlay.plane.quaternion)
  22602. var vertexes = []
  22603. if(cameraDir.angleTo(planeDir)>Math.PI/2){//朝向相机视线
  22604. for(let i=0; i<4; i++){
  22605. var vertex = overlay.plane.geometry.vertices[i].clone().applyMatrix4(matrix)
  22606. vertexes.push(vertex)
  22607. if(overlay.noBlock == null){
  22608. if(!m.ifShelter(vertex)){
  22609. overlay.noBlock = true
  22610. }
  22611. inSight = true; break;
  22612. }else{
  22613. overlay.noBlock = true
  22614. }
  22615. if(m.getPos2d(vertex, this.camera, $("#player")[0]).inSight){
  22616. inSight = true; break;
  22617. }
  22618. }
  22619. }
  22620. overlay.inSight = inSight
  22621. if(!inSight)overlay.plane.material.map.image.pause()
  22622. else overlay.plane.material.map.image.play()//maybe fail
  22623. }
  22624. })
  22625. lastMode = mode, lastPano = pano
  22626. }
  22627. }() */
  22628. n.prototype.updatePersistentZooming = function(e) {
  22629. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e)
  22630. }
  22631. ,
  22632. n.prototype.updateControlLocks = function() {
  22633. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[u.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  22634. }
  22635. ,
  22636. n.prototype.updatePanoRenderer = function() {
  22637. var e = new r.Vector3;
  22638. return function(t) {
  22639. var i = this.nextPano || this.currentPano;
  22640. this.panoRenderer.hasQueuedTiles() && i && (e.copy(d.FORWARD),
  22641. this.getDirection(e),
  22642. this.panoRenderer.updateDirection(e))
  22643. }
  22644. }(),
  22645. n.prototype.cleanupInactivePanos = function() {
  22646. var e = []
  22647. , t = [];
  22648. return function() {
  22649. e.length = 0,
  22650. e.push(this.currentPano),
  22651. this.nextPano && e.push(this.nextPano),
  22652. t.length = 0;
  22653. for (var i = 0; i < this.panoRenderer.activePanos.length; i++)
  22654. t.push(this.panoRenderer.activePanos[i]);
  22655. for (var n = 0; n < t.length; n++) {
  22656. for (var r = t[n], o = !0, a = 0; a < e.length; a++)
  22657. r.id === e[a].id && (o = !1);
  22658. o && r.exit()
  22659. }
  22660. }
  22661. }(),
  22662. n.prototype.updatePreRendering = function() {
  22663. var e = {};
  22664. return function(t) {
  22665. if (1 === f.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  22666. var i = this.nextPano || this.currentPano;
  22667. if (i && t && t.length > 1) {
  22668. var n = t.findIndex(function(e) {
  22669. if (e.id === i.id)
  22670. return !0
  22671. });
  22672. if (n >= 0 && n + 1 < t.length) {
  22673. var r = t[n + 1];
  22674. r.isLoaded(this.basePanoSize) || e[r.id] || (window.setTimeout(function(t) {
  22675. this.checkAndWaitForPanoLoad(t, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  22676. window.setTimeout(function(t) {
  22677. e[t.id] = !1
  22678. }
  22679. .bind(this, t), f.tiling.panoPreRenderRepeatDelay)
  22680. }
  22681. .bind(this, r), f.tiling.panoPreRenderDelay),
  22682. e[r.id] = !0)
  22683. }
  22684. }
  22685. }
  22686. }
  22687. }(),
  22688. n.prototype.enablePreRendering = function() {
  22689. this.preRenderingEnabled = !0
  22690. }
  22691. ,
  22692. n.prototype.disablePreRendering = function() {
  22693. this.preRenderingEnabled = !1,
  22694. this.cleanupInactivePanos()
  22695. }
  22696. ,
  22697. n.prototype.updateTileDownloader = function() {
  22698. var e = new r.Vector3;
  22699. return function(t) {
  22700. var i = this.nextPano || this.currentPano;
  22701. i && (e.copy(d.FORWARD),
  22702. this.getDirection(e),
  22703. this.tileDownloader.tilePrioritizer.updateCriteria(i, this.position, e, t.length > 0 ? t : null),
  22704. this.tileDownloader.processPriorityQueue = !0)
  22705. }
  22706. }(),
  22707. n.prototype.updateFromControls = function(e) {
  22708. null !== e && void 0 !== e || (e = 0),
  22709. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  22710. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  22711. this.position.copy(this.cameraControls.activeControl.camera.position),
  22712. this.target.copy(this.cameraControls.activeControl.target),
  22713. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  22714. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  22715. this.camera.position.copy(this.position),
  22716. this.camera.quaternion.copy(this.quaternion),
  22717. this.camera.updateMatrix(),
  22718. this.camera.updateMatrixWorld()
  22719. }
  22720. ,
  22721. n.prototype.hasChanged = function(e) {
  22722. /* if (!this.previousState)
  22723. return this.previousState = {
  22724. allFloorsVisible: this.model.allFloorsVisible,
  22725. position: this.position.clone(),
  22726. quaternion: this.quaternion.clone(),
  22727. mouse: this.mouse.clone(),
  22728. labelScaleFactor: this.getLabelScaleFactor(),
  22729. currentFloor: this.model.currentFloor,
  22730. projectionMatrix: this.camera.projectionMatrix.clone(),
  22731. worldMatrix: this.camera.matrixWorld.clone(),
  22732. mode: this.mode,
  22733. modelPosition: this.model.position.clone(),
  22734. modelCenter: this.model.center.clone(),
  22735. zoomLevel: this.zoomLevel
  22736. },
  22737. !0;
  22738. 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;
  22739. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  22740. e.moved = !this.position.equals(this.previousState.position),
  22741. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  22742. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  22743. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  22744. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  22745. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  22746. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  22747. e.modeChanged = this.mode !== this.previousState.mode,
  22748. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  22749. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  22750. e.nextPanoActive = null !== this.nextPano,
  22751. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  22752. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  22753. this.previousState.position.copy(this.position),
  22754. this.previousState.quaternion.copy(this.quaternion),
  22755. this.previousState.mouse.copy(this.mouse),
  22756. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  22757. this.previousState.currentFloor = this.model.currentFloor,
  22758. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  22759. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  22760. this.previousState.mode = this.mode,
  22761. this.previousState.modelPosition.copy(this.model.position),
  22762. this.previousState.modelCenter.copy(this.model.center),
  22763. this.previousState.zoomLevel = this.zoomLevel,
  22764. !t */
  22765. if (!this.previousState)
  22766. {
  22767. this.previousState = {
  22768. allFloorsVisible: this.model.allFloorsVisible,
  22769. position: this.position.clone(),
  22770. quaternion: this.quaternion.clone(),
  22771. mouse: this.mouse.clone(),
  22772. //labelScaleFactor: this.getLabelScaleFactor(),
  22773. currentFloor: this.model.currentFloor,
  22774. projectionMatrix: this.camera.projectionMatrix.clone(),
  22775. worldMatrix: this.camera.matrixWorld.clone(),
  22776. mode: this.mode,
  22777. modelPosition: this.model.position.clone(),
  22778. modelCenter: this.model.center.clone(),
  22779. zoomLevel: this.zoomLevel
  22780. };
  22781. return !0;
  22782. }
  22783. //许钟文改 分成相机是否改变cameraChanged 和其他
  22784. var a = this.position.equals(this.previousState.position) && this.quaternion.equals(this.previousState.quaternion)&& this.camera.matrixWorld.equals(this.previousState.worldMatrix) && this.camera.projectionMatrix.equals(this.previousState.projectionMatrix) && this.mode === this.previousState.mode && this.zoomLevel === this.previousState.zoomLevel && this.model.center.equals(this.previousState.modelCenter) && this.model.position.equals(this.previousState.modelPosition)
  22785. var t = a && this.mouse.equals(this.previousState.mouse) && this.model.allFloorsVisible === this.previousState.allFloorsVisible /* && this.getLabelScaleFactor() === this.previousState.labelScaleFactor */ && this.model.currentFloor === this.previousState.currentFloor && null === this.nextPano ;
  22786. e.cameraChanged = !a;
  22787. /* if(!t){//主要判断相机是否旋转
  22788. e.cameraChanged2 = !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 3) || !MathLight.closeTo(this.position, this.previousState.position, 4)
  22789. }else e.cameraChanged2 = false */
  22790. e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  22791. e.moved = !this.position.equals(this.previousState.position),
  22792. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  22793. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  22794. // e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  22795. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  22796. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  22797. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  22798. e.modeChanged = this.mode !== this.previousState.mode,
  22799. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  22800. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  22801. e.nextPanoActive = null !== this.nextPano,
  22802. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  22803. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  22804. this.previousState.position.copy(this.position),
  22805. this.previousState.quaternion.copy(this.quaternion),
  22806. this.previousState.mouse.copy(this.mouse),
  22807. //this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  22808. this.previousState.currentFloor = this.model.currentFloor,
  22809. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  22810. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  22811. this.previousState.mode = this.mode,
  22812. this.previousState.modelPosition.copy(this.model.position),
  22813. this.previousState.modelCenter.copy(this.model.center),
  22814. this.previousState.zoomLevel = this.zoomLevel;
  22815. //console.log("cameraChanged2 "+ e.cameraChanged2 + ", mouseMoved "+e.mouseMoved)
  22816. return !t
  22817. }
  22818. ,
  22819. n.prototype.updateIntersect = function() {
  22820. var e = this.flying || this.isWarping()
  22821. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  22822. , i = y.getById(V.LookTransition)
  22823. , n = !(e || t || this.isTouchEvent || i.length && i[0].running);
  22824. //this.tagManager.intersecttag(this.mouse, n, this.camera) || (this.intersect = this.getMouseIntersect(),//--MP
  22825. this.intersect = this.getMouseIntersect(); //xzw change
  22826. this.intersect && this.updateClosestPano(this.intersect),
  22827. // this.intersect && console.log(this.intersect.point),
  22828. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  22829. f.navigation.panoScores && !f.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  22830. }
  22831. ,
  22832. n.prototype.checkHotClick = function() {
  22833. if(this.intersectHot){
  22834. this.intersectHot.examine(this)
  22835. /* g_touraudio.pause();
  22836. g_bgaudio = false;
  22837. document.getElementById("bgaudio").pause();
  22838. var sWidth = document.body.scrollWidth;
  22839. var sHeight = document.body.scrollHeight;
  22840. var pop1 = document.getElementById('popup');
  22841. pop1.style.display = "block";
  22842. var myElement = document.createElement("iframe");
  22843. myElement.src = g_HotMeshes[i].hotLink;
  22844. myElement.id = "id1";
  22845. myElement.allowTransparency = "true";
  22846. myElement.style.width = "100%";
  22847. myElement.style.height = "100%";
  22848. myElement.scrolling = "no";
  22849. var element=document.getElementById("id1");
  22850. if (typeof(element)== "undefined" || element == null){
  22851. document.getElementById("popup").appendChild(myElement);
  22852. }
  22853. var oClose = document.getElementById("closepop");
  22854. oClose.onclick = function() {
  22855. pop1.style.display = "none";
  22856. document.getElementById("popup").removeChild(document.getElementById("id1"));
  22857. $("#popup iframe:last").remove();
  22858. document.getElementById("bgaudio").play();
  22859. } */
  22860. return true;
  22861. }
  22862. },
  22863. n.prototype.getMouseDirection = function(e) {
  22864. e = e || this.mouse;
  22865. var t = new r.Vector3(e.x,e.y,-1).unproject(this.camera)
  22866. , i = new r.Vector3(e.x,e.y,1).unproject(this.camera);
  22867. return i.sub(t).normalize()
  22868. }
  22869. ,
  22870. n.prototype.hoverOverlay = function(mesh){
  22871. if(!mesh){
  22872. this.hoveringPlane = null;
  22873. $("#player").css("cursor",this.currentCursor || "" );
  22874. }else{
  22875. var overlay = mesh.parent;
  22876. $("#player").css("cursor","pointer");
  22877. this.hoveringPlane = overlay;
  22878. return true;
  22879. }
  22880. },
  22881. n.prototype.clickOverlay = function(overlay){
  22882. if(this.openOverlay && !overlay)return;
  22883. if(overlay == window.videoPlane){
  22884. if(overlay.material.map.image.paused) playVideo(true)
  22885. else playVideo(false)
  22886. return
  22887. }
  22888. var plane = overlay.plane;
  22889. if(overlay.overlayType == "video"){
  22890. /* if(plane.material.map.image.paused) plane.material.map.image.play()
  22891. else plane.material.map.image.pause() */
  22892. overlay.switchPlay(!!overlay.pausedByUser)
  22893. }
  22894. /* if(window.EditOverlay &&EditOverlay.editing){
  22895. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  22896. $('#overlayProp').removeClass('atRight').removeClass('hide')
  22897. EditOverlay.endAddPlane();
  22898. EditOverlay.updateOverlayPanel(overlay)
  22899. EditOverlay.controlSelectOverlay(overlay)
  22900. return;
  22901. } */
  22902. },
  22903. n.prototype.getMouseIntersect = function(e, t) {//xzw change
  22904. e = e || this.mouse.clone(),
  22905. t = t || this.model.floors.reduce(function(e, t) {
  22906. return t.hidden ? e : e.concat(t.collider.children)
  22907. }, this.mode === u.PANORAMA ? this.panoMarkers : []);
  22908. for(var i in this.model.hots){
  22909. t.push(this.model.hots[i].mesh);
  22910. }
  22911. window.videoPlane && t.push(window.videoPlane)
  22912. this.overlayGroup && (t = t.concat(this.overlayGroup.children.filter(e=>e.overlayType == "video")));
  22913. var i = new r.Vector3(e.x,e.y,-1).unproject(this.camera);
  22914. this.raycaster.set(i, this.getMouseDirection(e));
  22915. var n = this.raycaster.intersectObjects(t, true);//add true
  22916. // n[0] && console.log(n[0].point);
  22917. if(g_HotStatus=="add"){
  22918. var points = this.raycaster.intersectObjects(window.player.model.chunks);
  22919. console.log(points[0]);
  22920. points.length >= 1? ($('#player').css('cursor', 'cell'),window.hotPointPos = points[0].point): ($('#player').css('cursor', 'not-allowed'), window.hotPointsPos = false)
  22921. }
  22922. this.intersectHot && this.intersectHot.hideTitle()
  22923. if (0 === n.length){
  22924. this.intersectHot = null; //add
  22925. if(g_HotStatus!="add") $("#player").css("cursor","");
  22926. return null;
  22927. }
  22928. var o = n[0];
  22929. if(o.object.type == "hotSprite"){ //add
  22930. this.intersectHot = o.object.belongHot;
  22931. this.intersectHot.showTitle()
  22932. this.intersectHot.actionType == 'noAction' || $("#player").css("cursor","pointer");
  22933. return;
  22934. }
  22935. this.intersectHot = null;
  22936. if(o.object == window.videoPlane){
  22937. this.hoveringPlane = window.videoPlane;
  22938. $("#player").css("cursor","pointer");
  22939. return
  22940. }
  22941. var intersect = this.hoverOverlay(this.overlayGroup && o && o.object.parent.parent == this.overlayGroup && o.object)
  22942. if(!intersect && g_HotStatus!="add") $("#player").css("cursor","");
  22943. if (o.face) {
  22944. o.normal = o.face.normal.applyQuaternion(o.object.quaternion);
  22945. var a = this.position.clone().sub(o.point);
  22946. a.dot(o.normal) < 0 && o.normal.negate(),
  22947. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  22948. o.horizontal = o.normal.y > .8
  22949. }
  22950. // console.log(o.point);
  22951. return o
  22952. }
  22953. ,
  22954. n.prototype.updateClosestPano = function(e) {
  22955. var t = [s.filters.isPanoAligned()];
  22956. if (this.mode === u.PANORAMA) {
  22957. if (!this.currentPano)
  22958. return;
  22959. t.push(s.filters.not(this.currentPano)),
  22960. t.push(s.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  22961. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  22962. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  22963. t.push(s.filters.isNotBehindNormal(e.point, e.normal))
  22964. } else{
  22965. t.push((pano)=>{ // add
  22966. return this.checkHasNeighbor(pano)
  22967. })
  22968. t.push(s.filters.isOnVisibleFloor()),
  22969. this.mode !== u.FLOORPLAN && t.push(s.filters.inDirection(this.position, this.getDirection(), .25));
  22970. }
  22971. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)]);
  22972. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  22973. this.emit(w.ClosestPanoChanging, this.closestPano, i, this.mode),
  22974. this.closestPano = i) : this.isPanoHover = !1
  22975. }
  22976. ,
  22977. n.prototype.dollhouseMode = function(e, t) {
  22978. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE),
  22979. this.mode = u.DOLLHOUSE,
  22980. this.cameraControls.controls[u.DOLLHOUSE].reset();
  22981. var i = new r.Vector3(this.model.center.x,0,this.model.center.z)
  22982. , n = new r.Vector3(15,10,15);
  22983. if (e && t) {
  22984. var o = d.FORWARD.clone().applyQuaternion(t)
  22985. , a = this.model.center.clone().sub(e)
  22986. , s = a.dot(o);
  22987. s > 0 ? (i = o.clone().multiplyScalar(s).add(e),
  22988. n.copy(e)) : F.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  22989. }
  22990. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  22991. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  22992. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  22993. this.updateFromControls(),
  22994. this.model.alpha = 1,
  22995. this.model.skybox.material.uniforms.opacity.value = 0
  22996. }
  22997. ,
  22998. n.prototype.insideMode = function(e, t) {
  22999. var i = $.Deferred()
  23000. , n = t || null;
  23001. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  23002. var r = [s.filters.isPanoAligned()];
  23003. this.model.currentFloor && r.push(s.filters.atFloor(this.model.currentFloor)),
  23004. e = e || this.currentPano || this.model.panos.find(r, [s.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  23005. this.flyToNewMode({
  23006. mode: u.PANORAMA,
  23007. pano: e,
  23008. callback: n
  23009. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  23010. } else {
  23011. var o = this.mode === u.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  23012. i.reject(o)
  23013. }
  23014. return i.promise()
  23015. }
  23016. ,
  23017. n.prototype.fitDollhouse = function(e, t, i) {//许钟文改 飞入前寻找和初始视角最合适的位置
  23018. //if(urlHasValue('oldEntry')){
  23019. //搬自一代。
  23020. var maxY = this.model.boundingBox.max.y;
  23021. var n = d.FORWARD.clone().applyQuaternion(i)
  23022. , i = n.clone().add(e);
  23023. this.cameraControls.activeControl.target.copy(i),
  23024. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  23025. //return;
  23026. /* //this.camera.position.copy(this.model.center);
  23027. //this.camera.updateMatrixWorld()
  23028. this.switchCameraMode("dollhouse", i) */
  23029. //}//下面是二代代码,看不太懂。因为有的场景在靠近一端的某个方向截取的初始视角会甩镜头,也就是不是下去之后的方向
  23030. //直接用一代的这个 效果和二代几乎一样,且不会甩
  23031. /* var n = d.FORWARD.clone().applyQuaternion(i);
  23032. this.cameraControls.activeControl.target.copy(n).add(e);
  23033. var o = d.RIGHT.clone().applyQuaternion(i)
  23034. , a = d.UP.clone()
  23035. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  23036. , l = this.model.boundingBox.max.clone()
  23037. , c = this.model.boundingBox.min.clone()
  23038. , h = [new r.Vector3(l.x,0,l.z).sub(e), new r.Vector3(l.x,0,c.z).sub(e), new r.Vector3(c.x,0,l.z).sub(e), new r.Vector3(c.x,0,c.z).sub(e)]
  23039. , u = 0
  23040. , p = 0
  23041. , g = 0;
  23042. h.forEach(function(e, t, i) {
  23043. var n = Math.abs(e.dot(o))
  23044. , r = e.dot(s);
  23045. n > u && (u = n,
  23046. p = r),
  23047. r > g && (g = r)
  23048. });
  23049. var m = Math.max(Math.abs(new r.Vector3(0,l.y,0).sub(e).dot(a)), Math.abs(new r.Vector3(0,c.y,0).sub(e).dot(a)))
  23050. , v = s.clone().multiplyScalar(p).add(t)
  23051. , A = s.clone().multiplyScalar(g).add(t);
  23052. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180));
  23053. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180));
  23054. p = Math.max(p, 10),
  23055. g = Math.max(g, 10);
  23056. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  23057. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  23058. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1;
  23059. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p))
  23060. : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  23061. */
  23062. }
  23063. ,
  23064. n.prototype.floorplanMode = function(e, t, i) {
  23065. this.mode = u.FLOORPLAN;
  23066. var n = this.cameraControls.controls[u.FLOORPLAN];
  23067. n.reset();
  23068. var r = e ? e : this.model.center;
  23069. if (n.target.copy(r).setY(0),
  23070. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  23071. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  23072. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  23073. t) {
  23074. var o = d.LEFT.clone().applyQuaternion(t);
  23075. n.rotateLeft(-Math.atan2(o.x, o.z))
  23076. } else
  23077. n.rotateToView(this.model.size, this.getDirection());
  23078. n.update(0)
  23079. }
  23080. ,
  23081. n.prototype.nonInterruptingFlyToPano = function(e, t) {
  23082. return e.skipWarpingCheck = !0,
  23083. this.flyToPano(e, t)
  23084. }
  23085. ,
  23086. n.prototype.updateMarkerVisi = function() {//加
  23087. if(this.mode != "panorama")return;
  23088. this.model.panos.list.forEach((pano)=>{
  23089. if(!pano.marker)return;
  23090. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  23091. })
  23092. }
  23093. ,
  23094. n.prototype.updateHotVisible = function(pano){
  23095. var hots = this.model.hots;
  23096. pano = pano || this.currentPano;
  23097. for (var index in hots){
  23098. var visible;
  23099. if(this.mode != "panorama"){
  23100. visible = true;
  23101. }else{
  23102. //hots[index].mesh.material.depthTest = false;
  23103. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  23104. }
  23105. hots[index].mesh.visible = visible;
  23106. }
  23107. }
  23108. n.prototype.flyToPano = function(e, t) {
  23109. var i = e.pano
  23110. , aim = e.lookAtPoint
  23111. , aimQua = e.quaternion //ADD
  23112. , o = e.duration
  23113. , a = e.aimDuration
  23114. , s = e.maxDistanceOverride
  23115. , l = e.skipWarpingCheck
  23116. , c = e.constantMoveSpeed
  23117. , h = null
  23118. , p = null
  23119. if (aim){
  23120. var _ = (new r.Matrix4).lookAt(i.position, aim, d.UP)
  23121. aimQua = (new r.Quaternion).setFromRotationMatrix(_)
  23122. }
  23123. else aimQua = aimQua
  23124. var zoomLevel = e.zoomLevel || 1 //add
  23125. if(this.flying) return t && t(e)
  23126. window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(i);
  23127. if (this.isWarping() && !l && (this.path.activeTransType === x.BLACK || this.path.activeTransType === x.STD))
  23128. return F.warn("Player.flyToPano() -> Cannot fly when warping"),
  23129. t && t(),
  23130. !1;
  23131. if (this.updateLastView(),
  23132. this.mode !== u.PANORAMA) {
  23133. var m;
  23134. void this.flyToNewMode({
  23135. mode: u.PANORAMA,
  23136. pano: i,
  23137. duration: o,
  23138. quaternion: aimQua ,
  23139. callback: t
  23140. })
  23141. }
  23142. if (!i || (h = g.deepExtend(e),
  23143. p = function() {
  23144. N.delayOneFrame(function() {
  23145. this.flyToPano(h, t)
  23146. }
  23147. .bind(this))
  23148. }
  23149. .bind(this),
  23150. !this.checkAndWaitForPanoLoad(i, "high", "low", this.basePanoSize, p))) {
  23151. var C = function(e) {
  23152. t && t(e)
  23153. }
  23154. .bind(this);
  23155. this.currentPano || (this.currentPano = i,
  23156. this.path.placeCpm(),
  23157. this.path.fadeOutCpm(f.path.fadeOutTime),
  23158. this.spider.draw());
  23159. var I = o;
  23160. if ("number" != typeof o) {
  23161. var E = s || f.transition.flytimeMaxDistanceThreshold;
  23162. I = Math.min(this.currentPano.position.distanceTo(i.position), E) * f.transition.flytimeDistanceMultiplier + f.transition.flyTime
  23163. }
  23164. if (f.transition.flySpeed > .01 && (I = 1e3 * this.currentPano.position.distanceTo(i.position) / f.transition.flySpeed),
  23165. zoomLevel !== this.zoomLevel)
  23166. switch (f.zoom.transitionStyle) {
  23167. case 1:
  23168. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? I / 2 : I); //改
  23169. break;
  23170. case 2:
  23171. return h = g.deepExtend(e),
  23172. p = this.flyToPano.bind(this, h, t),
  23173. void this.smoothZoomFovTo(null, zoomLevel, f.zoom.restoreTime * (this.zoomLevel - 1), p)
  23174. }
  23175. if (aimQua) {
  23176. y.cancelById(V.LookTransition),
  23177. I *= f.transition.aimSlowFactor;
  23178. var b = this.cameraControls.activeControl.camera.quaternion.clone()
  23179. , S = b.clone()
  23180. , M = new r.Vector3;
  23181. if (i === this.currentPano) {
  23182. var R = d.FORWARD.clone().applyQuaternion(b)
  23183. , P = d.FORWARD.clone().applyQuaternion(aimQua)
  23184. , O = R.angleTo(P);
  23185. return void 0 !== a && null !== a || (a = 1 * Math.sqrt(O) / f.tags.navigate.rotateSpeedFactor * 1e3),
  23186. void y.start(function(e) {
  23187. S.copy(b),
  23188. v.quaternion(S, aimQua)(e),
  23189. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  23190. this.cameraControls.activeControl.lookAt(M)
  23191. }
  23192. .bind(this), a, C, 0, A[f.transition.movementEasing], null, V.LookTransition)
  23193. }
  23194. }
  23195. if (i === this.currentPano || this.flying)
  23196. return void C();
  23197. this.flying = !0;
  23198. var L = this.position.clone()
  23199. , D = this.currentPano;
  23200. F.debug("Flying to pano ", i.position),
  23201. this.emit(w.PanoChosen, this.currentPano, i),
  23202. this.emit(w.FlyingStarted, i.position, L, i, D)
  23203. //---------before fly--------------- add
  23204. this.updateHotVisible(i); //更新热点显示
  23205. this.transitionPos({type:"beforeFlytopano", pano:i, dur:I})//add
  23206. Overlay.updateVisibles([this.currentPano, i])
  23207. //地标变化
  23208. if(this.model.floorLogos){
  23209. this.model.changefloorLogoOpa({index:0, opa:0, dur: p, delay:0.7})//this.model.floorLogoFade(0, _duration*0.5, 0.7);
  23210. this.model.floorLogos[1].position.copy(i.floorPosition.clone().sub(this.model.position));
  23211. //this.model.adjustfloorLogoHeight();
  23212. this.model.floorLogos[1].material.opacity = 0;//uniforms.opacity.value = 0;
  23213. this.model.floorLogos[1].visible = true;
  23214. this.model.changefloorLogoOpa({index:1, opa:1, dur: 250})//this.model.floorLogoShow(1,250);
  23215. }
  23216. //=======================================
  23217. aimQua && y.start(function(e) {
  23218. S.copy(b),
  23219. v.quaternion(S, aimQua)(e),
  23220. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  23221. this.cameraControls.activeControl.lookAt(M)
  23222. }
  23223. .bind(this), I, null, 0, A[f.transition.movementEasing], null, V.LookTransition);
  23224. var B = c ? null : A[f.transition.movementEasing];
  23225. this.nextPano = i
  23226. //===========================
  23227. updateVideo({type:"beforeFlytopano", pano:i, dur:I})//add
  23228. //===========================
  23229. y.start(v.uniform(this.model.skybox, "progress", 1), I, null, 0, A[f.transition.blendEasing], "skyFly", V.FlyToPano),
  23230. y.start(v.allUniforms(this.model.chunks, "progress", 1), I, null, 0, A[f.transition.blendEasing], "chunkFly", V.FlyToPano),
  23231. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position), I, function(e) {
  23232. this.flying = !1,
  23233. this.currentPano !== i && this.currentPano.exit(),
  23234. i.enter(),
  23235. this.currentPano = i,
  23236. this.nextPano = null,
  23237. this.path.placeCpm(),
  23238. this.path.fadeOutCpm(f.path.fadeOutTime),
  23239. this.spider.draw(),
  23240. this.emit(w.FlyingEnded, i.position, L, i, D),
  23241. this.updateMarkerVisi(),//add
  23242. C(e)
  23243. //add:
  23244. if(this.mode == "panorama" ){
  23245. if(this.model.floorLogos){
  23246. this.model.floorLogos[0].position.copy(this.model.floorLogos[1].position)
  23247. //this.model.adjustfloorLogoHeight()
  23248. this.model.changefloorLogoOpa({index:0,opa:1,dur:0});//this.model.floorLogos[0].material.uniforms.opacity.value = 1;
  23249. this.model.floorLogos[1].visible = false;
  23250. }
  23251. updateVideo({type:"flyDone", pano:i})//add
  23252. Overlay.updateVisibles([this.currentPano])//add
  23253. }
  23254. }
  23255. .bind(this), 0, B, "camFly", V.FlyToPano)
  23256. }
  23257. }
  23258. ,
  23259. window._transitionPosId = 9999
  23260. n.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  23261. y.cancelById(_transitionPosId)
  23262. var begin = function(object, pos, qua, scale){
  23263. if(pos){
  23264. if(!same(object.position, pos, 0.01)){
  23265. y.start(v.vector(object.position, pos), o.dur, (e)=>{
  23266. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  23267. }
  23268. if(qua && !same(object.quaternion, qua, 1e-6)){
  23269. y.start(v.quaternion(object.quaternion, qua), o.dur, (e)=>{
  23270. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  23271. }
  23272. if(scale && !same(object.scale, scale, 0.001)){
  23273. y.start(v.vector(object.scale, scale), o.dur, (e)=>{
  23274. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  23275. }
  23276. }
  23277. }
  23278. var same = function(vec1, vec2, diff){
  23279. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  23280. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  23281. return s
  23282. }
  23283. var sid = o.pano != void 0 ? o.pano.id : "outside";
  23284. this.overlayGroup.children.forEach(overlay=>{
  23285. var panoData = overlay.transformAtPanos[sid]
  23286. var useCustom = !panoData
  23287. //if(overlay.usingTransformData || !useCustom){
  23288. var pos = useCustom ? overlay.posCustom : panoData.pos;
  23289. var qua = useCustom ? overlay.quaCustom : panoData.qua;
  23290. var scale = useCustom ? overlay.getScaleBySize(overlay.widthCustom, overlay.heightCustom) :
  23291. overlay.getScaleBySize(panoData.width , panoData.height)
  23292. scale = new THREE.Vector3(scale.x, scale.y, overlay.scale.z)
  23293. begin(overlay, pos, qua, scale )
  23294. //}
  23295. overlay.usingTransformData = !useCustom
  23296. })
  23297. for(let i in this.model.hots){//是否判断visible?
  23298. var hot = this.model.hots[i];
  23299. var panoData = hot.transformAtPanos[sid];
  23300. var useCustom = !panoData
  23301. //if(hot.usingTransformData || !useCustom){
  23302. var pos = useCustom ? hot.position : panoData.pos;
  23303. var qua = hot.isSprite ? null : (useCustom ? hot.quaternion : panoData.qua);
  23304. begin(hot.mesh, pos, qua )
  23305. //}
  23306. hot.usingTransformData = !useCustom;
  23307. }
  23308. }
  23309. window._tranOutsideFocus = 4399
  23310. n.prototype.focusPoint = function(o={}){//当在外时,聚焦相机到这一点
  23311. console.log("focusPoint")
  23312. if(this.mode == "floorplan"){
  23313. var modelSize = o.modelSize || new THREE.Vector3(8,8,8);//可视范围
  23314. var control = this.cameraControls.controls.floorplan;
  23315. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  23316. var currentScale = control.absoluteScale;
  23317. var currentTarget = control.target.clone()
  23318. y.cancelById(window._tranOutsideFocus, true);
  23319. y.start(function(progress){
  23320. control.absoluteScale = absoluteScale*progress + currentScale*(1-progress);
  23321. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  23322. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  23323. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  23324. }else if(player.mode == "dollhouse"){
  23325. var control = player.cameraControls.controls.dollhouse;
  23326. var radius = o.radius || 8;
  23327. var currentTarget = control.target.clone()
  23328. var dir = control.offset.clone().normalize()
  23329. var currentRadius = control.offset.length();
  23330. y.cancelById(window._tranOutsideFocus, true);
  23331. y.start(function(progress){
  23332. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  23333. let radius_ = radius*progress+currentRadius*(1-progress)
  23334. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  23335. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  23336. }else if(this.mode == 'panorama'){
  23337. this.flyToPano({
  23338. lookAtPoint: o.aim.clone() ,
  23339. pano: this.currentPano,
  23340. aimDuration: o.dur || 600
  23341. })
  23342. }
  23343. }
  23344. n.prototype.fastForwardActivePanoFlight = function(e) {
  23345. e = e || f.transition.fastForwardFactor / 10 * 4 + 1,
  23346. y.adjustSpeed(V.FlyToPano, e),
  23347. y.adjustSpeed(V.LookTransition, e)
  23348. }
  23349. ,
  23350. n.prototype.flyToPanoClosestToMouse = function() {
  23351. if (Date.now() - this.mouseLastMoveTime > 50 && (this.intersect = this.getMouseIntersect(),
  23352. this.intersect && this.updateClosestPano(this.intersect)),
  23353. this.closestPano)
  23354. return this.flyToPano({
  23355. pano: this.closestPano
  23356. });
  23357. var e = this.getMouseDirection();
  23358. this.flyDirection(e) || this.flyToPano({
  23359. pano: this.currentPano
  23360. })
  23361. }
  23362. ,
  23363. n.prototype.flyLocalDirection = function(e) {
  23364. var t = this.getDirection(e)
  23365. , i = 1 === e.z ? .4 : .75
  23366. , n = 1 === Math.abs(e.x);
  23367. return this.flyDirection(t, i, n)
  23368. }
  23369. ,
  23370. n.prototype.flyDirection = function(e, t, i) {
  23371. this.closePopup();//xzw add
  23372. var n = $.Deferred();
  23373. this.history.invalidate();
  23374. var r = this.closestPanoInDirection(e, t, i);
  23375. return r ? this.flyToPano({
  23376. pano: r
  23377. }, n.resolve.bind(n, !0)) : (this.bump(e),
  23378. n.resolve(!1)),
  23379. n.promise()
  23380. }
  23381. ,
  23382. n.prototype.closestPanoInDirection = function(e, t, i) {
  23383. return this.rankedPanoInDirection(0, e, t, i)
  23384. }
  23385. ,
  23386. n.prototype.rankedPanoInDirection = function() {
  23387. var e = {
  23388. pano: null,
  23389. candidates: []
  23390. };
  23391. return function(t, i, n, r) {
  23392. t || (t = 0),
  23393. n = void 0 !== n ? n : .75;
  23394. var o = r ? "angle" : "direction";
  23395. return this.model.panos.findRankedByScore(t, [s.filters.isPanoAligned(), s.filters.inPanoDirection(this.position, i, n), s.filters.isNeighbourPanoTo(this.currentPano), s.filters.not(this.currentPano)], [s.scoreFunctions.distanceSquared(this.currentPano), s.scoreFunctions[o](this.position, i)], e),
  23396. this.cachedPanoCandidates = e.candidates,
  23397. e.pano
  23398. }
  23399. }(),
  23400. n.prototype.bump = function(e) {
  23401. if (this.mode === u.PANORAMA && !this.flying && !this.isWarping()) {
  23402. var t, i, n, r = f.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e), s = Math.abs(a) > .5;
  23403. if (s)
  23404. t = function() {
  23405. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", a > 0 ? 1.04 : .96), o, i, 0, A.easeInOutSine, "bumpZStart")
  23406. }
  23407. .bind(this),
  23408. i = function() {
  23409. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", 1), 5 * o, n, 0, A.easeInOutSine, "bumpZRelax")
  23410. }
  23411. .bind(this);
  23412. else {
  23413. var l = this.camera.position.clone()
  23414. , c = e.clone();
  23415. this.raycaster.set(l, c);
  23416. var h = this.model.floors.reduce(function(e, t) {
  23417. return e.concat(t.collider.children)
  23418. }, [])
  23419. , d = this.raycaster.intersectObjects(h)
  23420. , p = d.length > 0 ? d[0].distance / 25 : .04
  23421. , g = l.clone().add(c.multiplyScalar(p));
  23422. t = function() {
  23423. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, g), o, i, 0, A.easeInOutSine, "bumpTStart")
  23424. }
  23425. .bind(this),
  23426. i = function() {
  23427. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, l), 5 * o, n, 0, A.easeInOutSine, "bumpTRelax")
  23428. }
  23429. .bind(this)
  23430. }
  23431. n = function() {
  23432. this.flying = !1
  23433. }
  23434. .bind(this),
  23435. this.flying = !0,
  23436. t()
  23437. }
  23438. }
  23439. ,
  23440. n.prototype.changeFloor = function(e) {
  23441. if (!this.is360View(this.mode, this.currentPano))
  23442. if (this.mode === u.PANORAMA) {
  23443. var t = this.history.reversePano(e);
  23444. t && t.isAligned() ? this.flyToPano({
  23445. pano: t
  23446. }) : this.changeFloorByScore(e)
  23447. } else
  23448. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  23449. }
  23450. ,
  23451. n.prototype.changeFloorByScore = function() {
  23452. var e = {
  23453. pano: null,
  23454. candidates: []
  23455. };
  23456. return function(t) {
  23457. var i = this.model.nextFloor(t);
  23458. return i ? (this.model.panos.lowestByScore([s.filters.atFloor(i), s.filters.isPanoAligned()], [s.scoreFunctions.distance(this.currentPano), s.scoreFunctions.direction(this.position, new r.Vector3(0,t,0)), s.scoreFunctions.penalizeHeightDifferenceUnder(this.position, .5)], e),
  23459. void (e.pano ? (this.cachedPanoCandidates = e.candidates,
  23460. this.history.push(t, this.currentPano),
  23461. this.flyToPano({
  23462. pano: e.pano
  23463. })) : F.warn("No pano found on selected floor, not moving there."))) : void F.debug("player.changeFloor(" + t + "): no such floor")
  23464. }
  23465. }(),
  23466. n.prototype.gotoFloor = function(e) {
  23467. var t = e - this.model.currentFloor.floorIndex;
  23468. this.changeFloor(t)
  23469. }
  23470. ,
  23471. n.prototype.getDirection = function(e) {
  23472. return e = e ? e : (new r.Vector3).copy(d.FORWARD),
  23473. e.applyQuaternion(this.camera.quaternion)
  23474. }
  23475. ,
  23476. n.prototype.flyToSameMode = function(e, t, i, n, o) {
  23477. if (o = o || $.Deferred(),
  23478. this.mode === u.TRANSITIONING)
  23479. return F.warn("should not be transitioning here"),
  23480. n && n(!1),
  23481. o.reject().promise();
  23482. var a = i || !1
  23483. , s = i ? i.position : this.position
  23484. , l = this.position.clone()
  23485. , c = this.currentPano;
  23486. if (F.debug("New pose in mode " + this.mode),
  23487. !e || (retryCallback = function() {
  23488. N.delayOneFrame(function() {
  23489. this.flyToSameMode(e, t, i, n, o)
  23490. }
  23491. .bind(this))
  23492. }
  23493. .bind(this),
  23494. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  23495. var h = function() {
  23496. this.emit(w.FlyingEnded, s, l, e, c),
  23497. n && n(!0)
  23498. }
  23499. .bind(this)
  23500. , d = f[this.mode]
  23501. , p = void 0 !== t ? t : d.transitionTime
  23502. , g = new r.Vector3
  23503. , C = new r.Vector3;
  23504. if (this.emit(w.FlyingStarted, s, l, e, c),
  23505. this.mode === u.PANORAMA)
  23506. F.warn("we should not be here for panorama views");
  23507. else if (this.mode === u.DOLLHOUSE)
  23508. if (a) {
  23509. var I = new r.Vector3(0,1,0);
  23510. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  23511. this.model.warpDestFloors(i.floorVisibility),
  23512. C.copy(i.position);
  23513. var E = new r.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  23514. , b = new r.Raycaster(C.clone(),E.clone(),0,1 / 0)
  23515. , _ = b.intersectObjects(this.model.colliders)
  23516. , T = 3;
  23517. _.length ? (g.copy(_[0].point),
  23518. T = .75 * C.distanceTo(g)) : (g.copy(E).multiplyScalar(3).add(C),
  23519. F.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  23520. var x = (new r.Matrix4).lookAt(C, g, I)
  23521. , S = (new r.Euler).setFromRotationMatrix(x, f.warp.eOrder)
  23522. , M = g.distanceTo(C)
  23523. , R = (new r.Matrix4).lookAt(this.cameraControls.cameras[u.DOLLHOUSE].position, this.cameraControls.controls[u.DOLLHOUSE].target, I)
  23524. , P = (new r.Euler).setFromRotationMatrix(R, f.warp.eOrder)
  23525. , O = this.cameraControls.cameras[u.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[u.DOLLHOUSE].target);
  23526. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(Math.min(O, T), !0);
  23527. var L = new r.Euler(S.x - P.x,S.y - P.y,S.z - P.z,f.warp.eOrder);
  23528. L.y = L.y > Math.PI ? L.y -= 2 * Math.PI : L.y < -Math.PI ? L.y += 2 * Math.PI : L.y,
  23529. this.path.burnsDir = Math.sign(L.y);
  23530. var D = new r.Euler(0,0,0,f.warp.eOrder)
  23531. , B = new r.Vector3;
  23532. y.start(v.vector(this.cameraControls.controls[u.DOLLHOUSE].target, g), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  23533. y.start(function(e, t) {
  23534. D.x = P.x + e * L.x,
  23535. D.y = P.y + e * L.y,
  23536. D.z = P.z + e * L.z;
  23537. var i = O + e * (M - O);
  23538. B.set(0, 0, i).applyEuler(D).add(this.cameraControls.controls[u.DOLLHOUSE].target),
  23539. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(B).add(this.model.position)
  23540. }
  23541. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  23542. y.start(function(e, t) {
  23543. this.cameraControls.controls[u.DOLLHOUSE].update(),
  23544. this.quaternion.copy(this.cameraControls.cameras[u.DOLLHOUSE].quaternion),
  23545. this.position.copy(this.cameraControls.cameras[u.DOLLHOUSE].position)
  23546. }
  23547. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  23548. } else
  23549. F.warn("invalid warp destination in flyToSameMode()? ignore it then");
  23550. else if (this.path.placeCpm(),
  23551. this.path.fadeInCpm(f.path.fadeInTime),
  23552. i) {
  23553. this.model.warpDestFloors(i.floorVisibility);
  23554. var U = this.cameraControls.cameras[u.FLOORPLAN]
  23555. , k = this.cameraControls.controls[u.FLOORPLAN]
  23556. , H = k.target.clone()
  23557. , G = i.position.clone().sub(H)
  23558. , z = U.position.clone().sub(k.target)
  23559. , W = z.length()
  23560. , j = new r.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  23561. , Y = Math.atan2(k.offset.x, k.offset.z)
  23562. , X = Math.atan2(j.x, j.z)
  23563. , Z = k.absoluteScale
  23564. , q = m.convertWorkshopOrthoZoom(i.orthoZoom);
  23565. y.start(function(e, t) {
  23566. k.target.copy(G).multiplyScalar(e).add(H);
  23567. var i = Y + (X - Y) * e;
  23568. k.offset.x = W * Math.sin(i),
  23569. k.offset.z = W * Math.cos(i),
  23570. U.position.copy(k.target).add(k.offset),
  23571. k.absoluteScale = Z + e * (q - Z),
  23572. k.update(),
  23573. this.quaternion.copy(U.quaternion),
  23574. this.position.copy(U.position),
  23575. this.target.copy(k.target),
  23576. this.camera.projectionMatrix.copy(U.projectionMatrix)
  23577. }
  23578. .bind(this), p, null, 0, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  23579. } else
  23580. F.info("flyToSameMode() funny floorplan view? skipping");
  23581. return y.setTimeout(function(e) {
  23582. this.mode = e,
  23583. h(),
  23584. o.resolve(!0)
  23585. }
  23586. .bind(this, this.mode), p, V.FlyToSameMode),
  23587. this.mode = u.TRANSITIONING,
  23588. o.promise()
  23589. }
  23590. }
  23591. ,
  23592. n.prototype.flyToNewMode = function(e, t) {
  23593. e = e || {};
  23594. var i = e.mode
  23595. , n = e.pano
  23596. , o = e.duration
  23597. , a = e.warpDest
  23598. , s = e.callback
  23599. , l = e.force
  23600. , c = e.quaternion;
  23601. if (t = t || $.Deferred(),
  23602. this.isWarping())
  23603. return F.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  23604. s && s(!1),
  23605. t.reject("Cannot change mode during tour transition").promise();
  23606. if (this.mode === u.TRANSITIONING)
  23607. return s && s(!1),
  23608. t.reject("Cannot change mode during mode transition").promise();
  23609. if (i === this.mode)
  23610. return l ? (this.flyToSameMode(n, o, a, s).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  23611. t.promise()) : (s && s(!1),
  23612. t.reject("Already in " + i + " mode").promise());
  23613. var h = a || !1;
  23614. F.debug("Switching mode to " + i);
  23615. var d = function() {
  23616. N.delayOneFrame(function() {
  23617. this.flyToNewMode(e, t)
  23618. }
  23619. .bind(this))
  23620. }
  23621. .bind(this);
  23622. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, d))
  23623. return t.promise();
  23624. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  23625. return F.info("Waiting for model textures to be loaded before going out to dollhouse"),
  23626. this.model.waitForLoad(this.model, function() {
  23627. return this.model.meshTexturesLoaded;
  23628. }
  23629. .bind(this)),
  23630. this.model.loadMeshTextures().done(d),
  23631. t.promise();
  23632. this.history.invalidate(),
  23633. this.updateLastView();
  23634. var p = this.mode
  23635. , C = this.cameraControls.cameras[i];
  23636. e = g.deepExtend({}, f[i], f[p + "-" + i]);
  23637. var I = void 0 !== o ? o : e.transitionTime;
  23638. this.emit(w.ModeChanging, p, i, n),
  23639. n && (this.currentPano = n),
  23640. this.switchCameraMode(i, c),
  23641. y.cancelById(V.LookTransition);
  23642. //before fly---------------------
  23643. if(this.mode == "panorama"){
  23644. if(this.model.floorLogos){
  23645. this.model.floorLogos[0].visible = false;
  23646. this.model.floorLogos[1].visible = false;
  23647. }
  23648. }
  23649. if(i == "panorama"){
  23650. updateVideo({type:"beforeFlyIn", pano:this.currentPano, dur:I})//add
  23651. this.transitionPos({type:"beforeFlyIn", pano:n, dur:I})//add
  23652. }else{
  23653. updateVideo({type:"beforeFlyOut", dur:I})//add
  23654. this.transitionPos({type:"beforeFlyOut", dur:I/2})//add
  23655. }
  23656. //------------------------------------
  23657. var _ = (new r.Vector3).copy(this.position);
  23658. if (i === u.PANORAMA){
  23659. this.emit(w.PanoChosen, n, n),
  23660. setTimeout(function() {
  23661. n.floor.enter(i)
  23662. }
  23663. .bind(this), I / 2),
  23664. this.path.fadeOutCpm(f.path.fadeOutTime);
  23665. if(this.model.floorLogos){
  23666. this.model.floorLogos[0].position.copy(n.floorPosition.clone().sub(this.model.position));//改
  23667. this.model.floorLogos[1].position.copy(this.model.floorLogos[0].position);//for floorIcon position
  23668. }
  23669. }else if (i === u.DOLLHOUSE) {
  23670. if (h && (this.model.stayPut = !0),
  23671. a ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  23672. this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0),
  23673. this.path.placeCpm(),
  23674. this.path.fadeInCpm(f.path.fadeInTime),
  23675. h) {
  23676. var T = new r.Vector3(this.model.center.x,0,this.model.center.z);
  23677. _.set(15, 10, 15);
  23678. var M = new r.Vector3(0,0,-1).applyQuaternion(a.quaternion)
  23679. , R = new r.Raycaster(a.position.clone(),M.clone(),0,1 / 0)
  23680. , P = R.intersectObjects([this.sceneIntersectionPlane]);
  23681. P.length ? (T.copy(P[0].point),
  23682. _.copy(a.position),
  23683. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(.75 * _.distanceTo(T), !0)) : (F.warn("Tried to restore dollhouse mode that did not intersect...", a.position, a.quaternion),
  23684. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
  23685. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  23686. _.add(this.model.position),
  23687. C.position.copy(_),
  23688. this.cameraControls.controls[u.DOLLHOUSE].update()
  23689. }
  23690. } else if (this.path.placeCpm(),
  23691. this.path.fadeInCpm(f.path.fadeInTime),
  23692. a) {
  23693. this.model.warpDestFloors(a.floorVisibility);
  23694. var O = this.cameraControls.cameras[u.FLOORPLAN]
  23695. , L = this.cameraControls.controls[u.FLOORPLAN]
  23696. , D = O.position.clone().sub(L.target)
  23697. , B = new r.Vector3(-1,0,0).applyQuaternion(a.quaternion).normalize()
  23698. , U = Math.atan2(B.x, B.z);
  23699. L.target.copy(a.position);
  23700. var k = D.length();
  23701. L.offset.x = k * Math.sin(U),
  23702. L.offset.y = 0,
  23703. L.offset.z = k * Math.cos(U),
  23704. O.position.copy(L.target).add(L.offset);
  23705. L.target.clone().sub(C.position);
  23706. C.quaternion.copy(a.quaternion),
  23707. L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom),
  23708. L.absoluteScale = L.currentScale,
  23709. L.update()
  23710. } else
  23711. this.model.currentFloor.enter(i);
  23712. var H = this.currentPano
  23713. , G = this.position.clone();
  23714. return this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  23715. this.flying = !0,
  23716. this.isOutsideMode(i) && this.is360View(p, H) ? (h || i !== u.DOLLHOUSE || (C.position.set(15, 10, 15),
  23717. C.controls.target.set(this.model.center.x, 0, this.model.center.z),
  23718. C.controls.update()),
  23719. e.blackoutStyle = S.FADEIN,
  23720. I = f.show360Views.transitionTime,
  23721. this.fade360View(I, C, e)) : this.isOutsideMode(p) && this.is360View(i, n) ? (h && this.switchCameraMode(i, h.quaternion),
  23722. this.mode = i,
  23723. this.path && this.path.popOutCpm(),
  23724. e.blackoutStyle = S.END,
  23725. I = f.show360Views.transitionTime,
  23726. this.fade360View(I, C, e)) : (y.start(v.property(this.model, "alpha", e.modelAlpha, null), I * e.modelAlphaLength, null, e.modelAlphaDelay, null, V.FlyToNewMode),
  23727. y.start(v.vector(this.position, C.position), I, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToNewMode),
  23728. y.start(v.quaternion(this.quaternion, C.quaternion), I * e.rotationDuration, null, e.rotationDelay, A[f.flydown.rotationEasing], null, V.FlyToNewMode),
  23729. y.start(v.matrix4(this.camera.projectionMatrix, C.projectionMatrix), I * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, V.FlyToNewMode),
  23730. y.start(v.uniform(this.model.skybox, "opacity", e.skyboxOpacity), I * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, V.FlyToNewMode),
  23731. y.start(v.property(this.reticule.material.uniforms.opacity, "value", 0), I, null, V.FlyToNewMode)),
  23732. y.setTimeout(function() {
  23733. this.flying = !1,
  23734. p === u.PANORAMA && i !== u.PANORAMA ? this.currentPano.exit() : p !== u.PANORAMA && i === u.PANORAMA && (this.currentPano !== H && H.exit(),
  23735. this.currentPano.enter(),
  23736. this.path.placeCpm(),
  23737. this.path.fadeOutCpm(f.path.fadeOutTime),
  23738. this.spider.draw()),
  23739. p === u.DOLLHOUSE && this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
  23740. this.mode = i,
  23741. this.emit(w.FlyingEnded, _, G, this.currentPano, H)
  23742. //add:
  23743. this.updateMarkerVisi() ;
  23744. (this.mode == u.PANORAMA) && this.updateHotVisible(),
  23745. this.mode == u.PANORAMA&&this.model.floorLogos&&(
  23746. this.model.changefloorLogoOpa({index:0, from:0, opa:1, dur: 150 }),//this.model.floorLogoShow(0,150);
  23747. this.model.floorLogos[0].visible = true
  23748. )
  23749. if(this.mode == u.PANORAMA){
  23750. Overlay.updateVisibles([this.currentPano])
  23751. updateVideo({type:"flyDone", pano:this.currentPano})//add
  23752. }else{
  23753. Overlay.updateVisibles(true)
  23754. }
  23755. h && p !== u.PANORAMA && i === u.PANORAMA ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s) : (s && s(),
  23756. t.resolve())
  23757. }
  23758. .bind(this), I, V.FlyToNewMode),
  23759. this.mode = u.TRANSITIONING,
  23760. p == "panorama" && this.updateHotVisible(),
  23761. t.promise()
  23762. }
  23763. ,
  23764. n.prototype.fade360View = function(e, t, i) {
  23765. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  23766. $(this.domElement).fadeOut(.5 * e, function() {
  23767. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  23768. this.model.alpha = i.modelAlpha,
  23769. this.position.copy(t.position),
  23770. this.quaternion.copy(t.quaternion),
  23771. this.camera.projectionMatrix.copy(t.projectionMatrix),
  23772. $(this.domElement).fadeIn(.5 * e)
  23773. }
  23774. .bind(this))
  23775. }
  23776. ,
  23777. n.prototype.findDefaultViews = function() {
  23778. this.findDefaultView(this.lastInsideView, !0),
  23779. this.findDefaultView(this.last360View, !1)
  23780. }
  23781. ,
  23782. n.prototype.findDefaultView = function(e, t) {
  23783. var i, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  23784. if (e.cameraMode !== u.PANORAMA)
  23785. return !1;
  23786. var i = r.get(e.panoId);
  23787. return i && i.isAligned() === t
  23788. });
  23789. o >= 0 ? (i = r.get(n[o].panoId),
  23790. e.update({
  23791. cameraMode: u.PANORAMA,
  23792. pano: i,
  23793. position: n[o].position,
  23794. quaternion: n[o].quaternion
  23795. })) : (o = r.list.findIndex(function(e) {
  23796. return e.isAligned() === t
  23797. }),
  23798. o >= 0 ? (i = r.list[o],
  23799. e.update({
  23800. cameraMode: u.PANORAMA,
  23801. pano: i,
  23802. position: i.position
  23803. })) : F.warn("There are no", t ? "inside" : "360º", "views in this model"))
  23804. }
  23805. ,
  23806. n.prototype.updateLastView = function() {
  23807. if (this.mode === u.PANORAMA) {
  23808. var e = this.currentPano.isAligned() ? this.lastInsideView : this.last360View;
  23809. e.update({
  23810. pano: this.currentPano,
  23811. position: this.position,
  23812. quaternion: this.quaternion
  23813. })
  23814. }
  23815. }
  23816. ,
  23817. n.prototype.goToLastView = function(e, t) {
  23818. var i = $.Deferred()
  23819. , n = i.resolve.bind(i)
  23820. , r = i.reject.bind(i)
  23821. , o = e ? this.lastInsideView : this.last360View;
  23822. return this.isInMode(u.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  23823. this.isInMode(u.PANORAMA) ? (this.path && this.path.popOutCpm(),
  23824. this.fadeToView(e, o, f.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  23825. mode: o.cameraMode,
  23826. pano: o.pano,
  23827. quaternion: o.quaternion,
  23828. callback: t
  23829. }).done(n).fail(r),
  23830. i.promise()
  23831. }
  23832. ,
  23833. n.prototype.fadeToView = function(e, t, i, n) {
  23834. var r = $.Deferred()
  23835. , o = r.resolve.bind(r)
  23836. , a = r.reject.bind(r);
  23837. if (!t.isValid() || t.cameraMode === u.PANORAMA && !t.pano)
  23838. return F.warn("Tried to fade to an illegal view", t.cameraMode),
  23839. a("Cannot go to illegal view"),
  23840. r.promise();
  23841. var s = (f[t.cameraMode],
  23842. function() {
  23843. $(this.domElement).fadeIn(.5 * i),
  23844. n && n(),
  23845. o()
  23846. }
  23847. .bind(this))
  23848. , l = e ? S.FADEIN : S.END;
  23849. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  23850. $(this.domElement).fadeOut(.5 * i, function() {
  23851. this.model.fadePanoMarkers(e ? f.panorama.markerOpacity : 0),
  23852. t.cameraMode === u.PANORAMA ? this.flyToPano({
  23853. pano: t.pano,
  23854. lookAtPoint: d.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  23855. duration: 0
  23856. }, s) : this.flyToNewMode({
  23857. mode: t.cameraMode,
  23858. quaternion: t.quaternion,
  23859. duration: 0,
  23860. callback: s
  23861. })
  23862. }
  23863. .bind(this)),
  23864. r.promise()
  23865. }
  23866. ,
  23867. n.prototype.startWarp = function(e, t, i, n, r, o) {
  23868. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  23869. this.flying)
  23870. return F.warn("Player.startWarp() -> Cannot warp when flying"),
  23871. o && o(),
  23872. !1;
  23873. null !== e && void 0 !== e || (e = b.Show),
  23874. this.history.invalidate()
  23875. e !== b.Retain ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK) : i = this.path.upcomingTransType;
  23876. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  23877. return this.emit(w.WarpStarted, a, i, n, r),
  23878. n = n || S.MIDDLE,
  23879. this.path.warpToPano(i, n, r, function() {
  23880. t === E.Slow ? this.path.discardSlow() : t === E.Standard && this.path.discardPathObject(),
  23881. this.emit(w.WarpEnded, i),
  23882. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  23883. o && o()
  23884. }
  23885. .bind(this)),
  23886. e === b.Hide && this.path.discardPathObject(),
  23887. !0
  23888. }
  23889. ,
  23890. n.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  23891. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (F.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  23892. s && s(),
  23893. !1)
  23894. }
  23895. ,
  23896. n.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  23897. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (F.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  23898. a && a(),
  23899. !1)
  23900. }
  23901. ,
  23902. n.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  23903. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  23904. }
  23905. ,
  23906. n.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  23907. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  23908. !0) : (F.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  23909. t && t(),
  23910. !1)
  23911. }
  23912. ,
  23913. n.prototype.aimTourCamera = function(e, t, i, n) {
  23914. return F.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  23915. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  23916. }
  23917. ,
  23918. n.prototype.showPathToHeroLocation = function(e) {
  23919. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(x.STD, x.BLACK)
  23920. }
  23921. ,
  23922. n.prototype.tourInterlude = function(e, t) {
  23923. this.history.invalidate();
  23924. this.path.discardSlow();
  23925. //xzw:
  23926. var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  23927. var restChildCount = currentLocation.heroLocations ? (currentLocation.heroLocations.length-this.director.currentItem[1]-1) : 0
  23928. var current = g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  23929. var rotTime = currentLocation && currentLocation.musicInfo.music ? currentLocation.musicInfo.time - current : 2e3;
  23930. if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
  23931. var timeEachItem = 2000;//假设每个item飞的时间
  23932. var rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
  23933. }
  23934. rotTime = Math.max(0, rotTime)
  23935. console.log("rotTime "+rotTime +" at item "+this.director.currentItem + ",musicCurrentTime:"+current)
  23936. this.path.waitNextStep(e, function() {
  23937. t && t()
  23938. }.bind(this), rotTime)
  23939. }
  23940. ,
  23941. n.prototype.stopInterlude = function() {
  23942. this.interruptAndFastForward(null, 0)
  23943. }
  23944. ,
  23945. n.prototype.interruptAndFastForward = function(e, t) {
  23946. this.isWarping() && this.emit(w.WarpInterrupted, this.path.activeTransType, e, t),
  23947. this.flying && this.emit(w.FlyingInterrupted),
  23948. this.path.interruptAndFastForward(e, t)
  23949. }
  23950. ,
  23951. n.prototype.setSize = function(e, t) {
  23952. var i = e / t;
  23953. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t);
  23954. var n = B.getHFOVFromVFOV(f.insideFOV, e, t);
  23955. n > f.insideFOVMax ? this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t) : this.baseFov = f.insideFOV;
  23956. for (var r in this.cameraControls.cameras) {
  23957. var o = this.cameraControls.cameras[r];
  23958. o.fov = this.baseFov * (1 / this.zoomLevel),
  23959. o.updateAspect(i)
  23960. }
  23961. }
  23962. ,
  23963. n.prototype.toJSON = function() {
  23964. var e = {};
  23965. return this.cameraControls.activeControl ? (e = this.cameraControls.activeControl.toJSON(),
  23966. e.camera_mode = u.toInt(this.mode),
  23967. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  23968. return e.hidden ? 0 : 1
  23969. }) : u.PANORAMA && (e.scan_id = this.currentPano.id),
  23970. e) : e
  23971. }
  23972. ,
  23973. n.prototype.getCurrentNodePanos = function(e) {
  23974. this.model.panos.map;
  23975. if (e.length = 0, this.path.nodes){
  23976. var momentTour = this.director.getMomentTour(this.director.destinationItem)
  23977. if(momentTour == 'black'){ //改 upcomingPanos如果是black的只需要起点和终点
  23978. if(this.path.nodes.length){
  23979. e.push(this.model.panos.get(this.path.nodes[0]))
  23980. }
  23981. if(this.path.nodes.length>1){
  23982. e.push(this.model.panos.get(this.path.nodes[this.path.nodes.length-1]))
  23983. }
  23984. }else{
  23985. for (var t = 0; t < this.path.nodes.length; t++) {
  23986. var i = this.path.nodes[t];
  23987. e.push(this.model.panos.get(i))
  23988. }
  23989. }
  23990. }
  23991. }
  23992. ,
  23993. n.prototype.zoomIncrementally = function(e) {
  23994. var t = this.zoomLevel;
  23995. this.zoomTo(this.zoomLevel + e),
  23996. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  23997. }
  23998. ,
  23999. n.prototype.zoomInIncrementally = function(e) {
  24000. e = e || this.defaultZoomIncrement,
  24001. this.zoomIncrementally(e)
  24002. }
  24003. ,
  24004. n.prototype.zoomOutIncrementally = function(e) {
  24005. e = e || -this.defaultZoomIncrement,
  24006. this.zoomIncrementally(e)
  24007. }
  24008. ,
  24009. n.prototype.zoomBy = function(e) {
  24010. this.zoomTo(this.zoomLevel * e)
  24011. }
  24012. ,
  24013. n.prototype.zoomIn = function() {
  24014. this.zoomBy(1 + this.zoomSpeed)
  24015. }
  24016. ,
  24017. n.prototype.zoomOut = function() {
  24018. this.zoomBy(1 - this.zoomSpeed)
  24019. }
  24020. ,
  24021. n.prototype.zoomTo = function(e, t) {
  24022. if (t || f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled) {
  24023. if (e < f.zoom.min && (e = f.zoom.min),
  24024. e > f.zoom.max && (e = f.zoom.max),
  24025. e > this.zoomLevel ? (this.emit(O.ZoomIn),
  24026. e === f.zoom.max && this.emit(O.ZoomMax)) : e < this.zoomLevel && (this.emit(O.ZoomOut),
  24027. e === f.zoom.min && this.emit(O.ZoomMin)),
  24028. this.cameraControls.activeControl) {
  24029. var i = this.cameraControls.activeControl.camera;
  24030. this.zoomLevel = e,
  24031. i.fov = this.baseFov * (1 / this.zoomLevel),
  24032. i.updateProjectionMatrix(),
  24033. this.zoomFov = i.fov
  24034. }
  24035. }
  24036. }
  24037. ,
  24038. n.prototype.increaseZoomSpeed = function() {
  24039. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  24040. }
  24041. ,
  24042. n.prototype.decreaseZoomSpeed = function() {
  24043. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  24044. }
  24045. ,
  24046. n.prototype.clampZoomSpeed = function(e) {
  24047. return e < 0 ? 0 : e
  24048. }
  24049. ,
  24050. n.prototype.activatePersistentZooming = function(e) {
  24051. this.zooming = e ? 1 : -1
  24052. }
  24053. ,
  24054. n.prototype.deactivatePersistentZooming = function() {
  24055. this.zooming = 0
  24056. }
  24057. ,
  24058. n.prototype.zoomDefault = function() {
  24059. this.zoomTo(1, !0)
  24060. }
  24061. ,
  24062. window.fovTranId = 333;//add
  24063. n.prototype.smoothZoomToDefault = function(e, t) {
  24064. y.cancelById(window.fovTranId)
  24065. var i, n = this.zoomLevel,
  24066. r = function(e) {
  24067. e > 1 && (e = 1),
  24068. i = n * (1 - e) + e,
  24069. this.zoomTo(i, !0)
  24070. }.bind(this),
  24071. o = function() {
  24072. this.zoomDefault(),
  24073. t && window.setTimeout(t, 50)
  24074. }.bind(this);
  24075. y.start(r, e, o, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  24076. }
  24077. n.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {//add
  24078. y.cancelById(window.fovTranId)
  24079. console.log("smoothZoomFovTo "+zoomLevel)
  24080. var i,
  24081. n = this.zoomLevel,
  24082. aimLevel = zoomLevel || this.baseFov / fov
  24083. if (n == aimLevel) return
  24084. var fun = function (e) {
  24085. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel),
  24086. this.zoomTo(i, !0)
  24087. }.bind(this)
  24088. y.start(fun, dur, callback, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  24089. }
  24090. ,
  24091. n.prototype.updateZoomPano = function() {
  24092. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === u.PANORAMA) {
  24093. var e = this.currentPano;
  24094. if (e) {
  24095. var t = this.zoomLevel > f.zoom.activationThreshold
  24096. , i = this.flying && this.nextPano && this.nextPano !== this.currentPano
  24097. , n = !i && !this.isWarping()
  24098. , r = t /*&& n*/; // 允许flying状态下加载4K图
  24099. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  24100. this.panoRenderer.setZoomingActive(r, e, !0);
  24101. var o = function(e, t) {
  24102. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  24103. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  24104. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  24105. e.setZoomed(t)
  24106. }
  24107. .bind(this);
  24108. r && !e.zoomed ? (o(e, !0),
  24109. this.panoRenderer.enableUltraHighQualityMode(function() {
  24110. this.qualityManager.useUltraHighResolutionPanos && !f.zoom.overridemax && (f.zoom.max = D.ultraHighQualityMaxZoom),
  24111. r && o(e, !0)
  24112. }
  24113. .bind(this))) : !t && e.zoomed && o(e, !1)
  24114. }
  24115. }
  24116. },
  24117. n.prototype.checkHasNeighbor = function(pano){//add
  24118. for(var i in pano.neighbourPanos ){
  24119. if(i == pano.id)continue;
  24120. if(pano.neighbourPanos[i]){
  24121. return true;
  24122. }
  24123. }
  24124. }
  24125. ,
  24126. t.exports = n
  24127. }
  24128. ).call(this, "/js/player.js")
  24129. }
  24130. , {
  24131. "./constants": 8,
  24132. "./enum/AlignmentType": 17,
  24133. "./enum/BlackoutStyle": 18,
  24134. "./enum/ControlEvents": 21,
  24135. "./enum/Keys": 30,
  24136. "./enum/ModelManagerEvents": 33,
  24137. "./enum/PanoSizeClass": 36,
  24138. "./enum/PanoramaEvents": 37,
  24139. "./enum/PathDiscardMode": 38,
  24140. "./enum/PathDisplayMode": 39,
  24141. "./enum/PlayerEvents": 40,
  24142. "./enum/TagStates": 44,
  24143. "./enum/Vectors": 50,
  24144. "./enum/Viewmode": 51,
  24145. "./enum/WarpStyle": 52,
  24146. "./enum/ZoomEvents": 53,
  24147. "./exception/BasicException": 55,
  24148. "./model/ModelManager": 140,
  24149. "./objects/NSpider": 147,
  24150. "./objects/Panorama": 148,
  24151. "./objects/Reticule": 149,
  24152. "./objects/ShowPath": 151,
  24153. "./objects/Snapshot": 153,
  24154. "./objects/View": 154,
  24155. "./settings": 166,
  24156. "./shaders": 167,
  24157. "./tile/TileDownloader": 171,
  24158. "./tile/TilePrioritizer": 172,
  24159. "./util/ZoomStats": 179,
  24160. "./util/browser": 182,
  24161. "./util/camera": 183,
  24162. "./util/cameraLight": 184,
  24163. "./util/common": 185,
  24164. "./util/easing": 186,
  24165. "./util/history": 187,
  24166. "./util/lerp": 188,
  24167. "./util/logger": 189,
  24168. "./util/math": 190,
  24169. "./util/transitions": 195,
  24170. "hot":"hot",
  24171. "scaleImg":"scaleImg",
  24172. events: 202,
  24173. three: 217
  24174. }],
  24175. "scaleImg":[function(t, e){// xzw
  24176. var OUTPUT = e;
  24177. (function(){function t(t,a,i,r){function h(){B="object"==typeof i?i:a.src||r?u:document.createElement("canvas"),B.width=s,B.height=f,G=B.getContext("2d")}
  24178. function n(t){if(t){var e,a=G.getImageData(0,0,s,f),i=a.data;for(e=0;at>e;e+=4)
  24179. i[e]=t[e]*it|0,i[e+1]=t[e+1]*it|0,i[e+2]=t[e+2]*it|0,i[e+3]=t[e+3]*it|0;return delete t,a}
  24180. return G.getImageData(0,0,s,f)}
  24181. function o(t,e,a,i,r){return.5*(i-e+(2*e-5*a+4*i-r+(3*(a-i)+r-e)*t)*t)*t+a}
  24182. a||(a=t.input,i=t.output,r=t.inputRemovable,t.scale&&(t=t.scale));var u,d;if(a.src)
  24183. if(u=document.createElement("canvas"),null!=a.naturalWidth)
  24184. u.width=a.naturalWidth,u.height=a.naturalHeight;else if(null!=a.runtimeStyle){var l=a.runtimeStyle,c=l.width,g=l.height;l.width="auto",l.height="auto",u.width=a.width,u.height=a.height,l.width=c,l.height=g}else{var c=a.width,g=a.height;a.removeAttribute&&(a.removeAttribute("width"),a.removeAttribute("height")),u.width=a.width,u.height=a.height,a.width=c,a.height=g}
  24185. else
  24186. u=a;d=u.getContext("2d"),a.src&&d.drawImage(a,0,0);var s,f,m=u.width,w=u.height,p=d.getImageData(0,0,m,w).data;if(!m||!w)
  24187. return!1;(a.src||r)&&u.clearRect(0,0,m,w),"object"==typeof t?t.width?(s=t.width+.5|0,f=t.height+.5|0):(s=m*t.scaleX+.5|0,f=w*t.scaleY+.5|0):(s=t*m+.5|0,f=t*w+.5|0);var v,b,y,x,D,I,A,j,R,k,C,E,F,L,S,U,W,H,alpha,X,Y,q,z,B,G,J,K,M,N,O,P,Q,T,V,Z,$=s<<2,_=m<<2,tt=0,et=0,at=$*f,it=255.99/255,rt=s/m,ht=f/w,nt=rt*ht;if(rt>1||ht>1)
  24188. for(h(),J=n(),K=J.data,x=0;f>x;x++)
  24189. for(b=x/ht,R=0|b,q=b-R,N=R*_,M=1>R?N:N-_,w-2>R?(O=N+_,P=(R+2)*_):O=P=R>w-2?N:N+_,y=0;s>y;y++,et+=4)
  24190. v=y/rt,j=0|v,z=v-j,T=j<<2,Q=1>j?T:T-4,m-2>j?(V=T+4,Z=T+8):V=Z=j>m-2?T:T+4,H=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,X=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,Y=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,alpha=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,K[et]=H>=0?256>H?H:255:0,K[et+1]=X>=0?256>X?X:255:0,K[et+2]=Y>=0?256>Y?Y:255:0,K[et+3]=alpha>=0?256>alpha?alpha:255:0;else{if(e.Float32Array)
  24191. W=new Float32Array(at);else
  24192. for(W=[],et=0;at>et;++et)
  24193. W[et]=0;for(b=0;w>b;b++)
  24194. for(x=b*ht,A=0|x,D=A*$,U=!!((A-(x+ht|0))*(w-1-b))<<1,U&&(F=A+1-x,L=x+ht-A-1),v=0;m>v;v++,tt+=4)
  24195. switch(y=v*rt,I=0|y,et=D+(I<<2),S=!!((I-(y+rt|0))*(m-1-v)),S&&(C=I+1-y,E=y+rt-I-1),H=p[tt],X=p[tt+1],Y=p[tt+2],alpha=p[tt+3],S+U){case 0:W[et]+=H*nt,W[et+1]+=X*nt,W[et+2]+=Y*nt,W[et+3]+=alpha*nt;break;case 1:k=C*ht,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*ht,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k;break;case 2:k=rt*F,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=rt*L,et+=$,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k;break;default:k=C*F,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*F,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k,k=C*L,et+=$,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*L,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k;}
  24196. delete p,h(),J=n(W)}
  24197. if(G.putImageData(J,0,0),"string"==typeof i){if("png"===i||"jpeg"===i){var ot;return ot=r&&a.src?a:new Image,ot.width=s,ot.height=f,ot.src=B.toDataURL("image/"+i,0.85),ot}
  24198. if("png-src"===i||"jpeg-src"===i)
  24199. return B.toDataURL("image/"+i.split("-")[0],0.85)}
  24200. return B}
  24201. var e=this;"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t),exports.scale=t):c=t}).call(this);
  24202. OUTPUT.exports = c;
  24203. }, {}
  24204. ],
  24205. 156: [function(e, t, i) {
  24206. (function(i) {
  24207. "use strict";
  24208. function n(e, t) {
  24209. this.model = e,
  24210. this.panos = e.panos,
  24211. this.player = t,
  24212. this.imagePanos = this.listImagePanos(),
  24213. this.retryMinimumTime = 1e4
  24214. }
  24215. var r = (e("three"),
  24216. e("./enum/Viewmode"))
  24217. , o = (e("./settings"),
  24218. e("./objects/Panorama"))
  24219. , a = e("./util/logger")
  24220. , s = new a(i);
  24221. n.prototype.start = function() {
  24222. this.loadNextPano(function(e) {
  24223. e ? this.start() : (s.debug("No suitable pano loaded, waiting a little while before looking again"),
  24224. setTimeout(function() {
  24225. this.start()
  24226. }
  24227. .bind(this), 1e3))
  24228. }
  24229. .bind(this))
  24230. }
  24231. ,
  24232. n.prototype.validLoadTarget = function(e) {
  24233. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  24234. }
  24235. ,
  24236. n.prototype.listImagePanos = function() {
  24237. var e = []
  24238. , t = this;
  24239. return this.model.images.forEach(function(i) {
  24240. if (i.metadata && i.metadata.scan_id) {
  24241. var n = t.model.panos.get(i.metadata.scan_id);
  24242. n && !n.isLoaded("high") && e.push(n)
  24243. }
  24244. }),
  24245. e
  24246. }
  24247. ,
  24248. n.prototype.nextNotLoadedImage = function() {
  24249. for (; this.imagePanos.length > 0; ) {
  24250. var e = this.imagePanos[0];
  24251. if (!e.isLoaded("high"))
  24252. return e;
  24253. this.imagePanos.shift()
  24254. }
  24255. return null
  24256. }
  24257. ,
  24258. n.prototype.loadNextPano = function(e) {
  24259. var t, i, n = this.model.waitQueue.filter(function(e) {
  24260. return e.object instanceof o
  24261. });
  24262. n.length > 0 ? (t = n[0].object,
  24263. s.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  24264. s.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  24265. s.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  24266. t = this.imagePanos[0],
  24267. s.debug("Overrode pano selection: Highlight image " + t.id)) : this.player.mode === r.PANORAMA && (t = this.panos.lowestByScore([this.validLoadTarget.bind(this), o.filters.isNeighbourPanoTo(this.player.currentPano)], [o.scoreFunctions.distance(this.player.currentPano), o.scoreFunctions.direction(this.player.position, this.player.getDirection()), o.scoreFunctions.inFieldOfView(this.player.position, this.player.getDirection())]),
  24268. t && s.debug("Normal pano selection: neighbor " + t.id)),
  24269. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  24270. s.debug("Preloading " + i + "-res pano " + t.id),
  24271. t.loadCube(i).done(e).fail(function() {
  24272. s.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  24273. e()
  24274. })) : e && e(null)
  24275. }
  24276. ,
  24277. t.exports = n
  24278. }
  24279. ).call(this, "/js/preloaders.js")
  24280. }
  24281. , {
  24282. "./enum/Viewmode": 51,
  24283. "./objects/Panorama": 148,
  24284. "./settings": 166,
  24285. "./util/logger": 189,
  24286. three: 217
  24287. }],
  24288. 157: [function(e, t, i) {
  24289. (function(i) {
  24290. "use strict";
  24291. function n(e, t, i, n, r) {
  24292. this.qualityManager = e,
  24293. this.scene = t,
  24294. this.camera = i,
  24295. this.container = r,
  24296. this.controls = n,
  24297. this.controls.enabled = !0,
  24298. this.controls.locked = !0,
  24299. this.quickstartCamera = n.camera,
  24300. this.quickstartCamera.fov = h.clampVFOV(a.insideFOV, a.insideFOVMax, $("#player").width(), $("#player").height()),
  24301. this.skybox = null
  24302. }
  24303. var r = e("three")
  24304. , o = e("../util/logger")
  24305. , a = e("../constants")
  24306. , s = (e("../util/transitions"),
  24307. e("../util/lerp"),
  24308. e("../util/easing"),
  24309. e("../enum/Vectors"))
  24310. , l = e("../enum/PanoSizeClass")
  24311. , c = (e("../materials/ModelTextureMaterial"),
  24312. e("../materials/CubemapMaterial"))
  24313. , h = (e("../cameras/PanoramaCamera"),
  24314. e("../controls/PanoramaControls"),
  24315. e("../tile/TileUtils"),
  24316. e("../util/camera"),
  24317. e("../util/cameraLight"))
  24318. , u = (e("../util/browser"),
  24319. e("../settings"),
  24320. e("../gui/helpManager"),
  24321. new o(i));
  24322. n.prototype.load = function(e) {
  24323. e.pano.shouldRedrawOnBaseLoaded = !0;
  24324. var t, i, n = this, r = s.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  24325. this.controls.lookAt(r.add(this.quickstartCamera.position));
  24326. var a = this.qualityManager.getPanoSize(l.BASE)
  24327. , c = this.qualityManager.getPanoSize(l.STANDARD);
  24328. if (e.pano.tiled) {
  24329. u.warn("Loading startPano, TILED", e.pano.id);
  24330. var d = h.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  24331. , p = this.quickstartCamera.fov;
  24332. u.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + d + ", vertical FOV: " + p + "]"),
  24333. t = e.pano.loadTiledPano(c, r, {
  24334. hFov: d,
  24335. vFov: p
  24336. }, !1, !1, !0),
  24337. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  24338. } else
  24339. u.warn("Loading startPano", e.pano.id),
  24340. t = e.pano.loadCube("high");
  24341. return $.when(t).then(function() {
  24342. n.init(e.pano, e.quaternion),
  24343. e.pano.tiled ? i.done(function() {
  24344. e.pano.lockUntilRenderingComplete = !1,
  24345. this.controls.locked = !1
  24346. }
  24347. .bind(this)) : this.controls.locked = !1
  24348. }
  24349. .bind(this))
  24350. }
  24351. ,
  24352. n.prototype.init = function(e, t) {
  24353. u.info("Quickstart done loading, adding scene objects"),
  24354. e.lockUntilRenderingComplete = !0,
  24355. this.skybox = new r.Mesh(new r.CubeGeometry(1,1,1),new c({
  24356. side: r.BackSide
  24357. })),
  24358. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  24359. this.skybox.quaternion.copy(e.quaternion),
  24360. this.scene.add(this.skybox),
  24361. $(this.container).show()
  24362. }
  24363. ,
  24364. n.prototype.update = function(e) {
  24365. this.controls.update(e),
  24366. this.camera.copy(this.quickstartCamera)
  24367. }
  24368. ,
  24369. n.prototype.setSize = function(e, t) {
  24370. this.quickstartCamera.updateAspect(e / t)
  24371. }
  24372. ,
  24373. n.prototype.destroy = function() {
  24374. this.scene.remove(this.skybox)
  24375. }
  24376. ,
  24377. t.exports = n
  24378. }
  24379. ).call(this, "/js/scene/QuickstartManager.js")
  24380. }
  24381. , {
  24382. "../cameras/PanoramaCamera": 7,
  24383. "../constants": 8,
  24384. "../controls/PanoramaControls": 13,
  24385. "../enum/PanoSizeClass": 36,
  24386. "../enum/Vectors": 50,
  24387. "../gui/helpManager": 68,
  24388. "../materials/CubemapMaterial": 117,
  24389. "../materials/ModelTextureMaterial": 118,
  24390. "../settings": 166,
  24391. "../tile/TileUtils": 174,
  24392. "../util/browser": 182,
  24393. "../util/camera": 183,
  24394. "../util/cameraLight": 184,
  24395. "../util/easing": 186,
  24396. "../util/lerp": 188,
  24397. "../util/logger": 189,
  24398. "../util/transitions": 195,
  24399. three: 217
  24400. }],
  24401. 158: [function(e, t, i) {
  24402. "use strict";
  24403. function n(e, t, i) {
  24404. this.scene = e,
  24405. this.camera = t,
  24406. this.renderer = null,
  24407. this.effects = i,
  24408. this.animateCallback = null,
  24409. this.composer = null,
  24410. this.qualityManager = null,
  24411. e.renderWidth = 0,
  24412. e.renderHeight = 0,
  24413. this.updateClock = new r.Clock,
  24414. this.components = [],
  24415. this.updateListeners = [],
  24416. this.resizeListeners = [],
  24417. this.forceUpdateSize = !1,
  24418. this.started = !1,
  24419. this.textures = {},
  24420. this.suspendedObjects = []
  24421. }
  24422. var r = e("three")
  24423. , o = e("../shaders")
  24424. , a = e("../enum/SceneRendererEvents")
  24425. , s = e("../enum/GLTextureType")
  24426. , l = e("../enum/GLCubeFaces")
  24427. , c = e("../exception/BasicException")
  24428. , h = e("../exception/RendererCreationException")
  24429. /**********************************************************************fyz改 from徐世廷**********************************************************************/
  24430. , m = e("../util/browser")
  24431. /**************************************************************************************************************************************************/
  24432. , u = e("../settings")
  24433. , d = e("events").EventEmitter;
  24434. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  24435. n.prototype = Object.create(d.prototype),
  24436. n.prototype.addComponent = function(e) {
  24437. this.components.push(e),
  24438. e.update && this.updateListeners.push(e),
  24439. e.setSize && (this.resizeListeners.push(e),
  24440. this.forceUpdateSize = !0)
  24441. }
  24442. ,
  24443. n.prototype.removeComponent = function(e) {
  24444. var t = function(t) {
  24445. return t !== e
  24446. };
  24447. this.components = this.components.filter(t),
  24448. this.updateListeners = this.updateListeners.filter(t),
  24449. this.resizeListeners = this.resizeListeners.filter(t)
  24450. }
  24451. ,
  24452. n.prototype.start = function(e) {
  24453. if (this.started)
  24454. throw new c("Can't start SceneRenderer, already started");
  24455. this.createContext(e),
  24456. /***************************************************VR fyz改 from徐世廷**********************************************************************/
  24457. m.isMobile() && this.boluoVrInit(),
  24458. /*******************************************************************************************************************************/
  24459. this.initComposer(),
  24460. this.started = !0,
  24461. (p = p.bind(this))()
  24462. }
  24463. ,
  24464. n.prototype.createContext = function(e) {
  24465. try {
  24466. this.renderer = new r.WebGLRenderer({antialias: !m.isMobile(), alpha:true}),//透明
  24467. this.renderer.autoClear = !0,
  24468. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  24469. this.renderer.setSize($("#player").width(), $("#player").height(), false), //改
  24470. this.renderer.setClearColor( 0x000000, 0 ); //透明
  24471. this.emit(a.ContextCreated)
  24472. } catch (e) {
  24473. throw new h("Unable to create a WebGL rendering context")
  24474. }
  24475. u.profiling.enabled && this.overrideTextures(),
  24476. e.appendChild(this.renderer.domElement)
  24477. /* window.stats = new Stats();
  24478. e.appendChild( stats.dom ); */
  24479. }
  24480. ,
  24481. n.prototype.overrideTextures = function() {
  24482. var e = this.renderer.context
  24483. , t = 0
  24484. , i = e.createTexture;
  24485. e.createTexture = function() {
  24486. var n = i.call(e);
  24487. return n.id = t++,
  24488. this.textures[n.id] = n,
  24489. n
  24490. }
  24491. .bind(this);
  24492. var n = e.texImage2D;
  24493. e.texImage2D = function(t, i, r, o, a, l, c, h, u) {
  24494. var d, p = this.getTextureTypeFromTarget(e, t);
  24495. d = p === s.TextureCube ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP) : e.getParameter(e.TEXTURE_BINDING_2D),
  24496. void 0 !== c ? n.call(e, t, i, r, o, a, l, c, h, u) : (c = o,
  24497. h = a,
  24498. u = l,
  24499. o = u.naturalWidth,
  24500. a = u.naturalHeight,
  24501. n.call(e, t, i, r, c, h, u));
  24502. var f = this.textures[d.id];
  24503. f.width = p === s.TextureCube ? 6 * o : o,
  24504. f.height = a
  24505. }
  24506. .bind(this);
  24507. var r = e.deleteTexture;
  24508. e.deleteTexture = function(t) {
  24509. delete this.textures[t.id],
  24510. r.call(e, t)
  24511. }
  24512. .bind(this)
  24513. }
  24514. ,
  24515. n.prototype.updateTextureMemory = function() {
  24516. var e = null;
  24517. return function() {
  24518. var t = 0;
  24519. for (var i in this.textures) {
  24520. var n = this.textures[i];
  24521. n.width && n.height && (t += n.width * n.height * 4)
  24522. }
  24523. t !== e && this.emit(a.MemoryUsageUpdated, t),
  24524. e = t
  24525. }
  24526. }(),
  24527. n.prototype.getTextureTypeFromTarget = function(e, t) {
  24528. switch (t) {
  24529. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  24530. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  24531. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  24532. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24533. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  24534. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24535. return s.TextureCube;
  24536. case e.TEXTURE_2D:
  24537. return s.Texture2D;
  24538. default:
  24539. return null
  24540. }
  24541. }
  24542. ,
  24543. n.prototype.initComposer = function() {
  24544. this.composer = new r.EffectComposer(this.renderer),
  24545. this.composer.addPass(new r.RenderPass(this.scene,this.camera)),
  24546. //this.composer.addPass(this.effects.hblurPass),
  24547. //this.composer.addPass(this.effects.vblurPass)
  24548. this.composer.addPass(this.effects.transitionMaskPass)//add
  24549. }
  24550. ,
  24551. n.prototype.setSize = function(e, t, devicePixelRatio) {
  24552. this.renderWidth = e,
  24553. this.renderHeight = t,
  24554. this.effects.aspect = e / t,
  24555. /* this.renderer.setSize(e, t), -----MP */
  24556. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  24557. this.composer.setSize(e, t);
  24558. for (var i = 0; i < this.resizeListeners.length; i++)
  24559. this.resizeListeners[i].setSize(e, t)
  24560. }
  24561. ,
  24562. n.prototype.render = function() {
  24563. this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  24564. //this.effects.transitionMaskPass.enabled ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  24565. }
  24566. /******************************************************************************************************徐世廷**********************************************************************/
  24567. var vrPermission = {};
  24568. var vrPermissionCallBack = function(info1,info2){
  24569. if(info1 == "reset"){
  24570. vrPermission = {};
  24571. }else{
  24572. vrPermission[info1] = info2
  24573. if(Object.keys(vrPermission).length == 2 && (vrPermission.deviceMotion != "granted" || vrPermission.deviceOrientation != "granted")){
  24574. alert("运动和方向访问失败。这会导致画面视角一直固定。您需要完全关闭此应用,然后再次打开,并允许访问运动与方向。" )
  24575. }
  24576. }
  24577. }
  24578. n.prototype.boluoVrInit = function() {
  24579. console.log("boluoVrInit")
  24580. this.isHuawei5X = m.detectHUAWEI5X(),
  24581. this.oldRenderer = this.renderer,
  24582. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera);
  24583. window.panoCamera = this.camera;
  24584. var a = this;
  24585. window._vrEnabled = !1,
  24586. Object.defineProperty(window, "vrEnabled", {
  24587. get: function() {
  24588. return window._vrEnabled
  24589. },
  24590. set: function(b) {
  24591. b = !!b,
  24592. b ? (a.renderer = a.newRenderer,
  24593. window.vrMarkers.forEach(function(a) {
  24594. a.visible = !0
  24595. })) : (a.renderer = a.oldRenderer,
  24596. window.vrMarkers.forEach(function(a) {
  24597. a.visible = !1
  24598. })),
  24599. a.cursor.visible = b,
  24600. a.setSize(window.innerWidth, window.innerHeight),
  24601. window._vrEnabled = b
  24602. if(b){
  24603. setTimeout(function(){
  24604. console.log("orientEnable"+window.orientEnable)
  24605. if(window.vrEnabled && !window.orientEnable){//很可能没能触发陀螺仪事件
  24606. if(m.detectIOS()/* && m.detectSafari() */){
  24607. var b = m.iosVersion();//{major: 10, minor: 3, patch: 1}
  24608. console.log("开始获取权限 major"+b.major)
  24609. if(b.major == 12 && b.minor>=2){
  24610. if(browser.detectSafari()) alert("浏览器未能检测到转动。为完整体验VR效果,请打开 “设置” > “Safari” > “隐私和安全” 下的 “运动和方向访问” 开关,然后刷新此页面。")
  24611. else{//app??
  24612. alert("浏览器未能检测到转动。请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  24613. }
  24614. }else if(b.major >= 13){
  24615. if(!window.location.href.includes("https://")){
  24616. console.log("需要https");
  24617. alert("当前网页下,高于ios12的浏览器版本可能不支持陀螺仪开启。")
  24618. return;
  24619. }
  24620. var hasFailed = window.vrPermission && (window.vrPermission.deviceMotion != "granted" || window.vrPermission.deviceOrientation != "granted")
  24621. setTimeout(()=>{//如果使用了alert会阻断这个事件,报以下错requusting device orientation or motion access requires a user gesture
  24622. if(!window.vrEnabled || window.orientEnable)return;
  24623. vrPermissionCallBack("reset")
  24624. console.log(window.DeviceMotionEvent)
  24625. if ( window.DeviceMotionEvent && window.DeviceMotionEvent.requestPermission && typeof window.DeviceMotionEvent.requestPermission === 'function') {
  24626. console.log("开始获取权限1")
  24627. ///注意:需要https 本地服务器permissionState会得到denied
  24628. window.DeviceMotionEvent.requestPermission().then(permissionState => {
  24629. console.log("permissionState1: "+permissionState)
  24630. vrPermissionCallBack("deviceMotion", permissionState)
  24631. }).catch(function(e){
  24632. vrPermissionCallBack("deviceMotion", false)
  24633. console.log(e)
  24634. })
  24635. }else{
  24636. console.log("window.DeviceMotionEvent undefined")
  24637. vrPermissionCallBack("deviceMotion", false)
  24638. }
  24639. if ( window.DeviceOrientationEvent && window.DeviceOrientationEvent.requestPermission && typeof window.DeviceOrientationEvent.requestPermission === 'function') {
  24640. console.log("开始获取权限2")
  24641. window.DeviceOrientationEvent.requestPermission().then(permissionState => {
  24642. console.log("permissionState2: "+permissionState)
  24643. vrPermissionCallBack("deviceOrientation", permissionState)
  24644. }).catch(function(e){
  24645. vrPermissionCallBack("deviceOrientation", false)
  24646. console.log(e)
  24647. })
  24648. }else{
  24649. console.log("window.DeviceOrientationEvent undefined")
  24650. vrPermissionCallBack("deviceOrientation", false)
  24651. }
  24652. },hasFailed ? 0 : 150)
  24653. /* /* setTimeout(function(){
  24654. if(settings.vrEnabled && !window.orientEnable){
  24655. $alert("若画面视角一直固定,您需要完全关闭Safari浏览器,然后再次打开以开启运动和方向访问。")
  24656. }
  24657. },4000) */
  24658. }else console.log("陀螺仪未能启用 ios "+b.major+"."+b.minor)
  24659. }else{
  24660. //$alert("浏览器未能检测到转动", "请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  24661. }
  24662. }else{
  24663. //已经触发了
  24664. }
  24665. },200);
  24666. }
  24667. }
  24668. }),
  24669. this.createCursor(.5, !1, 1, 16777215, 0);
  24670. var b = {
  24671. setSize: function(b, c) {
  24672. a.camera.aspect = b / c
  24673. }
  24674. };
  24675. this.resizeListeners.push(b),
  24676. this.vrLoadingInit()
  24677. }
  24678. ,
  24679. n.prototype.vrLoadingInit = function() {
  24680. var a = function(camera) {
  24681. var a = this
  24682. , b = new r.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  24683. , c = new r.MeshBasicMaterial({
  24684. color: 4967932,
  24685. side: r.DoubleSide
  24686. })
  24687. , d = new r.Mesh(b,c);
  24688. this.mesh = d,
  24689. d.position.z = -2,
  24690. d.scale.set(.08, .08, .08),
  24691. d.visible = !1,
  24692. camera.add(d),
  24693. //window.player.camera.add(d),
  24694. a.enabled = !1,
  24695. this.update = function(b) {
  24696. 1 == a.enabled && (d.rotation.z += 15 * b)
  24697. }
  24698. }
  24699. , a = new a(this.camera);
  24700. window.Loading = a,
  24701. this.updateListeners.push(a)
  24702. }
  24703. ,
  24704. n.prototype.createCursor = function(a, b, c, d, e) {
  24705. var g, h = new r.SpriteMaterial({
  24706. opacity: c,
  24707. color: d,
  24708. transparent: b,
  24709. map: this.boluoGetTexture("images/cursor.png"),
  24710. needsUpdate: !0,
  24711. side: r.DoubleSide
  24712. });
  24713. h.map.offset = new r.Vector2(1 / 17 * e,0),
  24714. h.map.repeat = new r.Vector2(1 / 17,1),
  24715. h.depthTest = !1,
  24716. h.blending = r.AdditiveBlending,
  24717. g = new r.Sprite(h),
  24718. // g.scale.set(a, a, a),
  24719. g.scale.set(.3,.3,.3)
  24720. g.position.z = -2,
  24721. g.visible = !1,
  24722. g.name = "cursor",
  24723. this.camera.add(g),
  24724. this.scene.add(this.camera),
  24725. this.cursor = g;
  24726. var i = new this.CursorAnimation(this.scene,g,this.camera);
  24727. this.cursor.triggerTargetEvent = i.triggerTargetEvent,
  24728. this.updateListeners.push(i)
  24729. }
  24730. ,
  24731. window.orientEnable = 0; //是否能触发deviceorientation
  24732. n.prototype.CursorAnimation = function(a, b, c) {
  24733. function d() {
  24734. g.orient = r.Math.degToRad(window.orientation || 0)
  24735. }
  24736. function e(a) {
  24737. if(!window.vrEnabled && window.orientEnable) return;
  24738. window.orientEnable || (window.orientEnable = 1);
  24739. var b = r.Math.degToRad(a.alpha)
  24740. , c = r.Math.degToRad(a.beta)
  24741. , d = r.Math.degToRad(a.gamma);
  24742. if (this.isHuawei5X ? (-1e3 === g.alpha && (g.alpha = b),
  24743. -1e3 === g.beta && (g.beta = c),
  24744. -1e3 === g.gamma && (g.gamma = d),
  24745. Math.abs(b - g.alpha) > .06 && (g.alpha = b),
  24746. Math.abs(c - g.beta) > .006 && (g.beta = c),
  24747. Math.abs(d - g.gamma) > .006 && (g.gamma = d)) : (g.alpha = b,
  24748. g.beta = c,
  24749. g.gamma = d),
  24750. n.vrDebug) {
  24751. $("#info-device-orientation").css("display", "block");
  24752. var e = "";
  24753. e += "alpha=(" + g.alpha + ")<BR/>",
  24754. e += "beta=(" + g.beta + ")<BR/>",
  24755. e += "gamma=" + g.gamma + "<BR/>",
  24756. document.getElementById("info-device-orientation").innerHTML = e
  24757. }
  24758. }
  24759. this.cursor = b,
  24760. this.raycaster = new r.Raycaster,
  24761. this.targetEventObj = {},
  24762. this.type = 1,
  24763. this.tweenFlag = !0;
  24764. var g = this;
  24765. this.target = c,
  24766. console.log(c.uuid),
  24767. this.euler = new r.Euler,
  24768. this.q0 = new r.Quaternion,
  24769. this.q1 = new r.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  24770. this.zee = new r.Vector3(0,0,1),
  24771. this.alpha = -1e3,
  24772. this.beta = -1e3,
  24773. this.gamma = -1e3,
  24774. this.orient = r.Math.degToRad(window.orientation || 0),
  24775. window.addEventListener("orientationchange", d),
  24776. window.addEventListener("deviceorientation", e),
  24777. this.setObjectQuaternion = function(a, b, d, e, f) {
  24778. g.euler.set(d, b, -e, "YXZ"),
  24779. a.setFromEuler(g.euler),
  24780. a.multiply(g.q1),
  24781. a.multiply(g.q0.setFromAxisAngle(g.zee, -f)),
  24782. c.updateMatrixWorld()
  24783. }
  24784. ,
  24785. parent !== window && window.addEventListener("message", function(a) {
  24786. var b = JSON.parse(a.data)
  24787. , c = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  24788. b && b.alpha && b.beta && b.gamma && function(a) {
  24789. var c = r.Math.degToRad(b.alpha)
  24790. , d = r.Math.degToRad(b.beta)
  24791. , e = r.Math.degToRad(b.gamma);
  24792. a ? (-1e3 === g.alpha && (g.alpha = c),
  24793. -1e3 === g.beta && (g.beta = d),
  24794. -1e3 === g.gamma && (g.gamma = e),
  24795. Math.abs(c - g.alpha) > .06 && (g.alpha = c),
  24796. Math.abs(d - g.beta) > .006 && (g.beta = d),
  24797. Math.abs(e - g.gamma) > .006 && (g.gamma = e)) : (g.alpha = c,
  24798. g.beta = d,
  24799. g.gamma = e)
  24800. }(c)
  24801. }),
  24802. this.update = function(a) {
  24803. TWEEN.update();
  24804. if(window.ifTest && window.vrEnabled) this.triggerTargetEvent() //测试时不根据陀螺仪来转向
  24805. else window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient ),
  24806. this.triggerTargetEvent())
  24807. }
  24808. ,
  24809. this.triggerTargetEvent = function() {
  24810. var a = this.choseObj()
  24811. , b = a ? a.object : void 0;
  24812. this.targetEventObj.currentObj = b,
  24813. b !== this.targetEventObj.lastObj && (b && this.autoCursorPosition(a),
  24814. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  24815. b && b.enabled && this.startAnimate(function() {
  24816. this.clickCallback(b)
  24817. }
  24818. .bind(this))) : this.type,
  24819. this.targetEventObj.lastObj = b)
  24820. }
  24821. ,
  24822. this.choseObj = function() {
  24823. this.raycaster.setFromCamera({
  24824. x: 0,
  24825. y: 0
  24826. }, c);
  24827. var a = (this.raycaster.ray,
  24828. window.vrMarkers)
  24829. , b = this.raycaster.intersectObjects(a);
  24830. if (b.length > 0)
  24831. return b[0]
  24832. }
  24833. ,
  24834. this.clickCallback = function(a) {
  24835. this.runTHREEAction(a, "onclick")
  24836. }
  24837. ,
  24838. this.runTHREEAction = function(a, b) {
  24839. switch (b) {
  24840. case "onclick":
  24841. a._listeners && a._listeners.click && a._listeners.click.forEach(function(a) {
  24842. a()
  24843. });
  24844. break;
  24845. case "onhover":
  24846. a._listeners && a._listeners.hover && a._listeners.hover.forEach(function(a) {
  24847. a()
  24848. });
  24849. break;
  24850. case "onout":
  24851. a._listeners && a._listeners.out && a._listeners.out.forEach(function(a) {
  24852. a()
  24853. })
  24854. }
  24855. }
  24856. ,
  24857. this.startAnimate = function(a) {
  24858. this.tweenFlag && this.initAnimation(a)
  24859. }
  24860. ,
  24861. this.initAnimation = function(a) {
  24862. var b = this
  24863. , c = this.cursor.material.map.offset
  24864. , d = function(a) {
  24865. return Math.floor(17 * a) / 17
  24866. };
  24867. b.tweenFlag = !1,
  24868. this.cursorAnimate = new TWEEN.Tween(c).to({
  24869. x: 1
  24870. }, 1e3).onStart(function() {
  24871. b.tweenFlag = !1
  24872. }).onStop(function() {
  24873. b.tweenFlag = !0,
  24874. this.x = 0,
  24875. c.x = 0
  24876. }).onUpdate(function() {}).onComplete(function() {
  24877. a(),
  24878. c.x = 0,
  24879. setTimeout(function() {
  24880. b.tweenFlag = !0
  24881. }, 1500)
  24882. }),
  24883. this.cursorAnimate.easing(d),
  24884. this.cursorAnimate.start()
  24885. }
  24886. ,
  24887. this.autoCursorPosition = function(a) {
  24888. // var b = Math.abs(a.distance - 10);
  24889. // this.cursor.position.z = -b,
  24890. // b /= 10;
  24891. // alert(b);
  24892. // this.cursor.scale.set(b, b, b)
  24893. this.cursor.scale.set(.3,.3,.3)
  24894. }
  24895. }
  24896. ,
  24897. n.prototype.vrRenderer = function(a, b, c) {
  24898. var d = new b.vrCamera(c);
  24899. d.bananaAspect = .8,
  24900. this.width,
  24901. this.height;
  24902. var b = this;
  24903. this.setSize = function(c, d) {
  24904. a.setSize.call(this, c, d),
  24905. b.width = c,
  24906. b.height = d
  24907. }
  24908. ,
  24909. this.render = function(b, c, e, f) {
  24910. window.cameraQua = c.quaternion.clone();
  24911. var g, h;
  24912. if (c.__RESS__SKIP__STEREO__)
  24913. return a.render(b, c, e, f);
  24914. if ("PerspectiveCamera" === c.type)
  24915. g = d.cameraL,
  24916. h = d.cameraR,
  24917. b.updateMatrixWorld(),
  24918. null === c.parent && c.updateMatrixWorld(),
  24919. d.vrCameraUpdate(c);
  24920. else {
  24921. if ("OrthographicCamera" !== c.type)
  24922. return DEBUG && console.error("Unsupported renderer: ", c.type);
  24923. g = h = c
  24924. }
  24925. a.setScissorTest(!0),
  24926. a.setScissor(0, 0, this.width / 2, this.height),
  24927. a.setViewport(0, 0, this.width / 2, this.height),
  24928. a.render.call(this, b, g, e, f),
  24929. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  24930. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  24931. a.render.call(this, b, h, e, f),
  24932. a.setScissorTest(!1)
  24933. }
  24934. ,
  24935. this.__proto__ = {
  24936. __proto__: a
  24937. }
  24938. }
  24939. ,
  24940. n.prototype.vrCamera = function(a) {
  24941. this.type = "StereoCamera",
  24942. this._aspect = 1,
  24943. this._overlap = .064,
  24944. this.cameraL = new r.PerspectiveCamera,
  24945. this.cameraL.layers.enable(1),
  24946. this.cameraL.near = 0.01,//xzw add
  24947. this.cameraL.matrixAutoUpdate = !1,
  24948. this.cameraR = new r.PerspectiveCamera,
  24949. this.cameraR.layers.enable(2),
  24950. this.cameraR.near = 0.01,//xzw add
  24951. this.cameraR.matrixAutoUpdate = !1,
  24952. this.eyeRight = new r.Matrix4,
  24953. this.eyeLeft = new r.Matrix4,
  24954. this.vrCameraNeedsUpdate = !0,
  24955. window.vrCameraL = this.cameraL; // fyz 记录vr相机
  24956. Object.defineProperty(this, "bananaAspect", {
  24957. get: function() {
  24958. return this._aspect
  24959. },
  24960. set: function(a) {
  24961. this._aspect !== a && (this.vrCameraNeedsUpdate = !0),
  24962. this._aspect = a
  24963. }
  24964. }),
  24965. Object.defineProperty(this, "overlap", {
  24966. get: function() {
  24967. return this._overlap
  24968. },
  24969. set: function(a) {
  24970. this._overlap !== a && (this.vrCameraNeedsUpdate = !0),
  24971. this._overlap = a
  24972. }
  24973. }),
  24974. this.vrCameraUpdate = function(a) {
  24975. this.vrCameraNeedsUpdate = true;
  24976. if (this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== a.fov || this.bananaReal_aspect !== a.aspect * this.bananaAspect || this.bananaNear !== a.near || this.bananaFar !== a.far,
  24977. this.vrCameraNeedsUpdate) {
  24978. this.vrCameraNeedsUpdate = !1,
  24979. //console.debug("vrCameraUpdate"),
  24980. this.bananaFocus = a.focus,
  24981. this.bananaFov = a.fov,
  24982. this.bananaReal_aspect = a.aspect * this.bananaAspect,
  24983. this.bananaNear = a.near,
  24984. this.bananaFar = a.far,
  24985. //console.debug(a.aspect),
  24986. this.bananaFocus = 10;
  24987. var b, c, d = a.projectionMatrix.clone(), e = this.overlap / 2, f = e * this.bananaNear / this.bananaFocus, g = this.bananaNear * Math.tan(Math.PI / 180 * this.bananaFov * .5);
  24988. this.eyeLeft.elements[12] = -e,
  24989. this.eyeRight.elements[12] = e,
  24990. b = -g * this.bananaReal_aspect + f,
  24991. c = g * this.bananaReal_aspect + f,
  24992. d.elements[0] = 2 * this.bananaNear / (c - b),
  24993. d.elements[8] = (c + b) / (c - b),
  24994. this.cameraL.projectionMatrix.copy(d),
  24995. b = -g * this.bananaReal_aspect - f,
  24996. c = g * this.bananaReal_aspect - f,
  24997. d.elements[0] = 2 * this.bananaNear / (c - b),
  24998. d.elements[8] = (c + b) / (c - b),
  24999. this.cameraR.projectionMatrix.copy(d)
  25000. }
  25001. this.cameraL.matrixWorld.copy(a.matrixWorld).multiply(this.eyeLeft),
  25002. this.cameraR.matrixWorld.copy(a.matrixWorld).multiply(this.eyeRight)
  25003. }
  25004. }
  25005. ,
  25006. n.prototype.boluoGetTexture = function(a) {
  25007. var b = new r.TextureLoader;
  25008. return b.crossOrigin = "anonymous",
  25009. b.load(a)
  25010. }
  25011. ,
  25012. /***********************************************************************************************************************************************************************************/
  25013. n.prototype.updateScreenSize = function() {//xzw 改 为了截屏 要改canvas大小 以及缩放时不模糊
  25014. var W,H;//当截屏时有setTimeout 期间不能恢复大小,所以要用W,H记录正常大小
  25015. return function(o){
  25016. var render = false;
  25017. var ratio;
  25018. var w, h; //记录应当render的大小
  25019. if(o && !o.resize && o.width!= void 0 && o.height!= void 0){
  25020. w = o.width, h = o.height, render = true, ratio=1;
  25021. }else{
  25022. w = $('#player').width();
  25023. h = $('#player').height();
  25024. o && o.resize && (W = this.renderWidth, H = this.renderHeight);
  25025. (w !== W || h !== H || this.forceUpdateSize) &&
  25026. (W = w, H = h, render = true, ratio = window.devicePixelRatio);
  25027. }
  25028. if(render){
  25029. this.setSize(w, h, ratio);
  25030. this.forceUpdateSize = !1
  25031. }
  25032. }
  25033. }()
  25034. ,
  25035. n.prototype.updateComponents = function() {
  25036. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  25037. this.updateListeners[t].update(e)
  25038. }
  25039. ,
  25040. n.prototype.suspend = function() {
  25041. this.started = !1,
  25042. this.suspendedObjects = this.scene.children.map(function(e) {
  25043. return this.scene.remove(e),
  25044. e
  25045. }
  25046. .bind(this)),
  25047. this.render()
  25048. }
  25049. ,
  25050. n.prototype.resume = function() {
  25051. this.suspendedObjects.forEach(function(e) {
  25052. this.scene.add(e)
  25053. }
  25054. .bind(this)),
  25055. this.suspendedObjects = [],
  25056. this.started = !0,
  25057. p()
  25058. }
  25059. ;
  25060. var p = function() {
  25061. this.started && (window.requestAnimationFrame(p),
  25062. this.updateScreenSize(), // fyz resize
  25063. this.updateComponents(),
  25064. this.updateTextureMemory(),
  25065. this.render(),
  25066. window.stats && (window.fps = stats.update()),
  25067. this.emit(a.AfterRender))
  25068. };
  25069. n.prototype.getImageData = function() {
  25070. var e = document.createElement("canvas")
  25071. , t = e.getContext("2d");
  25072. return function(i, n, r) {
  25073. return e.width === n && e.height === r || (e.width = n,
  25074. e.height = r),
  25075. t.drawImage(i, 0, 0, n, r),
  25076. t.getImageData(0, 0, n, r)
  25077. }
  25078. }(),
  25079. n.prototype.initSizedTexture2D = function(e, t, i) {
  25080. var n = this.renderer
  25081. , o = n.context
  25082. , a = n.state
  25083. , s = new r.Texture(null);
  25084. s.flipY = !1,
  25085. i !== !0 && (i = !1),
  25086. s.generateMipmaps = i;
  25087. var l = n.paramThreeToGL(s.format)
  25088. , c = n.paramThreeToGL(s.type)
  25089. , h = n.properties.get(s)
  25090. , u = o.createTexture();
  25091. a.bindTexture(o.TEXTURE_2D, u),
  25092. o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY),
  25093. o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null),
  25094. s.wrapS = t,
  25095. s.wrapT = t;
  25096. var d = n.paramThreeToGL(t);
  25097. return o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  25098. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  25099. i ? (s.magFilter = r.LinearFilter,
  25100. s.minFilter = r.LinearMipMapLinearFilter,
  25101. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  25102. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_NEAREST),
  25103. o.generateMipmap(o.TEXTURE_2D)) : (s.magFilter = r.LinearFilter,
  25104. s.minFilter = r.LinearFilter,
  25105. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  25106. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)),
  25107. a.bindTexture(o.TEXTURE_2D, null),
  25108. h.__webglTexture = u,
  25109. s
  25110. }
  25111. ,
  25112. n.prototype.initSizedCubeMap = function(e, t) {
  25113. var i = this.renderer
  25114. , n = i.context
  25115. , o = i.state
  25116. , a = new r.CubeTexture([null, null, null, null, null, null]);
  25117. a.flipY = !1,
  25118. a.generateMipmaps = t;
  25119. var s = i.paramThreeToGL(a.format)
  25120. , l = i.paramThreeToGL(a.type)
  25121. , c = i.properties.get(a)
  25122. , h = n.createTexture();
  25123. o.bindTexture(n.TEXTURE_CUBE_MAP, h),
  25124. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY);
  25125. for (var u = 0; u < 6; u++)
  25126. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + u, 0, s, e, e, 0, s, l, null);
  25127. return t ? (a.magFilter = r.LinearFilter,
  25128. a.minFilter = r.LinearMipMapLinearFilter,
  25129. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  25130. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  25131. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  25132. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (a.magFilter = r.LinearFilter,
  25133. a.minFilter = r.LinearFilter,
  25134. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  25135. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  25136. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  25137. c.__image__webglTextureCube = h,
  25138. a
  25139. }
  25140. ,
  25141. n.prototype.deallocateCubeTexture = function(e) {
  25142. var t = this.renderer
  25143. , i = t.context
  25144. , n = t.properties.get(e);
  25145. i.deleteTexture(n.__image__webglTextureCube)
  25146. }
  25147. ,
  25148. n.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  25149. var a = this.renderer
  25150. , s = a.context
  25151. , l = a.state
  25152. , c = a.properties.get(t);
  25153. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  25154. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  25155. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  25156. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  25157. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  25158. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  25159. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  25160. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  25161. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  25162. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  25163. l.bindTexture(s.TEXTURE_2D, null)
  25164. }
  25165. ,
  25166. n.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  25167. var s = this.renderer
  25168. , l = s.context
  25169. , c = s.state
  25170. , h = s.properties.get(t);
  25171. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  25172. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  25173. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  25174. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  25175. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  25176. }
  25177. ,
  25178. n.prototype.rebuildMipMaps2D = function(e) {
  25179. var t = this.renderer
  25180. , i = t.context
  25181. , n = t.state;
  25182. t.properties.get(e);
  25183. i.generateMipmap(i.TEXTURE_2D),
  25184. n.bindTexture(i.TEXTURE_2D, null)
  25185. }
  25186. ,
  25187. n.prototype.rebuildMipMaps3D = function(e) {
  25188. var t = this.renderer
  25189. , i = t.context
  25190. , n = t.state
  25191. , r = t.properties.get(e);
  25192. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  25193. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  25194. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  25195. }
  25196. ,
  25197. n.prototype.renderToCubeMap = function() {
  25198. var e = !1
  25199. , t = null
  25200. , i = null
  25201. , n = null
  25202. , a = null
  25203. , s = null
  25204. , l = 1;
  25205. return function(c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  25206. var _ = this.renderer;
  25207. _.context;
  25208. e || (i = new r.OrthographicCamera(l / -2,l / 2,l / 2,l / -2,-200,200),
  25209. i.position.z = 150,
  25210. t = new r.Scene,
  25211. t.add(i),
  25212. n = new r.ShaderMaterial({
  25213. uniforms: {
  25214. tDiffuse: {
  25215. type: "t",
  25216. value: null
  25217. },
  25218. alpha: {
  25219. type: "f",
  25220. value: 1
  25221. }
  25222. },
  25223. vertexShader: o.basicTextured.vertexShader,
  25224. fragmentShader: o.basicTextured.fragmentShader,
  25225. depthWrite: !1,
  25226. depthTest: !1,
  25227. side: r.DoubleSide
  25228. }),
  25229. a = new r.PlaneBufferGeometry(l,l),
  25230. s = new r.Mesh(a,n),
  25231. s.position.z = 0,
  25232. t.add(s),
  25233. e = !0);
  25234. var T = a.getAttribute("uv");
  25235. T.setDynamic(!0),
  25236. T.needsUpdate = !0;
  25237. var x = T.array
  25238. , S = p / u
  25239. , M = f / d
  25240. , R = g / u
  25241. , P = m / d;
  25242. x[0] = S,
  25243. x[1] = M + P,
  25244. x[2] = S + R,
  25245. x[3] = M + P,
  25246. x[4] = S,
  25247. x[5] = M,
  25248. x[6] = S + R,
  25249. x[7] = M;
  25250. var O = a.getAttribute("position");
  25251. O.setDynamic(!0),
  25252. O.needsUpdate = !0;
  25253. var L = O.array
  25254. , D = v / h.width - l / 2
  25255. , N = A / h.height - l / 2
  25256. , B = y / h.width
  25257. , F = C / h.height;
  25258. L[0] = D,
  25259. L[1] = N + F,
  25260. L[3] = D + B,
  25261. L[4] = N + F,
  25262. L[6] = D,
  25263. L[7] = N,
  25264. L[9] = D + B,
  25265. L[10] = N;
  25266. this.renderer.properties.get(c);
  25267. n.uniforms.tDiffuse.value = c,
  25268. n.blending = E || r.NoBlending,
  25269. n.transparent = !!b,
  25270. void 0 !== w && null !== w || (w = 1),
  25271. n.uniforms.alpha.value = w,
  25272. n.needUpdate = !0,
  25273. h.activeCubeFace = I,
  25274. h.viewport.set(0, 0, h.width, h.height);
  25275. var V = this.renderer.autoClear;
  25276. this.renderer.autoClear = !1,
  25277. this.renderer.render(t, i, h, !1),
  25278. this.renderer.autoClear = V
  25279. }
  25280. }(),
  25281. n.prototype.copyCubeMap = function() {
  25282. var e = !1
  25283. , t = null
  25284. , i = null
  25285. , a = null
  25286. , s = null
  25287. , l = null
  25288. , c = new r.Euler;
  25289. new r.Vector3;
  25290. return function(h, u, d, p, f, g, m, v, A) {
  25291. this.renderer;
  25292. if (!e) {
  25293. var y = 2;
  25294. i = new r.OrthographicCamera(y / -2,y / 2,y / 2,y / -2,0,200),
  25295. i.position.set(0, 0, 0),
  25296. t = new r.Scene,
  25297. t.add(i),
  25298. a = new r.ShaderMaterial({
  25299. uniforms: {
  25300. tDiffuse: {
  25301. type: "t",
  25302. value: null
  25303. },
  25304. alpha: {
  25305. type: "f",
  25306. value: 1
  25307. }
  25308. },
  25309. vertexShader: o.copyCubeMap.vertexShader,
  25310. fragmentShader: o.copyCubeMap.fragmentShader,
  25311. depthWrite: !1,
  25312. depthTest: !1,
  25313. side: r.DoubleSide
  25314. }),
  25315. s = new r.BoxGeometry(y,y,y),
  25316. l = new r.Mesh(s,a),
  25317. t.add(l),
  25318. e = !0
  25319. }
  25320. for (var C = 0; C < 6; C++)
  25321. n.getCubeOrientationForCubeFace(C, c),
  25322. l.rotation.copy(c),
  25323. l.matrixWorldNeedsUpdate = !0,
  25324. l.updateMatrixWorld(),
  25325. a.uniforms.tDiffuse.value = h,
  25326. a.blending = m || r.NoBlending,
  25327. a.transparent = !!v,
  25328. void 0 !== A && null !== A || (A = 1),
  25329. a.uniforms.alpha.value = A,
  25330. a.needUpdate = !0,
  25331. u.activeCubeFace = C,
  25332. u.viewport.set(0, 0, f, g),
  25333. this.renderer.render(t, i, u, !1)
  25334. }
  25335. }(),
  25336. n.getLookAtForCubeFace = function(e, t) {
  25337. switch (e) {
  25338. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  25339. t.set(1, 0, 0);
  25340. break;
  25341. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  25342. t.set(-1, 0, 0);
  25343. break;
  25344. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  25345. t.set(0, 1, 0);
  25346. break;
  25347. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  25348. t.set(0, -1, 0);
  25349. break;
  25350. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  25351. t.set(0, 0, 1);
  25352. break;
  25353. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  25354. t.set(0, 0, -1)
  25355. }
  25356. }
  25357. ,
  25358. n.getCubeOrientationForCubeFace = function(e, t) {
  25359. switch (e) {
  25360. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  25361. t.set(0, -Math.PI / 2, 0);
  25362. break;
  25363. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  25364. t.set(0, Math.PI / 2, 0);
  25365. break;
  25366. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  25367. t.set(Math.PI / 2, Math.PI, 0);
  25368. break;
  25369. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  25370. t.set(-Math.PI / 2, Math.PI, 0);
  25371. break;
  25372. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  25373. t.set(0, -Math.PI, 0);
  25374. break;
  25375. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  25376. t.set(0, 0, 0)
  25377. }
  25378. }
  25379. ,
  25380. t.exports = n
  25381. }
  25382. , {
  25383. "../enum/GLCubeFaces": 25,
  25384. "../enum/GLTextureType": 26,
  25385. "../enum/SceneRendererEvents": 43,
  25386. "../exception/BasicException": 55,
  25387. "../exception/RendererCreationException": 57,
  25388. "../settings": 166,
  25389. "../shaders": 167,
  25390. /********************************************************************fyz改 from徐世廷**********************************************************************/
  25391. "../util/browser": 182,
  25392. /************************************************************************************************************************************************/
  25393. events: 202,
  25394. three: 217
  25395. }],
  25396. 159: [function(e, t, i) {
  25397. "use strict";
  25398. function n(e) {
  25399. this.messenger = new a(e),
  25400. this.clientKey = null
  25401. }
  25402. var r = e("../util/ajax")
  25403. , o = e("./PostMessageType")
  25404. , a = e("./postmessage")
  25405. , s = e("./VersionInfo")
  25406. , l = e("events").EventEmitter
  25407. , c = window.location.origin + "/api/v1/user/";
  25408. n.prototype = Object.create(l.prototype),
  25409. n.prototype.bindEvents = function() {
  25410. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this))
  25411. }
  25412. ,
  25413. n.prototype.waitForConnection = function() {
  25414. var e = new Promise(function(e, t) {
  25415. this.messenger.on(o.CONNECT, function(i) {
  25416. this.onConnectionReceived(i).then(e.bind(this, i.sdkVersion), t.bind())
  25417. }
  25418. .bind(this))
  25419. }
  25420. .bind(this));
  25421. return e
  25422. }
  25423. ,
  25424. n.prototype.onConnectionReceived = function(e) {
  25425. return this.messenger.setTarget(e.source, e.origin),
  25426. this.verifyConnection(e).then(function(t, i) {
  25427. this.messenger.send({
  25428. type: o.ACCEPT,
  25429. toId: e.fromId,
  25430. warning: i
  25431. }),
  25432. this.clientKey = t,
  25433. this.messenger.removeAllListeners(o.CONNECT),
  25434. this.bindEvents()
  25435. }
  25436. .bind(this), function(t) {
  25437. this.messenger.send({
  25438. type: o.REJECT,
  25439. toId: e.fromId,
  25440. reason: t
  25441. }),
  25442. this.messenger.setTarget()
  25443. }
  25444. .bind(this))
  25445. }
  25446. ,
  25447. n.prototype.verifyConnection = function(e) {
  25448. return new Promise(function(t, i) {
  25449. var n;
  25450. if (s.isDeprecated(e.sdkVersion))
  25451. n = "这个版本正在被弃用";
  25452. else if (!s.isSupported(e.sdkVersion))
  25453. return i("不支持此版本的SDK");
  25454. var o = {
  25455. cache: !1,
  25456. headers: {
  25457. "X-port-Application-Key": e.applicationKey,
  25458. "X-port-Referrer": e.origin
  25459. }
  25460. };
  25461. r.get(c, o).done(t.bind(this, e.applicationKey, n)).fail(i.bind(this, "key/referrer mismatch"))
  25462. }
  25463. )
  25464. }
  25465. ,
  25466. n.prototype.onMessageReceived = function(e) {
  25467. if (this.validateClientApplicationKey(e.applicationKey)) {
  25468. var t = this;
  25469. e.onDone = function(i) {
  25470. i.toId = e.fromId,
  25471. i.uid = e.uid,
  25472. i.type = o.RESPONSE,
  25473. t.messenger.send(i)
  25474. }
  25475. ,
  25476. this.emit(o.ACTION, e)
  25477. }
  25478. }
  25479. ,
  25480. n.prototype.validateClientApplicationKey = function(e) {
  25481. return this.clientKey === e
  25482. }
  25483. ,
  25484. n.prototype.sendEvent = function(e, t) {
  25485. this.messenger.send({
  25486. type: o.EVENT,
  25487. eventType: e,
  25488. eventData: t
  25489. })
  25490. }
  25491. ,
  25492. t.exports = n
  25493. }
  25494. , {
  25495. "../util/ajax": 181,
  25496. "./PostMessageType": 160,
  25497. "./VersionInfo": 163,
  25498. "./postmessage": 165,
  25499. events: 202
  25500. }],
  25501. 160: [function(e, t, i) {
  25502. "use strict";
  25503. t.exports = Object.freeze({
  25504. CONNECT: "postmessage.connect",
  25505. ACCEPT: "postmessage.accept",
  25506. REJECT: "postmessage.reject",
  25507. ACTION: "postmessage.action",
  25508. RESPONSE: "postmessage.response",
  25509. EVENT: "postmessage.event"
  25510. })
  25511. }
  25512. , {}],
  25513. 161: [function(e, t, i) {
  25514. "use strict";
  25515. t.exports = Object.freeze({
  25516. MOVE: "sdk.move",
  25517. ENTER_PANO: "sdk.enterpano",
  25518. MODEL_LOADED: "sdk.modelloaded"
  25519. })
  25520. }
  25521. , {}],
  25522. 162: [function(e, t, i) {
  25523. "use strict";
  25524. t.exports = Object.freeze({
  25525. FLY: "transition.fly",
  25526. FADEOUT: "transition.fade",
  25527. INSTANT: "transition.instant"
  25528. })
  25529. }
  25530. , {}],
  25531. 163: [function(e, t, i) {
  25532. "use strict";
  25533. t.exports = {
  25534. current: "1.0",
  25535. supported: ["1.0"],
  25536. deprecated: [],
  25537. isSupported: function(e) {
  25538. return this.supported.indexOf(e) !== -1
  25539. },
  25540. isDeprecated: function(e) {
  25541. return this.deprecated.indexOf(e) !== -1
  25542. },
  25543. isValid: function(e) {
  25544. return this.isSupported(e) || this.isDeprecated(e)
  25545. }
  25546. }
  25547. }
  25548. , {}],
  25549. 164: [function(e, t, i) {
  25550. (function(i) {
  25551. "use strict";
  25552. function n(e, t, i) {
  25553. e && (e = e.toLowerCase().trim());
  25554. var n = new I.UP.clone
  25555. , r = Math.PI / 3
  25556. , o = Math.PI / 2;
  25557. switch (e) {
  25558. case "left":
  25559. i.copy(t),
  25560. i.applyAxisAngle(n, o);
  25561. break;
  25562. case "right":
  25563. i.copy(t),
  25564. i.applyAxisAngle(n, -o);
  25565. break;
  25566. case "forwardleft":
  25567. i.copy(t),
  25568. i.applyAxisAngle(n, r);
  25569. break;
  25570. case "forwardright":
  25571. i.copy(t),
  25572. i.applyAxisAngle(n, -r);
  25573. break;
  25574. case "forward":
  25575. default:
  25576. i.copy(t)
  25577. }
  25578. return i
  25579. }
  25580. function r(e, t) {
  25581. if (e) {
  25582. var i = {
  25583. pano: e,
  25584. lookAtPoint: null,
  25585. duration: null,
  25586. maxDistanceOverride: null,
  25587. skipWarpingCheck: !1
  25588. };
  25589. this.player.flyToPano(i, function() {
  25590. t && t({
  25591. success: !0,
  25592. message: "Transition complete."
  25593. })
  25594. })
  25595. } else
  25596. R.warn("Showcase -> clickPanoObject: Unable to find pano."),
  25597. t && t({
  25598. success: !1,
  25599. error: "Unable to find pano."
  25600. })
  25601. }
  25602. function o(e, t) {
  25603. var i = this.findRankedPano(e, t);
  25604. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  25605. null)
  25606. }
  25607. function a(e, t) {
  25608. var i = this.findRankedtag(e, t);
  25609. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  25610. null)
  25611. }
  25612. function s(e, t) {
  25613. t.copy(I.FORWARD),
  25614. e.getDirection(t)
  25615. }
  25616. function l(e) {
  25617. function t(e) {
  25618. var t = (new c.Euler).setFromQuaternion(e.quaternion, "YXZ");
  25619. return {
  25620. x: c.Math.radToDeg(t._x),
  25621. y: c.Math.radToDeg(t._y),
  25622. z: c.Math.radToDeg(t._z)
  25623. }
  25624. }
  25625. var i = function(e) {
  25626. return e.alignmentType !== m.ALIGNED ? null : {
  25627. x: e.position.x,
  25628. y: e.position.y,
  25629. z: e.position.z
  25630. }
  25631. };
  25632. return {
  25633. panos: e.panos.list.map(function(n) {
  25634. var r = y.getCubemapUrls(e.urls, n.id, "high")[C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  25635. return {
  25636. uuid: n.id,
  25637. aligned: n.alignmentType === m.ALIGNED,
  25638. neighbourUUIDs: n.neighbourUUIDs.slice(),
  25639. position: i(n),
  25640. rotation: t(n),
  25641. thumbnail: r
  25642. }
  25643. })
  25644. }
  25645. }
  25646. var c = e("three")
  25647. , h = e("./ApiHost")
  25648. , u = e("../util/logger")
  25649. , d = e("../util/common")
  25650. , p = e("../util/math")
  25651. , f = e("../enum/ModelManagerEvents")
  25652. , g = e("./PostMessageType")
  25653. , m = e("../enum/AlignmentType")
  25654. , v = e("../enum/Direction")
  25655. , A = e("./TransitionStyles")
  25656. , y = e("../util/panorama")
  25657. , C = e("../enum/GLCubeFaces")
  25658. , I = e("../enum/Vectors")
  25659. , E = e("../enum/Viewmode")
  25660. , b = e("../enum/WarpStyle")
  25661. , w = (e("../enum/Keys"),
  25662. e("../enum/PlayerEvents"))
  25663. , _ = e("../sdk/SdkEvents")
  25664. , I = e("../enum/Vectors")
  25665. , T = e("../enum/ControlEvents")
  25666. , x = e("../enum/RenderLayers")
  25667. , S = (e("../constants"),
  25668. e("../settings"))
  25669. , M = e("../lib/jpeg_encoder")
  25670. , R = new u(i)
  25671. , P = function() {
  25672. var e = function e() {
  25673. e.playerDirection.copy(e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25674. e.player.getDirection(e.playerDirection),
  25675. e.projectVectors();
  25676. var t = e.playerDirection.angleTo(e.lastFacingDirection);
  25677. if (e.angleTravelled += Math.abs(t),
  25678. e.angleTravelled >= Math.abs(e.angle)) {
  25679. if (e.active = !1,
  25680. e.onDone) {
  25681. var i = e.onDone;
  25682. i()
  25683. }
  25684. } else
  25685. e.lastFacingDirection.copy(e.playerDirection),
  25686. window.setTimeout(e, 4)
  25687. };
  25688. return e.active = !1,
  25689. e.angle = 0,
  25690. e.angleTravelled = 0,
  25691. e.playerDirection = new c.Vector3,
  25692. e.lastFacingDirection = new c.Vector3,
  25693. e.onDone = null,
  25694. e.player = null,
  25695. e.start = function(t, i, n, r) {
  25696. e.active = !0,
  25697. t && i && (i = 0),
  25698. e.angle = t || i,
  25699. e.xAngle = t,
  25700. e.yAngle = i,
  25701. e.angleTravelled = 0,
  25702. e.playerDirection.copy(n.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25703. n.getDirection(e.playerDirection),
  25704. e.lastFacingDirection.copy(e.playerDirection),
  25705. e.projectVectors(),
  25706. e.onDone = r,
  25707. e.player = n,
  25708. e()
  25709. }
  25710. ,
  25711. e.projectVectors = function() {
  25712. e.xAngle && (e.playerDirection.projectOnPlane(I.UP),
  25713. e.lastFacingDirection.projectOnPlane(I.UP))
  25714. }
  25715. ,
  25716. e
  25717. }()
  25718. , O = function() {
  25719. var e = new c.Vector3;
  25720. return function(t) {
  25721. t ? (e.copy(t.position),
  25722. e.add(t.discPosition),
  25723. p.projectPositionToCanvas(e, this.player.camera, e),
  25724. this.click(e.x, e.y)) : R.warn("Showcase -> clicktagObject: Unable to find tag.")
  25725. }
  25726. }()
  25727. , L = function() {
  25728. return this.player.mode === E.PANORAMA ? S.insideLookLimitUp : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle) : null
  25729. }
  25730. , D = function() {
  25731. return this.player.mode === E.PANORAMA ? S.insideLookLimitDown : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle) : null
  25732. }
  25733. , N = function(e) {
  25734. var t = new c.Vector3;
  25735. return function(e) {
  25736. var i = this.player.getDirection();
  25737. t.copy(i);
  25738. var n = t.y;
  25739. t.y = 0,
  25740. t.normalize();
  25741. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1);
  25742. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.PANORAMA)
  25743. return 0 !== e && R.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  25744. 0;
  25745. this.player.mode === E.DOLLHOUSE && (r = -r);
  25746. var o = L.call(this) - .1
  25747. , a = D.call(this) + .1
  25748. , s = r + e;
  25749. s > o ? s = o : s < a && (s = a);
  25750. var l = s - r;
  25751. return e > 0 && l < .01 && (l = 0),
  25752. e < 0 && l > -.01 && (l = 0),
  25753. l
  25754. }
  25755. }()
  25756. , B = function() {
  25757. var e = new c.Euler;
  25758. return function(t) {
  25759. return e.setFromQuaternion(t.quaternion, "YXZ"),
  25760. {
  25761. position: {
  25762. x: t.position.x,
  25763. y: t.position.y,
  25764. z: t.position.z
  25765. },
  25766. rotation: {
  25767. x: c.Math.radToDeg(e.x),
  25768. y: c.Math.radToDeg(e.y),
  25769. z: 0
  25770. },
  25771. pano: t.currentPano ? t.currentPano.id : null,
  25772. mode: t.mode
  25773. }
  25774. }
  25775. }()
  25776. , F = null;
  25777. t.exports = {
  25778. init: function(e, t, i, n, r) {
  25779. V.init(e, t, i, r),
  25780. F = new Promise(function(e, t) {
  25781. i.on(w.Ready, function() {
  25782. e()
  25783. })
  25784. }
  25785. .bind(this));
  25786. var o = new h(window)
  25787. , a = o.waitForConnection();
  25788. a.then(function(e) {
  25789. o.on(g.ACTION, V.onMessageReceive.bind(V))
  25790. });
  25791. var s = function() {
  25792. var e = Date.now();
  25793. return function() {
  25794. if (!(Date.now() - e < 100)) {
  25795. var t = B(i);
  25796. o.sendEvent(_.MOVE, {
  25797. state: t
  25798. }),
  25799. e = Date.now()
  25800. }
  25801. }
  25802. }();
  25803. i.on(w.Move, s),
  25804. i.on(w.ViewChanged, s),
  25805. n.on(f.ActiveModelChanged, function(e) {
  25806. function t(e) {
  25807. var t, i = e.newPano.id;
  25808. e.oldPano && (t = e.oldPano.id),
  25809. i !== t && o.sendEvent(_.ENTER_PANO, {
  25810. oldPano: t,
  25811. newPano: i
  25812. })
  25813. }
  25814. var i = e.model
  25815. , n = e.oldModel;
  25816. V.model = i,
  25817. a.then(function() {
  25818. o.sendEvent(_.MODEL_LOADED, {
  25819. metadata: l(i)
  25820. })
  25821. }),
  25822. n && n.panos.forEach(function(e) {
  25823. e.removeEventListener("enter", t)
  25824. }),
  25825. i.panos.forEach(function(e) {
  25826. e.on("enter", t)
  25827. })
  25828. })
  25829. }
  25830. };
  25831. var V = {
  25832. director: null,
  25833. player: null,
  25834. controls: null,
  25835. sceneRenderer: null,
  25836. model: null,
  25837. init: function(e, t, i, n) {
  25838. this.director = e,
  25839. this.player = i,
  25840. this.controls = t,
  25841. this.sceneRenderer = n
  25842. },
  25843. handleToObject: {},
  25844. objectToHandle: {},
  25845. handleCount: 0,
  25846. onMessageReceive: function(e) {
  25847. if (e) {
  25848. var t = e.targetFunction
  25849. , i = e.params
  25850. , n = e.onDone;
  25851. t && this[t] && this[t](i, n)
  25852. }
  25853. },
  25854. waitForInit: function(e, t) {
  25855. F.then(t.bind({
  25856. success: !0,
  25857. message: "Init complete."
  25858. }))
  25859. },
  25860. moveToPano: function(e, t) {
  25861. var i = new c.Euler(0,0,0,"YXZ")
  25862. , n = new c.Quaternion;
  25863. return function(e, t) {
  25864. var r = e.pano
  25865. , o = e.rotation
  25866. , a = e.transition;
  25867. if (!this.model)
  25868. return t({
  25869. success: !1,
  25870. error: "The model has not been loaded yet"
  25871. });
  25872. var s = this.model.panos.get(r);
  25873. if (!s)
  25874. return t({
  25875. success: !1,
  25876. error: r + " does not exist in this model"
  25877. });
  25878. if (!o)
  25879. return t({
  25880. sucess: !1,
  25881. erorr: o + " is not a valid rotation"
  25882. });
  25883. i.set(c.Math.degToRad(o.x || 0), c.Math.degToRad(o.y || 0), c.Math.degToRad(o.z || 0), "YXZ"),
  25884. console.log(o.z);
  25885. var l = {
  25886. success: !0,
  25887. message: r
  25888. };
  25889. if (a === A.FADEOUT)
  25890. n.setFromEuler(i),
  25891. this.player.warpToPano(s, n, null, null, b.BLACK, null, null, t.bind(this, l));
  25892. else {
  25893. var h, u;
  25894. a === A.INSTANT && (h = 0,
  25895. u = 0);
  25896. var d = I.FORWARD.clone().applyEuler(i).add(s.position);
  25897. this.player.flyToPano({
  25898. pano: s,
  25899. lookAtPoint: d,
  25900. duration: h,
  25901. aimDuration: u
  25902. }, t.bind(this, l))
  25903. }
  25904. }
  25905. }(),
  25906. moveInDirection: function(e, t) {
  25907. var i = e.direction;
  25908. return "undefined" == typeof v[i] ? (R.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  25909. void (t && t({
  25910. success: !1,
  25911. error: "Invalid direction."
  25912. }))) : void this.player.flyLocalDirection(I[i].clone()).then(function(e) {
  25913. t(e ? {
  25914. success: !0,
  25915. message: "moved " + i
  25916. } : {
  25917. success: !1,
  25918. error: "Cannot move in direction: " + i
  25919. })
  25920. })
  25921. },
  25922. getPose: function(e, t) {
  25923. this.player.camera.position,
  25924. (new c.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ");
  25925. return t({
  25926. success: !0,
  25927. message: B(this.player)
  25928. })
  25929. },
  25930. takeScreenShot: function() {
  25931. var e = new c.PerspectiveCamera
  25932. , t = new c.WebGLRenderTarget;
  25933. return function(i, n) {
  25934. if (!i.resolution)
  25935. return n({
  25936. success: !1,
  25937. error: "An invalid resolution was specified"
  25938. });
  25939. if (i.resolution.width === -1 || i.resolution.height === -1) {
  25940. var r = this.sceneRenderer.renderer.getSize();
  25941. i.resolution.width = r.width,
  25942. i.resolution.height = r.height
  25943. }
  25944. e.layers.set(x.DEFAULT),
  25945. i.visibleObjects && (i.visibleObjects.showtags && e.layers.enable(x.TAG),
  25946. i.visibleObjects.showPucks && e.layers.enable(x.PANOMARKERS),
  25947. i.visibleObjects.showReticule && e.layers.enable(x.RETICULE));
  25948. var o = i.resolution.width
  25949. , a = i.resolution.height
  25950. , s = o / a;
  25951. e.position.copy(this.sceneRenderer.camera.position),
  25952. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  25953. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  25954. e.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / s,
  25955. t.setSize(o, a),
  25956. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, e, t);
  25957. var l = new Uint8Array(o * a * 4);
  25958. this.sceneRenderer.renderer.readRenderTargetPixels(t, 0, 0, o, a, l);
  25959. var c = M.encode({
  25960. data: l,
  25961. width: o,
  25962. height: a,
  25963. heading: 180,
  25964. pitch: 0
  25965. }, {
  25966. quality: 75,
  25967. flipY: !0
  25968. })
  25969. , h = "data:image/jpg;base64," + d.uint8ToBase64(c.data);
  25970. n({
  25971. success: !0,
  25972. message: h
  25973. })
  25974. }
  25975. }(),
  25976. findRankedPano: function(e, t) {
  25977. var i = new c.Vector3
  25978. , r = new c.Vector3;
  25979. return function(e, t) {
  25980. s(this.player, r),
  25981. n(t, r, i);
  25982. var o = this.player.rankedPanoInDirection(e, i);
  25983. if (o) {
  25984. var a = this.objectToHandle[o.id];
  25985. return a || (this.objectToHandle[o.id] = a = this.handleCount++,
  25986. this.handleToObject[a] = o),
  25987. a
  25988. }
  25989. return R.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  25990. -1
  25991. }
  25992. }(),
  25993. findRankedtag: function(e, t) {
  25994. var i = new c.Vector3
  25995. , r = new c.Vector3;
  25996. return function(e, t) {
  25997. s(this.player, r),
  25998. n(t, r, i);
  25999. var o = this.player.rankedtagInDirection(e, i);
  26000. if (o) {
  26001. var a = this.objectToHandle[o.sid];
  26002. return a || (this.objectToHandle[o.sid] = a = this.handleCount++,
  26003. this.handleToObject[a] = o),
  26004. a
  26005. }
  26006. return R.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  26007. -1
  26008. }
  26009. }(),
  26010. clickNearesttag: function(e) {
  26011. this.clickRankedtag(0, e)
  26012. },
  26013. clickRankedtag: function(e, t) {
  26014. var i = a.call(this, e, t);
  26015. i && O.call(this, i)
  26016. },
  26017. clickNearestPano: function(e, t) {
  26018. this.clickRankedPano(0, e, t)
  26019. },
  26020. clickRankedPano: function(e, t, i) {
  26021. var n = o.call(this, e, t);
  26022. n ? r.call(this, n, i) : i(null)
  26023. },
  26024. clickPano: function(e, t) {
  26025. var i = this.handleTable[e];
  26026. i ? r.call(this, i, t) : t(null)
  26027. },
  26028. rotateDirection: function() {
  26029. return function(e, t) {
  26030. var i = e.direction
  26031. , n = e.angle;
  26032. if (!P.active) {
  26033. var r = 0
  26034. , o = 0
  26035. , a = 0
  26036. , s = 0;
  26037. if (!n || isNaN(n))
  26038. return R.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  26039. void (t && t({
  26040. success: !1,
  26041. error: "Invalid rotation angle."
  26042. }));
  26043. if (this.player.mode === E.TRANSITIONING)
  26044. return R.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  26045. void (t && t({
  26046. success: !1,
  26047. error: "Cannot rotate while transitioning"
  26048. }));
  26049. if (i === v.RIGHT || i === v.LEFT)
  26050. i === v.RIGHT && (n = -n),
  26051. r = n > 0 ? -1 : 1,
  26052. a = n;
  26053. else {
  26054. if (i !== v.UP && i !== v.DOWN)
  26055. return R.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  26056. void (t && t({
  26057. success: !1,
  26058. error: "Invalid direction for rotation."
  26059. }));
  26060. if (this.player.mode === E.FLOORPLAN)
  26061. return R.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  26062. void (t && t({
  26063. success: !1,
  26064. error: "Cannot rotate " + i + " in floorplan mode"
  26065. }));
  26066. if (i === v.DOWN && (n = -n),
  26067. n = N.call(this, n),
  26068. 0 === n)
  26069. return R.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  26070. void (t && t({
  26071. success: !1,
  26072. error: "Already at maximum rotation in direction: " + i
  26073. }));
  26074. o = n > 0 ? 1 : -1,
  26075. s = n
  26076. }
  26077. var l = n;
  26078. n = c.Math.degToRad(n),
  26079. a = c.Math.degToRad(a),
  26080. s = c.Math.degToRad(s);
  26081. var h = this.controls.activeControl
  26082. , u = function() {
  26083. h.stopRotating(!0),
  26084. t && t({
  26085. success: !0,
  26086. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  26087. })
  26088. };
  26089. h.startRotating(r, o),
  26090. P.start(a, s, this.player, u)
  26091. }
  26092. }
  26093. }(),
  26094. rotate: function() {
  26095. var e = new c.Vector3
  26096. , t = new c.Vector3;
  26097. return function(i, n) {
  26098. var r = i.xAngle
  26099. , o = i.yAngle;
  26100. if (!P.active) {
  26101. if (r = r || 0,
  26102. o = o || 0,
  26103. isNaN(r) || isNaN(o))
  26104. return R.warn("Showcase -> rotate: Invalid rotation angle."),
  26105. void (n && n({
  26106. success: !1,
  26107. error: "Invalid rotation angle."
  26108. }));
  26109. if (this.player.mode === E.TRANSITIONING)
  26110. return R.warn("Automation -> rotate: Cannot rotate while transitioning"),
  26111. void (n && n({
  26112. success: !1,
  26113. error: "Cannot rotate while transitioning"
  26114. }));
  26115. Math.abs(r) < .01 && (r = 0),
  26116. Math.abs(o) < .01 && (o = 0);
  26117. var a = o;
  26118. o = N.call(this, o),
  26119. r = -r;
  26120. var s = a > 0 ? "UP" : "DOWN";
  26121. if (!r && a && !o)
  26122. return R.warn("Showcase -> rotate: Already at maximum rotation in direction: " + s),
  26123. void (n && n({
  26124. success: !1,
  26125. error: "Already at maximum rotation in direction: " + s
  26126. }));
  26127. a > o && R.warn("Showcase -> rotate: Reached maximum rotation in direction: " + s);
  26128. var l = o;
  26129. o = c.Math.degToRad(o),
  26130. r = c.Math.degToRad(r),
  26131. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  26132. this.player.getDirection(e),
  26133. t.copy(e).applyAxisAngle(I.UP, r),
  26134. t.applyAxisAngle(I.RIGHT, o);
  26135. var h = (e.angleTo(t),
  26136. r > 0 ? -1 : r < 0 ? 1 : 0)
  26137. , u = o > 0 ? 1 : o < 0 ? -1 : 0;
  26138. Math.abs(r) > Math.abs(o) ? u *= Math.abs(o / r) : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o));
  26139. var d = this.controls.activeControl
  26140. , p = function() {
  26141. d.stopRotating(!0),
  26142. n && n({
  26143. success: !0,
  26144. message: "Rotated " + i.xAngle.toFixed(2) + "° horizontally, " + l.toFixed(2) + "° vertically"
  26145. })
  26146. };
  26147. d.startRotating(h, u),
  26148. P.start(r, o, this.player, p)
  26149. }
  26150. }
  26151. }(),
  26152. panCamera: function(e, t) {
  26153. function i(e) {
  26154. switch (r.removeAllListeners(T.AutoPanComplete),
  26155. r.removeAllListeners(T.AutoPanInterrupt),
  26156. r.removeAllListeners(T.AutoPanClamped),
  26157. e) {
  26158. case T.AutoPanInterrupt:
  26159. t({
  26160. success: !0,
  26161. message: "Camera panning interrupted."
  26162. });
  26163. break;
  26164. case T.AutoPanClamped:
  26165. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  26166. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  26167. return void t({
  26168. success: !1,
  26169. error: "Already at edge of current model bounds."
  26170. });
  26171. var i = "The view point is outside the bounds for the current model. ";
  26172. i += "The view point was clamped to " + o(r.target.x, r.target.z),
  26173. console.warn(i)
  26174. }
  26175. case T.AutoPanComplete:
  26176. t({
  26177. success: !0,
  26178. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  26179. })
  26180. }
  26181. }
  26182. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.FLOORPLAN)
  26183. return t({
  26184. success: !1,
  26185. error: "Camera panning is not available in the current mode: " + this.player.mode
  26186. });
  26187. var n = e.position
  26188. , r = this.player.control;
  26189. r.setAutoPanPosition(n.x, n.z),
  26190. r.autoPan = !0;
  26191. var o = function(e, t) {
  26192. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  26193. };
  26194. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)),
  26195. r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)),
  26196. r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped))
  26197. },
  26198. click: function(e, t) {
  26199. var i = e.x
  26200. , n = e.y
  26201. , r = e.percentage;
  26202. r === !0 && (i = i / 100 * $("#player").width(),
  26203. n = n / 100 * $("#player").height()),
  26204. this.player.handleInputStart(i, n),
  26205. this.player.updateIntersect(),
  26206. this.player.handleInputEnd(i, n)
  26207. },
  26208. mouseOver: function(e, t) {
  26209. var i = e.x
  26210. , n = e.y
  26211. , r = e.percentage;
  26212. r === !0 && (i = i / 100 * $("#player").width(),
  26213. n = n / 100 * $("#player").height()),
  26214. this.player.handleInputMove(i, n),
  26215. this.player.updateIntersect()
  26216. },
  26217. moveToMode: function(e, t) {
  26218. function i(e) {
  26219. t(e ? {
  26220. success: !1,
  26221. error: "Failed to load new mode: " + e
  26222. } : {
  26223. success: !0,
  26224. message: "Moved to new mode: " + n
  26225. })
  26226. }
  26227. var n = e.mode;
  26228. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN ? this.director.changeMode(n).then(function() {
  26229. i()
  26230. }, function(e) {
  26231. i(e)
  26232. }) : t({
  26233. success: !1,
  26234. error: "Invalid mode selection"
  26235. })
  26236. }
  26237. }
  26238. }
  26239. ).call(this, "/js/sdk/automation.js")
  26240. }
  26241. , {
  26242. "../constants": 8,
  26243. "../enum/AlignmentType": 17,
  26244. "../enum/ControlEvents": 21,
  26245. "../enum/Direction": 22,
  26246. "../enum/GLCubeFaces": 25,
  26247. "../enum/Keys": 30,
  26248. "../enum/ModelManagerEvents": 33,
  26249. "../enum/PlayerEvents": 40,
  26250. "../enum/RenderLayers": 41,
  26251. "../enum/Vectors": 50,
  26252. "../enum/Viewmode": 51,
  26253. "../enum/WarpStyle": 52,
  26254. "../lib/jpeg_encoder": 94,
  26255. "../sdk/SdkEvents": 161,
  26256. "../settings": 166,
  26257. "../util/common": 185,
  26258. "../util/logger": 189,
  26259. "../util/math": 190,
  26260. "../util/panorama": 191,
  26261. "./ApiHost": 159,
  26262. "./PostMessageType": 160,
  26263. "./TransitionStyles": 162,
  26264. three: 217
  26265. }],
  26266. 165: [function(e, t, i) {
  26267. "use strict";
  26268. function n(e) {
  26269. this.sourceWindow = e,
  26270. this.targetWindow = null,
  26271. this.targetOrigin = null,
  26272. this.id = Math.floor(1e5 * Math.random()),
  26273. this.bindEvents()
  26274. }
  26275. var r = e("./PostMessageType")
  26276. , o = e("events").EventEmitter;
  26277. n.prototype = Object.create(o.prototype),
  26278. n.prototype.bindEvents = function() {
  26279. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  26280. }
  26281. ,
  26282. n.prototype.setTarget = function(e, t) {
  26283. this.targetWindow = e,
  26284. this.targetOrigin = t
  26285. }
  26286. ,
  26287. n.prototype.onPostmessageReceived = function(e) {
  26288. var t = e.origin || e.originalEvent.origin
  26289. , i = e.source;
  26290. switch (e.data.type) {
  26291. case r.CONNECT:
  26292. break;
  26293. case r.RESPONSE:
  26294. if (this.id !== e.data.toId)
  26295. return;
  26296. default:
  26297. if (!this.validateMessageOrigin(t))
  26298. return
  26299. }
  26300. var n = e.data;
  26301. n.source = i,
  26302. n.origin = t,
  26303. n.timestamp = Date.now(),
  26304. this.emit(e.data.type, n)
  26305. }
  26306. ,
  26307. n.prototype.validateMessageOrigin = function(e) {
  26308. return "*" === this.targetOrigin || e === this.targetOrigin
  26309. }
  26310. ,
  26311. n.prototype.send = function(e) {
  26312. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  26313. this.targetWindow.postMessage(e, this.targetOrigin))
  26314. }
  26315. ,
  26316. t.exports = n
  26317. }
  26318. , {
  26319. "./PostMessageType": 160,
  26320. events: 202
  26321. }],
  26322. 166: [function(e, t, i) {
  26323. "use strict";
  26324. var n = e("three")
  26325. , r = e("./util/browser")
  26326. , o = e("./enum/Viewmode")
  26327. , a = e("./enum/VROption")
  26328. , s = e("./enum/Colors")
  26329. , l = e("./enum/WarpStyle")
  26330. , c = e("./util/easing")
  26331. , h = e("./util/common")
  26332. , u = e("./util/showcase")
  26333. , d = e("./constants")
  26334. , p = {
  26335. debug: !1,
  26336. version: "2.25.6-0-gd87e5b1",
  26337. languageTag: r.valueFromHash("lang", null),
  26338. pageTitle: "四维虚拟漫游",
  26339. authorizationHeader: u.getAuthorizationHeader(),
  26340. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  26341. logLevel: r.valueFromHash("log", 2),
  26342. skyboxRadius: 2500,
  26343. modelBoundsPadding: 5,
  26344. showNeighbors: !1,
  26345. brand: r.valueFromHash("brand", !0),
  26346. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  26347. startHighlights: r.valueFromHash("hl", -1),
  26348. specialEdition: r.valueFromHash("bn", 0),
  26349. useWheel: r.valueFromHash("wh", !0),
  26350. crossOrigin: "anonymous",
  26351. fancierTransition: !1,
  26352. wireframe: !1,
  26353. skyboxWireframe: !1,
  26354. modelAlpha: 1,
  26355. highlightPanoSelection: !1,
  26356. showSweeps: !0,
  26357. showSkyboxes: !1,
  26358. showMesh: !0,
  26359. showFloors: !1,
  26360. showFloorDuration: 300,
  26361. showFloorDelay: 300,
  26362. hideFloorDuration: 300,
  26363. hideFloorDelay: 0,
  26364. reticuleOpacityTransitionTime: 250,
  26365. reticuleColor: window.MP_PREFETCHED_MODELDATA.mouseMarkerColor || s.newBlue, // 方奕卓 配置鼠标标志颜色
  26366. markerOpacityTransitionTime: 500,
  26367. guiAnimationSpeed: 250,
  26368. highlightAnimationDuration: 500,
  26369. modelComponentLoadSpinnerDelay: 150,
  26370. captureErrors: !1,
  26371. maxMobileTextures: 6,
  26372. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  26373. startupFlyinDelay: 3e3,
  26374. dollhouseDefault: {
  26375. minDistance: 15,
  26376. maxDistance: 50,
  26377. minPolarAngle: n.Math.degToRad(10),
  26378. maxPolarAngle: n.Math.degToRad(90)
  26379. },
  26380. hideReticuleTimeout: 1e3,
  26381. analytics: {
  26382. inactivityThreshold: 30,
  26383. sessionTrackingRate: .15,
  26384. maxTrackedErrors: 20,
  26385. sessionDurationPingFrequency: 10,
  26386. sessionDurationTimeout: 15
  26387. },
  26388. flydown: {
  26389. movementEasing: "easeInOutQuad",
  26390. movementDelay: .001,
  26391. rotationEasing: "easeInOutQuad",
  26392. rotationDelay: .5,
  26393. modelTextureDelay: .75,
  26394. skyboxDelay: .75
  26395. },
  26396. transition: {
  26397. flySpeed: .001,
  26398. flyTime: 750,
  26399. flytimeMaxDistanceThreshold: 5,
  26400. flytimeDistanceMultiplier: 150,
  26401. aimTime: 1500,
  26402. aimSlowFactor: 1.5,
  26403. blur: 0.8,
  26404. movementEasing: "easeInOutQuad",
  26405. blendEasing: "easeInOutQuad",
  26406. fastForwardFactor: 3//r.valueFromHash("mfis", 3)
  26407. },
  26408. show360Views: {
  26409. enabled: !0,
  26410. transitionTime: 1e3
  26411. },
  26412. quickstart: {
  26413. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  26414. animation: 1400,
  26415. showTextDelay: 500,
  26416. fadeOutDelay: 3e3,
  26417. fovChange: 10
  26418. },
  26419. appConfig: {
  26420. webvr_version: null,
  26421. segment_key: null,
  26422. embedly_key: null,
  26423. branch_key: null,
  26424. keen_write_key: null,
  26425. keen_project_id: null
  26426. },
  26427. vr: {
  26428. enabled: !0,
  26429. allowWebVR: !1,
  26430. option: r.valueFromHash("vr", a.CONTEXTUAL)
  26431. },
  26432. share: {
  26433. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  26434. },
  26435. input: {
  26436. longTapThreshold: 200,
  26437. moveToleranceNDC: .08,
  26438. touchMoveThreshold: 25
  26439. },
  26440. help: {
  26441. modalStayDuration: 600
  26442. },
  26443. immersive: {
  26444. timeToShowAgain: 1250,
  26445. uiStayDuration: 600
  26446. },
  26447. tourInteraction: {
  26448. disabled: "0" === r.valueFromHash("tourcta", null),
  26449. showPauseButton: 1e3,
  26450. showModal: 1500,
  26451. allowNextClick: 200,
  26452. largeModal: "1" === r.valueFromHash("tourcta", null),
  26453. smallModal: "2" === r.valueFromHash("tourcta", null)
  26454. },
  26455. labels: {
  26456. enabled: !1,
  26457. hideUntilStart: !0,
  26458. fadeInDuration: 250,
  26459. fadeInDelay: 250,
  26460. fadeOutDuration: 250,
  26461. fadeOutDelay: 0,
  26462. zoomHideThreshhold: {
  26463. mobile: r.isSmallScreen() ? .45 : .6,
  26464. desktop: 2
  26465. },
  26466. zoomTruncateThreshhold: {
  26467. mobile: r.isSmallScreen() ? .35 : .45,
  26468. desktop: .85
  26469. },
  26470. minLengthForTruncate: 16,
  26471. truncateLength: 12,
  26472. truncateSuffix: "..."
  26473. },
  26474. tags: {
  26475. enabled: r.valueFromHash("mt", 1),
  26476. startup: {
  26477. hideUntilStart: !0,
  26478. fadeInDuration: 500,
  26479. fadeInDelay: 100
  26480. },
  26481. visibility: {
  26482. anyDistance: !0,
  26483. visibleDistance: 8,
  26484. cameraClearance: .1,
  26485. alphaTestLevel: .05,
  26486. hideViaFloor: !0,
  26487. hideOffScreenDisc: !1,
  26488. hideOffScreenObject: !1
  26489. },
  26490. disc: {
  26491. opacity: 1,
  26492. disabledOpacity: .5,
  26493. scale: {
  26494. nearBound: 1.5,
  26495. farBound: 4.8,
  26496. linkFarBound: !1,
  26497. linkPercent: 40,
  26498. maxSize: 80,
  26499. minSize: 40,
  26500. baseViewportSize: 800,
  26501. responsiveness: 100
  26502. }
  26503. },
  26504. pole: {
  26505. enabled: !0,
  26506. height: .5,
  26507. width: 2,
  26508. opacity: .5,
  26509. color: "white"
  26510. },
  26511. navigate: {
  26512. nearestPano: !0,
  26513. lineOfSight: !0,
  26514. reactivate: !0,
  26515. aimAt: "disc",
  26516. tiltTolerance: 25,
  26517. rotateSpeedFactor: .6
  26518. }
  26519. },
  26520. path: {
  26521. color: window.MP_PREFETCHED_MODELDATA.floorMarkerColor || s.newBlue, // 方奕卓 配置导览标志颜色
  26522. colorUp: s._desat(s.newBlue, .5),
  26523. colorDown: s._darken(s.newBlue, .35),
  26524. opacity: .5,
  26525. style: "ribbon",
  26526. height: .025,
  26527. ribbonWidth: .24,
  26528. outsideHeight: .5,
  26529. waypointRadius: .5,
  26530. waypointIndoorRadius: .24,
  26531. waypointPulse: 1e3,
  26532. typ: l.BLACK,
  26533. meshFree: r.valueFromHash("mf", 1),
  26534. mapGuides: r.valueFromHash("guides", !0),
  26535. fadeInTime: 400,
  26536. fadeOutTime: 300
  26537. },
  26538. warp: {
  26539. nearPanoDist: .1,
  26540. matchCam: !1,
  26541. blur: .33,
  26542. fastTime: 1500,
  26543. teleportTime: 1500,
  26544. outsideTime: 2e3,
  26545. lookAheadMax: .3,
  26546. lookAheadDist: 2.5,
  26547. softPushDist: .37,
  26548. softPushEnd: .3,
  26549. softBendAngle: 8,
  26550. softBendTilt: 4,
  26551. softBendEnd: .3,
  26552. doBurns: true, //r.valueFromHash("kb", !0),
  26553. burnsAngle: 8, //导览在每个点停留时的旋转角度
  26554. minBurnsAngle: 35,
  26555. minDownAngle: -35,
  26556. maxTurnPerSec: 280,
  26557. maxAimPerSec: 35,
  26558. minRotation: 12,
  26559. maxAimRotation: 33.2,
  26560. turnFriction: .2,
  26561. flySpeed: .01,
  26562. minWarpTime: 1200,
  26563. warpInterruptionRedirectTime: 500,
  26564. tourStepDelay: r.valueFromHash("st", 0),
  26565. walkDelay: 0,
  26566. walkMaxDist: 50,
  26567. walkMinDist: .8,
  26568. walkSlideShowThreshhold: 3000,
  26569. walkExtraPanosDistance: .4,
  26570. timePerMeter: 1200,
  26571. motionLeadTime: 5000,
  26572. movementEasing: "easeInOutQuad",
  26573. blendEasing: "easeInOutQuad",
  26574. showBunny: !1,
  26575. loop: r.valueFromHash("lp", !1),
  26576. auto: r.valueFromHash("ts", -1),
  26577. eOrder: 'YXZ', //"YXZ",
  26578. stepFactor: .25,
  26579. brakeStrength: 2,
  26580. minBrakeAngle: .1,
  26581. maxBrakeAngle: 1.8,
  26582. climbEffort: 4
  26583. },
  26584. rotationFriction: .05,
  26585. rotationAccelerationInside: 4.5,
  26586. rotationAccelerationOutside: .15,
  26587. rotationAfterMoveMultiplier: 40,
  26588. rotationAfterMoveHistoryCount: 5,
  26589. panFriction: .09,
  26590. panAccelerationOutside: 60,
  26591. onload: r.valueFromHash("onload", o.PANORAMA),
  26592. zoomNearLimit: .1,
  26593. zoomFarLimit: 50,
  26594. navigation: {
  26595. panoScores: !1,
  26596. mouseDirection: !0,
  26597. filterStrictness: .75,
  26598. angleFactor: -30,
  26599. directionFactor: 10,
  26600. distanceFactor: -1,
  26601. optionalityFactor: 3
  26602. },
  26603. sdkInit: !1,
  26604. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  26605. console: r.valueFromHash("console", !1),
  26606. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  26607. panoramaNeighbourMaxDistance: 5,
  26608. panoFloorClickRadius: .35,
  26609. showScreenshotLocations: !1,
  26610. showAxis: !1,
  26611. showNeighbourRaycasts: !1,
  26612. colorMarkerOnLoad: !1,
  26613. colorMarkerByFloor: !1,
  26614. tiling: {
  26615. panoPreRenderRepeatDelay: 2500,
  26616. panoPreRenderDelay: 500,
  26617. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  26618. tilingFlagNames: ["usetiles", "tiles"],
  26619. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  26620. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  26621. overlayStyle: r.valueFromHash("tileoverlay", 0),
  26622. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  26623. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  26624. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  26625. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  26626. customCompression: r.valueFromHash("tilecustcomp", 0),
  26627. // mobileHighQualityOverride: !1,
  26628. mobileHighQualityOverride: 1,
  26629. allowUltraHighResolution: true
  26630. },
  26631. zoom: {
  26632. enabled: true,
  26633. forceOff: r.valueFromHash("nozoom", 0),
  26634. overridemax: r.valueFromHash("maxzoom", null),
  26635. overridemin: r.valueFromHash("minzoom", null),
  26636. max: d.highQualityMaxZoom,
  26637. min: 1,
  26638. transitionStyle: r.valueFromHash("zoomtrans", 1),
  26639. activationThreshold: 1.1,
  26640. restoreTime: 500
  26641. },
  26642. profiling: {
  26643. enabled: r.valueFromHash("mem", !1)
  26644. }
  26645. };
  26646. p = h.deepExtend(p, d, {
  26647. insideFOV: r.valueFromHash("fov", d.insideFOV),
  26648. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  26649. panorama: {
  26650. transitionTime: 1e3,
  26651. modelAlpha: 0,
  26652. modelAlphaDelay: p.flydown.modelTextureDelay,
  26653. modelAlphaLength: 1,
  26654. skyboxOpacity: 1,
  26655. skyboxOpacityDelay: p.flydown.skyboxDelay,
  26656. skyboxOpacityLength: .9,
  26657. fovLength: 1,
  26658. fovDelay: 0,
  26659. cameraMatrixDuration: .8,
  26660. cameraMatrixDelay: 0,
  26661. cameraMatrixEase: c.easeInCubic,
  26662. reticuleOpacity: 1,
  26663. markerOpacity: .3,
  26664. markerOpacityOnHover: 1
  26665. },
  26666. dollhouse: {
  26667. transitionTime: 1e3,
  26668. modelAlpha: 1,
  26669. modelAlphaDelay: 0,
  26670. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  26671. skyboxOpacity: 0,
  26672. skyboxOpacityDelay: 0,
  26673. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  26674. fovLength: 1,
  26675. fovDelay: 0,
  26676. cameraMatrixDuration: .8,
  26677. cameraMatrixDelay: .3,
  26678. cameraMatrixEase: c.easeInCubic,
  26679. reticuleOpacity: 1,
  26680. markerOpacity: 0,
  26681. markerOpacityOnHover: 0
  26682. },
  26683. floorplan: {
  26684. transitionTime: 1e3,
  26685. modelAlpha: 1,
  26686. modelAlphaDelay: 0,
  26687. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  26688. skyboxOpacity: 0,
  26689. skyboxOpacityDelay: 0,
  26690. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  26691. fovLength: 1,
  26692. fovDelay: 0,
  26693. cameraMatrixDuration: .5,
  26694. cameraMatrixDelay: 0,
  26695. cameraMatrixEase: c.easeOutCubic,
  26696. reticuleOpacity: 1,
  26697. markerOpacity: 0,
  26698. markerOpacityOnHover: 0,
  26699. cameraHeight: 50
  26700. },
  26701. transitioning: {
  26702. reticuleOpacity: 0,
  26703. markerOpacity: .3,
  26704. markerOpacityOnHover: 1
  26705. },
  26706. "floorplan-dollhouse": {
  26707. rotationDelay: 0,
  26708. rotationDuration: 1
  26709. },
  26710. "floorplan-panorama": {
  26711. rotationDelay: .5,
  26712. rotationDuration: 1
  26713. },
  26714. "dollhouse-panorama": {
  26715. rotationDelay: .5,
  26716. rotationDuration: 1
  26717. },
  26718. "dollhouse-floorplan": {
  26719. rotationDelay: 0,
  26720. rotationDuration: 1,
  26721. cameraMatrixDuration: 1.05,
  26722. cameraMatrixDelay: .5
  26723. },
  26724. "panorama-dollhouse": {
  26725. rotationDelay: 0,
  26726. rotationDuration: .5
  26727. },
  26728. "panorama-floorplan": {
  26729. transitionTime: 1500,
  26730. rotationDelay: 0,
  26731. rotationDuration: .5
  26732. }
  26733. }),
  26734. p.path.meshFree && (p.path.typ = l.WALK),
  26735. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  26736. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  26737. t.exports = p
  26738. }
  26739. , {
  26740. "./constants": 8,
  26741. "./enum/Colors": 19,
  26742. "./enum/VROption": 47,
  26743. "./enum/Viewmode": 51,
  26744. "./enum/WarpStyle": 52,
  26745. "./util/browser": 182,
  26746. "./util/common": 185,
  26747. "./util/easing": 186,
  26748. "./util/showcase": 193,
  26749. three: 217
  26750. }],
  26751. 167: [function(e, t, i) {
  26752. "use strict";
  26753. var n = e("three")
  26754. , r = e("./settings")
  26755. , 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"
  26756. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  26757. t.exports = {
  26758. basicTextured: {
  26759. uniforms: {
  26760. tDiffuse: {
  26761. type: "t",
  26762. value: null
  26763. },
  26764. alpha: {
  26765. type: "f",
  26766. value: 1
  26767. }
  26768. },
  26769. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  26770. 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}"
  26771. },
  26772. copyCubeMap: {
  26773. uniforms: {
  26774. tDiffuse: {
  26775. type: "t",
  26776. value: null
  26777. },
  26778. alpha: {
  26779. type: "f",
  26780. value: 1
  26781. }
  26782. },
  26783. 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}",
  26784. 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}"
  26785. },
  26786. cube: {
  26787. uniforms: {
  26788. map: {
  26789. type: "t",
  26790. value: null
  26791. },
  26792. opacity: {
  26793. type: "f",
  26794. value: 1
  26795. }
  26796. },
  26797. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  26798. 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"
  26799. },
  26800. model: {
  26801. uniforms: {
  26802. map: {
  26803. type: "t",
  26804. value: null
  26805. },
  26806. modelAlpha: {
  26807. type: "f",
  26808. value: r.modelAlpha
  26809. },
  26810. opacity: {
  26811. type: "f",
  26812. value: 1
  26813. },
  26814. progress: {
  26815. type: "f",
  26816. value: 0
  26817. },
  26818. blackout: {
  26819. type: "i",
  26820. value: 0
  26821. },
  26822. pano0Map: {
  26823. type: "t",
  26824. value: null
  26825. },
  26826. pano0Position: {
  26827. type: "v3",
  26828. value: new n.Vector3
  26829. },
  26830. pano0Matrix: {
  26831. type: "m4",
  26832. value: new n.Matrix4
  26833. },
  26834. pano1Map: {
  26835. type: "t",
  26836. value: null
  26837. },
  26838. pano1Position: {
  26839. type: "v3",
  26840. value: new n.Vector3
  26841. },
  26842. pano1Matrix: {
  26843. type: "m4",
  26844. value: new n.Matrix4
  26845. }
  26846. },
  26847. vertexShader: o + `uniform vec3 pano0Position;
  26848. uniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\n
  26849. uniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\n
  26850. varying vec3 vWorldPosition0;
  26851. varying vec3 vWorldPosition1;
  26852. uniform int blackout;
  26853. void main() {
  26854. vUv = uv;
  26855. vec4 worldPosition = modelMatrix * vec4(position, 1.0);
  26856. vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;
  26857. vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;
  26858. vWorldPosition0.x *= -1.0;
  26859. vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;
  26860. vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;
  26861. vWorldPosition1.x *= -1.0;
  26862. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  26863. }`,
  26864. fragmentShader: a + `uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\n
  26865. uniform 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\n
  26866. void main() {
  26867. const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);
  26868. const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);
  26869. vec4 colorFromPanos;
  26870. if (blackout == 5){
  26871. colorFromPanos = textureCube( pano1Map, vWorldPosition1.xyz) ;
  26872. }else{
  26873. vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);
  26874. vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);
  26875. if (blackout == 0) {colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);}
  26876. else if (blackout == 1) {
  26877. colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));
  26878. colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));
  26879. }
  26880. else if (blackout == 2) {colorFromPanos = mix(colorFromPano0, BLACK, progress);}
  26881. else if (blackout == 3) {colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));}
  26882. }
  26883. vec4 colorFromTexture = texture2D( map, vUv );
  26884. colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);
  26885. float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);
  26886. colorFromPanos = mix(colorFromPanos, GREY, whiteness);
  26887. gl_FragColor = vec4(colorFromPanos.rgb, opacity);
  26888. }`
  26889. },
  26890. hot:{
  26891. uniforms:{
  26892. color:{
  26893. type: "c",
  26894. value: new n.Color( 0xff2200 )
  26895. },
  26896. opac:{
  26897. type: "f",
  26898. value: 0
  26899. },
  26900. texture1:{
  26901. type: "t",
  26902. value: null
  26903. },
  26904. texture2:{
  26905. type: "t",
  26906. value: null
  26907. }
  26908. },
  26909. vertexShader:"varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  26910. 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"
  26911. },
  26912. modelOutside: {
  26913. uniforms: {
  26914. map: {
  26915. type: "t",
  26916. value: null
  26917. },
  26918. opacity: {
  26919. type: "f",
  26920. value: 1
  26921. }
  26922. },
  26923. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  26924. 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"
  26925. },
  26926. ribbon: {
  26927. uniforms: {
  26928. map: {
  26929. type: "t",
  26930. value: null
  26931. },
  26932. opacity: {
  26933. type: "f",
  26934. value: 1
  26935. },
  26936. color: {
  26937. type: "c",
  26938. value: new n.Color(r.path.color)
  26939. }
  26940. },
  26941. 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",
  26942. 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"
  26943. },
  26944. waypoint: {
  26945. uniforms: {
  26946. map: {
  26947. type: "t",
  26948. value: null
  26949. },
  26950. opacity: {
  26951. type: "f",
  26952. value: 1
  26953. },
  26954. pulse: {
  26955. type: "f",
  26956. value: 1
  26957. },
  26958. nearFade: {
  26959. type: "v2",
  26960. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  26961. },
  26962. color: {
  26963. type: "c",
  26964. value: new n.Color(r.reticuleColor)
  26965. }
  26966. },
  26967. 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",
  26968. 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"
  26969. },
  26970. modelDebug: {
  26971. uniforms: {
  26972. map: {
  26973. type: "t",
  26974. value: null
  26975. },
  26976. modelAlpha: {
  26977. type: "f",
  26978. value: r.modelAlpha
  26979. },
  26980. depthmapRatio: {
  26981. type: "f",
  26982. value: 0
  26983. },
  26984. opacity: {
  26985. type: "f",
  26986. value: 1
  26987. },
  26988. progress: {
  26989. type: "f",
  26990. value: 0
  26991. },
  26992. considerOcclusion: {
  26993. type: "i",
  26994. value: r.fancierTransition
  26995. },
  26996. highlightPanoSelection: {
  26997. type: "i",
  26998. value: 0
  26999. },
  27000. useThirdPano: {
  27001. type: "i",
  27002. value: r.useThirdPano
  27003. },
  27004. pano0Map: {
  27005. type: "t",
  27006. value: null
  27007. },
  27008. pano0Depth: {
  27009. type: "t",
  27010. value: null
  27011. },
  27012. pano0Position: {
  27013. type: "v3",
  27014. value: new n.Vector3
  27015. },
  27016. pano0Matrix: {
  27017. type: "m4",
  27018. value: new n.Matrix4
  27019. },
  27020. pano0Weight: {
  27021. type: "f",
  27022. value: r.transition.pano0Weight
  27023. },
  27024. pano1Map: {
  27025. type: "t",
  27026. value: null
  27027. },
  27028. pano1Depth: {
  27029. type: "t",
  27030. value: null
  27031. },
  27032. pano1Position: {
  27033. type: "v3",
  27034. value: new n.Vector3
  27035. },
  27036. pano1Matrix: {
  27037. type: "m4",
  27038. value: new n.Matrix4
  27039. },
  27040. pano1Weight: {
  27041. type: "f",
  27042. value: r.transition.pano1Weight
  27043. },
  27044. pano2Map: {
  27045. type: "t",
  27046. value: null
  27047. },
  27048. pano2Depth: {
  27049. type: "t",
  27050. value: null
  27051. },
  27052. pano2Position: {
  27053. type: "v3",
  27054. value: new n.Vector3
  27055. },
  27056. pano2Matrix: {
  27057. type: "m4",
  27058. value: new n.Matrix4
  27059. },
  27060. pano2Weight: {
  27061. type: "f",
  27062. value: r.transition.pano2Weight
  27063. }
  27064. },
  27065. 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",
  27066. 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"
  27067. },
  27068. customDepth: {
  27069. uniforms: {
  27070. panoPosition: {
  27071. type: "v3",
  27072. value: new n.Vector3
  27073. }
  27074. },
  27075. 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",
  27076. 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"
  27077. },
  27078. skysphere: {
  27079. uniforms: {
  27080. radius: {
  27081. type: "f",
  27082. value: 0
  27083. }
  27084. },
  27085. 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",
  27086. 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"
  27087. },
  27088. tagDisc: {
  27089. uniforms: {
  27090. opacity: {
  27091. type: "f",
  27092. value: 0
  27093. },
  27094. color: {
  27095. type: "c",
  27096. value: new n.Color
  27097. },
  27098. bg: {
  27099. type: "t",
  27100. value: null
  27101. },
  27102. mask: {
  27103. type: "t",
  27104. value: null
  27105. }
  27106. },
  27107. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  27108. 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"
  27109. }
  27110. }
  27111. }
  27112. , {
  27113. "./settings": 166,
  27114. three: 217
  27115. }],
  27116. 168: [function(e, t, i) {
  27117. (function(i) {
  27118. "use strict";
  27119. var n = e("three")
  27120. , r = (e("url"),
  27121. e("./util/ajax"))
  27122. , o = e("./settings")
  27123. , a = e("./util/logger")
  27124. , s = e("./util/math")
  27125. , l = e("./util/showcase")
  27126. , c = e("./objects/Panorama")
  27127. , h = new a(i)
  27128. , u = e("./model/Model")
  27129. , d = e("./shaders")
  27130. , p = e("./util/transitions")
  27131. , f = e("./objects/Chunk")
  27132. , g = e("./objects/Reticule")
  27133. , m = e("./objects/Skybox")
  27134. , v = e("./objects/Floor")
  27135. , A = e("./cameras/DollhouseCamera")
  27136. , y = e("./cameras/FloorplanCamera")
  27137. , C = e("./cameras/PanoramaCamera")
  27138. , I = e("./controls/DollhouseControls")
  27139. , E = e("./controls/FloorplanControls")
  27140. , b = e("./controls/PanoramaControls");
  27141. n.ImageUtils.crossOrigin = o.crossOrigin,
  27142. t.exports = {
  27143. shaders: d,
  27144. transitions: p,
  27145. Model: u,
  27146. Chunk: f,
  27147. Floor: v,
  27148. Skybox: m,
  27149. Reticule: g,
  27150. Panorama: c,
  27151. DollhouseCamera: A,
  27152. FloorplanCamera: y,
  27153. PanoramaCamera: C,
  27154. DollhouseControls: I,
  27155. FloorplanControls: E,
  27156. PanoramaControls: b,
  27157. getModel: function(e) {
  27158. if (!e.url)
  27159. throw 'getModel(): missing parameter "url"';
  27160. e.autoload = void 0 === e.autoload || e.autoload;
  27161. var t = l.parseSidUrl(e.url);
  27162. e.urlBase = t.urlBase,
  27163. e.urlModel = t.urlModel,
  27164. e.urlFiles = t.urlFiles;
  27165. var i = this._getPlatformError();
  27166. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  27167. this._loadModel().then(this._buildModel.bind(this)))
  27168. },
  27169. _getPlatformError: function() {
  27170. 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"
  27171. },
  27172. _loadModel: function() {
  27173. return r.get(this.options.urlModel, {
  27174. responseType: "json",
  27175. prefetchFrom: "model",
  27176. auth: l.getAuthorizationHeader()
  27177. }).then(null, function() {
  27178. return h.warn("Model loading failed at initial metadata load"),
  27179. "loading-failed"
  27180. })
  27181. },
  27182. _buildModel: function(e) {
  27183. e = l.normalizeModeldata(e, s);
  27184. var t = new u(this.options,e);
  27185. return this.options.autoload ? t.load(!0) : $.when(t)
  27186. }
  27187. }
  27188. }
  27189. ).call(this, "/js/showcase.js")
  27190. }
  27191. , {
  27192. "./cameras/DollhouseCamera": 5,
  27193. "./cameras/FloorplanCamera": 6,
  27194. "./cameras/PanoramaCamera": 7,
  27195. "./controls/DollhouseControls": 10,
  27196. "./controls/FloorplanControls": 11,
  27197. "./controls/PanoramaControls": 13,
  27198. "./model/Model": 139,
  27199. "./objects/Chunk": 144,
  27200. "./objects/Floor": 146,
  27201. "./objects/Panorama": 148,
  27202. "./objects/Reticule": 149,
  27203. "./objects/Skybox": 152,
  27204. "./settings": 166,
  27205. "./shaders": 167,
  27206. "./util/ajax": 181,
  27207. "./util/logger": 189,
  27208. "./util/math": 190,
  27209. "./util/showcase": 193,
  27210. "./util/transitions": 195,
  27211. three: 217,
  27212. url: 208
  27213. }],
  27214. 169: [function(e, t, i) {
  27215. "use strict";
  27216. function n() {
  27217. var e = {
  27218. renderTarget: null,
  27219. inUse: !1,
  27220. size: -1,
  27221. pano: null
  27222. };
  27223. return e
  27224. }
  27225. function r(e) {
  27226. M.push(e)
  27227. }
  27228. function o(e) {
  27229. var t = n();
  27230. return t.inUse = !0,
  27231. t.size = e,
  27232. r(t),
  27233. t
  27234. }
  27235. function a(e) {
  27236. for (var t = 0; t < M.length; t++) {
  27237. var i = M[t];
  27238. if (!i.inUse && i.size === e)
  27239. return i.inUse = !0,
  27240. i
  27241. }
  27242. return null
  27243. }
  27244. function s(e) {
  27245. for (var t = 0; t < M.length; t++) {
  27246. var i = M[t];
  27247. if (i.renderTarget === e)
  27248. return i.inUse = !1,
  27249. !0
  27250. }
  27251. return !1
  27252. }
  27253. function l() {
  27254. this.tileDirectory = {},
  27255. this.activeRenderTargetDescriptors = {},
  27256. this.activePanos = [],
  27257. this.panoLODDescriptors = {},
  27258. this.panoDescriptors = {},
  27259. this.tileTrees = {},
  27260. this.sceneRenderer = null,
  27261. this.tileDownloader = null,
  27262. this.forceQueue = [],
  27263. this.uploadQueues = {},
  27264. this.uploadInterval = null,
  27265. this.uploadIntervalCancelled = !1,
  27266. this.usingTileOverlay = !1,
  27267. this.overlayTilesLoaded = !1,
  27268. this.overlayTileBase = null,
  27269. this.overlayTilesBasic = {},
  27270. this.overlayTilesEnhanced = {},
  27271. this.zoomRenderTarget = null,
  27272. this.zoomPano = null,
  27273. this.zoomingActive = !1,
  27274. this.zoomPanoId = null,
  27275. this.zoomPanoRenderingDisabled = !1,
  27276. this.direction = new h.Vector3,
  27277. this.initTime = -1,
  27278. this.maxBaseUploadsPerFrame = x,
  27279. this.maxNonBaseUploadsPerFrame = T
  27280. }
  27281. function c() {
  27282. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  27283. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  27284. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  27285. }
  27286. var h = e("three")
  27287. , u = e("../exception/BasicException")
  27288. , d = e("../settings")
  27289. , p = e("../enum/PanoSizeClass")
  27290. , f = (e("../objects/Panorama"),
  27291. e("../enum/PanoRendererEvents"))
  27292. , g = e("../enum/SceneRendererEvents")
  27293. , m = e("../enum/TileDownloaderEvents")
  27294. , v = e("../enum/Vectors")
  27295. , A = (e("../enum/GLCubeFaces"),
  27296. e("../objects/Panorama"),
  27297. e("./TileTree"))
  27298. , y = (e("./TileDownloader"),
  27299. e("./TilePrioritizer"))
  27300. , C = e("./TileUtils")
  27301. , p = e("../enum/PanoSizeClass")
  27302. , I = (e("../util/browser"),
  27303. e("../util/panorama"))
  27304. , E = e("events").EventEmitter
  27305. , b = !1
  27306. , w = d.tiling.uploadIntervalDelay
  27307. , _ = d.tiling.initialIntervalDelay
  27308. , T = d.tiling.maxNonBaseUploadsPerFrame
  27309. , x = d.tiling.maxBaseUploadsPerFrame
  27310. , S = {
  27311. Base: 0,
  27312. Remaining: 1
  27313. }
  27314. , M = [];
  27315. l.prototype = Object.create(E.prototype),
  27316. l.prototype.init = function(e, t, i) {
  27317. this.sceneRenderer = e,
  27318. this.tileDownloader = t,
  27319. this.qualityManager = i,
  27320. this.bindEvents(),
  27321. this.sceneRenderer.on(g.ContextCreated, this.loadOverlayTiles.bind(this)),
  27322. this.initTime = performance.now()
  27323. }
  27324. ,
  27325. l.prototype.getActivePanoTextures = function(e) {
  27326. e = e || [];
  27327. for (var t = 0; t < M.length; t++) {
  27328. var i = M[t];
  27329. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  27330. }
  27331. }
  27332. ,
  27333. l.prototype.hasQueuedTiles = function() {
  27334. var e = this.peekNextFromUploadQueue();
  27335. return null !== e && void 0 !== e
  27336. }
  27337. ,
  27338. l.prototype.getActiveRenderTargetDescriptor = function(e) {
  27339. return this.activeRenderTargetDescriptors[e]
  27340. }
  27341. ,
  27342. l.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  27343. this.activeRenderTargetDescriptors[e] = t
  27344. }
  27345. ,
  27346. l.prototype.loadOverlayTiles = function() {
  27347. if (0 !== d.tiling.overlayStyle) {
  27348. var e = 0
  27349. , t = function(t, n, r) {
  27350. t = n ? t[n] = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping),
  27351. this.sceneRenderer.uploadTexture2D(r, t, 0, 0, C.TILE_SIZE, C.TILE_SIZE),
  27352. e++,
  27353. e === i.length && (this.overlayTilesLoaded = !0)
  27354. }
  27355. .bind(this)
  27356. , i = [["images/outlineBase.png", t.bind(this, this.overlayTileBase, null)], ["images/outlineBasic512.png", t.bind(this, this.overlayTilesBasic, 256)], ["images/outlineBasic512.png", t.bind(this, this.overlayTilesBasic, 512)], ["images/outlineBasic1024.png", t.bind(this, this.overlayTilesBasic, 1024)], ["images/outlineBasic2048.png", t.bind(this, this.overlayTilesBasic, 2048)], ["images/outlineBasic4096.png", t.bind(this, this.overlayTilesBasic, 4096)], ["images/outlineEnhanced512.png", t.bind(this, this.overlayTilesEnhanced, 256)], ["images/outlineEnhanced512.png", t.bind(this, this.overlayTilesEnhanced, 512)], ["images/outlineEnhanced1024.png", t.bind(this, this.overlayTilesEnhanced, 1024)], ["images/outlineEnhanced2048.png", t.bind(this, this.overlayTilesEnhanced, 2048)], ["images/outlineEnhanced4096.png", t.bind(this, this.overlayTilesEnhanced, 4096)]];
  27357. i.forEach(function(e) {
  27358. this.tileDownloader.loadImage(e[0], 0, e[1])
  27359. }
  27360. .bind(this)),
  27361. this.usingTileOverlay = !0
  27362. } else
  27363. this.usingTileOverlay = !1
  27364. }
  27365. ,
  27366. l.prototype.bindEvents = function() {
  27367. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  27368. }
  27369. ,
  27370. l.prototype.setupZoomRenderTarget = function() {
  27371. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  27372. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  27373. return;
  27374. var e = this.zoomRenderTarget;
  27375. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  27376. e) {
  27377. var t = e.width
  27378. , i = this.zoomRenderTarget.width;
  27379. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  27380. e.texture.dispose(),
  27381. e.texture.loaded = !1,
  27382. e.texture.version = 0,
  27383. this.sceneRenderer.deallocateCubeTexture(e.texture),
  27384. e.texture = null
  27385. }
  27386. this.zoomPanoRenderingDisabled = !1
  27387. } else
  27388. this.zoomPanoRenderingDisabled = !0
  27389. }
  27390. ,
  27391. l.prototype.enableUltraHighQualityMode = function(e) {
  27392. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  27393. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  27394. this.tileDownloader.testDownload(t, C.TILE_SIZE, function(t) {
  27395. t && (this.qualityManager.enableUltraHighQualityMode(),
  27396. this.setupZoomRenderTarget(),
  27397. e())
  27398. }
  27399. .bind(this))
  27400. }
  27401. }
  27402. ,
  27403. l.prototype.activateTiledPano = function(e, t, i) {
  27404. i && this.clearAllQueuedUploads();
  27405. for (var n = 0; n < C.FACES_PER_PANO; n++)
  27406. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  27407. this.linkAllTilesAndNodes(e);
  27408. var r = this.getActiveRenderTargetDescriptor(e.id)
  27409. , l = t;
  27410. if (l > this.qualityManager.getMaxNavPanoSize() && (l = this.qualityManager.getMaxNavPanoSize()),
  27411. !r || l !== r.size) {
  27412. if (r && s(r.renderTarget),
  27413. r = a(l),
  27414. !r) {
  27415. var c = this.initTiledPano(l, !1);
  27416. r = o(c.width),
  27417. r.renderTarget = c
  27418. }
  27419. r.pano = e,
  27420. this.resetPanoDescriptor(e.id),
  27421. this.resetPanoLODDescriptors(e.id),
  27422. this.resetRenderStatus(e.id, !0, !0)
  27423. }
  27424. this.setActiveRenderTargetDescriptor(e.id, r);
  27425. var h = i ? 0 : 1;
  27426. return this.updateActivePanos(e, h),
  27427. r.renderTarget
  27428. }
  27429. ,
  27430. l.prototype.deactivateTiledPano = function(e) {
  27431. var t = this.getActiveRenderTargetDescriptor(e.id);
  27432. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget),
  27433. this.setActiveRenderTargetDescriptor(e.id, null);
  27434. var i = this.getUploadQueueForPano(e.id);
  27435. this.clearUploadQueue(i),
  27436. this.updateActivePanos()
  27437. }
  27438. ,
  27439. l.prototype.updateActivePanos = function() {
  27440. var e = [];
  27441. return function(t, i) {
  27442. e.length = 0;
  27443. for (var n = 0; n < this.activePanos.length; n++) {
  27444. t && e.length === i && e.push(t);
  27445. var r = this.activePanos[n]
  27446. , o = this.getActiveRenderTargetDescriptor(r.id);
  27447. t && r.id === t.id || !this.isRenderTargetDescriptorValid(o) || e.push(r)
  27448. }
  27449. t && i >= e.length && e.push(t),
  27450. this.activePanos.length = 0,
  27451. this.activePanos.push.apply(this.activePanos, e)
  27452. }
  27453. }(),
  27454. l.prototype.getActivePanoCount = function() {
  27455. return this.activePanos.length
  27456. }
  27457. ,
  27458. l.prototype.resetRenderStatus = function(e, t, i, n) {
  27459. var r = null;
  27460. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1);
  27461. for (var o = function(e, n, r, o) {
  27462. i && (n.tile.zoomUploaded = !1),
  27463. t && (n.tile.uploaded = !1)
  27464. }, a = 0; a < C.FACES_PER_PANO; a++) {
  27465. var s = this.getTileTree(e, a);
  27466. s.breadthFirst({
  27467. callback: o.bind(this, a),
  27468. minLevel: r
  27469. })
  27470. }
  27471. }
  27472. ,
  27473. l.prototype.copyBaseRenderStatusToZoomed = function(e) {
  27474. for (var t = A.getLevelCountForSize(C.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  27475. t.tile.zoomUploaded = t.tile.uploaded,
  27476. t.zoomCovered = t.covered
  27477. }, n = 0; n < C.FACES_PER_PANO; n++) {
  27478. var r = this.getTileTree(e, n);
  27479. r.breadthFirst({
  27480. callback: i.bind(this, n),
  27481. maxLevel: t
  27482. })
  27483. }
  27484. }
  27485. ,
  27486. l.prototype.renderPanoTiles = function() {
  27487. var e = [];
  27488. return function(t, i, n, r) {
  27489. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  27490. i = i || this.direction || v.FORWARD;
  27491. var o = this.getActiveRenderTargetDescriptor(t);
  27492. if (!this.isRenderTargetDescriptorValid(o))
  27493. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  27494. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  27495. var s = this.getTileTree(t, a);
  27496. e.length = 0,
  27497. s.breadthFirst({
  27498. saveVisited: e
  27499. });
  27500. for (var l = 0; l < e.length; l++) {
  27501. var c = e[l];
  27502. this.queueTileUpload(c.tile, !1, r || 0 === l && n)
  27503. }
  27504. }
  27505. this.updateDirection(i)
  27506. }
  27507. }(),
  27508. l.prototype.isRenderTargetDescriptorValid = function(e) {
  27509. return e && e.renderTarget
  27510. }
  27511. ,
  27512. l.prototype.isPanoActive = function(e) {
  27513. var t = this.getActiveRenderTargetDescriptor(e);
  27514. return this.isRenderTargetDescriptorValid(t)
  27515. }
  27516. ,
  27517. l.prototype.isPanoZoomed = function(e) {
  27518. return this.zoomingActive && this.zoomPanoId === e
  27519. }
  27520. ,
  27521. l.prototype.initTileTree = function(e, t, i) {
  27522. var n = this.tileTrees[e];
  27523. n || (n = [],
  27524. this.tileTrees[e] = n);
  27525. var r = n[t];
  27526. if (!r) {
  27527. var o = A.getLevelCountForSize(C.TILE_SIZE, i);
  27528. r = new A(C.TILE_SIZE,o),
  27529. n[t] = r
  27530. }
  27531. }
  27532. ,
  27533. l.prototype.getTileTree = function(e, t) {
  27534. var i = this.tileTrees[e];
  27535. if (!i)
  27536. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  27537. var n = i[t];
  27538. if (!n)
  27539. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  27540. return n
  27541. }
  27542. ,
  27543. l.prototype.initTiledPano = function(e, t) {
  27544. var i = this.sceneRenderer.renderer
  27545. , n = (i.context,
  27546. new h.WebGLRenderTargetCube(e,e,{
  27547. stencilBuffer: !1
  27548. }))
  27549. , r = new h.CubeTexture([]);
  27550. n.texture = r,
  27551. r.image = [null, null, null, null, null, null],
  27552. r.flipY = !0,
  27553. t ? (r.generateMipmaps = !0,
  27554. r.magFilter = h.LinearFilter,
  27555. r.minFilter = h.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  27556. r.magFilter = h.LinearFilter,
  27557. r.minFilter = h.LinearFilter),
  27558. r.format = h.RGBAFormat,
  27559. i.setRenderTarget(n),
  27560. i.setRenderTarget(null);
  27561. var o = i.properties.get(r);
  27562. return o.__image__webglTextureCube = o.__webglTexture,
  27563. n
  27564. }
  27565. ,
  27566. l.prototype.getUploadQueueForPano = function(e) {
  27567. var t = this.uploadQueues[e];
  27568. return t || (t = [],
  27569. this.uploadQueues[e] = t),
  27570. t
  27571. }
  27572. ,
  27573. l.prototype.isTileUploaded = function(e) {
  27574. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  27575. }
  27576. ,
  27577. l.prototype.setUploaded = function(e, t) {
  27578. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  27579. }
  27580. ,
  27581. l.prototype.queueTileUpload = function(e, t, i) {
  27582. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  27583. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  27584. var r = this.getUploadQueueForPano(e.panoId);
  27585. 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),
  27586. e.uploadQueued = !0,
  27587. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  27588. }
  27589. }
  27590. ,
  27591. l.prototype.shoulPushToFrontOfQueue = function(e) {
  27592. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  27593. }
  27594. ,
  27595. l.prototype.getTopUploadQueue = function() {
  27596. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  27597. for (var n = 0; n < this.activePanos.length; n++)
  27598. if (e = this.activePanos[n],
  27599. t = this.getUploadQueueForPano(e.id),
  27600. t.length > 0)
  27601. switch (i) {
  27602. case S.Base:
  27603. if (0 === t[0].level)
  27604. return t;
  27605. break;
  27606. case S.Remaining:
  27607. return t
  27608. }
  27609. return null
  27610. }
  27611. ,
  27612. l.prototype.getNextFromUploadQueue = function() {
  27613. var e = function(e) {
  27614. var t = e.shift();
  27615. return t.uploadQueued = !1,
  27616. t
  27617. };
  27618. return function() {
  27619. if (this.forceQueue.length > 0)
  27620. return e(this.forceQueue);
  27621. var t = this.getTopUploadQueue();
  27622. return t && t.length > 0 ? e(t) : null
  27623. }
  27624. }(),
  27625. l.prototype.peekNextFromUploadQueue = function() {
  27626. if (this.forceQueue.length > 0)
  27627. return this.forceQueue[0];
  27628. var e = this.getTopUploadQueue();
  27629. return e && e.length > 0 ? e[0] : null
  27630. }
  27631. ,
  27632. l.prototype.clearAllQueuedUploads = function() {
  27633. this.clearAllUploadQueues(null, 0)
  27634. }
  27635. ,
  27636. l.prototype.clearAllQueuedUploadsForPano = function(e) {
  27637. this.clearAllUploadQueues(e, 0)
  27638. }
  27639. ,
  27640. l.prototype.clearAllUploadQueues = function(e, t) {
  27641. if (e)
  27642. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  27643. this.clearUploadQueue(this.forceQueue, t, e);
  27644. else {
  27645. for (var i = 0; i < this.activePanos.length; i++) {
  27646. var n = this.activePanos[i];
  27647. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  27648. }
  27649. this.clearUploadQueue(this.forceQueue, t)
  27650. }
  27651. }
  27652. ,
  27653. l.prototype.clearUploadQueue = function(e, t, i) {
  27654. void 0 !== t && null !== t || (t = 0);
  27655. for (var n = 0; n < e.length; ) {
  27656. var r = e[n];
  27657. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  27658. e.splice(n, 1)) : n++
  27659. }
  27660. }
  27661. ,
  27662. l.prototype.refreshUploadInterval = function() {
  27663. var e = null;
  27664. return function(t) {
  27665. this.uploadIntervalCancelled || (e || (e = c.bind(this)),
  27666. null !== t && void 0 !== t || (t = w),
  27667. b || (t = _),
  27668. this.uploadInterval = window.setTimeout(e, t),
  27669. this.uploadIntervalDelay = t)
  27670. }
  27671. }(),
  27672. l.prototype.update = function() {
  27673. var e = performance.now()
  27674. , t = 0;
  27675. return function() {
  27676. this.uploadIntervalCancelled = !0,
  27677. window.clearTimeout(this.uploadInterval),
  27678. this.uploadInterval = null;
  27679. var i = performance.now() - e;
  27680. !(i > w || 0 === t) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  27681. e = performance.now()),
  27682. t++
  27683. }
  27684. }(),
  27685. l.prototype.updateUploadQueue = function(e, t) {
  27686. e || (e = 1);
  27687. for (var i = 0, n = 0; ; ) {
  27688. if (n >= t || i >= e)
  27689. break;
  27690. var r = this.getNextFromUploadQueue();
  27691. if (!r)
  27692. break;
  27693. if (0 !== r.level ? i++ : n++,
  27694. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  27695. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  27696. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  27697. }
  27698. }
  27699. }
  27700. ,
  27701. l.prototype.updateDirection = function(e) {
  27702. if (e = e || this.direction) {
  27703. this.direction = e;
  27704. for (var t = 0; t < this.activePanos.length; t++) {
  27705. var i = this.activePanos[t]
  27706. , n = this.getUploadQueueForPano(i.id);
  27707. y.sortPanoTiles(n, i, this.direction)
  27708. }
  27709. }
  27710. }
  27711. ,
  27712. l.prototype.uploadTile = function() {
  27713. var e = {}
  27714. , t = (new h.Vector4,
  27715. d.tiling.overlayStyle);
  27716. return function(i, n) {
  27717. var r = i.panoId
  27718. , o = i.image
  27719. , a = i.tileSize
  27720. , s = i.panoSize
  27721. , l = i.tileIndex
  27722. , c = (i.faceTileIndex,
  27723. i.totalTiles)
  27724. , u = (i.face,
  27725. i.tileX)
  27726. , d = i.tileY
  27727. , p = !0
  27728. , g = !1
  27729. , m = (this.getPanoDescriptor(r),
  27730. this.getPanoLODDescriptor(r, s))
  27731. , v = this.getActiveRenderTargetDescriptor(r)
  27732. , A = v.renderTarget
  27733. , y = v.size;
  27734. if (this.isPanoZoomed(r) && (A = this.zoomRenderTarget,
  27735. y = this.qualityManager.getMaxZoomPanoSize()),
  27736. this.isRenderTargetDescriptorValid(v) || (p = !1,
  27737. g = !1),
  27738. n || (this.anyUploaded(i.node) && (p = !1,
  27739. g = !0),
  27740. this.isTileUploaded(i) && (p = !1,
  27741. g = !1)),
  27742. p) {
  27743. var C = u * a
  27744. , I = d * a
  27745. , E = a / s * y
  27746. , b = C / s * y
  27747. , w = I / s * y;
  27748. e[a] || (e[a] = this.sceneRenderer.initSizedTexture2D(a, h.ClampToEdgeWrapping));
  27749. var _ = e[a];
  27750. if (this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a),
  27751. 1 === t || 2 === t) {
  27752. var T = 1 === t ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  27753. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace),
  27754. this.sceneRenderer.renderToCubeMap(T[s], A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace, h.NormalBlending, !0, .5)
  27755. } else
  27756. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace);
  27757. m.uploadCount++,
  27758. this.emit(f.TileRenderSuccess, r, s, l, c),
  27759. m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c),
  27760. this.setUploaded(i, !0),
  27761. this.addCoverageForNode(i.node)
  27762. } else
  27763. this.setUploaded(i, !1);
  27764. return i.uploadAttempted || (m.uploadAttempts++,
  27765. this.emit(f.TileUploadAttempted, r, s, l, c)),
  27766. i.uploadAttempted = !0,
  27767. m.uploadAttempts === c && this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  27768. g
  27769. }
  27770. }(),
  27771. l.prototype.linkTileAndNode = function(e, t) {
  27772. t.tile = e,
  27773. e.node = t
  27774. }
  27775. ,
  27776. l.prototype.linkAllTilesAndNodes = function(e) {
  27777. for (var t = function(t, i, n, r, o) {
  27778. var a = this.getTileDirectoryEntry(e.id, i, r, o);
  27779. this.linkTileAndNode(a, n)
  27780. }, i = 0; i < C.FACES_PER_PANO; i++) {
  27781. var n = this.getTileTree(e.id, i);
  27782. n.breadthFirst({
  27783. callback: t.bind(this, n, i)
  27784. })
  27785. }
  27786. }
  27787. ,
  27788. l.prototype.anyUploaded = function(e) {
  27789. if (!e)
  27790. return !1;
  27791. if (e.tile && this.isTileUploaded(e.tile))
  27792. return !0;
  27793. if (e.children)
  27794. for (var t = 0; t < e.children.length; t++) {
  27795. var i = e.children[t];
  27796. if (this.anyUploaded(i))
  27797. return !0
  27798. }
  27799. return !1
  27800. }
  27801. ,
  27802. l.prototype.setNodeCovered = function(e, t) {
  27803. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  27804. }
  27805. ,
  27806. l.prototype.isNodeCovered = function(e) {
  27807. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  27808. }
  27809. ,
  27810. l.prototype.addCoverageForNode = function(e) {
  27811. if (this.setNodeCovered(e, !0),
  27812. e.parent && e.covered) {
  27813. var t = e.parent;
  27814. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  27815. }
  27816. }
  27817. ,
  27818. l.prototype.calcFullCoverage = function(e) {
  27819. var t = !1;
  27820. if (e.children)
  27821. for (var i = 0; i < e.children.length; i++) {
  27822. var n = e.children[i];
  27823. t = t || this.calcFullCoverage(n)
  27824. }
  27825. e.covered = e.tile.uploaded || t
  27826. }
  27827. ,
  27828. l.prototype.nodeSubcovered = function(e) {
  27829. if (!e.children)
  27830. return !1;
  27831. for (var t = 0; t < e.children.length; t++)
  27832. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  27833. return !1;
  27834. return !0
  27835. }
  27836. ,
  27837. l.prototype.resetPanoDescriptor = function(e) {
  27838. this.getPanoDescriptor(e)
  27839. }
  27840. ,
  27841. l.prototype.getPanoDescriptor = function(e) {
  27842. var t = this.panoDescriptors[e];
  27843. return t || (t = {},
  27844. this.panoDescriptors[e] = t),
  27845. t
  27846. }
  27847. ,
  27848. l.prototype.resetPanoLODDescriptors = function(e) {
  27849. var t = this.getPanoLODDescriptors(e);
  27850. for (var i in t)
  27851. if (t.hasOwnProperty(i)) {
  27852. var n = t[i];
  27853. n.uploadCount = 0,
  27854. n.uploadAttempts = 0
  27855. }
  27856. }
  27857. ,
  27858. l.prototype.getPanoLODDescriptor = function(e, t) {
  27859. var i = this.getPanoLODDescriptors(e)
  27860. , n = i[t];
  27861. return n || (n = {
  27862. uploadCount: 0,
  27863. uploadAttempts: 0
  27864. },
  27865. i[t] = n),
  27866. n
  27867. }
  27868. ,
  27869. l.prototype.getPanoLODDescriptors = function(e) {
  27870. var t = this.panoLODDescriptors[e];
  27871. return t || (t = {},
  27872. this.panoLODDescriptors[e] = t),
  27873. t
  27874. }
  27875. ,
  27876. l.prototype.onTileDownloaded = function(e) {
  27877. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  27878. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  27879. if (i.downloaded = !0,
  27880. i.image = e.image,
  27881. i.panoSize = e.panoSize,
  27882. i.tileX = e.tileX,
  27883. i.tileY = e.tileY,
  27884. i.totalTiles = e.totalTiles,
  27885. i.tileIndex = e.tileIndex,
  27886. i.faceTileIndex = e.faceTileIndex,
  27887. i.face = e.face,
  27888. i.cubeFace = I.mapFaceToCubemapFace(e.face),
  27889. i.panoId = e.panoId,
  27890. i.tileSize = e.tileSize,
  27891. i.direction = (new h.Vector3).copy(e.direction),
  27892. i.node = null,
  27893. i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize),
  27894. this.isPanoActive(i.panoId)) {
  27895. var n = this.getTileTree(i.panoId, i.face)
  27896. , r = n.getSubNode(i.panoSize, i.tileX, i.tileY);
  27897. this.linkTileAndNode(i, r),
  27898. this.queueTileUpload(i, !0)
  27899. }
  27900. }
  27901. ,
  27902. l.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  27903. var r = this.tileDirectory[e];
  27904. r || (r = {},
  27905. this.tileDirectory[e] = r);
  27906. var o = 16384 * t + 1024 * i + n
  27907. , a = r[o];
  27908. return a || (a = {
  27909. downloaded: !1,
  27910. uploaded: !1,
  27911. zoomUploaded: !1
  27912. },
  27913. r[o] = a),
  27914. a._key = e + ":" + t + ":" + i + ":" + n,
  27915. a._tileKey = o,
  27916. a
  27917. }
  27918. ,
  27919. l.prototype.setZoomingActive = function(e, t, i) {
  27920. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  27921. this.zoomPanoId = t.id,
  27922. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  27923. }
  27924. ,
  27925. l.prototype.updateZoomedPanoFromBase = function(e) {
  27926. if (!this.zoomPanoRenderingDisabled) {
  27927. var t = this.getActiveRenderTargetDescriptor(e.id);
  27928. if (t && t.renderTarget) {
  27929. var i = this.qualityManager.getMaxZoomPanoSize()
  27930. , n = t.renderTarget
  27931. , r = t.size;
  27932. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  27933. this.copyBaseRenderStatusToZoomed(e.id)
  27934. }
  27935. }
  27936. }
  27937. ,
  27938. t.exports = l
  27939. }
  27940. , {
  27941. "../enum/GLCubeFaces": 25,
  27942. "../enum/PanoRendererEvents": 35,
  27943. "../enum/PanoSizeClass": 36,
  27944. "../enum/SceneRendererEvents": 43,
  27945. "../enum/TileDownloaderEvents": 45,
  27946. "../enum/Vectors": 50,
  27947. "../exception/BasicException": 55,
  27948. "../objects/Panorama": 148,
  27949. "../settings": 166,
  27950. "../util/browser": 182,
  27951. "../util/panorama": 191,
  27952. "./TileDownloader": 171,
  27953. "./TilePrioritizer": 172,
  27954. "./TileTree": 173,
  27955. "./TileUtils": 174,
  27956. events: 202,
  27957. three: 217
  27958. }],
  27959. 170: [function(e, t, i) {
  27960. "use strict";
  27961. function n(e, t, i) {
  27962. this.maxNavPanoSize = -1,
  27963. this.maxZoomPanoSize = -1,
  27964. this.devicePixelDensity = e,
  27965. this.deviceScreenSize = t,
  27966. this.clientBandwidth = i,
  27967. this.panoSizeClassMap = {},
  27968. this.useHighResolutionPanos = !0,
  27969. this.useUltraHighResolutionPanos = !1,
  27970. this.modelHasUltraHighPanos = !1
  27971. }
  27972. var r = e("../enum/PanoSizeClass")
  27973. , o = e("../settings")
  27974. , a = e("../util/browser")
  27975. , s = e("../constants")
  27976. , l = e("../util/showcase")
  27977. , c = e("../enum/ModelManagerEvents");
  27978. n.prototype.init = function(e) {
  27979. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  27980. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  27981. this.highSize = this.getPanoSize(r.HIGH),
  27982. this.standardSize = this.getPanoSize(r.STANDARD),
  27983. this.baseSize = this.getPanoSize(r.BASE),
  27984. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  27985. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  27986. this.updateMaximums(),
  27987. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  27988. }
  27989. ,
  27990. n.prototype.updateFromModel = function(e) {
  27991. this.updateHighResolutionSettings(e),
  27992. this.updateUltraHighResolutionSettings(e)
  27993. }
  27994. ,
  27995. n.prototype.updateHighResolutionSettings = function(e) {
  27996. //---------------------许钟文---------原始的会判断modeldata里version,以致useHighResolutionPanos为false,所以我直接变为true啦----------------------------------
  27997. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  27998. //this.useHighResolutionPanos = !0;
  27999. //----------------------e n d -----------------------------------------------------------------
  28000. this.updateMaximums()
  28001. }
  28002. ,
  28003. n.prototype.updateUltraHighResolutionSettings = function(e) {
  28004. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  28005. this.updateMaximums()
  28006. }
  28007. ,
  28008. n.prototype.enableUltraHighQualityMode = function() {
  28009. this.modelHasUltraHighPanos = !0,
  28010. this.updateUltraHighResolutionSettings(null)
  28011. }
  28012. ,
  28013. n.prototype.ultraHighQualityModeEnabled = function() {
  28014. return this.modelHasUltraHighPanos
  28015. }
  28016. ,
  28017. n.prototype.onModelChanged = function(e) {
  28018. this.updateFromModel(e.model),
  28019. this.updateMaximums()
  28020. }
  28021. ,
  28022. n.prototype.updateMaximums = function() {
  28023. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  28024. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  28025. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  28026. }
  28027. ,
  28028. n.prototype.buildPanoSizeClassMap = function() {
  28029. this.panoSizeClassMap[r.BASE] = 512,
  28030. this.panoSizeClassMap[r.STANDARD] = 1024,
  28031. this.panoSizeClassMap[r.HIGH] = 2048,
  28032. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  28033. }
  28034. ,
  28035. n.prototype.getPanoSize = function(e) {
  28036. return this.panoSizeClassMap[e]
  28037. }
  28038. ,
  28039. n.prototype.getMaxPossiblePanoSize = function() {
  28040. return this.getPanoSize(r.ULTRAHIGH)
  28041. }
  28042. ,
  28043. n.prototype.getMaxPanoSize = function() {
  28044. return this.maxZoomPanoSize
  28045. }
  28046. ,
  28047. n.prototype.getMaxNavPanoSize = function() {
  28048. return this.maxNavPanoSize
  28049. }
  28050. ,
  28051. n.prototype.getMaxZoomPanoSize = function() {
  28052. return this.maxZoomPanoSize
  28053. }
  28054. ,
  28055. n.prototype.detectMaxNavPanoSizeClass = function() {
  28056. if(settings.mobileNavHigh)return r.HIGH //改
  28057. else return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  28058. }
  28059. ,
  28060. n.prototype.detectMaxNavPanoSize = function() {
  28061. var e = this.detectMaxNavPanoSizeClass();
  28062. return this.getPanoSize(e)
  28063. }
  28064. ,
  28065. n.prototype.detectMaxZoomPanoSize = function() {
  28066. 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)
  28067. }
  28068. ,
  28069. t.exports = n
  28070. }
  28071. , {
  28072. "../constants": 8,
  28073. "../enum/ModelManagerEvents": 33,
  28074. "../enum/PanoSizeClass": 36,
  28075. "../settings": 166,
  28076. "../util/browser": 182,
  28077. "../util/showcase": 193
  28078. }],
  28079. 171: [function(e, t, i) {
  28080. (function(i) {
  28081. "use strict";
  28082. function n(e) {
  28083. this.panos = null,
  28084. this.retryMinimumTime = 1e4,
  28085. this.urls = null,
  28086. this.panoLoadCallbacks = {},
  28087. this.downloadDescriptors = {},
  28088. this.priorityQueue = [],
  28089. this.forceQueue = [],
  28090. this.activeDownloads = [],
  28091. this.qualityManager = null,
  28092. this.tilePrioritizer = null,
  28093. this.refreshInterval = null,
  28094. this.processPriorityQueue = !1,
  28095. this.concurrentDownloads = e.concurrentDownloads || 1,
  28096. this.downloadTestResults = {}
  28097. }
  28098. var r = e("three")
  28099. , o = (e("../enum/Viewmode"),
  28100. e("../settings"))
  28101. , a = (e("../objects/Panorama"),
  28102. e("../util/logger"))
  28103. , s = (e("../enum/Vectors"),
  28104. e("../enum/PanoSizeClass"),
  28105. e("../enum/TileDownloaderEvents"))
  28106. , l = e("./TilePrioritizer")
  28107. , c = e("./TileUtils")
  28108. , h = (e("../enum/GLCubeFaces"),
  28109. e("../enum/DownloadStatus"))
  28110. , u = e("../util/panorama")
  28111. , d = e("../util/ajax")
  28112. , p = e("../ab")
  28113. , f = e("events").EventEmitter
  28114. , g = (new a(i),
  28115. Object.freeze({
  28116. Testing: 1,
  28117. Success: 2,
  28118. Fail: 3
  28119. }));
  28120. n.prototype = Object.create(f.prototype),
  28121. n.IDLE_REFRESH_DELAY = 500,
  28122. n.ACTIVE_REFRESH_DELAY = 16,
  28123. n.DOWNLOAD_RETRIES = 4,
  28124. n.prototype.init = function(e) {
  28125. this.qualityManager = e
  28126. }
  28127. ,
  28128. n.prototype.setUrls = function(e) {
  28129. this.urls = e
  28130. }
  28131. ,
  28132. n.prototype.setPanoData = function(e, t, i) {
  28133. this.panos = e,
  28134. this.imagePanos = t,
  28135. this.panoGroupId = i
  28136. }
  28137. ,
  28138. n.prototype.start = function() {
  28139. this.refreshUpdateInterval(0)
  28140. }
  28141. ,
  28142. n.prototype.stop = function() {
  28143. window.cancel(this.refreshInterval)
  28144. }
  28145. ,
  28146. n.prototype.refreshUpdateInterval = function(e) {
  28147. e || (e = 0),
  28148. this.refreshInterval = window.setTimeout(function() {
  28149. var e = this.update();
  28150. e ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)
  28151. }
  28152. .bind(this), e)
  28153. }
  28154. ,
  28155. n.prototype.update = function() {
  28156. var e = this.forceQueue.length > 0;
  28157. return this.processQueueForDownloading(this.forceQueue),
  28158. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  28159. this.priorityQueue.length > 0 && (e = !0),
  28160. this.processQueueForDownloading(this.priorityQueue)),
  28161. e
  28162. }
  28163. ,
  28164. n.prototype.forceQueueTilesForPano = function() {
  28165. var e = []
  28166. , t = [];
  28167. return function(i, n, r, o, a, s) {
  28168. e.length = 0;
  28169. for (var u = this.getTileDownloadDescriptors(i, n), d = 0; d < u.length; d++) {
  28170. var p = u[d];
  28171. p.status !== h.None && p.status !== h.Queued || e.push(p)
  28172. }
  28173. if (r && e.length > 0) {
  28174. l.sortPanoTiles(e, i, r),
  28175. t.length = 0,
  28176. c.matchingTilesInDirection(i, n, r, o, a, t);
  28177. for (var f = 0, g = function(e) {
  28178. return e.face === m.face && e.faceTileIndex === m.faceTileIndex
  28179. }; f < e.length; ) {
  28180. var m = e[f]
  28181. , v = t.findIndex(g);
  28182. v < 0 ? e.splice(f, 1) : f++
  28183. }
  28184. }
  28185. for (var A = 0; A < e.length; A++)
  28186. this.forceQueue.push(e[A]);
  28187. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued),
  28188. this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1),
  28189. s && this.processQueueForDownloading(this.forceQueue, !0)
  28190. }
  28191. }(),
  28192. n.prototype.clearForceQueue = function() {
  28193. this.clearQueue(this.forceQueue)
  28194. }
  28195. ,
  28196. n.prototype.queuePrioritizedTilesForPanos = function(e) {
  28197. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  28198. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  28199. this.clearFromQueue(this.priorityQueue, h.None, !0),
  28200. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, h.Queued))
  28201. }
  28202. ,
  28203. n.prototype.clearQueue = function(e) {
  28204. this.setStatusForAllDescriptors(e, h.None),
  28205. e.length = 0
  28206. }
  28207. ,
  28208. n.prototype.clearFromQueue = function(e, t, i) {
  28209. for (var n = 0; n < e.length; n++) {
  28210. var r = e[n];
  28211. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  28212. }
  28213. }
  28214. ,
  28215. n.prototype.setStatusForAllDescriptors = function(e, t) {
  28216. for (var i = 0; i < e.length; i++) {
  28217. var n = e[i];
  28218. n && (n.status = t)
  28219. }
  28220. }
  28221. ,
  28222. n.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  28223. for (var i = 0; i < e.length; i++) {
  28224. var n = e[i];
  28225. n && (n.status !== t ? n.status = t : e[i] = null)
  28226. }
  28227. }
  28228. ,
  28229. n.prototype.getTileDownloadDescriptors = function(e, t) {
  28230. var i = this.getAllTileDownloadDescriptorsForPano(e)
  28231. , n = i[t];
  28232. return n || (n = this.buildDownloadDescriptorArray(t),
  28233. i[t] = n,
  28234. this.initTileDownloadDescriptors(n, e, t)),
  28235. n
  28236. }
  28237. ,
  28238. n.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  28239. var t = this.downloadDescriptors[e.id];
  28240. return t || (t = {},
  28241. this.downloadDescriptors[e.id] = t),
  28242. t
  28243. }
  28244. ,
  28245. n.prototype.processQueueForDownloading = function(e, t) {
  28246. if (this.cleanupActiveDownloads(),
  28247. this.activeDownloads.length < this.concurrentDownloads || t)
  28248. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0, r = 0; n < i && e.length > 0; r++) {
  28249. var o = e.shift();
  28250. o && (this.startDownload(o),
  28251. n++)
  28252. }
  28253. }
  28254. ,
  28255. n.prototype.testDownload = function(e, t, i) {
  28256. var n = this.downloadTestResults[e];
  28257. if (n)
  28258. return void (n === g.Success ? i(!0) : n === g.Fail && i(!1));
  28259. this.downloadTestResults[e] = g.Testing;
  28260. var r = this.panos.list[0]
  28261. , o = this.getTileUrl(r.id, e, t, 0)
  28262. , a = function(t) {
  28263. this.downloadTestResults[e] = g.Success,
  28264. i(!0)
  28265. }
  28266. .bind(this)
  28267. , s = function() {
  28268. this.downloadTestResults[e] = g.Fail,
  28269. i(!1)
  28270. }
  28271. .bind(this);
  28272. this.loadImage(o, 0, a, s)
  28273. }
  28274. ,
  28275. n.prototype.startDownload = function(e) {
  28276. e.status = h.Downloading;
  28277. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  28278. this.activeDownloads.push(e),
  28279. this.loadImage(t, n.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  28280. }
  28281. ,
  28282. n.prototype.downloadFailed = function(e, t) {}
  28283. ,
  28284. n.prototype.downloadComplete = function(e, t) {
  28285. if (e.panoGroupId === this.panoGroupId) {
  28286. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  28287. e.status = h.Downloaded,
  28288. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  28289. var n = {
  28290. panoId: e.pano.id,
  28291. image: t,
  28292. tileSize: e.tileSize,
  28293. panoSize: e.panoSize,
  28294. tileIndex: e.tileIndex,
  28295. faceTileIndex: e.faceTileIndex,
  28296. totalTiles: e.totalTiles,
  28297. face: e.face,
  28298. tileX: e.tileX,
  28299. tileY: e.tileY,
  28300. direction: e.direction
  28301. };
  28302. e.image = t,
  28303. this.emit(s.TileDownloadSuccess, n),
  28304. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  28305. panoId: e.pano.id,
  28306. tileSize: e.tileSize,
  28307. panoSize: e.panoSize
  28308. },
  28309. this.emit(s.PanoDownloadComplete, n),
  28310. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  28311. }
  28312. }
  28313. ,
  28314. n.prototype.cleanupActiveDownloads = function() {
  28315. var e = [];
  28316. return function() {
  28317. e.length = 0;
  28318. for (var t = 0; t < this.activeDownloads.length; t++) {
  28319. var i = this.activeDownloads[t];
  28320. i.status !== h.Downloaded && i.status !== h.Failed && e.push(i)
  28321. }
  28322. this.activeDownloads.length = 0,
  28323. this.activeDownloads.push.apply(this.activeDownloads, e)
  28324. }
  28325. }(),
  28326. n.prototype.isPanoDownloaded = function(e, t) {
  28327. var i = this.getTileDownloadDescriptors(e, t);
  28328. if (i.length <= 0)
  28329. return !1;
  28330. for (var n = 0; n < i.length; n++) {
  28331. var r = i[n];
  28332. if (r.status !== h.Downloaded)
  28333. return !1
  28334. }
  28335. return !0
  28336. }
  28337. ,
  28338. n.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  28339. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  28340. this.panoLoadCallbacks[o] = {
  28341. onLoad: i,
  28342. onFail: n,
  28343. onProgress: r
  28344. }
  28345. }
  28346. ,
  28347. n.prototype.getPanoLoadCallbacks = function(e, t) {
  28348. var i = e.id + ":" + t;
  28349. return this.panoLoadCallbacks[i]
  28350. }
  28351. ,
  28352. n.prototype.buildDownloadDescriptorArray = function(e) {
  28353. for (var t = c.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  28354. var r = this.buildDownloadDescriptor();
  28355. i.push(r)
  28356. }
  28357. return i
  28358. }
  28359. ,
  28360. n.prototype.buildDownloadDescriptor = function() {
  28361. var e = {
  28362. panoGroupId: null,
  28363. pano: null,
  28364. panoSize: -1,
  28365. tileSize: -1,
  28366. tileIndex: -1,
  28367. totalTiles: -1,
  28368. faceTileIndex: -1,
  28369. status: h.None,
  28370. url: null,
  28371. image: null,
  28372. direction: new r.Vector3,
  28373. face: -1,
  28374. cubeFace: -1,
  28375. tileX: -1,
  28376. tileY: -1
  28377. };
  28378. return e
  28379. }
  28380. ,
  28381. n.prototype.initTileDownloadDescriptors = function(e, t, i) {
  28382. for (var n = 0; n < e.length; n++) {
  28383. var r = e[n];
  28384. this.initTileDownloadDescriptor(r, t, i, n)
  28385. }
  28386. }
  28387. ,
  28388. n.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  28389. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i;
  28390. e.face = c.getFaceForTile(i, n),
  28391. e.cubeFace = u.mapFaceToCubemapFace(e.face),
  28392. e.panoGroupId = this.panoGroupId,
  28393. e.pano = t,
  28394. e.panoSize = i,
  28395. e.tileSize = r,
  28396. e.tileIndex = n,
  28397. e.totalTiles = c.getTileCountForSize(i),
  28398. e.status = h.None,
  28399. e.image = null,
  28400. c.getTileLocation(e.panoSize, e.tileIndex, e),
  28401. c.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, c.LocationOnTile.Center, 0, e.direction)
  28402. }
  28403. ,
  28404. n.prototype.getTileUrl = function() {
  28405. var e = {
  28406. 256: "256",
  28407. 512: "512",
  28408. 1024: "1k",
  28409. 2048: "2k",
  28410. 4096: "4k"
  28411. }
  28412. , t = {
  28413. face: -1,
  28414. faceTileIndex: -1,
  28415. tileX: -1,
  28416. tileY: -1
  28417. };
  28418. return function(i, n, r, a) {
  28419. c.getTileLocation(n, a, t);
  28420. var s = Math.floor(n / r)
  28421. , l = s * s
  28422. , h = Math.floor(a / l)
  28423. , u = "";
  28424. 1 === o.tiling.customCompression && (u = "_" + o.tiling["q" + e[n]]);
  28425. var d = this.urls.get("tiles/" + i + "/" + e[n] + u + "_face" + h + "_" + t.tileX + "_" + t.tileY + ".jpg");
  28426. return d = p.changeIfTileGenerating(d)
  28427. }
  28428. }(),
  28429. n.prototype.loadImage = function(e, t, i, n) {
  28430. d.getImage(e, t).then(function(e) {
  28431. i(e)
  28432. }).fail(n)
  28433. }
  28434. ,
  28435. t.exports = n
  28436. }
  28437. ).call(this, "/js/tile/TileDownloader.js")
  28438. }
  28439. , {
  28440. "../ab": 3,
  28441. "../enum/DownloadStatus": 24,
  28442. "../enum/GLCubeFaces": 25,
  28443. "../enum/PanoSizeClass": 36,
  28444. "../enum/TileDownloaderEvents": 45,
  28445. "../enum/Vectors": 50,
  28446. "../enum/Viewmode": 51,
  28447. "../objects/Panorama": 148,
  28448. "../settings": 166,
  28449. "../util/ajax": 181,
  28450. "../util/logger": 189,
  28451. "../util/panorama": 191,
  28452. "./TilePrioritizer": 172,
  28453. "./TileUtils": 174,
  28454. events: 202,
  28455. three: 217
  28456. }],
  28457. 172: [function(e, t, i) {
  28458. (function(i) {
  28459. "use strict";
  28460. function n(e, t, i, o, a) {
  28461. this.qualityManager = e,
  28462. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  28463. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  28464. this.baseSize = t,
  28465. this.standardSize = i,
  28466. this.highSize = o,
  28467. this.ultraHighSize = a,
  28468. this.priorityCriteria = new n.PriorityCriteria(null,new r.Vector3(0,0,0),new r.Vector3(0,0,-1),new r.Vector3(0,0,-1))
  28469. }
  28470. var r = e("three")
  28471. , o = (e("../enum/Viewmode"),
  28472. e("../settings"),
  28473. e("../settings"),
  28474. e("../objects/Panorama"))
  28475. , a = e("../util/logger")
  28476. , s = (e("../enum/Vectors"),
  28477. e("../enum/PanoSizeClass"),
  28478. e("../enum/ModelManagerEvents"),
  28479. e("../enum/GLCubeFaces"),
  28480. e("../enum/DownloadStatus"))
  28481. , l = (e("../util/browser"),
  28482. e("./TileUtils"))
  28483. , c = e("../util/math")
  28484. , h = (e("events").EventEmitter,
  28485. new a(i),
  28486. Object.freeze({
  28487. None: 0,
  28488. DirectionalFOV: 1
  28489. }));
  28490. n.PriorityCriteria = function(e, t, i, n, o) {
  28491. this.pano = e,
  28492. this.cameraPosition = (new r.Vector3).copy(t),
  28493. this.cameraDir = (new r.Vector3).copy(i),
  28494. this.panoSpaceDir = (new r.Vector3).copy(n),
  28495. this.upcomingPanos = o,
  28496. this.copy = function(e) {
  28497. this.pano = e.pano,
  28498. this.cameraPosition.copy(e.cameraPosition),
  28499. this.cameraDir.copy(e.cameraDir),
  28500. this.panoSpaceDir.copy(e.panoSpaceDir),
  28501. this.upcomingPanos = o
  28502. }
  28503. ,
  28504. this.zoomingActive = !1
  28505. }
  28506. ,
  28507. n.DIRECTIONAL_FOV = 180,
  28508. n.DIRECTIONAL_FOV_NARROW = 120,
  28509. n.MAX_SCORED_PANOS_TOCONSIDER = 6,
  28510. n.MAX_SCORED_PANOS_TOADD = 2,
  28511. n.MAX_UPCOMING_PANOS_TOADD = 3,
  28512. n.DIRECTION_SCORE_STRICTNESS = .75,
  28513. n.appendQueue = function(e, t) {
  28514. if (e && t)
  28515. for (var i = 0; i < t.length; i++)
  28516. e.push(t[i])
  28517. }
  28518. ,
  28519. n.prototype.updateCriteria = function(e, t, i, n) {
  28520. this.priorityCriteria.pano = e,
  28521. this.priorityCriteria.cameraPosition.copy(t),
  28522. this.priorityCriteria.cameraDir.copy(i),
  28523. this.priorityCriteria.upcomingPanos = n,
  28524. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  28525. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  28526. }
  28527. ,
  28528. n.prototype.filterAndPrioritize = function() {
  28529. var e = []
  28530. , t = []
  28531. , i = [];
  28532. return function(r, o, a) {
  28533. this.populateNeighborPanos(this.priorityCriteria.pano, o, e),
  28534. this.populateScoredPanos(this.priorityCriteria.pano, o, t, this.priorityCriteria.cameraDir, n.MAX_SCORED_PANOS_TOCONSIDER);
  28535. var s = this.baseSize
  28536. , l = this.standardSize
  28537. , c = this.highSize
  28538. , h = this.ultraHighSize;
  28539. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  28540. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, s, n.MAX_UPCOMING_PANOS_TOADD),
  28541. i.length = 0,
  28542. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28543. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28544. n.appendQueue(r, i),
  28545. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  28546. i.length = 0,
  28547. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28548. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28549. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28550. n.appendQueue(r, i),
  28551. i.length = 0,
  28552. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28553. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28554. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28555. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28556. n.appendQueue(r, i),
  28557. this.queueTilesForPanos(r, e, a, s)
  28558. }
  28559. }(),
  28560. n.prototype.canDownloadSize = function(e) {
  28561. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  28562. }
  28563. ,
  28564. n.prototype.populateNeighborPanos = function(e, t, i) {
  28565. i = i || [],
  28566. i.length = 0;
  28567. var n = t.getNeighbours(e);
  28568. for (var r in n)
  28569. if (n.hasOwnProperty(r)) {
  28570. var o = t.get(r);
  28571. i.push(o)
  28572. }
  28573. return i
  28574. }
  28575. ,
  28576. n.prototype.populateScoredPanos = function(e, t, i, r, a) {
  28577. i = i || [],
  28578. i.length = 0;
  28579. var s = [o.filters.inPanoDirection(e.position, r, n.DIRECTION_SCORE_STRICTNESS), o.filters.not(e)]
  28580. , l = [o.scoreFunctions.distanceSquared(e), o.scoreFunctions.direction(e.position, r)]
  28581. , c = t.sortByScore(s, l);
  28582. if (c)
  28583. for (var h = 0; h < c.length && h < a; h++) {
  28584. var u = c[h].pano;
  28585. i.push(u)
  28586. }
  28587. return i
  28588. }
  28589. ,
  28590. n.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  28591. for (var o = 0, a = 0; a < t.length; a++) {
  28592. var s = t[a]
  28593. , l = this.queueTilesForPano(e, i, s, n);
  28594. if (o += l > 0 ? 1 : 0,
  28595. r && o >= r)
  28596. break
  28597. }
  28598. return o
  28599. }
  28600. ,
  28601. n.prototype.queueTilesForPano = function() {
  28602. var e = {
  28603. filter: h.None
  28604. };
  28605. return function(t, i, n, r) {
  28606. return this.filterAndQueueTileDownloadDescriptors(t, i, n, r, e)
  28607. }
  28608. }(),
  28609. n.prototype.queueTilesForPanosInDirection = function() {
  28610. var e = new r.Vector3;
  28611. return function(t, i, n, r, o, a, s, l) {
  28612. for (var h = 0, u = 0; u < n.length; u++) {
  28613. var d = n[u];
  28614. e.copy(d.position),
  28615. e.sub(o),
  28616. e.normalize();
  28617. var p = Math.max(Math.min(a.dot(e), 1), -1)
  28618. , f = c.getFOVDotThreshold(s);
  28619. if (p >= f) {
  28620. var g = this.queueTilesInDirectionForPano(t, i, d, r, o, a, s);
  28621. if (h += g > 0 ? 1 : 0,
  28622. l && h >= l)
  28623. break
  28624. }
  28625. }
  28626. return h
  28627. }
  28628. }(),
  28629. n.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  28630. for (var l = 0, c = 0; c < i.length; c++) {
  28631. var h = i[c]
  28632. , u = this.queueTilesInDirectionForPano(e, t, h, n, o, a);
  28633. if (l += u > 0 ? 1 : 0,
  28634. s && l >= s)
  28635. break
  28636. }
  28637. return l
  28638. }
  28639. ,
  28640. n.prototype.queueTilesInDirectionForPano = function() {
  28641. var e = {
  28642. filter: h.DirectionalFOV,
  28643. direction: new r.Vector3,
  28644. fov: 60
  28645. }
  28646. , t = new r.Vector3;
  28647. return function(i, n, r, o, a, s, c) {
  28648. return t.copy(s),
  28649. l.getRelativeDirection(r.quaternion, t),
  28650. e.direction.copy(t),
  28651. e.fov = c,
  28652. this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  28653. }
  28654. }(),
  28655. n.prototype.filterAndQueueTileDownloadDescriptors = function() {
  28656. var e = [];
  28657. return function(t, i, n, r, o) {
  28658. var a = i.getTileDownloadDescriptors(n, r);
  28659. e.length = 0,
  28660. this.filterTileDownloadDescriptors(n, a, e, o);
  28661. for (var s = 0, l = 0; l < e.length; l++) {
  28662. var c = e[l];
  28663. c && (t.push(c),
  28664. s++)
  28665. }
  28666. return s
  28667. }
  28668. }(),
  28669. n.prototype.filterTileDownloadDescriptors = function() {
  28670. new r.Vector3;
  28671. return function(e, t, i, n) {
  28672. var r, o;
  28673. switch (n.filter) {
  28674. case h.DirectionalFOV:
  28675. for (r = 0; r < t.length; r++)
  28676. o = t[r],
  28677. l.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  28678. break;
  28679. default:
  28680. for (r = 0; r < t.length; r++)
  28681. o = t[r],
  28682. i.push(o)
  28683. }
  28684. for (r = 0; r < i.length; r++)
  28685. o = i[r],
  28686. this.canIncludeDescriptor(o) || (i[r] = null)
  28687. }
  28688. }(),
  28689. n.prototype.canIncludeDescriptor = function(e) {
  28690. return e.status !== s.Downloading && e.status !== s.Downloaded
  28691. }
  28692. ,
  28693. n.prototype.canIncludePano = function(e, t) {
  28694. return !e.isLoaded(t)
  28695. }
  28696. ,
  28697. n.getFOVDotThreshold = function(e) {
  28698. return Math.cos(r.Math.degToRad(e / 2))
  28699. }
  28700. ;
  28701. var u = function() {
  28702. var e = function e(t, i) {
  28703. var n = e._panoSpaceDir
  28704. , r = e._fovThreshold
  28705. , o = e._fovThresholdNarrow
  28706. , a = Math.max(Math.min(n.dot(t.direction), 1), -1)
  28707. , s = Math.max(Math.min(n.dot(i.direction), 1), -1);
  28708. return t._dot = a,
  28709. i._dot = s,
  28710. a >= r && s < r ? -1 : a < r && s >= r ? 1 : a >= o && s < o ? -1 : a < o && s >= o ? 1 : t.panoSize > i.panoSize ? 1 : i.panoSize > t.panoSize ? -1 : -(a - s)
  28711. };
  28712. return e._panoSpaceDir = new r.Vector3,
  28713. e._fovThreshold = -1,
  28714. e._fovThresholdNarrow = -1,
  28715. e
  28716. }();
  28717. n.sortPanoTiles = function(e, t, i) {
  28718. u._panoSpaceDir.copy(i),
  28719. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  28720. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  28721. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV),
  28722. e.sort(u)
  28723. }
  28724. ,
  28725. n.insertSortedPanoTile = function(e, t, i, r) {
  28726. u._panoSpaceDir.copy(r),
  28727. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  28728. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  28729. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV);
  28730. for (var o = -1, a = 0; a < e.length; a++) {
  28731. var s = u(t, e[a]);
  28732. if (s <= 0) {
  28733. o = a;
  28734. break
  28735. }
  28736. }
  28737. if (o === -1)
  28738. e[e.length] = t;
  28739. else {
  28740. for (var h = e.length; h > o; h--)
  28741. e[h] = e[h - 1];
  28742. e[o] = t
  28743. }
  28744. }
  28745. ,
  28746. n.prototype.setZoomingActive = function(e) {
  28747. e !== this.zoomingActive && (this.zoomingActive = e)
  28748. }
  28749. ,
  28750. t.exports = n
  28751. }
  28752. ).call(this, "/js/tile/TilePrioritizer.js")
  28753. }
  28754. , {
  28755. "../enum/DownloadStatus": 24,
  28756. "../enum/GLCubeFaces": 25,
  28757. "../enum/ModelManagerEvents": 33,
  28758. "../enum/PanoSizeClass": 36,
  28759. "../enum/Vectors": 50,
  28760. "../enum/Viewmode": 51,
  28761. "../objects/Panorama": 148,
  28762. "../settings": 166,
  28763. "../util/browser": 182,
  28764. "../util/logger": 189,
  28765. "../util/math": 190,
  28766. "./TileUtils": 174,
  28767. events: 202,
  28768. three: 217
  28769. }],
  28770. 173: [function(e, t, i) {
  28771. "use strict";
  28772. function n(e, t) {
  28773. this.levels = t,
  28774. this.tileSize = e,
  28775. this.root = null,
  28776. this.allNodes = [],
  28777. a(this)
  28778. }
  28779. function r(e, t) {
  28780. this.tree = e,
  28781. this.parent = t,
  28782. this.children = [],
  28783. this.id = ++u
  28784. }
  28785. function o(e, t, i, r, a, s, l, h) {
  28786. if (e) {
  28787. l = l || n.TraversalType.PreOrder;
  28788. var u = r * c + i;
  28789. if (l === n.TraversalType.PreOrder && (a && a(e, t, u, i, r),
  28790. s && s.push(e)),
  28791. e.children && 0 !== e.children.length) {
  28792. for (var d = r * c, p = i * c, f = 0; f < c; f++)
  28793. for (var g = 0; g < c; g++)
  28794. o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h);
  28795. l === n.TraversalType.PostOrder && (a && a(e, t, u, i, r),
  28796. s && s.push(e))
  28797. }
  28798. }
  28799. }
  28800. function a(e) {
  28801. e.root = s(e, null, 0)
  28802. }
  28803. function s(e, t, i) {
  28804. if (i > e.levels)
  28805. return null;
  28806. var n = new r(e,t);
  28807. e.allNodes.push(n);
  28808. for (var o = 0; o < h; o++)
  28809. n.children[o] = s(e, n, i + 1);
  28810. return n
  28811. }
  28812. function l(e, t, i, n, r) {
  28813. if (!e)
  28814. return null;
  28815. if (0 === i)
  28816. return e;
  28817. if (!e.children || 0 === e.children.length)
  28818. return null;
  28819. var o = Math.pow(c, i)
  28820. , a = o / c
  28821. , s = n % a
  28822. , h = r % a
  28823. , u = Math.floor(r / a)
  28824. , d = Math.floor(n / a)
  28825. , p = u * c + d
  28826. , f = e.children[p];
  28827. return l(f, t + 1, i - 1, s, h)
  28828. }
  28829. var c = (e("three"),
  28830. e("./TileUtils"),
  28831. e("../objects/Panorama"),
  28832. e("../util/panorama"),
  28833. e("events").EventEmitter,
  28834. 2)
  28835. , h = c * c;
  28836. n.TraversalType = Object.freeze({
  28837. PreOrder: 0,
  28838. PostOrder: 1
  28839. });
  28840. var u = 0;
  28841. n.getLevelCountForSize = function(e, t) {
  28842. var i = 0;
  28843. for (t < e && (t = e); ; ) {
  28844. if (t /= c,
  28845. t < e)
  28846. break;
  28847. i++
  28848. }
  28849. return i
  28850. }
  28851. ,
  28852. n.getSizeForLevel = function(e, t) {
  28853. return Math.pow(c, t) * e
  28854. }
  28855. ,
  28856. n.prototype.getSubNode = function(e, t, i) {
  28857. (!t || e < this.tileSize) && (t = 0),
  28858. (!i || e < this.tileSize) && (i = 0),
  28859. e < this.tileSize && (e = this.tileSize);
  28860. var r = n.getLevelCountForSize(this.tileSize, e)
  28861. , o = l(this.root, 0, r, t, i);
  28862. return o
  28863. }
  28864. ,
  28865. n.prototype.breadthFirst = function(e) {
  28866. e = e || {};
  28867. var t = !!e.nullLevelEnd
  28868. , i = e.maxLevel
  28869. , n = e.minLevel
  28870. , r = e.callback
  28871. , o = e.saveVisited
  28872. , a = []
  28873. , s = {}
  28874. , l = 0
  28875. , c = 0;
  28876. for (a.push(this.root),
  28877. a.push(s); a.length > 0 && !(i && l > i); ) {
  28878. var h = a.shift();
  28879. if (h === s)
  28880. (!n || l >= n) && (r && t && r(null),
  28881. o && t && o.push(null)),
  28882. a.length > 0 && a.push(s),
  28883. l++,
  28884. c = 0;
  28885. else {
  28886. if (h.children)
  28887. for (var u = 0; u < h.children.length; u++) {
  28888. var d = h.children[u];
  28889. d && a.push(h.children[u])
  28890. }
  28891. var p = this.getFaceIndexFromNode(h);
  28892. (!n || l >= n) && (r && r(h, l, p),
  28893. o && o.push(h)),
  28894. c++
  28895. }
  28896. }
  28897. }
  28898. ,
  28899. n.prototype.getFaceIndexFromNode = function(e) {
  28900. if (!e)
  28901. return -1;
  28902. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  28903. var o = i.parent;
  28904. if (!o)
  28905. break;
  28906. for (var a = -1, s = 0; s < o.children.length; s++)
  28907. o.children[s] === i && (a = s);
  28908. var l = a % c
  28909. , h = Math.floor(a / c);
  28910. n = l * t + n,
  28911. r = h * t + r,
  28912. t *= c,
  28913. i = o
  28914. }
  28915. return r * t + n
  28916. }
  28917. ,
  28918. n.prototype.depthFirst = function(e, t, i) {
  28919. o(this.root, 0, 0, 0, e, t, i, this.tileSize)
  28920. }
  28921. ,
  28922. t.exports = n
  28923. }
  28924. , {
  28925. "../objects/Panorama": 148,
  28926. "../util/panorama": 191,
  28927. "./TileUtils": 174,
  28928. events: 202,
  28929. three: 217
  28930. }],
  28931. 174: [function(e, t, i) {
  28932. "use strict";
  28933. var n = e("../enum/GLCubeFaces")
  28934. , r = e("../util/MathLight")
  28935. , o = {};
  28936. o.TILE_SIZE = 512,
  28937. o.FACES_PER_PANO = 6,
  28938. o.LocationOnTile = {
  28939. Center: 0,
  28940. UpperLeft: 1,
  28941. UpperRight: 2,
  28942. LowerRight: 3,
  28943. LowerLeft: 4
  28944. },
  28945. o.getTileVector = function() {
  28946. return function(e, t, i, a, s, l, c, h) {
  28947. l = l || o.LocationOnTile.Center;
  28948. var u = e / t
  28949. , d = a / u;
  28950. s = -s + (u - 1);
  28951. var p = s / u
  28952. , f = t / e
  28953. , g = 2 * f
  28954. , m = g / 2
  28955. , v = 2 * d - 1 + m
  28956. , A = 2 * p - 1 + m;
  28957. switch (l) {
  28958. case o.LocationOnTile.UpperLeft:
  28959. v -= m,
  28960. A += m,
  28961. v += c * g;
  28962. break;
  28963. case o.LocationOnTile.UpperRight:
  28964. v += m,
  28965. A += m,
  28966. A -= c * g;
  28967. break;
  28968. case o.LocationOnTile.LowerRight:
  28969. v += m,
  28970. A -= m,
  28971. v -= c * g;
  28972. break;
  28973. case o.LocationOnTile.LowerLeft:
  28974. v -= m,
  28975. A -= m,
  28976. A += c * g;
  28977. break;
  28978. case o.LocationOnTile.Center:
  28979. }
  28980. switch (i) {
  28981. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28982. r.setVector(h, -1, A, -v);
  28983. break;
  28984. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28985. r.setVector(h, 1, A, v);
  28986. break;
  28987. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28988. r.setVector(h, -v, 1, -A);
  28989. break;
  28990. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28991. r.setVector(h, -v, -1, A);
  28992. break;
  28993. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28994. r.setVector(h, -v, A, 1);
  28995. break;
  28996. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28997. r.setVector(h, v, A, -1)
  28998. }
  28999. r.normalize(h)
  29000. }
  29001. }(),
  29002. o.getFaceForTile = function(e, t) {
  29003. var i = o.TILE_SIZE;
  29004. e < o.TILE_SIZE && (i = e);
  29005. var n = Math.floor(e / i)
  29006. , r = n * n;
  29007. return Math.floor(t / r)
  29008. }
  29009. ,
  29010. o.getTileLocation = function(e, t, i) {
  29011. var n = o.TILE_SIZE;
  29012. e < o.TILE_SIZE && (n = e);
  29013. var r = o.getFaceForTile(e, t)
  29014. , a = Math.floor(e / n)
  29015. , s = a * a
  29016. , l = t - r * s;
  29017. i.tileX = l % a,
  29018. i.tileY = Math.floor(l / a),
  29019. i.face = r,
  29020. i.faceTileIndex = l
  29021. }
  29022. ,
  29023. o.getTileCountForSize = function(e) {
  29024. if (e <= o.TILE_SIZE)
  29025. return o.FACES_PER_PANO;
  29026. var t = Math.floor(e / o.TILE_SIZE)
  29027. , i = t * t
  29028. , n = i * o.FACES_PER_PANO;
  29029. return n
  29030. }
  29031. ,
  29032. o.getRelativeDirection = function() {
  29033. var e = new r.Matrix4
  29034. , t = new r.Quaternion;
  29035. return function(i, n) {
  29036. t.copy(i),
  29037. t.inverse(),
  29038. e.makeRotationFromQuaternion(t),
  29039. e.applyToVector3(n),
  29040. r.normalize(n)
  29041. }
  29042. }(),
  29043. o.matchingTilesInDirection = function() {
  29044. var e = new r.Vector3
  29045. , t = new r.Vector3(0,0,-1)
  29046. , i = new r.Quaternion
  29047. , n = function(e, t) {
  29048. e.push({
  29049. face: t.face,
  29050. faceTileIndex: t.faceTileIndex,
  29051. tileX: t.tileX,
  29052. tileY: t.tileY
  29053. })
  29054. }
  29055. , a = function() {
  29056. var e = {
  29057. face: -1,
  29058. faceTileIndex: -1,
  29059. tileX: -1,
  29060. tileY: -1
  29061. };
  29062. return function(t, i, r) {
  29063. for (var a = o.getTileCountForSize(t), s = 0, l = 0; l < a; l++)
  29064. o.getTileLocation(t, l, e),
  29065. i && !i(e) || (s++,
  29066. r && n(r, e));
  29067. return s
  29068. }
  29069. }();
  29070. return function(n, s, l, c, h, u) {
  29071. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE;
  29072. o.getTileCountForSize(s);
  29073. if (!c && !h)
  29074. return a(s, null, u);
  29075. var p = !!h;
  29076. if (h = h || c,
  29077. h = Math.max(0, Math.min(h, 360)),
  29078. c = Math.max(0, Math.min(c, 360)),
  29079. r.copyVector(l, e),
  29080. o.getRelativeDirection(n.quaternion, e),
  29081. p) {
  29082. i.setFromUnitVectors(e, t);
  29083. var f = function(e) {
  29084. return o.isTileWithinFrustum(s, d, e.face, e.tileX, e.tileY, i, c, h)
  29085. };
  29086. return a(s, f, u)
  29087. }
  29088. var g = function(t) {
  29089. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c)
  29090. };
  29091. return a(s, g, u)
  29092. }
  29093. }(),
  29094. o.isTileWithinFrustum = function() {
  29095. var e = new r.Vector3
  29096. , t = 1e-5;
  29097. return function(i, n, a, s, l, c, h, u) {
  29098. for (var d = Math.tan(.5 * u * r.RADIANS_PER_DEGREE), p = -d, f = Math.tan(.5 * h * r.RADIANS_PER_DEGREE), g = -f, m = o.mapFaceToCubemapFace(a), v = 0, A = 0, y = 0, C = 0, I = 0, E = 0, b = o.LocationOnTile.Center; b <= o.LocationOnTile.LowerLeft; b++)
  29099. if (o.getTileVector(i, n, m, s, l, b, 0, e),
  29100. r.applyQuaternionToVector(c, e),
  29101. e.z >= -t)
  29102. I++;
  29103. else {
  29104. var w = -1 / e.z
  29105. , _ = e.x * w
  29106. , T = e.y * w;
  29107. T > d ? v++ : T < p && A++,
  29108. _ > f ? y++ : _ < g && C++,
  29109. E++
  29110. }
  29111. return A !== E && v !== E && y !== E && C !== E
  29112. }
  29113. }(),
  29114. o.isTileWithinFOV = function() {
  29115. var e = new r.Vector3
  29116. , t = new r.Vector3(0,1,0)
  29117. , i = new r.Vector3(1,0,0);
  29118. return function(n, a, s, l, c, h, u) {
  29119. var d = o.mapFaceToCubemapFace(s);
  29120. if (r.cross(h, t, i),
  29121. o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e),
  29122. o.isWithinFOV(e, h, u, null))
  29123. return !0;
  29124. for (var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0; m < f; m++) {
  29125. for (var v = o.LocationOnTile.UpperLeft; v <= o.LocationOnTile.LowerLeft; v++)
  29126. if (o.getTileVector(n, a, d, l, c, v, g, e),
  29127. o.isWithinFOV(e, h, u, null))
  29128. return !0;
  29129. g += p
  29130. }
  29131. return !1
  29132. }
  29133. }(),
  29134. o.isWithinFOV = function() {
  29135. var e = new r.Vector3
  29136. , t = new r.Vector3;
  29137. return function(i, n, o, a) {
  29138. if (r.copyVector(i, t),
  29139. a) {
  29140. r.copyVector(a, e),
  29141. r.normalize(e);
  29142. var s = r.dot(e, i);
  29143. e.x *= s,
  29144. e.y *= s,
  29145. e.z *= s,
  29146. r.subVector(t, e)
  29147. }
  29148. var l = o / 2 * r.RADIANS_PER_DEGREE
  29149. , c = Math.cos(l)
  29150. , h = r.dot(t, n);
  29151. return h >= c
  29152. }
  29153. }(),
  29154. o.mapFaceToCubemapFace = function() {
  29155. var e = {
  29156. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  29157. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  29158. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  29159. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  29160. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  29161. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  29162. };
  29163. return function(t) {
  29164. return e[t]
  29165. }
  29166. }(),
  29167. t.exports = o
  29168. }
  29169. , {
  29170. "../enum/GLCubeFaces": 25,
  29171. "../util/MathLight": 176
  29172. }],
  29173. 175: [function(e, t, i) {
  29174. (function(i) {
  29175. "use strict";
  29176. function n() {
  29177. this.list = [],
  29178. this.index = {},
  29179. Object.defineProperty(this, "length", {
  29180. get: function() {
  29181. return this.list.length
  29182. }
  29183. })
  29184. }
  29185. var r = (e("./common"),
  29186. e("./logger"));
  29187. new r(i);
  29188. n.prototype.forEach = function(e) {
  29189. this.list.forEach(e)
  29190. }
  29191. ,
  29192. n.prototype.add = function(e) {
  29193. this.list.push(e),
  29194. this.index[this.getIndex(e)] = e
  29195. }
  29196. ,
  29197. n.prototype.getIndex = function(e) {
  29198. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  29199. }
  29200. ,
  29201. n.prototype.extend = function(e) {
  29202. for (var t = 0; t < e.length; t++)
  29203. this.add(e[t])
  29204. }
  29205. ,
  29206. n.prototype.get = function(e) {
  29207. return this.index[e]
  29208. }
  29209. ,
  29210. n.prototype.first = function() {
  29211. return this.list[0]
  29212. }
  29213. ,
  29214. n.prototype.last = function() {
  29215. return this.list[this.list.length - 1]
  29216. }
  29217. ,
  29218. n.prototype.reIndex = function() {
  29219. this.index = {};
  29220. var e = this;
  29221. this.forEach(function(t) {
  29222. e.index[e.getIndex(t)] = t
  29223. })
  29224. }
  29225. ,
  29226. n.prototype.filter = function(e) {
  29227. var t = this.list.filter(e);
  29228. return this.reIndex(),
  29229. t
  29230. }
  29231. ,
  29232. n.prototype.reduce = function(e, t) {
  29233. return this.list.reduce(e, t)
  29234. }
  29235. ,
  29236. n.prototype.sort = function(e) {
  29237. return this.list.sort(e)
  29238. }
  29239. ,
  29240. n.prototype.indexOf = function(e) {
  29241. for (var t = 0; t < this.list.length; ++t)
  29242. if (this.list[t] === e)
  29243. return t;
  29244. return -1
  29245. }
  29246. ,
  29247. t.exports = n
  29248. }
  29249. ).call(this, "/js/util/IndexedCollection.js")
  29250. }
  29251. , {
  29252. "./common": 185,
  29253. "./logger": 189
  29254. }],
  29255. 176: [function(e, t, i) {
  29256. "use strict";
  29257. var n = e("../constants")
  29258. , r = {};
  29259. r.RADIANS_PER_DEGREE = Math.PI / 180,
  29260. r.DEGREES_PER_RADIAN = 180 / Math.PI,
  29261. r.Vector3 = function(e, t, i) {
  29262. this.x = e || 0,
  29263. this.y = t || 0,
  29264. this.z = i || 0
  29265. }
  29266. ,
  29267. r.Matrix4 = function() {
  29268. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  29269. arguments.length > 0 && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  29270. }
  29271. ,
  29272. r.Matrix4.prototype = {
  29273. identity: function() {
  29274. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  29275. this
  29276. },
  29277. copy: function(e) {
  29278. return this.elements.set(e.elements),
  29279. this
  29280. },
  29281. applyToVector3: function(e) {
  29282. var t = e.x
  29283. , i = e.y
  29284. , n = e.z
  29285. , r = this.elements;
  29286. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  29287. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  29288. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  29289. this
  29290. },
  29291. getInverse: function(e, t) {
  29292. var i = this.elements
  29293. , n = e.elements
  29294. , r = n[0]
  29295. , o = n[1]
  29296. , a = n[2]
  29297. , s = n[3]
  29298. , l = n[4]
  29299. , c = n[5]
  29300. , h = n[6]
  29301. , u = n[7]
  29302. , d = n[8]
  29303. , p = n[9]
  29304. , f = n[10]
  29305. , g = n[11]
  29306. , m = n[12]
  29307. , v = n[13]
  29308. , A = n[14]
  29309. , y = n[15]
  29310. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  29311. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  29312. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  29313. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  29314. , w = r * C + o * I + a * E + s * b;
  29315. if (0 === w) {
  29316. var _ = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  29317. if (t)
  29318. throw new Error(_);
  29319. return console.warn(_),
  29320. this.identity()
  29321. }
  29322. var T = 1 / w;
  29323. return i[0] = C * T,
  29324. i[1] = (v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y) * T,
  29325. i[2] = (c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y) * T,
  29326. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  29327. i[4] = I * T,
  29328. i[5] = (d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y) * T,
  29329. i[6] = (m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y) * T,
  29330. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  29331. i[8] = E * T,
  29332. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y) * T,
  29333. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y) * T,
  29334. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  29335. i[12] = b * T,
  29336. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A) * T,
  29337. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A) * T,
  29338. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  29339. this
  29340. },
  29341. makeRotationFromQuaternion: function(e) {
  29342. var t = this.elements
  29343. , i = e.x
  29344. , n = e.y
  29345. , r = e.z
  29346. , o = e.w
  29347. , a = i + i
  29348. , s = n + n
  29349. , l = r + r
  29350. , c = i * a
  29351. , h = i * s
  29352. , u = i * l
  29353. , d = n * s
  29354. , p = n * l
  29355. , f = r * l
  29356. , g = o * a
  29357. , m = o * s
  29358. , v = o * l;
  29359. return t[0] = 1 - (d + f),
  29360. t[4] = h - v,
  29361. t[8] = u + m,
  29362. t[1] = h + v,
  29363. t[5] = 1 - (c + f),
  29364. t[9] = p - g,
  29365. t[2] = u - m,
  29366. t[6] = p + g,
  29367. t[10] = 1 - (c + d),
  29368. t[3] = 0,
  29369. t[7] = 0,
  29370. t[11] = 0,
  29371. t[12] = 0,
  29372. t[13] = 0,
  29373. t[14] = 0,
  29374. t[15] = 1,
  29375. this
  29376. }
  29377. },
  29378. r.Quaternion = function(e, t, i, n) {
  29379. this._x = e || 0,
  29380. this._y = t || 0,
  29381. this._z = i || 0,
  29382. this._w = void 0 !== n ? n : 1
  29383. }
  29384. ,
  29385. r.Quaternion.prototype = {
  29386. get x() {
  29387. return this._x
  29388. },
  29389. set x(e) {
  29390. this._x = e
  29391. },
  29392. get y() {
  29393. return this._y
  29394. },
  29395. set y(e) {
  29396. this._y = e
  29397. },
  29398. get z() {
  29399. return this._z
  29400. },
  29401. set z(e) {
  29402. this._z = e
  29403. },
  29404. get w() {
  29405. return this._w
  29406. },
  29407. set w(e) {
  29408. this._w = e
  29409. },
  29410. copy: function(e) {
  29411. this._x = e.x,
  29412. this._y = e.y,
  29413. this._z = e.z,
  29414. this._w = e.w
  29415. },
  29416. inverse: function() {
  29417. return this.conjugate().normalize()
  29418. },
  29419. conjugate: function() {
  29420. return this._x *= -1,
  29421. this._y *= -1,
  29422. this._z *= -1,
  29423. this
  29424. },
  29425. length: function() {
  29426. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  29427. },
  29428. normalize: function() {
  29429. var e = this.length();
  29430. return 0 === e ? (this._x = 0,
  29431. this._y = 0,
  29432. this._z = 0,
  29433. this._w = 1) : (e = 1 / e,
  29434. this._x = this._x * e,
  29435. this._y = this._y * e,
  29436. this._z = this._z * e,
  29437. this._w = this._w * e),
  29438. this
  29439. },
  29440. setFromAxisAngle: function(e, t) {
  29441. var i = t / 2
  29442. , n = Math.sin(i);
  29443. return this._x = e.x * n,
  29444. this._y = e.y * n,
  29445. this._z = e.z * n,
  29446. this._w = Math.cos(i),
  29447. this
  29448. },
  29449. setFromUnitVectors: function() {
  29450. var e, t, i = 1e-6;
  29451. return function(n, o) {
  29452. return void 0 === e && (e = new r.Vector3),
  29453. t = r.dot(n, o) + 1,
  29454. t < i ? (t = 0,
  29455. Math.abs(n.x) > Math.abs(n.z) ? r.setVector(e, -n.y, n.x, 0) : r.setVector(e, 0, -n.z, n.y)) : r.cross(n, o, e),
  29456. this._x = e.x,
  29457. this._y = e.y,
  29458. this._z = e.z,
  29459. this._w = t,
  29460. this.normalize()
  29461. }
  29462. }(),
  29463. multiply: function(e) {
  29464. return this.multiplyQuaternions(this, e)
  29465. },
  29466. premultiply: function(e) {
  29467. return this.multiplyQuaternions(e, this)
  29468. },
  29469. multiplyQuaternions: function(e, t) {
  29470. var i = e._x
  29471. , n = e._y
  29472. , r = e._z
  29473. , o = e._w
  29474. , a = t._x
  29475. , s = t._y
  29476. , l = t._z
  29477. , c = t._w;
  29478. return this._x = i * c + o * a + n * l - r * s,
  29479. this._y = n * c + o * s + r * a - i * l,
  29480. this._z = r * c + o * l + i * s - n * a,
  29481. this._w = o * c - i * a - n * s - r * l,
  29482. this
  29483. }
  29484. },
  29485. r.convertWorkshopVector = function(e) {
  29486. return new r.Vector3(-e.x,e.y,e.z)
  29487. }
  29488. ,
  29489. r.convertWorkshopQuaternion = function(e) {
  29490. return new r.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new r.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  29491. }
  29492. ;
  29493. r.convertWorkshopOrthoZoom = function(e) {//xzw
  29494. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / n.workshopApsect
  29495. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  29496. }
  29497. ,
  29498. r.convertWorkshopPanoramaQuaternion = function(e) {
  29499. return new r.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), 270 * r.RADIANS_PER_DEGREE))
  29500. }
  29501. ,
  29502. r.normalize = function(e) {
  29503. var t = e.x * e.x + e.y * e.y + e.z * e.z
  29504. , i = Math.sqrt(t);
  29505. e.x /= i,
  29506. e.y /= i,
  29507. e.z /= i
  29508. }
  29509. ,
  29510. r.dot = function(e, t) {
  29511. return e.x * t.x + e.y * t.y + e.z * t.z
  29512. }
  29513. ,
  29514. r.cross = function(e, t, i) {
  29515. var n = e.x
  29516. , r = e.y
  29517. , o = e.z;
  29518. i.x = r * t.z - o * t.y,
  29519. i.y = o * t.x - n * t.z,
  29520. i.z = n * t.y - r * t.x
  29521. }
  29522. ,
  29523. r.setVector = function(e, t, i, n) {
  29524. e.x = t,
  29525. e.y = i,
  29526. e.z = n
  29527. }
  29528. ,
  29529. r.copyVector = function(e, t) {
  29530. t.x = e.x,
  29531. t.y = e.y,
  29532. t.z = e.z
  29533. }
  29534. ,
  29535. r.addVector = function(e, t) {
  29536. e.x += t.x,
  29537. e.y += t.y,
  29538. e.z += t.z
  29539. }
  29540. ,
  29541. r.subVector = function(e, t) {
  29542. e.x -= t.x,
  29543. e.y -= t.y,
  29544. e.z -= t.z
  29545. }
  29546. ,
  29547. r.applyQuaternionToVector = function(e, t) {
  29548. var i = t.x
  29549. , n = t.y
  29550. , r = t.z
  29551. , o = e.x
  29552. , a = e.y
  29553. , s = e.z
  29554. , l = e.w
  29555. , c = l * i + a * r - s * n
  29556. , h = l * n + s * i - o * r
  29557. , u = l * r + o * n - a * i
  29558. , d = -o * i - a * n - s * r;
  29559. t.x = c * l + d * -o + h * -s - u * -a,
  29560. t.y = h * l + d * -a + u * -o - c * -s,
  29561. t.z = u * l + d * -s + c * -a - h * -o
  29562. }
  29563. ,
  29564. r.angleBetweenVectors = function(e, t) {
  29565. return Math.acos(r.dot(e, t))
  29566. }
  29567. ,
  29568. t.exports = r
  29569. }
  29570. , {
  29571. "../constants": 8
  29572. }],
  29573. 177: [function(e, t, i) {
  29574. (function(i) {
  29575. "use strict";
  29576. function n(e) {
  29577. this.cache = null,
  29578. this.expires = 0
  29579. }
  29580. function r() {
  29581. this.baseUrl = null,
  29582. this.cache = null,
  29583. this.expires = 0
  29584. }
  29585. function o() {
  29586. this.baseUrl = null,
  29587. this.expires = 0
  29588. }
  29589. function a(e) {
  29590. this.initialLoadingPromise = null,
  29591. this.endpoint = e + "?type=3",
  29592. this.urlContainer = null,
  29593. this.authorizationHeader = h.getAuthorizationHeader(),
  29594. this.containerClasses = [o, r, n]
  29595. }
  29596. var s = e("./ajax")
  29597. , l = e("./logger")
  29598. , c = e("../constants")
  29599. , h = e("./showcase")
  29600. , u = (e("../ab"),
  29601. new l(i));
  29602. n.prototype = {
  29603. version: 1,
  29604. validate: function(e) {
  29605. return "catalog.json"in e && Object.keys(e).length > 0
  29606. },
  29607. update: function(e) {
  29608. return this.cache = e,
  29609. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29610. $.when()
  29611. },
  29612. get: function(e) {
  29613. return this.cache[e]
  29614. }
  29615. },
  29616. r.prototype = {
  29617. version: 2,
  29618. validate: function(e) {
  29619. return "catalog.json"in e && "base.url"in e && Object.keys(e).length > 1
  29620. },
  29621. update: function(e) {
  29622. return this.baseUrl = e["base.url"],
  29623. this.cache = e,
  29624. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29625. $.when()
  29626. },
  29627. get: function(e) {
  29628. var t = this.cache[e];
  29629. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  29630. }
  29631. },
  29632. o.prototype = {
  29633. version: 3,
  29634. validate: function(e) {
  29635. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  29636. },
  29637. update: function(e) {
  29638. return this.baseUrl = e.templates[0],
  29639. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29640. $.when()
  29641. },
  29642. get: function(e) {
  29643. return this.baseUrl.replace("{{filename}}", e)
  29644. }
  29645. },
  29646. a.prototype = {
  29647. init: function() {
  29648. return this.initialLoadingPromise ? this.initialLoadingPromise : (setInterval(function() {
  29649. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  29650. Date.now() + c.signedUrlRefreshBuffer > e && (u.debug("Refreshing urls..."),
  29651. this.refresh().done(function() {
  29652. u.debug("Refreshed")
  29653. }).fail(function() {
  29654. u.error("Failed url refresh, urls might go stale soon")
  29655. }))
  29656. }
  29657. .bind(this), c.signedUrlCheckInterval),
  29658. this.initialLoadingPromise = this.refresh(),
  29659. this.initialLoadingPromise)
  29660. },
  29661. refresh: function(e) { //已经在someData.js里加载过了 不用再加载file了吧
  29662. e = e || {};
  29663. /*var t = void 0 === e.cache || e.cache;
  29664. return s.get( this.endpoint , { //file
  29665. responseType: "json",
  29666. prefetchFrom: t ? "files" : null,
  29667. cache: t,
  29668. auth: this.authorizationHeader
  29669. }).then(function(e) {
  29670. if (this.urlContainer && this.urlContainer.validate(e))
  29671. return this.urlContainer.update(e);
  29672. for (var i = 0; i < this.containerClasses.length; i++) {
  29673. var n = this.containerClasses[i]
  29674. , r = new n;
  29675. if (r.validate(e))
  29676. return u.info("Using urls version " + r.version),
  29677. this.urlContainer = r,
  29678. this.urlContainer.update(e)
  29679. }
  29680. return t ? this.refresh({
  29681. cache: !1
  29682. }) : $.Deferred().reject("missing-urls")
  29683. }
  29684. .bind(this), function(e) {
  29685. return "loading-failed"
  29686. }) */
  29687. return $.Deferred().resolve();
  29688. },
  29689. get: function(e) {
  29690. //return this.urlContainer.get(e)
  29691. return window.MP_PREFETCHED_MODELDATA.files.templates[0].replace("{{filename}}", e)
  29692. }
  29693. },
  29694. t.exports = a
  29695. }
  29696. ).call(this, "/js/util/ModelUrls.js")
  29697. }
  29698. , {
  29699. "../ab": 3,
  29700. "../constants": 8,
  29701. "./ajax": 181,
  29702. "./logger": 189,
  29703. "./showcase": 193
  29704. }],
  29705. 178: [function(e, t, i) {
  29706. (function(i) {
  29707. "use strict";
  29708. function n() {
  29709. u.call(this),
  29710. this.neighbourMap = {},
  29711. this.map = null
  29712. }
  29713. var r = e("three")
  29714. , o = e("./common")
  29715. , a = e("../settings")
  29716. , s = e("../objects/Panorama")
  29717. , a = e("../settings")
  29718. , l = e("./aStar")
  29719. , c = e("./logger")
  29720. , h = new c(i)
  29721. , u = e("./IndexedCollection")
  29722. , d = e("./transitions");
  29723. o.inherit(n, u),
  29724. n.prototype.getIndex = function(e) {
  29725. return e.id
  29726. }
  29727. ,
  29728. n.prototype.find = function(e, t) {
  29729. var i = o.filterAll(this.list, e);
  29730. return 0 === i.length ? null : (t && t.forEach(function(e) {
  29731. i = o.stableSort(i, e)
  29732. }),
  29733. i[0])
  29734. }
  29735. ,
  29736. n.prototype.sortByScore = function(e, t) {
  29737. var i = o.filterAll(this.list, e);
  29738. return 0 === i.length ? null : i = i.map(function(e) {
  29739. return {
  29740. pano: e,
  29741. score: t.reduce(function(t, i) {
  29742. return t + i(e)
  29743. }, 0)
  29744. }
  29745. }).sort(function(e, t) {
  29746. return t.score - e.score;
  29747. })
  29748. }
  29749. ,
  29750. n.prototype.lowestByScore = function(e, t, i) {
  29751. return this.findRankedByScore(0, e, t, i)
  29752. }
  29753. ,
  29754. n.prototype.findRankedByScore = function(e, t, i, n) {
  29755. n && (n.candidates = null,
  29756. n.pano = null),
  29757. e || (e = 0);
  29758. var r = this.sortByScore(t, i);
  29759. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  29760. n.pano = r[e].pano),
  29761. r[e].pano)
  29762. }
  29763. ,
  29764. n.prototype.showPanoScores = function(e) {
  29765. this.list.forEach(function(e) {
  29766. e.removeTextSprite()
  29767. });
  29768. var t = 6344768;
  29769. e.forEach(function(e) {
  29770. e.pano.addTextSprite(e.score.toFixed(2), t),
  29771. t = 16428055
  29772. })
  29773. }
  29774. ,
  29775. n.prototype.isNeighbour = function(e, t) {
  29776. return this.neighbourMap[e.id][t.id]
  29777. }
  29778. ,
  29779. n.prototype.getNeighbours = function(e) {
  29780. return this.neighbourMap[e.id]
  29781. }
  29782. ,
  29783. n.prototype.setNeighbour = function(e, t, i) {
  29784. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  29785. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  29786. this.neighbourMap[e.id][e.id] = !0,
  29787. this.neighbourMap[t.id][t.id] = !0,
  29788. this.neighbourMap[e.id][t.id] = i,
  29789. this.neighbourMap[t.id][e.id] = i,
  29790. this.neighbourMap[e.id]
  29791. }
  29792. ,
  29793. n.prototype.findClosest = function(e, t) {
  29794. var i = [s.filters.isPanoAligned()];
  29795. return t && i.push(s.filters.inDirection(e, t, .75)),
  29796. this.find(i, [s.sortFunctions.distanceToPoint(e)])
  29797. }
  29798. ,
  29799. n.prototype.dualNeighbors = function(e, t) {
  29800. var i, n = [];
  29801. for (i in this.neighbourMap[e.id])
  29802. this.neighbourMap[t.id][i] && n.push(i);
  29803. return n
  29804. }
  29805. ,
  29806. n.prototype.populate_path_graph = function() {
  29807. var e, t, i, n, o, a, s, l, c = Date.now(), u = {}, d = 0, p = new r.Vector3(0,0,0), f = 0, g = 0;
  29808. for (e = 0; e < this.list.length; e += 1) {
  29809. o = this.list[e],
  29810. s = {},
  29811. l = !1,
  29812. i = o.neighbourPanos || o.findNeighourPanos();
  29813. for (t in i)
  29814. if (i[t]) {
  29815. a = this.index[t],
  29816. p.copy(o.floorPosition),
  29817. p.sub(a.floorPosition);
  29818. var m = Math.sqrt(p.x * p.x + p.z * p.z)
  29819. , v = (Math.abs(p.y) / Math.max(m, .01),
  29820. Math.max(0, Math.abs(p.y) - .2));
  29821. v > 0 ? (f += 1,
  29822. v = Math.pow(4 * v, 2),
  29823. m = Math.pow(m, 2),
  29824. n = Math.sqrt(v * v + m * m)) : (g += 1,
  29825. n = p.length()),
  29826. s[a.id] = n,
  29827. l = !0
  29828. }
  29829. l ? u[o.id] = s : d += 1
  29830. }
  29831. this.map = u,
  29832. h.info("graph ready in " + (Date.now() - c) + "ms, " + d + " had no neighbors")
  29833. }
  29834. ,
  29835. n.prototype.aStarSearch = function(e, t) {
  29836. var i = Date.now()
  29837. , n = new l({
  29838. start: e,
  29839. isEnd: function(e) {
  29840. return e === t
  29841. },
  29842. neighbor: function(e) {
  29843. var t = e.neighbourPanos || e.findNeighourPanos()
  29844. , i = [];
  29845. for (var n in t)
  29846. t[n] && i.push(this.index[n]); //add: t[n] &&
  29847. return i
  29848. }
  29849. .bind(this),
  29850. distance: function(e, t) {
  29851. var i = this.map[e.id]
  29852. , n = i[t.id];
  29853. return n
  29854. }
  29855. .bind(this),
  29856. heuristic: function(e, t) {
  29857. return 1
  29858. }
  29859. .bind(this),
  29860. hash: function(e) {
  29861. return e.id
  29862. },
  29863. timeout: 5e3
  29864. });
  29865. if (h.debug("A* search in " + (Date.now() - i) + "ms"),
  29866. "success" !== n.status)
  29867. return h.debug("Did not find A* path from " + e + " to " + t),
  29868. null;
  29869. h.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  29870. var r = [];
  29871. return n.path.forEach(function(e) {
  29872. r.push(e.id)
  29873. }),
  29874. r
  29875. }
  29876. ,
  29877. n.prototype.includeNodesNearPath = function() {
  29878. var e = new r.Vector3
  29879. , t = new r.Vector3
  29880. , i = new r.Vector3
  29881. , n = new r.Vector3
  29882. , o = new r.Vector3
  29883. , a = new r.Vector3
  29884. , s = new r.Vector3
  29885. , l = new r.Vector3
  29886. , c = []
  29887. , h = new r.Vector3
  29888. , u = new r.Vector3;
  29889. return function(r, d) {
  29890. if (r)
  29891. for (var p = function(e, t, i) {
  29892. return o.copy(t).sub(e),
  29893. o.dot(i)
  29894. }, f = function(e, t) {
  29895. return p(h, e.position, i) - p(h, t.position, i)
  29896. }, g = 0; g < r.length - 1; ) {
  29897. var m = r[g]
  29898. , v = r[g + 1]
  29899. , A = this.index[m]
  29900. , y = this.index[v];
  29901. h.copy(A.position),
  29902. u.copy(y.position),
  29903. c.length = 0,
  29904. e.copy(u).sub(h),
  29905. i.copy(e).normalize();
  29906. for (var C = 0; C < this.list.length; C++) {
  29907. var I = this.list[C];
  29908. o.copy(I.position).sub(h);
  29909. var E = o.dot(i);
  29910. if (E > 0) {
  29911. s.copy(i),
  29912. s.multiplyScalar(E),
  29913. a.copy(o),
  29914. a.sub(s);
  29915. var b = a.length();
  29916. if (b < d) {
  29917. t.copy(e).negate(),
  29918. n.copy(t).normalize(),
  29919. l.copy(I.position).sub(u);
  29920. var w = l.dot(n);
  29921. w > 0 && c.push(I)
  29922. }
  29923. }
  29924. }
  29925. if (c.length > 0) {
  29926. c.sort(f);
  29927. for (var _ = r.length + c.length - 1; _ >= g + c.length; _--)
  29928. r[_] = r[_ - c.length];
  29929. for (var T = 0; T < c.length; T++)
  29930. r[T + g + 1] = c[T].id
  29931. }
  29932. g += c.length + 1
  29933. }
  29934. }
  29935. }(),
  29936. n.prototype.fadeMarkerOpacity = function(e, t) {
  29937. var i = void 0 === e ? a.panorama.markerOpacity : e
  29938. , n = this.list.findIndex(function(e) {
  29939. return e.marker
  29940. });
  29941. if (!(n < 0)) {
  29942. var r = this.list[n].marker.material.opacity;
  29943. if (r !== e) {
  29944. var o = i - r;
  29945. d.trigger({
  29946. func: function(e, t) {
  29947. var i = r + e * o;
  29948. this.forEach(function(e) {
  29949. e.marker && (e.marker.material.opacity = i)
  29950. })
  29951. }
  29952. .bind(this),
  29953. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  29954. name: "_fpm"
  29955. })
  29956. }
  29957. }
  29958. }
  29959. ,
  29960. t.exports = n
  29961. }
  29962. ).call(this, "/js/util/PanoramaCollection.js")
  29963. }
  29964. , {
  29965. "../objects/Panorama": 148,
  29966. "../settings": 166,
  29967. "./IndexedCollection": 175,
  29968. "./aStar": 180,
  29969. "./common": 185,
  29970. "./logger": 189,
  29971. "./transitions": 195,
  29972. three: 217
  29973. }],
  29974. 179: [function(e, t, i) {
  29975. "use strict";
  29976. function n() {
  29977. this.actionSequence = [],
  29978. this.actionSequenceInProgress = !1
  29979. }
  29980. function r(e, t, i, n) {
  29981. s.trackAlways("zoom_" + e, {
  29982. from: t,
  29983. to: i,
  29984. pano: n
  29985. })
  29986. }
  29987. function o(e, t) {
  29988. r("initial", 1, e, t)
  29989. }
  29990. function a(e, t, i) {
  29991. r("followup", e, t, i)
  29992. }
  29993. var s = e("../analytics");
  29994. n.prototype.reset = function(e) {
  29995. this.actionSequenceInProgress = !1,
  29996. this.actionSequence.length = 0
  29997. }
  29998. ,
  29999. n.prototype.addZoomAction = function() {
  30000. var e = null
  30001. , t = null
  30002. , i = !1
  30003. , n = function() {
  30004. if (e = null,
  30005. this.actionSequence.length > 0) {
  30006. var i = this.actionSequence[0].start
  30007. , n = this.actionSequence[this.actionSequence.length - 1].end;
  30008. 1 === i ? o(n, t) : a(i, n, t)
  30009. }
  30010. this.reset()
  30011. };
  30012. return function(r, o, a) {
  30013. if (r !== o) {
  30014. i || (n = n.bind(this),
  30015. i = !0),
  30016. e && (window.clearTimeout(e),
  30017. e = null),
  30018. a === t && this.actionSequenceInProgress || (this.reset(),
  30019. t = a),
  30020. this.actionSequenceInProgress = !0;
  30021. var s = {
  30022. start: r,
  30023. end: o
  30024. };
  30025. this.actionSequence.push(s),
  30026. e = window.setTimeout(n, 150)
  30027. }
  30028. }
  30029. }(),
  30030. t.exports = n
  30031. }
  30032. , {
  30033. "../analytics": 4
  30034. }],
  30035. 180: [function(e, t, i) {
  30036. "use strict";
  30037. function n(e) {
  30038. void 0 === e.timeout && (e.timeout = 1 / 0);
  30039. var t = e.hash || o
  30040. , i = {
  30041. data: e.start,
  30042. g: 0,
  30043. h: e.heuristic(e.start)
  30044. }
  30045. , n = i;
  30046. i.f = i.h;
  30047. var h = new s
  30048. , u = new l(a)
  30049. , d = c();
  30050. u.push(i),
  30051. d.set(t(i.data), i);
  30052. for (var p = new Date; u.size(); ) {
  30053. if (new Date - p > e.timeout)
  30054. return {
  30055. status: "timeout",
  30056. cost: n.g,
  30057. path: r(n)
  30058. };
  30059. var f = u.pop();
  30060. if (d.delete(t(f.data)),
  30061. e.isEnd(f.data))
  30062. return {
  30063. status: "success",
  30064. cost: f.g,
  30065. path: r(f)
  30066. };
  30067. h.add(t(f.data));
  30068. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  30069. var v = g[m];
  30070. if (!h.contains(t(v))) {
  30071. var A = f.g + e.distance(f.data, v)
  30072. , y = d.get(t(v))
  30073. , C = !1;
  30074. if (void 0 === y)
  30075. y = {
  30076. data: v
  30077. },
  30078. d.set(t(v), y);
  30079. else {
  30080. if (y.g < A)
  30081. continue;
  30082. C = !0
  30083. }
  30084. y.parent = f,
  30085. y.g = A,
  30086. y.h = e.heuristic(v),
  30087. y.f = A + y.h,
  30088. y.h < n.h && (n = y),
  30089. C ? u.heapify() : u.push(y)
  30090. }
  30091. }
  30092. }
  30093. return {
  30094. status: "noPath",
  30095. cost: n.g,
  30096. path: r(n)
  30097. }
  30098. }
  30099. function r(e) {
  30100. if (void 0 !== e.parent) {
  30101. var t = r(e.parent);
  30102. return t.push(e.data),
  30103. t
  30104. }
  30105. return [e.data]
  30106. }
  30107. function o(e) {
  30108. return e.toString()
  30109. }
  30110. function a(e, t) {
  30111. return e.f - t.f
  30112. }
  30113. var s = e("Set")
  30114. , l = e("heap")
  30115. , c = e("dict");
  30116. t.exports = n
  30117. }
  30118. , {
  30119. Set: 196,
  30120. dict: 210,
  30121. heap: 211
  30122. }],
  30123. 181: [function(e, t, i) {
  30124. (function(i) {
  30125. "use strict";
  30126. function n(e, t, i) {
  30127. var n = new XMLHttpRequest;
  30128. if (i && "withCredentials"in n)
  30129. n.open(e, t, i);
  30130. else if ("undefined" != typeof XDomainRequest)
  30131. n = new XDomainRequest,
  30132. n.open(e, t);
  30133. else {
  30134. if (i)
  30135. throw "Browser does not support CORS!";
  30136. n.open(e, t)
  30137. }
  30138. return n
  30139. }
  30140. function r(e, t, i) {
  30141. function o() {
  30142. u.warn("Retrying ", t),
  30143. r(e, t, i).done(c.resolve.bind(c)).progress(c.notify.bind(c)).fail(c.reject.bind(c))
  30144. }
  30145. function a(e, t) {
  30146. var i = e.response;
  30147. if ("json" === t && "object" != typeof i)
  30148. try {
  30149. i = JSON.parse(e.responseText)
  30150. } catch (e) {
  30151. return void c.reject({
  30152. error: "Failed parsing JSON"
  30153. })
  30154. }
  30155. else if ("image/jpeg" === t) {
  30156. var n = new Uint8Array(e.response)
  30157. , r = new Blob([n],{
  30158. type: "image/jpeg"
  30159. })
  30160. , o = URL.createObjectURL(r);
  30161. i = new Image,
  30162. i.src = o,
  30163. i.crossOrigin = "Anonymous",
  30164. i.onload = function() {
  30165. URL.revokeObjectURL(o)
  30166. }
  30167. }
  30168. return i
  30169. }
  30170. var s = n(e, t, !1);
  30171. if (i = i || {},
  30172. i.retries = void 0 !== i.retries ? i.retries : 0,
  30173. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  30174. i.responseType)
  30175. if (["arraybuffer", "text", "json"].indexOf(i.responseType) > -1)
  30176. s.responseType = i.responseType;
  30177. else {
  30178. if ("image/jpeg" !== i.responseType)
  30179. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  30180. s.responseType = "arraybuffer"
  30181. }
  30182. if ("json" === i.responseType && s.setRequestHeader("Accept", "application/json"),
  30183. i.auth && s.setRequestHeader("Authorization", i.auth),
  30184. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  30185. s.setRequestHeader("Content-Type", "application/json")),
  30186. "object" == typeof i.headers)
  30187. for (var l in i.headers)
  30188. s.setRequestHeader(l, i.headers[l]);
  30189. var c = $.Deferred();
  30190. return s.onreadystatechange = function(e) {
  30191. if (4 === this.readyState)
  30192. if (this.status >= 500 && this.status <= 600 && i.retry && i.retries < 3)
  30193. i.retries++,
  30194. setTimeout(o, 1e3);
  30195. else if (200 === this.status) {
  30196. var t = a(this, i.responseType);
  30197. c.resolve(t)
  30198. } else
  30199. c.reject(this)
  30200. }
  30201. ,
  30202. s.onprogress = function(e) {
  30203. c.notify(e)
  30204. }
  30205. ,
  30206. s.send(i.data),
  30207. c.promise()
  30208. }
  30209. function o(e) {
  30210. return Object.keys(e).sort().map(function(t) {
  30211. return {
  30212. key: t,
  30213. value: e[t]
  30214. }
  30215. })
  30216. }
  30217. function a(e, t) {
  30218. var i = t.responseType || null
  30219. , n = t.auth || null
  30220. , r = t.prefetchFrom || null
  30221. , a = e + "__" + i + "__" + n + "__" + r;
  30222. return t.headers && o(t.headers).forEach(function(e) {
  30223. a += "__" + e.key + ":" + e.value
  30224. }),
  30225. a
  30226. }
  30227. function s(e, t) {
  30228. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[a(e, t)] : null
  30229. }
  30230. function l(e, t, i) {
  30231. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i)
  30232. }
  30233. var c = e("./logger")
  30234. , h = e("../ab")
  30235. , u = new c(i);
  30236. window.URL = window.URL || window.webkitURL,
  30237. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  30238. window.MP_PREFETCHED_MODELDATA = window.MP_PREFETCHED_MODELDATA || {}
  30239. /* setTimeout(function() {//MP-- xzw delete
  30240. window.MP_REQUEST_CACHE = null,
  30241. window.MP_PREFETCHED_MODELDATA = {}
  30242. }, 6e4),
  30243. window.onpageshow = function(e) {
  30244. e.persisted && (window.MP_REQUEST_CACHE = null,
  30245. window.MP_PREFETCHED_MODELDATA = {})
  30246. } */
  30247. ,
  30248. t.exports = {
  30249. get: function(e, t) {
  30250. t = t || {};
  30251. var i = void 0 === t.cache || t.cache;
  30252. if (i) {
  30253. var n = s(e, t);
  30254. if (n)
  30255. return n
  30256. }
  30257. var o;
  30258. return o = t.prefetchFrom && window.MP_PREFETCHED_MODELDATA[t.prefetchFrom] ? $.when(window.MP_PREFETCHED_MODELDATA[t.prefetchFrom]) : r("GET", e, t),
  30259. i && l(e, t, o),
  30260. o
  30261. },
  30262. post: function(e, t) {
  30263. return r("POST", e, t)
  30264. },
  30265. patch: function(e, t) {
  30266. return r("PATCH", e, t)
  30267. },
  30268. getImage: function(e, t) {
  30269. function i() {
  30270. u.warn("Retrying ", e),
  30271. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  30272. }
  30273. var n = $.Deferred()
  30274. , r = new Image
  30275. , o = this;
  30276. return e = h.changeIfImageOptimzing(e),
  30277. null !== t && void 0 !== t || (t = 3),
  30278. r.onerror = function() {
  30279. t > 0 ? setTimeout(i, 1e3) : n.reject()
  30280. }
  30281. ,
  30282. r.onload = function() {
  30283. n.resolve(r)
  30284. }
  30285. ,
  30286. r.crossOrigin = "anonymous",
  30287. r.src = e,
  30288. n
  30289. }
  30290. }
  30291. }
  30292. ).call(this, "/js/util/ajax.js")
  30293. }
  30294. , {
  30295. "../ab": 3,
  30296. "./logger": 189
  30297. }],
  30298. 182: [function(e, t, i) {
  30299. "use strict";
  30300. function n(e, t) {
  30301. var i = window.navigator.userAgent
  30302. , n = i.match(e);
  30303. return n = n ? n[1].split(t) : [],
  30304. {
  30305. major: parseInt(n[0]) || 0,
  30306. minor: parseInt(n[1]) || 0,
  30307. patch: parseInt(n[2]) || 0
  30308. }
  30309. }
  30310. var r = e("../exception/DeviceMismatchException");
  30311. window.browser = t.exports = {
  30312. isFullscreen: function() {
  30313. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  30314. },
  30315. supportsFullscreen: function() {
  30316. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  30317. },
  30318. isPointerLocked: function() {
  30319. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  30320. },
  30321. requestFullscreen: function(e, t) {
  30322. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  30323. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  30324. },
  30325. requestPointerLock: function() {
  30326. var e;
  30327. if (document.fullscreenElement)
  30328. e = document.fullscreenElement();
  30329. else if (document.mozFullscreenElement)
  30330. e = document.mozFullscreenElement();
  30331. else if (document.mozFullScreenElement)
  30332. e = document.mozFullScreenElement();
  30333. else {
  30334. if (!document.webkitFullscreenElement)
  30335. return;
  30336. e = document.webkitFullscreenElement()
  30337. }
  30338. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  30339. e.requestPointerLock(),
  30340. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  30341. },
  30342. exitPointerLock: function() {
  30343. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  30344. document.exitPointerLock()
  30345. },
  30346. exitFullscreen: function() {
  30347. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  30348. },
  30349. details: function() {
  30350. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  30351. return e ? {
  30352. name: e[1],
  30353. version: parseInt(e[2]),
  30354. platform: navigator.platform
  30355. } : {}
  30356. },
  30357. is: function(e) {
  30358. return this.details() && this.details().name === e
  30359. },
  30360. inIframe: function() {
  30361. return window.parent !== window
  30362. },
  30363. aspectRatio: function() {
  30364. var e = $("#player").width() / $("#player").height();
  30365. return isFinite(e) ? e : 0
  30366. },
  30367. userAgent: function() {
  30368. return window.navigator.userAgent
  30369. },
  30370. isMobile: function() {
  30371. var e = navigator.userAgent || navigator.vendor || window.opera;
  30372. 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))
  30373. },
  30374. isLandscape: function() {
  30375. return this.isMobile && this.aspectRatio() > 1
  30376. },
  30377. isSmallScreen: function() {
  30378. var e = screen.width / window.devicePixelRatio;
  30379. return e < 240
  30380. },
  30381. detectIE: function() {
  30382. var e = window.navigator.userAgent
  30383. , t = e.indexOf("MSIE ");
  30384. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  30385. },
  30386. detectSafari: function() {
  30387. var e = window.navigator.userAgent
  30388. , t = e.indexOf("Safari");
  30389. return t !== -1 && !this.detectChrome()
  30390. },
  30391. detectFirefox: function() {
  30392. var e = window.navigator.userAgent;
  30393. return e.indexOf("Firefox") !== -1
  30394. },
  30395. detectChrome: function() {
  30396. var e = window.navigator.userAgent;
  30397. return e.indexOf("Chrome") !== -1 && !this.detectOpera()
  30398. },
  30399. detectOpera: function() {
  30400. var e = window.navigator.userAgent;
  30401. return e.indexOf("OPR") !== -1
  30402. },
  30403. detectIOS: function() {
  30404. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  30405. },
  30406. detectIPad: function() {
  30407. var e = window.navigator.userAgent
  30408. , t = /iPad/;
  30409. return t.test(e)
  30410. },
  30411. detectIPod: function() {
  30412. var e = window.navigator.userAgent
  30413. , t = /iPod/;
  30414. return t.test(e)
  30415. },
  30416. detectIPhone: function() {
  30417. var e = window.navigator.userAgent
  30418. , t = /iPhone/;
  30419. return t.test(e)
  30420. },
  30421. detectAndroid: function() {
  30422. var e = window.navigator.userAgent;
  30423. return e.indexOf("Android") !== -1
  30424. },
  30425. detectAndroidMobile: function() {
  30426. var e = window.navigator.userAgent;
  30427. return this.detectAndroid() && e.indexOf("Mobile") !== -1
  30428. },
  30429. detectSamsungNative: function() {
  30430. var e = window.navigator.userAgent;
  30431. return e.indexOf("SM-G900H") !== -1 || e.indexOf("GT-I9500") !== -1 || e.indexOf("SM-N900") !== -1
  30432. },
  30433. detectSamsungS6: function() {
  30434. var e = window.navigator.userAgent;
  30435. return e.indexOf("SM-G92") !== -1
  30436. },
  30437. /************************************************************fyz改from徐世廷*************************************************************/
  30438. detectHUAWEI5X: function() {
  30439. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  30440. },
  30441. /*******************************************************************************************************************************/
  30442. detectWebVR: function() {
  30443. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  30444. },
  30445. getVRDisplay: function() {
  30446. var e = $.Deferred();
  30447. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(t) {
  30448. t.length >= 1 && e.resolve(t[0]),
  30449. e.reject(null)
  30450. }),
  30451. e) : e.reject(null)
  30452. },
  30453. iosVersion: function() {
  30454. if (!this.detectIOS())
  30455. throw new r("Did not detect an iDevice");
  30456. var e = /((?:\d+\_?){1,3}) like Mac OS/
  30457. , t = "_";
  30458. return n(e, t)
  30459. },
  30460. androidVersion: function() {
  30461. if (!this.detectAndroid())
  30462. throw new r("Did not detect an Android based device");
  30463. var e = /Android ((?:\d+\.?){1,3})/
  30464. , t = ".";
  30465. return n(e, t)
  30466. },
  30467. valueFromCookie: function(e, t) {
  30468. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  30469. if (!i)
  30470. return t;
  30471. var n = i[1];
  30472. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  30473. },
  30474. valueFromHash: function(e, t) {
  30475. var i = new RegExp("[#&?]" + e + "=([^#&?]*)")
  30476. , n = i.exec(window.location.href);
  30477. if (!n)
  30478. return t;
  30479. var r = n[1];
  30480. return "boolean" == typeof t ? "true" === r || "1" === r : "number" == typeof t ? parseFloat(r) : window.decodeURIComponent(r)
  30481. }
  30482. }
  30483. //changeLog()
  30484. }
  30485. , {
  30486. "../exception/DeviceMismatchException": 56
  30487. }],
  30488. 183: [function(e, t, i) {
  30489. (function(i) {
  30490. "use strict";
  30491. function n(e, t) {
  30492. var i = r(t);
  30493. var replaceAll = function (str, f, e) {
  30494. //f全部替换成e
  30495. var reg = new RegExp(f, "g"); //创建正则RegExp对象
  30496. return str.replace(reg, e);
  30497. };
  30498. var urlFirstView = c.valueFromHash('firstView');
  30499. if(urlFirstView){
  30500. try{
  30501. urlFirstView = replaceAll(urlFirstView, "pano:", '"pano":"')
  30502. urlFirstView = replaceAll(urlFirstView, ",qua:", '","qua":[')
  30503. urlFirstView = "{"+urlFirstView+"]}"
  30504. let info = JSON.parse(urlFirstView);
  30505. i.pano = t.index[info.pano] //panos.get(info.pano)
  30506. if(!i.pano){
  30507. urlFirstView = false
  30508. console.error('检测到firstView但是 找不到该pano')
  30509. }else{
  30510. i.quaternion = new THREE.Quaternion().fromArray(info.qua)
  30511. i.zoom = -1;
  30512. i.mode = "panorama"
  30513. i.setByUrl = true
  30514. }
  30515. }catch(e){
  30516. urlFirstView = false
  30517. console.error('检测到firstView但是解析出错'+e)
  30518. }
  30519. }
  30520. if (Object.keys(i).length > 0)
  30521. return i;
  30522. if (e.heroImage)
  30523. i = o(e, t);
  30524. else if (window.MP_PREFETCHED_MODELDATA.camera_start) {
  30525. var n = window.MP_PREFETCHED_MODELDATA.camera_start;
  30526. try {
  30527. Object.keys(n).length > 0 && !l.isEmptyQuaternion(n.camera.quaternion) && (i.mode = h.convertWorkshopModeInt(n.mode),
  30528. i.position = n.camera.position,
  30529. //i.quaternion = n.camera.quaternion,
  30530. i.quaternion = new th.Quaternion().fromArray(n.camera.quaternion),//xzw
  30531. i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom),
  30532. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  30533. d.debug("Using camera_start"),
  30534. d.debug("Modeldata pano: ", i.pano.quaternion),
  30535. d.debug("Camera start pano: ", n.pano.quaternion)),
  30536. i.mode !== h.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  30537. } catch (e) {
  30538. d.warn(e.message)
  30539. if(i.mode == "panorama" && !i.pano)i.pano = t.list[0]
  30540. }
  30541. }
  30542. if (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  30543. i.mode === h.MESH && i.position && (i.mode = h.PANORAMA,
  30544. i.pano = t.findClosest(i.position),
  30545. i.quaternion = i.pano.quaternion),
  30546. 0 === Object.keys(i).length) {
  30547. var a = t.list[0];
  30548. a && (i.mode = h.PANORAMA,
  30549. i.pano = a,
  30550. i.position = a.position,
  30551. i.quaternion = a.quaternion,
  30552. d.info("Starting at 1st pano " + a.id))
  30553. }
  30554. return i.mode = i.mode || h.DOLLHOUSE,
  30555. i
  30556. }
  30557. function r(e) {
  30558. var t = c.valueFromHash("start", "")
  30559. , i = {};
  30560. if ("" !== t) {
  30561. d.debug("Start override found in parameters, trying to parse..."),
  30562. i = a(t) || {};
  30563. var n = c.valueFromHash("tag", null);
  30564. n && (i.tag = n),
  30565. i.panoId && (i.pano = e.get(i.panoId))
  30566. }
  30567. return i
  30568. }
  30569. function o(e, t) {
  30570. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  30571. return {};
  30572. var i = {}
  30573. , n = e.heroImage.metadata;
  30574. d.debug("Using start position from thumbnail image"),
  30575. i.position = n.camera_position,
  30576. i.quaternion = n.camera_quaternion;
  30577. try {
  30578. i.mode = h.convertWorkshopModeInt(n.camera_mode),
  30579. i.mode === h.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  30580. } catch (e) {
  30581. d.debug(e.message)
  30582. }
  30583. return i
  30584. }
  30585. function a(e) {
  30586. return s.deserialize(e)
  30587. }
  30588. var s = e("../controls/serializer")
  30589. , l = e("../util/math")
  30590. , c = e("./browser")
  30591. , h = e("../enum/Viewmode")
  30592. , u = e("../util/logger")
  30593. , th = e("three")//xzw
  30594. , d = new u(i);
  30595. t.exports = {
  30596. getStartCameraOptions: n
  30597. }
  30598. }
  30599. ).call(this, "/js/util/camera.js")
  30600. }
  30601. , {
  30602. "../controls/serializer": 14,
  30603. "../enum/Viewmode": 51,
  30604. "../util/logger": 189,
  30605. "../util/math": 190,
  30606. "./browser": 182,
  30607. "three": 217
  30608. }],
  30609. 184: [function(e, t, i) {
  30610. "use strict";
  30611. function n(e, t, i) {
  30612. return o(e.fov, t, i)
  30613. }
  30614. var r = e("./MathLight")
  30615. , o = function(e, t, i) {
  30616. var n = t
  30617. , o = i
  30618. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (n / o)) * r.DEGREES_PER_RADIAN;
  30619. return a
  30620. }
  30621. , a = function(e, t, i) {
  30622. var n = t
  30623. , o = i
  30624. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (o / n)) * r.DEGREES_PER_RADIAN;
  30625. return a
  30626. }
  30627. , s = function(e, t, i, n) {
  30628. var r = o(e, i, n);
  30629. return r > t ? a(t, i, n) : e
  30630. };
  30631. t.exports = {
  30632. clampVFOV: s,
  30633. getHFOVForCamera: n,
  30634. getHFOVFromVFOV: o,
  30635. getVFOVFromHFOV: a
  30636. }
  30637. window.MathLight = t.exports
  30638. }
  30639. , {
  30640. "./MathLight": 176
  30641. }],
  30642. 185: [function(e, t, i) {
  30643. "use strict";
  30644. var n = e("three");
  30645. t.exports = {
  30646. delayOneFrame: function(e) {
  30647. window.setTimeout(e, 1)
  30648. },
  30649. normalizeUrl: function(e) {
  30650. return e.replace("https://", "http://")
  30651. },
  30652. domainFromUrl: function(e) {
  30653. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  30654. return t ? t[3] : e
  30655. },
  30656. average: function(e, t) {
  30657. if (0 === e.length)
  30658. return null;
  30659. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  30660. var o = t ? e[r][t] : e[r];
  30661. i += o,
  30662. n++
  30663. }
  30664. return i / n
  30665. },
  30666. countUnique: function(e) {
  30667. for (var t = {}, i = 0; i < e.length; i++)
  30668. t[e[i]] = 1 + (t[e[i]] || 0);
  30669. return Object.keys(t).length
  30670. },
  30671. averageVectors: function(e, t) {
  30672. var i = new n.Vector3;
  30673. if (0 === e.length)
  30674. return i;
  30675. for (var r = 0, o = 0; o < e.length; o++) {
  30676. var a = t ? e[o][t] : e[o];
  30677. i.add(a),
  30678. r++
  30679. }
  30680. return i.divideScalar(r)
  30681. },
  30682. equalLists: function(e, t) {
  30683. if (e.length !== t.length)
  30684. return !1;
  30685. for (var i = 0; i < e.length; i++)
  30686. if (e[i] !== t[i])
  30687. return !1;
  30688. return !0
  30689. },
  30690. lowerMedian: function(e, t) {
  30691. if (0 === e.length)
  30692. return null;
  30693. t = t || 2,
  30694. e.sort(function(e, t) {
  30695. return e - t
  30696. });
  30697. var i = Math.floor(e.length / t);
  30698. return e[i]
  30699. },
  30700. stableSort: function(e, t) {
  30701. return e.map(function(e, t) {
  30702. return {
  30703. value: e,
  30704. index: t
  30705. }
  30706. }).sort(function(e, i) {
  30707. var n = t(e.value, i.value);
  30708. return 0 !== n ? n : e.index - i.index
  30709. }).map(function(e) {
  30710. return e.value
  30711. })
  30712. },
  30713. filterAll: function(e, t) {
  30714. return e.filter(function(e) {
  30715. return t.every(function(t) {
  30716. return t(e)
  30717. })
  30718. })
  30719. },
  30720. formatDate: function(e) {
  30721. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  30722. },
  30723. formatDatetime: function(e) {
  30724. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  30725. },
  30726. randomString: function(e) {
  30727. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  30728. t += i.charAt(Math.floor(Math.random() * i.length));
  30729. return t
  30730. },
  30731. uint8ToBase64: function(e, t) {
  30732. t && "number" == typeof t || (t = 8192);
  30733. for (var i = [], n = 0; n < e.length; n += t)
  30734. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  30735. return btoa(i.join(""))
  30736. },
  30737. uuid4: function e(t) {
  30738. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  30739. },
  30740. nth: function(e) {
  30741. return e %= 10,
  30742. 1 === e ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  30743. },
  30744. extendObject: function(e, t) {
  30745. return Object.keys(t).forEach(function(i) {
  30746. e[i] = t[i]
  30747. }),
  30748. e
  30749. },
  30750. deepExtend: function e(t) {
  30751. t = t || {};
  30752. for (var i = 1; i < arguments.length; i++) {
  30753. var n = arguments[i];
  30754. if (n)
  30755. for (var r in n)
  30756. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  30757. }
  30758. return t
  30759. },
  30760. inherit: function(e, t) {
  30761. e.prototype = Object.create(t.prototype),
  30762. e.prototype.constructor = e
  30763. },
  30764. extend: function(e, t) {
  30765. for (var i in t.prototype)
  30766. e.prototype[i] = t.prototype[i]
  30767. }
  30768. ,
  30769. getVisiblePano : function(positions = [], options={}){//add
  30770. var visiblePanos = [];
  30771. var panos = options.panos || player.model.panos.list;
  30772. options.posAtPanos = options.posAtPanos || {}//在不同漫游点的positions
  30773. panos.forEach((pano)=>{
  30774. if(!pano.isAligned())return;
  30775. var A = pano.position.clone();
  30776. var posB = options.posAtPanos[pano.id] || positions;
  30777. var posLength = posB.length
  30778. for(let i=0;i<posLength;i++){
  30779. var B = posB[i];
  30780. var ray = new THREE.Raycaster(A.clone(), B.clone().sub(A).normalize(), 0, A.distanceTo(B) - (options.tolerance||0) )
  30781. var o = ray.intersectObjects(options.model || player.model.colliders, true);
  30782. if (!o || !o.length){ //只要有一点可见,就算整体可见
  30783. visiblePanos.push(pano );
  30784. break;
  30785. }
  30786. }
  30787. })
  30788. return visiblePanos
  30789. }
  30790. ,
  30791. sortByScore : function(list, request, rank) {
  30792. var i = this.filterAll(list, request);
  30793. return 0 === i.length ? null : i = i.map(function(e) {
  30794. return {
  30795. item: e,
  30796. score: rank.reduce(function(t, i) {
  30797. return t + i(e);
  30798. }, 0)
  30799. };
  30800. }).sort(function(e, t) {
  30801. return t.score - e.score;
  30802. });
  30803. }
  30804. },
  30805. Math.sign = function(e) {
  30806. return e < 0 ? -1 : 1
  30807. }
  30808. window.common = t.exports
  30809. }
  30810. , {
  30811. three: 217
  30812. }],
  30813. 186: [function(e, t, i) {
  30814. "use strict";
  30815. var n = {};
  30816. n.linearTween = function(e, t, i, n) {
  30817. return i * e / n + t
  30818. }
  30819. ,
  30820. n.easeInQuad = function(e, t, i, n) {
  30821. return e /= n,
  30822. i * e * e + t
  30823. }
  30824. ,
  30825. n.easeOutQuad = function(e, t, i, n) {
  30826. return e /= n,
  30827. -i * e * (e - 2) + t
  30828. }
  30829. ,
  30830. n.easeInOutQuad = function(e, t, i, n) {
  30831. return e /= n / 2,
  30832. e < 1 ? i / 2 * e * e + t : (e--,
  30833. -i / 2 * (e * (e - 2) - 1) + t)
  30834. }
  30835. ,
  30836. n.easeInCubic = function(e, t, i, n) {
  30837. return e /= n,
  30838. i * e * e * e + t
  30839. }
  30840. ,
  30841. n.easeOutCubic = function(e, t, i, n) {
  30842. return e /= n,
  30843. e--,
  30844. i * (e * e * e + 1) + t
  30845. }
  30846. ,
  30847. n.easeInOutCubic = function(e, t, i, n) {
  30848. return e /= n / 2,
  30849. e < 1 ? i / 2 * e * e * e + t : (e -= 2,
  30850. i / 2 * (e * e * e + 2) + t)
  30851. }
  30852. ,
  30853. n.easeInQuart = function(e, t, i, n) {
  30854. return e /= n,
  30855. i * e * e * e * e + t
  30856. }
  30857. ,
  30858. n.easeOutQuart = function(e, t, i, n) {
  30859. return e /= n,
  30860. e--,
  30861. -i * (e * e * e * e - 1) + t
  30862. }
  30863. ,
  30864. n.easeInOutQuart = function(e, t, i, n) {
  30865. return e /= n / 2,
  30866. e < 1 ? i / 2 * e * e * e * e + t : (e -= 2,
  30867. -i / 2 * (e * e * e * e - 2) + t)
  30868. }
  30869. ,
  30870. n.easeInQuint = function(e, t, i, n) {
  30871. return e /= n,
  30872. i * e * e * e * e * e + t
  30873. }
  30874. ,
  30875. n.easeOutQuint = function(e, t, i, n) {
  30876. return e /= n,
  30877. e--,
  30878. i * (e * e * e * e * e + 1) + t
  30879. }
  30880. ,
  30881. n.easeInOutQuint = function(e, t, i, n) {
  30882. return e /= n / 2,
  30883. e < 1 ? i / 2 * e * e * e * e * e + t : (e -= 2,
  30884. i / 2 * (e * e * e * e * e + 2) + t)
  30885. }
  30886. ,
  30887. n.easeInSine = function(e, t, i, n) {
  30888. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  30889. }
  30890. ,
  30891. n.easeOutSine = function(e, t, i, n) {
  30892. return i * Math.sin(e / n * (Math.PI / 2)) + t
  30893. }
  30894. ,
  30895. n.easeInOutSine = function(e, t, i, n) {
  30896. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  30897. }
  30898. ,
  30899. n.easeInExpo = function(e, t, i, n) {
  30900. return i * Math.pow(2, 10 * (e / n - 1)) + t
  30901. }
  30902. ,
  30903. n.easeOutExpo = function(e, t, i, n) {
  30904. return i * (-Math.pow(2, -10 * e / n) + 1) + t
  30905. }
  30906. ,
  30907. n.easeInOutExpo = function(e, t, i, n) {
  30908. return e /= n / 2,
  30909. e < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  30910. i / 2 * (-Math.pow(2, -10 * e) + 2) + t)
  30911. }
  30912. ,
  30913. n.easeInCirc = function(e, t, i, n) {
  30914. return e /= n,
  30915. -i * (Math.sqrt(1 - e * e) - 1) + t
  30916. }
  30917. ,
  30918. n.easeOutCirc = function(e, t, i, n) {
  30919. return e /= n,
  30920. e--,
  30921. i * Math.sqrt(1 - e * e) + t
  30922. }
  30923. ,
  30924. n.easeInOutCirc = function(e, t, i, n) {
  30925. return e /= n / 2,
  30926. e < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  30927. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  30928. }
  30929. ,
  30930. n.easeInElastic = function(e, t, i, n) {
  30931. var r = 1.70158
  30932. , o = 0
  30933. , a = i;
  30934. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  30935. a < Math.abs(i) ? (a = i,
  30936. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  30937. -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t)
  30938. }
  30939. ,
  30940. n.easeOutElastic = function(e, t, i, n) {
  30941. var r = 1.70158
  30942. , o = 0
  30943. , a = i;
  30944. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  30945. a < Math.abs(i) ? (a = i,
  30946. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  30947. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  30948. }
  30949. ,
  30950. n.easeInOutElastic = function(e, t, i, n) {
  30951. var r = 1.70158
  30952. , o = 0
  30953. , a = i;
  30954. return 0 === e ? t : 2 === (e /= n / 2) ? t + i : (o || (o = n * (.3 * 1.5)),
  30955. a < Math.abs(i) ? (a = i,
  30956. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  30957. e < 1 ? -.5 * (a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t : a * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) * .5 + i + t)
  30958. }
  30959. ,
  30960. n.easeInBack = function(e, t, i, n, r) {
  30961. return void 0 === r && (r = 1.70158),
  30962. i * (e /= n) * e * ((r + 1) * e - r) + t
  30963. }
  30964. ,
  30965. n.easeOutBack = function(e, t, i, n, r) {
  30966. return void 0 === r && (r = 1.70158),
  30967. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  30968. }
  30969. ,
  30970. n.easeInOutBack = function(e, t, i, n, r) {
  30971. return void 0 === r && (r = 1.70158),
  30972. (e /= n / 2) < 1 ? i / 2 * (e * e * (((r *= 1.525) + 1) * e - r)) + t : i / 2 * ((e -= 2) * e * (((r *= 1.525) + 1) * e + r) + 2) + t
  30973. }
  30974. ,
  30975. n.easeOutBounce = function(e, t, i, n) {
  30976. 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
  30977. }
  30978. ,
  30979. n.easeInBounce = function(e, t, i, r) {
  30980. return i - n.easeOutBounce(r - e, 0, i, r) + t
  30981. }
  30982. ,
  30983. n.easeInOutBounce = function(e, t, i, r) {
  30984. return e < r / 2 ? .5 * n.easeInBounce(2 * e, 0, i, r) + t : .5 * n.easeOutBounce(x, 2 * e - r, 0, i, r) + .5 * i + t
  30985. }
  30986. ,
  30987. t.exports = n
  30988. window.easing = n
  30989. }
  30990. , {}],
  30991. 187: [function(e, t, i) {
  30992. "use strict";
  30993. function n() {
  30994. this.events = [],
  30995. this.valid = !1
  30996. }
  30997. var r = e("../enum/Joystick");
  30998. n.prototype.push = function(e, t) {
  30999. this.events.push({
  31000. direction: e,
  31001. pano: t
  31002. }),
  31003. this.valid = !0
  31004. }
  31005. ,
  31006. n.prototype.pop = function(e) {
  31007. var t = this.events.pop();
  31008. return this.events.length < 1 && (this.valid = !1),
  31009. t
  31010. }
  31011. ,
  31012. n.prototype.peek = function() {
  31013. return this.events.length ? this.events[this.events.length - 1] : {
  31014. direction: null,
  31015. pano: null
  31016. }
  31017. }
  31018. ,
  31019. n.prototype.invalidate = function() {
  31020. this.events = [],
  31021. this.valid = !1
  31022. }
  31023. ,
  31024. n.prototype.reversePano = function(e) {
  31025. if (!this.valid)
  31026. return null;
  31027. var t = this.peek();
  31028. return r.opposite(e) === t.direction ? (this.pop(),
  31029. t.pano) : null
  31030. }
  31031. ,
  31032. t.exports = n
  31033. }
  31034. , {
  31035. "../enum/Joystick": 29
  31036. }],
  31037. 188: [function(e, t, i) {
  31038. "use strict";
  31039. window.lerp = t.exports = {
  31040. vector: function(e, t) {
  31041. var i = e.clone();
  31042. return t = t.clone(),
  31043. function(n) {
  31044. e.set(i.x * (1 - n) + t.x * n, i.y * (1 - n) + t.y * n, i.z * (1 - n) + t.z * n)
  31045. }
  31046. },
  31047. quaternion: function(e, t) {
  31048. var i = e.clone();
  31049. return function(n) {
  31050. e.copy(i).slerp(t, n)
  31051. }
  31052. },
  31053. property: function(e, t, i, n) {
  31054. var r = e[t];
  31055. return function(o) {
  31056. e[t] = r * (1 - o) + i * o,
  31057. n && n(e[t])
  31058. }
  31059. },
  31060. uniform: function(e, t, i) {
  31061. var n = e.material.uniforms[t].value;
  31062. return function(r) {
  31063. e.material.uniforms[t] && (e.material.uniforms[t].value = n * (1 - r) + i * r)
  31064. }
  31065. },
  31066. matrix4: function(e, t) {
  31067. var i = e.clone();
  31068. return function(n) {
  31069. for (var r = e.elements, o = i.elements, a = t.elements, s = 0; s < 16; s++)
  31070. r[s] = o[s] * (1 - n) + a[s] * n
  31071. }
  31072. },
  31073. allUniforms: function(e, t, i) {
  31074. var n = e.map(function(e) {
  31075. return this.uniform(e, t, i)
  31076. }
  31077. .bind(this));
  31078. return function(e) {
  31079. n.forEach(function(t) {
  31080. t(e)
  31081. })
  31082. }
  31083. }
  31084. }
  31085. }
  31086. , {}],
  31087. 189: [function(e, t, i) {
  31088. "use strict";
  31089. function n(e) {
  31090. var t, i, o, a, s = e.split("/"), l = "[" + s[s.length - 1].replace(".js", "") + "]", c = {};
  31091. if (n.consoleEnabled) {
  31092. var h = function(e) {
  31093. $("#debug-console").append("<p>" + e + "</p>"),
  31094. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  31095. };
  31096. t = function(e) {
  31097. h(Array.prototype.slice.call(arguments).join(" "))
  31098. }
  31099. ,
  31100. i = function(e) {
  31101. h(Array.prototype.slice.call(arguments).join(" "))
  31102. }
  31103. ,
  31104. o = function(e) {
  31105. h("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  31106. }
  31107. ,
  31108. a = function(e) {
  31109. h("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  31110. }
  31111. } else
  31112. console.log ? (t = console.log,
  31113. i = console.info ? console.info : console.log,
  31114. o = console.warn ? console.warn : console.log,
  31115. a = console.error ? console.error : console.log) : t = i = o = a = function() {}
  31116. ;
  31117. var u = function(e) {
  31118. return [l, n.timestamp()].concat(Array.prototype.slice.call(e))
  31119. }
  31120. , d = function(t, i) {
  31121. if (r) {
  31122. var o = Array.prototype.slice.call(t).join(" ");
  31123. r.captureMessage(o, {
  31124. level: i,
  31125. path: e,
  31126. timestamp: n.timestamp()
  31127. })
  31128. }
  31129. }
  31130. , p = function(t, i) {
  31131. if (r) {
  31132. var o = Array.prototype.slice.call(t).join(" ");
  31133. r.captureException(new Error(o), {
  31134. level: i,
  31135. path: e,
  31136. timestamp: n.timestamp()
  31137. })
  31138. }
  31139. };
  31140. return {
  31141. debug: function() {
  31142. n.level >= n.levels.debug && t.apply(console, u(arguments))
  31143. },
  31144. info: function() {
  31145. n.level >= n.levels.info && i.apply(console, u(arguments))
  31146. },
  31147. warn: function() {
  31148. d(arguments, "warn"),
  31149. n.level >= n.levels.warn && o.apply(console, u(arguments))
  31150. },
  31151. error: function() {
  31152. p(arguments, "error"),
  31153. n.level >= n.levels.error && a.apply(console, u(arguments))
  31154. },
  31155. v3str: function(e, t) {
  31156. var i = void 0 === t ? 2 : t;
  31157. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  31158. },
  31159. eulstr: function(e, t) {
  31160. var i = void 0 === t ? 2 : t;
  31161. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  31162. },
  31163. time: function(e) {
  31164. n.level >= n.levels.debug && (c[e] = Date.now())
  31165. },
  31166. timeEnd: function(e) {
  31167. if (n.level >= n.levels.debug) {
  31168. var t = c[e];
  31169. if (!t)
  31170. return;
  31171. var i = (Date.now() - t) / 1e3;
  31172. this.debug(e, i + "s")
  31173. }
  31174. }
  31175. }
  31176. }
  31177. var r = window.Raven;
  31178. n.timestamp = function() {
  31179. return (Date.now() - window.navigationStart) / 1e3 + "s"
  31180. }
  31181. ,
  31182. n.levels = {
  31183. debug: 3,
  31184. info: 2,
  31185. warn: 1,
  31186. error: 0
  31187. },
  31188. n.level = n.levels.info,
  31189. t.exports = n
  31190. }
  31191. , {}],
  31192. 190: [function(e, t, i) {
  31193. "use strict";
  31194. var n = e("three")
  31195. , r = e("../enum/GLCubeFaces")
  31196. , o = e("../constants");
  31197. t.exports = {
  31198. convertVisionVector: function(e) {
  31199. return new n.Vector3(e.x,e.z,-e.y)
  31200. },
  31201. convertVisionQuaternion: function(e) {
  31202. return new n.Quaternion(e.x,e.z,-e.y,e.w).multiply((new n.Quaternion).setFromAxisAngle(new n.Vector3(0,1,0), n.Math.degToRad(90)))
  31203. },
  31204. convertWorkshopVector: function(e) {
  31205. return new n.Vector3(-e.x,e.y,e.z)
  31206. },
  31207. convertWorkshopQuaternion: function(e) {
  31208. return new n.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new n.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  31209. },
  31210. convertWorkshopPanoramaQuaternion: function(e) {
  31211. return new n.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new n.Quaternion).setFromAxisAngle(new n.Vector3(0,1,0), n.Math.degToRad(270)))
  31212. },
  31213. convertWorkshopOrthoZoom: function(e) {// xzw
  31214. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / o.workshopApsect
  31215. //return e;
  31216. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  31217. },
  31218. toPrecision: function(e, t) {//xzw change
  31219. var f = function(e, t){
  31220. var i = Math.pow(10, t);
  31221. return Math.round(e * i) / i
  31222. }
  31223. if(e instanceof Array){
  31224. for(var s=0; s<e.length; s++){
  31225. e[s] = f(e[s],t);
  31226. }
  31227. return e;
  31228. }
  31229. else return f(e,t)
  31230. },
  31231. isEmptyQuaternion: function(e) {
  31232. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  31233. },
  31234. projectPositionToCanvas: function(e, t, i) {
  31235. i = i || new n.Vector3,
  31236. i.copy(e);
  31237. var r = .5 * $("#player").width()
  31238. , o = .5 * $("#player").height();
  31239. return i.project(t),
  31240. i.x = i.x * r + r,
  31241. i.y = -(i.y * o) + o,
  31242. i
  31243. },
  31244. convertScreenPositionToNDC: function(e, t, i) {
  31245. return i = i || new n.Vector2,
  31246. i.x = e / $("#player").width() * 2 - 1,
  31247. i.y = 2 * -(t / $("#player").height()) + 1,
  31248. i
  31249. },
  31250. constrainedTurn: function(e) {
  31251. var t = e % (2 * Math.PI);
  31252. return t = t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  31253. },
  31254. getFOVDotThreshold: function(e) {
  31255. return Math.cos(n.Math.degToRad(e / 2))
  31256. },
  31257. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  31258. switch (e) {
  31259. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  31260. i.set(1, t.y, t.x);
  31261. break;
  31262. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  31263. i.set(-1, t.y, -t.x);
  31264. break;
  31265. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  31266. i.set(-t.x, 1, -t.y);
  31267. break;
  31268. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  31269. i.set(-t.x, -1, t.y);
  31270. break;
  31271. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  31272. i.set(-t.x, t.y, 1);
  31273. break;
  31274. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  31275. i.set(t.x, t.y, -1)
  31276. }
  31277. n && i.normalize()
  31278. },
  31279. //add:
  31280. getPos2d : function(point, camera, dom){
  31281. var camera = camera ;
  31282. var dom = dom;
  31283. 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);
  31284. var x,y;
  31285. x = (pos.x + 1) / 2 * dom.clientWidth;
  31286. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  31287. var inSight = x <= dom.clientWidth && x >= 0
  31288. && y <= dom.clientHeight && y >= 0
  31289. return {
  31290. pos: new THREE.Vector2(x,y),
  31291. vector: pos,
  31292. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  31293. inSight : inSight //在屏幕范围内可见
  31294. };
  31295. }
  31296. }
  31297. window.math = t.exports
  31298. }
  31299. , {
  31300. "../constants": 8,
  31301. "../enum/GLCubeFaces": 25,
  31302. three: 217
  31303. }],
  31304. 191: [function(e, t, i) {
  31305. "use strict";
  31306. function n(e, t, i) {
  31307. return a.map(function(n, o) {
  31308. return e.get("pan/" + i + "/" + t + "_skybox" + r(n) + ".jpg")
  31309. }
  31310. .bind(this))
  31311. }
  31312. function r(e) {
  31313. return s[e]
  31314. }
  31315. var o = e("../enum/GLCubeFaces")
  31316. , a = [0, 1, 2, 3, 4, 5]
  31317. , s = {
  31318. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  31319. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  31320. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  31321. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  31322. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  31323. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  31324. };
  31325. t.exports = {
  31326. mapFaceToCubemapFace: r,
  31327. getCubemapUrls: n
  31328. }
  31329. }
  31330. , {
  31331. "../enum/GLCubeFaces": 25
  31332. }],
  31333. 192: [function(e, t, i) {
  31334. "use strict";
  31335. t.exports = {
  31336. captureErrors: function(e, t, i) {
  31337. if ("Raven"in window) {
  31338. Raven.config(e, t).install(),
  31339. i && Raven.setTagsContext(i);
  31340. var n = console.warn
  31341. , r = console.error;
  31342. console.warn = function() {
  31343. var e = Array.prototype.slice.call(arguments);
  31344. Raven.captureMessage(e.join(" "), {
  31345. level: "warning"
  31346. }),
  31347. n.apply(console, e)
  31348. }
  31349. ,
  31350. console.error = function() {
  31351. var e = Array.prototype.slice.call(arguments);
  31352. Raven.captureException(new Error(e.join(" ")), {
  31353. level: "error"
  31354. }),
  31355. r.apply(console, e)
  31356. }
  31357. } else
  31358. console.error("Raven not found, not capturing errors.")
  31359. }
  31360. }
  31361. }
  31362. , {}],
  31363. 193: [function(e, t, i) {
  31364. (function(i) {
  31365. "use strict";
  31366. var n = e("./browser")
  31367. , r = e("../constants")
  31368. , o = e("url")
  31369. , a = e("./logger")
  31370. , ss = e('three')
  31371. , s = new a(i)
  31372. , l = {
  31373. getAuthorizationHeader: function() {
  31374. var e = n.valueFromHash("auth");
  31375. if (e)
  31376. return e.replace(",", " ");
  31377. var t = n.valueFromCookie("token");
  31378. return t ? "Token " + t : null
  31379. },
  31380. parseSidUrl: function(e) {
  31381. var t, i;
  31382. t=g_Prefix;
  31383. if (e = e || "",
  31384. e.match(/^https?/)) {
  31385. var n = o.parse(e);
  31386. t = g_Prefix,
  31387. i = e
  31388. } else{
  31389. //xzw 原先的不能用
  31390. //t = window.location.protocol + "//" + window.location.host, //MP
  31391. t = g_Prefix
  31392. //i = t + "/api/player/models/" + e; //MP
  31393. i = t + "data/" + e;
  31394. }
  31395. return {
  31396. urlBase: t,
  31397. urlModel: i,
  31398. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  31399. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  31400. }
  31401. },
  31402. getModelIDFromQueryString: function() {
  31403. return n.valueFromHash("model") || n.valueFromHash("m")
  31404. },
  31405. /* normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  31406. e = JSON.parse(JSON.stringify(e));
  31407. var i = null;
  31408. if (e.images.forEach(function(n) {
  31409. if(!n.metadata) return;
  31410. if ("string" == typeof n.metadata)
  31411. try {
  31412. n.metadata = JSON.parse(n.metadata)
  31413. } catch (e) {
  31414. s.warn("Unable to parse image metadata"),
  31415. n.metadata = null
  31416. }
  31417. else{
  31418. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  31419. }
  31420. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  31421. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  31422. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  31423. }else{
  31424. n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  31425. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position))
  31426. n.metadata.zoom = n.metadata.zoom || 1;
  31427. }
  31428. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  31429. }),
  31430. //icon初始视角的:
  31431. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  31432. var n = {};
  31433. n.pano = {
  31434. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  31435. position: t.convertWorkshopVector(i.scan_position),
  31436. uuid: i.scan_id
  31437. },
  31438. n.camera = {
  31439. quaternion: i.camera_quaternion,
  31440. position: i.camera_position
  31441. },
  31442. e.startPano = n
  31443. }
  31444. return e
  31445. },
  31446. */
  31447. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  31448. e = JSON.parse(JSON.stringify(e));
  31449. var i = null;
  31450. var deal = function(n) {
  31451. if(!n.metadata) return;
  31452. if ("string" == typeof n.metadata)
  31453. try {
  31454. n.metadata = JSON.parse(n.metadata)
  31455. } catch (e) {
  31456. s.warn("Unable to parse image metadata"),
  31457. n.metadata = null
  31458. }
  31459. else{
  31460. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  31461. }
  31462. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  31463. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  31464. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  31465. }else{
  31466. n.metadata.camera_position = new ss.Vector3().copy(n.metadata.camera_position)
  31467. n.metadata.camera_quaternion = new ss.Quaternion().copy(n.metadata.camera_quaternion)
  31468. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  31469. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  31470. }
  31471. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  31472. }
  31473. //改
  31474. e.images.forEach(info=>{
  31475. if(info.locations){
  31476. info.locations.forEach(a=>deal(a))
  31477. }else{
  31478. deal(info)
  31479. }
  31480. })
  31481. //icon初始视角的:
  31482. if(i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  31483. var n = {};
  31484. n.pano = {
  31485. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  31486. position: t.convertWorkshopVector(i.scan_position),
  31487. uuid: i.scan_id
  31488. },
  31489. n.camera = {
  31490. quaternion: i.camera_quaternion,
  31491. position: i.camera_position
  31492. },
  31493. e.startPano = n
  31494. }
  31495. return e
  31496. },
  31497. visionVersionToInt: function() {
  31498. var e = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join(""));
  31499. return function(t) {
  31500. if (!t)
  31501. throw new Error("Vision version is required");
  31502. var i = e.exec(t);
  31503. if (null === i)
  31504. throw new Error("String is not a vision version: " + t);
  31505. return parseInt(i[1])
  31506. }
  31507. }(),
  31508. modelDataPromisesTiles: function(e) {
  31509. var vision_version = e.vision_version || window.MP_PREFETCHED_MODELDATA.vision_version
  31510. if (vision_version)
  31511. try {
  31512. return l.visionVersionToInt(vision_version) >= l.visionVersionToInt(r.visionTilingStartVersion)
  31513. } catch (t) {
  31514. s.warn("Invalid vision version: " + vision_version)
  31515. }
  31516. // var t = e.created ? new Date(e.created) : null;
  31517. // return t && t >= r.visionTilingStartDate
  31518. return false
  31519. }
  31520. };
  31521. t.exports = l
  31522. }
  31523. ).call(this, "/js/util/showcase.js")
  31524. }
  31525. , {
  31526. "../constants": 8,
  31527. "./browser": 182,
  31528. "./logger": 189,
  31529. three:217,
  31530. url: 208
  31531. }],
  31532. 194: [function(e, t, i) {
  31533. "use strict";
  31534. var n = e("../util/ajax")
  31535. , r = e("three")
  31536. , o = e("../settings")
  31537. , a = {};
  31538. t.exports = {
  31539. load: function(e, t, i) {
  31540. var s = a[e];
  31541. return s ? (t && setTimeout(function() {
  31542. t(s)
  31543. }, 1),
  31544. s) : (s = new r.Texture,
  31545. o.minimalMemoryMode && (s.minFilter = r.LinearFilter,
  31546. s.magFilter = r.LinearFilter,
  31547. s.generateMipmaps = !1),
  31548. s.sourceFile = e,
  31549. a[e] = s,
  31550. n.getImage(e).then(function(e) {
  31551. s.image = e,
  31552. s.needsUpdate = !0,
  31553. t && t(s)
  31554. }).fail(i),
  31555. s)
  31556. },
  31557. loadBase64: function(e, t) {
  31558. t = t || "png";
  31559. var i = new r.Texture;
  31560. return i.image = document.createElement("img"),
  31561. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  31562. o.minimalMemoryMode && (i.minFilter = r.LinearFilter,
  31563. i.magFilter = r.LinearFilter,
  31564. i.generateMipmaps = !1),
  31565. i.needsUpdate = !0,
  31566. i
  31567. },
  31568. isLoaded: function(e) {
  31569. return !!a[e]
  31570. }
  31571. }
  31572. window.Texture = t.exports
  31573. }
  31574. , {
  31575. "../settings": 166,
  31576. "../util/ajax": 181,
  31577. three: 217
  31578. }],
  31579. 195: [function(e, t, i) {
  31580. "use strict";
  31581. var n = e("./easing");
  31582. window.transitions = t.exports = {
  31583. globalDone: null,
  31584. funcs: [],
  31585. counter: 0,
  31586. uniqueID: 0,
  31587. start: function(e, t, i, r, o, a, s) {
  31588. return r = r || 0,
  31589. this.funcs.push({
  31590. func: e,
  31591. current: -r * Math.abs(t),
  31592. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  31593. done: i,
  31594. easing: o || n.linearTween,
  31595. cycling: t < 0,
  31596. running: !0,
  31597. debug: r < 0,
  31598. name: a || "T" + this.counter,
  31599. id: void 0 === s ? this.counter : s,
  31600. paused: !1
  31601. }),
  31602. e(0, 16),
  31603. this.counter += 1,
  31604. e
  31605. },
  31606. trigger: function(e) {
  31607. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  31608. , i = e.func || function() {}
  31609. , r = void 0 === e.duration ? 0 : e.duration;
  31610. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r));
  31611. var o = e.done || null
  31612. , a = e.easing || n.linearTween
  31613. , s = e.name || "R" + this.counter
  31614. , l = void 0 === e.id ? this.counter : e.id;
  31615. return this.start(i, r, o, t, a, s, l)
  31616. },
  31617. setTimeout: function(e, t, i) {
  31618. var n = void 0 === i ? this.counter : i;
  31619. return this.trigger({
  31620. done: e,
  31621. duration: void 0 === t ? 0 : t,
  31622. name: "O" + this.counter,
  31623. id: n
  31624. })
  31625. },
  31626. pause: function() {
  31627. this.paused = !0
  31628. },
  31629. resume: function() {
  31630. this.paused = !1
  31631. },
  31632. update: function(e) {
  31633. this.funcs.forEach(function(t) {
  31634. if (!(t.paused || (t.current += 1e3 * e,
  31635. t.current < 0)))
  31636. if (t.current >= t.duration && !t.cycling) {
  31637. var i = t.easing(1, 0, 1, 1);
  31638. t.func(i, 1e3 * e),
  31639. t.done && t.done(),
  31640. t.running = !1
  31641. } else {
  31642. var n = t.easing(t.current % t.duration / t.duration, 0, 1, 1)
  31643. , r = t.func(n, 1e3 * e) || !1;
  31644. r && (t.done && t.done(),
  31645. t.running = !1)
  31646. }
  31647. });
  31648. var t = this.funcs.length;
  31649. this.funcs = this.funcs.filter(function(e) {
  31650. return e.running
  31651. });
  31652. var i = this.funcs.length;
  31653. if (t > 0 && 0 === i && this.globalDone) {
  31654. var n = this.globalDone;
  31655. this.globalDone = null,
  31656. n()
  31657. }
  31658. },
  31659. adjustSpeed: function(e, t) {
  31660. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  31661. var r = i[n];
  31662. r.duration /= t,
  31663. r.current /= t
  31664. }
  31665. },
  31666. getById: function(e) {
  31667. return this.funcs.filter(function(t) {
  31668. return e === t.id
  31669. })
  31670. },
  31671. get: function(e) {
  31672. for (var t = 0; t < this.funcs.length; t += 1)
  31673. if (this.funcs[t].func === e)
  31674. return this.funcs[t];
  31675. return null
  31676. },
  31677. isRunning: function(e) {
  31678. var t = this.get(e);
  31679. return null !== t && t.running
  31680. },
  31681. countActive: function() {
  31682. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  31683. e += this.funcs[t].running;
  31684. return e
  31685. },
  31686. listActive: function() {
  31687. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  31688. this.funcs[t].running && e.push(this.funcs[t].name);
  31689. return e
  31690. },
  31691. done: function(e) {
  31692. this.globalDone = e
  31693. },
  31694. cancelById: function(e) {
  31695. var t = void 0 === e ? 0 : e;
  31696. this.funcs = this.funcs.filter(function(e) {
  31697. return e.id !== t
  31698. })
  31699. },
  31700. cancel: function(e) {
  31701. this.funcs = this.funcs.filter(function(t) {
  31702. return t.func !== e
  31703. })
  31704. },
  31705. getUniqueId: function() {
  31706. return this.uniqueID -= 1,
  31707. this.uniqueID
  31708. }
  31709. }
  31710. }
  31711. , {
  31712. "./easing": 186
  31713. }],
  31714. 196: [function(e, t, i) {
  31715. function n(e) {
  31716. if (this.set = {},
  31717. this.infContains = function() {
  31718. return !0
  31719. }
  31720. ,
  31721. "object" == typeof e)
  31722. if (e instanceof Array)
  31723. for (var t = 0; t < e.length; t++)
  31724. this.set[e[t]] = !0;
  31725. else
  31726. this.set = e;
  31727. else if ("function" == typeof e)
  31728. this.infContains = e;
  31729. else if ("undefined" != typeof e)
  31730. throw new Error("set must be either an array or an object.")
  31731. }
  31732. t.exports = n,
  31733. n.prototype.contains = function(e) {
  31734. return !!this.set[e]
  31735. }
  31736. ,
  31737. n.prototype.has = n.prototype.contains,
  31738. n.prototype.add = function(e) {
  31739. if (1 == arguments.length)
  31740. this.set[e] = !0;
  31741. else
  31742. for (var t = 0; t < arguments.length; t++)
  31743. this.set[arguments[t]] = !0
  31744. }
  31745. ,
  31746. n.prototype.addAll = function(e) {
  31747. if ("object" != typeof e && !(e instanceof Array))
  31748. throw new Error("arr must be an array.");
  31749. for (var t = 0; t < e.length; t++)
  31750. this.add(e[t])
  31751. }
  31752. ,
  31753. n.prototype.remove = function(e) {
  31754. if (1 == arguments.length)
  31755. delete this.set[e];
  31756. else
  31757. for (var t = 0; t < arguments.length; t++)
  31758. delete this.set[arguments[t]]
  31759. }
  31760. ,
  31761. n.prototype.delete = n.prototype.remove,
  31762. n.prototype.clear = function() {
  31763. this.set = {}
  31764. }
  31765. ,
  31766. n.prototype.size = function() {
  31767. return Object.keys(this.set).length
  31768. }
  31769. ,
  31770. n.prototype.toString = function() {
  31771. return "{" + Object.keys(this.set).toString() + "}"
  31772. }
  31773. ,
  31774. n.prototype.toArray = function() {
  31775. return "undefined" == typeof this.set ? [] : Object.keys(this.set)
  31776. }
  31777. ,
  31778. n.prototype["*values"] = n.prototype.toArray
  31779. }
  31780. , {}],
  31781. 197: [function(e, t, i) {}
  31782. , {}],
  31783. 198: [function(e, t, i) {
  31784. (function(t) {
  31785. "use strict";
  31786. function n() {
  31787. try {
  31788. var e = new Uint8Array(1);
  31789. return e.__proto__ = {
  31790. __proto__: Uint8Array.prototype,
  31791. foo: function() {
  31792. return 42
  31793. }
  31794. },
  31795. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  31796. } catch (e) {
  31797. return !1
  31798. }
  31799. }
  31800. function r() {
  31801. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  31802. }
  31803. function o(e, t) {
  31804. if (r() < t)
  31805. throw new RangeError("Invalid typed array length");
  31806. return a.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t),
  31807. e.__proto__ = a.prototype) : (null === e && (e = new a(t)),
  31808. e.length = t),
  31809. e
  31810. }
  31811. function a(e, t, i) {
  31812. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a))
  31813. return new a(e,t,i);
  31814. if ("number" == typeof e) {
  31815. if ("string" == typeof t)
  31816. throw new Error("If encoding is specified then the first argument must be a string");
  31817. return h(this, e)
  31818. }
  31819. return s(this, e, t, i)
  31820. }
  31821. function s(e, t, i, n) {
  31822. if ("number" == typeof t)
  31823. throw new TypeError('"value" argument must not be a number');
  31824. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? p(e, t, i, n) : "string" == typeof t ? u(e, t, i) : f(e, t)
  31825. }
  31826. function l(e) {
  31827. if ("number" != typeof e)
  31828. throw new TypeError('"size" argument must be a number');
  31829. if (e < 0)
  31830. throw new RangeError('"size" argument must not be negative')
  31831. }
  31832. function c(e, t, i, n) {
  31833. return l(t),
  31834. 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)
  31835. }
  31836. function h(e, t) {
  31837. if (l(t),
  31838. e = o(e, t < 0 ? 0 : 0 | g(t)),
  31839. !a.TYPED_ARRAY_SUPPORT)
  31840. for (var i = 0; i < t; ++i)
  31841. e[i] = 0;
  31842. return e
  31843. }
  31844. function u(e, t, i) {
  31845. if ("string" == typeof i && "" !== i || (i = "utf8"),
  31846. !a.isEncoding(i))
  31847. throw new TypeError('"encoding" must be a valid string encoding');
  31848. var n = 0 | v(t, i);
  31849. e = o(e, n);
  31850. var r = e.write(t, i);
  31851. return r !== n && (e = e.slice(0, r)),
  31852. e
  31853. }
  31854. function d(e, t) {
  31855. var i = t.length < 0 ? 0 : 0 | g(t.length);
  31856. e = o(e, i);
  31857. for (var n = 0; n < i; n += 1)
  31858. e[n] = 255 & t[n];
  31859. return e
  31860. }
  31861. function p(e, t, i, n) {
  31862. if (t.byteLength,
  31863. i < 0 || t.byteLength < i)
  31864. throw new RangeError("'offset' is out of bounds");
  31865. if (t.byteLength < i + (n || 0))
  31866. throw new RangeError("'length' is out of bounds");
  31867. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  31868. a.TYPED_ARRAY_SUPPORT ? (e = t,
  31869. e.__proto__ = a.prototype) : e = d(e, t),
  31870. e
  31871. }
  31872. function f(e, t) {
  31873. if (a.isBuffer(t)) {
  31874. var i = 0 | g(t.length);
  31875. return e = o(e, i),
  31876. 0 === e.length ? e : (t.copy(e, 0, 0, i),
  31877. e)
  31878. }
  31879. if (t) {
  31880. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  31881. return "number" != typeof t.length || K(t.length) ? o(e, 0) : d(e, t);
  31882. if ("Buffer" === t.type && $(t.data))
  31883. return d(e, t.data)
  31884. }
  31885. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  31886. }
  31887. function g(e) {
  31888. if (e >= r())
  31889. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + r().toString(16) + " bytes");
  31890. return 0 | e
  31891. }
  31892. function m(e) {
  31893. return +e != e && (e = 0),
  31894. a.alloc(+e)
  31895. }
  31896. function v(e, t) {
  31897. if (a.isBuffer(e))
  31898. return e.length;
  31899. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  31900. return e.byteLength;
  31901. "string" != typeof e && (e = "" + e);
  31902. var i = e.length;
  31903. if (0 === i)
  31904. return 0;
  31905. for (var n = !1; ; )
  31906. switch (t) {
  31907. case "ascii":
  31908. case "latin1":
  31909. case "binary":
  31910. return i;
  31911. case "utf8":
  31912. case "utf-8":
  31913. case void 0:
  31914. return j(e).length;
  31915. case "ucs2":
  31916. case "ucs-2":
  31917. case "utf16le":
  31918. case "utf-16le":
  31919. return 2 * i;
  31920. case "hex":
  31921. return i >>> 1;
  31922. case "base64":
  31923. return Z(e).length;
  31924. default:
  31925. if (n)
  31926. return j(e).length;
  31927. t = ("" + t).toLowerCase(),
  31928. n = !0
  31929. }
  31930. }
  31931. function A(e, t, i) {
  31932. var n = !1;
  31933. if ((void 0 === t || t < 0) && (t = 0),
  31934. t > this.length)
  31935. return "";
  31936. if ((void 0 === i || i > this.length) && (i = this.length),
  31937. i <= 0)
  31938. return "";
  31939. if (i >>>= 0,
  31940. t >>>= 0,
  31941. i <= t)
  31942. return "";
  31943. for (e || (e = "utf8"); ; )
  31944. switch (e) {
  31945. case "hex":
  31946. return L(this, t, i);
  31947. case "utf8":
  31948. case "utf-8":
  31949. return M(this, t, i);
  31950. case "ascii":
  31951. return P(this, t, i);
  31952. case "latin1":
  31953. case "binary":
  31954. return O(this, t, i);
  31955. case "base64":
  31956. return S(this, t, i);
  31957. case "ucs2":
  31958. case "ucs-2":
  31959. case "utf16le":
  31960. case "utf-16le":
  31961. return D(this, t, i);
  31962. default:
  31963. if (n)
  31964. throw new TypeError("Unknown encoding: " + e);
  31965. e = (e + "").toLowerCase(),
  31966. n = !0
  31967. }
  31968. }
  31969. function y(e, t, i) {
  31970. var n = e[t];
  31971. e[t] = e[i],
  31972. e[i] = n
  31973. }
  31974. function C(e, t, i, n, r) {
  31975. if (0 === e.length)
  31976. return -1;
  31977. if ("string" == typeof i ? (n = i,
  31978. i = 0) : i > 2147483647 ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  31979. i = +i,
  31980. isNaN(i) && (i = r ? 0 : e.length - 1),
  31981. i < 0 && (i = e.length + i),
  31982. i >= e.length) {
  31983. if (r)
  31984. return -1;
  31985. i = e.length - 1
  31986. } else if (i < 0) {
  31987. if (!r)
  31988. return -1;
  31989. i = 0
  31990. }
  31991. if ("string" == typeof t && (t = a.from(t, n)),
  31992. a.isBuffer(t))
  31993. return 0 === t.length ? -1 : I(e, t, i, n, r);
  31994. if ("number" == typeof t)
  31995. return t &= 255,
  31996. a.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? r ? Uint8Array.prototype.indexOf.call(e, t, i) : Uint8Array.prototype.lastIndexOf.call(e, t, i) : I(e, [t], i, n, r);
  31997. throw new TypeError("val must be string, number or Buffer")
  31998. }
  31999. function I(e, t, i, n, r) {
  32000. function o(e, t) {
  32001. return 1 === a ? e[t] : e.readUInt16BE(t * a)
  32002. }
  32003. var a = 1
  32004. , s = e.length
  32005. , l = t.length;
  32006. if (void 0 !== n && (n = String(n).toLowerCase(),
  32007. "ucs2" === n || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  32008. if (e.length < 2 || t.length < 2)
  32009. return -1;
  32010. a = 2,
  32011. s /= 2,
  32012. l /= 2,
  32013. i /= 2
  32014. }
  32015. var c;
  32016. if (r) {
  32017. var h = -1;
  32018. for (c = i; c < s; c++)
  32019. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  32020. if (h === -1 && (h = c),
  32021. c - h + 1 === l)
  32022. return h * a
  32023. } else
  32024. h !== -1 && (c -= c - h),
  32025. h = -1
  32026. } else
  32027. for (i + l > s && (i = s - l),
  32028. c = i; c >= 0; c--) {
  32029. for (var u = !0, d = 0; d < l; d++)
  32030. if (o(e, c + d) !== o(t, d)) {
  32031. u = !1;
  32032. break
  32033. }
  32034. if (u)
  32035. return c
  32036. }
  32037. return -1
  32038. }
  32039. function E(e, t, i, n) {
  32040. i = Number(i) || 0;
  32041. var r = e.length - i;
  32042. n ? (n = Number(n),
  32043. n > r && (n = r)) : n = r;
  32044. var o = t.length;
  32045. if (o % 2 !== 0)
  32046. throw new TypeError("Invalid hex string");
  32047. n > o / 2 && (n = o / 2);
  32048. for (var a = 0; a < n; ++a) {
  32049. var s = parseInt(t.substr(2 * a, 2), 16);
  32050. if (isNaN(s))
  32051. return a;
  32052. e[i + a] = s
  32053. }
  32054. return a
  32055. }
  32056. function b(e, t, i, n) {
  32057. return q(j(t, e.length - i), e, i, n)
  32058. }
  32059. function w(e, t, i, n) {
  32060. return q(Y(t), e, i, n)
  32061. }
  32062. function _(e, t, i, n) {
  32063. return w(e, t, i, n)
  32064. }
  32065. function T(e, t, i, n) {
  32066. return q(Z(t), e, i, n)
  32067. }
  32068. function x(e, t, i, n) {
  32069. return q(X(t, e.length - i), e, i, n)
  32070. }
  32071. function S(e, t, i) {
  32072. return 0 === t && i === e.length ? Q.fromByteArray(e) : Q.fromByteArray(e.slice(t, i))
  32073. }
  32074. function M(e, t, i) {
  32075. i = Math.min(e.length, i);
  32076. for (var n = [], r = t; r < i; ) {
  32077. var o = e[r]
  32078. , a = null
  32079. , s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
  32080. if (r + s <= i) {
  32081. var l, c, h, u;
  32082. switch (s) {
  32083. case 1:
  32084. o < 128 && (a = o);
  32085. break;
  32086. case 2:
  32087. l = e[r + 1],
  32088. 128 === (192 & l) && (u = (31 & o) << 6 | 63 & l,
  32089. u > 127 && (a = u));
  32090. break;
  32091. case 3:
  32092. l = e[r + 1],
  32093. c = e[r + 2],
  32094. 128 === (192 & l) && 128 === (192 & c) && (u = (15 & o) << 12 | (63 & l) << 6 | 63 & c,
  32095. u > 2047 && (u < 55296 || u > 57343) && (a = u));
  32096. break;
  32097. case 4:
  32098. l = e[r + 1],
  32099. c = e[r + 2],
  32100. h = e[r + 3],
  32101. 128 === (192 & l) && 128 === (192 & c) && 128 === (192 & h) && (u = (15 & o) << 18 | (63 & l) << 12 | (63 & c) << 6 | 63 & h,
  32102. u > 65535 && u < 1114112 && (a = u))
  32103. }
  32104. }
  32105. null === a ? (a = 65533,
  32106. s = 1) : a > 65535 && (a -= 65536,
  32107. n.push(a >>> 10 & 1023 | 55296),
  32108. a = 56320 | 1023 & a),
  32109. n.push(a),
  32110. r += s
  32111. }
  32112. return R(n)
  32113. }
  32114. function R(e) {
  32115. var t = e.length;
  32116. if (t <= ee)
  32117. return String.fromCharCode.apply(String, e);
  32118. for (var i = "", n = 0; n < t; )
  32119. i += String.fromCharCode.apply(String, e.slice(n, n += ee));
  32120. return i
  32121. }
  32122. function P(e, t, i) {
  32123. var n = "";
  32124. i = Math.min(e.length, i);
  32125. for (var r = t; r < i; ++r)
  32126. n += String.fromCharCode(127 & e[r]);
  32127. return n
  32128. }
  32129. function O(e, t, i) {
  32130. var n = "";
  32131. i = Math.min(e.length, i);
  32132. for (var r = t; r < i; ++r)
  32133. n += String.fromCharCode(e[r]);
  32134. return n
  32135. }
  32136. function L(e, t, i) {
  32137. var n = e.length;
  32138. (!t || t < 0) && (t = 0),
  32139. (!i || i < 0 || i > n) && (i = n);
  32140. for (var r = "", o = t; o < i; ++o)
  32141. r += W(e[o]);
  32142. return r
  32143. }
  32144. function D(e, t, i) {
  32145. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  32146. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  32147. return r
  32148. }
  32149. function N(e, t, i) {
  32150. if (e % 1 !== 0 || e < 0)
  32151. throw new RangeError("offset is not uint");
  32152. if (e + t > i)
  32153. throw new RangeError("Trying to access beyond buffer length")
  32154. }
  32155. function B(e, t, i, n, r, o) {
  32156. if (!a.isBuffer(e))
  32157. throw new TypeError('"buffer" argument must be a Buffer instance');
  32158. if (t > r || t < o)
  32159. throw new RangeError('"value" argument is out of bounds');
  32160. if (i + n > e.length)
  32161. throw new RangeError("Index out of range")
  32162. }
  32163. function F(e, t, i, n) {
  32164. t < 0 && (t = 65535 + t + 1);
  32165. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  32166. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  32167. }
  32168. function V(e, t, i, n) {
  32169. t < 0 && (t = 4294967295 + t + 1);
  32170. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  32171. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  32172. }
  32173. function U(e, t, i, n, r, o) {
  32174. if (i + n > e.length)
  32175. throw new RangeError("Index out of range");
  32176. if (i < 0)
  32177. throw new RangeError("Index out of range")
  32178. }
  32179. function k(e, t, i, n, r) {
  32180. return r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  32181. J.write(e, t, i, n, 23, 4),
  32182. i + 4
  32183. }
  32184. function H(e, t, i, n, r) {
  32185. return r || U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  32186. J.write(e, t, i, n, 52, 8),
  32187. i + 8
  32188. }
  32189. function G(e) {
  32190. if (e = z(e).replace(te, ""),
  32191. e.length < 2)
  32192. return "";
  32193. for (; e.length % 4 !== 0; )
  32194. e += "=";
  32195. return e
  32196. }
  32197. function z(e) {
  32198. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  32199. }
  32200. function W(e) {
  32201. return e < 16 ? "0" + e.toString(16) : e.toString(16)
  32202. }
  32203. function j(e, t) {
  32204. t = t || 1 / 0;
  32205. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  32206. if (i = e.charCodeAt(a),
  32207. i > 55295 && i < 57344) {
  32208. if (!r) {
  32209. if (i > 56319) {
  32210. (t -= 3) > -1 && o.push(239, 191, 189);
  32211. continue
  32212. }
  32213. if (a + 1 === n) {
  32214. (t -= 3) > -1 && o.push(239, 191, 189);
  32215. continue
  32216. }
  32217. r = i;
  32218. continue
  32219. }
  32220. if (i < 56320) {
  32221. (t -= 3) > -1 && o.push(239, 191, 189),
  32222. r = i;
  32223. continue
  32224. }
  32225. i = (r - 55296 << 10 | i - 56320) + 65536
  32226. } else
  32227. r && (t -= 3) > -1 && o.push(239, 191, 189);
  32228. if (r = null,
  32229. i < 128) {
  32230. if ((t -= 1) < 0)
  32231. break;
  32232. o.push(i)
  32233. } else if (i < 2048) {
  32234. if ((t -= 2) < 0)
  32235. break;
  32236. o.push(i >> 6 | 192, 63 & i | 128)
  32237. } else if (i < 65536) {
  32238. if ((t -= 3) < 0)
  32239. break;
  32240. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  32241. } else {
  32242. if (!(i < 1114112))
  32243. throw new Error("Invalid code point");
  32244. if ((t -= 4) < 0)
  32245. break;
  32246. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  32247. }
  32248. }
  32249. return o
  32250. }
  32251. function Y(e) {
  32252. for (var t = [], i = 0; i < e.length; ++i)
  32253. t.push(255 & e.charCodeAt(i));
  32254. return t
  32255. }
  32256. function X(e, t) {
  32257. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  32258. i = e.charCodeAt(a),
  32259. n = i >> 8,
  32260. r = i % 256,
  32261. o.push(r),
  32262. o.push(n);
  32263. return o
  32264. }
  32265. function Z(e) {
  32266. return Q.toByteArray(G(e))
  32267. }
  32268. function q(e, t, i, n) {
  32269. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  32270. t[r + i] = e[r];
  32271. return r
  32272. }
  32273. function K(e) {
  32274. return e !== e
  32275. }
  32276. var Q = e("base64-js")
  32277. , J = e("ieee754")
  32278. , $ = e("isarray");
  32279. i.Buffer = a,
  32280. i.SlowBuffer = m,
  32281. i.INSPECT_MAX_BYTES = 50,
  32282. a.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n(),
  32283. i.kMaxLength = r(),
  32284. a.poolSize = 8192,
  32285. a._augment = function(e) {
  32286. return e.__proto__ = a.prototype,
  32287. e
  32288. }
  32289. ,
  32290. a.from = function(e, t, i) {
  32291. return s(null, e, t, i)
  32292. }
  32293. ,
  32294. a.TYPED_ARRAY_SUPPORT && (a.prototype.__proto__ = Uint8Array.prototype,
  32295. a.__proto__ = Uint8Array,
  32296. "undefined" != typeof Symbol && Symbol.species && a[Symbol.species] === a && Object.defineProperty(a, Symbol.species, {
  32297. value: null,
  32298. configurable: !0
  32299. })),
  32300. a.alloc = function(e, t, i) {
  32301. return c(null, e, t, i)
  32302. }
  32303. ,
  32304. a.allocUnsafe = function(e) {
  32305. return h(null, e)
  32306. }
  32307. ,
  32308. a.allocUnsafeSlow = function(e) {
  32309. return h(null, e)
  32310. }
  32311. ,
  32312. a.isBuffer = function(e) {
  32313. return !(null == e || !e._isBuffer)
  32314. }
  32315. ,
  32316. a.compare = function(e, t) {
  32317. if (!a.isBuffer(e) || !a.isBuffer(t))
  32318. throw new TypeError("Arguments must be Buffers");
  32319. if (e === t)
  32320. return 0;
  32321. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  32322. if (e[r] !== t[r]) {
  32323. i = e[r],
  32324. n = t[r];
  32325. break
  32326. }
  32327. return i < n ? -1 : n < i ? 1 : 0
  32328. }
  32329. ,
  32330. a.isEncoding = function(e) {
  32331. switch (String(e).toLowerCase()) {
  32332. case "hex":
  32333. case "utf8":
  32334. case "utf-8":
  32335. case "ascii":
  32336. case "latin1":
  32337. case "binary":
  32338. case "base64":
  32339. case "ucs2":
  32340. case "ucs-2":
  32341. case "utf16le":
  32342. case "utf-16le":
  32343. return !0;
  32344. default:
  32345. return !1
  32346. }
  32347. }
  32348. ,
  32349. a.concat = function(e, t) {
  32350. if (!$(e))
  32351. throw new TypeError('"list" argument must be an Array of Buffers');
  32352. if (0 === e.length)
  32353. return a.alloc(0);
  32354. var i;
  32355. if (void 0 === t)
  32356. for (t = 0,
  32357. i = 0; i < e.length; ++i)
  32358. t += e[i].length;
  32359. var n = a.allocUnsafe(t)
  32360. , r = 0;
  32361. for (i = 0; i < e.length; ++i) {
  32362. var o = e[i];
  32363. if (!a.isBuffer(o))
  32364. throw new TypeError('"list" argument must be an Array of Buffers');
  32365. o.copy(n, r),
  32366. r += o.length
  32367. }
  32368. return n
  32369. }
  32370. ,
  32371. a.byteLength = v,
  32372. a.prototype._isBuffer = !0,
  32373. a.prototype.swap16 = function() {
  32374. var e = this.length;
  32375. if (e % 2 !== 0)
  32376. throw new RangeError("Buffer size must be a multiple of 16-bits");
  32377. for (var t = 0; t < e; t += 2)
  32378. y(this, t, t + 1);
  32379. return this
  32380. }
  32381. ,
  32382. a.prototype.swap32 = function() {
  32383. var e = this.length;
  32384. if (e % 4 !== 0)
  32385. throw new RangeError("Buffer size must be a multiple of 32-bits");
  32386. for (var t = 0; t < e; t += 4)
  32387. y(this, t, t + 3),
  32388. y(this, t + 1, t + 2);
  32389. return this
  32390. }
  32391. ,
  32392. a.prototype.swap64 = function() {
  32393. var e = this.length;
  32394. if (e % 8 !== 0)
  32395. throw new RangeError("Buffer size must be a multiple of 64-bits");
  32396. for (var t = 0; t < e; t += 8)
  32397. y(this, t, t + 7),
  32398. y(this, t + 1, t + 6),
  32399. y(this, t + 2, t + 5),
  32400. y(this, t + 3, t + 4);
  32401. return this
  32402. }
  32403. ,
  32404. a.prototype.toString = function() {
  32405. var e = 0 | this.length;
  32406. return 0 === e ? "" : 0 === arguments.length ? M(this, 0, e) : A.apply(this, arguments)
  32407. }
  32408. ,
  32409. a.prototype.equals = function(e) {
  32410. if (!a.isBuffer(e))
  32411. throw new TypeError("Argument must be a Buffer");
  32412. return this === e || 0 === a.compare(this, e)
  32413. }
  32414. ,
  32415. a.prototype.inspect = function() {
  32416. var e = ""
  32417. , t = i.INSPECT_MAX_BYTES;
  32418. return this.length > 0 && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  32419. this.length > t && (e += " ... ")),
  32420. "<Buffer " + e + ">"
  32421. }
  32422. ,
  32423. a.prototype.compare = function(e, t, i, n, r) {
  32424. if (!a.isBuffer(e))
  32425. throw new TypeError("Argument must be a Buffer");
  32426. if (void 0 === t && (t = 0),
  32427. void 0 === i && (i = e ? e.length : 0),
  32428. void 0 === n && (n = 0),
  32429. void 0 === r && (r = this.length),
  32430. t < 0 || i > e.length || n < 0 || r > this.length)
  32431. throw new RangeError("out of range index");
  32432. if (n >= r && t >= i)
  32433. return 0;
  32434. if (n >= r)
  32435. return -1;
  32436. if (t >= i)
  32437. return 1;
  32438. if (t >>>= 0,
  32439. i >>>= 0,
  32440. n >>>= 0,
  32441. r >>>= 0,
  32442. this === e)
  32443. return 0;
  32444. for (var o = r - n, s = i - t, l = Math.min(o, s), c = this.slice(n, r), h = e.slice(t, i), u = 0; u < l; ++u)
  32445. if (c[u] !== h[u]) {
  32446. o = c[u],
  32447. s = h[u];
  32448. break
  32449. }
  32450. return o < s ? -1 : s < o ? 1 : 0
  32451. }
  32452. ,
  32453. a.prototype.includes = function(e, t, i) {
  32454. return this.indexOf(e, t, i) !== -1
  32455. }
  32456. ,
  32457. a.prototype.indexOf = function(e, t, i) {
  32458. return C(this, e, t, i, !0)
  32459. }
  32460. ,
  32461. a.prototype.lastIndexOf = function(e, t, i) {
  32462. return C(this, e, t, i, !1)
  32463. }
  32464. ,
  32465. a.prototype.write = function(e, t, i, n) {
  32466. if (void 0 === t)
  32467. n = "utf8",
  32468. i = this.length,
  32469. t = 0;
  32470. else if (void 0 === i && "string" == typeof t)
  32471. n = t,
  32472. i = this.length,
  32473. t = 0;
  32474. else {
  32475. if (!isFinite(t))
  32476. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  32477. t |= 0,
  32478. isFinite(i) ? (i |= 0,
  32479. void 0 === n && (n = "utf8")) : (n = i,
  32480. i = void 0)
  32481. }
  32482. var r = this.length - t;
  32483. if ((void 0 === i || i > r) && (i = r),
  32484. e.length > 0 && (i < 0 || t < 0) || t > this.length)
  32485. throw new RangeError("Attempt to write outside buffer bounds");
  32486. n || (n = "utf8");
  32487. for (var o = !1; ; )
  32488. switch (n) {
  32489. case "hex":
  32490. return E(this, e, t, i);
  32491. case "utf8":
  32492. case "utf-8":
  32493. return b(this, e, t, i);
  32494. case "ascii":
  32495. return w(this, e, t, i);
  32496. case "latin1":
  32497. case "binary":
  32498. return _(this, e, t, i);
  32499. case "base64":
  32500. return T(this, e, t, i);
  32501. case "ucs2":
  32502. case "ucs-2":
  32503. case "utf16le":
  32504. case "utf-16le":
  32505. return x(this, e, t, i);
  32506. default:
  32507. if (o)
  32508. throw new TypeError("Unknown encoding: " + n);
  32509. n = ("" + n).toLowerCase(),
  32510. o = !0
  32511. }
  32512. }
  32513. ,
  32514. a.prototype.toJSON = function() {
  32515. return {
  32516. type: "Buffer",
  32517. data: Array.prototype.slice.call(this._arr || this, 0)
  32518. }
  32519. }
  32520. ;
  32521. var ee = 4096;
  32522. a.prototype.slice = function(e, t) {
  32523. var i = this.length;
  32524. e = ~~e,
  32525. t = void 0 === t ? i : ~~t,
  32526. e < 0 ? (e += i,
  32527. e < 0 && (e = 0)) : e > i && (e = i),
  32528. t < 0 ? (t += i,
  32529. t < 0 && (t = 0)) : t > i && (t = i),
  32530. t < e && (t = e);
  32531. var n;
  32532. if (a.TYPED_ARRAY_SUPPORT)
  32533. n = this.subarray(e, t),
  32534. n.__proto__ = a.prototype;
  32535. else {
  32536. var r = t - e;
  32537. n = new a(r,void 0);
  32538. for (var o = 0; o < r; ++o)
  32539. n[o] = this[o + e]
  32540. }
  32541. return n
  32542. }
  32543. ,
  32544. a.prototype.readUIntLE = function(e, t, i) {
  32545. e |= 0,
  32546. t |= 0,
  32547. i || N(e, t, this.length);
  32548. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  32549. n += this[e + o] * r;
  32550. return n
  32551. }
  32552. ,
  32553. a.prototype.readUIntBE = function(e, t, i) {
  32554. e |= 0,
  32555. t |= 0,
  32556. i || N(e, t, this.length);
  32557. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); )
  32558. n += this[e + --t] * r;
  32559. return n
  32560. }
  32561. ,
  32562. a.prototype.readUInt8 = function(e, t) {
  32563. return t || N(e, 1, this.length),
  32564. this[e]
  32565. }
  32566. ,
  32567. a.prototype.readUInt16LE = function(e, t) {
  32568. return t || N(e, 2, this.length),
  32569. this[e] | this[e + 1] << 8
  32570. }
  32571. ,
  32572. a.prototype.readUInt16BE = function(e, t) {
  32573. return t || N(e, 2, this.length),
  32574. this[e] << 8 | this[e + 1]
  32575. }
  32576. ,
  32577. a.prototype.readUInt32LE = function(e, t) {
  32578. return t || N(e, 4, this.length),
  32579. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  32580. }
  32581. ,
  32582. a.prototype.readUInt32BE = function(e, t) {
  32583. return t || N(e, 4, this.length),
  32584. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  32585. }
  32586. ,
  32587. a.prototype.readIntLE = function(e, t, i) {
  32588. e |= 0,
  32589. t |= 0,
  32590. i || N(e, t, this.length);
  32591. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  32592. n += this[e + o] * r;
  32593. return r *= 128,
  32594. n >= r && (n -= Math.pow(2, 8 * t)),
  32595. n
  32596. }
  32597. ,
  32598. a.prototype.readIntBE = function(e, t, i) {
  32599. e |= 0,
  32600. t |= 0,
  32601. i || N(e, t, this.length);
  32602. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); )
  32603. o += this[e + --n] * r;
  32604. return r *= 128,
  32605. o >= r && (o -= Math.pow(2, 8 * t)),
  32606. o
  32607. }
  32608. ,
  32609. a.prototype.readInt8 = function(e, t) {
  32610. return t || N(e, 1, this.length),
  32611. 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e]
  32612. }
  32613. ,
  32614. a.prototype.readInt16LE = function(e, t) {
  32615. t || N(e, 2, this.length);
  32616. var i = this[e] | this[e + 1] << 8;
  32617. return 32768 & i ? 4294901760 | i : i
  32618. }
  32619. ,
  32620. a.prototype.readInt16BE = function(e, t) {
  32621. t || N(e, 2, this.length);
  32622. var i = this[e + 1] | this[e] << 8;
  32623. return 32768 & i ? 4294901760 | i : i
  32624. }
  32625. ,
  32626. a.prototype.readInt32LE = function(e, t) {
  32627. return t || N(e, 4, this.length),
  32628. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  32629. }
  32630. ,
  32631. a.prototype.readInt32BE = function(e, t) {
  32632. return t || N(e, 4, this.length),
  32633. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  32634. }
  32635. ,
  32636. a.prototype.readFloatLE = function(e, t) {
  32637. return t || N(e, 4, this.length),
  32638. J.read(this, e, !0, 23, 4)
  32639. }
  32640. ,
  32641. a.prototype.readFloatBE = function(e, t) {
  32642. return t || N(e, 4, this.length),
  32643. J.read(this, e, !1, 23, 4)
  32644. }
  32645. ,
  32646. a.prototype.readDoubleLE = function(e, t) {
  32647. return t || N(e, 8, this.length),
  32648. J.read(this, e, !0, 52, 8)
  32649. }
  32650. ,
  32651. a.prototype.readDoubleBE = function(e, t) {
  32652. return t || N(e, 8, this.length),
  32653. J.read(this, e, !1, 52, 8)
  32654. }
  32655. ,
  32656. a.prototype.writeUIntLE = function(e, t, i, n) {
  32657. if (e = +e,
  32658. t |= 0,
  32659. i |= 0,
  32660. !n) {
  32661. var r = Math.pow(2, 8 * i) - 1;
  32662. B(this, e, t, i, r, 0)
  32663. }
  32664. var o = 1
  32665. , a = 0;
  32666. for (this[t] = 255 & e; ++a < i && (o *= 256); )
  32667. this[t + a] = e / o & 255;
  32668. return t + i
  32669. }
  32670. ,
  32671. a.prototype.writeUIntBE = function(e, t, i, n) {
  32672. if (e = +e,
  32673. t |= 0,
  32674. i |= 0,
  32675. !n) {
  32676. var r = Math.pow(2, 8 * i) - 1;
  32677. B(this, e, t, i, r, 0)
  32678. }
  32679. var o = i - 1
  32680. , a = 1;
  32681. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  32682. this[t + o] = e / a & 255;
  32683. return t + i
  32684. }
  32685. ,
  32686. a.prototype.writeUInt8 = function(e, t, i) {
  32687. return e = +e,
  32688. t |= 0,
  32689. i || B(this, e, t, 1, 255, 0),
  32690. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  32691. this[t] = 255 & e,
  32692. t + 1
  32693. }
  32694. ,
  32695. a.prototype.writeUInt16LE = function(e, t, i) {
  32696. return e = +e,
  32697. t |= 0,
  32698. i || B(this, e, t, 2, 65535, 0),
  32699. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  32700. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  32701. t + 2
  32702. }
  32703. ,
  32704. a.prototype.writeUInt16BE = function(e, t, i) {
  32705. return e = +e,
  32706. t |= 0,
  32707. i || B(this, e, t, 2, 65535, 0),
  32708. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  32709. this[t + 1] = 255 & e) : F(this, e, t, !1),
  32710. t + 2
  32711. }
  32712. ,
  32713. a.prototype.writeUInt32LE = function(e, t, i) {
  32714. return e = +e,
  32715. t |= 0,
  32716. i || B(this, e, t, 4, 4294967295, 0),
  32717. a.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  32718. this[t + 2] = e >>> 16,
  32719. this[t + 1] = e >>> 8,
  32720. this[t] = 255 & e) : V(this, e, t, !0),
  32721. t + 4
  32722. }
  32723. ,
  32724. a.prototype.writeUInt32BE = function(e, t, i) {
  32725. return e = +e,
  32726. t |= 0,
  32727. i || B(this, e, t, 4, 4294967295, 0),
  32728. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  32729. this[t + 1] = e >>> 16,
  32730. this[t + 2] = e >>> 8,
  32731. this[t + 3] = 255 & e) : V(this, e, t, !1),
  32732. t + 4
  32733. }
  32734. ,
  32735. a.prototype.writeIntLE = function(e, t, i, n) {
  32736. if (e = +e,
  32737. t |= 0,
  32738. !n) {
  32739. var r = Math.pow(2, 8 * i - 1);
  32740. B(this, e, t, i, r - 1, -r)
  32741. }
  32742. var o = 0
  32743. , a = 1
  32744. , s = 0;
  32745. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  32746. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  32747. this[t + o] = (e / a >> 0) - s & 255;
  32748. return t + i
  32749. }
  32750. ,
  32751. a.prototype.writeIntBE = function(e, t, i, n) {
  32752. if (e = +e,
  32753. t |= 0,
  32754. !n) {
  32755. var r = Math.pow(2, 8 * i - 1);
  32756. B(this, e, t, i, r - 1, -r)
  32757. }
  32758. var o = i - 1
  32759. , a = 1
  32760. , s = 0;
  32761. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  32762. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  32763. this[t + o] = (e / a >> 0) - s & 255;
  32764. return t + i
  32765. }
  32766. ,
  32767. a.prototype.writeInt8 = function(e, t, i) {
  32768. return e = +e,
  32769. t |= 0,
  32770. i || B(this, e, t, 1, 127, -128),
  32771. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  32772. e < 0 && (e = 255 + e + 1),
  32773. this[t] = 255 & e,
  32774. t + 1
  32775. }
  32776. ,
  32777. a.prototype.writeInt16LE = function(e, t, i) {
  32778. return e = +e,
  32779. t |= 0,
  32780. i || B(this, e, t, 2, 32767, -32768),
  32781. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  32782. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  32783. t + 2
  32784. }
  32785. ,
  32786. a.prototype.writeInt16BE = function(e, t, i) {
  32787. return e = +e,
  32788. t |= 0,
  32789. i || B(this, e, t, 2, 32767, -32768),
  32790. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  32791. this[t + 1] = 255 & e) : F(this, e, t, !1),
  32792. t + 2
  32793. }
  32794. ,
  32795. a.prototype.writeInt32LE = function(e, t, i) {
  32796. return e = +e,
  32797. t |= 0,
  32798. i || B(this, e, t, 4, 2147483647, -2147483648),
  32799. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  32800. this[t + 1] = e >>> 8,
  32801. this[t + 2] = e >>> 16,
  32802. this[t + 3] = e >>> 24) : V(this, e, t, !0),
  32803. t + 4
  32804. }
  32805. ,
  32806. a.prototype.writeInt32BE = function(e, t, i) {
  32807. return e = +e,
  32808. t |= 0,
  32809. i || B(this, e, t, 4, 2147483647, -2147483648),
  32810. e < 0 && (e = 4294967295 + e + 1),
  32811. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  32812. this[t + 1] = e >>> 16,
  32813. this[t + 2] = e >>> 8,
  32814. this[t + 3] = 255 & e) : V(this, e, t, !1),
  32815. t + 4
  32816. }
  32817. ,
  32818. a.prototype.writeFloatLE = function(e, t, i) {
  32819. return k(this, e, t, !0, i)
  32820. }
  32821. ,
  32822. a.prototype.writeFloatBE = function(e, t, i) {
  32823. return k(this, e, t, !1, i)
  32824. }
  32825. ,
  32826. a.prototype.writeDoubleLE = function(e, t, i) {
  32827. return H(this, e, t, !0, i)
  32828. }
  32829. ,
  32830. a.prototype.writeDoubleBE = function(e, t, i) {
  32831. return H(this, e, t, !1, i)
  32832. }
  32833. ,
  32834. a.prototype.copy = function(e, t, i, n) {
  32835. if (i || (i = 0),
  32836. n || 0 === n || (n = this.length),
  32837. t >= e.length && (t = e.length),
  32838. t || (t = 0),
  32839. n > 0 && n < i && (n = i),
  32840. n === i)
  32841. return 0;
  32842. if (0 === e.length || 0 === this.length)
  32843. return 0;
  32844. if (t < 0)
  32845. throw new RangeError("targetStart out of bounds");
  32846. if (i < 0 || i >= this.length)
  32847. throw new RangeError("sourceStart out of bounds");
  32848. if (n < 0)
  32849. throw new RangeError("sourceEnd out of bounds");
  32850. n > this.length && (n = this.length),
  32851. e.length - t < n - i && (n = e.length - t + i);
  32852. var r, o = n - i;
  32853. if (this === e && i < t && t < n)
  32854. for (r = o - 1; r >= 0; --r)
  32855. e[r + t] = this[r + i];
  32856. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
  32857. for (r = 0; r < o; ++r)
  32858. e[r + t] = this[r + i];
  32859. else
  32860. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  32861. return o
  32862. }
  32863. ,
  32864. a.prototype.fill = function(e, t, i, n) {
  32865. if ("string" == typeof e) {
  32866. if ("string" == typeof t ? (n = t,
  32867. t = 0,
  32868. i = this.length) : "string" == typeof i && (n = i,
  32869. i = this.length),
  32870. 1 === e.length) {
  32871. var r = e.charCodeAt(0);
  32872. r < 256 && (e = r)
  32873. }
  32874. if (void 0 !== n && "string" != typeof n)
  32875. throw new TypeError("encoding must be a string");
  32876. if ("string" == typeof n && !a.isEncoding(n))
  32877. throw new TypeError("Unknown encoding: " + n)
  32878. } else
  32879. "number" == typeof e && (e &= 255);
  32880. if (t < 0 || this.length < t || this.length < i)
  32881. throw new RangeError("Out of range index");
  32882. if (i <= t)
  32883. return this;
  32884. t >>>= 0,
  32885. i = void 0 === i ? this.length : i >>> 0,
  32886. e || (e = 0);
  32887. var o;
  32888. if ("number" == typeof e)
  32889. for (o = t; o < i; ++o)
  32890. this[o] = e;
  32891. else {
  32892. var s = a.isBuffer(e) ? e : j(new a(e,n).toString())
  32893. , l = s.length;
  32894. for (o = 0; o < i - t; ++o)
  32895. this[o + t] = s[o % l]
  32896. }
  32897. return this
  32898. }
  32899. ;
  32900. var te = /[^+\/0-9A-Za-z-_]/g
  32901. }
  32902. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  32903. }
  32904. , {
  32905. "base64-js": 199,
  32906. ieee754: 200,
  32907. isarray: 201
  32908. }],
  32909. 199: [function(e, t, i) {
  32910. "use strict";
  32911. function n(e) {
  32912. var t = e.length;
  32913. if (t % 4 > 0)
  32914. throw new Error("Invalid string. Length must be a multiple of 4");
  32915. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  32916. }
  32917. function r(e) {
  32918. return 3 * e.length / 4 - n(e)
  32919. }
  32920. function o(e) {
  32921. var t, i, r, o, a, s, l = e.length;
  32922. a = n(e),
  32923. s = new u(3 * l / 4 - a),
  32924. r = a > 0 ? l - 4 : l;
  32925. var c = 0;
  32926. for (t = 0,
  32927. i = 0; t < r; t += 4,
  32928. i += 3)
  32929. o = h[e.charCodeAt(t)] << 18 | h[e.charCodeAt(t + 1)] << 12 | h[e.charCodeAt(t + 2)] << 6 | h[e.charCodeAt(t + 3)],
  32930. s[c++] = o >> 16 & 255,
  32931. s[c++] = o >> 8 & 255,
  32932. s[c++] = 255 & o;
  32933. return 2 === a ? (o = h[e.charCodeAt(t)] << 2 | h[e.charCodeAt(t + 1)] >> 4,
  32934. s[c++] = 255 & o) : 1 === a && (o = h[e.charCodeAt(t)] << 10 | h[e.charCodeAt(t + 1)] << 4 | h[e.charCodeAt(t + 2)] >> 2,
  32935. s[c++] = o >> 8 & 255,
  32936. s[c++] = 255 & o),
  32937. s
  32938. }
  32939. function a(e) {
  32940. return c[e >> 18 & 63] + c[e >> 12 & 63] + c[e >> 6 & 63] + c[63 & e]
  32941. }
  32942. function s(e, t, i) {
  32943. for (var n, r = [], o = t; o < i; o += 3)
  32944. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  32945. r.push(a(n));
  32946. return r.join("")
  32947. }
  32948. function l(e) {
  32949. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 16383, l = 0, h = i - n; l < h; l += a)
  32950. o.push(s(e, l, l + a > h ? h : l + a));
  32951. return 1 === n ? (t = e[i - 1],
  32952. r += c[t >> 2],
  32953. r += c[t << 4 & 63],
  32954. r += "==") : 2 === n && (t = (e[i - 2] << 8) + e[i - 1],
  32955. r += c[t >> 10],
  32956. r += c[t >> 4 & 63],
  32957. r += c[t << 2 & 63],
  32958. r += "="),
  32959. o.push(r),
  32960. o.join("")
  32961. }
  32962. i.byteLength = r,
  32963. i.toByteArray = o,
  32964. i.fromByteArray = l;
  32965. for (var c = [], h = [], u = "undefined" != typeof Uint8Array ? Uint8Array : Array, d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", p = 0, f = d.length; p < f; ++p)
  32966. c[p] = d[p],
  32967. h[d.charCodeAt(p)] = p;
  32968. h["-".charCodeAt(0)] = 62,
  32969. h["_".charCodeAt(0)] = 63
  32970. }
  32971. , {}],
  32972. 200: [function(e, t, i) {
  32973. i.read = function(e, t, i, n, r) {
  32974. 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];
  32975. for (u += d,
  32976. o = p & (1 << -h) - 1,
  32977. p >>= -h,
  32978. h += s; h > 0; o = 256 * o + e[t + u],
  32979. u += d,
  32980. h -= 8)
  32981. ;
  32982. for (a = o & (1 << -h) - 1,
  32983. o >>= -h,
  32984. h += n; h > 0; a = 256 * a + e[t + u],
  32985. u += d,
  32986. h -= 8)
  32987. ;
  32988. if (0 === o)
  32989. o = 1 - c;
  32990. else {
  32991. if (o === l)
  32992. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  32993. a += Math.pow(2, n),
  32994. o -= c
  32995. }
  32996. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  32997. }
  32998. ,
  32999. i.write = function(e, t, i, n, r, o) {
  33000. 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;
  33001. for (t = Math.abs(t),
  33002. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  33003. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  33004. t * (l = Math.pow(2, -a)) < 1 && (a--,
  33005. l *= 2),
  33006. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  33007. t * l >= 2 && (a++,
  33008. l /= 2),
  33009. a + u >= h ? (s = 0,
  33010. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  33011. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  33012. a = 0)); r >= 8; e[i + p] = 255 & s,
  33013. p += f,
  33014. s /= 256,
  33015. r -= 8)
  33016. ;
  33017. for (a = a << r | s,
  33018. c += r; c > 0; e[i + p] = 255 & a,
  33019. p += f,
  33020. a /= 256,
  33021. c -= 8)
  33022. ;
  33023. e[i + p - f] |= 128 * g
  33024. }
  33025. }
  33026. , {}],
  33027. 201: [function(e, t, i) {
  33028. var n = {}.toString;
  33029. t.exports = Array.isArray || function(e) {
  33030. return "[object Array]" == n.call(e)
  33031. }
  33032. }
  33033. , {}],
  33034. 202: [function(e, t, i) {
  33035. function n() {
  33036. this._events = this._events || {},
  33037. this._maxListeners = this._maxListeners || void 0
  33038. }
  33039. function r(e) {
  33040. return "function" == typeof e
  33041. }
  33042. function o(e) {
  33043. return "number" == typeof e
  33044. }
  33045. function a(e) {
  33046. return "object" == typeof e && null !== e
  33047. }
  33048. function s(e) {
  33049. return void 0 === e
  33050. }
  33051. t.exports = n,
  33052. n.EventEmitter = n,
  33053. n.prototype._events = void 0,
  33054. n.prototype._maxListeners = void 0,
  33055. n.defaultMaxListeners = 10,
  33056. n.prototype.setMaxListeners = function(e) {
  33057. if (!o(e) || e < 0 || isNaN(e))
  33058. throw TypeError("n must be a positive number");
  33059. return this._maxListeners = e,
  33060. this
  33061. }
  33062. ,
  33063. n.prototype.emit = function(e) {
  33064. var t, i, n, o, l, c;
  33065. if (this._events || (this._events = {}),
  33066. "error" === e && (!this._events.error || a(this._events.error) && !this._events.error.length)) {
  33067. if (t = arguments[1],
  33068. t instanceof Error)
  33069. throw t;
  33070. var h = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  33071. throw h.context = t,
  33072. h
  33073. }
  33074. if (i = this._events[e],
  33075. s(i))
  33076. return !1;
  33077. if (r(i))
  33078. switch (arguments.length) {
  33079. case 1:
  33080. i.call(this);
  33081. break;
  33082. case 2:
  33083. i.call(this, arguments[1]);
  33084. break;
  33085. case 3:
  33086. i.call(this, arguments[1], arguments[2]);
  33087. break;
  33088. default:
  33089. o = Array.prototype.slice.call(arguments, 1),
  33090. i.apply(this, o)
  33091. }
  33092. else if (a(i))
  33093. for (o = Array.prototype.slice.call(arguments, 1),
  33094. c = i.slice(),
  33095. n = c.length,
  33096. l = 0; l < n; l++)
  33097. c[l].apply(this, o);
  33098. return !0
  33099. }
  33100. ,
  33101. n.prototype.addListener = function(e, t) {
  33102. var i;
  33103. if (!r(t))
  33104. throw TypeError("listener must be a function");
  33105. return this._events || (this._events = {}),
  33106. this._events.newListener && this.emit("newListener", e, r(t.listener) ? t.listener : t),
  33107. this._events[e] ? a(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  33108. a(this._events[e]) && !this._events[e].warned && (i = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners,
  33109. i && i > 0 && this._events[e].length > i && (this._events[e].warned = !0,
  33110. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  33111. "function" == typeof console.trace && console.trace())),
  33112. this
  33113. }
  33114. ,
  33115. n.prototype.on = n.prototype.addListener,
  33116. n.prototype.once = function(e, t) {
  33117. function i() {
  33118. this.removeListener(e, i),
  33119. n || (n = !0,
  33120. t.apply(this, arguments))
  33121. }
  33122. if (!r(t))
  33123. throw TypeError("listener must be a function");
  33124. var n = !1;
  33125. return i.listener = t,
  33126. this.on(e, i),
  33127. this
  33128. }
  33129. ,
  33130. n.prototype.removeListener = function(e, t) {
  33131. var i, n, o, s;
  33132. if (!r(t))
  33133. throw TypeError("listener must be a function");
  33134. if (!this._events || !this._events[e])
  33135. return this;
  33136. if (i = this._events[e],
  33137. o = i.length,
  33138. n = -1,
  33139. i === t || r(i.listener) && i.listener === t)
  33140. delete this._events[e],
  33141. this._events.removeListener && this.emit("removeListener", e, t);
  33142. else if (a(i)) {
  33143. for (s = o; s-- > 0; )
  33144. if (i[s] === t || i[s].listener && i[s].listener === t) {
  33145. n = s;
  33146. break
  33147. }
  33148. if (n < 0)
  33149. return this;
  33150. 1 === i.length ? (i.length = 0,
  33151. delete this._events[e]) : i.splice(n, 1),
  33152. this._events.removeListener && this.emit("removeListener", e, t)
  33153. }
  33154. return this
  33155. }
  33156. ,
  33157. n.prototype.removeAllListeners = function(e) {
  33158. var t, i;
  33159. if (!this._events)
  33160. return this;
  33161. if (!this._events.removeListener)
  33162. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  33163. this;
  33164. if (0 === arguments.length) {
  33165. for (t in this._events)
  33166. "removeListener" !== t && this.removeAllListeners(t);
  33167. return this.removeAllListeners("removeListener"),
  33168. this._events = {},
  33169. this
  33170. }
  33171. if (i = this._events[e],
  33172. r(i))
  33173. this.removeListener(e, i);
  33174. else if (i)
  33175. for (; i.length; )
  33176. this.removeListener(e, i[i.length - 1]);
  33177. return delete this._events[e],
  33178. this
  33179. }
  33180. ,
  33181. n.prototype.listeners = function(e) {
  33182. var t;
  33183. return t = this._events && this._events[e] ? r(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  33184. }
  33185. ,
  33186. n.prototype.listenerCount = function(e) {
  33187. if (this._events) {
  33188. var t = this._events[e];
  33189. if (r(t))
  33190. return 1;
  33191. if (t)
  33192. return t.length
  33193. }
  33194. return 0
  33195. }
  33196. ,
  33197. n.listenerCount = function(e, t) {
  33198. return e.listenerCount(t)
  33199. }
  33200. }
  33201. , {}],
  33202. 203: [function(e, t, i) {
  33203. function n() {
  33204. throw new Error("setTimeout has not been defined")
  33205. }
  33206. function r() {
  33207. throw new Error("clearTimeout has not been defined")
  33208. }
  33209. function o(e) {
  33210. if (u === setTimeout)
  33211. return setTimeout(e, 0);
  33212. if ((u === n || !u) && setTimeout)
  33213. return u = setTimeout,
  33214. setTimeout(e, 0);
  33215. try {
  33216. return u(e, 0)
  33217. } catch (t) {
  33218. try {
  33219. return u.call(null, e, 0)
  33220. } catch (t) {
  33221. return u.call(this, e, 0)
  33222. }
  33223. }
  33224. }
  33225. function a(e) {
  33226. if (d === clearTimeout)
  33227. return clearTimeout(e);
  33228. if ((d === r || !d) && clearTimeout)
  33229. return d = clearTimeout,
  33230. clearTimeout(e);
  33231. try {
  33232. return d(e)
  33233. } catch (t) {
  33234. try {
  33235. return d.call(null, e)
  33236. } catch (t) {
  33237. return d.call(this, e)
  33238. }
  33239. }
  33240. }
  33241. function s() {
  33242. m && f && (m = !1,
  33243. f.length ? g = f.concat(g) : v = -1,
  33244. g.length && l())
  33245. }
  33246. function l() {
  33247. if (!m) {
  33248. var e = o(s);
  33249. m = !0;
  33250. for (var t = g.length; t; ) {
  33251. for (f = g,
  33252. g = []; ++v < t; )
  33253. f && f[v].run();
  33254. v = -1,
  33255. t = g.length
  33256. }
  33257. f = null,
  33258. m = !1,
  33259. a(e)
  33260. }
  33261. }
  33262. function c(e, t) {
  33263. this.fun = e,
  33264. this.array = t
  33265. }
  33266. function h() {}
  33267. var u, d, p = t.exports = {};
  33268. !function() {
  33269. try {
  33270. u = "function" == typeof setTimeout ? setTimeout : n
  33271. } catch (e) {
  33272. u = n
  33273. }
  33274. try {
  33275. d = "function" == typeof clearTimeout ? clearTimeout : r
  33276. } catch (e) {
  33277. d = r
  33278. }
  33279. }();
  33280. var f, g = [], m = !1, v = -1;
  33281. p.nextTick = function(e) {
  33282. var t = new Array(arguments.length - 1);
  33283. if (arguments.length > 1)
  33284. for (var i = 1; i < arguments.length; i++)
  33285. t[i - 1] = arguments[i];
  33286. g.push(new c(e,t)),
  33287. 1 !== g.length || m || o(l)
  33288. }
  33289. ,
  33290. c.prototype.run = function() {
  33291. this.fun.apply(null, this.array)
  33292. }
  33293. ,
  33294. p.title = "browser",
  33295. p.browser = !0,
  33296. p.env = {},
  33297. p.argv = [],
  33298. p.version = "",
  33299. p.versions = {},
  33300. p.on = h,
  33301. p.addListener = h,
  33302. p.once = h,
  33303. p.off = h,
  33304. p.removeListener = h,
  33305. p.removeAllListeners = h,
  33306. p.emit = h,
  33307. p.binding = function(e) {
  33308. throw new Error("process.binding is not supported")
  33309. }
  33310. ,
  33311. p.cwd = function() {
  33312. return "/"
  33313. }
  33314. ,
  33315. p.chdir = function(e) {
  33316. throw new Error("process.chdir is not supported")
  33317. }
  33318. ,
  33319. p.umask = function() {
  33320. return 0
  33321. }
  33322. }
  33323. , {}],
  33324. 204: [function(e, t, i) {
  33325. (function(e) {
  33326. !function(n) {
  33327. function r(e) {
  33328. throw new RangeError(L[e])
  33329. }
  33330. function o(e, t) {
  33331. for (var i = e.length, n = []; i--; )
  33332. n[i] = t(e[i]);
  33333. return n
  33334. }
  33335. function a(e, t) {
  33336. var i = e.split("@")
  33337. , n = "";
  33338. i.length > 1 && (n = i[0] + "@",
  33339. e = i[1]),
  33340. e = e.replace(O, ".");
  33341. var r = e.split(".")
  33342. , a = o(r, t).join(".");
  33343. return n + a
  33344. }
  33345. function s(e) {
  33346. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  33347. t = e.charCodeAt(r++),
  33348. t >= 55296 && t <= 56319 && r < o ? (i = e.charCodeAt(r++),
  33349. 56320 == (64512 & i) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  33350. r--)) : n.push(t);
  33351. return n
  33352. }
  33353. function l(e) {
  33354. return o(e, function(e) {
  33355. var t = "";
  33356. return e > 65535 && (e -= 65536,
  33357. t += B(e >>> 10 & 1023 | 55296),
  33358. e = 56320 | 1023 & e),
  33359. t += B(e)
  33360. }).join("")
  33361. }
  33362. function c(e) {
  33363. return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E
  33364. }
  33365. function h(e, t) {
  33366. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  33367. }
  33368. function u(e, t, i) {
  33369. var n = 0;
  33370. for (e = i ? N(e / T) : e >> 1,
  33371. e += N(e / t); e > D * w >> 1; n += E)
  33372. e = N(e / D);
  33373. return N(n + (D + 1) * e / (e + _))
  33374. }
  33375. function d(e) {
  33376. var t, i, n, o, a, s, h, d, p, f, g = [], m = e.length, v = 0, A = S, y = x;
  33377. for (i = e.lastIndexOf(M),
  33378. i < 0 && (i = 0),
  33379. n = 0; n < i; ++n)
  33380. e.charCodeAt(n) >= 128 && r("not-basic"),
  33381. g.push(e.charCodeAt(n));
  33382. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  33383. for (a = v,
  33384. s = 1,
  33385. h = E; o >= m && r("invalid-input"),
  33386. d = c(e.charCodeAt(o++)),
  33387. (d >= E || d > N((I - v) / s)) && r("overflow"),
  33388. v += d * s,
  33389. p = h <= y ? b : h >= y + w ? w : h - y,
  33390. !(d < p); h += E)
  33391. f = E - p,
  33392. s > N(I / f) && r("overflow"),
  33393. s *= f;
  33394. t = g.length + 1,
  33395. y = u(v - a, t, 0 == a),
  33396. N(v / t) > I - A && r("overflow"),
  33397. A += N(v / t),
  33398. v %= t,
  33399. g.splice(v++, 0, A)
  33400. }
  33401. return l(g)
  33402. }
  33403. function p(e) {
  33404. var t, i, n, o, a, l, c, d, p, f, g, m, v, A, y, C = [];
  33405. for (e = s(e),
  33406. m = e.length,
  33407. t = S,
  33408. i = 0,
  33409. a = x,
  33410. l = 0; l < m; ++l)
  33411. g = e[l],
  33412. g < 128 && C.push(B(g));
  33413. for (n = o = C.length,
  33414. o && C.push(M); n < m; ) {
  33415. for (c = I,
  33416. l = 0; l < m; ++l)
  33417. g = e[l],
  33418. g >= t && g < c && (c = g);
  33419. for (v = n + 1,
  33420. c - t > N((I - i) / v) && r("overflow"),
  33421. i += (c - t) * v,
  33422. t = c,
  33423. l = 0; l < m; ++l)
  33424. if (g = e[l],
  33425. g < t && ++i > I && r("overflow"),
  33426. g == t) {
  33427. for (d = i,
  33428. p = E; f = p <= a ? b : p >= a + w ? w : p - a,
  33429. !(d < f); p += E)
  33430. y = d - f,
  33431. A = E - f,
  33432. C.push(B(h(f + y % A, 0))),
  33433. d = N(y / A);
  33434. C.push(B(h(d, 0))),
  33435. a = u(i, v, n == o),
  33436. i = 0,
  33437. ++n
  33438. }
  33439. ++i,
  33440. ++t
  33441. }
  33442. return C.join("")
  33443. }
  33444. function f(e) {
  33445. return a(e, function(e) {
  33446. return R.test(e) ? d(e.slice(4).toLowerCase()) : e
  33447. })
  33448. }
  33449. function g(e) {
  33450. return a(e, function(e) {
  33451. return P.test(e) ? "xn--" + p(e) : e
  33452. })
  33453. }
  33454. var m = "object" == typeof i && i && !i.nodeType && i
  33455. , v = "object" == typeof t && t && !t.nodeType && t
  33456. , A = "object" == typeof e && e;
  33457. A.global !== A && A.window !== A && A.self !== A || (n = A);
  33458. var y, C, I = 2147483647, E = 36, b = 1, w = 26, _ = 38, T = 700, x = 72, S = 128, M = "-", R = /^xn--/, P = /[^\x20-\x7E]/, O = /[\x2E\u3002\uFF0E\uFF61]/g, L = {
  33459. overflow: "Overflow: input needs wider integers to process",
  33460. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  33461. "invalid-input": "Invalid input"
  33462. }, D = E - b, N = Math.floor, B = String.fromCharCode;
  33463. if (y = {
  33464. version: "1.4.1",
  33465. ucs2: {
  33466. decode: s,
  33467. encode: l
  33468. },
  33469. decode: d,
  33470. encode: p,
  33471. toASCII: g,
  33472. toUnicode: f
  33473. },
  33474. "function" == typeof define && "object" == typeof define.amd && define.amd)
  33475. define("punycode", function() {
  33476. return y
  33477. });
  33478. else if (m && v)
  33479. if (t.exports == m)
  33480. v.exports = y;
  33481. else
  33482. for (C in y)
  33483. y.hasOwnProperty(C) && (m[C] = y[C]);
  33484. else
  33485. n.punycode = y
  33486. }(this)
  33487. }
  33488. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  33489. }
  33490. , {}],
  33491. 205: [function(e, t, i) {
  33492. "use strict";
  33493. function n(e, t) {
  33494. return Object.prototype.hasOwnProperty.call(e, t)
  33495. }
  33496. t.exports = function(e, t, i, o) {
  33497. t = t || "&",
  33498. i = i || "=";
  33499. var a = {};
  33500. if ("string" != typeof e || 0 === e.length)
  33501. return a;
  33502. var s = /\+/g;
  33503. e = e.split(t);
  33504. var l = 1e3;
  33505. o && "number" == typeof o.maxKeys && (l = o.maxKeys);
  33506. var c = e.length;
  33507. l > 0 && c > l && (c = l);
  33508. for (var h = 0; h < c; ++h) {
  33509. var u, d, p, f, g = e[h].replace(s, "%20"), m = g.indexOf(i);
  33510. m >= 0 ? (u = g.substr(0, m),
  33511. d = g.substr(m + 1)) : (u = g,
  33512. d = ""),
  33513. p = decodeURIComponent(u),
  33514. f = decodeURIComponent(d),
  33515. n(a, p) ? r(a[p]) ? a[p].push(f) : a[p] = [a[p], f] : a[p] = f
  33516. }
  33517. return a
  33518. }
  33519. ;
  33520. var r = Array.isArray || function(e) {
  33521. return "[object Array]" === Object.prototype.toString.call(e)
  33522. }
  33523. }
  33524. , {}],
  33525. 206: [function(e, t, i) {
  33526. "use strict";
  33527. function n(e, t) {
  33528. if (e.map)
  33529. return e.map(t);
  33530. for (var i = [], n = 0; n < e.length; n++)
  33531. i.push(t(e[n], n));
  33532. return i
  33533. }
  33534. var r = function(e) {
  33535. switch (typeof e) {
  33536. case "string":
  33537. return e;
  33538. case "boolean":
  33539. return e ? "true" : "false";
  33540. case "number":
  33541. return isFinite(e) ? e : "";
  33542. default:
  33543. return ""
  33544. }
  33545. };
  33546. t.exports = function(e, t, i, s) {
  33547. return t = t || "&",
  33548. i = i || "=",
  33549. null === e && (e = void 0),
  33550. "object" == typeof e ? n(a(e), function(a) {
  33551. var s = encodeURIComponent(r(a)) + i;
  33552. return o(e[a]) ? n(e[a], function(e) {
  33553. return s + encodeURIComponent(r(e))
  33554. }).join(t) : s + encodeURIComponent(r(e[a]))
  33555. }).join(t) : s ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e)) : ""
  33556. }
  33557. ;
  33558. var o = Array.isArray || function(e) {
  33559. return "[object Array]" === Object.prototype.toString.call(e)
  33560. }
  33561. , a = Object.keys || function(e) {
  33562. var t = [];
  33563. for (var i in e)
  33564. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  33565. return t
  33566. }
  33567. }
  33568. , {}],
  33569. 207: [function(e, t, i) {
  33570. "use strict";
  33571. i.decode = i.parse = e("./decode"),
  33572. i.encode = i.stringify = e("./encode")
  33573. }
  33574. , {
  33575. "./decode": 205,
  33576. "./encode": 206
  33577. }],
  33578. 208: [function(e, t, i) {
  33579. "use strict";
  33580. function n() {
  33581. this.protocol = null,
  33582. this.slashes = null,
  33583. this.auth = null,
  33584. this.host = null,
  33585. this.port = null,
  33586. this.hostname = null,
  33587. this.hash = null,
  33588. this.search = null,
  33589. this.query = null,
  33590. this.pathname = null,
  33591. this.path = null,
  33592. this.href = null
  33593. }
  33594. function r(e, t, i) {
  33595. if (e && c.isObject(e) && e instanceof n)
  33596. return e;
  33597. var r = new n;
  33598. return r.parse(e, t, i),
  33599. r
  33600. }
  33601. function o(e) {
  33602. return c.isString(e) && (e = r(e)),
  33603. e instanceof n ? e.format() : n.prototype.format.call(e)
  33604. }
  33605. function a(e, t) {
  33606. return r(e, !1, !0).resolve(t)
  33607. }
  33608. function s(e, t) {
  33609. return e ? r(e, !1, !0).resolveObject(t) : t
  33610. }
  33611. var l = e("punycode")
  33612. , c = e("./util");
  33613. i.parse = r,
  33614. i.resolve = a,
  33615. i.resolveObject = s,
  33616. i.format = o,
  33617. i.Url = n;
  33618. var h = /^([a-z0-9.+-]+:)/i
  33619. , u = /:[0-9]*$/
  33620. , d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  33621. , p = ["<", ">", '"', "`", " ", "\r", "\n", "\t"]
  33622. , f = ["{", "}", "|", "\\", "^", "`"].concat(p)
  33623. , g = ["'"].concat(f)
  33624. , m = ["%", "/", "?", ";", "#"].concat(g)
  33625. , v = ["/", "?", "#"]
  33626. , A = 255
  33627. , y = /^[+a-z0-9A-Z_-]{0,63}$/
  33628. , C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  33629. , I = {
  33630. javascript: !0,
  33631. "javascript:": !0
  33632. }
  33633. , E = {
  33634. javascript: !0,
  33635. "javascript:": !0
  33636. }
  33637. , b = {
  33638. http: !0,
  33639. https: !0,
  33640. ftp: !0,
  33641. gopher: !0,
  33642. file: !0,
  33643. "http:": !0,
  33644. "https:": !0,
  33645. "ftp:": !0,
  33646. "gopher:": !0,
  33647. "file:": !0
  33648. }
  33649. , w = e("querystring");
  33650. n.prototype.parse = function(e, t, i) {
  33651. if (!c.isString(e))
  33652. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  33653. var n = e.indexOf("?")
  33654. , r = n !== -1 && n < e.indexOf("#") ? "?" : "#"
  33655. , o = e.split(r)
  33656. , a = /\\/g;
  33657. o[0] = o[0].replace(a, "/"),
  33658. e = o.join(r);
  33659. var s = e;
  33660. if (s = s.trim(),
  33661. !i && 1 === e.split("#").length) {
  33662. var u = d.exec(s);
  33663. if (u)
  33664. return this.path = s,
  33665. this.href = s,
  33666. this.pathname = u[1],
  33667. u[2] ? (this.search = u[2],
  33668. t ? this.query = w.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : t && (this.search = "",
  33669. this.query = {}),
  33670. this
  33671. }
  33672. var p = h.exec(s);
  33673. if (p) {
  33674. p = p[0];
  33675. var f = p.toLowerCase();
  33676. this.protocol = f,
  33677. s = s.substr(p.length)
  33678. }
  33679. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  33680. var _ = "//" === s.substr(0, 2);
  33681. !_ || p && E[p] || (s = s.substr(2),
  33682. this.slashes = !0)
  33683. }
  33684. if (!E[p] && (_ || p && !b[p])) {
  33685. for (var T = -1, x = 0; x < v.length; x++) {
  33686. var S = s.indexOf(v[x]);
  33687. S !== -1 && (T === -1 || S < T) && (T = S)
  33688. }
  33689. var M, R;
  33690. R = T === -1 ? s.lastIndexOf("@") : s.lastIndexOf("@", T),
  33691. R !== -1 && (M = s.slice(0, R),
  33692. s = s.slice(R + 1),
  33693. this.auth = decodeURIComponent(M)),
  33694. T = -1;
  33695. for (var x = 0; x < m.length; x++) {
  33696. var S = s.indexOf(m[x]);
  33697. S !== -1 && (T === -1 || S < T) && (T = S)
  33698. }
  33699. T === -1 && (T = s.length),
  33700. this.host = s.slice(0, T),
  33701. s = s.slice(T),
  33702. this.parseHost(),
  33703. this.hostname = this.hostname || "";
  33704. var P = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  33705. if (!P)
  33706. for (var O = this.hostname.split(/\./), x = 0, L = O.length; x < L; x++) {
  33707. var D = O[x];
  33708. if (D && !D.match(y)) {
  33709. for (var N = "", B = 0, F = D.length; B < F; B++)
  33710. N += D.charCodeAt(B) > 127 ? "x" : D[B];
  33711. if (!N.match(y)) {
  33712. var V = O.slice(0, x)
  33713. , U = O.slice(x + 1)
  33714. , k = D.match(C);
  33715. k && (V.push(k[1]),
  33716. U.unshift(k[2])),
  33717. U.length && (s = "/" + U.join(".") + s),
  33718. this.hostname = V.join(".");
  33719. break
  33720. }
  33721. }
  33722. }
  33723. this.hostname.length > A ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  33724. P || (this.hostname = l.toASCII(this.hostname));
  33725. var H = this.port ? ":" + this.port : ""
  33726. , G = this.hostname || "";
  33727. this.host = G + H,
  33728. this.href += this.host,
  33729. P && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  33730. "/" !== s[0] && (s = "/" + s))
  33731. }
  33732. if (!I[f])
  33733. for (var x = 0, L = g.length; x < L; x++) {
  33734. var z = g[x];
  33735. if (s.indexOf(z) !== -1) {
  33736. var W = encodeURIComponent(z);
  33737. W === z && (W = escape(z)),
  33738. s = s.split(z).join(W)
  33739. }
  33740. }
  33741. var j = s.indexOf("#");
  33742. j !== -1 && (this.hash = s.substr(j),
  33743. s = s.slice(0, j));
  33744. var Y = s.indexOf("?");
  33745. if (Y !== -1 ? (this.search = s.substr(Y),
  33746. this.query = s.substr(Y + 1),
  33747. t && (this.query = w.parse(this.query)),
  33748. s = s.slice(0, Y)) : t && (this.search = "",
  33749. this.query = {}),
  33750. s && (this.pathname = s),
  33751. b[f] && this.hostname && !this.pathname && (this.pathname = "/"),
  33752. this.pathname || this.search) {
  33753. var H = this.pathname || ""
  33754. , X = this.search || "";
  33755. this.path = H + X
  33756. }
  33757. return this.href = this.format(),
  33758. this
  33759. }
  33760. ,
  33761. n.prototype.format = function() {
  33762. var e = this.auth || "";
  33763. e && (e = encodeURIComponent(e),
  33764. e = e.replace(/%3A/i, ":"),
  33765. e += "@");
  33766. var t = this.protocol || ""
  33767. , i = this.pathname || ""
  33768. , n = this.hash || ""
  33769. , r = !1
  33770. , o = "";
  33771. this.host ? r = e + this.host : this.hostname && (r = e + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"),
  33772. this.port && (r += ":" + this.port)),
  33773. this.query && c.isObject(this.query) && Object.keys(this.query).length && (o = w.stringify(this.query));
  33774. var a = this.search || o && "?" + o || "";
  33775. return t && ":" !== t.substr(-1) && (t += ":"),
  33776. this.slashes || (!t || b[t]) && r !== !1 ? (r = "//" + (r || ""),
  33777. i && "/" !== i.charAt(0) && (i = "/" + i)) : r || (r = ""),
  33778. n && "#" !== n.charAt(0) && (n = "#" + n),
  33779. a && "?" !== a.charAt(0) && (a = "?" + a),
  33780. i = i.replace(/[?#]/g, function(e) {
  33781. return encodeURIComponent(e)
  33782. }),
  33783. a = a.replace("#", "%23"),
  33784. t + r + i + a + n
  33785. }
  33786. ,
  33787. n.prototype.resolve = function(e) {
  33788. return this.resolveObject(r(e, !1, !0)).format()
  33789. }
  33790. ,
  33791. n.prototype.resolveObject = function(e) {
  33792. if (c.isString(e)) {
  33793. var t = new n;
  33794. t.parse(e, !1, !0),
  33795. e = t
  33796. }
  33797. for (var i = new n, r = Object.keys(this), o = 0; o < r.length; o++) {
  33798. var a = r[o];
  33799. i[a] = this[a]
  33800. }
  33801. if (i.hash = e.hash,
  33802. "" === e.href)
  33803. return i.href = i.format(),
  33804. i;
  33805. if (e.slashes && !e.protocol) {
  33806. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  33807. var h = s[l];
  33808. "protocol" !== h && (i[h] = e[h])
  33809. }
  33810. return b[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  33811. i.href = i.format(),
  33812. i
  33813. }
  33814. if (e.protocol && e.protocol !== i.protocol) {
  33815. if (!b[e.protocol]) {
  33816. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  33817. var p = u[d];
  33818. i[p] = e[p]
  33819. }
  33820. return i.href = i.format(),
  33821. i
  33822. }
  33823. if (i.protocol = e.protocol,
  33824. e.host || E[e.protocol])
  33825. i.pathname = e.pathname;
  33826. else {
  33827. for (var f = (e.pathname || "").split("/"); f.length && !(e.host = f.shift()); )
  33828. ;
  33829. e.host || (e.host = ""),
  33830. e.hostname || (e.hostname = ""),
  33831. "" !== f[0] && f.unshift(""),
  33832. f.length < 2 && f.unshift(""),
  33833. i.pathname = f.join("/")
  33834. }
  33835. if (i.search = e.search,
  33836. i.query = e.query,
  33837. i.host = e.host || "",
  33838. i.auth = e.auth,
  33839. i.hostname = e.hostname || e.host,
  33840. i.port = e.port,
  33841. i.pathname || i.search) {
  33842. var g = i.pathname || ""
  33843. , m = i.search || "";
  33844. i.path = g + m
  33845. }
  33846. return i.slashes = i.slashes || e.slashes,
  33847. i.href = i.format(),
  33848. i
  33849. }
  33850. var v = i.pathname && "/" === i.pathname.charAt(0)
  33851. , A = e.host || e.pathname && "/" === e.pathname.charAt(0)
  33852. , y = A || v || i.host && e.pathname
  33853. , C = y
  33854. , I = i.pathname && i.pathname.split("/") || []
  33855. , f = e.pathname && e.pathname.split("/") || []
  33856. , w = i.protocol && !b[i.protocol];
  33857. if (w && (i.hostname = "",
  33858. i.port = null,
  33859. i.host && ("" === I[0] ? I[0] = i.host : I.unshift(i.host)),
  33860. i.host = "",
  33861. e.protocol && (e.hostname = null,
  33862. e.port = null,
  33863. e.host && ("" === f[0] ? f[0] = e.host : f.unshift(e.host)),
  33864. e.host = null),
  33865. y = y && ("" === f[0] || "" === I[0])),
  33866. A)
  33867. i.host = e.host || "" === e.host ? e.host : i.host,
  33868. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  33869. i.search = e.search,
  33870. i.query = e.query,
  33871. I = f;
  33872. else if (f.length)
  33873. I || (I = []),
  33874. I.pop(),
  33875. I = I.concat(f),
  33876. i.search = e.search,
  33877. i.query = e.query;
  33878. else if (!c.isNullOrUndefined(e.search)) {
  33879. if (w) {
  33880. i.hostname = i.host = I.shift();
  33881. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  33882. _ && (i.auth = _.shift(),
  33883. i.host = i.hostname = _.shift())
  33884. }
  33885. return i.search = e.search,
  33886. i.query = e.query,
  33887. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  33888. i.href = i.format(),
  33889. i
  33890. }
  33891. if (!I.length)
  33892. return i.pathname = null,
  33893. i.search ? i.path = "/" + i.search : i.path = null,
  33894. i.href = i.format(),
  33895. i;
  33896. for (var T = I.slice(-1)[0], x = (i.host || e.host || I.length > 1) && ("." === T || ".." === T) || "" === T, S = 0, M = I.length; M >= 0; M--)
  33897. T = I[M],
  33898. "." === T ? I.splice(M, 1) : ".." === T ? (I.splice(M, 1),
  33899. S++) : S && (I.splice(M, 1),
  33900. S--);
  33901. if (!y && !C)
  33902. for (; S--; S)
  33903. I.unshift("..");
  33904. !y || "" === I[0] || I[0] && "/" === I[0].charAt(0) || I.unshift(""),
  33905. x && "/" !== I.join("/").substr(-1) && I.push("");
  33906. var R = "" === I[0] || I[0] && "/" === I[0].charAt(0);
  33907. if (w) {
  33908. i.hostname = i.host = R ? "" : I.length ? I.shift() : "";
  33909. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  33910. _ && (i.auth = _.shift(),
  33911. i.host = i.hostname = _.shift())
  33912. }
  33913. return y = y || i.host && I.length,
  33914. y && !R && I.unshift(""),
  33915. I.length ? i.pathname = I.join("/") : (i.pathname = null,
  33916. i.path = null),
  33917. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  33918. i.auth = e.auth || i.auth,
  33919. i.slashes = i.slashes || e.slashes,
  33920. i.href = i.format(),
  33921. i
  33922. }
  33923. ,
  33924. n.prototype.parseHost = function() {
  33925. var e = this.host
  33926. , t = u.exec(e);
  33927. t && (t = t[0],
  33928. ":" !== t && (this.port = t.substr(1)),
  33929. e = e.substr(0, e.length - t.length)),
  33930. e && (this.hostname = e)
  33931. }
  33932. }
  33933. , {
  33934. "./util": 209,
  33935. punycode: 204,
  33936. querystring: 207
  33937. }],
  33938. 209: [function(e, t, i) {
  33939. "use strict";
  33940. t.exports = {
  33941. isString: function(e) {
  33942. return "string" == typeof e
  33943. },
  33944. isObject: function(e) {
  33945. return "object" == typeof e && null !== e
  33946. },
  33947. isNull: function(e) {
  33948. return null === e
  33949. },
  33950. isNullOrUndefined: function(e) {
  33951. return null == e
  33952. }
  33953. }
  33954. }
  33955. , {}],
  33956. 210: [function(e, t, i) {
  33957. "use strict";
  33958. function n(e) {
  33959. return l + e
  33960. }
  33961. function r(e) {
  33962. return e.substring(l.length)
  33963. }
  33964. function o(e, t) {
  33965. for (var i in t)
  33966. Object.defineProperty(e, i, {
  33967. value: t[i],
  33968. configurable: !0,
  33969. writable: !0
  33970. })
  33971. }
  33972. function a(e) {
  33973. if ("string" != typeof e)
  33974. throw new TypeError("key must be a string.")
  33975. }
  33976. var s = Object.prototype.hasOwnProperty
  33977. , l = "~";
  33978. t.exports = function(e) {
  33979. var t = Object.create(null)
  33980. , i = 0
  33981. , l = {};
  33982. return o(l, {
  33983. get: function(e, i) {
  33984. a(e);
  33985. var r = n(e);
  33986. return r in t ? t[r] : i
  33987. },
  33988. set: function(e, r) {
  33989. a(e);
  33990. var o = n(e);
  33991. return o in t || ++i,
  33992. t[o] = r
  33993. },
  33994. has: function(e) {
  33995. return a(e),
  33996. n(e)in t
  33997. },
  33998. delete: function(e) {
  33999. a(e);
  34000. var r = n(e);
  34001. return r in t && (--i,
  34002. delete t[r],
  34003. !0)
  34004. },
  34005. clear: function() {
  34006. t = Object.create(null),
  34007. i = 0
  34008. },
  34009. forEach: function(e, i) {
  34010. if ("function" != typeof e)
  34011. throw new TypeError("`callback` must be a function");
  34012. for (var n in t)
  34013. if (s.call(t, n)) {
  34014. var o = r(n)
  34015. , a = t[n];
  34016. e.call(i, a, o, l)
  34017. }
  34018. }
  34019. }),
  34020. Object.defineProperty(l, "size", {
  34021. get: function() {
  34022. return i
  34023. },
  34024. configurable: !0
  34025. }),
  34026. "object" == typeof e && null !== e && Object.keys(e).forEach(function(t) {
  34027. l.set(t, e[t])
  34028. }),
  34029. l
  34030. }
  34031. }
  34032. , {}],
  34033. 211: [function(e, t, i) {
  34034. t.exports = e("./lib/heap")
  34035. }
  34036. , {
  34037. "./lib/heap": 212
  34038. }],
  34039. 212: [function(e, t, i) {
  34040. (function() {
  34041. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m;
  34042. r = Math.floor,
  34043. u = Math.min,
  34044. n = function(e, t) {
  34045. return e < t ? -1 : e > t ? 1 : 0
  34046. }
  34047. ,
  34048. h = function(e, t, i, o, a) {
  34049. var s;
  34050. if (null == i && (i = 0),
  34051. null == a && (a = n),
  34052. i < 0)
  34053. throw new Error("lo must be non-negative");
  34054. for (null == o && (o = e.length); i < o; )
  34055. s = r((i + o) / 2),
  34056. a(t, e[s]) < 0 ? o = s : i = s + 1;
  34057. return [].splice.apply(e, [i, i - i].concat(t)),
  34058. t
  34059. }
  34060. ,
  34061. s = function(e, t, i) {
  34062. return null == i && (i = n),
  34063. e.push(t),
  34064. g(e, 0, e.length - 1, i)
  34065. }
  34066. ,
  34067. a = function(e, t) {
  34068. var i, r;
  34069. return null == t && (t = n),
  34070. i = e.pop(),
  34071. e.length ? (r = e[0],
  34072. e[0] = i,
  34073. m(e, 0, t)) : r = i,
  34074. r
  34075. }
  34076. ,
  34077. c = function(e, t, i) {
  34078. var r;
  34079. return null == i && (i = n),
  34080. r = e[0],
  34081. e[0] = t,
  34082. m(e, 0, i),
  34083. r
  34084. }
  34085. ,
  34086. l = function(e, t, i) {
  34087. var r;
  34088. return null == i && (i = n),
  34089. e.length && i(e[0], t) < 0 && (r = [e[0], t],
  34090. t = r[0],
  34091. e[0] = r[1],
  34092. m(e, 0, i)),
  34093. t
  34094. }
  34095. ,
  34096. o = function(e, t) {
  34097. var i, o, a, s, l, c;
  34098. for (null == t && (t = n),
  34099. s = function() {
  34100. c = [];
  34101. for (var t = 0, i = r(e.length / 2); 0 <= i ? t < i : t > i; 0 <= i ? t++ : t--)
  34102. c.push(t);
  34103. return c
  34104. }
  34105. .apply(this).reverse(),
  34106. l = [],
  34107. o = 0,
  34108. a = s.length; o < a; o++)
  34109. i = s[o],
  34110. l.push(m(e, i, t));
  34111. return l
  34112. }
  34113. ,
  34114. f = function(e, t, i) {
  34115. var r;
  34116. if (null == i && (i = n),
  34117. r = e.indexOf(t),
  34118. r !== -1)
  34119. return g(e, 0, r, i),
  34120. m(e, r, i)
  34121. }
  34122. ,
  34123. d = function(e, t, i) {
  34124. var r, a, s, c, h;
  34125. if (null == i && (i = n),
  34126. a = e.slice(0, t),
  34127. !a.length)
  34128. return a;
  34129. for (o(a, i),
  34130. h = e.slice(t),
  34131. s = 0,
  34132. c = h.length; s < c; s++)
  34133. r = h[s],
  34134. l(a, r, i);
  34135. return a.sort(i).reverse()
  34136. }
  34137. ,
  34138. p = function(e, t, i) {
  34139. var r, s, l, c, d, p, f, g, m, v;
  34140. if (null == i && (i = n),
  34141. 10 * t <= e.length) {
  34142. if (c = e.slice(0, t).sort(i),
  34143. !c.length)
  34144. return c;
  34145. for (l = c[c.length - 1],
  34146. g = e.slice(t),
  34147. d = 0,
  34148. f = g.length; d < f; d++)
  34149. r = g[d],
  34150. i(r, l) < 0 && (h(c, r, 0, null, i),
  34151. c.pop(),
  34152. l = c[c.length - 1]);
  34153. return c
  34154. }
  34155. for (o(e, i),
  34156. v = [],
  34157. s = p = 0,
  34158. m = u(t, e.length); 0 <= m ? p < m : p > m; s = 0 <= m ? ++p : --p)
  34159. v.push(a(e, i));
  34160. return v
  34161. }
  34162. ,
  34163. g = function(e, t, i, r) {
  34164. var o, a, s;
  34165. for (null == r && (r = n),
  34166. o = e[i]; i > t && (s = i - 1 >> 1,
  34167. a = e[s],
  34168. r(o, a) < 0); )
  34169. e[i] = a,
  34170. i = s;
  34171. return e[i] = o
  34172. }
  34173. ,
  34174. m = function(e, t, i) {
  34175. var r, o, a, s, l;
  34176. for (null == i && (i = n),
  34177. o = e.length,
  34178. l = t,
  34179. a = e[t],
  34180. r = 2 * t + 1; r < o; )
  34181. s = r + 1,
  34182. s < o && !(i(e[r], e[s]) < 0) && (r = s),
  34183. e[t] = e[r],
  34184. t = r,
  34185. r = 2 * t + 1;
  34186. return e[t] = a,
  34187. g(e, l, t, i)
  34188. }
  34189. ,
  34190. e = function() {
  34191. function e(e) {
  34192. this.cmp = null != e ? e : n,
  34193. this.nodes = []
  34194. }
  34195. return e.push = s,
  34196. e.pop = a,
  34197. e.replace = c,
  34198. e.pushpop = l,
  34199. e.heapify = o,
  34200. e.updateItem = f,
  34201. e.nlargest = d,
  34202. e.nsmallest = p,
  34203. e.prototype.push = function(e) {
  34204. return s(this.nodes, e, this.cmp)
  34205. }
  34206. ,
  34207. e.prototype.pop = function() {
  34208. return a(this.nodes, this.cmp)
  34209. }
  34210. ,
  34211. e.prototype.peek = function() {
  34212. return this.nodes[0]
  34213. }
  34214. ,
  34215. e.prototype.contains = function(e) {
  34216. return this.nodes.indexOf(e) !== -1
  34217. }
  34218. ,
  34219. e.prototype.replace = function(e) {
  34220. return c(this.nodes, e, this.cmp)
  34221. }
  34222. ,
  34223. e.prototype.pushpop = function(e) {
  34224. return l(this.nodes, e, this.cmp)
  34225. }
  34226. ,
  34227. e.prototype.heapify = function() {
  34228. return o(this.nodes, this.cmp)
  34229. }
  34230. ,
  34231. e.prototype.updateItem = function(e) {
  34232. return f(this.nodes, e, this.cmp)
  34233. }
  34234. ,
  34235. e.prototype.clear = function() {
  34236. return this.nodes = []
  34237. }
  34238. ,
  34239. e.prototype.empty = function() {
  34240. return 0 === this.nodes.length
  34241. }
  34242. ,
  34243. e.prototype.size = function() {
  34244. return this.nodes.length
  34245. }
  34246. ,
  34247. e.prototype.clone = function() {
  34248. var t;
  34249. return t = new e,
  34250. t.nodes = this.nodes.slice(0),
  34251. t
  34252. }
  34253. ,
  34254. e.prototype.toArray = function() {
  34255. return this.nodes.slice(0)
  34256. }
  34257. ,
  34258. e.prototype.insert = e.prototype.push,
  34259. e.prototype.top = e.prototype.peek,
  34260. e.prototype.front = e.prototype.peek,
  34261. e.prototype.has = e.prototype.contains,
  34262. e.prototype.copy = e.prototype.clone,
  34263. e
  34264. }(),
  34265. function(e, n) {
  34266. return "function" == typeof define && define.amd ? define([], n) : "object" == typeof i ? t.exports = n() : e.Heap = n()
  34267. }(this, function() {
  34268. return e
  34269. })
  34270. }
  34271. ).call(this)
  34272. }
  34273. , {}],
  34274. 213: [function(e, t, i) {
  34275. !function(e) {
  34276. function i() {}
  34277. function n(e, t) {
  34278. return function() {
  34279. e.apply(t, arguments)
  34280. }
  34281. }
  34282. function r(e) {
  34283. if ("object" != typeof this)
  34284. throw new TypeError("Promises must be constructed via new");
  34285. if ("function" != typeof e)
  34286. throw new TypeError("not a function");
  34287. this._state = 0,
  34288. this._handled = !1,
  34289. this._value = void 0,
  34290. this._deferreds = [],
  34291. h(e, this)
  34292. }
  34293. function o(e, t) {
  34294. for (; 3 === e._state; )
  34295. e = e._value;
  34296. return 0 === e._state ? void e._deferreds.push(t) : (e._handled = !0,
  34297. void r._immediateFn(function() {
  34298. var i = 1 === e._state ? t.onFulfilled : t.onRejected;
  34299. if (null === i)
  34300. return void (1 === e._state ? a : s)(t.promise, e._value);
  34301. var n;
  34302. try {
  34303. n = i(e._value)
  34304. } catch (e) {
  34305. return void s(t.promise, e)
  34306. }
  34307. a(t.promise, n)
  34308. }))
  34309. }
  34310. function a(e, t) {
  34311. try {
  34312. if (t === e)
  34313. throw new TypeError("A promise cannot be resolved with itself.");
  34314. if (t && ("object" == typeof t || "function" == typeof t)) {
  34315. var i = t.then;
  34316. if (t instanceof r)
  34317. return e._state = 3,
  34318. e._value = t,
  34319. void l(e);
  34320. if ("function" == typeof i)
  34321. return void h(n(i, t), e)
  34322. }
  34323. e._state = 1,
  34324. e._value = t,
  34325. l(e)
  34326. } catch (t) {
  34327. s(e, t)
  34328. }
  34329. }
  34330. function s(e, t) {
  34331. e._state = 2,
  34332. e._value = t,
  34333. l(e)
  34334. }
  34335. function l(e) {
  34336. 2 === e._state && 0 === e._deferreds.length && r._immediateFn(function() {
  34337. e._handled || r._unhandledRejectionFn(e._value)
  34338. });
  34339. for (var t = 0, i = e._deferreds.length; t < i; t++)
  34340. o(e, e._deferreds[t]);
  34341. e._deferreds = null
  34342. }
  34343. function c(e, t, i) {
  34344. this.onFulfilled = "function" == typeof e ? e : null,
  34345. this.onRejected = "function" == typeof t ? t : null,
  34346. this.promise = i
  34347. }
  34348. function h(e, t) {
  34349. var i = !1;
  34350. try {
  34351. e(function(e) {
  34352. i || (i = !0,
  34353. a(t, e))
  34354. }, function(e) {
  34355. i || (i = !0,
  34356. s(t, e))
  34357. })
  34358. } catch (e) {
  34359. if (i)
  34360. return;
  34361. i = !0,
  34362. s(t, e)
  34363. }
  34364. }
  34365. var u = setTimeout;
  34366. r.prototype.catch = function(e) {
  34367. return this.then(null, e)
  34368. }
  34369. ,
  34370. r.prototype.then = function(e, t) {
  34371. var n = new this.constructor(i);
  34372. return o(this, new c(e,t,n)),
  34373. n
  34374. }
  34375. ,
  34376. r.all = function(e) {
  34377. var t = Array.prototype.slice.call(e);
  34378. return new r(function(e, i) {
  34379. function n(o, a) {
  34380. try {
  34381. if (a && ("object" == typeof a || "function" == typeof a)) {
  34382. var s = a.then;
  34383. if ("function" == typeof s)
  34384. return void s.call(a, function(e) {
  34385. n(o, e)
  34386. }, i)
  34387. }
  34388. t[o] = a,
  34389. 0 === --r && e(t)
  34390. } catch (e) {
  34391. i(e)
  34392. }
  34393. }
  34394. if (0 === t.length)
  34395. return e([]);
  34396. for (var r = t.length, o = 0; o < t.length; o++)
  34397. n(o, t[o])
  34398. }
  34399. )
  34400. }
  34401. ,
  34402. r.resolve = function(e) {
  34403. return e && "object" == typeof e && e.constructor === r ? e : new r(function(t) {
  34404. t(e)
  34405. }
  34406. )
  34407. }
  34408. ,
  34409. r.reject = function(e) {
  34410. return new r(function(t, i) {
  34411. i(e)
  34412. }
  34413. )
  34414. }
  34415. ,
  34416. r.race = function(e) {
  34417. return new r(function(t, i) {
  34418. for (var n = 0, r = e.length; n < r; n++)
  34419. e[n].then(t, i)
  34420. }
  34421. )
  34422. }
  34423. ,
  34424. r._immediateFn = "function" == typeof setImmediate && function(e) {
  34425. setImmediate(e)
  34426. }
  34427. || function(e) {
  34428. u(e, 0)
  34429. }
  34430. ,
  34431. r._unhandledRejectionFn = function(e) {
  34432. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  34433. }
  34434. ,
  34435. r._setImmediateFn = function(e) {
  34436. r._immediateFn = e
  34437. }
  34438. ,
  34439. r._setUnhandledRejectionFn = function(e) {
  34440. r._unhandledRejectionFn = e
  34441. }
  34442. ,
  34443. "undefined" != typeof t && t.exports ? t.exports = r : e.Promise || (e.Promise = r)
  34444. }(this)
  34445. }
  34446. , {}],
  34447. 214: [function(e, t, i) {
  34448. (function(i) {
  34449. !function(i, n) {
  34450. "function" == typeof define && define.amd ? define(["bytebuffer"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = n(e("bytebuffer"), !0) : (i.dcodeIO = i.dcodeIO || {}).ProtoBuf = n(i.dcodeIO.ByteBuffer)
  34451. }(this, function(t, n) {
  34452. "use strict";
  34453. var r = {};
  34454. return r.ByteBuffer = t,
  34455. r.Long = t.Long || null,
  34456. r.VERSION = "5.0.1",
  34457. r.WIRE_TYPES = {},
  34458. r.WIRE_TYPES.VARINT = 0,
  34459. r.WIRE_TYPES.BITS64 = 1,
  34460. r.WIRE_TYPES.LDELIM = 2,
  34461. r.WIRE_TYPES.STARTGROUP = 3,
  34462. r.WIRE_TYPES.ENDGROUP = 4,
  34463. r.WIRE_TYPES.BITS32 = 5,
  34464. r.PACKABLE_WIRE_TYPES = [r.WIRE_TYPES.VARINT, r.WIRE_TYPES.BITS64, r.WIRE_TYPES.BITS32],
  34465. r.TYPES = {
  34466. int32: {
  34467. name: "int32",
  34468. wireType: r.WIRE_TYPES.VARINT,
  34469. defaultValue: 0
  34470. },
  34471. uint32: {
  34472. name: "uint32",
  34473. wireType: r.WIRE_TYPES.VARINT,
  34474. defaultValue: 0
  34475. },
  34476. sint32: {
  34477. name: "sint32",
  34478. wireType: r.WIRE_TYPES.VARINT,
  34479. defaultValue: 0
  34480. },
  34481. int64: {
  34482. name: "int64",
  34483. wireType: r.WIRE_TYPES.VARINT,
  34484. defaultValue: r.Long ? r.Long.ZERO : void 0
  34485. },
  34486. uint64: {
  34487. name: "uint64",
  34488. wireType: r.WIRE_TYPES.VARINT,
  34489. defaultValue: r.Long ? r.Long.UZERO : void 0
  34490. },
  34491. sint64: {
  34492. name: "sint64",
  34493. wireType: r.WIRE_TYPES.VARINT,
  34494. defaultValue: r.Long ? r.Long.ZERO : void 0
  34495. },
  34496. bool: {
  34497. name: "bool",
  34498. wireType: r.WIRE_TYPES.VARINT,
  34499. defaultValue: !1
  34500. },
  34501. double: {
  34502. name: "double",
  34503. wireType: r.WIRE_TYPES.BITS64,
  34504. defaultValue: 0
  34505. },
  34506. string: {
  34507. name: "string",
  34508. wireType: r.WIRE_TYPES.LDELIM,
  34509. defaultValue: ""
  34510. },
  34511. bytes: {
  34512. name: "bytes",
  34513. wireType: r.WIRE_TYPES.LDELIM,
  34514. defaultValue: null
  34515. },
  34516. fixed32: {
  34517. name: "fixed32",
  34518. wireType: r.WIRE_TYPES.BITS32,
  34519. defaultValue: 0
  34520. },
  34521. sfixed32: {
  34522. name: "sfixed32",
  34523. wireType: r.WIRE_TYPES.BITS32,
  34524. defaultValue: 0
  34525. },
  34526. fixed64: {
  34527. name: "fixed64",
  34528. wireType: r.WIRE_TYPES.BITS64,
  34529. defaultValue: r.Long ? r.Long.UZERO : void 0
  34530. },
  34531. sfixed64: {
  34532. name: "sfixed64",
  34533. wireType: r.WIRE_TYPES.BITS64,
  34534. defaultValue: r.Long ? r.Long.ZERO : void 0
  34535. },
  34536. float: {
  34537. name: "float",
  34538. wireType: r.WIRE_TYPES.BITS32,
  34539. defaultValue: 0
  34540. },
  34541. enum: {
  34542. name: "enum",
  34543. wireType: r.WIRE_TYPES.VARINT,
  34544. defaultValue: 0
  34545. },
  34546. message: {
  34547. name: "message",
  34548. wireType: r.WIRE_TYPES.LDELIM,
  34549. defaultValue: null
  34550. },
  34551. group: {
  34552. name: "group",
  34553. wireType: r.WIRE_TYPES.STARTGROUP,
  34554. defaultValue: null
  34555. }
  34556. },
  34557. r.MAP_KEY_TYPES = [r.TYPES.int32, r.TYPES.sint32, r.TYPES.sfixed32, r.TYPES.uint32, r.TYPES.fixed32, r.TYPES.int64, r.TYPES.sint64, r.TYPES.sfixed64, r.TYPES.uint64, r.TYPES.fixed64, r.TYPES.bool, r.TYPES.string, r.TYPES.bytes],
  34558. r.ID_MIN = 1,
  34559. r.ID_MAX = 536870911,
  34560. r.convertFieldsToCamelCase = !1,
  34561. r.populateAccessors = !0,
  34562. r.populateDefaults = !0,
  34563. r.Util = function() {
  34564. var t = {};
  34565. return t.IS_NODE = !("object" != typeof i || i + "" != "[object process]" || i.browser),
  34566. t.XHR = function() {
  34567. for (var e = [function() {
  34568. return new XMLHttpRequest
  34569. }
  34570. , function() {
  34571. return new ActiveXObject("Msxml2.XMLHTTP")
  34572. }
  34573. , function() {
  34574. return new ActiveXObject("Msxml3.XMLHTTP")
  34575. }
  34576. , function() {
  34577. return new ActiveXObject("Microsoft.XMLHTTP")
  34578. }
  34579. ], t = null, i = 0; i < e.length; i++) {
  34580. try {
  34581. t = e[i]()
  34582. } catch (e) {
  34583. continue
  34584. }
  34585. break
  34586. }
  34587. if (!t)
  34588. throw Error("XMLHttpRequest is not supported");
  34589. return t
  34590. }
  34591. ,
  34592. t.fetch = function(i, n) {
  34593. if (n && "function" != typeof n && (n = null),
  34594. t.IS_NODE) {
  34595. var r = e("fs");
  34596. if (n)
  34597. r.readFile(i, function(e, t) {
  34598. n(e ? null : "" + t)
  34599. });
  34600. else
  34601. try {
  34602. return r.readFileSync(i)
  34603. } catch (e) {
  34604. return null
  34605. }
  34606. } else {
  34607. var o = t.XHR();
  34608. if (o.open("GET", i, !!n),
  34609. o.setRequestHeader("Accept", "text/plain"),
  34610. "function" == typeof o.overrideMimeType && o.overrideMimeType("text/plain"),
  34611. !n)
  34612. return o.send(null),
  34613. 200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null;
  34614. if (o.onreadystatechange = function() {
  34615. 4 == o.readyState && n(200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null)
  34616. }
  34617. ,
  34618. 4 == o.readyState)
  34619. return;
  34620. o.send(null)
  34621. }
  34622. }
  34623. ,
  34624. t.toCamelCase = function(e) {
  34625. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  34626. return t.toUpperCase()
  34627. })
  34628. }
  34629. ,
  34630. t
  34631. }(),
  34632. r.Lang = {
  34633. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  34634. RULE: /^(?:required|optional|repeated|map)$/,
  34635. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  34636. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  34637. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  34638. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  34639. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  34640. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  34641. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  34642. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  34643. NUMBER_OCT: /^0[0-7]+$/,
  34644. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  34645. BOOL: /^(?:true|false)$/i,
  34646. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  34647. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  34648. WHITESPACE: /\s/,
  34649. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  34650. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  34651. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  34652. },
  34653. r.DotProto = function(e, t) {
  34654. function i(e, i) {
  34655. var n = -1
  34656. , r = 1;
  34657. if ("-" == e.charAt(0) && (r = -1,
  34658. e = e.substring(1)),
  34659. t.NUMBER_DEC.test(e))
  34660. n = parseInt(e);
  34661. else if (t.NUMBER_HEX.test(e))
  34662. n = parseInt(e.substring(2), 16);
  34663. else {
  34664. if (!t.NUMBER_OCT.test(e))
  34665. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  34666. n = parseInt(e.substring(1), 8)
  34667. }
  34668. if (n = r * n | 0,
  34669. !i && n < 0)
  34670. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  34671. return n
  34672. }
  34673. function n(e) {
  34674. var i = 1;
  34675. if ("-" == e.charAt(0) && (i = -1,
  34676. e = e.substring(1)),
  34677. t.NUMBER_DEC.test(e))
  34678. return i * parseInt(e, 10);
  34679. if (t.NUMBER_HEX.test(e))
  34680. return i * parseInt(e.substring(2), 16);
  34681. if (t.NUMBER_OCT.test(e))
  34682. return i * parseInt(e.substring(1), 8);
  34683. if ("inf" === e)
  34684. return i * (1 / 0);
  34685. if ("nan" === e)
  34686. return NaN;
  34687. if (t.NUMBER_FLT.test(e))
  34688. return i * parseFloat(e);
  34689. throw Error("illegal number value: " + (i < 0 ? "-" : "") + e)
  34690. }
  34691. function r(e, t, i) {
  34692. "undefined" == typeof e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  34693. e[t].push(i))
  34694. }
  34695. var o = {}
  34696. , a = function(e) {
  34697. this.source = e + "",
  34698. this.index = 0,
  34699. this.line = 1,
  34700. this.stack = [],
  34701. this._stringOpen = null
  34702. }
  34703. , s = a.prototype;
  34704. s._readString = function() {
  34705. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ;
  34706. e.lastIndex = this.index - 1;
  34707. var i = e.exec(this.source);
  34708. if (!i)
  34709. throw Error("unterminated string");
  34710. return this.index = e.lastIndex,
  34711. this.stack.push(this._stringOpen),
  34712. this._stringOpen = null,
  34713. i[1]
  34714. }
  34715. ,
  34716. s.next = function() {
  34717. if (this.stack.length > 0)
  34718. return this.stack.shift();
  34719. if (this.index >= this.source.length)
  34720. return null;
  34721. if (null !== this._stringOpen)
  34722. return this._readString();
  34723. var e, i, n;
  34724. do {
  34725. for (e = !1; t.WHITESPACE.test(n = this.source.charAt(this.index)); )
  34726. if ("\n" === n && ++this.line,
  34727. ++this.index === this.source.length)
  34728. return null;
  34729. if ("/" === this.source.charAt(this.index))
  34730. if (++this.index,
  34731. "/" === this.source.charAt(this.index)) {
  34732. for (; "\n" !== this.source.charAt(++this.index); )
  34733. if (this.index == this.source.length)
  34734. return null;
  34735. ++this.index,
  34736. ++this.line,
  34737. e = !0
  34738. } else {
  34739. if ("*" !== (n = this.source.charAt(this.index)))
  34740. return "/";
  34741. do {
  34742. if ("\n" === n && ++this.line,
  34743. ++this.index === this.source.length)
  34744. return null;
  34745. i = n,
  34746. n = this.source.charAt(this.index)
  34747. } while ("*" !== i || "/" !== n);++this.index,
  34748. e = !0
  34749. }
  34750. } while (e);if (this.index === this.source.length)
  34751. return null;
  34752. var r = this.index;
  34753. t.DELIM.lastIndex = 0;
  34754. var o = t.DELIM.test(this.source.charAt(r++));
  34755. if (!o)
  34756. for (; r < this.source.length && !t.DELIM.test(this.source.charAt(r)); )
  34757. ++r;
  34758. var a = this.source.substring(this.index, this.index = r);
  34759. return '"' !== a && "'" !== a || (this._stringOpen = a),
  34760. a
  34761. }
  34762. ,
  34763. s.peek = function() {
  34764. if (0 === this.stack.length) {
  34765. var e = this.next();
  34766. if (null === e)
  34767. return null;
  34768. this.stack.push(e)
  34769. }
  34770. return this.stack[0]
  34771. }
  34772. ,
  34773. s.skip = function(e) {
  34774. var t = this.next();
  34775. if (t !== e)
  34776. throw Error("illegal '" + t + "', '" + e + "' expected")
  34777. }
  34778. ,
  34779. s.omit = function(e) {
  34780. return this.peek() === e && (this.next(),
  34781. !0)
  34782. }
  34783. ,
  34784. s.toString = function() {
  34785. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  34786. }
  34787. ,
  34788. o.Tokenizer = a;
  34789. var l = function(e) {
  34790. this.tn = new a(e),
  34791. this.proto3 = !1
  34792. }
  34793. , c = l.prototype;
  34794. return c.parse = function() {
  34795. var e, i, n = {
  34796. name: "[ROOT]",
  34797. package: null,
  34798. messages: [],
  34799. enums: [],
  34800. imports: [],
  34801. options: {},
  34802. services: []
  34803. }, r = !0;
  34804. try {
  34805. for (; e = this.tn.next(); )
  34806. switch (e) {
  34807. case "package":
  34808. if (!r || null !== n.package)
  34809. throw Error("unexpected 'package'");
  34810. if (e = this.tn.next(),
  34811. !t.TYPEREF.test(e))
  34812. throw Error("illegal package name: " + e);
  34813. this.tn.skip(";"),
  34814. n.package = e;
  34815. break;
  34816. case "import":
  34817. if (!r)
  34818. throw Error("unexpected 'import'");
  34819. e = this.tn.peek(),
  34820. ("public" === e || (i = "weak" === e)) && this.tn.next(),
  34821. e = this._readString(),
  34822. this.tn.skip(";"),
  34823. i || n.imports.push(e);
  34824. break;
  34825. case "syntax":
  34826. if (!r)
  34827. throw Error("unexpected 'syntax'");
  34828. this.tn.skip("="),
  34829. "proto3" === (n.syntax = this._readString()) && (this.proto3 = !0),
  34830. this.tn.skip(";");
  34831. break;
  34832. case "message":
  34833. this._parseMessage(n, null),
  34834. r = !1;
  34835. break;
  34836. case "enum":
  34837. this._parseEnum(n),
  34838. r = !1;
  34839. break;
  34840. case "option":
  34841. this._parseOption(n);
  34842. break;
  34843. case "service":
  34844. this._parseService(n);
  34845. break;
  34846. case "extend":
  34847. this._parseExtend(n);
  34848. break;
  34849. default:
  34850. throw Error("unexpected '" + e + "'")
  34851. }
  34852. } catch (e) {
  34853. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  34854. e
  34855. }
  34856. return delete n.name,
  34857. n
  34858. }
  34859. ,
  34860. l.parse = function(e) {
  34861. return new l(e).parse()
  34862. }
  34863. ,
  34864. c._readString = function() {
  34865. var e, t, i = "";
  34866. do {
  34867. if (t = this.tn.next(),
  34868. "'" !== t && '"' !== t)
  34869. throw Error("illegal string delimiter: " + t);
  34870. i += this.tn.next(),
  34871. this.tn.skip(t),
  34872. e = this.tn.peek()
  34873. } while ('"' === e || '"' === e);return i
  34874. }
  34875. ,
  34876. c._readValue = function(e) {
  34877. var i = this.tn.peek();
  34878. if ('"' === i || "'" === i)
  34879. return this._readString();
  34880. if (this.tn.next(),
  34881. t.NUMBER.test(i))
  34882. return n(i);
  34883. if (t.BOOL.test(i))
  34884. return "true" === i.toLowerCase();
  34885. if (e && t.TYPEREF.test(i))
  34886. return i;
  34887. throw Error("illegal value: " + i)
  34888. }
  34889. ,
  34890. c._parseOption = function(e, i) {
  34891. var n = this.tn.next()
  34892. , r = !1;
  34893. if ("(" === n && (r = !0,
  34894. n = this.tn.next()),
  34895. !t.TYPEREF.test(n))
  34896. throw Error("illegal option name: " + n);
  34897. var o = n;
  34898. r && (this.tn.skip(")"),
  34899. o = "(" + o + ")",
  34900. n = this.tn.peek(),
  34901. t.FQTYPEREF.test(n) && (o += n,
  34902. this.tn.next())),
  34903. this.tn.skip("="),
  34904. this._parseOptionValue(e, o),
  34905. i || this.tn.skip(";")
  34906. }
  34907. ,
  34908. c._parseOptionValue = function(e, i) {
  34909. var n = this.tn.peek();
  34910. if ("{" !== n)
  34911. r(e.options, i, this._readValue(!0));
  34912. else
  34913. for (this.tn.skip("{"); "}" !== (n = this.tn.next()); ) {
  34914. if (!t.NAME.test(n))
  34915. throw Error("illegal option name: " + i + "." + n);
  34916. this.tn.omit(":") ? r(e.options, i + "." + n, this._readValue(!0)) : this._parseOptionValue(e, i + "." + n)
  34917. }
  34918. }
  34919. ,
  34920. c._parseService = function(e) {
  34921. var i = this.tn.next();
  34922. if (!t.NAME.test(i))
  34923. throw Error("illegal service name at line " + this.tn.line + ": " + i);
  34924. var n = i
  34925. , r = {
  34926. name: n,
  34927. rpc: {},
  34928. options: {}
  34929. };
  34930. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  34931. if ("option" === i)
  34932. this._parseOption(r);
  34933. else {
  34934. if ("rpc" !== i)
  34935. throw Error("illegal service token: " + i);
  34936. this._parseServiceRPC(r)
  34937. }
  34938. this.tn.omit(";"),
  34939. e.services.push(r)
  34940. }
  34941. ,
  34942. c._parseServiceRPC = function(e) {
  34943. var i = "rpc"
  34944. , n = this.tn.next();
  34945. if (!t.NAME.test(n))
  34946. throw Error("illegal rpc service method name: " + n);
  34947. var r = n
  34948. , o = {
  34949. request: null,
  34950. response: null,
  34951. request_stream: !1,
  34952. response_stream: !1,
  34953. options: {}
  34954. };
  34955. if (this.tn.skip("("),
  34956. n = this.tn.next(),
  34957. "stream" === n.toLowerCase() && (o.request_stream = !0,
  34958. n = this.tn.next()),
  34959. !t.TYPEREF.test(n))
  34960. throw Error("illegal rpc service request type: " + n);
  34961. if (o.request = n,
  34962. this.tn.skip(")"),
  34963. n = this.tn.next(),
  34964. "returns" !== n.toLowerCase())
  34965. throw Error("illegal rpc service request type delimiter: " + n);
  34966. if (this.tn.skip("("),
  34967. n = this.tn.next(),
  34968. "stream" === n.toLowerCase() && (o.response_stream = !0,
  34969. n = this.tn.next()),
  34970. o.response = n,
  34971. this.tn.skip(")"),
  34972. n = this.tn.peek(),
  34973. "{" === n) {
  34974. for (this.tn.next(); "}" !== (n = this.tn.next()); ) {
  34975. if ("option" !== n)
  34976. throw Error("illegal rpc service token: " + n);
  34977. this._parseOption(o)
  34978. }
  34979. this.tn.omit(";")
  34980. } else
  34981. this.tn.skip(";");
  34982. "undefined" == typeof e[i] && (e[i] = {}),
  34983. e[i][r] = o
  34984. }
  34985. ,
  34986. c._parseMessage = function(e, n) {
  34987. var r = !!n
  34988. , o = this.tn.next()
  34989. , a = {
  34990. name: "",
  34991. fields: [],
  34992. enums: [],
  34993. messages: [],
  34994. options: {},
  34995. services: [],
  34996. oneofs: {}
  34997. };
  34998. if (!t.NAME.test(o))
  34999. throw Error("illegal " + (r ? "group" : "message") + " name: " + o);
  35000. for (a.name = o,
  35001. r && (this.tn.skip("="),
  35002. n.id = i(this.tn.next()),
  35003. a.isGroup = !0),
  35004. o = this.tn.peek(),
  35005. "[" === o && n && this._parseFieldOptions(n),
  35006. this.tn.skip("{"); "}" !== (o = this.tn.next()); )
  35007. if (t.RULE.test(o))
  35008. this._parseMessageField(a, o);
  35009. else if ("oneof" === o)
  35010. this._parseMessageOneOf(a);
  35011. else if ("enum" === o)
  35012. this._parseEnum(a);
  35013. else if ("message" === o)
  35014. this._parseMessage(a);
  35015. else if ("option" === o)
  35016. this._parseOption(a);
  35017. else if ("service" === o)
  35018. this._parseService(a);
  35019. else if ("extensions" === o)
  35020. a.extensions = this._parseExtensionRanges();
  35021. else if ("reserved" === o)
  35022. this._parseIgnored();
  35023. else if ("extend" === o)
  35024. this._parseExtend(a);
  35025. else {
  35026. if (!t.TYPEREF.test(o))
  35027. throw Error("illegal message token: " + o);
  35028. if (!this.proto3)
  35029. throw Error("illegal field rule: " + o);
  35030. this._parseMessageField(a, "optional", o)
  35031. }
  35032. return this.tn.omit(";"),
  35033. e.messages.push(a),
  35034. a
  35035. }
  35036. ,
  35037. c._parseIgnored = function() {
  35038. for (; ";" !== this.tn.peek(); )
  35039. this.tn.next();
  35040. this.tn.skip(";")
  35041. }
  35042. ,
  35043. c._parseMessageField = function(e, n, r) {
  35044. if (!t.RULE.test(n))
  35045. throw Error("illegal message field rule: " + n);
  35046. var o, a = {
  35047. rule: n,
  35048. type: "",
  35049. name: "",
  35050. options: {},
  35051. id: 0
  35052. };
  35053. if ("map" === n) {
  35054. if (r)
  35055. throw Error("illegal type: " + r);
  35056. if (this.tn.skip("<"),
  35057. o = this.tn.next(),
  35058. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  35059. throw Error("illegal message field type: " + o);
  35060. if (a.keytype = o,
  35061. this.tn.skip(","),
  35062. o = this.tn.next(),
  35063. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  35064. throw Error("illegal message field: " + o);
  35065. if (a.type = o,
  35066. this.tn.skip(">"),
  35067. o = this.tn.next(),
  35068. !t.NAME.test(o))
  35069. throw Error("illegal message field name: " + o);
  35070. a.name = o,
  35071. this.tn.skip("="),
  35072. a.id = i(this.tn.next()),
  35073. o = this.tn.peek(),
  35074. "[" === o && this._parseFieldOptions(a),
  35075. this.tn.skip(";")
  35076. } else if (r = "undefined" != typeof r ? r : this.tn.next(),
  35077. "group" === r) {
  35078. var s = this._parseMessage(e, a);
  35079. if (!/^[A-Z]/.test(s.name))
  35080. throw Error("illegal group name: " + s.name);
  35081. a.type = s.name,
  35082. a.name = s.name.toLowerCase(),
  35083. this.tn.omit(";")
  35084. } else {
  35085. if (!t.TYPE.test(r) && !t.TYPEREF.test(r))
  35086. throw Error("illegal message field type: " + r);
  35087. if (a.type = r,
  35088. o = this.tn.next(),
  35089. !t.NAME.test(o))
  35090. throw Error("illegal message field name: " + o);
  35091. a.name = o,
  35092. this.tn.skip("="),
  35093. a.id = i(this.tn.next()),
  35094. o = this.tn.peek(),
  35095. "[" === o && this._parseFieldOptions(a),
  35096. this.tn.skip(";")
  35097. }
  35098. return e.fields.push(a),
  35099. a
  35100. }
  35101. ,
  35102. c._parseMessageOneOf = function(e) {
  35103. var i = this.tn.next();
  35104. if (!t.NAME.test(i))
  35105. throw Error("illegal oneof name: " + i);
  35106. var n, r = i, o = [];
  35107. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  35108. n = this._parseMessageField(e, "optional", i),
  35109. n.oneof = r,
  35110. o.push(n.id);
  35111. this.tn.omit(";"),
  35112. e.oneofs[r] = o
  35113. }
  35114. ,
  35115. c._parseFieldOptions = function(e) {
  35116. this.tn.skip("[");
  35117. for (var t, i = !0; "]" !== (t = this.tn.peek()); )
  35118. i || this.tn.skip(","),
  35119. this._parseOption(e, !0),
  35120. i = !1;
  35121. this.tn.next()
  35122. }
  35123. ,
  35124. c._parseEnum = function(e) {
  35125. var n = {
  35126. name: "",
  35127. values: [],
  35128. options: {}
  35129. }
  35130. , r = this.tn.next();
  35131. if (!t.NAME.test(r))
  35132. throw Error("illegal name: " + r);
  35133. for (n.name = r,
  35134. this.tn.skip("{"); "}" !== (r = this.tn.next()); )
  35135. if ("option" === r)
  35136. this._parseOption(n);
  35137. else {
  35138. if (!t.NAME.test(r))
  35139. throw Error("illegal name: " + r);
  35140. this.tn.skip("=");
  35141. var o = {
  35142. name: r,
  35143. id: i(this.tn.next(), !0)
  35144. };
  35145. r = this.tn.peek(),
  35146. "[" === r && this._parseFieldOptions({
  35147. options: {}
  35148. }),
  35149. this.tn.skip(";"),
  35150. n.values.push(o)
  35151. }
  35152. this.tn.omit(";"),
  35153. e.enums.push(n)
  35154. }
  35155. ,
  35156. c._parseExtensionRanges = function() {
  35157. var t, i, r, o = [];
  35158. do {
  35159. for (i = []; ; ) {
  35160. switch (t = this.tn.next()) {
  35161. case "min":
  35162. r = e.ID_MIN;
  35163. break;
  35164. case "max":
  35165. r = e.ID_MAX;
  35166. break;
  35167. default:
  35168. r = n(t)
  35169. }
  35170. if (i.push(r),
  35171. 2 === i.length)
  35172. break;
  35173. if ("to" !== this.tn.peek()) {
  35174. i.push(r);
  35175. break
  35176. }
  35177. this.tn.next()
  35178. }
  35179. o.push(i)
  35180. } while (this.tn.omit(","));return this.tn.skip(";"),
  35181. o
  35182. }
  35183. ,
  35184. c._parseExtend = function(e) {
  35185. var i = this.tn.next();
  35186. if (!t.TYPEREF.test(i))
  35187. throw Error("illegal extend reference: " + i);
  35188. var n = {
  35189. ref: i,
  35190. fields: []
  35191. };
  35192. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  35193. if (t.RULE.test(i))
  35194. this._parseMessageField(n, i);
  35195. else {
  35196. if (!t.TYPEREF.test(i))
  35197. throw Error("illegal extend token: " + i);
  35198. if (!this.proto3)
  35199. throw Error("illegal field rule: " + i);
  35200. this._parseMessageField(n, "optional", i)
  35201. }
  35202. return this.tn.omit(";"),
  35203. e.messages.push(n),
  35204. n
  35205. }
  35206. ,
  35207. c.toString = function() {
  35208. return "Parser at line " + this.tn.line
  35209. }
  35210. ,
  35211. o.Parser = l,
  35212. o
  35213. }(r, r.Lang),
  35214. r.Reflect = function(e) {
  35215. function i(i) {
  35216. if ("string" == typeof i && (i = e.TYPES[i]),
  35217. "undefined" == typeof i.defaultValue)
  35218. throw Error("default value for type " + i.name + " is not supported");
  35219. return i == e.TYPES.bytes ? new t(0) : i.defaultValue
  35220. }
  35221. function n(t, i) {
  35222. if (t && "number" == typeof t.low && "number" == typeof t.high && "boolean" == typeof t.unsigned && t.low === t.low && t.high === t.high)
  35223. return new e.Long(t.low,t.high,"undefined" == typeof i ? t.unsigned : i);
  35224. if ("string" == typeof t)
  35225. return e.Long.fromString(t, i || !1, 10);
  35226. if ("number" == typeof t)
  35227. return e.Long.fromNumber(t, i || !1);
  35228. throw Error("not convertible to Long")
  35229. }
  35230. function r(t, i) {
  35231. var n = i.readVarint32()
  35232. , o = 7 & n
  35233. , a = n >>> 3;
  35234. switch (o) {
  35235. case e.WIRE_TYPES.VARINT:
  35236. do
  35237. n = i.readUint8();
  35238. while (128 === (128 & n));break;
  35239. case e.WIRE_TYPES.BITS64:
  35240. i.offset += 8;
  35241. break;
  35242. case e.WIRE_TYPES.LDELIM:
  35243. n = i.readVarint32(),
  35244. i.offset += n;
  35245. break;
  35246. case e.WIRE_TYPES.STARTGROUP:
  35247. r(a, i);
  35248. break;
  35249. case e.WIRE_TYPES.ENDGROUP:
  35250. if (a === t)
  35251. return !1;
  35252. throw Error("Illegal GROUPEND after unknown group: " + a + " (" + t + " expected)");
  35253. case e.WIRE_TYPES.BITS32:
  35254. i.offset += 4;
  35255. break;
  35256. default:
  35257. throw Error("Illegal wire type in unknown group " + t + ": " + o)
  35258. }
  35259. return !0
  35260. }
  35261. var o = {}
  35262. , a = function(e, t, i) {
  35263. this.builder = e,
  35264. this.parent = t,
  35265. this.name = i,
  35266. this.className
  35267. }
  35268. , s = a.prototype;
  35269. s.fqn = function() {
  35270. for (var e = this.name, t = this; ; ) {
  35271. if (t = t.parent,
  35272. null == t)
  35273. break;
  35274. e = t.name + "." + e
  35275. }
  35276. return e
  35277. }
  35278. ,
  35279. s.toString = function(e) {
  35280. return (e ? this.className + " " : "") + this.fqn()
  35281. }
  35282. ,
  35283. s.build = function() {
  35284. throw Error(this.toString(!0) + " cannot be built directly")
  35285. }
  35286. ,
  35287. o.T = a;
  35288. var l = function(e, t, i, n, r) {
  35289. a.call(this, e, t, i),
  35290. this.className = "Namespace",
  35291. this.children = [],
  35292. this.options = n || {},
  35293. this.syntax = r || "proto2"
  35294. }
  35295. , c = l.prototype = Object.create(a.prototype);
  35296. c.getChildren = function(e) {
  35297. if (e = e || null,
  35298. null == e)
  35299. return this.children.slice();
  35300. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  35301. this.children[i]instanceof e && t.push(this.children[i]);
  35302. return t
  35303. }
  35304. ,
  35305. c.addChild = function(e) {
  35306. var t;
  35307. if (t = this.getChild(e.name))
  35308. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  35309. t.name = t.originalName;
  35310. else {
  35311. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  35312. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  35313. e.name = e.originalName
  35314. }
  35315. this.children.push(e)
  35316. }
  35317. ,
  35318. c.getChild = function(e) {
  35319. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  35320. if (this.children[i][t] === e)
  35321. return this.children[i];
  35322. return null
  35323. }
  35324. ,
  35325. c.resolve = function(e, t) {
  35326. var i = "string" == typeof e ? e.split(".") : e
  35327. , n = this
  35328. , r = 0;
  35329. if ("" === i[r]) {
  35330. for (; null !== n.parent; )
  35331. n = n.parent;
  35332. r++
  35333. }
  35334. var a;
  35335. do {
  35336. do {
  35337. if (!(n instanceof o.Namespace)) {
  35338. n = null;
  35339. break
  35340. }
  35341. if (a = n.getChild(i[r]),
  35342. !a || !(a instanceof o.T) || t && !(a instanceof o.Namespace)) {
  35343. n = null;
  35344. break
  35345. }
  35346. n = a,
  35347. r++
  35348. } while (r < i.length);if (null != n)
  35349. break;
  35350. if (null !== this.parent)
  35351. return this.parent.resolve(e, t)
  35352. } while (null != n);return n
  35353. }
  35354. ,
  35355. c.qn = function(e) {
  35356. var t = []
  35357. , i = e;
  35358. do
  35359. t.unshift(i.name),
  35360. i = i.parent;
  35361. while (null !== i);for (var n = 1; n <= t.length; n++) {
  35362. var r = t.slice(t.length - n);
  35363. if (e === this.resolve(r, e instanceof o.Namespace))
  35364. return r.join(".")
  35365. }
  35366. return e.fqn()
  35367. }
  35368. ,
  35369. c.build = function() {
  35370. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  35371. e = i[n],
  35372. e instanceof l && (t[e.name] = e.build());
  35373. return Object.defineProperty && Object.defineProperty(t, "$options", {
  35374. value: this.buildOpt()
  35375. }),
  35376. t
  35377. }
  35378. ,
  35379. c.buildOpt = function() {
  35380. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  35381. var r = t[i]
  35382. , o = this.options[t[i]];
  35383. e[r] = o
  35384. }
  35385. return e
  35386. }
  35387. ,
  35388. c.getOption = function(e) {
  35389. return "undefined" == typeof e ? this.options : "undefined" != typeof this.options[e] ? this.options[e] : null
  35390. }
  35391. ,
  35392. o.Namespace = l;
  35393. var h = function(t, i, n, r) {
  35394. if (this.type = t,
  35395. this.resolvedType = i,
  35396. this.isMapKey = n,
  35397. this.syntax = r,
  35398. n && e.MAP_KEY_TYPES.indexOf(t) < 0)
  35399. throw Error("Invalid map key type: " + t.name)
  35400. }
  35401. , u = h.prototype;
  35402. h.defaultFieldValue = i,
  35403. u.verifyValue = function(i) {
  35404. function r(e, t) {
  35405. throw Error("Illegal value for " + o.toString(!0) + " of type " + o.type.name + ": " + e + " (" + t + ")")
  35406. }
  35407. var o = this;
  35408. switch (this.type) {
  35409. case e.TYPES.int32:
  35410. case e.TYPES.sint32:
  35411. case e.TYPES.sfixed32:
  35412. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  35413. i > 4294967295 ? 0 | i : i;
  35414. case e.TYPES.uint32:
  35415. case e.TYPES.fixed32:
  35416. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  35417. i < 0 ? i >>> 0 : i;
  35418. case e.TYPES.int64:
  35419. case e.TYPES.sint64:
  35420. case e.TYPES.sfixed64:
  35421. if (e.Long)
  35422. try {
  35423. return n(i, !1)
  35424. } catch (e) {
  35425. r(typeof i, e.message)
  35426. }
  35427. else
  35428. r(typeof i, "requires Long.js");
  35429. case e.TYPES.uint64:
  35430. case e.TYPES.fixed64:
  35431. if (e.Long)
  35432. try {
  35433. return n(i, !0)
  35434. } catch (e) {
  35435. r(typeof i, e.message)
  35436. }
  35437. else
  35438. r(typeof i, "requires Long.js");
  35439. case e.TYPES.bool:
  35440. return "boolean" != typeof i && r(typeof i, "not a boolean"),
  35441. i;
  35442. case e.TYPES.float:
  35443. case e.TYPES.double:
  35444. return "number" != typeof i && r(typeof i, "not a number"),
  35445. i;
  35446. case e.TYPES.string:
  35447. return "string" == typeof i || i && i instanceof String || r(typeof i, "not a string"),
  35448. "" + i;
  35449. case e.TYPES.bytes:
  35450. return t.isByteBuffer(i) ? i : t.wrap(i, "base64");
  35451. case e.TYPES.enum:
  35452. var a = this.resolvedType.getChildren(e.Reflect.Enum.Value);
  35453. for (l = 0; l < a.length; l++) {
  35454. if (a[l].name == i)
  35455. return a[l].id;
  35456. if (a[l].id == i)
  35457. return a[l].id
  35458. }
  35459. if ("proto3" === this.syntax)
  35460. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  35461. (i > 4294967295 || i < 0) && r(typeof i, "not in range for uint32"),
  35462. i;
  35463. r(i, "not a valid enum value");
  35464. case e.TYPES.group:
  35465. case e.TYPES.message:
  35466. if (i && "object" == typeof i || r(typeof i, "object expected"),
  35467. i instanceof this.resolvedType.clazz)
  35468. return i;
  35469. if (i instanceof e.Builder.Message) {
  35470. var s = {};
  35471. for (var l in i)
  35472. i.hasOwnProperty(l) && (s[l] = i[l]);
  35473. i = s
  35474. }
  35475. return new this.resolvedType.clazz(i)
  35476. }
  35477. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + i + " (undefined type " + this.type + ")")
  35478. }
  35479. ,
  35480. u.calculateLength = function(i, n) {
  35481. if (null === n)
  35482. return 0;
  35483. var r;
  35484. switch (this.type) {
  35485. case e.TYPES.int32:
  35486. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n);
  35487. case e.TYPES.uint32:
  35488. return t.calculateVarint32(n);
  35489. case e.TYPES.sint32:
  35490. return t.calculateVarint32(t.zigZagEncode32(n));
  35491. case e.TYPES.fixed32:
  35492. case e.TYPES.sfixed32:
  35493. case e.TYPES.float:
  35494. return 4;
  35495. case e.TYPES.int64:
  35496. case e.TYPES.uint64:
  35497. return t.calculateVarint64(n);
  35498. case e.TYPES.sint64:
  35499. return t.calculateVarint64(t.zigZagEncode64(n));
  35500. case e.TYPES.fixed64:
  35501. case e.TYPES.sfixed64:
  35502. return 8;
  35503. case e.TYPES.bool:
  35504. return 1;
  35505. case e.TYPES.enum:
  35506. return t.calculateVarint32(n);
  35507. case e.TYPES.double:
  35508. return 8;
  35509. case e.TYPES.string:
  35510. return r = t.calculateUTF8Bytes(n),
  35511. t.calculateVarint32(r) + r;
  35512. case e.TYPES.bytes:
  35513. if (n.remaining() < 0)
  35514. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  35515. return t.calculateVarint32(n.remaining()) + n.remaining();
  35516. case e.TYPES.message:
  35517. return r = this.resolvedType.calculate(n),
  35518. t.calculateVarint32(r) + r;
  35519. case e.TYPES.group:
  35520. return r = this.resolvedType.calculate(n),
  35521. r + t.calculateVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP)
  35522. }
  35523. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  35524. }
  35525. ,
  35526. u.encodeValue = function(i, n, r) {
  35527. if (null === n)
  35528. return r;
  35529. switch (this.type) {
  35530. case e.TYPES.int32:
  35531. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n);
  35532. break;
  35533. case e.TYPES.uint32:
  35534. r.writeVarint32(n);
  35535. break;
  35536. case e.TYPES.sint32:
  35537. r.writeVarint32ZigZag(n);
  35538. break;
  35539. case e.TYPES.fixed32:
  35540. r.writeUint32(n);
  35541. break;
  35542. case e.TYPES.sfixed32:
  35543. r.writeInt32(n);
  35544. break;
  35545. case e.TYPES.int64:
  35546. case e.TYPES.uint64:
  35547. r.writeVarint64(n);
  35548. break;
  35549. case e.TYPES.sint64:
  35550. r.writeVarint64ZigZag(n);
  35551. break;
  35552. case e.TYPES.fixed64:
  35553. r.writeUint64(n);
  35554. break;
  35555. case e.TYPES.sfixed64:
  35556. r.writeInt64(n);
  35557. break;
  35558. case e.TYPES.bool:
  35559. "string" == typeof n ? r.writeVarint32("false" === n.toLowerCase() ? 0 : !!n) : r.writeVarint32(n ? 1 : 0);
  35560. break;
  35561. case e.TYPES.enum:
  35562. r.writeVarint32(n);
  35563. break;
  35564. case e.TYPES.float:
  35565. r.writeFloat32(n);
  35566. break;
  35567. case e.TYPES.double:
  35568. r.writeFloat64(n);
  35569. break;
  35570. case e.TYPES.string:
  35571. r.writeVString(n);
  35572. break;
  35573. case e.TYPES.bytes:
  35574. if (n.remaining() < 0)
  35575. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  35576. var o = n.offset;
  35577. r.writeVarint32(n.remaining()),
  35578. r.append(n),
  35579. n.offset = o;
  35580. break;
  35581. case e.TYPES.message:
  35582. var a = (new t).LE();
  35583. this.resolvedType.encode(n, a),
  35584. r.writeVarint32(a.offset),
  35585. r.append(a.flip());
  35586. break;
  35587. case e.TYPES.group:
  35588. this.resolvedType.encode(n, r),
  35589. r.writeVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP);
  35590. break;
  35591. default:
  35592. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  35593. }
  35594. return r
  35595. }
  35596. ,
  35597. u.decode = function(t, i, n) {
  35598. if (i != this.type.wireType)
  35599. throw Error("Unexpected wire type for element");
  35600. var r, o;
  35601. switch (this.type) {
  35602. case e.TYPES.int32:
  35603. return 0 | t.readVarint32();
  35604. case e.TYPES.uint32:
  35605. return t.readVarint32() >>> 0;
  35606. case e.TYPES.sint32:
  35607. return 0 | t.readVarint32ZigZag();
  35608. case e.TYPES.fixed32:
  35609. return t.readUint32() >>> 0;
  35610. case e.TYPES.sfixed32:
  35611. return 0 | t.readInt32();
  35612. case e.TYPES.int64:
  35613. return t.readVarint64();
  35614. case e.TYPES.uint64:
  35615. return t.readVarint64().toUnsigned();
  35616. case e.TYPES.sint64:
  35617. return t.readVarint64ZigZag();
  35618. case e.TYPES.fixed64:
  35619. return t.readUint64();
  35620. case e.TYPES.sfixed64:
  35621. return t.readInt64();
  35622. case e.TYPES.bool:
  35623. return !!t.readVarint32();
  35624. case e.TYPES.enum:
  35625. return t.readVarint32();
  35626. case e.TYPES.float:
  35627. return t.readFloat();
  35628. case e.TYPES.double:
  35629. return t.readDouble();
  35630. case e.TYPES.string:
  35631. return t.readVString();
  35632. case e.TYPES.bytes:
  35633. if (o = t.readVarint32(),
  35634. t.remaining() < o)
  35635. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + t.remaining());
  35636. return r = t.clone(),
  35637. r.limit = r.offset + o,
  35638. t.offset += o,
  35639. r;
  35640. case e.TYPES.message:
  35641. return o = t.readVarint32(),
  35642. this.resolvedType.decode(t, o);
  35643. case e.TYPES.group:
  35644. return this.resolvedType.decode(t, -1, n)
  35645. }
  35646. throw Error("[INTERNAL] Illegal decode type")
  35647. }
  35648. ,
  35649. u.valueFromString = function(i) {
  35650. if (!this.isMapKey)
  35651. throw Error("valueFromString() called on non-map-key element");
  35652. switch (this.type) {
  35653. case e.TYPES.int32:
  35654. case e.TYPES.sint32:
  35655. case e.TYPES.sfixed32:
  35656. case e.TYPES.uint32:
  35657. case e.TYPES.fixed32:
  35658. return this.verifyValue(parseInt(i));
  35659. case e.TYPES.int64:
  35660. case e.TYPES.sint64:
  35661. case e.TYPES.sfixed64:
  35662. case e.TYPES.uint64:
  35663. case e.TYPES.fixed64:
  35664. return this.verifyValue(i);
  35665. case e.TYPES.bool:
  35666. return "true" === i;
  35667. case e.TYPES.string:
  35668. return this.verifyValue(i);
  35669. case e.TYPES.bytes:
  35670. return t.fromBinary(i)
  35671. }
  35672. }
  35673. ,
  35674. u.valueToString = function(t) {
  35675. if (!this.isMapKey)
  35676. throw Error("valueToString() called on non-map-key element");
  35677. return this.type === e.TYPES.bytes ? t.toString("binary") : t.toString()
  35678. }
  35679. ,
  35680. o.Element = h;
  35681. var d = function(e, t, i, n, r, o) {
  35682. l.call(this, e, t, i, n, o),
  35683. this.className = "Message",
  35684. this.extensions = void 0,
  35685. this.clazz = null,
  35686. this.isGroup = !!r,
  35687. this._fields = null,
  35688. this._fieldsById = null,
  35689. this._fieldsByName = null
  35690. }
  35691. , p = d.prototype = Object.create(l.prototype);
  35692. p.build = function(i) {
  35693. if (this.clazz && !i)
  35694. return this.clazz;
  35695. var n = function(e, i) {
  35696. function n(i, r, o, a) {
  35697. if (null === i || "object" != typeof i) {
  35698. if (a && a instanceof e.Reflect.Enum) {
  35699. var s = e.Reflect.Enum.getName(a.object, i);
  35700. if (null !== s)
  35701. return s
  35702. }
  35703. return i
  35704. }
  35705. if (t.isByteBuffer(i))
  35706. return r ? i.toBase64() : i.toBuffer();
  35707. if (e.Long.isLong(i))
  35708. return o ? i.toString() : e.Long.fromValue(i);
  35709. var l;
  35710. if (Array.isArray(i))
  35711. return l = [],
  35712. i.forEach(function(e, t) {
  35713. l[t] = n(e, r, o, a)
  35714. }),
  35715. l;
  35716. if (l = {},
  35717. i instanceof e.Map) {
  35718. for (var c = i.entries(), h = c.next(); !h.done; h = c.next())
  35719. l[i.keyElem.valueToString(h.value[0])] = n(h.value[1], r, o, i.valueElem.resolvedType);
  35720. return l
  35721. }
  35722. var u = i.$type
  35723. , d = void 0;
  35724. for (var p in i)
  35725. i.hasOwnProperty(p) && (u && (d = u.getChild(p)) ? l[p] = n(i[p], r, o, d.resolvedType) : l[p] = n(i[p], r, o));
  35726. return l
  35727. }
  35728. var r = i.getChildren(e.Reflect.Message.Field)
  35729. , o = i.getChildren(e.Reflect.Message.OneOf)
  35730. , a = function(n, s) {
  35731. e.Builder.Message.call(this);
  35732. for (var l = 0, c = o.length; l < c; ++l)
  35733. this[o[l].name] = null;
  35734. for (l = 0,
  35735. c = r.length; l < c; ++l) {
  35736. var h = r[l];
  35737. this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null,
  35738. !h.required && "proto3" !== i.syntax || null === h.defaultValue || (this[h.name] = h.defaultValue)
  35739. }
  35740. if (arguments.length > 0) {
  35741. var u;
  35742. if (1 !== arguments.length || null === n || "object" != typeof n || !("function" != typeof n.encode || n instanceof a) || Array.isArray(n) || n instanceof e.Map || t.isByteBuffer(n) || n instanceof ArrayBuffer || e.Long && n instanceof e.Long)
  35743. for (l = 0,
  35744. c = arguments.length; l < c; ++l)
  35745. "undefined" != typeof (u = arguments[l]) && this.$set(r[l].name, u);
  35746. else
  35747. this.$set(n)
  35748. }
  35749. }
  35750. , s = a.prototype = Object.create(e.Builder.Message.prototype);
  35751. s.add = function(t, n, r) {
  35752. var o = i._fieldsByName[t];
  35753. if (!r) {
  35754. if (!o)
  35755. throw Error(this + "#" + t + " is undefined");
  35756. if (!(o instanceof e.Reflect.Message.Field))
  35757. throw Error(this + "#" + t + " is not a field: " + o.toString(!0));
  35758. if (!o.repeated)
  35759. throw Error(this + "#" + t + " is not a repeated field");
  35760. n = o.verifyValue(n, !0)
  35761. }
  35762. return null === this[t] && (this[t] = []),
  35763. this[t].push(n),
  35764. this
  35765. }
  35766. ,
  35767. s.$add = s.add,
  35768. s.set = function(t, n, r) {
  35769. if (t && "object" == typeof t) {
  35770. r = n;
  35771. for (var o in t)
  35772. t.hasOwnProperty(o) && "undefined" != typeof (n = t[o]) && this.$set(o, n, r);
  35773. return this
  35774. }
  35775. var a = i._fieldsByName[t];
  35776. if (r)
  35777. this[t] = n;
  35778. else {
  35779. if (!a)
  35780. throw Error(this + "#" + t + " is not a field: undefined");
  35781. if (!(a instanceof e.Reflect.Message.Field))
  35782. throw Error(this + "#" + t + " is not a field: " + a.toString(!0));
  35783. this[a.name] = n = a.verifyValue(n)
  35784. }
  35785. if (a && a.oneof) {
  35786. var s = this[a.oneof.name];
  35787. null !== n ? (null !== s && s !== a.name && (this[s] = null),
  35788. this[a.oneof.name] = a.name) : s === t && (this[a.oneof.name] = null)
  35789. }
  35790. return this
  35791. }
  35792. ,
  35793. s.$set = s.set,
  35794. s.get = function(t, n) {
  35795. if (n)
  35796. return this[t];
  35797. var r = i._fieldsByName[t];
  35798. if (!(r && r instanceof e.Reflect.Message.Field))
  35799. throw Error(this + "#" + t + " is not a field: undefined");
  35800. if (!(r instanceof e.Reflect.Message.Field))
  35801. throw Error(this + "#" + t + " is not a field: " + r.toString(!0));
  35802. return this[r.name]
  35803. }
  35804. ,
  35805. s.$get = s.get;
  35806. for (var l = 0; l < r.length; l++) {
  35807. var c = r[l];
  35808. c instanceof e.Reflect.Message.ExtensionField || i.builder.options.populateAccessors && function(e) {
  35809. var t = e.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  35810. return e.toUpperCase().replace("_", "")
  35811. });
  35812. t = t.substring(0, 1).toUpperCase() + t.substring(1);
  35813. var n = e.originalName.replace(/([A-Z])/g, function(e) {
  35814. return "_" + e
  35815. })
  35816. , r = function(t, i) {
  35817. return this[e.name] = i ? t : e.verifyValue(t),
  35818. this
  35819. }
  35820. , o = function() {
  35821. return this[e.name]
  35822. };
  35823. null === i.getChild("set" + t) && (s["set" + t] = r),
  35824. null === i.getChild("set_" + n) && (s["set_" + n] = r),
  35825. null === i.getChild("get" + t) && (s["get" + t] = o),
  35826. null === i.getChild("get_" + n) && (s["get_" + n] = o)
  35827. }(c)
  35828. }
  35829. s.encode = function(e, n) {
  35830. "boolean" == typeof e && (n = e,
  35831. e = void 0);
  35832. var r = !1;
  35833. e || (e = new t,
  35834. r = !0);
  35835. var o = e.littleEndian;
  35836. try {
  35837. return i.encode(this, e.LE(), n),
  35838. (r ? e.flip() : e).LE(o)
  35839. } catch (t) {
  35840. throw e.LE(o),
  35841. t
  35842. }
  35843. }
  35844. ,
  35845. a.encode = function(e, t, i) {
  35846. return new a(e).encode(t, i)
  35847. }
  35848. ,
  35849. s.calculate = function() {
  35850. return i.calculate(this)
  35851. }
  35852. ,
  35853. s.encodeDelimited = function(e, n) {
  35854. var r = !1;
  35855. e || (e = new t,
  35856. r = !0);
  35857. var o = (new t).LE();
  35858. return i.encode(this, o, n).flip(),
  35859. e.writeVarint32(o.remaining()),
  35860. e.append(o),
  35861. r ? e.flip() : e
  35862. }
  35863. ,
  35864. s.encodeAB = function() {
  35865. try {
  35866. return this.encode().toArrayBuffer()
  35867. } catch (e) {
  35868. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  35869. e
  35870. }
  35871. }
  35872. ,
  35873. s.toArrayBuffer = s.encodeAB,
  35874. s.encodeNB = function() {
  35875. try {
  35876. return this.encode().toBuffer()
  35877. } catch (e) {
  35878. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  35879. e
  35880. }
  35881. }
  35882. ,
  35883. s.toBuffer = s.encodeNB,
  35884. s.encode64 = function() {
  35885. try {
  35886. return this.encode().toBase64()
  35887. } catch (e) {
  35888. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  35889. e
  35890. }
  35891. }
  35892. ,
  35893. s.toBase64 = s.encode64,
  35894. s.encodeHex = function() {
  35895. try {
  35896. return this.encode().toHex()
  35897. } catch (e) {
  35898. throw e.encoded && (e.encoded = e.encoded.toHex()),
  35899. e
  35900. }
  35901. }
  35902. ,
  35903. s.toHex = s.encodeHex,
  35904. s.toRaw = function(e, t) {
  35905. return n(this, !!e, !!t, this.$type)
  35906. }
  35907. ,
  35908. s.encodeJSON = function() {
  35909. return JSON.stringify(n(this, !0, !0, this.$type))
  35910. }
  35911. ,
  35912. a.decode = function(e, n, r) {
  35913. "string" == typeof n && (r = n,
  35914. n = -1),
  35915. "string" == typeof e && (e = t.wrap(e, r ? r : "base64")),
  35916. e = t.isByteBuffer(e) ? e : t.wrap(e);
  35917. var o = e.littleEndian;
  35918. try {
  35919. var a = i.decode(e.LE());
  35920. return e.LE(o),
  35921. a
  35922. } catch (t) {
  35923. throw e.LE(o),
  35924. t
  35925. }
  35926. }
  35927. ,
  35928. a.decodeDelimited = function(e, n) {
  35929. if ("string" == typeof e && (e = t.wrap(e, n ? n : "base64")),
  35930. e = t.isByteBuffer(e) ? e : t.wrap(e),
  35931. e.remaining() < 1)
  35932. return null;
  35933. var r = e.offset
  35934. , o = e.readVarint32();
  35935. if (e.remaining() < o)
  35936. return e.offset = r,
  35937. null;
  35938. try {
  35939. var a = i.decode(e.slice(e.offset, e.offset + o).LE());
  35940. return e.offset += o,
  35941. a
  35942. } catch (t) {
  35943. throw e.offset += o,
  35944. t
  35945. }
  35946. }
  35947. ,
  35948. a.decode64 = function(e) {
  35949. return a.decode(e, "base64")
  35950. }
  35951. ,
  35952. a.decodeHex = function(e) {
  35953. return a.decode(e, "hex")
  35954. }
  35955. ,
  35956. a.decodeJSON = function(e) {
  35957. return new a(JSON.parse(e))
  35958. }
  35959. ,
  35960. s.toString = function() {
  35961. return i.toString()
  35962. }
  35963. ;
  35964. return Object.defineProperty && (Object.defineProperty(a, "$options", {
  35965. value: i.buildOpt()
  35966. }),
  35967. Object.defineProperty(s, "$options", {
  35968. value: a.$options
  35969. }),
  35970. Object.defineProperty(a, "$type", {
  35971. value: i
  35972. }),
  35973. Object.defineProperty(s, "$type", {
  35974. value: i
  35975. })),
  35976. a
  35977. }(e, this);
  35978. this._fields = [],
  35979. this._fieldsById = {},
  35980. this._fieldsByName = {};
  35981. for (var r, o = 0, a = this.children.length; o < a; o++)
  35982. if (r = this.children[o],
  35983. r instanceof A || r instanceof d || r instanceof E) {
  35984. if (n.hasOwnProperty(r.name))
  35985. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + r.toString(!0) + " cannot override static property '" + r.name + "'");
  35986. n[r.name] = r.build()
  35987. } else if (r instanceof d.Field)
  35988. r.build(),
  35989. this._fields.push(r),
  35990. this._fieldsById[r.id] = r,
  35991. this._fieldsByName[r.name] = r;
  35992. else if (!(r instanceof d.OneOf || r instanceof I))
  35993. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[o].toString(!0));
  35994. return this.clazz = n
  35995. }
  35996. ,
  35997. p.encode = function(e, t, i) {
  35998. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  35999. n = this._fields[a],
  36000. r = e[n.name],
  36001. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  36002. if (null !== o) {
  36003. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  36004. throw l.encoded = t,
  36005. l
  36006. }
  36007. return t
  36008. }
  36009. ,
  36010. p.calculate = function(e) {
  36011. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  36012. if (t = this._fields[r],
  36013. i = e[t.name],
  36014. t.required && null === i)
  36015. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  36016. n += t.calculate(i, e)
  36017. }
  36018. return n
  36019. }
  36020. ,
  36021. p.decode = function(t, i, n) {
  36022. i = "number" == typeof i ? i : -1;
  36023. for (var o, a, s, l, c = t.offset, h = new this.clazz; t.offset < c + i || i === -1 && t.remaining() > 0; ) {
  36024. if (o = t.readVarint32(),
  36025. a = 7 & o,
  36026. s = o >>> 3,
  36027. a === e.WIRE_TYPES.ENDGROUP) {
  36028. if (s !== n)
  36029. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + s + " (" + (n ? n + " expected" : "not a group") + ")");
  36030. break
  36031. }
  36032. if (l = this._fieldsById[s]) {
  36033. if (l.repeated && !l.options.packed)
  36034. h[l.name].push(l.decode(a, t));
  36035. else if (l.map) {
  36036. var u = l.decode(a, t);
  36037. h[l.name].set(u[0], u[1])
  36038. } else if (h[l.name] = l.decode(a, t),
  36039. l.oneof) {
  36040. var d = h[l.oneof.name];
  36041. null !== d && d !== l.name && (h[d] = null),
  36042. h[l.oneof.name] = l.name
  36043. }
  36044. } else
  36045. switch (a) {
  36046. case e.WIRE_TYPES.VARINT:
  36047. t.readVarint32();
  36048. break;
  36049. case e.WIRE_TYPES.BITS32:
  36050. t.offset += 4;
  36051. break;
  36052. case e.WIRE_TYPES.BITS64:
  36053. t.offset += 8;
  36054. break;
  36055. case e.WIRE_TYPES.LDELIM:
  36056. var p = t.readVarint32();
  36057. t.offset += p;
  36058. break;
  36059. case e.WIRE_TYPES.STARTGROUP:
  36060. for (; r(s, t); )
  36061. ;
  36062. break;
  36063. default:
  36064. throw Error("Illegal wire type for unknown field " + s + " in " + this.toString(!0) + "#decode: " + a)
  36065. }
  36066. }
  36067. for (var f = 0, g = this._fields.length; f < g; ++f)
  36068. if (l = this._fields[f],
  36069. null === h[l.name])
  36070. if ("proto3" === this.syntax)
  36071. h[l.name] = l.defaultValue;
  36072. else {
  36073. if (l.required) {
  36074. var m = Error("Missing at least one required field for " + this.toString(!0) + ": " + l.name);
  36075. throw m.decoded = h,
  36076. m
  36077. }
  36078. e.populateDefaults && null !== l.defaultValue && (h[l.name] = l.defaultValue)
  36079. }
  36080. return h
  36081. }
  36082. ,
  36083. o.Message = d;
  36084. var f = function(t, i, n, r, o, s, l, c, h, u) {
  36085. a.call(this, t, i, s),
  36086. this.className = "Message.Field",
  36087. this.required = "required" === n,
  36088. this.repeated = "repeated" === n,
  36089. this.map = "map" === n,
  36090. this.keyType = r || null,
  36091. this.type = o,
  36092. this.resolvedType = null,
  36093. this.id = l,
  36094. this.options = c || {},
  36095. this.defaultValue = null,
  36096. this.oneof = h || null,
  36097. this.syntax = u || "proto2",
  36098. this.originalName = this.name,
  36099. this.element = null,
  36100. this.keyElement = null,
  36101. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = e.Util.toCamelCase(this.name))
  36102. }
  36103. , g = f.prototype = Object.create(a.prototype);
  36104. g.build = function() {
  36105. this.element = new h(this.type,this.resolvedType,!1,this.syntax),
  36106. this.map && (this.keyElement = new h(this.keyType,void 0,!0,this.syntax)),
  36107. "proto3" !== this.syntax || this.repeated || this.map ? "undefined" != typeof this.options.default && (this.defaultValue = this.verifyValue(this.options.default)) : this.defaultValue = h.defaultFieldValue(this.type)
  36108. }
  36109. ,
  36110. g.verifyValue = function(t, i) {
  36111. function n(e, t) {
  36112. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  36113. }
  36114. i = i || !1;
  36115. var r = this;
  36116. if (null === t)
  36117. return this.required && n(typeof t, "required"),
  36118. "proto3" === this.syntax && this.type !== e.TYPES.message && n(typeof t, "proto3 field without field presence cannot be null"),
  36119. null;
  36120. var o;
  36121. if (this.repeated && !i) {
  36122. Array.isArray(t) || (t = [t]);
  36123. var a = [];
  36124. for (o = 0; o < t.length; o++)
  36125. a.push(this.element.verifyValue(t[o]));
  36126. return a
  36127. }
  36128. return this.map && !i ? t instanceof e.Map ? t : (t instanceof Object || n(typeof t, "expected ProtoBuf.Map or raw object for map field"),
  36129. new e.Map(this,t)) : (!this.repeated && Array.isArray(t) && n(typeof t, "no array expected"),
  36130. this.element.verifyValue(t))
  36131. }
  36132. ,
  36133. g.hasWirePresence = function(t, i) {
  36134. if ("proto3" !== this.syntax)
  36135. return null !== t;
  36136. if (this.oneof && i[this.oneof.name] === this.name)
  36137. return !0;
  36138. switch (this.type) {
  36139. case e.TYPES.int32:
  36140. case e.TYPES.sint32:
  36141. case e.TYPES.sfixed32:
  36142. case e.TYPES.uint32:
  36143. case e.TYPES.fixed32:
  36144. return 0 !== t;
  36145. case e.TYPES.int64:
  36146. case e.TYPES.sint64:
  36147. case e.TYPES.sfixed64:
  36148. case e.TYPES.uint64:
  36149. case e.TYPES.fixed64:
  36150. return 0 !== t.low || 0 !== t.high;
  36151. case e.TYPES.bool:
  36152. return t;
  36153. case e.TYPES.float:
  36154. case e.TYPES.double:
  36155. return 0 !== t;
  36156. case e.TYPES.string:
  36157. return t.length > 0;
  36158. case e.TYPES.bytes:
  36159. return t.remaining() > 0;
  36160. case e.TYPES.enum:
  36161. return 0 !== t;
  36162. case e.TYPES.message:
  36163. return null !== t;
  36164. default:
  36165. return !0
  36166. }
  36167. }
  36168. ,
  36169. g.encode = function(i, n, r) {
  36170. if (null === this.type || "object" != typeof this.type)
  36171. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  36172. if (null === i || this.repeated && 0 == i.length)
  36173. return n;
  36174. try {
  36175. if (this.repeated) {
  36176. var o;
  36177. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  36178. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36179. n.ensureCapacity(n.offset += 1);
  36180. var a = n.offset;
  36181. for (o = 0; o < i.length; o++)
  36182. this.element.encodeValue(this.id, i[o], n);
  36183. var s = n.offset - a
  36184. , l = t.calculateVarint32(s);
  36185. if (l > 1) {
  36186. var c = n.slice(a, n.offset);
  36187. a += l - 1,
  36188. n.offset = a,
  36189. n.append(c)
  36190. }
  36191. n.writeVarint32(s, a - l)
  36192. } else
  36193. for (o = 0; o < i.length; o++)
  36194. n.writeVarint32(this.id << 3 | this.type.wireType),
  36195. this.element.encodeValue(this.id, i[o], n)
  36196. } else
  36197. this.map ? i.forEach(function(i, r, o) {
  36198. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, r) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  36199. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36200. n.writeVarint32(a),
  36201. n.writeVarint32(8 | this.keyType.wireType),
  36202. this.keyElement.encodeValue(1, r, n),
  36203. n.writeVarint32(16 | this.type.wireType),
  36204. this.element.encodeValue(2, i, n)
  36205. }, this) : this.hasWirePresence(i, r) && (n.writeVarint32(this.id << 3 | this.type.wireType),
  36206. this.element.encodeValue(this.id, i, n))
  36207. } catch (e) {
  36208. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  36209. }
  36210. return n
  36211. }
  36212. ,
  36213. g.calculate = function(i, n) {
  36214. if (i = this.verifyValue(i),
  36215. null === this.type || "object" != typeof this.type)
  36216. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  36217. if (null === i || this.repeated && 0 == i.length)
  36218. return 0;
  36219. var r = 0;
  36220. try {
  36221. if (this.repeated) {
  36222. var o, a;
  36223. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  36224. for (r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36225. a = 0,
  36226. o = 0; o < i.length; o++)
  36227. a += this.element.calculateLength(this.id, i[o]);
  36228. r += t.calculateVarint32(a),
  36229. r += a
  36230. } else
  36231. for (o = 0; o < i.length; o++)
  36232. r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  36233. r += this.element.calculateLength(this.id, i[o])
  36234. } else
  36235. this.map ? i.forEach(function(i, n, o) {
  36236. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, n) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  36237. r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36238. r += t.calculateVarint32(a),
  36239. r += a
  36240. }, this) : this.hasWirePresence(i, n) && (r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  36241. r += this.element.calculateLength(this.id, i))
  36242. } catch (e) {
  36243. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  36244. }
  36245. return r
  36246. }
  36247. ,
  36248. g.decode = function(t, i, n) {
  36249. var r, o, a = !this.map && t == this.type.wireType || !n && this.repeated && this.options.packed && t == e.WIRE_TYPES.LDELIM || this.map && t == e.WIRE_TYPES.LDELIM;
  36250. if (!a)
  36251. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + t + " (" + this.type.wireType + " expected)");
  36252. if (t == e.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !n) {
  36253. o = i.readVarint32(),
  36254. o = i.offset + o;
  36255. for (var s = []; i.offset < o; )
  36256. s.push(this.decode(this.type.wireType, i, !0));
  36257. return s
  36258. }
  36259. if (this.map) {
  36260. var l = h.defaultFieldValue(this.keyType);
  36261. if (r = h.defaultFieldValue(this.type),
  36262. o = i.readVarint32(),
  36263. i.remaining() < o)
  36264. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + i.remaining());
  36265. var c = i.clone();
  36266. for (c.limit = c.offset + o,
  36267. i.offset += o; c.remaining() > 0; ) {
  36268. var u = c.readVarint32();
  36269. t = 7 & u;
  36270. var d = u >>> 3;
  36271. if (1 === d)
  36272. l = this.keyElement.decode(c, t, d);
  36273. else {
  36274. if (2 !== d)
  36275. throw Error("Unexpected tag in map field key/value submessage");
  36276. r = this.element.decode(c, t, d)
  36277. }
  36278. }
  36279. return [l, r]
  36280. }
  36281. return this.element.decode(i, t, this.id)
  36282. }
  36283. ,
  36284. o.Message.Field = f;
  36285. var m = function(e, t, i, n, r, o, a) {
  36286. f.call(this, e, t, i, null, n, r, o, a),
  36287. this.extension
  36288. };
  36289. m.prototype = Object.create(f.prototype),
  36290. o.Message.ExtensionField = m;
  36291. var v = function(e, t, i) {
  36292. a.call(this, e, t, i),
  36293. this.fields = []
  36294. };
  36295. o.Message.OneOf = v;
  36296. var A = function(e, t, i, n, r) {
  36297. l.call(this, e, t, i, n, r),
  36298. this.className = "Enum",
  36299. this.object = null
  36300. };
  36301. A.getName = function(e, t) {
  36302. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  36303. if (e[i = n[r]] === t)
  36304. return i;
  36305. return null
  36306. }
  36307. ;
  36308. var y = A.prototype = Object.create(l.prototype);
  36309. y.build = function(t) {
  36310. if (this.object && !t)
  36311. return this.object;
  36312. for (var i = new e.Builder.Enum, n = this.getChildren(A.Value), r = 0, o = n.length; r < o; ++r)
  36313. i[n[r].name] = n[r].id;
  36314. return Object.defineProperty && Object.defineProperty(i, "$options", {
  36315. value: this.buildOpt(),
  36316. enumerable: !1
  36317. }),
  36318. this.object = i
  36319. }
  36320. ,
  36321. o.Enum = A;
  36322. var C = function(e, t, i, n) {
  36323. a.call(this, e, t, i),
  36324. this.className = "Enum.Value",
  36325. this.id = n
  36326. };
  36327. C.prototype = Object.create(a.prototype),
  36328. o.Enum.Value = C;
  36329. var I = function(e, t, i, n) {
  36330. a.call(this, e, t, i),
  36331. this.field = n
  36332. };
  36333. I.prototype = Object.create(a.prototype),
  36334. o.Extension = I;
  36335. var E = function(e, t, i, n) {
  36336. l.call(this, e, t, i, n),
  36337. this.className = "Service",
  36338. this.clazz = null
  36339. }
  36340. , b = E.prototype = Object.create(l.prototype);
  36341. b.build = function(i) {
  36342. return this.clazz && !i ? this.clazz : this.clazz = function(e, i) {
  36343. for (var n = function(t) {
  36344. e.Builder.Service.call(this),
  36345. this.rpcImpl = t || function(e, t, i) {
  36346. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  36347. }
  36348. }, r = n.prototype = Object.create(e.Builder.Service.prototype), o = i.getChildren(e.Reflect.Service.RPCMethod), a = 0; a < o.length; a++)
  36349. !function(e) {
  36350. r[e.name] = function(n, r) {
  36351. try {
  36352. try {
  36353. n = e.resolvedRequestType.clazz.decode(t.wrap(n))
  36354. } catch (e) {
  36355. if (!(e instanceof TypeError))
  36356. throw e
  36357. }
  36358. if (null === n || "object" != typeof n)
  36359. throw Error("Illegal arguments");
  36360. n instanceof e.resolvedRequestType.clazz || (n = new e.resolvedRequestType.clazz(n)),
  36361. this.rpcImpl(e.fqn(), n, function(t, n) {
  36362. if (t)
  36363. return void r(t);
  36364. null === n && (n = "");
  36365. try {
  36366. n = e.resolvedResponseType.clazz.decode(n)
  36367. } catch (e) {}
  36368. return n && n instanceof e.resolvedResponseType.clazz ? void r(null, n) : void r(Error("Illegal response type received in service method " + i.name + "#" + e.name))
  36369. })
  36370. } catch (e) {
  36371. setTimeout(r.bind(this, e), 0)
  36372. }
  36373. }
  36374. ,
  36375. n[e.name] = function(t, i, r) {
  36376. new n(t)[e.name](i, r)
  36377. }
  36378. ,
  36379. Object.defineProperty && (Object.defineProperty(n[e.name], "$options", {
  36380. value: e.buildOpt()
  36381. }),
  36382. Object.defineProperty(r[e.name], "$options", {
  36383. value: n[e.name].$options
  36384. }))
  36385. }(o[a]);
  36386. return Object.defineProperty && (Object.defineProperty(n, "$options", {
  36387. value: i.buildOpt()
  36388. }),
  36389. Object.defineProperty(r, "$options", {
  36390. value: n.$options
  36391. }),
  36392. Object.defineProperty(n, "$type", {
  36393. value: i
  36394. }),
  36395. Object.defineProperty(r, "$type", {
  36396. value: i
  36397. })),
  36398. n
  36399. }(e, this)
  36400. }
  36401. ,
  36402. o.Service = E;
  36403. var w = function(e, t, i, n) {
  36404. a.call(this, e, t, i),
  36405. this.className = "Service.Method",
  36406. this.options = n || {}
  36407. }
  36408. , _ = w.prototype = Object.create(a.prototype);
  36409. _.buildOpt = c.buildOpt,
  36410. o.Service.Method = w;
  36411. var T = function(e, t, i, n, r, o, a, s) {
  36412. w.call(this, e, t, i, s),
  36413. this.className = "Service.RPCMethod",
  36414. this.requestName = n,
  36415. this.responseName = r,
  36416. this.requestStream = o,
  36417. this.responseStream = a,
  36418. this.resolvedRequestType = null,
  36419. this.resolvedResponseType = null
  36420. };
  36421. return T.prototype = Object.create(w.prototype),
  36422. o.Service.RPCMethod = T,
  36423. o
  36424. }(r),
  36425. r.Builder = function(t, i, n) {
  36426. function r(e) {
  36427. e.messages && e.messages.forEach(function(t) {
  36428. t.syntax = e.syntax,
  36429. r(t)
  36430. }),
  36431. e.enums && e.enums.forEach(function(t) {
  36432. t.syntax = e.syntax
  36433. })
  36434. }
  36435. var o = function(e) {
  36436. this.ns = new n.Namespace(this,null,""),
  36437. this.ptr = this.ns,
  36438. this.resolved = !1,
  36439. this.result = null,
  36440. this.files = {},
  36441. this.importRoot = null,
  36442. this.options = e || {}
  36443. }
  36444. , a = o.prototype;
  36445. return o.isMessage = function(e) {
  36446. return "string" == typeof e.name && ("undefined" == typeof e.values && "undefined" == typeof e.rpc)
  36447. }
  36448. ,
  36449. o.isMessageField = function(e) {
  36450. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && "undefined" != typeof e.id
  36451. }
  36452. ,
  36453. o.isEnum = function(e) {
  36454. return "string" == typeof e.name && !("undefined" == typeof e.values || !Array.isArray(e.values) || 0 === e.values.length)
  36455. }
  36456. ,
  36457. o.isService = function(e) {
  36458. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  36459. }
  36460. ,
  36461. o.isExtend = function(e) {
  36462. return "string" == typeof e.ref
  36463. }
  36464. ,
  36465. a.reset = function() {
  36466. return this.ptr = this.ns,
  36467. this
  36468. }
  36469. ,
  36470. a.define = function(e) {
  36471. if ("string" != typeof e || !i.TYPEREF.test(e))
  36472. throw Error("illegal namespace: " + e);
  36473. return e.split(".").forEach(function(e) {
  36474. var t = this.ptr.getChild(e);
  36475. null === t && this.ptr.addChild(t = new n.Namespace(this,this.ptr,e)),
  36476. this.ptr = t
  36477. }, this),
  36478. this
  36479. }
  36480. ,
  36481. a.create = function(e) {
  36482. if (!e)
  36483. return this;
  36484. if (Array.isArray(e)) {
  36485. if (0 === e.length)
  36486. return this;
  36487. e = e.slice()
  36488. } else
  36489. e = [e];
  36490. for (var i = [e]; i.length > 0; ) {
  36491. if (e = i.pop(),
  36492. !Array.isArray(e))
  36493. throw Error("not a valid namespace: " + JSON.stringify(e));
  36494. for (; e.length > 0; ) {
  36495. var r = e.shift();
  36496. if (o.isMessage(r)) {
  36497. var a = new n.Message(this,this.ptr,r.name,r.options,r.isGroup,r.syntax)
  36498. , s = {};
  36499. r.oneofs && Object.keys(r.oneofs).forEach(function(e) {
  36500. a.addChild(s[e] = new n.Message.OneOf(this,a,e))
  36501. }, this),
  36502. r.fields && r.fields.forEach(function(e) {
  36503. if (null !== a.getChild(0 | e.id))
  36504. throw Error("duplicate or invalid field id in " + a.name + ": " + e.id);
  36505. if (e.options && "object" != typeof e.options)
  36506. throw Error("illegal field options in " + a.name + "#" + e.name);
  36507. var t = null;
  36508. if ("string" == typeof e.oneof && !(t = s[e.oneof]))
  36509. throw Error("illegal oneof in " + a.name + "#" + e.name + ": " + e.oneof);
  36510. e = new n.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,r.syntax),
  36511. t && t.fields.push(e),
  36512. a.addChild(e)
  36513. }, this);
  36514. var l = [];
  36515. if (r.enums && r.enums.forEach(function(e) {
  36516. l.push(e)
  36517. }),
  36518. r.messages && r.messages.forEach(function(e) {
  36519. l.push(e)
  36520. }),
  36521. r.services && r.services.forEach(function(e) {
  36522. l.push(e)
  36523. }),
  36524. r.extensions && ("number" == typeof r.extensions[0] ? a.extensions = [r.extensions] : a.extensions = r.extensions),
  36525. this.ptr.addChild(a),
  36526. l.length > 0) {
  36527. i.push(e),
  36528. e = l,
  36529. l = null,
  36530. this.ptr = a,
  36531. a = null;
  36532. continue
  36533. }
  36534. l = null
  36535. } else if (o.isEnum(r))
  36536. a = new n.Enum(this,this.ptr,r.name,r.options,r.syntax),
  36537. r.values.forEach(function(e) {
  36538. a.addChild(new n.Enum.Value(this,a,e.name,e.id))
  36539. }, this),
  36540. this.ptr.addChild(a);
  36541. else if (o.isService(r))
  36542. a = new n.Service(this,this.ptr,r.name,r.options),
  36543. Object.keys(r.rpc).forEach(function(e) {
  36544. var t = r.rpc[e];
  36545. a.addChild(new n.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  36546. }, this),
  36547. this.ptr.addChild(a);
  36548. else {
  36549. if (!o.isExtend(r))
  36550. throw Error("not a valid definition: " + JSON.stringify(r));
  36551. if (a = this.ptr.resolve(r.ref, !0))
  36552. r.fields.forEach(function(e) {
  36553. if (null !== a.getChild(0 | e.id))
  36554. throw Error("duplicate extended field id in " + a.name + ": " + e.id);
  36555. if (a.extensions) {
  36556. var i = !1;
  36557. if (a.extensions.forEach(function(t) {
  36558. e.id >= t[0] && e.id <= t[1] && (i = !0)
  36559. }),
  36560. !i)
  36561. throw Error("illegal extended field id in " + a.name + ": " + e.id + " (not within valid ranges)")
  36562. }
  36563. var r = e.name;
  36564. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r));
  36565. var o = new n.Message.ExtensionField(this,a,e.rule,e.type,this.ptr.fqn() + "." + r,e.id,e.options)
  36566. , s = new n.Extension(this,this.ptr,e.name,o);
  36567. o.extension = s,
  36568. this.ptr.addChild(s),
  36569. a.addChild(o)
  36570. }, this);
  36571. else if (!/\.?google\.protobuf\./.test(r.ref))
  36572. throw Error("extended message " + r.ref + " is not defined")
  36573. }
  36574. r = null,
  36575. a = null
  36576. }
  36577. e = null,
  36578. this.ptr = this.ptr.parent
  36579. }
  36580. return this.resolved = !1,
  36581. this.result = null,
  36582. this
  36583. }
  36584. ,
  36585. a.import = function(i, n) {
  36586. var o = "/";
  36587. if ("string" == typeof n) {
  36588. if (t.Util.IS_NODE && (n = e("path").resolve(n)),
  36589. this.files[n] === !0)
  36590. return this.reset();
  36591. this.files[n] = !0
  36592. } else if ("object" == typeof n) {
  36593. var a = n.root;
  36594. t.Util.IS_NODE && (a = e("path").resolve(a)),
  36595. (a.indexOf("\\") >= 0 || n.file.indexOf("\\") >= 0) && (o = "\\");
  36596. var s = a + o + n.file;
  36597. if (this.files[s] === !0)
  36598. return this.reset();
  36599. this.files[s] = !0
  36600. }
  36601. if (i.imports && i.imports.length > 0) {
  36602. var l, c = !1;
  36603. "object" == typeof n ? (this.importRoot = n.root,
  36604. c = !0,
  36605. l = this.importRoot,
  36606. n = n.file,
  36607. (l.indexOf("\\") >= 0 || n.indexOf("\\") >= 0) && (o = "\\")) : "string" == typeof n ? this.importRoot ? l = this.importRoot : n.indexOf("/") >= 0 ? (l = n.replace(/\/[^\/]*$/, ""),
  36608. "" === l && (l = "/")) : n.indexOf("\\") >= 0 ? (l = n.replace(/\\[^\\]*$/, ""),
  36609. o = "\\") : l = "." : l = null;
  36610. for (var h = 0; h < i.imports.length; h++)
  36611. if ("string" == typeof i.imports[h]) {
  36612. if (!l)
  36613. throw Error("cannot determine import root");
  36614. var u = i.imports[h];
  36615. if ("google/protobuf/descriptor.proto" === u)
  36616. continue;
  36617. if (u = l + o + u,
  36618. this.files[u] === !0)
  36619. continue;
  36620. /\.proto$/i.test(u) && !t.DotProto && (u = u.replace(/\.proto$/, ".json"));
  36621. var d = t.Util.fetch(u);
  36622. if (null === d)
  36623. throw Error("failed to import '" + u + "' in '" + n + "': file not found");
  36624. /\.json$/i.test(u) ? this.import(JSON.parse(d + ""), u) : this.import(t.DotProto.Parser.parse(d), u)
  36625. } else
  36626. n ? /\.(\w+)$/.test(n) ? this.import(i.imports[h], n.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  36627. return t + "_import" + h + "." + i
  36628. })) : this.import(i.imports[h], n + "_import" + h) : this.import(i.imports[h]);
  36629. c && (this.importRoot = null)
  36630. }
  36631. i.package && this.define(i.package),
  36632. i.syntax && r(i);
  36633. var p = this.ptr;
  36634. return i.options && Object.keys(i.options).forEach(function(e) {
  36635. p.options[e] = i.options[e]
  36636. }),
  36637. i.messages && (this.create(i.messages),
  36638. this.ptr = p),
  36639. i.enums && (this.create(i.enums),
  36640. this.ptr = p),
  36641. i.services && (this.create(i.services),
  36642. this.ptr = p),
  36643. i.extends && this.create(i.extends),
  36644. this.reset()
  36645. }
  36646. ,
  36647. a.resolveAll = function() {
  36648. var e;
  36649. if (null == this.ptr || "object" == typeof this.ptr.type)
  36650. return this;
  36651. if (this.ptr instanceof n.Namespace)
  36652. this.ptr.children.forEach(function(e) {
  36653. this.ptr = e,
  36654. this.resolveAll()
  36655. }, this);
  36656. else if (this.ptr instanceof n.Message.Field) {
  36657. if (i.TYPE.test(this.ptr.type))
  36658. this.ptr.type = t.TYPES[this.ptr.type];
  36659. else {
  36660. if (!i.TYPEREF.test(this.ptr.type))
  36661. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36662. if (e = (this.ptr instanceof n.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0),
  36663. !e)
  36664. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36665. if (this.ptr.resolvedType = e,
  36666. e instanceof n.Enum) {
  36667. if (this.ptr.type = t.TYPES.enum,
  36668. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  36669. throw Error("proto3 message cannot reference proto2 enum")
  36670. } else {
  36671. if (!(e instanceof n.Message))
  36672. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36673. this.ptr.type = e.isGroup ? t.TYPES.group : t.TYPES.message
  36674. }
  36675. }
  36676. if (this.ptr.map) {
  36677. if (!i.TYPE.test(this.ptr.keyType))
  36678. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  36679. this.ptr.keyType = t.TYPES[this.ptr.keyType]
  36680. }
  36681. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  36682. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod))
  36683. throw Error("illegal service type in " + this.ptr.toString(!0));
  36684. if (e = this.ptr.parent.resolve(this.ptr.requestName, !0),
  36685. !(e && e instanceof t.Reflect.Message))
  36686. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  36687. if (this.ptr.resolvedRequestType = e,
  36688. e = this.ptr.parent.resolve(this.ptr.responseName, !0),
  36689. !(e && e instanceof t.Reflect.Message))
  36690. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  36691. this.ptr.resolvedResponseType = e
  36692. } else if (!(this.ptr instanceof t.Reflect.Message.OneOf || this.ptr instanceof t.Reflect.Extension || this.ptr instanceof t.Reflect.Enum.Value))
  36693. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  36694. return this.reset()
  36695. }
  36696. ,
  36697. a.build = function(e) {
  36698. if (this.reset(),
  36699. this.resolved || (this.resolveAll(),
  36700. this.resolved = !0,
  36701. this.result = null),
  36702. null === this.result && (this.result = this.ns.build()),
  36703. !e)
  36704. return this.result;
  36705. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  36706. if (!i[t[n]]) {
  36707. i = null;
  36708. break
  36709. }
  36710. i = i[t[n]]
  36711. }
  36712. return i
  36713. }
  36714. ,
  36715. a.lookup = function(e, t) {
  36716. return e ? this.ns.resolve(e, t) : this.ns
  36717. }
  36718. ,
  36719. a.toString = function() {
  36720. return "Builder"
  36721. }
  36722. ,
  36723. o.Message = function() {}
  36724. ,
  36725. o.Enum = function() {}
  36726. ,
  36727. o.Service = function() {}
  36728. ,
  36729. o
  36730. }(r, r.Lang, r.Reflect),
  36731. r.Map = function(e, t) {
  36732. function i(e) {
  36733. var t = 0;
  36734. return {
  36735. next: function() {
  36736. return t < e.length ? {
  36737. done: !1,
  36738. value: e[t++]
  36739. } : {
  36740. done: !0
  36741. }
  36742. }
  36743. }
  36744. }
  36745. var n = function(e, i) {
  36746. if (!e.map)
  36747. throw Error("field is not a map");
  36748. if (this.field = e,
  36749. this.keyElem = new t.Element(e.keyType,null,!0,e.syntax),
  36750. this.valueElem = new t.Element(e.type,e.resolvedType,!1,e.syntax),
  36751. this.map = {},
  36752. Object.defineProperty(this, "size", {
  36753. get: function() {
  36754. return Object.keys(this.map).length
  36755. }
  36756. }),
  36757. i)
  36758. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  36759. var o = this.keyElem.valueFromString(n[r])
  36760. , a = this.valueElem.verifyValue(i[n[r]]);
  36761. this.map[this.keyElem.valueToString(o)] = {
  36762. key: o,
  36763. value: a
  36764. }
  36765. }
  36766. }
  36767. , r = n.prototype;
  36768. return r.clear = function() {
  36769. this.map = {}
  36770. }
  36771. ,
  36772. r.delete = function(e) {
  36773. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  36774. , i = t in this.map;
  36775. return delete this.map[t],
  36776. i
  36777. }
  36778. ,
  36779. r.entries = function() {
  36780. for (var e, t = [], n = Object.keys(this.map), r = 0; r < n.length; r++)
  36781. t.push([(e = this.map[n[r]]).key, e.value]);
  36782. return i(t)
  36783. }
  36784. ,
  36785. r.keys = function() {
  36786. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  36787. e.push(this.map[t[n]].key);
  36788. return i(e)
  36789. }
  36790. ,
  36791. r.values = function() {
  36792. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  36793. e.push(this.map[t[n]].value);
  36794. return i(e)
  36795. }
  36796. ,
  36797. r.forEach = function(e, t) {
  36798. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  36799. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  36800. }
  36801. ,
  36802. r.set = function(e, t) {
  36803. var i = this.keyElem.verifyValue(e)
  36804. , n = this.valueElem.verifyValue(t);
  36805. return this.map[this.keyElem.valueToString(i)] = {
  36806. key: i,
  36807. value: n
  36808. },
  36809. this
  36810. }
  36811. ,
  36812. r.get = function(e) {
  36813. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  36814. if (t in this.map)
  36815. return this.map[t].value
  36816. }
  36817. ,
  36818. r.has = function(e) {
  36819. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  36820. return t in this.map
  36821. }
  36822. ,
  36823. n
  36824. }(r, r.Reflect),
  36825. r.loadProto = function(e, t, i) {
  36826. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  36827. t = void 0),
  36828. r.loadJson(r.DotProto.Parser.parse(e), t, i)
  36829. }
  36830. ,
  36831. r.protoFromString = r.loadProto,
  36832. r.loadProtoFile = function(e, t, i) {
  36833. if (t && "object" == typeof t ? (i = t,
  36834. t = null) : t && "function" == typeof t || (t = null),
  36835. t)
  36836. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  36837. if (null === n)
  36838. return void t(Error("Failed to fetch file"));
  36839. try {
  36840. t(null, r.loadProto(n, i, e))
  36841. } catch (e) {
  36842. t(e)
  36843. }
  36844. });
  36845. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  36846. return null === n ? null : r.loadProto(n, i, e)
  36847. }
  36848. ,
  36849. r.protoFromFile = r.loadProtoFile,
  36850. r.newBuilder = function(e) {
  36851. return e = e || {},
  36852. "undefined" == typeof e.convertFieldsToCamelCase && (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  36853. "undefined" == typeof e.populateAccessors && (e.populateAccessors = r.populateAccessors),
  36854. new r.Builder(e)
  36855. }
  36856. ,
  36857. r.loadJson = function(e, t, i) {
  36858. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  36859. t = null),
  36860. t && "object" == typeof t || (t = r.newBuilder()),
  36861. "string" == typeof e && (e = JSON.parse(e)),
  36862. t.import(e, i),
  36863. t.resolveAll(),
  36864. t
  36865. }
  36866. ,
  36867. r.loadJsonFile = function(e, t, i) {
  36868. if (t && "object" == typeof t ? (i = t,
  36869. t = null) : t && "function" == typeof t || (t = null),
  36870. t)
  36871. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  36872. if (null === n)
  36873. return void t(Error("Failed to fetch file"));
  36874. try {
  36875. t(null, r.loadJson(JSON.parse(n), i, e))
  36876. } catch (e) {
  36877. t(e)
  36878. }
  36879. });
  36880. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  36881. return null === n ? null : r.loadJson(JSON.parse(n), i, e)
  36882. }
  36883. ,
  36884. r
  36885. })
  36886. }
  36887. ).call(this, e("_process"))
  36888. }
  36889. , {
  36890. _process: 203,
  36891. bytebuffer: 215,
  36892. fs: 197,
  36893. path: 197
  36894. }],
  36895. 215: [function(e, t, i) {
  36896. !function(i, n) {
  36897. "function" == typeof define && define.amd ? define(["long"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = function() {
  36898. var t;
  36899. try {
  36900. t = e("long")
  36901. } catch (e) {}
  36902. return n(t)
  36903. }() : (i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long)
  36904. }(this, function(e) {
  36905. "use strict";
  36906. function t(e) {
  36907. var t = 0;
  36908. return function() {
  36909. return t < e.length ? e.charCodeAt(t++) : null
  36910. }
  36911. }
  36912. function i() {
  36913. var e = []
  36914. , t = [];
  36915. return function() {
  36916. return 0 === arguments.length ? t.join("") + l.apply(String, e) : (e.length + arguments.length > 1024 && (t.push(l.apply(String, e)),
  36917. e.length = 0),
  36918. void Array.prototype.push.apply(e, arguments))
  36919. }
  36920. }
  36921. function n(e, t, i, n, r) {
  36922. 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];
  36923. for (u += d,
  36924. o = p & (1 << -h) - 1,
  36925. p >>= -h,
  36926. h += s; h > 0; o = 256 * o + e[t + u],
  36927. u += d,
  36928. h -= 8)
  36929. ;
  36930. for (a = o & (1 << -h) - 1,
  36931. o >>= -h,
  36932. h += n; h > 0; a = 256 * a + e[t + u],
  36933. u += d,
  36934. h -= 8)
  36935. ;
  36936. if (0 === o)
  36937. o = 1 - c;
  36938. else {
  36939. if (o === l)
  36940. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  36941. a += Math.pow(2, n),
  36942. o -= c
  36943. }
  36944. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  36945. }
  36946. function r(e, t, i, n, r, o) {
  36947. 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;
  36948. for (t = Math.abs(t),
  36949. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  36950. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  36951. t * (l = Math.pow(2, -a)) < 1 && (a--,
  36952. l *= 2),
  36953. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  36954. t * l >= 2 && (a++,
  36955. l /= 2),
  36956. a + u >= h ? (s = 0,
  36957. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  36958. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  36959. a = 0)); r >= 8; e[i + p] = 255 & s,
  36960. p += f,
  36961. s /= 256,
  36962. r -= 8)
  36963. ;
  36964. for (a = a << r | s,
  36965. c += r; c > 0; e[i + p] = 255 & a,
  36966. p += f,
  36967. a /= 256,
  36968. c -= 8)
  36969. ;
  36970. e[i + p - f] |= 128 * g
  36971. }
  36972. var o = function(e, t, i) {
  36973. if ("undefined" == typeof e && (e = o.DEFAULT_CAPACITY),
  36974. "undefined" == typeof t && (t = o.DEFAULT_ENDIAN),
  36975. "undefined" == typeof i && (i = o.DEFAULT_NOASSERT),
  36976. !i) {
  36977. if (e |= 0,
  36978. e < 0)
  36979. throw RangeError("Illegal capacity");
  36980. t = !!t,
  36981. i = !!i
  36982. }
  36983. this.buffer = 0 === e ? s : new ArrayBuffer(e),
  36984. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  36985. this.offset = 0,
  36986. this.markedOffset = -1,
  36987. this.limit = e,
  36988. this.littleEndian = t,
  36989. this.noAssert = i
  36990. };
  36991. o.VERSION = "5.0.1",
  36992. o.LITTLE_ENDIAN = !0,
  36993. o.BIG_ENDIAN = !1,
  36994. o.DEFAULT_CAPACITY = 16,
  36995. o.DEFAULT_ENDIAN = o.BIG_ENDIAN,
  36996. o.DEFAULT_NOASSERT = !1,
  36997. o.Long = e || null;
  36998. var a = o.prototype;
  36999. a.__isByteBuffer__,
  37000. Object.defineProperty(a, "__isByteBuffer__", {
  37001. value: !0,
  37002. enumerable: !1,
  37003. configurable: !1
  37004. });
  37005. var s = new ArrayBuffer(0)
  37006. , l = String.fromCharCode;
  37007. o.accessor = function() {
  37008. return Uint8Array
  37009. }
  37010. ,
  37011. o.allocate = function(e, t, i) {
  37012. return new o(e,t,i)
  37013. }
  37014. ,
  37015. o.concat = function(e, t, i, n) {
  37016. "boolean" != typeof t && "string" == typeof t || (n = i,
  37017. i = t,
  37018. t = void 0);
  37019. for (var r, a = 0, s = 0, l = e.length; s < l; ++s)
  37020. o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)),
  37021. r = e[s].limit - e[s].offset,
  37022. r > 0 && (a += r);
  37023. if (0 === a)
  37024. return new o(0,i,n);
  37025. var c, h = new o(a,i,n);
  37026. for (s = 0; s < l; )
  37027. c = e[s++],
  37028. r = c.limit - c.offset,
  37029. r <= 0 || (h.view.set(c.view.subarray(c.offset, c.limit), h.offset),
  37030. h.offset += r);
  37031. return h.limit = h.offset,
  37032. h.offset = 0,
  37033. h
  37034. }
  37035. ,
  37036. o.isByteBuffer = function(e) {
  37037. return (e && e.__isByteBuffer__) === !0
  37038. }
  37039. ,
  37040. o.type = function() {
  37041. return ArrayBuffer
  37042. }
  37043. ,
  37044. o.wrap = function(e, t, i, n) {
  37045. if ("string" != typeof t && (n = i,
  37046. i = t,
  37047. t = void 0),
  37048. "string" == typeof e)
  37049. switch ("undefined" == typeof t && (t = "utf8"),
  37050. t) {
  37051. case "base64":
  37052. return o.fromBase64(e, i);
  37053. case "hex":
  37054. return o.fromHex(e, i);
  37055. case "binary":
  37056. return o.fromBinary(e, i);
  37057. case "utf8":
  37058. return o.fromUTF8(e, i);
  37059. case "debug":
  37060. return o.fromDebug(e, i);
  37061. default:
  37062. throw Error("Unsupported encoding: " + t)
  37063. }
  37064. if (null === e || "object" != typeof e)
  37065. throw TypeError("Illegal buffer");
  37066. var r;
  37067. if (o.isByteBuffer(e))
  37068. return r = a.clone.call(e),
  37069. r.markedOffset = -1,
  37070. r;
  37071. if (e instanceof Uint8Array)
  37072. r = new o(0,i,n),
  37073. e.length > 0 && (r.buffer = e.buffer,
  37074. r.offset = e.byteOffset,
  37075. r.limit = e.byteOffset + e.byteLength,
  37076. r.view = new Uint8Array(e.buffer));
  37077. else if (e instanceof ArrayBuffer)
  37078. r = new o(0,i,n),
  37079. e.byteLength > 0 && (r.buffer = e,
  37080. r.offset = 0,
  37081. r.limit = e.byteLength,
  37082. r.view = e.byteLength > 0 ? new Uint8Array(e) : null);
  37083. else {
  37084. if ("[object Array]" !== Object.prototype.toString.call(e))
  37085. throw TypeError("Illegal buffer");
  37086. r = new o(e.length,i,n),
  37087. r.limit = e.length;
  37088. for (var s = 0; s < e.length; ++s)
  37089. r.view[s] = e[s]
  37090. }
  37091. return r
  37092. }
  37093. ,
  37094. a.writeBitSet = function(e, t) {
  37095. var i = "undefined" == typeof t;
  37096. if (i && (t = this.offset),
  37097. !this.noAssert) {
  37098. if (!(e instanceof Array))
  37099. throw TypeError("Illegal BitSet: Not an array");
  37100. if ("number" != typeof t || t % 1 !== 0)
  37101. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37102. if (t >>>= 0,
  37103. t < 0 || t + 0 > this.buffer.byteLength)
  37104. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37105. }
  37106. var n, r = t, o = e.length, a = o >> 3, s = 0;
  37107. for (t += this.writeVarint32(o, t); a--; )
  37108. 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,
  37109. this.writeByte(n, t++);
  37110. if (s < o) {
  37111. var l = 0;
  37112. for (n = 0; s < o; )
  37113. n |= (1 & !!e[s++]) << l++;
  37114. this.writeByte(n, t++)
  37115. }
  37116. return i ? (this.offset = t,
  37117. this) : t - r
  37118. }
  37119. ,
  37120. a.readBitSet = function(e) {
  37121. var t = "undefined" == typeof e;
  37122. t && (e = this.offset);
  37123. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  37124. for (e += n.length; o--; )
  37125. i = this.readByte(e++),
  37126. s[a++] = !!(1 & i),
  37127. s[a++] = !!(2 & i),
  37128. s[a++] = !!(4 & i),
  37129. s[a++] = !!(8 & i),
  37130. s[a++] = !!(16 & i),
  37131. s[a++] = !!(32 & i),
  37132. s[a++] = !!(64 & i),
  37133. s[a++] = !!(128 & i);
  37134. if (a < r) {
  37135. var l = 0;
  37136. for (i = this.readByte(e++); a < r; )
  37137. s[a++] = !!(i >> l++ & 1)
  37138. }
  37139. return t && (this.offset = e),
  37140. s
  37141. }
  37142. ,
  37143. a.readBytes = function(e, t) {
  37144. var i = "undefined" == typeof t;
  37145. if (i && (t = this.offset),
  37146. !this.noAssert) {
  37147. if ("number" != typeof t || t % 1 !== 0)
  37148. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37149. if (t >>>= 0,
  37150. t < 0 || t + e > this.buffer.byteLength)
  37151. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  37152. }
  37153. var n = this.slice(t, t + e);
  37154. return i && (this.offset += e),
  37155. n
  37156. }
  37157. ,
  37158. a.writeBytes = a.append,
  37159. a.writeInt8 = function(e, t) {
  37160. var i = "undefined" == typeof t;
  37161. if (i && (t = this.offset),
  37162. !this.noAssert) {
  37163. if ("number" != typeof e || e % 1 !== 0)
  37164. throw TypeError("Illegal value: " + e + " (not an integer)");
  37165. if (e |= 0,
  37166. "number" != typeof t || t % 1 !== 0)
  37167. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37168. if (t >>>= 0,
  37169. t < 0 || t + 0 > this.buffer.byteLength)
  37170. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37171. }
  37172. t += 1;
  37173. var n = this.buffer.byteLength;
  37174. return t > n && this.resize((n *= 2) > t ? n : t),
  37175. t -= 1,
  37176. this.view[t] = e,
  37177. i && (this.offset += 1),
  37178. this
  37179. }
  37180. ,
  37181. a.writeByte = a.writeInt8,
  37182. a.readInt8 = function(e) {
  37183. var t = "undefined" == typeof e;
  37184. if (t && (e = this.offset),
  37185. !this.noAssert) {
  37186. if ("number" != typeof e || e % 1 !== 0)
  37187. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37188. if (e >>>= 0,
  37189. e < 0 || e + 1 > this.buffer.byteLength)
  37190. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37191. }
  37192. var i = this.view[e];
  37193. return 128 === (128 & i) && (i = -(255 - i + 1)),
  37194. t && (this.offset += 1),
  37195. i
  37196. }
  37197. ,
  37198. a.readByte = a.readInt8,
  37199. a.writeUint8 = function(e, t) {
  37200. var i = "undefined" == typeof t;
  37201. if (i && (t = this.offset),
  37202. !this.noAssert) {
  37203. if ("number" != typeof e || e % 1 !== 0)
  37204. throw TypeError("Illegal value: " + e + " (not an integer)");
  37205. if (e >>>= 0,
  37206. "number" != typeof t || t % 1 !== 0)
  37207. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37208. if (t >>>= 0,
  37209. t < 0 || t + 0 > this.buffer.byteLength)
  37210. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37211. }
  37212. t += 1;
  37213. var n = this.buffer.byteLength;
  37214. return t > n && this.resize((n *= 2) > t ? n : t),
  37215. t -= 1,
  37216. this.view[t] = e,
  37217. i && (this.offset += 1),
  37218. this
  37219. }
  37220. ,
  37221. a.writeUInt8 = a.writeUint8,
  37222. a.readUint8 = function(e) {
  37223. var t = "undefined" == typeof e;
  37224. if (t && (e = this.offset),
  37225. !this.noAssert) {
  37226. if ("number" != typeof e || e % 1 !== 0)
  37227. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37228. if (e >>>= 0,
  37229. e < 0 || e + 1 > this.buffer.byteLength)
  37230. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37231. }
  37232. var i = this.view[e];
  37233. return t && (this.offset += 1),
  37234. i
  37235. }
  37236. ,
  37237. a.readUInt8 = a.readUint8,
  37238. a.writeInt16 = function(e, t) {
  37239. var i = "undefined" == typeof t;
  37240. if (i && (t = this.offset),
  37241. !this.noAssert) {
  37242. if ("number" != typeof e || e % 1 !== 0)
  37243. throw TypeError("Illegal value: " + e + " (not an integer)");
  37244. if (e |= 0,
  37245. "number" != typeof t || t % 1 !== 0)
  37246. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37247. if (t >>>= 0,
  37248. t < 0 || t + 0 > this.buffer.byteLength)
  37249. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37250. }
  37251. t += 2;
  37252. var n = this.buffer.byteLength;
  37253. return t > n && this.resize((n *= 2) > t ? n : t),
  37254. t -= 2,
  37255. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  37256. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  37257. this.view[t + 1] = 255 & e),
  37258. i && (this.offset += 2),
  37259. this
  37260. }
  37261. ,
  37262. a.writeShort = a.writeInt16,
  37263. a.readInt16 = function(e) {
  37264. var t = "undefined" == typeof e;
  37265. if (t && (e = this.offset),
  37266. !this.noAssert) {
  37267. if ("number" != typeof e || e % 1 !== 0)
  37268. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37269. if (e >>>= 0,
  37270. e < 0 || e + 2 > this.buffer.byteLength)
  37271. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  37272. }
  37273. var i = 0;
  37274. return this.littleEndian ? (i = this.view[e],
  37275. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  37276. i |= this.view[e + 1]),
  37277. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  37278. t && (this.offset += 2),
  37279. i
  37280. }
  37281. ,
  37282. a.readShort = a.readInt16,
  37283. a.writeUint16 = function(e, t) {
  37284. var i = "undefined" == typeof t;
  37285. if (i && (t = this.offset),
  37286. !this.noAssert) {
  37287. if ("number" != typeof e || e % 1 !== 0)
  37288. throw TypeError("Illegal value: " + e + " (not an integer)");
  37289. if (e >>>= 0,
  37290. "number" != typeof t || t % 1 !== 0)
  37291. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37292. if (t >>>= 0,
  37293. t < 0 || t + 0 > this.buffer.byteLength)
  37294. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37295. }
  37296. t += 2;
  37297. var n = this.buffer.byteLength;
  37298. return t > n && this.resize((n *= 2) > t ? n : t),
  37299. t -= 2,
  37300. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  37301. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  37302. this.view[t + 1] = 255 & e),
  37303. i && (this.offset += 2),
  37304. this
  37305. }
  37306. ,
  37307. a.writeUInt16 = a.writeUint16,
  37308. a.readUint16 = function(e) {
  37309. var t = "undefined" == typeof e;
  37310. if (t && (e = this.offset),
  37311. !this.noAssert) {
  37312. if ("number" != typeof e || e % 1 !== 0)
  37313. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37314. if (e >>>= 0,
  37315. e < 0 || e + 2 > this.buffer.byteLength)
  37316. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  37317. }
  37318. var i = 0;
  37319. return this.littleEndian ? (i = this.view[e],
  37320. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  37321. i |= this.view[e + 1]),
  37322. t && (this.offset += 2),
  37323. i
  37324. }
  37325. ,
  37326. a.readUInt16 = a.readUint16,
  37327. a.writeInt32 = function(e, t) {
  37328. var i = "undefined" == typeof t;
  37329. if (i && (t = this.offset),
  37330. !this.noAssert) {
  37331. if ("number" != typeof e || e % 1 !== 0)
  37332. throw TypeError("Illegal value: " + e + " (not an integer)");
  37333. if (e |= 0,
  37334. "number" != typeof t || t % 1 !== 0)
  37335. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37336. if (t >>>= 0,
  37337. t < 0 || t + 0 > this.buffer.byteLength)
  37338. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37339. }
  37340. t += 4;
  37341. var n = this.buffer.byteLength;
  37342. return t > n && this.resize((n *= 2) > t ? n : t),
  37343. t -= 4,
  37344. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  37345. this.view[t + 2] = e >>> 16 & 255,
  37346. this.view[t + 1] = e >>> 8 & 255,
  37347. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  37348. this.view[t + 1] = e >>> 16 & 255,
  37349. this.view[t + 2] = e >>> 8 & 255,
  37350. this.view[t + 3] = 255 & e),
  37351. i && (this.offset += 4),
  37352. this
  37353. }
  37354. ,
  37355. a.writeInt = a.writeInt32,
  37356. a.readInt32 = function(e) {
  37357. var t = "undefined" == typeof e;
  37358. if (t && (e = this.offset),
  37359. !this.noAssert) {
  37360. if ("number" != typeof e || e % 1 !== 0)
  37361. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37362. if (e >>>= 0,
  37363. e < 0 || e + 4 > this.buffer.byteLength)
  37364. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37365. }
  37366. var i = 0;
  37367. return this.littleEndian ? (i = this.view[e + 2] << 16,
  37368. i |= this.view[e + 1] << 8,
  37369. i |= this.view[e],
  37370. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  37371. i |= this.view[e + 2] << 8,
  37372. i |= this.view[e + 3],
  37373. i += this.view[e] << 24 >>> 0),
  37374. i |= 0,
  37375. t && (this.offset += 4),
  37376. i
  37377. }
  37378. ,
  37379. a.readInt = a.readInt32,
  37380. a.writeUint32 = function(e, t) {
  37381. var i = "undefined" == typeof t;
  37382. if (i && (t = this.offset),
  37383. !this.noAssert) {
  37384. if ("number" != typeof e || e % 1 !== 0)
  37385. throw TypeError("Illegal value: " + e + " (not an integer)");
  37386. if (e >>>= 0,
  37387. "number" != typeof t || t % 1 !== 0)
  37388. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37389. if (t >>>= 0,
  37390. t < 0 || t + 0 > this.buffer.byteLength)
  37391. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37392. }
  37393. t += 4;
  37394. var n = this.buffer.byteLength;
  37395. return t > n && this.resize((n *= 2) > t ? n : t),
  37396. t -= 4,
  37397. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  37398. this.view[t + 2] = e >>> 16 & 255,
  37399. this.view[t + 1] = e >>> 8 & 255,
  37400. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  37401. this.view[t + 1] = e >>> 16 & 255,
  37402. this.view[t + 2] = e >>> 8 & 255,
  37403. this.view[t + 3] = 255 & e),
  37404. i && (this.offset += 4),
  37405. this
  37406. }
  37407. ,
  37408. a.writeUInt32 = a.writeUint32,
  37409. a.readUint32 = function(e) {
  37410. var t = "undefined" == typeof e;
  37411. if (t && (e = this.offset),
  37412. !this.noAssert) {
  37413. if ("number" != typeof e || e % 1 !== 0)
  37414. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37415. if (e >>>= 0,
  37416. e < 0 || e + 4 > this.buffer.byteLength)
  37417. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37418. }
  37419. var i = 0;
  37420. return this.littleEndian ? (i = this.view[e + 2] << 16,
  37421. i |= this.view[e + 1] << 8,
  37422. i |= this.view[e],
  37423. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  37424. i |= this.view[e + 2] << 8,
  37425. i |= this.view[e + 3],
  37426. i += this.view[e] << 24 >>> 0),
  37427. t && (this.offset += 4),
  37428. i
  37429. }
  37430. ,
  37431. a.readUInt32 = a.readUint32,
  37432. e && (a.writeInt64 = function(t, i) {
  37433. var n = "undefined" == typeof i;
  37434. if (n && (i = this.offset),
  37435. !this.noAssert) {
  37436. if ("number" == typeof t)
  37437. t = e.fromNumber(t);
  37438. else if ("string" == typeof t)
  37439. t = e.fromString(t);
  37440. else if (!(t && t instanceof e))
  37441. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  37442. if ("number" != typeof i || i % 1 !== 0)
  37443. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37444. if (i >>>= 0,
  37445. i < 0 || i + 0 > this.buffer.byteLength)
  37446. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37447. }
  37448. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  37449. i += 8;
  37450. var r = this.buffer.byteLength;
  37451. i > r && this.resize((r *= 2) > i ? r : i),
  37452. i -= 8;
  37453. var o = t.low
  37454. , a = t.high;
  37455. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  37456. this.view[i + 2] = o >>> 16 & 255,
  37457. this.view[i + 1] = o >>> 8 & 255,
  37458. this.view[i] = 255 & o,
  37459. i += 4,
  37460. this.view[i + 3] = a >>> 24 & 255,
  37461. this.view[i + 2] = a >>> 16 & 255,
  37462. this.view[i + 1] = a >>> 8 & 255,
  37463. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  37464. this.view[i + 1] = a >>> 16 & 255,
  37465. this.view[i + 2] = a >>> 8 & 255,
  37466. this.view[i + 3] = 255 & a,
  37467. i += 4,
  37468. this.view[i] = o >>> 24 & 255,
  37469. this.view[i + 1] = o >>> 16 & 255,
  37470. this.view[i + 2] = o >>> 8 & 255,
  37471. this.view[i + 3] = 255 & o),
  37472. n && (this.offset += 8),
  37473. this
  37474. }
  37475. ,
  37476. a.writeLong = a.writeInt64,
  37477. a.readInt64 = function(t) {
  37478. var i = "undefined" == typeof t;
  37479. if (i && (t = this.offset),
  37480. !this.noAssert) {
  37481. if ("number" != typeof t || t % 1 !== 0)
  37482. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37483. if (t >>>= 0,
  37484. t < 0 || t + 8 > this.buffer.byteLength)
  37485. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  37486. }
  37487. var n = 0
  37488. , r = 0;
  37489. this.littleEndian ? (n = this.view[t + 2] << 16,
  37490. n |= this.view[t + 1] << 8,
  37491. n |= this.view[t],
  37492. n += this.view[t + 3] << 24 >>> 0,
  37493. t += 4,
  37494. r = this.view[t + 2] << 16,
  37495. r |= this.view[t + 1] << 8,
  37496. r |= this.view[t],
  37497. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  37498. r |= this.view[t + 2] << 8,
  37499. r |= this.view[t + 3],
  37500. r += this.view[t] << 24 >>> 0,
  37501. t += 4,
  37502. n = this.view[t + 1] << 16,
  37503. n |= this.view[t + 2] << 8,
  37504. n |= this.view[t + 3],
  37505. n += this.view[t] << 24 >>> 0);
  37506. var o = new e(n,r,!1);
  37507. return i && (this.offset += 8),
  37508. o
  37509. }
  37510. ,
  37511. a.readLong = a.readInt64,
  37512. a.writeUint64 = function(t, i) {
  37513. var n = "undefined" == typeof i;
  37514. if (n && (i = this.offset),
  37515. !this.noAssert) {
  37516. if ("number" == typeof t)
  37517. t = e.fromNumber(t);
  37518. else if ("string" == typeof t)
  37519. t = e.fromString(t);
  37520. else if (!(t && t instanceof e))
  37521. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  37522. if ("number" != typeof i || i % 1 !== 0)
  37523. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37524. if (i >>>= 0,
  37525. i < 0 || i + 0 > this.buffer.byteLength)
  37526. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37527. }
  37528. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  37529. i += 8;
  37530. var r = this.buffer.byteLength;
  37531. i > r && this.resize((r *= 2) > i ? r : i),
  37532. i -= 8;
  37533. var o = t.low
  37534. , a = t.high;
  37535. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  37536. this.view[i + 2] = o >>> 16 & 255,
  37537. this.view[i + 1] = o >>> 8 & 255,
  37538. this.view[i] = 255 & o,
  37539. i += 4,
  37540. this.view[i + 3] = a >>> 24 & 255,
  37541. this.view[i + 2] = a >>> 16 & 255,
  37542. this.view[i + 1] = a >>> 8 & 255,
  37543. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  37544. this.view[i + 1] = a >>> 16 & 255,
  37545. this.view[i + 2] = a >>> 8 & 255,
  37546. this.view[i + 3] = 255 & a,
  37547. i += 4,
  37548. this.view[i] = o >>> 24 & 255,
  37549. this.view[i + 1] = o >>> 16 & 255,
  37550. this.view[i + 2] = o >>> 8 & 255,
  37551. this.view[i + 3] = 255 & o),
  37552. n && (this.offset += 8),
  37553. this
  37554. }
  37555. ,
  37556. a.writeUInt64 = a.writeUint64,
  37557. a.readUint64 = function(t) {
  37558. var i = "undefined" == typeof t;
  37559. if (i && (t = this.offset),
  37560. !this.noAssert) {
  37561. if ("number" != typeof t || t % 1 !== 0)
  37562. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37563. if (t >>>= 0,
  37564. t < 0 || t + 8 > this.buffer.byteLength)
  37565. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  37566. }
  37567. var n = 0
  37568. , r = 0;
  37569. this.littleEndian ? (n = this.view[t + 2] << 16,
  37570. n |= this.view[t + 1] << 8,
  37571. n |= this.view[t],
  37572. n += this.view[t + 3] << 24 >>> 0,
  37573. t += 4,
  37574. r = this.view[t + 2] << 16,
  37575. r |= this.view[t + 1] << 8,
  37576. r |= this.view[t],
  37577. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  37578. r |= this.view[t + 2] << 8,
  37579. r |= this.view[t + 3],
  37580. r += this.view[t] << 24 >>> 0,
  37581. t += 4,
  37582. n = this.view[t + 1] << 16,
  37583. n |= this.view[t + 2] << 8,
  37584. n |= this.view[t + 3],
  37585. n += this.view[t] << 24 >>> 0);
  37586. var o = new e(n,r,!0);
  37587. return i && (this.offset += 8),
  37588. o
  37589. }
  37590. ,
  37591. a.readUInt64 = a.readUint64),
  37592. a.writeFloat32 = function(e, t) {
  37593. var i = "undefined" == typeof t;
  37594. if (i && (t = this.offset),
  37595. !this.noAssert) {
  37596. if ("number" != typeof e)
  37597. throw TypeError("Illegal value: " + e + " (not a number)");
  37598. if ("number" != typeof t || t % 1 !== 0)
  37599. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37600. if (t >>>= 0,
  37601. t < 0 || t + 0 > this.buffer.byteLength)
  37602. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37603. }
  37604. t += 4;
  37605. var n = this.buffer.byteLength;
  37606. return t > n && this.resize((n *= 2) > t ? n : t),
  37607. t -= 4,
  37608. r(this.view, e, t, this.littleEndian, 23, 4),
  37609. i && (this.offset += 4),
  37610. this
  37611. }
  37612. ,
  37613. a.writeFloat = a.writeFloat32,
  37614. a.readFloat32 = function(e) {
  37615. var t = "undefined" == typeof e;
  37616. if (t && (e = this.offset),
  37617. !this.noAssert) {
  37618. if ("number" != typeof e || e % 1 !== 0)
  37619. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37620. if (e >>>= 0,
  37621. e < 0 || e + 4 > this.buffer.byteLength)
  37622. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37623. }
  37624. var i = n(this.view, e, this.littleEndian, 23, 4);
  37625. return t && (this.offset += 4),
  37626. i
  37627. }
  37628. ,
  37629. a.readFloat = a.readFloat32,
  37630. a.writeFloat64 = function(e, t) {
  37631. var i = "undefined" == typeof t;
  37632. if (i && (t = this.offset),
  37633. !this.noAssert) {
  37634. if ("number" != typeof e)
  37635. throw TypeError("Illegal value: " + e + " (not a number)");
  37636. if ("number" != typeof t || t % 1 !== 0)
  37637. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37638. if (t >>>= 0,
  37639. t < 0 || t + 0 > this.buffer.byteLength)
  37640. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37641. }
  37642. t += 8;
  37643. var n = this.buffer.byteLength;
  37644. return t > n && this.resize((n *= 2) > t ? n : t),
  37645. t -= 8,
  37646. r(this.view, e, t, this.littleEndian, 52, 8),
  37647. i && (this.offset += 8),
  37648. this
  37649. }
  37650. ,
  37651. a.writeDouble = a.writeFloat64,
  37652. a.readFloat64 = function(e) {
  37653. var t = "undefined" == typeof e;
  37654. if (t && (e = this.offset),
  37655. !this.noAssert) {
  37656. if ("number" != typeof e || e % 1 !== 0)
  37657. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37658. if (e >>>= 0,
  37659. e < 0 || e + 8 > this.buffer.byteLength)
  37660. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  37661. }
  37662. var i = n(this.view, e, this.littleEndian, 52, 8);
  37663. return t && (this.offset += 8),
  37664. i
  37665. }
  37666. ,
  37667. a.readDouble = a.readFloat64,
  37668. o.MAX_VARINT32_BYTES = 5,
  37669. o.calculateVarint32 = function(e) {
  37670. return e >>>= 0,
  37671. e < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  37672. }
  37673. ,
  37674. o.zigZagEncode32 = function(e) {
  37675. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  37676. }
  37677. ,
  37678. o.zigZagDecode32 = function(e) {
  37679. return e >>> 1 ^ -(1 & e) | 0
  37680. }
  37681. ,
  37682. a.writeVarint32 = function(e, t) {
  37683. var i = "undefined" == typeof t;
  37684. if (i && (t = this.offset),
  37685. !this.noAssert) {
  37686. if ("number" != typeof e || e % 1 !== 0)
  37687. throw TypeError("Illegal value: " + e + " (not an integer)");
  37688. if (e |= 0,
  37689. "number" != typeof t || t % 1 !== 0)
  37690. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37691. if (t >>>= 0,
  37692. t < 0 || t + 0 > this.buffer.byteLength)
  37693. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37694. }
  37695. var n, r = o.calculateVarint32(e);
  37696. t += r;
  37697. var a = this.buffer.byteLength;
  37698. for (t > a && this.resize((a *= 2) > t ? a : t),
  37699. t -= r,
  37700. e >>>= 0; e >= 128; )
  37701. n = 127 & e | 128,
  37702. this.view[t++] = n,
  37703. e >>>= 7;
  37704. return this.view[t++] = e,
  37705. i ? (this.offset = t,
  37706. this) : r
  37707. }
  37708. ,
  37709. a.writeVarint32ZigZag = function(e, t) {
  37710. return this.writeVarint32(o.zigZagEncode32(e), t)
  37711. }
  37712. ,
  37713. a.readVarint32 = function(e) {
  37714. var t = "undefined" == typeof e;
  37715. if (t && (e = this.offset),
  37716. !this.noAssert) {
  37717. if ("number" != typeof e || e % 1 !== 0)
  37718. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37719. if (e >>>= 0,
  37720. e < 0 || e + 1 > this.buffer.byteLength)
  37721. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37722. }
  37723. var i, n = 0, r = 0;
  37724. do {
  37725. if (!this.noAssert && e > this.limit) {
  37726. var o = Error("Truncated");
  37727. throw o.truncated = !0,
  37728. o
  37729. }
  37730. i = this.view[e++],
  37731. n < 5 && (r |= (127 & i) << 7 * n),
  37732. ++n
  37733. } while (0 !== (128 & i));return r |= 0,
  37734. t ? (this.offset = e,
  37735. r) : {
  37736. value: r,
  37737. length: n
  37738. }
  37739. }
  37740. ,
  37741. a.readVarint32ZigZag = function(e) {
  37742. var t = this.readVarint32(e);
  37743. return "object" == typeof t ? t.value = o.zigZagDecode32(t.value) : t = o.zigZagDecode32(t),
  37744. t
  37745. }
  37746. ,
  37747. e && (o.MAX_VARINT64_BYTES = 10,
  37748. o.calculateVarint64 = function(t) {
  37749. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t));
  37750. var i = t.toInt() >>> 0
  37751. , n = t.shiftRightUnsigned(28).toInt() >>> 0
  37752. , r = t.shiftRightUnsigned(56).toInt() >>> 0;
  37753. return 0 == r ? 0 == n ? i < 16384 ? i < 128 ? 1 : 2 : i < 1 << 21 ? 3 : 4 : n < 16384 ? n < 128 ? 5 : 6 : n < 1 << 21 ? 7 : 8 : r < 128 ? 9 : 10
  37754. }
  37755. ,
  37756. o.zigZagEncode64 = function(t) {
  37757. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  37758. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  37759. }
  37760. ,
  37761. o.zigZagDecode64 = function(t) {
  37762. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  37763. t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
  37764. }
  37765. ,
  37766. a.writeVarint64 = function(t, i) {
  37767. var n = "undefined" == typeof i;
  37768. if (n && (i = this.offset),
  37769. !this.noAssert) {
  37770. if ("number" == typeof t)
  37771. t = e.fromNumber(t);
  37772. else if ("string" == typeof t)
  37773. t = e.fromString(t);
  37774. else if (!(t && t instanceof e))
  37775. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  37776. if ("number" != typeof i || i % 1 !== 0)
  37777. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37778. if (i >>>= 0,
  37779. i < 0 || i + 0 > this.buffer.byteLength)
  37780. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37781. }
  37782. "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned());
  37783. var r = o.calculateVarint64(t)
  37784. , a = t.toInt() >>> 0
  37785. , s = t.shiftRightUnsigned(28).toInt() >>> 0
  37786. , l = t.shiftRightUnsigned(56).toInt() >>> 0;
  37787. i += r;
  37788. var c = this.buffer.byteLength;
  37789. switch (i > c && this.resize((c *= 2) > i ? c : i),
  37790. i -= r,
  37791. r) {
  37792. case 10:
  37793. this.view[i + 9] = l >>> 7 & 1;
  37794. case 9:
  37795. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l;
  37796. case 8:
  37797. this.view[i + 7] = 8 !== r ? s >>> 21 | 128 : s >>> 21 & 127;
  37798. case 7:
  37799. this.view[i + 6] = 7 !== r ? s >>> 14 | 128 : s >>> 14 & 127;
  37800. case 6:
  37801. this.view[i + 5] = 6 !== r ? s >>> 7 | 128 : s >>> 7 & 127;
  37802. case 5:
  37803. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s;
  37804. case 4:
  37805. this.view[i + 3] = 4 !== r ? a >>> 21 | 128 : a >>> 21 & 127;
  37806. case 3:
  37807. this.view[i + 2] = 3 !== r ? a >>> 14 | 128 : a >>> 14 & 127;
  37808. case 2:
  37809. this.view[i + 1] = 2 !== r ? a >>> 7 | 128 : a >>> 7 & 127;
  37810. case 1:
  37811. this.view[i] = 1 !== r ? 128 | a : 127 & a
  37812. }
  37813. return n ? (this.offset += r,
  37814. this) : r
  37815. }
  37816. ,
  37817. a.writeVarint64ZigZag = function(e, t) {
  37818. return this.writeVarint64(o.zigZagEncode64(e), t)
  37819. }
  37820. ,
  37821. a.readVarint64 = function(t) {
  37822. var i = "undefined" == typeof t;
  37823. if (i && (t = this.offset),
  37824. !this.noAssert) {
  37825. if ("number" != typeof t || t % 1 !== 0)
  37826. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37827. if (t >>>= 0,
  37828. t < 0 || t + 1 > this.buffer.byteLength)
  37829. throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
  37830. }
  37831. var n = t
  37832. , r = 0
  37833. , o = 0
  37834. , a = 0
  37835. , s = 0;
  37836. if (s = this.view[t++],
  37837. r = 127 & s,
  37838. 128 & s && (s = this.view[t++],
  37839. r |= (127 & s) << 7,
  37840. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37841. r |= (127 & s) << 14,
  37842. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37843. r |= (127 & s) << 21,
  37844. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37845. o = 127 & s,
  37846. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37847. o |= (127 & s) << 7,
  37848. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37849. o |= (127 & s) << 14,
  37850. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37851. o |= (127 & s) << 21,
  37852. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37853. a = 127 & s,
  37854. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37855. a |= (127 & s) << 7,
  37856. 128 & s || this.noAssert && "undefined" == typeof s))))))))))
  37857. throw Error("Buffer overrun");
  37858. var l = e.fromBits(r | o << 28, o >>> 4 | a << 24, !1);
  37859. return i ? (this.offset = t,
  37860. l) : {
  37861. value: l,
  37862. length: t - n
  37863. }
  37864. }
  37865. ,
  37866. a.readVarint64ZigZag = function(t) {
  37867. var i = this.readVarint64(t);
  37868. return i && i.value instanceof e ? i.value = o.zigZagDecode64(i.value) : i = o.zigZagDecode64(i),
  37869. i
  37870. }
  37871. ),
  37872. a.writeCString = function(e, i) {
  37873. var n = "undefined" == typeof i;
  37874. n && (i = this.offset);
  37875. var r, o = e.length;
  37876. if (!this.noAssert) {
  37877. if ("string" != typeof e)
  37878. throw TypeError("Illegal str: Not a string");
  37879. for (r = 0; r < o; ++r)
  37880. if (0 === e.charCodeAt(r))
  37881. throw RangeError("Illegal str: Contains NULL-characters");
  37882. if ("number" != typeof i || i % 1 !== 0)
  37883. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37884. if (i >>>= 0,
  37885. i < 0 || i + 0 > this.buffer.byteLength)
  37886. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37887. }
  37888. o = h.calculateUTF16asUTF8(t(e))[1],
  37889. i += o + 1;
  37890. var a = this.buffer.byteLength;
  37891. return i > a && this.resize((a *= 2) > i ? a : i),
  37892. i -= o + 1,
  37893. h.encodeUTF16toUTF8(t(e), function(e) {
  37894. this.view[i++] = e
  37895. }
  37896. .bind(this)),
  37897. this.view[i++] = 0,
  37898. n ? (this.offset = i,
  37899. this) : o
  37900. }
  37901. ,
  37902. a.readCString = function(e) {
  37903. var t = "undefined" == typeof e;
  37904. if (t && (e = this.offset),
  37905. !this.noAssert) {
  37906. if ("number" != typeof e || e % 1 !== 0)
  37907. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37908. if (e >>>= 0,
  37909. e < 0 || e + 1 > this.buffer.byteLength)
  37910. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37911. }
  37912. var n, r = e, o = -1;
  37913. return h.decodeUTF8toUTF16(function() {
  37914. if (0 === o)
  37915. return null;
  37916. if (e >= this.limit)
  37917. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  37918. return o = this.view[e++],
  37919. 0 === o ? null : o
  37920. }
  37921. .bind(this), n = i(), !0),
  37922. t ? (this.offset = e,
  37923. n()) : {
  37924. string: n(),
  37925. length: e - r
  37926. }
  37927. }
  37928. ,
  37929. a.writeIString = function(e, i) {
  37930. var n = "undefined" == typeof i;
  37931. if (n && (i = this.offset),
  37932. !this.noAssert) {
  37933. if ("string" != typeof e)
  37934. throw TypeError("Illegal str: Not a string");
  37935. if ("number" != typeof i || i % 1 !== 0)
  37936. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37937. if (i >>>= 0,
  37938. i < 0 || i + 0 > this.buffer.byteLength)
  37939. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37940. }
  37941. var r, o = i;
  37942. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  37943. i += 4 + r;
  37944. var a = this.buffer.byteLength;
  37945. if (i > a && this.resize((a *= 2) > i ? a : i),
  37946. i -= 4 + r,
  37947. this.littleEndian ? (this.view[i + 3] = r >>> 24 & 255,
  37948. this.view[i + 2] = r >>> 16 & 255,
  37949. this.view[i + 1] = r >>> 8 & 255,
  37950. this.view[i] = 255 & r) : (this.view[i] = r >>> 24 & 255,
  37951. this.view[i + 1] = r >>> 16 & 255,
  37952. this.view[i + 2] = r >>> 8 & 255,
  37953. this.view[i + 3] = 255 & r),
  37954. i += 4,
  37955. h.encodeUTF16toUTF8(t(e), function(e) {
  37956. this.view[i++] = e
  37957. }
  37958. .bind(this)),
  37959. i !== o + 4 + r)
  37960. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + 4 + r));
  37961. return n ? (this.offset = i,
  37962. this) : i - o
  37963. }
  37964. ,
  37965. a.readIString = function(e) {
  37966. var t = "undefined" == typeof e;
  37967. if (t && (e = this.offset),
  37968. !this.noAssert) {
  37969. if ("number" != typeof e || e % 1 !== 0)
  37970. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37971. if (e >>>= 0,
  37972. e < 0 || e + 4 > this.buffer.byteLength)
  37973. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37974. }
  37975. var i = e
  37976. , n = this.readUint32(e)
  37977. , r = this.readUTF8String(n, o.METRICS_BYTES, e += 4);
  37978. return e += r.length,
  37979. t ? (this.offset = e,
  37980. r.string) : {
  37981. string: r.string,
  37982. length: e - i
  37983. }
  37984. }
  37985. ,
  37986. o.METRICS_CHARS = "c",
  37987. o.METRICS_BYTES = "b",
  37988. a.writeUTF8String = function(e, i) {
  37989. var n = "undefined" == typeof i;
  37990. if (n && (i = this.offset),
  37991. !this.noAssert) {
  37992. if ("number" != typeof i || i % 1 !== 0)
  37993. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37994. if (i >>>= 0,
  37995. i < 0 || i + 0 > this.buffer.byteLength)
  37996. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37997. }
  37998. var r, o = i;
  37999. r = h.calculateUTF16asUTF8(t(e))[1],
  38000. i += r;
  38001. var a = this.buffer.byteLength;
  38002. return i > a && this.resize((a *= 2) > i ? a : i),
  38003. i -= r,
  38004. h.encodeUTF16toUTF8(t(e), function(e) {
  38005. this.view[i++] = e
  38006. }
  38007. .bind(this)),
  38008. n ? (this.offset = i,
  38009. this) : i - o
  38010. }
  38011. ,
  38012. a.writeString = a.writeUTF8String,
  38013. o.calculateUTF8Chars = function(e) {
  38014. return h.calculateUTF16asUTF8(t(e))[0]
  38015. }
  38016. ,
  38017. o.calculateUTF8Bytes = function(e) {
  38018. return h.calculateUTF16asUTF8(t(e))[1]
  38019. }
  38020. ,
  38021. o.calculateString = o.calculateUTF8Bytes,
  38022. a.readUTF8String = function(e, t, n) {
  38023. "number" == typeof t && (n = t,
  38024. t = void 0);
  38025. var r = "undefined" == typeof n;
  38026. if (r && (n = this.offset),
  38027. "undefined" == typeof t && (t = o.METRICS_CHARS),
  38028. !this.noAssert) {
  38029. if ("number" != typeof e || e % 1 !== 0)
  38030. throw TypeError("Illegal length: " + e + " (not an integer)");
  38031. if (e |= 0,
  38032. "number" != typeof n || n % 1 !== 0)
  38033. throw TypeError("Illegal offset: " + n + " (not an integer)");
  38034. if (n >>>= 0,
  38035. n < 0 || n + 0 > this.buffer.byteLength)
  38036. throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
  38037. }
  38038. var a, s = 0, l = n;
  38039. if (t === o.METRICS_CHARS) {
  38040. if (a = i(),
  38041. h.decodeUTF8(function() {
  38042. return s < e && n < this.limit ? this.view[n++] : null
  38043. }
  38044. .bind(this), function(e) {
  38045. ++s,
  38046. h.UTF8toUTF16(e, a)
  38047. }),
  38048. s !== e)
  38049. throw RangeError("Illegal range: Truncated data, " + s + " == " + e);
  38050. return r ? (this.offset = n,
  38051. a()) : {
  38052. string: a(),
  38053. length: n - l
  38054. }
  38055. }
  38056. if (t === o.METRICS_BYTES) {
  38057. if (!this.noAssert) {
  38058. if ("number" != typeof n || n % 1 !== 0)
  38059. throw TypeError("Illegal offset: " + n + " (not an integer)");
  38060. if (n >>>= 0,
  38061. n < 0 || n + e > this.buffer.byteLength)
  38062. throw RangeError("Illegal offset: 0 <= " + n + " (+" + e + ") <= " + this.buffer.byteLength)
  38063. }
  38064. var c = n + e;
  38065. if (h.decodeUTF8toUTF16(function() {
  38066. return n < c ? this.view[n++] : null
  38067. }
  38068. .bind(this), a = i(), this.noAssert),
  38069. n !== c)
  38070. throw RangeError("Illegal range: Truncated data, " + n + " == " + c);
  38071. return r ? (this.offset = n,
  38072. a()) : {
  38073. string: a(),
  38074. length: n - l
  38075. }
  38076. }
  38077. throw TypeError("Unsupported metrics: " + t)
  38078. }
  38079. ,
  38080. a.readString = a.readUTF8String,
  38081. a.writeVString = function(e, i) {
  38082. var n = "undefined" == typeof i;
  38083. if (n && (i = this.offset),
  38084. !this.noAssert) {
  38085. if ("string" != typeof e)
  38086. throw TypeError("Illegal str: Not a string");
  38087. if ("number" != typeof i || i % 1 !== 0)
  38088. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38089. if (i >>>= 0,
  38090. i < 0 || i + 0 > this.buffer.byteLength)
  38091. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38092. }
  38093. var r, a, s = i;
  38094. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  38095. a = o.calculateVarint32(r),
  38096. i += a + r;
  38097. var l = this.buffer.byteLength;
  38098. if (i > l && this.resize((l *= 2) > i ? l : i),
  38099. i -= a + r,
  38100. i += this.writeVarint32(r, i),
  38101. h.encodeUTF16toUTF8(t(e), function(e) {
  38102. this.view[i++] = e
  38103. }
  38104. .bind(this)),
  38105. i !== s + r + a)
  38106. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + r + a));
  38107. return n ? (this.offset = i,
  38108. this) : i - s
  38109. }
  38110. ,
  38111. a.readVString = function(e) {
  38112. var t = "undefined" == typeof e;
  38113. if (t && (e = this.offset),
  38114. !this.noAssert) {
  38115. if ("number" != typeof e || e % 1 !== 0)
  38116. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38117. if (e >>>= 0,
  38118. e < 0 || e + 1 > this.buffer.byteLength)
  38119. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  38120. }
  38121. var i = e
  38122. , n = this.readVarint32(e)
  38123. , r = this.readUTF8String(n.value, o.METRICS_BYTES, e += n.length);
  38124. return e += r.length,
  38125. t ? (this.offset = e,
  38126. r.string) : {
  38127. string: r.string,
  38128. length: e - i
  38129. }
  38130. }
  38131. ,
  38132. a.append = function(e, t, i) {
  38133. "number" != typeof t && "string" == typeof t || (i = t,
  38134. t = void 0);
  38135. var n = "undefined" == typeof i;
  38136. if (n && (i = this.offset),
  38137. !this.noAssert) {
  38138. if ("number" != typeof i || i % 1 !== 0)
  38139. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38140. if (i >>>= 0,
  38141. i < 0 || i + 0 > this.buffer.byteLength)
  38142. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38143. }
  38144. e instanceof o || (e = o.wrap(e, t));
  38145. var r = e.limit - e.offset;
  38146. if (r <= 0)
  38147. return this;
  38148. i += r;
  38149. var a = this.buffer.byteLength;
  38150. return i > a && this.resize((a *= 2) > i ? a : i),
  38151. i -= r,
  38152. this.view.set(e.view.subarray(e.offset, e.limit), i),
  38153. e.offset += r,
  38154. n && (this.offset += r),
  38155. this
  38156. }
  38157. ,
  38158. a.appendTo = function(e, t) {
  38159. return e.append(this, t),
  38160. this
  38161. }
  38162. ,
  38163. a.assert = function(e) {
  38164. return this.noAssert = !e,
  38165. this
  38166. }
  38167. ,
  38168. a.capacity = function() {
  38169. return this.buffer.byteLength
  38170. }
  38171. ,
  38172. a.clear = function() {
  38173. return this.offset = 0,
  38174. this.limit = this.buffer.byteLength,
  38175. this.markedOffset = -1,
  38176. this
  38177. }
  38178. ,
  38179. a.clone = function(e) {
  38180. var t = new o(0,this.littleEndian,this.noAssert);
  38181. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  38182. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  38183. t.view = this.view),
  38184. t.offset = this.offset,
  38185. t.markedOffset = this.markedOffset,
  38186. t.limit = this.limit,
  38187. t
  38188. }
  38189. ,
  38190. a.compact = function(e, t) {
  38191. if ("undefined" == typeof e && (e = this.offset),
  38192. "undefined" == typeof t && (t = this.limit),
  38193. !this.noAssert) {
  38194. if ("number" != typeof e || e % 1 !== 0)
  38195. throw TypeError("Illegal begin: Not an integer");
  38196. if (e >>>= 0,
  38197. "number" != typeof t || t % 1 !== 0)
  38198. throw TypeError("Illegal end: Not an integer");
  38199. if (t >>>= 0,
  38200. e < 0 || e > t || t > this.buffer.byteLength)
  38201. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38202. }
  38203. if (0 === e && t === this.buffer.byteLength)
  38204. return this;
  38205. var i = t - e;
  38206. if (0 === i)
  38207. return this.buffer = s,
  38208. this.view = null,
  38209. this.markedOffset >= 0 && (this.markedOffset -= e),
  38210. this.offset = 0,
  38211. this.limit = 0,
  38212. this;
  38213. var n = new ArrayBuffer(i)
  38214. , r = new Uint8Array(n);
  38215. return r.set(this.view.subarray(e, t)),
  38216. this.buffer = n,
  38217. this.view = r,
  38218. this.markedOffset >= 0 && (this.markedOffset -= e),
  38219. this.offset = 0,
  38220. this.limit = i,
  38221. this
  38222. }
  38223. ,
  38224. a.copy = function(e, t) {
  38225. if ("undefined" == typeof e && (e = this.offset),
  38226. "undefined" == typeof t && (t = this.limit),
  38227. !this.noAssert) {
  38228. if ("number" != typeof e || e % 1 !== 0)
  38229. throw TypeError("Illegal begin: Not an integer");
  38230. if (e >>>= 0,
  38231. "number" != typeof t || t % 1 !== 0)
  38232. throw TypeError("Illegal end: Not an integer");
  38233. if (t >>>= 0,
  38234. e < 0 || e > t || t > this.buffer.byteLength)
  38235. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38236. }
  38237. if (e === t)
  38238. return new o(0,this.littleEndian,this.noAssert);
  38239. var i = t - e
  38240. , n = new o(i,this.littleEndian,this.noAssert);
  38241. return n.offset = 0,
  38242. n.limit = i,
  38243. n.markedOffset >= 0 && (n.markedOffset -= e),
  38244. this.copyTo(n, 0, e, t),
  38245. n
  38246. }
  38247. ,
  38248. a.copyTo = function(e, t, i, n) {
  38249. var r, a;
  38250. if (!this.noAssert && !o.isByteBuffer(e))
  38251. throw TypeError("Illegal target: Not a ByteBuffer");
  38252. if (t = (a = "undefined" == typeof t) ? e.offset : 0 | t,
  38253. i = (r = "undefined" == typeof i) ? this.offset : 0 | i,
  38254. n = "undefined" == typeof n ? this.limit : 0 | n,
  38255. t < 0 || t > e.buffer.byteLength)
  38256. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  38257. if (i < 0 || n > this.buffer.byteLength)
  38258. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  38259. var s = n - i;
  38260. return 0 === s ? e : (e.ensureCapacity(t + s),
  38261. e.view.set(this.view.subarray(i, n), t),
  38262. r && (this.offset += s),
  38263. a && (e.offset += s),
  38264. this)
  38265. }
  38266. ,
  38267. a.ensureCapacity = function(e) {
  38268. var t = this.buffer.byteLength;
  38269. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  38270. }
  38271. ,
  38272. a.fill = function(e, t, i) {
  38273. var n = "undefined" == typeof t;
  38274. if (n && (t = this.offset),
  38275. "string" == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  38276. "undefined" == typeof t && (t = this.offset),
  38277. "undefined" == typeof i && (i = this.limit),
  38278. !this.noAssert) {
  38279. if ("number" != typeof e || e % 1 !== 0)
  38280. throw TypeError("Illegal value: " + e + " (not an integer)");
  38281. if (e |= 0,
  38282. "number" != typeof t || t % 1 !== 0)
  38283. throw TypeError("Illegal begin: Not an integer");
  38284. if (t >>>= 0,
  38285. "number" != typeof i || i % 1 !== 0)
  38286. throw TypeError("Illegal end: Not an integer");
  38287. if (i >>>= 0,
  38288. t < 0 || t > i || i > this.buffer.byteLength)
  38289. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  38290. }
  38291. if (t >= i)
  38292. return this;
  38293. for (; t < i; )
  38294. this.view[t++] = e;
  38295. return n && (this.offset = t),
  38296. this
  38297. }
  38298. ,
  38299. a.flip = function() {
  38300. return this.limit = this.offset,
  38301. this.offset = 0,
  38302. this
  38303. }
  38304. ,
  38305. a.mark = function(e) {
  38306. if (e = "undefined" == typeof e ? this.offset : e,
  38307. !this.noAssert) {
  38308. if ("number" != typeof e || e % 1 !== 0)
  38309. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38310. if (e >>>= 0,
  38311. e < 0 || e + 0 > this.buffer.byteLength)
  38312. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  38313. }
  38314. return this.markedOffset = e,
  38315. this
  38316. }
  38317. ,
  38318. a.order = function(e) {
  38319. if (!this.noAssert && "boolean" != typeof e)
  38320. throw TypeError("Illegal littleEndian: Not a boolean");
  38321. return this.littleEndian = !!e,
  38322. this
  38323. }
  38324. ,
  38325. a.LE = function(e) {
  38326. return this.littleEndian = "undefined" == typeof e || !!e,
  38327. this
  38328. }
  38329. ,
  38330. a.BE = function(e) {
  38331. return this.littleEndian = "undefined" != typeof e && !e,
  38332. this
  38333. }
  38334. ,
  38335. a.prepend = function(e, t, i) {
  38336. "number" != typeof t && "string" == typeof t || (i = t,
  38337. t = void 0);
  38338. var n = "undefined" == typeof i;
  38339. if (n && (i = this.offset),
  38340. !this.noAssert) {
  38341. if ("number" != typeof i || i % 1 !== 0)
  38342. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38343. if (i >>>= 0,
  38344. i < 0 || i + 0 > this.buffer.byteLength)
  38345. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38346. }
  38347. e instanceof o || (e = o.wrap(e, t));
  38348. var r = e.limit - e.offset;
  38349. if (r <= 0)
  38350. return this;
  38351. var a = r - i;
  38352. if (a > 0) {
  38353. var s = new ArrayBuffer(this.buffer.byteLength + a)
  38354. , l = new Uint8Array(s);
  38355. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  38356. this.buffer = s,
  38357. this.view = l,
  38358. this.offset += a,
  38359. this.markedOffset >= 0 && (this.markedOffset += a),
  38360. this.limit += a,
  38361. i += a
  38362. } else {
  38363. new Uint8Array(this.buffer)
  38364. }
  38365. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  38366. e.offset = e.limit,
  38367. n && (this.offset -= r),
  38368. this
  38369. }
  38370. ,
  38371. a.prependTo = function(e, t) {
  38372. return e.prepend(this, t),
  38373. this
  38374. }
  38375. ,
  38376. a.printDebug = function(e) {
  38377. "function" != typeof e && (e = console.log.bind(console)),
  38378. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  38379. }
  38380. ,
  38381. a.remaining = function() {
  38382. return this.limit - this.offset
  38383. }
  38384. ,
  38385. a.reset = function() {
  38386. return this.markedOffset >= 0 ? (this.offset = this.markedOffset,
  38387. this.markedOffset = -1) : this.offset = 0,
  38388. this
  38389. }
  38390. ,
  38391. a.resize = function(e) {
  38392. if (!this.noAssert) {
  38393. if ("number" != typeof e || e % 1 !== 0)
  38394. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  38395. if (e |= 0,
  38396. e < 0)
  38397. throw RangeError("Illegal capacity: 0 <= " + e)
  38398. }
  38399. if (this.buffer.byteLength < e) {
  38400. var t = new ArrayBuffer(e)
  38401. , i = new Uint8Array(t);
  38402. i.set(this.view),
  38403. this.buffer = t,
  38404. this.view = i
  38405. }
  38406. return this
  38407. }
  38408. ,
  38409. a.reverse = function(e, t) {
  38410. if ("undefined" == typeof e && (e = this.offset),
  38411. "undefined" == typeof t && (t = this.limit),
  38412. !this.noAssert) {
  38413. if ("number" != typeof e || e % 1 !== 0)
  38414. throw TypeError("Illegal begin: Not an integer");
  38415. if (e >>>= 0,
  38416. "number" != typeof t || t % 1 !== 0)
  38417. throw TypeError("Illegal end: Not an integer");
  38418. if (t >>>= 0,
  38419. e < 0 || e > t || t > this.buffer.byteLength)
  38420. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38421. }
  38422. return e === t ? this : (Array.prototype.reverse.call(this.view.subarray(e, t)),
  38423. this)
  38424. }
  38425. ,
  38426. a.skip = function(e) {
  38427. if (!this.noAssert) {
  38428. if ("number" != typeof e || e % 1 !== 0)
  38429. throw TypeError("Illegal length: " + e + " (not an integer)");
  38430. e |= 0
  38431. }
  38432. var t = this.offset + e;
  38433. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  38434. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  38435. return this.offset = t,
  38436. this
  38437. }
  38438. ,
  38439. a.slice = function(e, t) {
  38440. if ("undefined" == typeof e && (e = this.offset),
  38441. "undefined" == typeof t && (t = this.limit),
  38442. !this.noAssert) {
  38443. if ("number" != typeof e || e % 1 !== 0)
  38444. throw TypeError("Illegal begin: Not an integer");
  38445. if (e >>>= 0,
  38446. "number" != typeof t || t % 1 !== 0)
  38447. throw TypeError("Illegal end: Not an integer");
  38448. if (t >>>= 0,
  38449. e < 0 || e > t || t > this.buffer.byteLength)
  38450. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38451. }
  38452. var i = this.clone();
  38453. return i.offset = e,
  38454. i.limit = t,
  38455. i
  38456. }
  38457. ,
  38458. a.toBuffer = function(e) {
  38459. var t = this.offset
  38460. , i = this.limit;
  38461. if (!this.noAssert) {
  38462. if ("number" != typeof t || t % 1 !== 0)
  38463. throw TypeError("Illegal offset: Not an integer");
  38464. if (t >>>= 0,
  38465. "number" != typeof i || i % 1 !== 0)
  38466. throw TypeError("Illegal limit: Not an integer");
  38467. if (i >>>= 0,
  38468. t < 0 || t > i || i > this.buffer.byteLength)
  38469. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  38470. }
  38471. if (!e && 0 === t && i === this.buffer.byteLength)
  38472. return this.buffer;
  38473. if (t === i)
  38474. return s;
  38475. var n = new ArrayBuffer(i - t);
  38476. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  38477. n
  38478. }
  38479. ,
  38480. a.toArrayBuffer = a.toBuffer,
  38481. a.toString = function(e, t, i) {
  38482. if ("undefined" == typeof e)
  38483. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  38484. switch ("number" == typeof e && (e = "utf8",
  38485. t = e,
  38486. i = t),
  38487. e) {
  38488. case "utf8":
  38489. return this.toUTF8(t, i);
  38490. case "base64":
  38491. return this.toBase64(t, i);
  38492. case "hex":
  38493. return this.toHex(t, i);
  38494. case "binary":
  38495. return this.toBinary(t, i);
  38496. case "debug":
  38497. return this.toDebug();
  38498. case "columns":
  38499. return this.toColumns();
  38500. default:
  38501. throw Error("Unsupported encoding: " + e)
  38502. }
  38503. }
  38504. ;
  38505. var c = function() {
  38506. for (var e = {}, t = [65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47], i = [], n = 0, r = t.length; n < r; ++n)
  38507. i[t[n]] = n;
  38508. return e.encode = function(e, i) {
  38509. for (var n, r; null !== (n = e()); )
  38510. i(t[n >> 2 & 63]),
  38511. r = (3 & n) << 4,
  38512. null !== (n = e()) ? (r |= n >> 4 & 15,
  38513. i(t[63 & (r | n >> 4 & 15)]),
  38514. r = (15 & n) << 2,
  38515. null !== (n = e()) ? (i(t[63 & (r | n >> 6 & 3)]),
  38516. i(t[63 & n])) : (i(t[63 & r]),
  38517. i(61))) : (i(t[63 & r]),
  38518. i(61),
  38519. i(61))
  38520. }
  38521. ,
  38522. e.decode = function(e, t) {
  38523. function n(e) {
  38524. throw Error("Illegal character code: " + e)
  38525. }
  38526. for (var r, o, a; null !== (r = e()); )
  38527. if (o = i[r],
  38528. "undefined" == typeof o && n(r),
  38529. null !== (r = e()) && (a = i[r],
  38530. "undefined" == typeof a && n(r),
  38531. t(o << 2 >>> 0 | (48 & a) >> 4),
  38532. null !== (r = e()))) {
  38533. if (o = i[r],
  38534. "undefined" == typeof o) {
  38535. if (61 === r)
  38536. break;
  38537. n(r)
  38538. }
  38539. if (t((15 & a) << 4 >>> 0 | (60 & o) >> 2),
  38540. null !== (r = e())) {
  38541. if (a = i[r],
  38542. "undefined" == typeof a) {
  38543. if (61 === r)
  38544. break;
  38545. n(r)
  38546. }
  38547. t((3 & o) << 6 >>> 0 | a)
  38548. }
  38549. }
  38550. }
  38551. ,
  38552. e.test = function(e) {
  38553. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  38554. }
  38555. ,
  38556. e
  38557. }();
  38558. a.toBase64 = function(e, t) {
  38559. if ("undefined" == typeof e && (e = this.offset),
  38560. "undefined" == typeof t && (t = this.limit),
  38561. e |= 0,
  38562. t |= 0,
  38563. e < 0 || t > this.capacity || e > t)
  38564. throw RangeError("begin, end");
  38565. var n;
  38566. return c.encode(function() {
  38567. return e < t ? this.view[e++] : null
  38568. }
  38569. .bind(this), n = i()),
  38570. n()
  38571. }
  38572. ,
  38573. o.fromBase64 = function(e, i) {
  38574. if ("string" != typeof e)
  38575. throw TypeError("str");
  38576. var n = new o(e.length / 4 * 3,i)
  38577. , r = 0;
  38578. return c.decode(t(e), function(e) {
  38579. n.view[r++] = e
  38580. }),
  38581. n.limit = r,
  38582. n
  38583. }
  38584. ,
  38585. o.btoa = function(e) {
  38586. return o.fromBinary(e).toBase64()
  38587. }
  38588. ,
  38589. o.atob = function(e) {
  38590. return o.fromBase64(e).toBinary()
  38591. }
  38592. ,
  38593. a.toBinary = function(e, t) {
  38594. if ("undefined" == typeof e && (e = this.offset),
  38595. "undefined" == typeof t && (t = this.limit),
  38596. e |= 0,
  38597. t |= 0,
  38598. e < 0 || t > this.capacity() || e > t)
  38599. throw RangeError("begin, end");
  38600. if (e === t)
  38601. return "";
  38602. for (var i = [], n = []; e < t; )
  38603. i.push(this.view[e++]),
  38604. i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)),
  38605. i = []);
  38606. return n.join("") + String.fromCharCode.apply(String, i)
  38607. }
  38608. ,
  38609. o.fromBinary = function(e, t) {
  38610. if ("string" != typeof e)
  38611. throw TypeError("str");
  38612. for (var i, n = 0, r = e.length, a = new o(r,t); n < r; ) {
  38613. if (i = e.charCodeAt(n),
  38614. i > 255)
  38615. throw RangeError("illegal char code: " + i);
  38616. a.view[n++] = i
  38617. }
  38618. return a.limit = r,
  38619. a
  38620. }
  38621. ,
  38622. a.toDebug = function(e) {
  38623. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  38624. if (i !== -1 && (t = this.view[i],
  38625. r += t < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  38626. e && (o += t > 32 && t < 127 ? String.fromCharCode(t) : ".")),
  38627. ++i,
  38628. e && i > 0 && i % 16 === 0 && i !== n) {
  38629. for (; r.length < 51; )
  38630. r += " ";
  38631. a += r + o + "\n",
  38632. r = o = ""
  38633. }
  38634. 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 ? " " : ""
  38635. }
  38636. if (e && " " !== r) {
  38637. for (; r.length < 51; )
  38638. r += " ";
  38639. a += r + o + "\n"
  38640. }
  38641. return e ? a : r
  38642. }
  38643. ,
  38644. o.fromDebug = function(e, t, i) {
  38645. for (var n, r, a = e.length, s = new o((a + 1) / 3 | 0,t,i), l = 0, c = 0, h = !1, u = !1, d = !1, p = !1, f = !1; l < a; ) {
  38646. switch (n = e.charAt(l++)) {
  38647. case "!":
  38648. if (!i) {
  38649. if (u || d || p) {
  38650. f = !0;
  38651. break
  38652. }
  38653. u = d = p = !0
  38654. }
  38655. s.offset = s.markedOffset = s.limit = c,
  38656. h = !1;
  38657. break;
  38658. case "|":
  38659. if (!i) {
  38660. if (u || p) {
  38661. f = !0;
  38662. break
  38663. }
  38664. u = p = !0
  38665. }
  38666. s.offset = s.limit = c,
  38667. h = !1;
  38668. break;
  38669. case "[":
  38670. if (!i) {
  38671. if (u || d) {
  38672. f = !0;
  38673. break
  38674. }
  38675. u = d = !0
  38676. }
  38677. s.offset = s.markedOffset = c,
  38678. h = !1;
  38679. break;
  38680. case "<":
  38681. if (!i) {
  38682. if (u) {
  38683. f = !0;
  38684. break
  38685. }
  38686. u = !0
  38687. }
  38688. s.offset = c,
  38689. h = !1;
  38690. break;
  38691. case "]":
  38692. if (!i) {
  38693. if (p || d) {
  38694. f = !0;
  38695. break
  38696. }
  38697. p = d = !0
  38698. }
  38699. s.limit = s.markedOffset = c,
  38700. h = !1;
  38701. break;
  38702. case ">":
  38703. if (!i) {
  38704. if (p) {
  38705. f = !0;
  38706. break
  38707. }
  38708. p = !0
  38709. }
  38710. s.limit = c,
  38711. h = !1;
  38712. break;
  38713. case "'":
  38714. if (!i) {
  38715. if (d) {
  38716. f = !0;
  38717. break
  38718. }
  38719. d = !0
  38720. }
  38721. s.markedOffset = c,
  38722. h = !1;
  38723. break;
  38724. case " ":
  38725. h = !1;
  38726. break;
  38727. default:
  38728. if (!i && h) {
  38729. f = !0;
  38730. break
  38731. }
  38732. if (r = parseInt(n + e.charAt(l++), 16),
  38733. !i && (isNaN(r) || r < 0 || r > 255))
  38734. throw TypeError("Illegal str: Not a debug encoded string");
  38735. s.view[c++] = r,
  38736. h = !0
  38737. }
  38738. if (f)
  38739. throw TypeError("Illegal str: Invalid symbol at " + l)
  38740. }
  38741. if (!i) {
  38742. if (!u || !p)
  38743. throw TypeError("Illegal str: Missing offset or limit");
  38744. if (c < s.buffer.byteLength)
  38745. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + c + " < " + a)
  38746. }
  38747. return s
  38748. }
  38749. ,
  38750. a.toHex = function(e, t) {
  38751. if (e = "undefined" == typeof e ? this.offset : e,
  38752. t = "undefined" == typeof t ? this.limit : t,
  38753. !this.noAssert) {
  38754. if ("number" != typeof e || e % 1 !== 0)
  38755. throw TypeError("Illegal begin: Not an integer");
  38756. if (e >>>= 0,
  38757. "number" != typeof t || t % 1 !== 0)
  38758. throw TypeError("Illegal end: Not an integer");
  38759. if (t >>>= 0,
  38760. e < 0 || e > t || t > this.buffer.byteLength)
  38761. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38762. }
  38763. for (var i, n = new Array(t - e); e < t; )
  38764. i = this.view[e++],
  38765. i < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  38766. return n.join("")
  38767. }
  38768. ,
  38769. o.fromHex = function(e, t, i) {
  38770. if (!i) {
  38771. if ("string" != typeof e)
  38772. throw TypeError("Illegal str: Not a string");
  38773. if (e.length % 2 !== 0)
  38774. throw TypeError("Illegal str: Length not a multiple of 2")
  38775. }
  38776. for (var n, r = e.length, a = new o(r / 2 | 0,t), s = 0, l = 0; s < r; s += 2) {
  38777. if (n = parseInt(e.substring(s, s + 2), 16),
  38778. !i && (!isFinite(n) || n < 0 || n > 255))
  38779. throw TypeError("Illegal str: Contains non-hex characters");
  38780. a.view[l++] = n
  38781. }
  38782. return a.limit = l,
  38783. a
  38784. }
  38785. ;
  38786. var h = function() {
  38787. var e = {};
  38788. return e.MAX_CODEPOINT = 1114111,
  38789. e.encodeUTF8 = function(e, t) {
  38790. var i = null;
  38791. for ("number" == typeof e && (i = e,
  38792. e = function() {
  38793. return null
  38794. }
  38795. ); null !== i || null !== (i = e()); )
  38796. i < 128 ? t(127 & i) : i < 2048 ? (t(i >> 6 & 31 | 192),
  38797. t(63 & i | 128)) : i < 65536 ? (t(i >> 12 & 15 | 224),
  38798. t(i >> 6 & 63 | 128),
  38799. t(63 & i | 128)) : (t(i >> 18 & 7 | 240),
  38800. t(i >> 12 & 63 | 128),
  38801. t(i >> 6 & 63 | 128),
  38802. t(63 & i | 128)),
  38803. i = null
  38804. }
  38805. ,
  38806. e.decodeUTF8 = function(e, t) {
  38807. for (var i, n, r, o, a = function(e) {
  38808. e = e.slice(0, e.indexOf(null));
  38809. var t = Error(e.toString());
  38810. throw t.name = "TruncatedError",
  38811. t.bytes = e,
  38812. t
  38813. }; null !== (i = e()); )
  38814. if (0 === (128 & i))
  38815. t(i);
  38816. else if (192 === (224 & i))
  38817. null === (n = e()) && a([i, n]),
  38818. t((31 & i) << 6 | 63 & n);
  38819. else if (224 === (240 & i))
  38820. (null === (n = e()) || null === (r = e())) && a([i, n, r]),
  38821. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  38822. else {
  38823. if (240 !== (248 & i))
  38824. throw RangeError("Illegal starting byte: " + i);
  38825. (null === (n = e()) || null === (r = e()) || null === (o = e())) && a([i, n, r, o]),
  38826. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  38827. }
  38828. }
  38829. ,
  38830. e.UTF16toUTF8 = function(e, t) {
  38831. for (var i, n = null; ; ) {
  38832. if (null === (i = null !== n ? n : e()))
  38833. break;
  38834. i >= 55296 && i <= 57343 && null !== (n = e()) && n >= 56320 && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  38835. n = null) : t(i)
  38836. }
  38837. null !== n && t(n)
  38838. }
  38839. ,
  38840. e.UTF8toUTF16 = function(e, t) {
  38841. var i = null;
  38842. for ("number" == typeof e && (i = e,
  38843. e = function() {
  38844. return null
  38845. }
  38846. ); null !== i || null !== (i = e()); )
  38847. i <= 65535 ? t(i) : (i -= 65536,
  38848. t((i >> 10) + 55296),
  38849. t(i % 1024 + 56320)),
  38850. i = null
  38851. }
  38852. ,
  38853. e.encodeUTF16toUTF8 = function(t, i) {
  38854. e.UTF16toUTF8(t, function(t) {
  38855. e.encodeUTF8(t, i)
  38856. })
  38857. }
  38858. ,
  38859. e.decodeUTF8toUTF16 = function(t, i) {
  38860. e.decodeUTF8(t, function(t) {
  38861. e.UTF8toUTF16(t, i)
  38862. })
  38863. }
  38864. ,
  38865. e.calculateCodePoint = function(e) {
  38866. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  38867. }
  38868. ,
  38869. e.calculateUTF8 = function(e) {
  38870. for (var t, i = 0; null !== (t = e()); )
  38871. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  38872. return i
  38873. }
  38874. ,
  38875. e.calculateUTF16asUTF8 = function(t) {
  38876. var i = 0
  38877. , n = 0;
  38878. return e.UTF16toUTF8(t, function(e) {
  38879. ++i,
  38880. n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  38881. }),
  38882. [i, n]
  38883. }
  38884. ,
  38885. e
  38886. }();
  38887. return a.toUTF8 = function(e, t) {
  38888. if ("undefined" == typeof e && (e = this.offset),
  38889. "undefined" == typeof t && (t = this.limit),
  38890. !this.noAssert) {
  38891. if ("number" != typeof e || e % 1 !== 0)
  38892. throw TypeError("Illegal begin: Not an integer");
  38893. if (e >>>= 0,
  38894. "number" != typeof t || t % 1 !== 0)
  38895. throw TypeError("Illegal end: Not an integer");
  38896. if (t >>>= 0,
  38897. e < 0 || e > t || t > this.buffer.byteLength)
  38898. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38899. }
  38900. var n;
  38901. try {
  38902. h.decodeUTF8toUTF16(function() {
  38903. return e < t ? this.view[e++] : null
  38904. }
  38905. .bind(this), n = i())
  38906. } catch (i) {
  38907. if (e !== t)
  38908. throw RangeError("Illegal range: Truncated data, " + e + " != " + t)
  38909. }
  38910. return n()
  38911. }
  38912. ,
  38913. o.fromUTF8 = function(e, i, n) {
  38914. if (!n && "string" != typeof e)
  38915. throw TypeError("Illegal str: Not a string");
  38916. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1],i,n)
  38917. , a = 0;
  38918. return h.encodeUTF16toUTF8(t(e), function(e) {
  38919. r.view[a++] = e
  38920. }),
  38921. r.limit = a,
  38922. r
  38923. }
  38924. ,
  38925. o
  38926. })
  38927. }
  38928. , {
  38929. long: 216
  38930. }],
  38931. 216: [function(e, t, i) {
  38932. !function(i, n) {
  38933. "function" == typeof define && define.amd ? define([], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = n() : (i.dcodeIO = i.dcodeIO || {}).Long = n()
  38934. }(this, function() {
  38935. "use strict";
  38936. function e(e, t, i) {
  38937. this.low = 0 | e,
  38938. this.high = 0 | t,
  38939. this.unsigned = !!i
  38940. }
  38941. function t(e) {
  38942. return (e && e.__isLong__) === !0
  38943. }
  38944. function i(e, t) {
  38945. var i, n, o;
  38946. return t ? (e >>>= 0,
  38947. (o = 0 <= e && e < 256) && (n = l[e]) ? n : (i = r(e, (0 | e) < 0 ? -1 : 0, !0),
  38948. o && (l[e] = i),
  38949. i)) : (e |= 0,
  38950. (o = -128 <= e && e < 128) && (n = s[e]) ? n : (i = r(e, e < 0 ? -1 : 0, !1),
  38951. o && (s[e] = i),
  38952. i))
  38953. }
  38954. function n(e, t) {
  38955. if (isNaN(e) || !isFinite(e))
  38956. return t ? m : g;
  38957. if (t) {
  38958. if (e < 0)
  38959. return m;
  38960. if (e >= d)
  38961. return I
  38962. } else {
  38963. if (e <= -p)
  38964. return E;
  38965. if (e + 1 >= p)
  38966. return C
  38967. }
  38968. return e < 0 ? n(-e, t).neg() : r(e % u | 0, e / u | 0, t)
  38969. }
  38970. function r(t, i, n) {
  38971. return new e(t,i,n)
  38972. }
  38973. function o(e, t, i) {
  38974. if (0 === e.length)
  38975. throw Error("empty string");
  38976. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  38977. return g;
  38978. if ("number" == typeof t ? (i = t,
  38979. t = !1) : t = !!t,
  38980. i = i || 10,
  38981. i < 2 || 36 < i)
  38982. throw RangeError("radix");
  38983. var r;
  38984. if ((r = e.indexOf("-")) > 0)
  38985. throw Error("interior hyphen");
  38986. if (0 === r)
  38987. return o(e.substring(1), t, i).neg();
  38988. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  38989. var h = Math.min(8, e.length - l)
  38990. , u = parseInt(e.substring(l, l + h), i);
  38991. if (h < 8) {
  38992. var d = n(c(i, h));
  38993. s = s.mul(d).add(n(u))
  38994. } else
  38995. s = s.mul(a),
  38996. s = s.add(n(u))
  38997. }
  38998. return s.unsigned = t,
  38999. s
  39000. }
  39001. function a(t) {
  39002. return t instanceof e ? t : "number" == typeof t ? n(t) : "string" == typeof t ? o(t) : r(t.low, t.high, t.unsigned)
  39003. }
  39004. e.prototype.__isLong__,
  39005. Object.defineProperty(e.prototype, "__isLong__", {
  39006. value: !0,
  39007. enumerable: !1,
  39008. configurable: !1
  39009. }),
  39010. e.isLong = t;
  39011. var s = {}
  39012. , l = {};
  39013. e.fromInt = i,
  39014. e.fromNumber = n,
  39015. e.fromBits = r;
  39016. var c = Math.pow;
  39017. e.fromString = o,
  39018. e.fromValue = a;
  39019. var h = 1 << 24
  39020. , u = 4294967296
  39021. , d = 0x10000000000000000
  39022. , p = d / 2
  39023. , f = i(h)
  39024. , g = i(0);
  39025. e.ZERO = g;
  39026. var m = i(0, !0);
  39027. e.UZERO = m;
  39028. var v = i(1);
  39029. e.ONE = v;
  39030. var A = i(1, !0);
  39031. e.UONE = A;
  39032. var y = i(-1);
  39033. e.NEG_ONE = y;
  39034. var C = r(-1, 2147483647, !1);
  39035. e.MAX_VALUE = C;
  39036. var I = r(-1, -1, !0);
  39037. e.MAX_UNSIGNED_VALUE = I;
  39038. var E = r(0, -2147483648, !1);
  39039. e.MIN_VALUE = E;
  39040. var b = e.prototype;
  39041. return b.toInt = function() {
  39042. return this.unsigned ? this.low >>> 0 : this.low
  39043. }
  39044. ,
  39045. b.toNumber = function() {
  39046. return this.unsigned ? (this.high >>> 0) * u + (this.low >>> 0) : this.high * u + (this.low >>> 0)
  39047. }
  39048. ,
  39049. b.toString = function(e) {
  39050. if (e = e || 10,
  39051. e < 2 || 36 < e)
  39052. throw RangeError("radix");
  39053. if (this.isZero())
  39054. return "0";
  39055. if (this.isNegative()) {
  39056. if (this.eq(E)) {
  39057. var t = n(e)
  39058. , i = this.div(t)
  39059. , r = i.mul(t).sub(this);
  39060. return i.toString(e) + r.toInt().toString(e)
  39061. }
  39062. return "-" + this.neg().toString(e)
  39063. }
  39064. for (var o = n(c(e, 6), this.unsigned), a = this, s = ""; ; ) {
  39065. var l = a.div(o)
  39066. , h = a.sub(l.mul(o)).toInt() >>> 0
  39067. , u = h.toString(e);
  39068. if (a = l,
  39069. a.isZero())
  39070. return u + s;
  39071. for (; u.length < 6; )
  39072. u = "0" + u;
  39073. s = "" + u + s
  39074. }
  39075. }
  39076. ,
  39077. b.getHighBits = function() {
  39078. return this.high
  39079. }
  39080. ,
  39081. b.getHighBitsUnsigned = function() {
  39082. return this.high >>> 0
  39083. }
  39084. ,
  39085. b.getLowBits = function() {
  39086. return this.low
  39087. }
  39088. ,
  39089. b.getLowBitsUnsigned = function() {
  39090. return this.low >>> 0
  39091. }
  39092. ,
  39093. b.getNumBitsAbs = function() {
  39094. if (this.isNegative())
  39095. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  39096. for (var e = 0 != this.high ? this.high : this.low, t = 31; t > 0 && 0 == (e & 1 << t); t--)
  39097. ;
  39098. return 0 != this.high ? t + 33 : t + 1
  39099. }
  39100. ,
  39101. b.isZero = function() {
  39102. return 0 === this.high && 0 === this.low
  39103. }
  39104. ,
  39105. b.isNegative = function() {
  39106. return !this.unsigned && this.high < 0
  39107. }
  39108. ,
  39109. b.isPositive = function() {
  39110. return this.unsigned || this.high >= 0
  39111. }
  39112. ,
  39113. b.isOdd = function() {
  39114. return 1 === (1 & this.low)
  39115. }
  39116. ,
  39117. b.isEven = function() {
  39118. return 0 === (1 & this.low)
  39119. }
  39120. ,
  39121. b.equals = function(e) {
  39122. return t(e) || (e = a(e)),
  39123. (this.unsigned === e.unsigned || this.high >>> 31 !== 1 || e.high >>> 31 !== 1) && (this.high === e.high && this.low === e.low)
  39124. }
  39125. ,
  39126. b.eq = b.equals,
  39127. b.notEquals = function(e) {
  39128. return !this.eq(e)
  39129. }
  39130. ,
  39131. b.neq = b.notEquals,
  39132. b.lessThan = function(e) {
  39133. return this.comp(e) < 0
  39134. }
  39135. ,
  39136. b.lt = b.lessThan,
  39137. b.lessThanOrEqual = function(e) {
  39138. return this.comp(e) <= 0
  39139. }
  39140. ,
  39141. b.lte = b.lessThanOrEqual,
  39142. b.greaterThan = function(e) {
  39143. return this.comp(e) > 0
  39144. }
  39145. ,
  39146. b.gt = b.greaterThan,
  39147. b.greaterThanOrEqual = function(e) {
  39148. return this.comp(e) >= 0
  39149. }
  39150. ,
  39151. b.gte = b.greaterThanOrEqual,
  39152. b.compare = function(e) {
  39153. if (t(e) || (e = a(e)),
  39154. this.eq(e))
  39155. return 0;
  39156. var i = this.isNegative()
  39157. , n = e.isNegative();
  39158. return i && !n ? -1 : !i && n ? 1 : this.unsigned ? e.high >>> 0 > this.high >>> 0 || e.high === this.high && e.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.sub(e).isNegative() ? -1 : 1
  39159. }
  39160. ,
  39161. b.comp = b.compare,
  39162. b.negate = function() {
  39163. return !this.unsigned && this.eq(E) ? E : this.not().add(v)
  39164. }
  39165. ,
  39166. b.neg = b.negate,
  39167. b.add = function(e) {
  39168. t(e) || (e = a(e));
  39169. var i = this.high >>> 16
  39170. , n = 65535 & this.high
  39171. , o = this.low >>> 16
  39172. , s = 65535 & this.low
  39173. , l = e.high >>> 16
  39174. , c = 65535 & e.high
  39175. , h = e.low >>> 16
  39176. , u = 65535 & e.low
  39177. , d = 0
  39178. , p = 0
  39179. , f = 0
  39180. , g = 0;
  39181. return g += s + u,
  39182. f += g >>> 16,
  39183. g &= 65535,
  39184. f += o + h,
  39185. p += f >>> 16,
  39186. f &= 65535,
  39187. p += n + c,
  39188. d += p >>> 16,
  39189. p &= 65535,
  39190. d += i + l,
  39191. d &= 65535,
  39192. r(f << 16 | g, d << 16 | p, this.unsigned)
  39193. }
  39194. ,
  39195. b.subtract = function(e) {
  39196. return t(e) || (e = a(e)),
  39197. this.add(e.neg())
  39198. }
  39199. ,
  39200. b.sub = b.subtract,
  39201. b.multiply = function(e) {
  39202. if (this.isZero())
  39203. return g;
  39204. if (t(e) || (e = a(e)),
  39205. e.isZero())
  39206. return g;
  39207. if (this.eq(E))
  39208. return e.isOdd() ? E : g;
  39209. if (e.eq(E))
  39210. return this.isOdd() ? E : g;
  39211. if (this.isNegative())
  39212. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  39213. if (e.isNegative())
  39214. return this.mul(e.neg()).neg();
  39215. if (this.lt(f) && e.lt(f))
  39216. return n(this.toNumber() * e.toNumber(), this.unsigned);
  39217. var i = this.high >>> 16
  39218. , o = 65535 & this.high
  39219. , s = this.low >>> 16
  39220. , l = 65535 & this.low
  39221. , c = e.high >>> 16
  39222. , h = 65535 & e.high
  39223. , u = e.low >>> 16
  39224. , d = 65535 & e.low
  39225. , p = 0
  39226. , m = 0
  39227. , v = 0
  39228. , A = 0;
  39229. return A += l * d,
  39230. v += A >>> 16,
  39231. A &= 65535,
  39232. v += s * d,
  39233. m += v >>> 16,
  39234. v &= 65535,
  39235. v += l * u,
  39236. m += v >>> 16,
  39237. v &= 65535,
  39238. m += o * d,
  39239. p += m >>> 16,
  39240. m &= 65535,
  39241. m += s * u,
  39242. p += m >>> 16,
  39243. m &= 65535,
  39244. m += l * h,
  39245. p += m >>> 16,
  39246. m &= 65535,
  39247. p += i * d + o * u + s * h + l * c,
  39248. p &= 65535,
  39249. r(v << 16 | A, p << 16 | m, this.unsigned)
  39250. }
  39251. ,
  39252. b.mul = b.multiply,
  39253. b.divide = function(e) {
  39254. if (t(e) || (e = a(e)),
  39255. e.isZero())
  39256. throw Error("division by zero");
  39257. if (this.isZero())
  39258. return this.unsigned ? m : g;
  39259. var i, r, o;
  39260. if (this.unsigned) {
  39261. if (e.unsigned || (e = e.toUnsigned()),
  39262. e.gt(this))
  39263. return m;
  39264. if (e.gt(this.shru(1)))
  39265. return A;
  39266. o = m
  39267. } else {
  39268. if (this.eq(E)) {
  39269. if (e.eq(v) || e.eq(y))
  39270. return E;
  39271. if (e.eq(E))
  39272. return v;
  39273. var s = this.shr(1);
  39274. return i = s.div(e).shl(1),
  39275. i.eq(g) ? e.isNegative() ? v : y : (r = this.sub(e.mul(i)),
  39276. o = i.add(r.div(e)))
  39277. }
  39278. if (e.eq(E))
  39279. return this.unsigned ? m : g;
  39280. if (this.isNegative())
  39281. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  39282. if (e.isNegative())
  39283. return this.div(e.neg()).neg();
  39284. o = g
  39285. }
  39286. for (r = this; r.gte(e); ) {
  39287. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));
  39288. for (var l = Math.ceil(Math.log(i) / Math.LN2), h = l <= 48 ? 1 : c(2, l - 48), u = n(i), d = u.mul(e); d.isNegative() || d.gt(r); )
  39289. i -= h,
  39290. u = n(i, this.unsigned),
  39291. d = u.mul(e);
  39292. u.isZero() && (u = v),
  39293. o = o.add(u),
  39294. r = r.sub(d)
  39295. }
  39296. return o
  39297. }
  39298. ,
  39299. b.div = b.divide,
  39300. b.modulo = function(e) {
  39301. return t(e) || (e = a(e)),
  39302. this.sub(this.div(e).mul(e))
  39303. }
  39304. ,
  39305. b.mod = b.modulo,
  39306. b.not = function() {
  39307. return r(~this.low, ~this.high, this.unsigned)
  39308. }
  39309. ,
  39310. b.and = function(e) {
  39311. return t(e) || (e = a(e)),
  39312. r(this.low & e.low, this.high & e.high, this.unsigned)
  39313. }
  39314. ,
  39315. b.or = function(e) {
  39316. return t(e) || (e = a(e)),
  39317. r(this.low | e.low, this.high | e.high, this.unsigned)
  39318. }
  39319. ,
  39320. b.xor = function(e) {
  39321. return t(e) || (e = a(e)),
  39322. r(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  39323. }
  39324. ,
  39325. b.shiftLeft = function(e) {
  39326. return t(e) && (e = e.toInt()),
  39327. 0 === (e &= 63) ? this : e < 32 ? r(this.low << e, this.high << e | this.low >>> 32 - e, this.unsigned) : r(0, this.low << e - 32, this.unsigned)
  39328. }
  39329. ,
  39330. b.shl = b.shiftLeft,
  39331. b.shiftRight = function(e) {
  39332. return t(e) && (e = e.toInt()),
  39333. 0 === (e &= 63) ? this : e < 32 ? r(this.low >>> e | this.high << 32 - e, this.high >> e, this.unsigned) : r(this.high >> e - 32, this.high >= 0 ? 0 : -1, this.unsigned)
  39334. }
  39335. ,
  39336. b.shr = b.shiftRight,
  39337. b.shiftRightUnsigned = function(e) {
  39338. if (t(e) && (e = e.toInt()),
  39339. e &= 63,
  39340. 0 === e)
  39341. return this;
  39342. var i = this.high;
  39343. if (e < 32) {
  39344. var n = this.low;
  39345. return r(n >>> e | i << 32 - e, i >>> e, this.unsigned)
  39346. }
  39347. return 32 === e ? r(i, 0, this.unsigned) : r(i >>> e - 32, 0, this.unsigned)
  39348. }
  39349. ,
  39350. b.shru = b.shiftRightUnsigned,
  39351. b.toSigned = function() {
  39352. return this.unsigned ? r(this.low, this.high, !1) : this
  39353. }
  39354. ,
  39355. b.toUnsigned = function() {
  39356. return this.unsigned ? this : r(this.low, this.high, !0)
  39357. }
  39358. ,
  39359. b.toBytes = function(e) {
  39360. return e ? this.toBytesLE() : this.toBytesBE()
  39361. }
  39362. ,
  39363. b.toBytesLE = function() {
  39364. var e = this.high
  39365. , t = this.low;
  39366. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  39367. }
  39368. ,
  39369. b.toBytesBE = function() {
  39370. var e = this.high
  39371. , t = this.low;
  39372. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  39373. }
  39374. ,
  39375. e
  39376. })
  39377. }
  39378. , {}],
  39379. 217: [function(e, t, i) {
  39380. var n = {
  39381. REVISION: "75"
  39382. };
  39383. "function" == typeof define && define.amd ? define("three", n) : "undefined" != typeof i && "undefined" != typeof t && (t.exports = n),
  39384. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  39385. void 0 === Math.sign && (Math.sign = function(e) {
  39386. return e < 0 ? -1 : e > 0 ? 1 : +e
  39387. }
  39388. ),
  39389. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  39390. get: function() {
  39391. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  39392. }
  39393. }),
  39394. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  39395. writable: !0,
  39396. configurable: !0,
  39397. value: function(e) {
  39398. "use strict";
  39399. if (void 0 === e || null === e)
  39400. throw new TypeError("Cannot convert first argument to object");
  39401. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  39402. var r = arguments[i];
  39403. if (void 0 !== r && null !== r) {
  39404. r = Object(r);
  39405. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  39406. var l = o[a]
  39407. , c = Object.getOwnPropertyDescriptor(r, l);
  39408. void 0 !== c && c.enumerable && (t[l] = r[l])
  39409. }
  39410. }
  39411. }
  39412. return t
  39413. }
  39414. }),
  39415. n.MOUSE = {
  39416. LEFT: 0,
  39417. MIDDLE: 1,
  39418. RIGHT: 2
  39419. },
  39420. n.CullFaceNone = 0,
  39421. n.CullFaceBack = 1,
  39422. n.CullFaceFront = 2,
  39423. n.CullFaceFrontBack = 3,
  39424. n.FrontFaceDirectionCW = 0,
  39425. n.FrontFaceDirectionCCW = 1,
  39426. n.BasicShadowMap = 0,
  39427. n.PCFShadowMap = 1,
  39428. n.PCFSoftShadowMap = 2,
  39429. n.FrontSide = 0,
  39430. n.BackSide = 1,
  39431. n.DoubleSide = 2,
  39432. n.FlatShading = 1,
  39433. n.SmoothShading = 2,
  39434. n.NoColors = 0,
  39435. n.FaceColors = 1,
  39436. n.VertexColors = 2,
  39437. n.NoBlending = 0,
  39438. n.NormalBlending = 1,
  39439. n.AdditiveBlending = 2,
  39440. n.SubtractiveBlending = 3,
  39441. n.MultiplyBlending = 4,
  39442. n.CustomBlending = 5,
  39443. n.AddEquation = 100,
  39444. n.SubtractEquation = 101,
  39445. n.ReverseSubtractEquation = 102,
  39446. n.MinEquation = 103,
  39447. n.MaxEquation = 104,
  39448. n.ZeroFactor = 200,
  39449. n.OneFactor = 201,
  39450. n.SrcColorFactor = 202,
  39451. n.OneMinusSrcColorFactor = 203,
  39452. n.SrcAlphaFactor = 204,
  39453. n.OneMinusSrcAlphaFactor = 205,
  39454. n.DstAlphaFactor = 206,
  39455. n.OneMinusDstAlphaFactor = 207,
  39456. n.DstColorFactor = 208,
  39457. n.OneMinusDstColorFactor = 209,
  39458. n.SrcAlphaSaturateFactor = 210,
  39459. n.NeverDepth = 0,
  39460. n.AlwaysDepth = 1,
  39461. n.LessDepth = 2,
  39462. n.LessEqualDepth = 3,
  39463. n.EqualDepth = 4,
  39464. n.GreaterEqualDepth = 5,
  39465. n.GreaterDepth = 6,
  39466. n.NotEqualDepth = 7,
  39467. n.MultiplyOperation = 0,
  39468. n.MixOperation = 1,
  39469. n.AddOperation = 2,
  39470. n.NoToneMapping = 0,
  39471. n.LinearToneMapping = 1,
  39472. n.ReinhardToneMapping = 2,
  39473. n.Uncharted2ToneMapping = 3,
  39474. n.CineonToneMapping = 4,
  39475. n.UVMapping = 300,
  39476. n.CubeReflectionMapping = 301,
  39477. n.CubeRefractionMapping = 302,
  39478. n.EquirectangularReflectionMapping = 303,
  39479. n.EquirectangularRefractionMapping = 304,
  39480. n.SphericalReflectionMapping = 305,
  39481. n.CubeUVReflectionMapping = 306,
  39482. n.CubeUVRefractionMapping = 307,
  39483. n.RepeatWrapping = 1e3,
  39484. n.ClampToEdgeWrapping = 1001,
  39485. n.MirroredRepeatWrapping = 1002,
  39486. n.NearestFilter = 1003,
  39487. n.NearestMipMapNearestFilter = 1004,
  39488. n.NearestMipMapLinearFilter = 1005,
  39489. n.LinearFilter = 1006,
  39490. n.LinearMipMapNearestFilter = 1007,
  39491. n.LinearMipMapLinearFilter = 1008,
  39492. n.UnsignedByteType = 1009,
  39493. n.ByteType = 1010,
  39494. n.ShortType = 1011,
  39495. n.UnsignedShortType = 1012,
  39496. n.IntType = 1013,
  39497. n.UnsignedIntType = 1014,
  39498. n.FloatType = 1015,
  39499. n.HalfFloatType = 1025,
  39500. n.UnsignedShort4444Type = 1016,
  39501. n.UnsignedShort5551Type = 1017,
  39502. n.UnsignedShort565Type = 1018,
  39503. n.AlphaFormat = 1019,
  39504. n.RGBFormat = 1020,
  39505. n.RGBAFormat = 1021,
  39506. n.LuminanceFormat = 1022,
  39507. n.LuminanceAlphaFormat = 1023,
  39508. n.RGBEFormat = n.RGBAFormat,
  39509. n.RGB_S3TC_DXT1_Format = 2001,
  39510. n.RGBA_S3TC_DXT1_Format = 2002,
  39511. n.RGBA_S3TC_DXT3_Format = 2003,
  39512. n.RGBA_S3TC_DXT5_Format = 2004,
  39513. n.RGB_PVRTC_4BPPV1_Format = 2100,
  39514. n.RGB_PVRTC_2BPPV1_Format = 2101,
  39515. n.RGBA_PVRTC_4BPPV1_Format = 2102,
  39516. n.RGBA_PVRTC_2BPPV1_Format = 2103,
  39517. n.RGB_ETC1_Format = 2151,
  39518. n.LoopOnce = 2200,
  39519. n.LoopRepeat = 2201,
  39520. n.LoopPingPong = 2202,
  39521. n.InterpolateDiscrete = 2300,
  39522. n.InterpolateLinear = 2301,
  39523. n.InterpolateSmooth = 2302,
  39524. n.ZeroCurvatureEnding = 2400,
  39525. n.ZeroSlopeEnding = 2401,
  39526. n.WrapAroundEnding = 2402,
  39527. n.TrianglesDrawMode = 0,
  39528. n.TriangleStripDrawMode = 1,
  39529. n.TriangleFanDrawMode = 2,
  39530. n.LinearEncoding = 3e3,
  39531. n.sRGBEncoding = 3001,
  39532. n.GammaEncoding = 3007,
  39533. n.RGBEEncoding = 3002,
  39534. n.LogLuvEncoding = 3003,
  39535. n.RGBM7Encoding = 3004,
  39536. n.RGBM16Encoding = 3005,
  39537. n.RGBDEncoding = 3006,
  39538. n.Color = function(e) {
  39539. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  39540. }
  39541. ,
  39542. n.Color.prototype = {
  39543. constructor: n.Color,
  39544. r: 1,
  39545. g: 1,
  39546. b: 1,
  39547. set: function(e) {
  39548. return e instanceof n.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  39549. this
  39550. },
  39551. setScalar: function(e) {
  39552. this.r = e,
  39553. this.g = e,
  39554. this.b = e
  39555. },
  39556. setHex: function(e) {
  39557. return e = Math.floor(e),
  39558. this.r = (e >> 16 & 255) / 255,
  39559. this.g = (e >> 8 & 255) / 255,
  39560. this.b = (255 & e) / 255,
  39561. this
  39562. },
  39563. setRGB: function(e, t, i) {
  39564. return this.r = e,
  39565. this.g = t,
  39566. this.b = i,
  39567. this
  39568. },
  39569. setHSL: function() {
  39570. function e(e, t, i) {
  39571. return i < 0 && (i += 1),
  39572. i > 1 && (i -= 1),
  39573. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  39574. }
  39575. return function(t, i, r) {
  39576. if (t = n.Math.euclideanModulo(t, 1),
  39577. i = n.Math.clamp(i, 0, 1),
  39578. r = n.Math.clamp(r, 0, 1),
  39579. 0 === i)
  39580. this.r = this.g = this.b = r;
  39581. else {
  39582. var o = r <= .5 ? r * (1 + i) : r + i - r * i
  39583. , a = 2 * r - o;
  39584. this.r = e(a, o, t + 1 / 3),
  39585. this.g = e(a, o, t),
  39586. this.b = e(a, o, t - 1 / 3)
  39587. }
  39588. return this
  39589. }
  39590. }(),
  39591. setStyle: function(e) {
  39592. function t(t) {
  39593. void 0 !== t && parseFloat(t) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.")
  39594. }
  39595. var i;
  39596. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)) {
  39597. var r, o = i[1], a = i[2];
  39598. switch (o) {
  39599. case "rgb":
  39600. case "rgba":
  39601. if (r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  39602. return this.r = Math.min(255, parseInt(r[1], 10)) / 255,
  39603. this.g = Math.min(255, parseInt(r[2], 10)) / 255,
  39604. this.b = Math.min(255, parseInt(r[3], 10)) / 255,
  39605. t(r[5]),
  39606. this;
  39607. if (r = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  39608. return this.r = Math.min(100, parseInt(r[1], 10)) / 100,
  39609. this.g = Math.min(100, parseInt(r[2], 10)) / 100,
  39610. this.b = Math.min(100, parseInt(r[3], 10)) / 100,
  39611. t(r[5]),
  39612. this;
  39613. break;
  39614. case "hsl":
  39615. case "hsla":
  39616. if (r = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)) {
  39617. var s = parseFloat(r[1]) / 360
  39618. , l = parseInt(r[2], 10) / 100
  39619. , c = parseInt(r[3], 10) / 100;
  39620. return t(r[5]),
  39621. this.setHSL(s, l, c)
  39622. }
  39623. }
  39624. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(e)) {
  39625. var h = i[1]
  39626. , u = h.length;
  39627. if (3 === u)
  39628. return this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255,
  39629. this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255,
  39630. this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255,
  39631. this;
  39632. if (6 === u)
  39633. return this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255,
  39634. this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255,
  39635. this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255,
  39636. this
  39637. }
  39638. if (e && e.length > 0) {
  39639. var h = n.ColorKeywords[e];
  39640. void 0 !== h ? this.setHex(h) : console.warn("THREE.Color: Unknown color " + e)
  39641. }
  39642. return this
  39643. },
  39644. clone: function() {
  39645. return new this.constructor(this.r,this.g,this.b)
  39646. },
  39647. copy: function(e) {
  39648. return this.r = e.r,
  39649. this.g = e.g,
  39650. this.b = e.b,
  39651. this
  39652. },
  39653. copyGammaToLinear: function(e, t) {
  39654. return void 0 === t && (t = 2),
  39655. this.r = Math.pow(e.r, t),
  39656. this.g = Math.pow(e.g, t),
  39657. this.b = Math.pow(e.b, t),
  39658. this
  39659. },
  39660. copyLinearToGamma: function(e, t) {
  39661. void 0 === t && (t = 2);
  39662. var i = t > 0 ? 1 / t : 1;
  39663. return this.r = Math.pow(e.r, i),
  39664. this.g = Math.pow(e.g, i),
  39665. this.b = Math.pow(e.b, i),
  39666. this
  39667. },
  39668. convertGammaToLinear: function() {
  39669. var e = this.r
  39670. , t = this.g
  39671. , i = this.b;
  39672. return this.r = e * e,
  39673. this.g = t * t,
  39674. this.b = i * i,
  39675. this
  39676. },
  39677. convertLinearToGamma: function() {
  39678. return this.r = Math.sqrt(this.r),
  39679. this.g = Math.sqrt(this.g),
  39680. this.b = Math.sqrt(this.b),
  39681. this
  39682. },
  39683. getHex: function() {
  39684. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  39685. },
  39686. getHexString: function() {
  39687. return ("000000" + this.getHex().toString(16)).slice(-6)
  39688. },
  39689. getHSL: function(e) {
  39690. var t, i, n = e || {
  39691. h: 0,
  39692. s: 0,
  39693. l: 0
  39694. }, 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;
  39695. if (l === s)
  39696. t = 0,
  39697. i = 0;
  39698. else {
  39699. var h = s - l;
  39700. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  39701. s) {
  39702. case r:
  39703. t = (o - a) / h + (o < a ? 6 : 0);
  39704. break;
  39705. case o:
  39706. t = (a - r) / h + 2;
  39707. break;
  39708. case a:
  39709. t = (r - o) / h + 4
  39710. }
  39711. t /= 6
  39712. }
  39713. return n.h = t,
  39714. n.s = i,
  39715. n.l = c,
  39716. n
  39717. },
  39718. getStyle: function() {
  39719. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  39720. },
  39721. offsetHSL: function(e, t, i) {
  39722. var n = this.getHSL();
  39723. return n.h += e,
  39724. n.s += t,
  39725. n.l += i,
  39726. this.setHSL(n.h, n.s, n.l),
  39727. this
  39728. },
  39729. add: function(e) {
  39730. return this.r += e.r,
  39731. this.g += e.g,
  39732. this.b += e.b,
  39733. this
  39734. },
  39735. addColors: function(e, t) {
  39736. return this.r = e.r + t.r,
  39737. this.g = e.g + t.g,
  39738. this.b = e.b + t.b,
  39739. this
  39740. },
  39741. addScalar: function(e) {
  39742. return this.r += e,
  39743. this.g += e,
  39744. this.b += e,
  39745. this
  39746. },
  39747. multiply: function(e) {
  39748. return this.r *= e.r,
  39749. this.g *= e.g,
  39750. this.b *= e.b,
  39751. this
  39752. },
  39753. multiplyScalar: function(e) {
  39754. return this.r *= e,
  39755. this.g *= e,
  39756. this.b *= e,
  39757. this
  39758. },
  39759. lerp: function(e, t) {
  39760. return this.r += (e.r - this.r) * t,
  39761. this.g += (e.g - this.g) * t,
  39762. this.b += (e.b - this.b) * t,
  39763. this
  39764. },
  39765. equals: function(e) {
  39766. return e.r === this.r && e.g === this.g && e.b === this.b
  39767. },
  39768. fromArray: function(e, t) {
  39769. return void 0 === t && (t = 0),
  39770. this.r = e[t],
  39771. this.g = e[t + 1],
  39772. this.b = e[t + 2],
  39773. this
  39774. },
  39775. toArray: function(e, t) {
  39776. return void 0 === e && (e = []),
  39777. void 0 === t && (t = 0),
  39778. e[t] = this.r,
  39779. e[t + 1] = this.g,
  39780. e[t + 2] = this.b,
  39781. e
  39782. }
  39783. },
  39784. n.ColorKeywords = {
  39785. aliceblue: 15792383,
  39786. antiquewhite: 16444375,
  39787. aqua: 65535,
  39788. aquamarine: 8388564,
  39789. azure: 15794175,
  39790. beige: 16119260,
  39791. bisque: 16770244,
  39792. black: 0,
  39793. blanchedalmond: 16772045,
  39794. blue: 255,
  39795. blueviolet: 9055202,
  39796. brown: 10824234,
  39797. burlywood: 14596231,
  39798. cadetblue: 6266528,
  39799. chartreuse: 8388352,
  39800. chocolate: 13789470,
  39801. coral: 16744272,
  39802. cornflowerblue: 6591981,
  39803. cornsilk: 16775388,
  39804. crimson: 14423100,
  39805. cyan: 65535,
  39806. darkblue: 139,
  39807. darkcyan: 35723,
  39808. darkgoldenrod: 12092939,
  39809. darkgray: 11119017,
  39810. darkgreen: 25600,
  39811. darkgrey: 11119017,
  39812. darkkhaki: 12433259,
  39813. darkmagenta: 9109643,
  39814. darkolivegreen: 5597999,
  39815. darkorange: 16747520,
  39816. darkorchid: 10040012,
  39817. darkred: 9109504,
  39818. darksalmon: 15308410,
  39819. darkseagreen: 9419919,
  39820. darkslateblue: 4734347,
  39821. darkslategray: 3100495,
  39822. darkslategrey: 3100495,
  39823. darkturquoise: 52945,
  39824. darkviolet: 9699539,
  39825. deeppink: 16716947,
  39826. deepskyblue: 49151,
  39827. dimgray: 6908265,
  39828. dimgrey: 6908265,
  39829. dodgerblue: 2003199,
  39830. firebrick: 11674146,
  39831. floralwhite: 16775920,
  39832. forestgreen: 2263842,
  39833. fuchsia: 16711935,
  39834. gainsboro: 14474460,
  39835. ghostwhite: 16316671,
  39836. gold: 16766720,
  39837. goldenrod: 14329120,
  39838. gray: 8421504,
  39839. green: 32768,
  39840. greenyellow: 11403055,
  39841. grey: 8421504,
  39842. honeydew: 15794160,
  39843. hotpink: 16738740,
  39844. indianred: 13458524,
  39845. indigo: 4915330,
  39846. ivory: 16777200,
  39847. khaki: 15787660,
  39848. lavender: 15132410,
  39849. lavenderblush: 16773365,
  39850. lawngreen: 8190976,
  39851. lemonchiffon: 16775885,
  39852. lightblue: 11393254,
  39853. lightcoral: 15761536,
  39854. lightcyan: 14745599,
  39855. lightgoldenrodyellow: 16448210,
  39856. lightgray: 13882323,
  39857. lightgreen: 9498256,
  39858. lightgrey: 13882323,
  39859. lightpink: 16758465,
  39860. lightsalmon: 16752762,
  39861. lightseagreen: 2142890,
  39862. lightskyblue: 8900346,
  39863. lightslategray: 7833753,
  39864. lightslategrey: 7833753,
  39865. lightsteelblue: 11584734,
  39866. lightyellow: 16777184,
  39867. lime: 65280,
  39868. limegreen: 3329330,
  39869. linen: 16445670,
  39870. magenta: 16711935,
  39871. maroon: 8388608,
  39872. mediumaquamarine: 6737322,
  39873. mediumblue: 205,
  39874. mediumorchid: 12211667,
  39875. mediumpurple: 9662683,
  39876. mediumseagreen: 3978097,
  39877. mediumslateblue: 8087790,
  39878. mediumspringgreen: 64154,
  39879. mediumturquoise: 4772300,
  39880. mediumvioletred: 13047173,
  39881. midnightblue: 1644912,
  39882. mintcream: 16121850,
  39883. mistyrose: 16770273,
  39884. moccasin: 16770229,
  39885. navajowhite: 16768685,
  39886. navy: 128,
  39887. oldlace: 16643558,
  39888. olive: 8421376,
  39889. olivedrab: 7048739,
  39890. orange: 16753920,
  39891. orangered: 16729344,
  39892. orchid: 14315734,
  39893. palegoldenrod: 15657130,
  39894. palegreen: 10025880,
  39895. paleturquoise: 11529966,
  39896. palevioletred: 14381203,
  39897. papayawhip: 16773077,
  39898. peachpuff: 16767673,
  39899. peru: 13468991,
  39900. pink: 16761035,
  39901. plum: 14524637,
  39902. powderblue: 11591910,
  39903. purple: 8388736,
  39904. red: 16711680,
  39905. rosybrown: 12357519,
  39906. royalblue: 4286945,
  39907. saddlebrown: 9127187,
  39908. salmon: 16416882,
  39909. sandybrown: 16032864,
  39910. seagreen: 3050327,
  39911. seashell: 16774638,
  39912. sienna: 10506797,
  39913. silver: 12632256,
  39914. skyblue: 8900331,
  39915. slateblue: 6970061,
  39916. slategray: 7372944,
  39917. slategrey: 7372944,
  39918. snow: 16775930,
  39919. springgreen: 65407,
  39920. steelblue: 4620980,
  39921. tan: 13808780,
  39922. teal: 32896,
  39923. thistle: 14204888,
  39924. tomato: 16737095,
  39925. turquoise: 4251856,
  39926. violet: 15631086,
  39927. wheat: 16113331,
  39928. white: 16777215,
  39929. whitesmoke: 16119285,
  39930. yellow: 16776960,
  39931. yellowgreen: 10145074
  39932. },
  39933. n.Quaternion = function(e, t, i, n) {
  39934. this._x = e || 0,
  39935. this._y = t || 0,
  39936. this._z = i || 0,
  39937. this._w = void 0 !== n ? n : 1
  39938. }
  39939. ,
  39940. n.Quaternion.prototype = {
  39941. constructor: n.Quaternion,
  39942. get x() {
  39943. return this._x
  39944. },
  39945. set x(e) {
  39946. this._x = e,
  39947. this.onChangeCallback()
  39948. },
  39949. get y() {
  39950. return this._y
  39951. },
  39952. set y(e) {
  39953. this._y = e,
  39954. this.onChangeCallback()
  39955. },
  39956. get z() {
  39957. return this._z
  39958. },
  39959. set z(e) {
  39960. this._z = e,
  39961. this.onChangeCallback()
  39962. },
  39963. get w() {
  39964. return this._w
  39965. },
  39966. set w(e) {
  39967. this._w = e,
  39968. this.onChangeCallback()
  39969. },
  39970. set: function(e, t, i, n) {
  39971. return this._x = e,
  39972. this._y = t,
  39973. this._z = i,
  39974. this._w = n,
  39975. this.onChangeCallback(),
  39976. this
  39977. },
  39978. clone: function() {
  39979. return new this.constructor(this._x,this._y,this._z,this._w)
  39980. },
  39981. copy: function(e) {
  39982. return this._x = e.x,
  39983. this._y = e.y,
  39984. this._z = e.z,
  39985. this._w = e.w,
  39986. this.onChangeCallback(),
  39987. this
  39988. },
  39989. setFromEuler: function(e, t) {
  39990. if (e instanceof n.Euler == !1)
  39991. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39992. var i = Math.cos(e._x / 2)
  39993. , r = Math.cos(e._y / 2)
  39994. , o = Math.cos(e._z / 2)
  39995. , a = Math.sin(e._x / 2)
  39996. , s = Math.sin(e._y / 2)
  39997. , l = Math.sin(e._z / 2)
  39998. , c = e.order;
  39999. return "XYZ" === c ? (this._x = a * r * o + i * s * l,
  40000. this._y = i * s * o - a * r * l,
  40001. this._z = i * r * l + a * s * o,
  40002. this._w = i * r * o - a * s * l) : "YXZ" === c ? (this._x = a * r * o + i * s * l,
  40003. this._y = i * s * o - a * r * l,
  40004. this._z = i * r * l - a * s * o,
  40005. this._w = i * r * o + a * s * l) : "ZXY" === c ? (this._x = a * r * o - i * s * l,
  40006. this._y = i * s * o + a * r * l,
  40007. this._z = i * r * l + a * s * o,
  40008. this._w = i * r * o - a * s * l) : "ZYX" === c ? (this._x = a * r * o - i * s * l,
  40009. this._y = i * s * o + a * r * l,
  40010. this._z = i * r * l - a * s * o,
  40011. this._w = i * r * o + a * s * l) : "YZX" === c ? (this._x = a * r * o + i * s * l,
  40012. this._y = i * s * o + a * r * l,
  40013. this._z = i * r * l - a * s * o,
  40014. this._w = i * r * o - a * s * l) : "XZY" === c && (this._x = a * r * o - i * s * l,
  40015. this._y = i * s * o - a * r * l,
  40016. this._z = i * r * l + a * s * o,
  40017. this._w = i * r * o + a * s * l),
  40018. t !== !1 && this.onChangeCallback(),
  40019. this
  40020. },
  40021. setFromAxisAngle: function(e, t) {
  40022. var i = t / 2
  40023. , n = Math.sin(i);
  40024. return this._x = e.x * n,
  40025. this._y = e.y * n,
  40026. this._z = e.z * n,
  40027. this._w = Math.cos(i),
  40028. this.onChangeCallback(),
  40029. this
  40030. },
  40031. setFromRotationMatrix: function(e) {
  40032. 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;
  40033. return d > 0 ? (t = .5 / Math.sqrt(d + 1),
  40034. this._w = .25 / t,
  40035. this._x = (h - l) * t,
  40036. this._y = (o - c) * t,
  40037. this._z = (a - r) * t) : n > s && n > u ? (t = 2 * Math.sqrt(1 + n - s - u),
  40038. this._w = (h - l) / t,
  40039. this._x = .25 * t,
  40040. this._y = (r + a) / t,
  40041. this._z = (o + c) / t) : s > u ? (t = 2 * Math.sqrt(1 + s - n - u),
  40042. this._w = (o - c) / t,
  40043. this._x = (r + a) / t,
  40044. this._y = .25 * t,
  40045. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  40046. this._w = (a - r) / t,
  40047. this._x = (o + c) / t,
  40048. this._y = (l + h) / t,
  40049. this._z = .25 * t),
  40050. this.onChangeCallback(),
  40051. this
  40052. },
  40053. setFromUnitVectors: function() {
  40054. var e, t, i = 1e-6;
  40055. return function(r, o) {
  40056. return void 0 === e && (e = new n.Vector3),
  40057. t = r.dot(o) + 1,
  40058. t < i ? (t = 0,
  40059. Math.abs(r.x) > Math.abs(r.z) ? e.set(-r.y, r.x, 0) : e.set(0, -r.z, r.y)) : e.crossVectors(r, o),
  40060. this._x = e.x,
  40061. this._y = e.y,
  40062. this._z = e.z,
  40063. this._w = t,
  40064. this.normalize(),
  40065. this
  40066. }
  40067. }(),
  40068. inverse: function() {
  40069. return this.conjugate().normalize(),
  40070. this
  40071. },
  40072. conjugate: function() {
  40073. return this._x *= -1,
  40074. this._y *= -1,
  40075. this._z *= -1,
  40076. this.onChangeCallback(),
  40077. this
  40078. },
  40079. dot: function(e) {
  40080. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  40081. },
  40082. lengthSq: function() {
  40083. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  40084. },
  40085. length: function() {
  40086. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  40087. },
  40088. normalize: function() {
  40089. var e = this.length();
  40090. return 0 === e ? (this._x = 0,
  40091. this._y = 0,
  40092. this._z = 0,
  40093. this._w = 1) : (e = 1 / e,
  40094. this._x = this._x * e,
  40095. this._y = this._y * e,
  40096. this._z = this._z * e,
  40097. this._w = this._w * e),
  40098. this.onChangeCallback(),
  40099. this
  40100. },
  40101. multiply: function(e, t) {
  40102. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  40103. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  40104. },
  40105. multiplyQuaternions: function(e, t) {
  40106. var i = e._x
  40107. , n = e._y
  40108. , r = e._z
  40109. , o = e._w
  40110. , a = t._x
  40111. , s = t._y
  40112. , l = t._z
  40113. , c = t._w;
  40114. return this._x = i * c + o * a + n * l - r * s,
  40115. this._y = n * c + o * s + r * a - i * l,
  40116. this._z = r * c + o * l + i * s - n * a,
  40117. this._w = o * c - i * a - n * s - r * l,
  40118. this.onChangeCallback(),
  40119. this
  40120. },
  40121. slerp: function(e, t) {
  40122. if (0 === t)
  40123. return this;
  40124. if (1 === t)
  40125. return this.copy(e);
  40126. var i = this._x
  40127. , n = this._y
  40128. , r = this._z
  40129. , o = this._w
  40130. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  40131. if (a < 0 ? (this._w = -e._w,
  40132. this._x = -e._x,
  40133. this._y = -e._y,
  40134. this._z = -e._z,
  40135. a = -a) : this.copy(e),
  40136. a >= 1)
  40137. return this._w = o,
  40138. this._x = i,
  40139. this._y = n,
  40140. this._z = r,
  40141. this;
  40142. var s = Math.sqrt(1 - a * a);
  40143. if (Math.abs(s) < .001)
  40144. return this._w = .5 * (o + this._w),
  40145. this._x = .5 * (i + this._x),
  40146. this._y = .5 * (n + this._y),
  40147. this._z = .5 * (r + this._z),
  40148. this;
  40149. var l = Math.atan2(s, a)
  40150. , c = Math.sin((1 - t) * l) / s
  40151. , h = Math.sin(t * l) / s;
  40152. return this._w = o * c + this._w * h,
  40153. this._x = i * c + this._x * h,
  40154. this._y = n * c + this._y * h,
  40155. this._z = r * c + this._z * h,
  40156. this.onChangeCallback(),
  40157. this
  40158. },
  40159. equals: function(e) {
  40160. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  40161. },
  40162. fromArray: function(e, t) {
  40163. return void 0 === t && (t = 0),
  40164. this._x = e[t],
  40165. this._y = e[t + 1],
  40166. this._z = e[t + 2],
  40167. this._w = e[t + 3],
  40168. this.onChangeCallback(),
  40169. this
  40170. },
  40171. toArray: function(e, t) {
  40172. return void 0 === e && (e = []),
  40173. void 0 === t && (t = 0),
  40174. e[t] = this._x,
  40175. e[t + 1] = this._y,
  40176. e[t + 2] = this._z,
  40177. e[t + 3] = this._w,
  40178. e
  40179. },
  40180. onChange: function(e) {
  40181. return this.onChangeCallback = e,
  40182. this
  40183. },
  40184. onChangeCallback: function() {}
  40185. },
  40186. Object.assign(n.Quaternion, {
  40187. slerp: function(e, t, i, n) {
  40188. return i.copy(e).slerp(t, n)
  40189. },
  40190. slerpFlat: function(e, t, i, n, r, o, a) {
  40191. var s = i[n + 0]
  40192. , l = i[n + 1]
  40193. , c = i[n + 2]
  40194. , h = i[n + 3]
  40195. , u = r[o + 0]
  40196. , d = r[o + 1]
  40197. , p = r[o + 2]
  40198. , f = r[o + 3];
  40199. if (h !== f || s !== u || l !== d || c !== p) {
  40200. var g = 1 - a
  40201. , m = s * u + l * d + c * p + h * f
  40202. , v = m >= 0 ? 1 : -1
  40203. , A = 1 - m * m;
  40204. if (A > Number.EPSILON) {
  40205. var y = Math.sqrt(A)
  40206. , C = Math.atan2(y, m * v);
  40207. g = Math.sin(g * C) / y,
  40208. a = Math.sin(a * C) / y
  40209. }
  40210. var I = a * v;
  40211. if (s = s * g + u * I,
  40212. l = l * g + d * I,
  40213. c = c * g + p * I,
  40214. h = h * g + f * I,
  40215. g === 1 - a) {
  40216. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  40217. s *= E,
  40218. l *= E,
  40219. c *= E,
  40220. h *= E
  40221. }
  40222. }
  40223. e[t] = s,
  40224. e[t + 1] = l,
  40225. e[t + 2] = c,
  40226. e[t + 3] = h
  40227. }
  40228. }),
  40229. n.Vector2 = function(e, t) {
  40230. this.x = e || 0,
  40231. this.y = t || 0
  40232. }
  40233. ,
  40234. n.Vector2.prototype = {
  40235. constructor: n.Vector2,
  40236. get width() {
  40237. return this.x
  40238. },
  40239. set width(e) {
  40240. this.x = e
  40241. },
  40242. get height() {
  40243. return this.y
  40244. },
  40245. set height(e) {
  40246. this.y = e
  40247. },
  40248. set: function(e, t) {
  40249. return this.x = e,
  40250. this.y = t,
  40251. this
  40252. },
  40253. setScalar: function(e) {
  40254. return this.x = e,
  40255. this.y = e,
  40256. this
  40257. },
  40258. setX: function(e) {
  40259. return this.x = e,
  40260. this
  40261. },
  40262. setY: function(e) {
  40263. return this.y = e,
  40264. this
  40265. },
  40266. setComponent: function(e, t) {
  40267. switch (e) {
  40268. case 0:
  40269. this.x = t;
  40270. break;
  40271. case 1:
  40272. this.y = t;
  40273. break;
  40274. default:
  40275. throw new Error("index is out of range: " + e)
  40276. }
  40277. },
  40278. getComponent: function(e) {
  40279. switch (e) {
  40280. case 0:
  40281. return this.x;
  40282. case 1:
  40283. return this.y;
  40284. default:
  40285. throw new Error("index is out of range: " + e)
  40286. }
  40287. },
  40288. clone: function() {
  40289. return new this.constructor(this.x,this.y)
  40290. },
  40291. copy: function(e) {
  40292. return this.x = e.x,
  40293. this.y = e.y,
  40294. this
  40295. },
  40296. add: function(e, t) {
  40297. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  40298. this.addVectors(e, t)) : (this.x += e.x,
  40299. this.y += e.y,
  40300. this)
  40301. },
  40302. addScalar: function(e) {
  40303. return this.x += e,
  40304. this.y += e,
  40305. this
  40306. },
  40307. addVectors: function(e, t) {
  40308. return this.x = e.x + t.x,
  40309. this.y = e.y + t.y,
  40310. this
  40311. },
  40312. addScaledVector: function(e, t) {
  40313. return this.x += e.x * t,
  40314. this.y += e.y * t,
  40315. this
  40316. },
  40317. sub: function(e, t) {
  40318. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  40319. this.subVectors(e, t)) : (this.x -= e.x,
  40320. this.y -= e.y,
  40321. this)
  40322. },
  40323. subScalar: function(e) {
  40324. return this.x -= e,
  40325. this.y -= e,
  40326. this
  40327. },
  40328. subVectors: function(e, t) {
  40329. return this.x = e.x - t.x,
  40330. this.y = e.y - t.y,
  40331. this
  40332. },
  40333. multiply: function(e) {
  40334. return this.x *= e.x,
  40335. this.y *= e.y,
  40336. this
  40337. },
  40338. multiplyScalar: function(e) {
  40339. return isFinite(e) ? (this.x *= e,
  40340. this.y *= e) : (this.x = 0,
  40341. this.y = 0),
  40342. this
  40343. },
  40344. divide: function(e) {
  40345. return this.x /= e.x,
  40346. this.y /= e.y,
  40347. this
  40348. },
  40349. divideScalar: function(e) {
  40350. return this.multiplyScalar(1 / e)
  40351. },
  40352. min: function(e) {
  40353. return this.x = Math.min(this.x, e.x),
  40354. this.y = Math.min(this.y, e.y),
  40355. this
  40356. },
  40357. max: function(e) {
  40358. return this.x = Math.max(this.x, e.x),
  40359. this.y = Math.max(this.y, e.y),
  40360. this
  40361. },
  40362. clamp: function(e, t) {
  40363. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  40364. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  40365. this
  40366. },
  40367. clampScalar: function() {
  40368. var e, t;
  40369. return function(i, r) {
  40370. return void 0 === e && (e = new n.Vector2,
  40371. t = new n.Vector2),
  40372. e.set(i, i),
  40373. t.set(r, r),
  40374. this.clamp(e, t)
  40375. }
  40376. }(),
  40377. clampLength: function(e, t) {
  40378. var i = this.length();
  40379. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  40380. this
  40381. },
  40382. floor: function() {
  40383. return this.x = Math.floor(this.x),
  40384. this.y = Math.floor(this.y),
  40385. this
  40386. },
  40387. ceil: function() {
  40388. return this.x = Math.ceil(this.x),
  40389. this.y = Math.ceil(this.y),
  40390. this
  40391. },
  40392. round: function() {
  40393. return this.x = Math.round(this.x),
  40394. this.y = Math.round(this.y),
  40395. this
  40396. },
  40397. roundToZero: function() {
  40398. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  40399. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  40400. this
  40401. },
  40402. negate: function() {
  40403. return this.x = -this.x,
  40404. this.y = -this.y,
  40405. this
  40406. },
  40407. dot: function(e) {
  40408. return this.x * e.x + this.y * e.y
  40409. },
  40410. lengthSq: function() {
  40411. return this.x * this.x + this.y * this.y
  40412. },
  40413. length: function() {
  40414. return Math.sqrt(this.x * this.x + this.y * this.y)
  40415. },
  40416. lengthManhattan: function() {
  40417. return Math.abs(this.x) + Math.abs(this.y)
  40418. },
  40419. normalize: function() {
  40420. return this.divideScalar(this.length())
  40421. },
  40422. angle: function() {
  40423. var e = Math.atan2(this.y, this.x);
  40424. return e < 0 && (e += 2 * Math.PI),
  40425. e
  40426. },
  40427. distanceTo: function(e) {
  40428. return Math.sqrt(this.distanceToSquared(e))
  40429. },
  40430. distanceToSquared: function(e) {
  40431. var t = this.x - e.x
  40432. , i = this.y - e.y;
  40433. return t * t + i * i
  40434. },
  40435. setLength: function(e) {
  40436. return this.multiplyScalar(e / this.length())
  40437. },
  40438. lerp: function(e, t) {
  40439. return this.x += (e.x - this.x) * t,
  40440. this.y += (e.y - this.y) * t,
  40441. this
  40442. },
  40443. lerpVectors: function(e, t, i) {
  40444. return this.subVectors(t, e).multiplyScalar(i).add(e),
  40445. this
  40446. },
  40447. equals: function(e) {
  40448. return e.x === this.x && e.y === this.y
  40449. },
  40450. fromArray: function(e, t) {
  40451. return void 0 === t && (t = 0),
  40452. this.x = e[t],
  40453. this.y = e[t + 1],
  40454. this
  40455. },
  40456. toArray: function(e, t) {
  40457. return void 0 === e && (e = []),
  40458. void 0 === t && (t = 0),
  40459. e[t] = this.x,
  40460. e[t + 1] = this.y,
  40461. e
  40462. },
  40463. fromAttribute: function(e, t, i) {
  40464. return void 0 === i && (i = 0),
  40465. t = t * e.itemSize + i,
  40466. this.x = e.array[t],
  40467. this.y = e.array[t + 1],
  40468. this
  40469. },
  40470. rotateAround: function(e, t) {
  40471. var i = Math.cos(t)
  40472. , n = Math.sin(t)
  40473. , r = this.x - e.x
  40474. , o = this.y - e.y;
  40475. return this.x = r * i - o * n + e.x,
  40476. this.y = r * n + o * i + e.y,
  40477. this
  40478. }
  40479. },
  40480. n.Vector3 = function(e, t, i) {
  40481. this.x = e || 0,
  40482. this.y = t || 0,
  40483. this.z = i || 0
  40484. }
  40485. ,
  40486. n.Vector3.prototype = {
  40487. constructor: n.Vector3,
  40488. set: function(e, t, i) {
  40489. return this.x = e,
  40490. this.y = t,
  40491. this.z = i,
  40492. this
  40493. },
  40494. setScalar: function(e) {
  40495. return this.x = e,
  40496. this.y = e,
  40497. this.z = e,
  40498. this
  40499. },
  40500. setX: function(e) {
  40501. return this.x = e,
  40502. this
  40503. },
  40504. setY: function(e) {
  40505. return this.y = e,
  40506. this
  40507. },
  40508. setZ: function(e) {
  40509. return this.z = e,
  40510. this
  40511. },
  40512. setComponent: function(e, t) {
  40513. switch (e) {
  40514. case 0:
  40515. this.x = t;
  40516. break;
  40517. case 1:
  40518. this.y = t;
  40519. break;
  40520. case 2:
  40521. this.z = t;
  40522. break;
  40523. default:
  40524. throw new Error("index is out of range: " + e)
  40525. }
  40526. },
  40527. getComponent: function(e) {
  40528. switch (e) {
  40529. case 0:
  40530. return this.x;
  40531. case 1:
  40532. return this.y;
  40533. case 2:
  40534. return this.z;
  40535. default:
  40536. throw new Error("index is out of range: " + e)
  40537. }
  40538. },
  40539. clone: function() {
  40540. return new this.constructor(this.x,this.y,this.z)
  40541. },
  40542. copy: function(e) {
  40543. return this.x = e.x,
  40544. this.y = e.y,
  40545. this.z = e.z,
  40546. this
  40547. },
  40548. add: function(e, t) {
  40549. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  40550. this.addVectors(e, t)) : (this.x += e.x,
  40551. this.y += e.y,
  40552. this.z += e.z,
  40553. this)
  40554. },
  40555. addScalar: function(e) {
  40556. return this.x += e,
  40557. this.y += e,
  40558. this.z += e,
  40559. this
  40560. },
  40561. addVectors: function(e, t) {
  40562. return this.x = e.x + t.x,
  40563. this.y = e.y + t.y,
  40564. this.z = e.z + t.z,
  40565. this
  40566. },
  40567. addScaledVector: function(e, t) {
  40568. return this.x += e.x * t,
  40569. this.y += e.y * t,
  40570. this.z += e.z * t,
  40571. this
  40572. },
  40573. sub: function(e, t) {
  40574. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  40575. this.subVectors(e, t)) : (this.x -= e.x,
  40576. this.y -= e.y,
  40577. this.z -= e.z,
  40578. this)
  40579. },
  40580. subScalar: function(e) {
  40581. return this.x -= e,
  40582. this.y -= e,
  40583. this.z -= e,
  40584. this
  40585. },
  40586. subVectors: function(e, t) {
  40587. return this.x = e.x - t.x,
  40588. this.y = e.y - t.y,
  40589. this.z = e.z - t.z,
  40590. this
  40591. },
  40592. multiply: function(e, t) {
  40593. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  40594. this.multiplyVectors(e, t)) : (this.x *= e.x,
  40595. this.y *= e.y,
  40596. this.z *= e.z,
  40597. this)
  40598. },
  40599. multiplyScalar: function(e) {
  40600. return isFinite(e) ? (this.x *= e,
  40601. this.y *= e,
  40602. this.z *= e) : (this.x = 0,
  40603. this.y = 0,
  40604. this.z = 0),
  40605. this
  40606. },
  40607. multiplyVectors: function(e, t) {
  40608. return this.x = e.x * t.x,
  40609. this.y = e.y * t.y,
  40610. this.z = e.z * t.z,
  40611. this
  40612. },
  40613. applyEuler: function() {
  40614. var e;
  40615. return function(t) {
  40616. return t instanceof n.Euler == !1 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  40617. void 0 === e && (e = new n.Quaternion),
  40618. this.applyQuaternion(e.setFromEuler(t)),
  40619. this
  40620. }
  40621. }(),
  40622. applyAxisAngle: function() {
  40623. var e;
  40624. return function(t, i) {
  40625. return void 0 === e && (e = new n.Quaternion),
  40626. this.applyQuaternion(e.setFromAxisAngle(t, i)),
  40627. this
  40628. }
  40629. }(),
  40630. applyMatrix3: function(e) {
  40631. var t = this.x
  40632. , i = this.y
  40633. , n = this.z
  40634. , r = e.elements;
  40635. return this.x = r[0] * t + r[3] * i + r[6] * n,
  40636. this.y = r[1] * t + r[4] * i + r[7] * n,
  40637. this.z = r[2] * t + r[5] * i + r[8] * n,
  40638. this
  40639. },
  40640. applyMatrix4: function(e) {
  40641. var t = this.x
  40642. , i = this.y
  40643. , n = this.z
  40644. , r = e.elements;
  40645. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  40646. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  40647. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  40648. this
  40649. },
  40650. applyProjection: function(e) {
  40651. var t = this.x
  40652. , i = this.y
  40653. , n = this.z
  40654. , r = e.elements
  40655. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  40656. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  40657. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  40658. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  40659. this
  40660. },
  40661. applyQuaternion: function(e) {
  40662. var t = this.x
  40663. , i = this.y
  40664. , n = this.z
  40665. , r = e.x
  40666. , o = e.y
  40667. , a = e.z
  40668. , s = e.w
  40669. , l = s * t + o * n - a * i
  40670. , c = s * i + a * t - r * n
  40671. , h = s * n + r * i - o * t
  40672. , u = -r * t - o * i - a * n;
  40673. return this.x = l * s + u * -r + c * -a - h * -o,
  40674. this.y = c * s + u * -o + h * -r - l * -a,
  40675. this.z = h * s + u * -a + l * -o - c * -r,
  40676. this
  40677. },
  40678. project: function() {
  40679. var e;
  40680. return function(t) {
  40681. return void 0 === e && (e = new n.Matrix4),
  40682. e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)),
  40683. this.applyProjection(e)
  40684. }
  40685. }(),
  40686. unproject: function() {
  40687. var e;
  40688. return function(t) {
  40689. return void 0 === e && (e = new n.Matrix4),
  40690. e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)),
  40691. this.applyProjection(e)
  40692. }
  40693. }(),
  40694. transformDirection: function(e) {
  40695. var t = this.x
  40696. , i = this.y
  40697. , n = this.z
  40698. , r = e.elements;
  40699. return this.x = r[0] * t + r[4] * i + r[8] * n,
  40700. this.y = r[1] * t + r[5] * i + r[9] * n,
  40701. this.z = r[2] * t + r[6] * i + r[10] * n,
  40702. this.normalize(),
  40703. this
  40704. },
  40705. divide: function(e) {
  40706. return this.x /= e.x,
  40707. this.y /= e.y,
  40708. this.z /= e.z,
  40709. this
  40710. },
  40711. divideScalar: function(e) {
  40712. return this.multiplyScalar(1 / e)
  40713. },
  40714. min: function(e) {
  40715. return this.x = Math.min(this.x, e.x),
  40716. this.y = Math.min(this.y, e.y),
  40717. this.z = Math.min(this.z, e.z),
  40718. this
  40719. },
  40720. max: function(e) {
  40721. return this.x = Math.max(this.x, e.x),
  40722. this.y = Math.max(this.y, e.y),
  40723. this.z = Math.max(this.z, e.z),
  40724. this
  40725. },
  40726. clamp: function(e, t) {
  40727. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  40728. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  40729. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  40730. this
  40731. },
  40732. clampScalar: function() {
  40733. var e, t;
  40734. return function(i, r) {
  40735. return void 0 === e && (e = new n.Vector3,
  40736. t = new n.Vector3),
  40737. e.set(i, i, i),
  40738. t.set(r, r, r),
  40739. this.clamp(e, t)
  40740. }
  40741. }(),
  40742. clampLength: function(e, t) {
  40743. var i = this.length();
  40744. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  40745. this
  40746. },
  40747. floor: function() {
  40748. return this.x = Math.floor(this.x),
  40749. this.y = Math.floor(this.y),
  40750. this.z = Math.floor(this.z),
  40751. this
  40752. },
  40753. ceil: function() {
  40754. return this.x = Math.ceil(this.x),
  40755. this.y = Math.ceil(this.y),
  40756. this.z = Math.ceil(this.z),
  40757. this
  40758. },
  40759. round: function() {
  40760. return this.x = Math.round(this.x),
  40761. this.y = Math.round(this.y),
  40762. this.z = Math.round(this.z),
  40763. this
  40764. },
  40765. roundToZero: function() {
  40766. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  40767. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  40768. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  40769. this
  40770. },
  40771. negate: function() {
  40772. return this.x = -this.x,
  40773. this.y = -this.y,
  40774. this.z = -this.z,
  40775. this
  40776. },
  40777. dot: function(e) {
  40778. return this.x * e.x + this.y * e.y + this.z * e.z
  40779. },
  40780. lengthSq: function() {
  40781. return this.x * this.x + this.y * this.y + this.z * this.z
  40782. },
  40783. length: function() {
  40784. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  40785. },
  40786. lengthManhattan: function() {
  40787. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  40788. },
  40789. normalize: function() {
  40790. return this.divideScalar(this.length())
  40791. },
  40792. setLength: function(e) {
  40793. return this.multiplyScalar(e / this.length())
  40794. },
  40795. lerp: function(e, t) {
  40796. return this.x += (e.x - this.x) * t,
  40797. this.y += (e.y - this.y) * t,
  40798. this.z += (e.z - this.z) * t,
  40799. this
  40800. },
  40801. lerpVectors: function(e, t, i) {
  40802. return this.subVectors(t, e).multiplyScalar(i).add(e),
  40803. this
  40804. },
  40805. cross: function(e, t) {
  40806. if (void 0 !== t)
  40807. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  40808. this.crossVectors(e, t);
  40809. var i = this.x
  40810. , n = this.y
  40811. , r = this.z;
  40812. return this.x = n * e.z - r * e.y,
  40813. this.y = r * e.x - i * e.z,
  40814. this.z = i * e.y - n * e.x,
  40815. this
  40816. },
  40817. crossVectors: function(e, t) {
  40818. var i = e.x
  40819. , n = e.y
  40820. , r = e.z
  40821. , o = t.x
  40822. , a = t.y
  40823. , s = t.z;
  40824. return this.x = n * s - r * a,
  40825. this.y = r * o - i * s,
  40826. this.z = i * a - n * o,
  40827. this
  40828. },
  40829. projectOnVector: function() {
  40830. var e, t;
  40831. return function(i) {
  40832. return void 0 === e && (e = new n.Vector3),
  40833. e.copy(i).normalize(),
  40834. t = this.dot(e),
  40835. this.copy(e).multiplyScalar(t)
  40836. }
  40837. }(),
  40838. projectOnPlane: function() {
  40839. var e;
  40840. return function(t) {
  40841. return void 0 === e && (e = new n.Vector3),
  40842. e.copy(this).projectOnVector(t),
  40843. this.sub(e)
  40844. }
  40845. }(),
  40846. reflect: function() {
  40847. var e;
  40848. return function(t) {
  40849. return void 0 === e && (e = new n.Vector3),
  40850. this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  40851. }
  40852. }(),
  40853. angleTo: function(e) {
  40854. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  40855. return Math.acos(n.Math.clamp(t, -1, 1))
  40856. },
  40857. distanceTo: function(e) {
  40858. return Math.sqrt(this.distanceToSquared(e))
  40859. },
  40860. distanceToSquared: function(e) {
  40861. var t = this.x - e.x
  40862. , i = this.y - e.y
  40863. , n = this.z - e.z;
  40864. return t * t + i * i + n * n
  40865. },
  40866. setFromSpherical: function(e) {
  40867. var t = Math.sin(e.phi) * e.radius;
  40868. return this.x = t * Math.sin(e.theta),
  40869. this.y = Math.cos(e.phi) * e.radius,
  40870. this.z = t * Math.cos(e.theta),
  40871. this
  40872. },
  40873. setFromMatrixPosition: function(e) {
  40874. return this.setFromMatrixColumn(e, 3)
  40875. },
  40876. setFromMatrixScale: function(e) {
  40877. var t = this.setFromMatrixColumn(e, 0).length()
  40878. , i = this.setFromMatrixColumn(e, 1).length()
  40879. , n = this.setFromMatrixColumn(e, 2).length();
  40880. return this.x = t,
  40881. this.y = i,
  40882. this.z = n,
  40883. this
  40884. },
  40885. setFromMatrixColumn: function(e, t) {
  40886. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  40887. e = arguments[1],
  40888. t = arguments[0]),
  40889. this.fromArray(e.elements, 4 * t)
  40890. },
  40891. equals: function(e) {
  40892. return e.x === this.x && e.y === this.y && e.z === this.z
  40893. },
  40894. fromArray: function(e, t) {
  40895. return void 0 === t && (t = 0),
  40896. this.x = e[t],
  40897. this.y = e[t + 1],
  40898. this.z = e[t + 2],
  40899. this
  40900. },
  40901. toArray: function(e, t) {
  40902. return void 0 === e && (e = []),
  40903. void 0 === t && (t = 0),
  40904. e[t] = this.x,
  40905. e[t + 1] = this.y,
  40906. e[t + 2] = this.z,
  40907. e
  40908. },
  40909. fromAttribute: function(e, t, i) {
  40910. return void 0 === i && (i = 0),
  40911. t = t * e.itemSize + i,
  40912. this.x = e.array[t],
  40913. this.y = e.array[t + 1],
  40914. this.z = e.array[t + 2],
  40915. this
  40916. }
  40917. },
  40918. n.Vector4 = function(e, t, i, n) {
  40919. this.x = e || 0,
  40920. this.y = t || 0,
  40921. this.z = i || 0,
  40922. this.w = void 0 !== n ? n : 1
  40923. }
  40924. ,
  40925. n.Vector4.prototype = {
  40926. constructor: n.Vector4,
  40927. set: function(e, t, i, n) {
  40928. return this.x = e,
  40929. this.y = t,
  40930. this.z = i,
  40931. this.w = n,
  40932. this
  40933. },
  40934. setScalar: function(e) {
  40935. return this.x = e,
  40936. this.y = e,
  40937. this.z = e,
  40938. this.w = e,
  40939. this
  40940. },
  40941. setX: function(e) {
  40942. return this.x = e,
  40943. this
  40944. },
  40945. setY: function(e) {
  40946. return this.y = e,
  40947. this
  40948. },
  40949. setZ: function(e) {
  40950. return this.z = e,
  40951. this
  40952. },
  40953. setW: function(e) {
  40954. return this.w = e,
  40955. this
  40956. },
  40957. setComponent: function(e, t) {
  40958. switch (e) {
  40959. case 0:
  40960. this.x = t;
  40961. break;
  40962. case 1:
  40963. this.y = t;
  40964. break;
  40965. case 2:
  40966. this.z = t;
  40967. break;
  40968. case 3:
  40969. this.w = t;
  40970. break;
  40971. default:
  40972. throw new Error("index is out of range: " + e)
  40973. }
  40974. },
  40975. getComponent: function(e) {
  40976. switch (e) {
  40977. case 0:
  40978. return this.x;
  40979. case 1:
  40980. return this.y;
  40981. case 2:
  40982. return this.z;
  40983. case 3:
  40984. return this.w;
  40985. default:
  40986. throw new Error("index is out of range: " + e)
  40987. }
  40988. },
  40989. clone: function() {
  40990. return new this.constructor(this.x,this.y,this.z,this.w)
  40991. },
  40992. copy: function(e) {
  40993. return this.x = e.x,
  40994. this.y = e.y,
  40995. this.z = e.z,
  40996. this.w = void 0 !== e.w ? e.w : 1,
  40997. this
  40998. },
  40999. add: function(e, t) {
  41000. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  41001. this.addVectors(e, t)) : (this.x += e.x,
  41002. this.y += e.y,
  41003. this.z += e.z,
  41004. this.w += e.w,
  41005. this)
  41006. },
  41007. addScalar: function(e) {
  41008. return this.x += e,
  41009. this.y += e,
  41010. this.z += e,
  41011. this.w += e,
  41012. this
  41013. },
  41014. addVectors: function(e, t) {
  41015. return this.x = e.x + t.x,
  41016. this.y = e.y + t.y,
  41017. this.z = e.z + t.z,
  41018. this.w = e.w + t.w,
  41019. this
  41020. },
  41021. addScaledVector: function(e, t) {
  41022. return this.x += e.x * t,
  41023. this.y += e.y * t,
  41024. this.z += e.z * t,
  41025. this.w += e.w * t,
  41026. this
  41027. },
  41028. sub: function(e, t) {
  41029. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  41030. this.subVectors(e, t)) : (this.x -= e.x,
  41031. this.y -= e.y,
  41032. this.z -= e.z,
  41033. this.w -= e.w,
  41034. this)
  41035. },
  41036. subScalar: function(e) {
  41037. return this.x -= e,
  41038. this.y -= e,
  41039. this.z -= e,
  41040. this.w -= e,
  41041. this
  41042. },
  41043. subVectors: function(e, t) {
  41044. return this.x = e.x - t.x,
  41045. this.y = e.y - t.y,
  41046. this.z = e.z - t.z,
  41047. this.w = e.w - t.w,
  41048. this
  41049. },
  41050. multiplyScalar: function(e) {
  41051. return isFinite(e) ? (this.x *= e,
  41052. this.y *= e,
  41053. this.z *= e,
  41054. this.w *= e) : (this.x = 0,
  41055. this.y = 0,
  41056. this.z = 0,
  41057. this.w = 0),
  41058. this
  41059. },
  41060. applyMatrix4: function(e) {
  41061. var t = this.x
  41062. , i = this.y
  41063. , n = this.z
  41064. , r = this.w
  41065. , o = e.elements;
  41066. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  41067. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  41068. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  41069. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  41070. this
  41071. },
  41072. divideScalar: function(e) {
  41073. return this.multiplyScalar(1 / e)
  41074. },
  41075. setAxisAngleFromQuaternion: function(e) {
  41076. this.w = 2 * Math.acos(e.w);
  41077. var t = Math.sqrt(1 - e.w * e.w);
  41078. return t < 1e-4 ? (this.x = 1,
  41079. this.y = 0,
  41080. this.z = 0) : (this.x = e.x / t,
  41081. this.y = e.y / t,
  41082. this.z = e.z / t),
  41083. this
  41084. },
  41085. setAxisAngleFromRotationMatrix: function(e) {
  41086. var t, i, n, r, o = .01, a = .1, s = e.elements, l = s[0], c = s[4], h = s[8], u = s[1], d = s[5], p = s[9], f = s[2], g = s[6], m = s[10];
  41087. if (Math.abs(c - u) < o && Math.abs(h - f) < o && Math.abs(p - g) < o) {
  41088. if (Math.abs(c + u) < a && Math.abs(h + f) < a && Math.abs(p + g) < a && Math.abs(l + d + m - 3) < a)
  41089. return this.set(1, 0, 0, 0),
  41090. this;
  41091. t = Math.PI;
  41092. var v = (l + 1) / 2
  41093. , A = (d + 1) / 2
  41094. , y = (m + 1) / 2
  41095. , C = (c + u) / 4
  41096. , I = (h + f) / 4
  41097. , E = (p + g) / 4;
  41098. return v > A && v > y ? v < o ? (i = 0,
  41099. n = .707106781,
  41100. r = .707106781) : (i = Math.sqrt(v),
  41101. n = C / i,
  41102. r = I / i) : A > y ? A < o ? (i = .707106781,
  41103. n = 0,
  41104. r = .707106781) : (n = Math.sqrt(A),
  41105. i = C / n,
  41106. r = E / n) : y < o ? (i = .707106781,
  41107. n = .707106781,
  41108. r = 0) : (r = Math.sqrt(y),
  41109. i = I / r,
  41110. n = E / r),
  41111. this.set(i, n, r, t),
  41112. this
  41113. }
  41114. var b = Math.sqrt((g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c));
  41115. return Math.abs(b) < .001 && (b = 1),
  41116. this.x = (g - p) / b,
  41117. this.y = (h - f) / b,
  41118. this.z = (u - c) / b,
  41119. this.w = Math.acos((l + d + m - 1) / 2),
  41120. this
  41121. },
  41122. min: function(e) {
  41123. return this.x = Math.min(this.x, e.x),
  41124. this.y = Math.min(this.y, e.y),
  41125. this.z = Math.min(this.z, e.z),
  41126. this.w = Math.min(this.w, e.w),
  41127. this
  41128. },
  41129. max: function(e) {
  41130. return this.x = Math.max(this.x, e.x),
  41131. this.y = Math.max(this.y, e.y),
  41132. this.z = Math.max(this.z, e.z),
  41133. this.w = Math.max(this.w, e.w),
  41134. this
  41135. },
  41136. clamp: function(e, t) {
  41137. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  41138. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  41139. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  41140. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  41141. this
  41142. },
  41143. clampScalar: function() {
  41144. var e, t;
  41145. return function(i, r) {
  41146. return void 0 === e && (e = new n.Vector4,
  41147. t = new n.Vector4),
  41148. e.set(i, i, i, i),
  41149. t.set(r, r, r, r),
  41150. this.clamp(e, t)
  41151. }
  41152. }(),
  41153. floor: function() {
  41154. return this.x = Math.floor(this.x),
  41155. this.y = Math.floor(this.y),
  41156. this.z = Math.floor(this.z),
  41157. this.w = Math.floor(this.w),
  41158. this
  41159. },
  41160. ceil: function() {
  41161. return this.x = Math.ceil(this.x),
  41162. this.y = Math.ceil(this.y),
  41163. this.z = Math.ceil(this.z),
  41164. this.w = Math.ceil(this.w),
  41165. this
  41166. },
  41167. round: function() {
  41168. return this.x = Math.round(this.x),
  41169. this.y = Math.round(this.y),
  41170. this.z = Math.round(this.z),
  41171. this.w = Math.round(this.w),
  41172. this
  41173. },
  41174. roundToZero: function() {
  41175. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  41176. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  41177. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  41178. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  41179. this
  41180. },
  41181. negate: function() {
  41182. return this.x = -this.x,
  41183. this.y = -this.y,
  41184. this.z = -this.z,
  41185. this.w = -this.w,
  41186. this
  41187. },
  41188. dot: function(e) {
  41189. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  41190. },
  41191. lengthSq: function() {
  41192. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  41193. },
  41194. length: function() {
  41195. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  41196. },
  41197. lengthManhattan: function() {
  41198. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  41199. },
  41200. normalize: function() {
  41201. return this.divideScalar(this.length())
  41202. },
  41203. setLength: function(e) {
  41204. return this.multiplyScalar(e / this.length())
  41205. },
  41206. lerp: function(e, t) {
  41207. return this.x += (e.x - this.x) * t,
  41208. this.y += (e.y - this.y) * t,
  41209. this.z += (e.z - this.z) * t,
  41210. this.w += (e.w - this.w) * t,
  41211. this
  41212. },
  41213. lerpVectors: function(e, t, i) {
  41214. return this.subVectors(t, e).multiplyScalar(i).add(e),
  41215. this
  41216. },
  41217. equals: function(e) {
  41218. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  41219. },
  41220. fromArray: function(e, t) {
  41221. return void 0 === t && (t = 0),
  41222. this.x = e[t],
  41223. this.y = e[t + 1],
  41224. this.z = e[t + 2],
  41225. this.w = e[t + 3],
  41226. this
  41227. },
  41228. toArray: function(e, t) {
  41229. return void 0 === e && (e = []),
  41230. void 0 === t && (t = 0),
  41231. e[t] = this.x,
  41232. e[t + 1] = this.y,
  41233. e[t + 2] = this.z,
  41234. e[t + 3] = this.w,
  41235. e
  41236. },
  41237. fromAttribute: function(e, t, i) {
  41238. return void 0 === i && (i = 0),
  41239. t = t * e.itemSize + i,
  41240. this.x = e.array[t],
  41241. this.y = e.array[t + 1],
  41242. this.z = e.array[t + 2],
  41243. this.w = e.array[t + 3],
  41244. this
  41245. }
  41246. },
  41247. n.Euler = function(e, t, i, r) {
  41248. this._x = e || 0,
  41249. this._y = t || 0,
  41250. this._z = i || 0,
  41251. this._order = r || n.Euler.DefaultOrder
  41252. }
  41253. ,
  41254. n.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  41255. n.Euler.DefaultOrder = "XYZ",
  41256. n.Euler.prototype = {
  41257. constructor: n.Euler,
  41258. get x() {
  41259. return this._x
  41260. },
  41261. set x(e) {
  41262. this._x = e,
  41263. this.onChangeCallback()
  41264. },
  41265. get y() {
  41266. return this._y
  41267. },
  41268. set y(e) {
  41269. this._y = e,
  41270. this.onChangeCallback()
  41271. },
  41272. get z() {
  41273. return this._z
  41274. },
  41275. set z(e) {
  41276. this._z = e,
  41277. this.onChangeCallback()
  41278. },
  41279. get order() {
  41280. return this._order
  41281. },
  41282. set order(e) {
  41283. this._order = e,
  41284. this.onChangeCallback()
  41285. },
  41286. set: function(e, t, i, n) {
  41287. return this._x = e,
  41288. this._y = t,
  41289. this._z = i,
  41290. this._order = n || this._order,
  41291. this.onChangeCallback(),
  41292. this
  41293. },
  41294. clone: function() {
  41295. return new this.constructor(this._x,this._y,this._z,this._order)
  41296. },
  41297. copy: function(e) {
  41298. return this._x = e._x,
  41299. this._y = e._y,
  41300. this._z = e._z,
  41301. this._order = e._order,
  41302. this.onChangeCallback(),
  41303. this
  41304. },
  41305. setFromRotationMatrix: function(e, t, i) {
  41306. var r = n.Math.clamp
  41307. , o = e.elements
  41308. , a = o[0]
  41309. , s = o[4]
  41310. , l = o[8]
  41311. , c = o[1]
  41312. , h = o[5]
  41313. , u = o[9]
  41314. , d = o[2]
  41315. , p = o[6]
  41316. , f = o[10];
  41317. return t = t || this._order,
  41318. "XYZ" === t ? (this._y = Math.asin(r(l, -1, 1)),
  41319. Math.abs(l) < .99999 ? (this._x = Math.atan2(-u, f),
  41320. this._z = Math.atan2(-s, a)) : (this._x = Math.atan2(p, h),
  41321. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-r(u, -1, 1)),
  41322. Math.abs(u) < .99999 ? (this._y = Math.atan2(l, f),
  41323. this._z = Math.atan2(c, h)) : (this._y = Math.atan2(-d, a),
  41324. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(r(p, -1, 1)),
  41325. Math.abs(p) < .99999 ? (this._y = Math.atan2(-d, f),
  41326. this._z = Math.atan2(-s, h)) : (this._y = 0,
  41327. this._z = Math.atan2(c, a))) : "ZYX" === t ? (this._y = Math.asin(-r(d, -1, 1)),
  41328. Math.abs(d) < .99999 ? (this._x = Math.atan2(p, f),
  41329. this._z = Math.atan2(c, a)) : (this._x = 0,
  41330. this._z = Math.atan2(-s, h))) : "YZX" === t ? (this._z = Math.asin(r(c, -1, 1)),
  41331. Math.abs(c) < .99999 ? (this._x = Math.atan2(-u, h),
  41332. this._y = Math.atan2(-d, a)) : (this._x = 0,
  41333. this._y = Math.atan2(l, f))) : "XZY" === t ? (this._z = Math.asin(-r(s, -1, 1)),
  41334. Math.abs(s) < .99999 ? (this._x = Math.atan2(p, h),
  41335. this._y = Math.atan2(l, a)) : (this._x = Math.atan2(-u, f),
  41336. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  41337. this._order = t,
  41338. i !== !1 && this.onChangeCallback(),
  41339. this
  41340. },
  41341. setFromQuaternion: function() {
  41342. var e;
  41343. return function(t, i, r) {
  41344. return void 0 === e && (e = new n.Matrix4),
  41345. e.makeRotationFromQuaternion(t),
  41346. this.setFromRotationMatrix(e, i, r),
  41347. this
  41348. }
  41349. }(),
  41350. setFromVector3: function(e, t) {
  41351. return this.set(e.x, e.y, e.z, t || this._order)
  41352. },
  41353. reorder: function() {
  41354. var e = new n.Quaternion;
  41355. return function(t) {
  41356. e.setFromEuler(this),
  41357. this.setFromQuaternion(e, t)
  41358. }
  41359. }(),
  41360. equals: function(e) {
  41361. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  41362. },
  41363. fromArray: function(e) {
  41364. return this._x = e[0],
  41365. this._y = e[1],
  41366. this._z = e[2],
  41367. void 0 !== e[3] && (this._order = e[3]),
  41368. this.onChangeCallback(),
  41369. this
  41370. },
  41371. toArray: function(e, t) {
  41372. return void 0 === e && (e = []),
  41373. void 0 === t && (t = 0),
  41374. e[t] = this._x,
  41375. e[t + 1] = this._y,
  41376. e[t + 2] = this._z,
  41377. e[t + 3] = this._order,
  41378. e
  41379. },
  41380. toVector3: function(e) {
  41381. return e ? e.set(this._x, this._y, this._z) : new n.Vector3(this._x,this._y,this._z)
  41382. },
  41383. onChange: function(e) {
  41384. return this.onChangeCallback = e,
  41385. this
  41386. },
  41387. onChangeCallback: function() {}
  41388. },
  41389. n.Line3 = function(e, t) {
  41390. this.start = void 0 !== e ? e : new n.Vector3,
  41391. this.end = void 0 !== t ? t : new n.Vector3
  41392. }
  41393. ,
  41394. n.Line3.prototype = {
  41395. constructor: n.Line3,
  41396. set: function(e, t) {
  41397. return this.start.copy(e),
  41398. this.end.copy(t),
  41399. this
  41400. },
  41401. clone: function() {
  41402. return (new this.constructor).copy(this)
  41403. },
  41404. copy: function(e) {
  41405. return this.start.copy(e.start),
  41406. this.end.copy(e.end),
  41407. this
  41408. },
  41409. center: function(e) {
  41410. var t = e || new n.Vector3;
  41411. return t.addVectors(this.start, this.end).multiplyScalar(.5)
  41412. },
  41413. delta: function(e) {
  41414. var t = e || new n.Vector3;
  41415. return t.subVectors(this.end, this.start)
  41416. },
  41417. distanceSq: function() {
  41418. return this.start.distanceToSquared(this.end)
  41419. },
  41420. distance: function() {
  41421. return this.start.distanceTo(this.end)
  41422. },
  41423. at: function(e, t) {
  41424. var i = t || new n.Vector3;
  41425. return this.delta(i).multiplyScalar(e).add(this.start)
  41426. },
  41427. closestPointToPointParameter: function() {
  41428. var e = new n.Vector3
  41429. , t = new n.Vector3;
  41430. return function(i, r) {
  41431. e.subVectors(i, this.start),
  41432. t.subVectors(this.end, this.start);
  41433. var o = t.dot(t)
  41434. , a = t.dot(e)
  41435. , s = a / o;
  41436. return r && (s = n.Math.clamp(s, 0, 1)),
  41437. s
  41438. }
  41439. }(),
  41440. closestPointToPoint: function(e, t, i) {
  41441. var r = this.closestPointToPointParameter(e, t)
  41442. , o = i || new n.Vector3;
  41443. return this.delta(o).multiplyScalar(r).add(this.start)
  41444. },
  41445. applyMatrix4: function(e) {
  41446. return this.start.applyMatrix4(e),
  41447. this.end.applyMatrix4(e),
  41448. this
  41449. },
  41450. equals: function(e) {
  41451. return e.start.equals(this.start) && e.end.equals(this.end)
  41452. }
  41453. },
  41454. n.Box2 = function(e, t) {
  41455. this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0),+(1 / 0)),
  41456. this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0),-(1 / 0))
  41457. }
  41458. ,
  41459. n.Box2.prototype = {
  41460. constructor: n.Box2,
  41461. set: function(e, t) {
  41462. return this.min.copy(e),
  41463. this.max.copy(t),
  41464. this
  41465. },
  41466. setFromPoints: function(e) {
  41467. this.makeEmpty();
  41468. for (var t = 0, i = e.length; t < i; t++)
  41469. this.expandByPoint(e[t]);
  41470. return this
  41471. },
  41472. setFromCenterAndSize: function() {
  41473. var e = new n.Vector2;
  41474. return function(t, i) {
  41475. var n = e.copy(i).multiplyScalar(.5);
  41476. return this.min.copy(t).sub(n),
  41477. this.max.copy(t).add(n),
  41478. this
  41479. }
  41480. }(),
  41481. clone: function() {
  41482. return (new this.constructor).copy(this)
  41483. },
  41484. copy: function(e) {
  41485. return this.min.copy(e.min),
  41486. this.max.copy(e.max),
  41487. this
  41488. },
  41489. makeEmpty: function() {
  41490. return this.min.x = this.min.y = +(1 / 0),
  41491. this.max.x = this.max.y = -(1 / 0),
  41492. this
  41493. },
  41494. isEmpty: function() {
  41495. return this.max.x < this.min.x || this.max.y < this.min.y
  41496. },
  41497. center: function(e) {
  41498. var t = e || new n.Vector2;
  41499. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  41500. },
  41501. size: function(e) {
  41502. var t = e || new n.Vector2;
  41503. return t.subVectors(this.max, this.min)
  41504. },
  41505. expandByPoint: function(e) {
  41506. return this.min.min(e),
  41507. this.max.max(e),
  41508. this
  41509. },
  41510. expandByVector: function(e) {
  41511. return this.min.sub(e),
  41512. this.max.add(e),
  41513. this
  41514. },
  41515. expandByScalar: function(e) {
  41516. return this.min.addScalar(-e),
  41517. this.max.addScalar(e),
  41518. this
  41519. },
  41520. containsPoint: function(e) {
  41521. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  41522. },
  41523. containsBox: function(e) {
  41524. 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
  41525. },
  41526. getParameter: function(e, t) {
  41527. var i = t || new n.Vector2;
  41528. return i.set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y))
  41529. },
  41530. intersectsBox: function(e) {
  41531. 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)
  41532. },
  41533. clampPoint: function(e, t) {
  41534. var i = t || new n.Vector2;
  41535. return i.copy(e).clamp(this.min, this.max)
  41536. },
  41537. distanceToPoint: function() {
  41538. var e = new n.Vector2;
  41539. return function(t) {
  41540. var i = e.copy(t).clamp(this.min, this.max);
  41541. return i.sub(t).length()
  41542. }
  41543. }(),
  41544. intersect: function(e) {
  41545. return this.min.max(e.min),
  41546. this.max.min(e.max),
  41547. this
  41548. },
  41549. union: function(e) {
  41550. return this.min.min(e.min),
  41551. this.max.max(e.max),
  41552. this
  41553. },
  41554. translate: function(e) {
  41555. return this.min.add(e),
  41556. this.max.add(e),
  41557. this
  41558. },
  41559. equals: function(e) {
  41560. return e.min.equals(this.min) && e.max.equals(this.max)
  41561. }
  41562. },
  41563. n.Box3 = function(e, t) {
  41564. this.min = void 0 !== e ? e : new n.Vector3(+(1 / 0),+(1 / 0),+(1 / 0)),
  41565. this.max = void 0 !== t ? t : new n.Vector3(-(1 / 0),-(1 / 0),-(1 / 0))
  41566. }
  41567. ,
  41568. n.Box3.prototype = {
  41569. constructor: n.Box3,
  41570. set: function(e, t) {
  41571. return this.min.copy(e),
  41572. this.max.copy(t),
  41573. this
  41574. },
  41575. setFromArray: function(e) {
  41576. this.makeEmpty();
  41577. 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) {
  41578. var c = e[s]
  41579. , h = e[s + 1]
  41580. , u = e[s + 2];
  41581. c < t && (t = c),
  41582. h < i && (i = h),
  41583. u < n && (n = u),
  41584. c > r && (r = c),
  41585. h > o && (o = h),
  41586. u > a && (a = u)
  41587. }
  41588. this.min.set(t, i, n),
  41589. this.max.set(r, o, a)
  41590. },
  41591. setFromPoints: function(e) {
  41592. this.makeEmpty();
  41593. for (var t = 0, i = e.length; t < i; t++)
  41594. this.expandByPoint(e[t]);
  41595. return this
  41596. },
  41597. setFromCenterAndSize: function() {
  41598. var e = new n.Vector3;
  41599. return function(t, i) {
  41600. var n = e.copy(i).multiplyScalar(.5);
  41601. return this.min.copy(t).sub(n),
  41602. this.max.copy(t).add(n),
  41603. this
  41604. }
  41605. }(),
  41606. setFromObject: function() {
  41607. var e;
  41608. return function(t) {
  41609. void 0 === e && (e = new n.Box3);
  41610. var i = this;
  41611. return this.makeEmpty(),
  41612. t.updateMatrixWorld(!0),
  41613. t.traverse(function(t) {
  41614. var n = t.geometry;
  41615. void 0 !== n && (null === n.boundingBox && n.computeBoundingBox(),
  41616. n.boundingBox.isEmpty() === !1 && (e.copy(n.boundingBox),
  41617. e.applyMatrix4(t.matrixWorld),
  41618. i.union(e)))
  41619. }),
  41620. this
  41621. }
  41622. }(),
  41623. clone: function() {
  41624. return (new this.constructor).copy(this)
  41625. },
  41626. copy: function(e) {
  41627. return this.min.copy(e.min),
  41628. this.max.copy(e.max),
  41629. this
  41630. },
  41631. makeEmpty: function() {
  41632. return this.min.x = this.min.y = this.min.z = +(1 / 0),
  41633. this.max.x = this.max.y = this.max.z = -(1 / 0),
  41634. this
  41635. },
  41636. isEmpty: function() {
  41637. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  41638. },
  41639. center: function(e) {
  41640. var t = e || new n.Vector3;
  41641. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  41642. },
  41643. size: function(e) {
  41644. var t = e || new n.Vector3;
  41645. return t.subVectors(this.max, this.min)
  41646. },
  41647. expandByPoint: function(e) {
  41648. return this.min.min(e),
  41649. this.max.max(e),
  41650. this
  41651. },
  41652. expandByVector: function(e) {
  41653. return this.min.sub(e),
  41654. this.max.add(e),
  41655. this
  41656. },
  41657. expandByScalar: function(e) {
  41658. return this.min.addScalar(-e),
  41659. this.max.addScalar(e),
  41660. this
  41661. },
  41662. containsPoint: function(e) {
  41663. 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)
  41664. },
  41665. containsBox: function(e) {
  41666. 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
  41667. },
  41668. getParameter: function(e, t) {
  41669. var i = t || new n.Vector3;
  41670. return i.set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y), (e.z - this.min.z) / (this.max.z - this.min.z))
  41671. },
  41672. intersectsBox: function(e) {
  41673. 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)
  41674. },
  41675. intersectsSphere: function() {
  41676. var e;
  41677. return function(t) {
  41678. return void 0 === e && (e = new n.Vector3),
  41679. this.clampPoint(t.center, e),
  41680. e.distanceToSquared(t.center) <= t.radius * t.radius
  41681. }
  41682. }(),
  41683. intersectsPlane: function(e) {
  41684. var t, i;
  41685. return e.normal.x > 0 ? (t = e.normal.x * this.min.x,
  41686. i = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  41687. i = e.normal.x * this.min.x),
  41688. e.normal.y > 0 ? (t += e.normal.y * this.min.y,
  41689. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  41690. i += e.normal.y * this.min.y),
  41691. e.normal.z > 0 ? (t += e.normal.z * this.min.z,
  41692. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  41693. i += e.normal.z * this.min.z),
  41694. t <= e.constant && i >= e.constant
  41695. },
  41696. clampPoint: function(e, t) {
  41697. var i = t || new n.Vector3;
  41698. return i.copy(e).clamp(this.min, this.max)
  41699. },
  41700. distanceToPoint: function() {
  41701. var e = new n.Vector3;
  41702. return function(t) {
  41703. var i = e.copy(t).clamp(this.min, this.max);
  41704. return i.sub(t).length()
  41705. }
  41706. }(),
  41707. getBoundingSphere: function() {
  41708. var e = new n.Vector3;
  41709. return function(t) {
  41710. var i = t || new n.Sphere;
  41711. return i.center = this.center(),
  41712. i.radius = .5 * this.size(e).length(),
  41713. i
  41714. }
  41715. }(),
  41716. intersect: function(e) {
  41717. return this.min.max(e.min),
  41718. this.max.min(e.max),
  41719. this
  41720. },
  41721. union: function(e) {
  41722. return this.min.min(e.min),
  41723. this.max.max(e.max),
  41724. this
  41725. },
  41726. applyMatrix4: function() {
  41727. var e = [new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3];
  41728. return function(t) {
  41729. return e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  41730. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  41731. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  41732. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  41733. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  41734. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  41735. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  41736. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  41737. this.makeEmpty(),
  41738. this.setFromPoints(e),
  41739. this
  41740. }
  41741. }(),
  41742. translate: function(e) {
  41743. return this.min.add(e),
  41744. this.max.add(e),
  41745. this
  41746. },
  41747. equals: function(e) {
  41748. return e.min.equals(this.min) && e.max.equals(this.max)
  41749. }
  41750. },
  41751. n.Matrix3 = function() {
  41752. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  41753. arguments.length > 0 && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  41754. }
  41755. ,
  41756. n.Matrix3.prototype = {
  41757. constructor: n.Matrix3,
  41758. set: function(e, t, i, n, r, o, a, s, l) {
  41759. var c = this.elements;
  41760. return c[0] = e,
  41761. c[1] = n,
  41762. c[2] = a,
  41763. c[3] = t,
  41764. c[4] = r,
  41765. c[5] = s,
  41766. c[6] = i,
  41767. c[7] = o,
  41768. c[8] = l,
  41769. this
  41770. },
  41771. identity: function() {
  41772. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  41773. this
  41774. },
  41775. clone: function() {
  41776. return (new this.constructor).fromArray(this.elements)
  41777. },
  41778. copy: function(e) {
  41779. var t = e.elements;
  41780. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  41781. this
  41782. },
  41783. setFromMatrix4: function(e) {
  41784. var t = e.elements;
  41785. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  41786. this
  41787. },
  41788. applyToVector3Array: function() {
  41789. var e;
  41790. return function(t, i, r) {
  41791. void 0 === e && (e = new n.Vector3),
  41792. void 0 === i && (i = 0),
  41793. void 0 === r && (r = t.length);
  41794. for (var o = 0, a = i; o < r; o += 3,
  41795. a += 3)
  41796. e.fromArray(t, a),
  41797. e.applyMatrix3(this),
  41798. e.toArray(t, a);
  41799. return t
  41800. }
  41801. }(),
  41802. applyToBuffer: function() {
  41803. var e;
  41804. return function(t, i, r) {
  41805. void 0 === e && (e = new n.Vector3),
  41806. void 0 === i && (i = 0),
  41807. void 0 === r && (r = t.length / t.itemSize);
  41808. for (var o = 0, a = i; o < r; o++,
  41809. a++)
  41810. e.x = t.getX(a),
  41811. e.y = t.getY(a),
  41812. e.z = t.getZ(a),
  41813. e.applyMatrix3(this),
  41814. t.setXYZ(e.x, e.y, e.z);
  41815. return t
  41816. }
  41817. }(),
  41818. multiplyScalar: function(e) {
  41819. var t = this.elements;
  41820. return t[0] *= e,
  41821. t[3] *= e,
  41822. t[6] *= e,
  41823. t[1] *= e,
  41824. t[4] *= e,
  41825. t[7] *= e,
  41826. t[2] *= e,
  41827. t[5] *= e,
  41828. t[8] *= e,
  41829. this
  41830. },
  41831. determinant: function() {
  41832. var e = this.elements
  41833. , t = e[0]
  41834. , i = e[1]
  41835. , n = e[2]
  41836. , r = e[3]
  41837. , o = e[4]
  41838. , a = e[5]
  41839. , s = e[6]
  41840. , l = e[7]
  41841. , c = e[8];
  41842. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  41843. },
  41844. getInverse: function(e, t) {
  41845. e instanceof n.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  41846. var i = e.elements
  41847. , r = this.elements
  41848. , o = i[0]
  41849. , a = i[1]
  41850. , s = i[2]
  41851. , l = i[3]
  41852. , c = i[4]
  41853. , h = i[5]
  41854. , u = i[6]
  41855. , d = i[7]
  41856. , p = i[8]
  41857. , f = p * c - h * d
  41858. , g = h * u - p * l
  41859. , m = d * l - c * u
  41860. , v = o * f + a * g + s * m;
  41861. if (0 === v) {
  41862. var A = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  41863. if (t)
  41864. throw new Error(A);
  41865. return console.warn(A),
  41866. this.identity()
  41867. }
  41868. return r[0] = f,
  41869. r[1] = s * d - p * a,
  41870. r[2] = h * a - s * c,
  41871. r[3] = g,
  41872. r[4] = p * o - s * u,
  41873. r[5] = s * l - h * o,
  41874. r[6] = m,
  41875. r[7] = a * u - d * o,
  41876. r[8] = c * o - a * l,
  41877. this.multiplyScalar(1 / v)
  41878. },
  41879. transpose: function() {
  41880. var e, t = this.elements;
  41881. return e = t[1],
  41882. t[1] = t[3],
  41883. t[3] = e,
  41884. e = t[2],
  41885. t[2] = t[6],
  41886. t[6] = e,
  41887. e = t[5],
  41888. t[5] = t[7],
  41889. t[7] = e,
  41890. this
  41891. },
  41892. flattenToArrayOffset: function(e, t) {
  41893. var i = this.elements;
  41894. return e[t] = i[0],
  41895. e[t + 1] = i[1],
  41896. e[t + 2] = i[2],
  41897. e[t + 3] = i[3],
  41898. e[t + 4] = i[4],
  41899. e[t + 5] = i[5],
  41900. e[t + 6] = i[6],
  41901. e[t + 7] = i[7],
  41902. e[t + 8] = i[8],
  41903. e
  41904. },
  41905. getNormalMatrix: function(e) {
  41906. return this.setFromMatrix4(e).getInverse(this).transpose()
  41907. },
  41908. transposeIntoArray: function(e) {
  41909. var t = this.elements;
  41910. return e[0] = t[0],
  41911. e[1] = t[3],
  41912. e[2] = t[6],
  41913. e[3] = t[1],
  41914. e[4] = t[4],
  41915. e[5] = t[7],
  41916. e[6] = t[2],
  41917. e[7] = t[5],
  41918. e[8] = t[8],
  41919. this
  41920. },
  41921. fromArray: function(e) {
  41922. return this.elements.set(e),
  41923. this
  41924. },
  41925. toArray: function() {
  41926. var e = this.elements;
  41927. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  41928. }
  41929. },
  41930. n.Matrix4 = function() {
  41931. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  41932. arguments.length > 0 && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  41933. }
  41934. ,
  41935. n.Matrix4.prototype = {
  41936. constructor: n.Matrix4,
  41937. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  41938. var m = this.elements;
  41939. return m[0] = e,
  41940. m[4] = t,
  41941. m[8] = i,
  41942. m[12] = n,
  41943. m[1] = r,
  41944. m[5] = o,
  41945. m[9] = a,
  41946. m[13] = s,
  41947. m[2] = l,
  41948. m[6] = c,
  41949. m[10] = h,
  41950. m[14] = u,
  41951. m[3] = d,
  41952. m[7] = p,
  41953. m[11] = f,
  41954. m[15] = g,
  41955. this
  41956. },
  41957. identity: function() {
  41958. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  41959. this
  41960. },
  41961. clone: function() {
  41962. return (new n.Matrix4).fromArray(this.elements)
  41963. },
  41964. copy: function(e) {
  41965. return this.elements.set(e.elements),
  41966. this
  41967. },
  41968. copyPosition: function(e) {
  41969. var t = this.elements
  41970. , i = e.elements;
  41971. return t[12] = i[12],
  41972. t[13] = i[13],
  41973. t[14] = i[14],
  41974. this
  41975. },
  41976. extractBasis: function(e, t, i) {
  41977. return e.setFromMatrixColumn(this, 0),
  41978. t.setFromMatrixColumn(this, 1),
  41979. i.setFromMatrixColumn(this, 2),
  41980. this
  41981. },
  41982. makeBasis: function(e, t, i) {
  41983. 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),
  41984. this
  41985. },
  41986. extractRotation: function() {
  41987. var e;
  41988. return function(t) {
  41989. void 0 === e && (e = new n.Vector3);
  41990. var i = this.elements
  41991. , r = t.elements
  41992. , o = 1 / e.setFromMatrixColumn(t, 0).length()
  41993. , a = 1 / e.setFromMatrixColumn(t, 1).length()
  41994. , s = 1 / e.setFromMatrixColumn(t, 2).length();
  41995. return i[0] = r[0] * o,
  41996. i[1] = r[1] * o,
  41997. i[2] = r[2] * o,
  41998. i[4] = r[4] * a,
  41999. i[5] = r[5] * a,
  42000. i[6] = r[6] * a,
  42001. i[8] = r[8] * s,
  42002. i[9] = r[9] * s,
  42003. i[10] = r[10] * s,
  42004. this
  42005. }
  42006. }(),
  42007. makeRotationFromEuler: function(e) {
  42008. e instanceof n.Euler == !1 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  42009. var t = this.elements
  42010. , i = e.x
  42011. , r = e.y
  42012. , o = e.z
  42013. , a = Math.cos(i)
  42014. , s = Math.sin(i)
  42015. , l = Math.cos(r)
  42016. , c = Math.sin(r)
  42017. , h = Math.cos(o)
  42018. , u = Math.sin(o);
  42019. if ("XYZ" === e.order) {
  42020. var d = a * h
  42021. , p = a * u
  42022. , f = s * h
  42023. , g = s * u;
  42024. t[0] = l * h,
  42025. t[4] = -l * u,
  42026. t[8] = c,
  42027. t[1] = p + f * c,
  42028. t[5] = d - g * c,
  42029. t[9] = -s * l,
  42030. t[2] = g - d * c,
  42031. t[6] = f + p * c,
  42032. t[10] = a * l
  42033. } else if ("YXZ" === e.order) {
  42034. var m = l * h
  42035. , v = l * u
  42036. , A = c * h
  42037. , y = c * u;
  42038. t[0] = m + y * s,
  42039. t[4] = A * s - v,
  42040. t[8] = a * c,
  42041. t[1] = a * u,
  42042. t[5] = a * h,
  42043. t[9] = -s,
  42044. t[2] = v * s - A,
  42045. t[6] = y + m * s,
  42046. t[10] = a * l
  42047. } else if ("ZXY" === e.order) {
  42048. var m = l * h
  42049. , v = l * u
  42050. , A = c * h
  42051. , y = c * u;
  42052. t[0] = m - y * s,
  42053. t[4] = -a * u,
  42054. t[8] = A + v * s,
  42055. t[1] = v + A * s,
  42056. t[5] = a * h,
  42057. t[9] = y - m * s,
  42058. t[2] = -a * c,
  42059. t[6] = s,
  42060. t[10] = a * l
  42061. } else if ("ZYX" === e.order) {
  42062. var d = a * h
  42063. , p = a * u
  42064. , f = s * h
  42065. , g = s * u;
  42066. t[0] = l * h,
  42067. t[4] = f * c - p,
  42068. t[8] = d * c + g,
  42069. t[1] = l * u,
  42070. t[5] = g * c + d,
  42071. t[9] = p * c - f,
  42072. t[2] = -c,
  42073. t[6] = s * l,
  42074. t[10] = a * l
  42075. } else if ("YZX" === e.order) {
  42076. var C = a * l
  42077. , I = a * c
  42078. , E = s * l
  42079. , b = s * c;
  42080. t[0] = l * h,
  42081. t[4] = b - C * u,
  42082. t[8] = E * u + I,
  42083. t[1] = u,
  42084. t[5] = a * h,
  42085. t[9] = -s * h,
  42086. t[2] = -c * h,
  42087. t[6] = I * u + E,
  42088. t[10] = C - b * u
  42089. } else if ("XZY" === e.order) {
  42090. var C = a * l
  42091. , I = a * c
  42092. , E = s * l
  42093. , b = s * c;
  42094. t[0] = l * h,
  42095. t[4] = -u,
  42096. t[8] = c * h,
  42097. t[1] = C * u + b,
  42098. t[5] = a * h,
  42099. t[9] = I * u - E,
  42100. t[2] = E * u - I,
  42101. t[6] = s * h,
  42102. t[10] = b * u + C
  42103. }
  42104. return t[3] = 0,
  42105. t[7] = 0,
  42106. t[11] = 0,
  42107. t[12] = 0,
  42108. t[13] = 0,
  42109. t[14] = 0,
  42110. t[15] = 1,
  42111. this
  42112. },
  42113. makeRotationFromQuaternion: function(e) {
  42114. var t = this.elements
  42115. , i = e.x
  42116. , n = e.y
  42117. , r = e.z
  42118. , o = e.w
  42119. , a = i + i
  42120. , s = n + n
  42121. , l = r + r
  42122. , c = i * a
  42123. , h = i * s
  42124. , u = i * l
  42125. , d = n * s
  42126. , p = n * l
  42127. , f = r * l
  42128. , g = o * a
  42129. , m = o * s
  42130. , v = o * l;
  42131. return t[0] = 1 - (d + f),
  42132. t[4] = h - v,
  42133. t[8] = u + m,
  42134. t[1] = h + v,
  42135. t[5] = 1 - (c + f),
  42136. t[9] = p - g,
  42137. t[2] = u - m,
  42138. t[6] = p + g,
  42139. t[10] = 1 - (c + d),
  42140. t[3] = 0,
  42141. t[7] = 0,
  42142. t[11] = 0,
  42143. t[12] = 0,
  42144. t[13] = 0,
  42145. t[14] = 0,
  42146. t[15] = 1,
  42147. this
  42148. },
  42149. lookAt: function() {
  42150. var e, t, i;
  42151. return function(r, o, a) {
  42152. void 0 === e && (e = new n.Vector3),
  42153. void 0 === t && (t = new n.Vector3),
  42154. void 0 === i && (i = new n.Vector3);
  42155. var s = this.elements;
  42156. return i.subVectors(r, o).normalize(),
  42157. 0 === i.lengthSq() && (i.z = 1),
  42158. e.crossVectors(a, i).normalize(),
  42159. 0 === e.lengthSq() && (i.x += 1e-4,
  42160. e.crossVectors(a, i).normalize()),
  42161. t.crossVectors(i, e),
  42162. s[0] = e.x,
  42163. s[4] = t.x,
  42164. s[8] = i.x,
  42165. s[1] = e.y,
  42166. s[5] = t.y,
  42167. s[9] = i.y,
  42168. s[2] = e.z,
  42169. s[6] = t.z,
  42170. s[10] = i.z,
  42171. this
  42172. }
  42173. }(),
  42174. multiply: function(e, t) {
  42175. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  42176. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  42177. },
  42178. multiplyMatrices: function(e, t) {
  42179. var i = e.elements
  42180. , n = t.elements
  42181. , r = this.elements
  42182. , o = i[0]
  42183. , a = i[4]
  42184. , s = i[8]
  42185. , l = i[12]
  42186. , c = i[1]
  42187. , h = i[5]
  42188. , u = i[9]
  42189. , d = i[13]
  42190. , p = i[2]
  42191. , f = i[6]
  42192. , g = i[10]
  42193. , m = i[14]
  42194. , v = i[3]
  42195. , A = i[7]
  42196. , y = i[11]
  42197. , C = i[15]
  42198. , I = n[0]
  42199. , E = n[4]
  42200. , b = n[8]
  42201. , w = n[12]
  42202. , _ = n[1]
  42203. , T = n[5]
  42204. , x = n[9]
  42205. , S = n[13]
  42206. , M = n[2]
  42207. , R = n[6]
  42208. , P = n[10]
  42209. , O = n[14]
  42210. , L = n[3]
  42211. , D = n[7]
  42212. , N = n[11]
  42213. , B = n[15];
  42214. return r[0] = o * I + a * _ + s * M + l * L,
  42215. r[4] = o * E + a * T + s * R + l * D,
  42216. r[8] = o * b + a * x + s * P + l * N,
  42217. r[12] = o * w + a * S + s * O + l * B,
  42218. r[1] = c * I + h * _ + u * M + d * L,
  42219. r[5] = c * E + h * T + u * R + d * D,
  42220. r[9] = c * b + h * x + u * P + d * N,
  42221. r[13] = c * w + h * S + u * O + d * B,
  42222. r[2] = p * I + f * _ + g * M + m * L,
  42223. r[6] = p * E + f * T + g * R + m * D,
  42224. r[10] = p * b + f * x + g * P + m * N,
  42225. r[14] = p * w + f * S + g * O + m * B,
  42226. r[3] = v * I + A * _ + y * M + C * L,
  42227. r[7] = v * E + A * T + y * R + C * D,
  42228. r[11] = v * b + A * x + y * P + C * N,
  42229. r[15] = v * w + A * S + y * O + C * B,
  42230. this
  42231. },
  42232. multiplyToArray: function(e, t, i) {
  42233. var n = this.elements;
  42234. return this.multiplyMatrices(e, t),
  42235. i[0] = n[0],
  42236. i[1] = n[1],
  42237. i[2] = n[2],
  42238. i[3] = n[3],
  42239. i[4] = n[4],
  42240. i[5] = n[5],
  42241. i[6] = n[6],
  42242. i[7] = n[7],
  42243. i[8] = n[8],
  42244. i[9] = n[9],
  42245. i[10] = n[10],
  42246. i[11] = n[11],
  42247. i[12] = n[12],
  42248. i[13] = n[13],
  42249. i[14] = n[14],
  42250. i[15] = n[15],
  42251. this
  42252. },
  42253. multiplyScalar: function(e) {
  42254. var t = this.elements;
  42255. return t[0] *= e,
  42256. t[4] *= e,
  42257. t[8] *= e,
  42258. t[12] *= e,
  42259. t[1] *= e,
  42260. t[5] *= e,
  42261. t[9] *= e,
  42262. t[13] *= e,
  42263. t[2] *= e,
  42264. t[6] *= e,
  42265. t[10] *= e,
  42266. t[14] *= e,
  42267. t[3] *= e,
  42268. t[7] *= e,
  42269. t[11] *= e,
  42270. t[15] *= e,
  42271. this
  42272. },
  42273. applyToVector3Array: function() {
  42274. var e;
  42275. return function(t, i, r) {
  42276. void 0 === e && (e = new n.Vector3),
  42277. void 0 === i && (i = 0),
  42278. void 0 === r && (r = t.length);
  42279. for (var o = 0, a = i; o < r; o += 3,
  42280. a += 3)
  42281. e.fromArray(t, a),
  42282. e.applyMatrix4(this),
  42283. e.toArray(t, a);
  42284. return t
  42285. }
  42286. }(),
  42287. applyToBuffer: function() {
  42288. var e;
  42289. return function(t, i, r) {
  42290. void 0 === e && (e = new n.Vector3),
  42291. void 0 === i && (i = 0),
  42292. void 0 === r && (r = t.length / t.itemSize);
  42293. for (var o = 0, a = i; o < r; o++,
  42294. a++)
  42295. e.x = t.getX(a),
  42296. e.y = t.getY(a),
  42297. e.z = t.getZ(a),
  42298. e.applyMatrix4(this),
  42299. t.setXYZ(e.x, e.y, e.z);
  42300. return t
  42301. }
  42302. }(),
  42303. determinant: function() {
  42304. var e = this.elements
  42305. , t = e[0]
  42306. , i = e[4]
  42307. , n = e[8]
  42308. , r = e[12]
  42309. , o = e[1]
  42310. , a = e[5]
  42311. , s = e[9]
  42312. , l = e[13]
  42313. , c = e[2]
  42314. , h = e[6]
  42315. , u = e[10]
  42316. , d = e[14]
  42317. , p = e[3]
  42318. , f = e[7]
  42319. , g = e[11]
  42320. , m = e[15];
  42321. return p * (+r * s * h - n * l * h - r * a * u + i * l * u + n * a * d - i * s * d) + f * (+t * s * d - t * l * u + r * o * u - n * o * d + n * l * c - r * s * c) + g * (+t * l * h - t * a * d - r * o * h + i * o * d + r * a * c - i * l * c) + m * (-n * a * c - t * s * h + t * a * u + n * o * h - i * o * u + i * s * c)
  42322. },
  42323. transpose: function() {
  42324. var e, t = this.elements;
  42325. return e = t[1],
  42326. t[1] = t[4],
  42327. t[4] = e,
  42328. e = t[2],
  42329. t[2] = t[8],
  42330. t[8] = e,
  42331. e = t[6],
  42332. t[6] = t[9],
  42333. t[9] = e,
  42334. e = t[3],
  42335. t[3] = t[12],
  42336. t[12] = e,
  42337. e = t[7],
  42338. t[7] = t[13],
  42339. t[13] = e,
  42340. e = t[11],
  42341. t[11] = t[14],
  42342. t[14] = e,
  42343. this
  42344. },
  42345. flattenToArrayOffset: function(e, t) {
  42346. var i = this.elements;
  42347. return e[t] = i[0],
  42348. e[t + 1] = i[1],
  42349. e[t + 2] = i[2],
  42350. e[t + 3] = i[3],
  42351. e[t + 4] = i[4],
  42352. e[t + 5] = i[5],
  42353. e[t + 6] = i[6],
  42354. e[t + 7] = i[7],
  42355. e[t + 8] = i[8],
  42356. e[t + 9] = i[9],
  42357. e[t + 10] = i[10],
  42358. e[t + 11] = i[11],
  42359. e[t + 12] = i[12],
  42360. e[t + 13] = i[13],
  42361. e[t + 14] = i[14],
  42362. e[t + 15] = i[15],
  42363. e
  42364. },
  42365. getPosition: function() {
  42366. var e;
  42367. return function() {
  42368. return void 0 === e && (e = new n.Vector3),
  42369. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  42370. e.setFromMatrixColumn(this, 3)
  42371. }
  42372. }(),
  42373. setPosition: function(e) {
  42374. var t = this.elements;
  42375. return t[12] = e.x,
  42376. t[13] = e.y,
  42377. t[14] = e.z,
  42378. this
  42379. },
  42380. getInverse: function(e, t) {
  42381. var i = this.elements
  42382. , n = e.elements
  42383. , r = n[0]
  42384. , o = n[1]
  42385. , a = n[2]
  42386. , s = n[3]
  42387. , l = n[4]
  42388. , c = n[5]
  42389. , h = n[6]
  42390. , u = n[7]
  42391. , d = n[8]
  42392. , p = n[9]
  42393. , f = n[10]
  42394. , g = n[11]
  42395. , m = n[12]
  42396. , v = n[13]
  42397. , A = n[14]
  42398. , y = n[15]
  42399. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  42400. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  42401. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  42402. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  42403. , w = r * C + o * I + a * E + s * b;
  42404. if (0 === w) {
  42405. var _ = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  42406. if (t)
  42407. throw new Error(_);
  42408. return console.warn(_),
  42409. this.identity()
  42410. }
  42411. return i[0] = C,
  42412. i[1] = v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y,
  42413. i[2] = c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y,
  42414. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  42415. i[4] = I,
  42416. i[5] = d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y,
  42417. i[6] = m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y,
  42418. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  42419. i[8] = E,
  42420. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y,
  42421. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y,
  42422. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  42423. i[12] = b,
  42424. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A,
  42425. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A,
  42426. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  42427. this.multiplyScalar(1 / w)
  42428. },
  42429. scale: function(e) {
  42430. var t = this.elements
  42431. , i = e.x
  42432. , n = e.y
  42433. , r = e.z;
  42434. return t[0] *= i,
  42435. t[4] *= n,
  42436. t[8] *= r,
  42437. t[1] *= i,
  42438. t[5] *= n,
  42439. t[9] *= r,
  42440. t[2] *= i,
  42441. t[6] *= n,
  42442. t[10] *= r,
  42443. t[3] *= i,
  42444. t[7] *= n,
  42445. t[11] *= r,
  42446. this
  42447. },
  42448. getMaxScaleOnAxis: function() {
  42449. var e = this.elements
  42450. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  42451. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  42452. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  42453. return Math.sqrt(Math.max(t, i, n))
  42454. },
  42455. makeTranslation: function(e, t, i) {
  42456. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  42457. this
  42458. },
  42459. makeRotationX: function(e) {
  42460. var t = Math.cos(e)
  42461. , i = Math.sin(e);
  42462. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  42463. this
  42464. },
  42465. makeRotationY: function(e) {
  42466. var t = Math.cos(e)
  42467. , i = Math.sin(e);
  42468. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  42469. this
  42470. },
  42471. makeRotationZ: function(e) {
  42472. var t = Math.cos(e)
  42473. , i = Math.sin(e);
  42474. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  42475. this
  42476. },
  42477. makeRotationAxis: function(e, t) {
  42478. var i = Math.cos(t)
  42479. , n = Math.sin(t)
  42480. , r = 1 - i
  42481. , o = e.x
  42482. , a = e.y
  42483. , s = e.z
  42484. , l = r * o
  42485. , c = r * a;
  42486. 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),
  42487. this
  42488. },
  42489. makeScale: function(e, t, i) {
  42490. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  42491. this
  42492. },
  42493. compose: function(e, t, i) {
  42494. return this.makeRotationFromQuaternion(t),
  42495. this.scale(i),
  42496. this.setPosition(e),
  42497. this
  42498. },
  42499. decompose: function() {
  42500. var e, t;
  42501. return function(i, r, o) {
  42502. void 0 === e && (e = new n.Vector3),
  42503. void 0 === t && (t = new n.Matrix4);
  42504. var a = this.elements
  42505. , s = e.set(a[0], a[1], a[2]).length()
  42506. , l = e.set(a[4], a[5], a[6]).length()
  42507. , c = e.set(a[8], a[9], a[10]).length()
  42508. , h = this.determinant();
  42509. h < 0 && (s = -s),
  42510. i.x = a[12],
  42511. i.y = a[13],
  42512. i.z = a[14],
  42513. t.elements.set(this.elements);
  42514. var u = 1 / s
  42515. , d = 1 / l
  42516. , p = 1 / c;
  42517. return t.elements[0] *= u,
  42518. t.elements[1] *= u,
  42519. t.elements[2] *= u,
  42520. t.elements[4] *= d,
  42521. t.elements[5] *= d,
  42522. t.elements[6] *= d,
  42523. t.elements[8] *= p,
  42524. t.elements[9] *= p,
  42525. t.elements[10] *= p,
  42526. r.setFromRotationMatrix(t),
  42527. o.x = s,
  42528. o.y = l,
  42529. o.z = c,
  42530. this
  42531. }
  42532. }(),
  42533. makeFrustum: function(e, t, i, n, r, o) {
  42534. var a = this.elements
  42535. , s = 2 * r / (t - e)
  42536. , l = 2 * r / (n - i)
  42537. , c = (t + e) / (t - e)
  42538. , h = (n + i) / (n - i)
  42539. , u = -(o + r) / (o - r)
  42540. , d = -2 * o * r / (o - r);
  42541. return a[0] = s,
  42542. a[4] = 0,
  42543. a[8] = c,
  42544. a[12] = 0,
  42545. a[1] = 0,
  42546. a[5] = l,
  42547. a[9] = h,
  42548. a[13] = 0,
  42549. a[2] = 0,
  42550. a[6] = 0,
  42551. a[10] = u,
  42552. a[14] = d,
  42553. a[3] = 0,
  42554. a[7] = 0,
  42555. a[11] = -1,
  42556. a[15] = 0,
  42557. this
  42558. },
  42559. makePerspective: function(e, t, i, r) {
  42560. var o = i * Math.tan(n.Math.degToRad(.5 * e))
  42561. , a = -o
  42562. , s = a * t
  42563. , l = o * t;
  42564. return this.makeFrustum(s, l, a, o, i, r)
  42565. },
  42566. makeOrthographic: function(e, t, i, n, r, o) {
  42567. var a = this.elements
  42568. , s = 1 / (t - e)
  42569. , l = 1 / (i - n)
  42570. , c = 1 / (o - r)
  42571. , h = (t + e) * s
  42572. , u = (i + n) * l
  42573. , d = (o + r) * c;
  42574. return a[0] = 2 * s,
  42575. a[4] = 0,
  42576. a[8] = 0,
  42577. a[12] = -h,
  42578. a[1] = 0,
  42579. a[5] = 2 * l,
  42580. a[9] = 0,
  42581. a[13] = -u,
  42582. a[2] = 0,
  42583. a[6] = 0,
  42584. a[10] = -2 * c,
  42585. a[14] = -d,
  42586. a[3] = 0,
  42587. a[7] = 0,
  42588. a[11] = 0,
  42589. a[15] = 1,
  42590. this
  42591. },
  42592. equals: function(e) {
  42593. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  42594. if (t[n] !== i[n])
  42595. return !1;
  42596. return !0
  42597. },
  42598. fromArray: function(e) {
  42599. return this.elements.set(e),
  42600. this
  42601. },
  42602. toArray: function() {
  42603. var e = this.elements;
  42604. 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]]
  42605. }
  42606. },
  42607. n.Ray = function(e, t) {
  42608. this.origin = void 0 !== e ? e : new n.Vector3,
  42609. this.direction = void 0 !== t ? t : new n.Vector3
  42610. }
  42611. ,
  42612. n.Ray.prototype = {
  42613. constructor: n.Ray,
  42614. set: function(e, t) {
  42615. return this.origin.copy(e),
  42616. this.direction.copy(t),
  42617. this
  42618. },
  42619. clone: function() {
  42620. return (new this.constructor).copy(this)
  42621. },
  42622. copy: function(e) {
  42623. return this.origin.copy(e.origin),
  42624. this.direction.copy(e.direction),
  42625. this
  42626. },
  42627. at: function(e, t) {
  42628. var i = t || new n.Vector3;
  42629. return i.copy(this.direction).multiplyScalar(e).add(this.origin)
  42630. },
  42631. lookAt: function(e) {
  42632. this.direction.copy(e).sub(this.origin).normalize()
  42633. },
  42634. recast: function() {
  42635. var e = new n.Vector3;
  42636. return function(t) {
  42637. return this.origin.copy(this.at(t, e)),
  42638. this
  42639. }
  42640. }(),
  42641. closestPointToPoint: function(e, t) {
  42642. var i = t || new n.Vector3;
  42643. i.subVectors(e, this.origin);
  42644. var r = i.dot(this.direction);
  42645. return r < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(r).add(this.origin)
  42646. },
  42647. distanceToPoint: function(e) {
  42648. return Math.sqrt(this.distanceSqToPoint(e))
  42649. },
  42650. distanceSqToPoint: function() {
  42651. var e = new n.Vector3;
  42652. return function(t) {
  42653. var i = e.subVectors(t, this.origin).dot(this.direction);
  42654. return i < 0 ? this.origin.distanceToSquared(t) : (e.copy(this.direction).multiplyScalar(i).add(this.origin),
  42655. e.distanceToSquared(t))
  42656. }
  42657. }(),
  42658. distanceSqToSegment: function() {
  42659. var e = new n.Vector3
  42660. , t = new n.Vector3
  42661. , i = new n.Vector3;
  42662. return function(n, r, o, a) {
  42663. e.copy(n).add(r).multiplyScalar(.5),
  42664. t.copy(r).sub(n).normalize(),
  42665. i.copy(this.origin).sub(e);
  42666. var s, l, c, h, u = .5 * n.distanceTo(r), d = -this.direction.dot(t), p = i.dot(this.direction), f = -i.dot(t), g = i.lengthSq(), m = Math.abs(1 - d * d);
  42667. if (m > 0)
  42668. if (s = d * f - p,
  42669. l = d * p - f,
  42670. h = u * m,
  42671. s >= 0)
  42672. if (l >= -h)
  42673. if (l <= h) {
  42674. var v = 1 / m;
  42675. s *= v,
  42676. l *= v,
  42677. c = s * (s + d * l + 2 * p) + l * (d * s + l + 2 * f) + g
  42678. } else
  42679. l = u,
  42680. s = Math.max(0, -(d * l + p)),
  42681. c = -s * s + l * (l + 2 * f) + g;
  42682. else
  42683. l = -u,
  42684. s = Math.max(0, -(d * l + p)),
  42685. c = -s * s + l * (l + 2 * f) + g;
  42686. else
  42687. l <= -h ? (s = Math.max(0, -(-d * u + p)),
  42688. l = s > 0 ? -u : Math.min(Math.max(-u, -f), u),
  42689. c = -s * s + l * (l + 2 * f) + g) : l <= h ? (s = 0,
  42690. l = Math.min(Math.max(-u, -f), u),
  42691. c = l * (l + 2 * f) + g) : (s = Math.max(0, -(d * u + p)),
  42692. l = s > 0 ? u : Math.min(Math.max(-u, -f), u),
  42693. c = -s * s + l * (l + 2 * f) + g);
  42694. else
  42695. l = d > 0 ? -u : u,
  42696. s = Math.max(0, -(d * l + p)),
  42697. c = -s * s + l * (l + 2 * f) + g;
  42698. return o && o.copy(this.direction).multiplyScalar(s).add(this.origin),
  42699. a && a.copy(t).multiplyScalar(l).add(e),
  42700. c
  42701. }
  42702. }(),
  42703. intersectSphere: function() {
  42704. var e = new n.Vector3;
  42705. return function(t, i) {
  42706. e.subVectors(t.center, this.origin);
  42707. var n = e.dot(this.direction)
  42708. , r = e.dot(e) - n * n
  42709. , o = t.radius * t.radius;
  42710. if (r > o)
  42711. return null;
  42712. var a = Math.sqrt(o - r)
  42713. , s = n - a
  42714. , l = n + a;
  42715. return s < 0 && l < 0 ? null : s < 0 ? this.at(l, i) : this.at(s, i)
  42716. }
  42717. }(),
  42718. intersectsSphere: function(e) {
  42719. return this.distanceToPoint(e.center) <= e.radius
  42720. },
  42721. distanceToPlane: function(e) {
  42722. var t = e.normal.dot(this.direction);
  42723. if (0 === t)
  42724. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  42725. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  42726. return i >= 0 ? i : null
  42727. },
  42728. intersectPlane: function(e, t) {
  42729. var i = this.distanceToPlane(e);
  42730. return null === i ? null : this.at(i, t)
  42731. },
  42732. intersectsPlane: function(e) {
  42733. var t = e.distanceToPoint(this.origin);
  42734. if (0 === t)
  42735. return !0;
  42736. var i = e.normal.dot(this.direction);
  42737. return i * t < 0
  42738. },
  42739. intersectBox: function(e, t) {
  42740. 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;
  42741. return l >= 0 ? (i = (e.min.x - u.x) * l,
  42742. n = (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  42743. n = (e.min.x - u.x) * l),
  42744. c >= 0 ? (r = (e.min.y - u.y) * c,
  42745. o = (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  42746. o = (e.min.y - u.y) * c),
  42747. i > o || r > n ? null : ((r > i || i !== i) && (i = r),
  42748. (o < n || n !== n) && (n = o),
  42749. h >= 0 ? (a = (e.min.z - u.z) * h,
  42750. s = (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  42751. s = (e.min.z - u.z) * h),
  42752. i > s || a > n ? null : ((a > i || i !== i) && (i = a),
  42753. (s < n || n !== n) && (n = s),
  42754. n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  42755. },
  42756. intersectsBox: function() {
  42757. var e = new n.Vector3;
  42758. return function(t) {
  42759. return null !== this.intersectBox(t, e)
  42760. }
  42761. }(),
  42762. intersectTriangle: function() {
  42763. var e = new n.Vector3
  42764. , t = new n.Vector3
  42765. , i = new n.Vector3
  42766. , r = new n.Vector3;
  42767. return function(n, o, a, s, l) {
  42768. t.subVectors(o, n),
  42769. i.subVectors(a, n),
  42770. r.crossVectors(t, i);
  42771. var c, h = this.direction.dot(r);
  42772. if (h > 0) {
  42773. if (s)
  42774. return null;
  42775. c = 1
  42776. } else {
  42777. if (!(h < 0))
  42778. return null;
  42779. c = -1,
  42780. h = -h
  42781. }
  42782. e.subVectors(this.origin, n);
  42783. var u = c * this.direction.dot(i.crossVectors(e, i));
  42784. if (u < 0)
  42785. return null;
  42786. var d = c * this.direction.dot(t.cross(e));
  42787. if (d < 0)
  42788. return null;
  42789. if (u + d > h)
  42790. return null;
  42791. var p = -c * e.dot(r);
  42792. return p < 0 ? null : this.at(p / h, l)
  42793. }
  42794. }(),
  42795. applyMatrix4: function(e) {
  42796. return this.direction.add(this.origin).applyMatrix4(e),
  42797. this.origin.applyMatrix4(e),
  42798. this.direction.sub(this.origin),
  42799. this.direction.normalize(),
  42800. this
  42801. },
  42802. equals: function(e) {
  42803. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  42804. }
  42805. },
  42806. n.Sphere = function(e, t) {
  42807. this.center = void 0 !== e ? e : new n.Vector3,
  42808. this.radius = void 0 !== t ? t : 0
  42809. }
  42810. ,
  42811. n.Sphere.prototype = {
  42812. constructor: n.Sphere,
  42813. set: function(e, t) {
  42814. return this.center.copy(e),
  42815. this.radius = t,
  42816. this
  42817. },
  42818. setFromPoints: function() {
  42819. var e = new n.Box3;
  42820. return function(t, i) {
  42821. var n = this.center;
  42822. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n);
  42823. for (var r = 0, o = 0, a = t.length; o < a; o++)
  42824. r = Math.max(r, n.distanceToSquared(t[o]));
  42825. return this.radius = Math.sqrt(r),
  42826. this
  42827. }
  42828. }(),
  42829. clone: function() {
  42830. return (new this.constructor).copy(this)
  42831. },
  42832. copy: function(e) {
  42833. return this.center.copy(e.center),
  42834. this.radius = e.radius,
  42835. this
  42836. },
  42837. empty: function() {
  42838. return this.radius <= 0
  42839. },
  42840. containsPoint: function(e) {
  42841. return e.distanceToSquared(this.center) <= this.radius * this.radius
  42842. },
  42843. distanceToPoint: function(e) {
  42844. return e.distanceTo(this.center) - this.radius
  42845. },
  42846. intersectsSphere: function(e) {
  42847. var t = this.radius + e.radius;
  42848. return e.center.distanceToSquared(this.center) <= t * t
  42849. },
  42850. intersectsBox: function(e) {
  42851. return e.intersectsSphere(this)
  42852. },
  42853. intersectsPlane: function(e) {
  42854. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  42855. },
  42856. clampPoint: function(e, t) {
  42857. var i = this.center.distanceToSquared(e)
  42858. , r = t || new n.Vector3;
  42859. return r.copy(e),
  42860. i > this.radius * this.radius && (r.sub(this.center).normalize(),
  42861. r.multiplyScalar(this.radius).add(this.center)),
  42862. r
  42863. },
  42864. getBoundingBox: function(e) {
  42865. var t = e || new n.Box3;
  42866. return t.set(this.center, this.center),
  42867. t.expandByScalar(this.radius),
  42868. t
  42869. },
  42870. applyMatrix4: function(e) {
  42871. return this.center.applyMatrix4(e),
  42872. this.radius = this.radius * e.getMaxScaleOnAxis(),
  42873. this
  42874. },
  42875. translate: function(e) {
  42876. return this.center.add(e),
  42877. this
  42878. },
  42879. equals: function(e) {
  42880. return e.center.equals(this.center) && e.radius === this.radius
  42881. }
  42882. },
  42883. n.Frustum = function(e, t, i, r, o, a) {
  42884. this.planes = [void 0 !== e ? e : new n.Plane, void 0 !== t ? t : new n.Plane, void 0 !== i ? i : new n.Plane, void 0 !== r ? r : new n.Plane, void 0 !== o ? o : new n.Plane, void 0 !== a ? a : new n.Plane]
  42885. }
  42886. ,
  42887. n.Frustum.prototype = {
  42888. constructor: n.Frustum,
  42889. set: function(e, t, i, n, r, o) {
  42890. var a = this.planes;
  42891. return a[0].copy(e),
  42892. a[1].copy(t),
  42893. a[2].copy(i),
  42894. a[3].copy(n),
  42895. a[4].copy(r),
  42896. a[5].copy(o),
  42897. this
  42898. },
  42899. clone: function() {
  42900. return (new this.constructor).copy(this)
  42901. },
  42902. copy: function(e) {
  42903. for (var t = this.planes, i = 0; i < 6; i++)
  42904. t[i].copy(e.planes[i]);
  42905. return this
  42906. },
  42907. setFromMatrix: function(e) {
  42908. var t = this.planes
  42909. , i = e.elements
  42910. , n = i[0]
  42911. , r = i[1]
  42912. , o = i[2]
  42913. , a = i[3]
  42914. , s = i[4]
  42915. , l = i[5]
  42916. , c = i[6]
  42917. , h = i[7]
  42918. , u = i[8]
  42919. , d = i[9]
  42920. , p = i[10]
  42921. , f = i[11]
  42922. , g = i[12]
  42923. , m = i[13]
  42924. , v = i[14]
  42925. , A = i[15];
  42926. return t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  42927. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  42928. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  42929. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  42930. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  42931. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  42932. this
  42933. },
  42934. intersectsObject: function() {
  42935. var e = new n.Sphere;
  42936. return function(t) {
  42937. var i = t.geometry;
  42938. return null === i.boundingSphere && i.computeBoundingSphere(),
  42939. e.copy(i.boundingSphere),
  42940. e.applyMatrix4(t.matrixWorld),
  42941. this.intersectsSphere(e)
  42942. }
  42943. }(),
  42944. intersectsSphere: function(e) {
  42945. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  42946. var o = t[r].distanceToPoint(i);
  42947. if (o < n)
  42948. return !1
  42949. }
  42950. return !0
  42951. },
  42952. intersectsBox: function() {
  42953. var e = new n.Vector3
  42954. , t = new n.Vector3;
  42955. return function(i) {
  42956. for (var n = this.planes, r = 0; r < 6; r++) {
  42957. var o = n[r];
  42958. e.x = o.normal.x > 0 ? i.min.x : i.max.x,
  42959. t.x = o.normal.x > 0 ? i.max.x : i.min.x,
  42960. e.y = o.normal.y > 0 ? i.min.y : i.max.y,
  42961. t.y = o.normal.y > 0 ? i.max.y : i.min.y,
  42962. e.z = o.normal.z > 0 ? i.min.z : i.max.z,
  42963. t.z = o.normal.z > 0 ? i.max.z : i.min.z;
  42964. var a = o.distanceToPoint(e)
  42965. , s = o.distanceToPoint(t);
  42966. if (a < 0 && s < 0)
  42967. return !1
  42968. }
  42969. return !0
  42970. }
  42971. }(),
  42972. containsPoint: function(e) {
  42973. for (var t = this.planes, i = 0; i < 6; i++)
  42974. if (t[i].distanceToPoint(e) < 0)
  42975. return !1;
  42976. return !0
  42977. }
  42978. },
  42979. n.Plane = function(e, t) {
  42980. this.normal = void 0 !== e ? e : new n.Vector3(1,0,0),
  42981. this.constant = void 0 !== t ? t : 0
  42982. }
  42983. ,
  42984. n.Plane.prototype = {
  42985. constructor: n.Plane,
  42986. set: function(e, t) {
  42987. return this.normal.copy(e),
  42988. this.constant = t,
  42989. this
  42990. },
  42991. setComponents: function(e, t, i, n) {
  42992. return this.normal.set(e, t, i),
  42993. this.constant = n,
  42994. this
  42995. },
  42996. setFromNormalAndCoplanarPoint: function(e, t) {
  42997. return this.normal.copy(e),
  42998. this.constant = -t.dot(this.normal),
  42999. this
  43000. },
  43001. setFromCoplanarPoints: function() {
  43002. var e = new n.Vector3
  43003. , t = new n.Vector3;
  43004. return function(i, n, r) {
  43005. var o = e.subVectors(r, n).cross(t.subVectors(i, n)).normalize();
  43006. return this.setFromNormalAndCoplanarPoint(o, i),
  43007. this
  43008. }
  43009. }(),
  43010. clone: function() {
  43011. return (new this.constructor).copy(this)
  43012. },
  43013. copy: function(e) {
  43014. return this.normal.copy(e.normal),
  43015. this.constant = e.constant,
  43016. this
  43017. },
  43018. normalize: function() {
  43019. var e = 1 / this.normal.length();
  43020. return this.normal.multiplyScalar(e),
  43021. this.constant *= e,
  43022. this
  43023. },
  43024. negate: function() {
  43025. return this.constant *= -1,
  43026. this.normal.negate(),
  43027. this
  43028. },
  43029. distanceToPoint: function(e) {
  43030. return this.normal.dot(e) + this.constant
  43031. },
  43032. distanceToSphere: function(e) {
  43033. return this.distanceToPoint(e.center) - e.radius
  43034. },
  43035. projectPoint: function(e, t) {
  43036. return this.orthoPoint(e, t).sub(e).negate()
  43037. },
  43038. orthoPoint: function(e, t) {
  43039. var i = this.distanceToPoint(e)
  43040. , r = t || new n.Vector3;
  43041. return r.copy(this.normal).multiplyScalar(i)
  43042. },
  43043. intersectLine: function() {
  43044. var e = new n.Vector3;
  43045. return function(t, i) {
  43046. var r = i || new n.Vector3
  43047. , o = t.delta(e)
  43048. , a = this.normal.dot(o);
  43049. if (0 !== a) {
  43050. var s = -(t.start.dot(this.normal) + this.constant) / a;
  43051. if (!(s < 0 || s > 1))
  43052. return r.copy(o).multiplyScalar(s).add(t.start)
  43053. } else if (0 === this.distanceToPoint(t.start))
  43054. return r.copy(t.start)
  43055. }
  43056. }(),
  43057. intersectsLine: function(e) {
  43058. var t = this.distanceToPoint(e.start)
  43059. , i = this.distanceToPoint(e.end);
  43060. return t < 0 && i > 0 || i < 0 && t > 0
  43061. },
  43062. intersectsBox: function(e) {
  43063. return e.intersectsPlane(this)
  43064. },
  43065. intersectsSphere: function(e) {
  43066. return e.intersectsPlane(this)
  43067. },
  43068. coplanarPoint: function(e) {
  43069. var t = e || new n.Vector3;
  43070. return t.copy(this.normal).multiplyScalar(-this.constant)
  43071. },
  43072. applyMatrix4: function() {
  43073. var e = new n.Vector3
  43074. , t = new n.Vector3
  43075. , i = new n.Matrix3;
  43076. return function(n, r) {
  43077. var o = r || i.getNormalMatrix(n)
  43078. , a = e.copy(this.normal).applyMatrix3(o)
  43079. , s = this.coplanarPoint(t);
  43080. return s.applyMatrix4(n),
  43081. this.setFromNormalAndCoplanarPoint(a, s),
  43082. this
  43083. }
  43084. }(),
  43085. translate: function(e) {
  43086. return this.constant = this.constant - e.dot(this.normal),
  43087. this
  43088. },
  43089. equals: function(e) {
  43090. return e.normal.equals(this.normal) && e.constant === this.constant
  43091. }
  43092. },
  43093. n.Spherical = function(e, t, i) {
  43094. return this.radius = void 0 !== e ? e : 1,
  43095. this.phi = void 0 !== t ? t : 0,
  43096. this.theta = void 0 !== i ? i : 0,
  43097. this
  43098. }
  43099. ,
  43100. n.Spherical.prototype = {
  43101. constructor: n.Spherical,
  43102. set: function(e, t, i) {
  43103. this.radius = e,
  43104. this.phi = t,
  43105. this.theta = i
  43106. },
  43107. clone: function() {
  43108. return (new this.constructor).copy(this)
  43109. },
  43110. copy: function(e) {
  43111. return this.radius.copy(e.radius),
  43112. this.phi.copy(e.phi),
  43113. this.theta.copy(e.theta),
  43114. this
  43115. },
  43116. makeSafe: function() {
  43117. var e = 1e-6;
  43118. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi))
  43119. },
  43120. setFromVector3: function(e) {
  43121. return this.radius = e.length(),
  43122. 0 === this.radius ? (this.theta = 0,
  43123. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  43124. this.phi = Math.acos(n.Math.clamp(e.y / this.radius, -1, 1))),
  43125. this
  43126. }
  43127. },
  43128. n.Math = {
  43129. generateUUID: function() {
  43130. var e, t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), i = new Array(36), n = 0;
  43131. return function() {
  43132. for (var r = 0; r < 36; r++)
  43133. 8 === r || 13 === r || 18 === r || 23 === r ? i[r] = "-" : 14 === r ? i[r] = "4" : (n <= 2 && (n = 33554432 + 16777216 * Math.random() | 0),
  43134. e = 15 & n,
  43135. n >>= 4,
  43136. i[r] = t[19 === r ? 3 & e | 8 : e]);
  43137. return i.join("")
  43138. }
  43139. }(),
  43140. clamp: function(e, t, i) {
  43141. return Math.max(t, Math.min(i, e))
  43142. },
  43143. euclideanModulo: function(e, t) {
  43144. return (e % t + t) % t
  43145. },
  43146. mapLinear: function(e, t, i, n, r) {
  43147. return n + (e - t) * (r - n) / (i - t)
  43148. },
  43149. smoothstep: function(e, t, i) {
  43150. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  43151. e * e * (3 - 2 * e))
  43152. },
  43153. smootherstep: function(e, t, i) {
  43154. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  43155. e * e * e * (e * (6 * e - 15) + 10))
  43156. },
  43157. random16: function() {
  43158. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  43159. Math.random()
  43160. },
  43161. randInt: function(e, t) {
  43162. return e + Math.floor(Math.random() * (t - e + 1))
  43163. },
  43164. randFloat: function(e, t) {
  43165. return e + Math.random() * (t - e)
  43166. },
  43167. randFloatSpread: function(e) {
  43168. return e * (.5 - Math.random())
  43169. },
  43170. degToRad: function() {
  43171. var e = Math.PI / 180;
  43172. return function(t) {
  43173. return t * e
  43174. }
  43175. }(),
  43176. radToDeg: function() {
  43177. var e = 180 / Math.PI;
  43178. return function(t) {
  43179. return t * e
  43180. }
  43181. }(),
  43182. isPowerOfTwo: function(e) {
  43183. return 0 === (e & e - 1) && 0 !== e
  43184. },
  43185. nearestPowerOfTwo: function(e) {
  43186. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  43187. },
  43188. nextPowerOfTwo: function(e) {
  43189. return e--,
  43190. e |= e >> 1,
  43191. e |= e >> 2,
  43192. e |= e >> 4,
  43193. e |= e >> 8,
  43194. e |= e >> 16,
  43195. e++,
  43196. e
  43197. }
  43198. },
  43199. n.Spline = function(e) {
  43200. function t(e, t, i, n, r, o, a) {
  43201. var s = .5 * (i - e)
  43202. , l = .5 * (n - t);
  43203. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  43204. }
  43205. this.points = e;
  43206. var i, r, o, a, s, l, c, h, u, d = [], p = {
  43207. x: 0,
  43208. y: 0,
  43209. z: 0
  43210. };
  43211. this.initFromArray = function(e) {
  43212. this.points = [];
  43213. for (var t = 0; t < e.length; t++)
  43214. this.points[t] = {
  43215. x: e[t][0],
  43216. y: e[t][1],
  43217. z: e[t][2]
  43218. }
  43219. }
  43220. ,
  43221. this.getPoint = function(e) {
  43222. return i = (this.points.length - 1) * e,
  43223. r = Math.floor(i),
  43224. o = i - r,
  43225. d[0] = 0 === r ? r : r - 1,
  43226. d[1] = r,
  43227. d[2] = r > this.points.length - 2 ? this.points.length - 1 : r + 1,
  43228. d[3] = r > this.points.length - 3 ? this.points.length - 1 : r + 2,
  43229. l = this.points[d[0]],
  43230. c = this.points[d[1]],
  43231. h = this.points[d[2]],
  43232. u = this.points[d[3]],
  43233. a = o * o,
  43234. s = o * a,
  43235. p.x = t(l.x, c.x, h.x, u.x, o, a, s),
  43236. p.y = t(l.y, c.y, h.y, u.y, o, a, s),
  43237. p.z = t(l.z, c.z, h.z, u.z, o, a, s),
  43238. p
  43239. }
  43240. ,
  43241. this.getControlPointsArray = function() {
  43242. var e, t, i = this.points.length, n = [];
  43243. for (e = 0; e < i; e++)
  43244. t = this.points[e],
  43245. n[e] = [t.x, t.y, t.z];
  43246. return n
  43247. }
  43248. ,
  43249. this.getLength = function(e) {
  43250. var t, i, r, o, a = 0, s = 0, l = 0, c = new n.Vector3, h = new n.Vector3, u = [], d = 0;
  43251. for (u[0] = 0,
  43252. e || (e = 100),
  43253. r = this.points.length * e,
  43254. c.copy(this.points[0]),
  43255. t = 1; t < r; t++)
  43256. i = t / r,
  43257. o = this.getPoint(i),
  43258. h.copy(o),
  43259. d += h.distanceTo(c),
  43260. c.copy(o),
  43261. a = (this.points.length - 1) * i,
  43262. s = Math.floor(a),
  43263. s !== l && (u[s] = d,
  43264. l = s);
  43265. return u[u.length] = d,
  43266. {
  43267. chunks: u,
  43268. total: d
  43269. }
  43270. }
  43271. ,
  43272. this.reparametrizeByArcLength = function(e) {
  43273. var t, i, r, o, a, s, l, c, h = [], u = new n.Vector3, d = this.getLength();
  43274. for (h.push(u.copy(this.points[0]).clone()),
  43275. t = 1; t < this.points.length; t++) {
  43276. for (s = d.chunks[t] - d.chunks[t - 1],
  43277. l = Math.ceil(e * s / d.total),
  43278. o = (t - 1) / (this.points.length - 1),
  43279. a = t / (this.points.length - 1),
  43280. i = 1; i < l - 1; i++)
  43281. r = o + i * (1 / l) * (a - o),
  43282. c = this.getPoint(r),
  43283. h.push(u.copy(c).clone());
  43284. h.push(u.copy(this.points[t]).clone())
  43285. }
  43286. this.points = h
  43287. }
  43288. }
  43289. ,
  43290. n.Triangle = function(e, t, i) {
  43291. this.a = void 0 !== e ? e : new n.Vector3,
  43292. this.b = void 0 !== t ? t : new n.Vector3,
  43293. this.c = void 0 !== i ? i : new n.Vector3
  43294. }
  43295. ,
  43296. n.Triangle.normal = function() {
  43297. var e = new n.Vector3;
  43298. return function(t, i, r, o) {
  43299. var a = o || new n.Vector3;
  43300. a.subVectors(r, i),
  43301. e.subVectors(t, i),
  43302. a.cross(e);
  43303. var s = a.lengthSq();
  43304. return s > 0 ? a.multiplyScalar(1 / Math.sqrt(s)) : a.set(0, 0, 0)
  43305. }
  43306. }(),
  43307. n.Triangle.barycoordFromPoint = function() {
  43308. var e = new n.Vector3
  43309. , t = new n.Vector3
  43310. , i = new n.Vector3;
  43311. return function(r, o, a, s, l) {
  43312. e.subVectors(s, o),
  43313. t.subVectors(a, o),
  43314. i.subVectors(r, o);
  43315. var c = e.dot(e)
  43316. , h = e.dot(t)
  43317. , u = e.dot(i)
  43318. , d = t.dot(t)
  43319. , p = t.dot(i)
  43320. , f = c * d - h * h
  43321. , g = l || new n.Vector3;
  43322. if (0 === f)
  43323. return g.set(-2, -1, -1);
  43324. var m = 1 / f
  43325. , v = (d * u - h * p) * m
  43326. , A = (c * p - h * u) * m;
  43327. return g.set(1 - v - A, A, v)
  43328. }
  43329. }(),
  43330. n.Triangle.containsPoint = function() {
  43331. var e = new n.Vector3;
  43332. return function(t, i, r, o) {
  43333. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e);
  43334. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1
  43335. }
  43336. }(),
  43337. n.Triangle.prototype = {
  43338. constructor: n.Triangle,
  43339. set: function(e, t, i) {
  43340. return this.a.copy(e),
  43341. this.b.copy(t),
  43342. this.c.copy(i),
  43343. this
  43344. },
  43345. setFromPointsAndIndices: function(e, t, i, n) {
  43346. return this.a.copy(e[t]),
  43347. this.b.copy(e[i]),
  43348. this.c.copy(e[n]),
  43349. this
  43350. },
  43351. clone: function() {
  43352. return (new this.constructor).copy(this)
  43353. },
  43354. copy: function(e) {
  43355. return this.a.copy(e.a),
  43356. this.b.copy(e.b),
  43357. this.c.copy(e.c),
  43358. this
  43359. },
  43360. area: function() {
  43361. var e = new n.Vector3
  43362. , t = new n.Vector3;
  43363. return function() {
  43364. return e.subVectors(this.c, this.b),
  43365. t.subVectors(this.a, this.b),
  43366. .5 * e.cross(t).length()
  43367. }
  43368. }(),
  43369. midpoint: function(e) {
  43370. var t = e || new n.Vector3;
  43371. return t.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  43372. },
  43373. normal: function(e) {
  43374. return n.Triangle.normal(this.a, this.b, this.c, e)
  43375. },
  43376. plane: function(e) {
  43377. var t = e || new n.Plane;
  43378. return t.setFromCoplanarPoints(this.a, this.b, this.c)
  43379. },
  43380. barycoordFromPoint: function(e, t) {
  43381. return n.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  43382. },
  43383. containsPoint: function(e) {
  43384. return n.Triangle.containsPoint(e, this.a, this.b, this.c)
  43385. },
  43386. equals: function(e) {
  43387. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  43388. }
  43389. },
  43390. n.Interpolant = function(e, t, i, n) {
  43391. this.parameterPositions = e,
  43392. this._cachedIndex = 0,
  43393. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  43394. this.sampleValues = t,
  43395. this.valueSize = i
  43396. }
  43397. ,
  43398. n.Interpolant.prototype = {
  43399. constructor: n.Interpolant,
  43400. evaluate: function(e) {
  43401. var t = this.parameterPositions
  43402. , i = this._cachedIndex
  43403. , n = t[i]
  43404. , r = t[i - 1];
  43405. e: {
  43406. t: {
  43407. var o;
  43408. i: {
  43409. n: if (!(e < n)) {
  43410. for (var a = i + 2; ; ) {
  43411. if (void 0 === n) {
  43412. if (e < r)
  43413. break n;
  43414. return i = t.length,
  43415. this._cachedIndex = i,
  43416. this.afterEnd_(i - 1, e, r)
  43417. }
  43418. if (i === a)
  43419. break;
  43420. if (r = n,
  43421. n = t[++i],
  43422. e < n)
  43423. break t
  43424. }
  43425. o = t.length;
  43426. break i
  43427. }
  43428. {
  43429. if (e >= r)
  43430. break e;
  43431. var s = t[1];
  43432. e < s && (i = 2,
  43433. r = s);
  43434. for (var a = i - 2; ; ) {
  43435. if (void 0 === r)
  43436. return this._cachedIndex = 0,
  43437. this.beforeStart_(0, e, n);
  43438. if (i === a)
  43439. break;
  43440. if (n = r,
  43441. r = t[--i - 1],
  43442. e >= r)
  43443. break t
  43444. }
  43445. o = i,
  43446. i = 0
  43447. }
  43448. }
  43449. for (; i < o; ) {
  43450. var l = i + o >>> 1;
  43451. e < t[l] ? o = l : i = l + 1
  43452. }
  43453. if (n = t[i],
  43454. r = t[i - 1],
  43455. void 0 === r)
  43456. return this._cachedIndex = 0,
  43457. this.beforeStart_(0, e, n);
  43458. if (void 0 === n)
  43459. return i = t.length,
  43460. this._cachedIndex = i,
  43461. this.afterEnd_(i - 1, r, e)
  43462. }
  43463. this._cachedIndex = i,
  43464. this.intervalChanged_(i, r, n)
  43465. }
  43466. return this.interpolate_(i, r, e, n)
  43467. },
  43468. settings: null,
  43469. DefaultSettings_: {},
  43470. getSettings_: function() {
  43471. return this.settings || this.DefaultSettings_
  43472. },
  43473. copySampleValue_: function(e) {
  43474. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  43475. t[o] = i[r + o];
  43476. return t
  43477. },
  43478. interpolate_: function(e, t, i, n) {
  43479. throw new Error("call to abstract method")
  43480. },
  43481. intervalChanged_: function(e, t, i) {}
  43482. },
  43483. Object.assign(n.Interpolant.prototype, {
  43484. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  43485. afterEnd_: n.Interpolant.prototype.copySampleValue_
  43486. }),
  43487. n.CubicInterpolant = function(e, t, i, r) {
  43488. n.Interpolant.call(this, e, t, i, r),
  43489. this._weightPrev = -0,
  43490. this._offsetPrev = -0,
  43491. this._weightNext = -0,
  43492. this._offsetNext = -0
  43493. }
  43494. ,
  43495. n.CubicInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43496. constructor: n.CubicInterpolant,
  43497. DefaultSettings_: {
  43498. endingStart: n.ZeroCurvatureEnding,
  43499. endingEnd: n.ZeroCurvatureEnding
  43500. },
  43501. intervalChanged_: function(e, t, i) {
  43502. var r = this.parameterPositions
  43503. , o = e - 2
  43504. , a = e + 1
  43505. , s = r[o]
  43506. , l = r[a];
  43507. if (void 0 === s)
  43508. switch (this.getSettings_().endingStart) {
  43509. case n.ZeroSlopeEnding:
  43510. o = e,
  43511. s = 2 * t - i;
  43512. break;
  43513. case n.WrapAroundEnding:
  43514. o = r.length - 2,
  43515. s = t + r[o] - r[o + 1];
  43516. break;
  43517. default:
  43518. o = e,
  43519. s = i
  43520. }
  43521. if (void 0 === l)
  43522. switch (this.getSettings_().endingEnd) {
  43523. case n.ZeroSlopeEnding:
  43524. a = e,
  43525. l = 2 * i - t;
  43526. break;
  43527. case n.WrapAroundEnding:
  43528. a = 1,
  43529. l = i + r[1] - r[0];
  43530. break;
  43531. default:
  43532. a = e - 1,
  43533. l = t
  43534. }
  43535. var c = .5 * (i - t)
  43536. , h = this.valueSize;
  43537. this._weightPrev = c / (t - s),
  43538. this._weightNext = c / (l - i),
  43539. this._offsetPrev = o * h,
  43540. this._offsetNext = a * h
  43541. },
  43542. interpolate_: function(e, t, i, n) {
  43543. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = s - a, c = this._offsetPrev, h = this._offsetNext, u = this._weightPrev, d = this._weightNext, p = (i - t) / (n - t), f = p * p, g = f * p, m = -u * g + 2 * u * f - u * p, v = (1 + u) * g + (-1.5 - 2 * u) * f + (-.5 + u) * p + 1, A = (-1 - d) * g + (1.5 + d) * f + .5 * p, y = d * g - d * f, C = 0; C !== a; ++C)
  43544. r[C] = m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C];
  43545. return r
  43546. }
  43547. }),
  43548. n.DiscreteInterpolant = function(e, t, i, r) {
  43549. n.Interpolant.call(this, e, t, i, r)
  43550. }
  43551. ,
  43552. n.DiscreteInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43553. constructor: n.DiscreteInterpolant,
  43554. interpolate_: function(e, t, i, n) {
  43555. return this.copySampleValue_(e - 1)
  43556. }
  43557. }),
  43558. n.LinearInterpolant = function(e, t, i, r) {
  43559. n.Interpolant.call(this, e, t, i, r)
  43560. }
  43561. ,
  43562. n.LinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43563. constructor: n.LinearInterpolant,
  43564. interpolate_: function(e, t, i, n) {
  43565. 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)
  43566. r[u] = o[l + u] * h + o[s + u] * c;
  43567. return r
  43568. }
  43569. }),
  43570. n.QuaternionLinearInterpolant = function(e, t, i, r) {
  43571. n.Interpolant.call(this, e, t, i, r)
  43572. }
  43573. ,
  43574. n.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43575. constructor: n.QuaternionLinearInterpolant,
  43576. interpolate_: function(e, t, i, r) {
  43577. for (var o = this.resultBuffer, a = this.sampleValues, s = this.valueSize, l = e * s, c = (i - t) / (r - t), h = l + s; l !== h; l += 4)
  43578. n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c);
  43579. return o
  43580. }
  43581. }),
  43582. n.Clock = function(e) {
  43583. this.autoStart = void 0 === e || e,
  43584. this.startTime = 0,
  43585. this.oldTime = 0,
  43586. this.elapsedTime = 0,
  43587. this.running = !1
  43588. }
  43589. ,
  43590. n.Clock.prototype = {
  43591. constructor: n.Clock,
  43592. start: function() {
  43593. this.startTime = performance.now(),
  43594. this.oldTime = this.startTime,
  43595. this.running = !0
  43596. },
  43597. stop: function() {
  43598. this.getElapsedTime(),
  43599. this.running = !1
  43600. },
  43601. getElapsedTime: function() {
  43602. return this.getDelta(),
  43603. this.elapsedTime
  43604. },
  43605. getDelta: function() {
  43606. var e = 0;
  43607. if (this.autoStart && !this.running && this.start(),
  43608. this.running) {
  43609. var t = performance.now();
  43610. e = .001 * (t - this.oldTime),
  43611. this.oldTime = t,
  43612. this.elapsedTime += e
  43613. }
  43614. return e
  43615. }
  43616. },
  43617. n.EventDispatcher = function() {}
  43618. ,
  43619. n.EventDispatcher.prototype = {
  43620. constructor: n.EventDispatcher,
  43621. apply: function(e) {
  43622. e.addEventListener = n.EventDispatcher.prototype.addEventListener,
  43623. e.hasEventListener = n.EventDispatcher.prototype.hasEventListener,
  43624. e.removeEventListener = n.EventDispatcher.prototype.removeEventListener,
  43625. e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent
  43626. },
  43627. addEventListener: function(e, t) {
  43628. void 0 === this._listeners && (this._listeners = {});
  43629. var i = this._listeners;
  43630. void 0 === i[e] && (i[e] = []),
  43631. i[e].indexOf(t) === -1 && i[e].push(t)
  43632. },
  43633. hasEventListener: function(e, t) {
  43634. if (void 0 === this._listeners)
  43635. return !1;
  43636. var i = this._listeners;
  43637. return void 0 !== i[e] && i[e].indexOf(t) !== -1
  43638. },
  43639. removeEventListener: function(e, t) {
  43640. if (void 0 !== this._listeners) {
  43641. var i = this._listeners
  43642. , n = i[e];
  43643. if (void 0 !== n) {
  43644. var r = n.indexOf(t);
  43645. r !== -1 && n.splice(r, 1)
  43646. }
  43647. }
  43648. },
  43649. dispatchEvent: function(e) {
  43650. if (void 0 !== this._listeners) {
  43651. var t = this._listeners
  43652. , i = t[e.type];
  43653. if (void 0 !== i) {
  43654. e.target = this;
  43655. for (var n = [], r = i.length, o = 0; o < r; o++)
  43656. n[o] = i[o];
  43657. for (var o = 0; o < r; o++)
  43658. n[o].call(this, e)
  43659. }
  43660. }
  43661. }
  43662. },
  43663. n.Layers = function() {
  43664. this.mask = 1
  43665. }
  43666. ,
  43667. n.Layers.prototype = {
  43668. constructor: n.Layers,
  43669. set: function(e) {
  43670. this.mask = 1 << e
  43671. },
  43672. enable: function(e) {
  43673. this.mask |= 1 << e
  43674. },
  43675. toggle: function(e) {
  43676. this.mask ^= 1 << e
  43677. },
  43678. disable: function(e) {
  43679. this.mask &= ~(1 << e)
  43680. },
  43681. test: function(e) {
  43682. return 0 !== (this.mask & e.mask)
  43683. }
  43684. },
  43685. function(e) {
  43686. function t(e, t) {
  43687. return e.distance - t.distance
  43688. }
  43689. function i(e, t, n, r) {
  43690. if (e.visible !== !1 && (e.raycast(t, n),
  43691. r === !0))
  43692. for (var o = e.children, a = 0, s = o.length; a < s; a++)
  43693. i(o[a], t, n, !0)
  43694. }
  43695. e.Raycaster = function(t, i, n, r) {
  43696. this.ray = new e.Ray(t,i),
  43697. this.near = n || 0,
  43698. this.far = r || 1 / 0,
  43699. this.params = {
  43700. Mesh: {},
  43701. Line: {},
  43702. LOD: {},
  43703. Points: {
  43704. threshold: 1
  43705. },
  43706. Sprite: {}
  43707. },
  43708. Object.defineProperties(this.params, {
  43709. PointCloud: {
  43710. get: function() {
  43711. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  43712. this.Points
  43713. }
  43714. }
  43715. })
  43716. }
  43717. ,
  43718. e.Raycaster.prototype = {
  43719. constructor: e.Raycaster,
  43720. linePrecision: 1,
  43721. set: function(e, t) {
  43722. this.ray.set(e, t)
  43723. },
  43724. setFromCamera: function(t, i) {
  43725. i instanceof e.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld),
  43726. this.ray.direction.set(t.x, t.y, .5).unproject(i).sub(this.ray.origin).normalize()) : i instanceof e.OrthographicCamera ? (this.ray.origin.set(t.x, t.y, -1).unproject(i),
  43727. this.ray.direction.set(0, 0, -1).transformDirection(i.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  43728. },
  43729. intersectObject: function(e, n) {
  43730. var r = [];
  43731. return i(e, this, r, n),
  43732. r.sort(t),
  43733. r
  43734. },
  43735. intersectObjects: function(e, n) {
  43736. var r = [];
  43737. if (Array.isArray(e) === !1)
  43738. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  43739. r;
  43740. for (var o = 0, a = e.length; o < a; o++)
  43741. i(e[o], this, r, n);
  43742. return r.sort(t),
  43743. r
  43744. }
  43745. }
  43746. }(n),
  43747. n.Object3D = function() {
  43748. function e() {
  43749. o.setFromEuler(r, !1)
  43750. }
  43751. function t() {
  43752. r.setFromQuaternion(o, void 0, !1)
  43753. }
  43754. Object.defineProperty(this, "id", {
  43755. value: n.Object3DIdCount++
  43756. }),
  43757. this.uuid = n.Math.generateUUID(),
  43758. this.name = "",
  43759. this.type = "Object3D",
  43760. this.parent = null,
  43761. this.children = [],
  43762. this.up = n.Object3D.DefaultUp.clone();
  43763. var i = new n.Vector3
  43764. , r = new n.Euler
  43765. , o = new n.Quaternion
  43766. , a = new n.Vector3(1,1,1);
  43767. r.onChange(e),
  43768. o.onChange(t),
  43769. Object.defineProperties(this, {
  43770. position: {
  43771. enumerable: !0,
  43772. value: i
  43773. },
  43774. rotation: {
  43775. enumerable: !0,
  43776. value: r
  43777. },
  43778. quaternion: {
  43779. enumerable: !0,
  43780. value: o
  43781. },
  43782. scale: {
  43783. enumerable: !0,
  43784. value: a
  43785. },
  43786. modelViewMatrix: {
  43787. value: new n.Matrix4
  43788. },
  43789. normalMatrix: {
  43790. value: new n.Matrix3
  43791. }
  43792. }),
  43793. this.rotationAutoUpdate = !0,
  43794. this.matrix = new n.Matrix4,
  43795. this.matrixWorld = new n.Matrix4,
  43796. this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate,
  43797. this.matrixWorldNeedsUpdate = !1,
  43798. this.layers = new n.Layers,
  43799. this.visible = !0,
  43800. this.castShadow = !1,
  43801. this.receiveShadow = !1,
  43802. this.frustumCulled = !0,
  43803. this.renderOrder = 0,
  43804. this.userData = {}
  43805. }
  43806. ,
  43807. n.Object3D.DefaultUp = new n.Vector3(0,1,0),
  43808. n.Object3D.DefaultMatrixAutoUpdate = !0,
  43809. n.Object3D.prototype = {
  43810. constructor: n.Object3D,
  43811. applyMatrix: function(e) {
  43812. this.matrix.multiplyMatrices(e, this.matrix),
  43813. this.matrix.decompose(this.position, this.quaternion, this.scale)
  43814. },
  43815. setRotationFromAxisAngle: function(e, t) {
  43816. this.quaternion.setFromAxisAngle(e, t)
  43817. },
  43818. setRotationFromEuler: function(e) {
  43819. this.quaternion.setFromEuler(e, !0)
  43820. },
  43821. setRotationFromMatrix: function(e) {
  43822. this.quaternion.setFromRotationMatrix(e)
  43823. },
  43824. setRotationFromQuaternion: function(e) {
  43825. this.quaternion.copy(e)
  43826. },
  43827. rotateOnAxis: function() {
  43828. var e = new n.Quaternion;
  43829. return function(t, i) {
  43830. return e.setFromAxisAngle(t, i),
  43831. this.quaternion.multiply(e),
  43832. this
  43833. }
  43834. }(),
  43835. rotateX: function() {
  43836. var e = new n.Vector3(1,0,0);
  43837. return function(t) {
  43838. return this.rotateOnAxis(e, t)
  43839. }
  43840. }(),
  43841. rotateY: function() {
  43842. var e = new n.Vector3(0,1,0);
  43843. return function(t) {
  43844. return this.rotateOnAxis(e, t)
  43845. }
  43846. }(),
  43847. rotateZ: function() {
  43848. var e = new n.Vector3(0,0,1);
  43849. return function(t) {
  43850. return this.rotateOnAxis(e, t)
  43851. }
  43852. }(),
  43853. translateOnAxis: function() {
  43854. var e = new n.Vector3;
  43855. return function(t, i) {
  43856. return e.copy(t).applyQuaternion(this.quaternion),
  43857. this.position.add(e.multiplyScalar(i)),
  43858. this
  43859. }
  43860. }(),
  43861. translateX: function() {
  43862. var e = new n.Vector3(1,0,0);
  43863. return function(t) {
  43864. return this.translateOnAxis(e, t)
  43865. }
  43866. }(),
  43867. translateY: function() {
  43868. var e = new n.Vector3(0,1,0);
  43869. return function(t) {
  43870. return this.translateOnAxis(e, t)
  43871. }
  43872. }(),
  43873. translateZ: function() {
  43874. var e = new n.Vector3(0,0,1);
  43875. return function(t) {
  43876. return this.translateOnAxis(e, t)
  43877. }
  43878. }(),
  43879. localToWorld: function(e) {
  43880. return e.applyMatrix4(this.matrixWorld)
  43881. },
  43882. worldToLocal: function() {
  43883. var e = new n.Matrix4;
  43884. return function(t) {
  43885. return t.applyMatrix4(e.getInverse(this.matrixWorld))
  43886. }
  43887. }(),
  43888. lookAt: function() {
  43889. var e = new n.Matrix4;
  43890. return function(t) {
  43891. e.lookAt(t, this.position, this.up),
  43892. this.quaternion.setFromRotationMatrix(e)
  43893. }
  43894. }(),
  43895. add: function(e) {
  43896. if (arguments.length > 1) {
  43897. for (var t = 0; t < arguments.length; t++)
  43898. this.add(arguments[t]);
  43899. return this
  43900. }
  43901. return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e),
  43902. this) : (e instanceof n.Object3D ? (null !== e.parent && e.parent.remove(e),
  43903. e.parent = this,
  43904. e.dispatchEvent({
  43905. type: "added"
  43906. }),
  43907. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  43908. this)
  43909. },
  43910. remove: function(e) {
  43911. if (arguments.length > 1)
  43912. for (var t = 0; t < arguments.length; t++)
  43913. this.remove(arguments[t]);
  43914. var i = this.children.indexOf(e);
  43915. i !== -1 && (e.parent = null,
  43916. e.dispatchEvent({
  43917. type: "removed"
  43918. }),
  43919. this.children.splice(i, 1))
  43920. },
  43921. getObjectById: function(e) {
  43922. return this.getObjectByProperty("id", e)
  43923. },
  43924. getObjectByName: function(e) {
  43925. return this.getObjectByProperty("name", e)
  43926. },
  43927. getObjectByProperty: function(e, t) {
  43928. if (this[e] === t)
  43929. return this;
  43930. for (var i = 0, n = this.children.length; i < n; i++) {
  43931. var r = this.children[i]
  43932. , o = r.getObjectByProperty(e, t);
  43933. if (void 0 !== o)
  43934. return o
  43935. }
  43936. },
  43937. getWorldPosition: function(e) {
  43938. var t = e || new n.Vector3;
  43939. return this.updateMatrixWorld(!0),
  43940. t.setFromMatrixPosition(this.matrixWorld)
  43941. },
  43942. getWorldQuaternion: function() {
  43943. var e = new n.Vector3
  43944. , t = new n.Vector3;
  43945. return function(i) {
  43946. var r = i || new n.Quaternion;
  43947. return this.updateMatrixWorld(!0),
  43948. this.matrixWorld.decompose(e, r, t),
  43949. r
  43950. }
  43951. }(),
  43952. getWorldRotation: function() {
  43953. var e = new n.Quaternion;
  43954. return function(t) {
  43955. var i = t || new n.Euler;
  43956. return this.getWorldQuaternion(e),
  43957. i.setFromQuaternion(e, this.rotation.order, !1)
  43958. }
  43959. }(),
  43960. getWorldScale: function() {
  43961. var e = new n.Vector3
  43962. , t = new n.Quaternion;
  43963. return function(i) {
  43964. var r = i || new n.Vector3;
  43965. return this.updateMatrixWorld(!0),
  43966. this.matrixWorld.decompose(e, t, r),
  43967. r
  43968. }
  43969. }(),
  43970. getWorldDirection: function() {
  43971. var e = new n.Quaternion;
  43972. return function(t) {
  43973. var i = t || new n.Vector3;
  43974. return this.getWorldQuaternion(e),
  43975. i.set(0, 0, 1).applyQuaternion(e)
  43976. }
  43977. }(),
  43978. raycast: function() {},
  43979. traverse: function(e) {
  43980. e(this);
  43981. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  43982. t[i].traverse(e)
  43983. },
  43984. traverseVisible: function(e) {
  43985. if (this.visible !== !1) {
  43986. e(this);
  43987. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  43988. t[i].traverseVisible(e)
  43989. }
  43990. },
  43991. traverseAncestors: function(e) {
  43992. var t = this.parent;
  43993. null !== t && (e(t),
  43994. t.traverseAncestors(e))
  43995. },
  43996. updateMatrix: function() {
  43997. this.matrix.compose(this.position, this.quaternion, this.scale),
  43998. this.matrixWorldNeedsUpdate = !0
  43999. },
  44000. updateMatrixWorld: function(e) {
  44001. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  44002. this.matrixWorldNeedsUpdate !== !0 && e !== !0 || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  44003. this.matrixWorldNeedsUpdate = !1,
  44004. e = !0);
  44005. for (var t = 0, i = this.children.length; t < i; t++)
  44006. this.children[t].updateMatrixWorld(e)
  44007. },
  44008. toJSON: function(e) {
  44009. function t(e) {
  44010. var t = [];
  44011. for (var i in e) {
  44012. var n = e[i];
  44013. delete n.metadata,
  44014. t.push(n)
  44015. }
  44016. return t
  44017. }
  44018. var i = void 0 === e
  44019. , n = {};
  44020. i && (e = {
  44021. geometries: {},
  44022. materials: {},
  44023. textures: {},
  44024. images: {}
  44025. },
  44026. n.metadata = {
  44027. version: 4.4,
  44028. type: "Object",
  44029. generator: "Object3D.toJSON"
  44030. });
  44031. var r = {};
  44032. if (r.uuid = this.uuid,
  44033. r.type = this.type,
  44034. "" !== this.name && (r.name = this.name),
  44035. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  44036. this.castShadow === !0 && (r.castShadow = !0),
  44037. this.receiveShadow === !0 && (r.receiveShadow = !0),
  44038. this.visible === !1 && (r.visible = !1),
  44039. r.matrix = this.matrix.toArray(),
  44040. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  44041. r.geometry = this.geometry.uuid),
  44042. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  44043. r.material = this.material.uuid),
  44044. this.children.length > 0) {
  44045. r.children = [];
  44046. for (var o = 0; o < this.children.length; o++)
  44047. r.children.push(this.children[o].toJSON(e).object)
  44048. }
  44049. if (i) {
  44050. var a = t(e.geometries)
  44051. , s = t(e.materials)
  44052. , l = t(e.textures)
  44053. , c = t(e.images);
  44054. a.length > 0 && (n.geometries = a),
  44055. s.length > 0 && (n.materials = s),
  44056. l.length > 0 && (n.textures = l),
  44057. c.length > 0 && (n.images = c)
  44058. }
  44059. return n.object = r,
  44060. n
  44061. },
  44062. clone: function(e) {
  44063. return (new this.constructor).copy(this, e)
  44064. },
  44065. copy: function(e, t) {
  44066. if (void 0 === t && (t = !0),
  44067. this.name = e.name,
  44068. this.up.copy(e.up),
  44069. this.position.copy(e.position),
  44070. this.quaternion.copy(e.quaternion),
  44071. this.scale.copy(e.scale),
  44072. this.rotationAutoUpdate = e.rotationAutoUpdate,
  44073. this.matrix.copy(e.matrix),
  44074. this.matrixWorld.copy(e.matrixWorld),
  44075. this.matrixAutoUpdate = e.matrixAutoUpdate,
  44076. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  44077. this.visible = e.visible,
  44078. this.castShadow = e.castShadow,
  44079. this.receiveShadow = e.receiveShadow,
  44080. this.frustumCulled = e.frustumCulled,
  44081. this.renderOrder = e.renderOrder,
  44082. this.userData = JSON.parse(JSON.stringify(e.userData)),
  44083. t === !0)
  44084. for (var i = 0; i < e.children.length; i++) {
  44085. var n = e.children[i];
  44086. this.add(n.clone())
  44087. }
  44088. return this
  44089. }
  44090. },
  44091. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  44092. n.Object3DIdCount = 0,
  44093. n.Face3 = function(e, t, i, r, o, a) {
  44094. this.a = e,
  44095. this.b = t,
  44096. this.c = i,
  44097. this.normal = r instanceof n.Vector3 ? r : new n.Vector3,
  44098. this.vertexNormals = Array.isArray(r) ? r : [],
  44099. this.color = o instanceof n.Color ? o : new n.Color,
  44100. this.vertexColors = Array.isArray(o) ? o : [],
  44101. this.materialIndex = void 0 !== a ? a : 0
  44102. }
  44103. ,
  44104. n.Face3.prototype = {
  44105. constructor: n.Face3,
  44106. clone: function() {
  44107. return (new this.constructor).copy(this)
  44108. },
  44109. copy: function(e) {
  44110. this.a = e.a,
  44111. this.b = e.b,
  44112. this.c = e.c,
  44113. this.normal.copy(e.normal),
  44114. this.color.copy(e.color),
  44115. this.materialIndex = e.materialIndex;
  44116. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  44117. this.vertexNormals[t] = e.vertexNormals[t].clone();
  44118. for (var t = 0, i = e.vertexColors.length; t < i; t++)
  44119. this.vertexColors[t] = e.vertexColors[t].clone();
  44120. return this
  44121. }
  44122. },
  44123. n.BufferAttribute = function(e, t) {
  44124. this.uuid = n.Math.generateUUID(),
  44125. this.array = e,
  44126. this.itemSize = t,
  44127. this.dynamic = !1,
  44128. this.updateRange = {
  44129. offset: 0,
  44130. count: -1
  44131. },
  44132. this.version = 0
  44133. }
  44134. ,
  44135. n.BufferAttribute.prototype = {
  44136. constructor: n.BufferAttribute,
  44137. get count() {
  44138. return this.array.length / this.itemSize
  44139. },
  44140. set needsUpdate(e) {
  44141. e === !0 && this.version++
  44142. },
  44143. setDynamic: function(e) {
  44144. return this.dynamic = e,
  44145. this
  44146. },
  44147. copy: function(e) {
  44148. return this.array = new e.array.constructor(e.array),
  44149. this.itemSize = e.itemSize,
  44150. this.dynamic = e.dynamic,
  44151. this
  44152. },
  44153. copyAt: function(e, t, i) {
  44154. e *= this.itemSize,
  44155. i *= t.itemSize;
  44156. for (var n = 0, r = this.itemSize; n < r; n++)
  44157. this.array[e + n] = t.array[i + n];
  44158. return this
  44159. },
  44160. copyArray: function(e) {
  44161. return this.array.set(e),
  44162. this
  44163. },
  44164. copyColorsArray: function(e) {
  44165. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44166. var a = e[r];
  44167. void 0 === a && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", r),
  44168. a = new n.Color),
  44169. t[i++] = a.r,
  44170. t[i++] = a.g,
  44171. t[i++] = a.b
  44172. }
  44173. return this
  44174. },
  44175. copyIndicesArray: function(e) {
  44176. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  44177. var o = e[n];
  44178. t[i++] = o.a,
  44179. t[i++] = o.b,
  44180. t[i++] = o.c
  44181. }
  44182. return this
  44183. },
  44184. copyVector2sArray: function(e) {
  44185. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44186. var a = e[r];
  44187. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", r),
  44188. a = new n.Vector2),
  44189. t[i++] = a.x,
  44190. t[i++] = a.y
  44191. }
  44192. return this
  44193. },
  44194. copyVector3sArray: function(e) {
  44195. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44196. var a = e[r];
  44197. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", r),
  44198. a = new n.Vector3),
  44199. t[i++] = a.x,
  44200. t[i++] = a.y,
  44201. t[i++] = a.z
  44202. }
  44203. return this
  44204. },
  44205. copyVector4sArray: function(e) {
  44206. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44207. var a = e[r];
  44208. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", r),
  44209. a = new n.Vector4),
  44210. t[i++] = a.x,
  44211. t[i++] = a.y,
  44212. t[i++] = a.z,
  44213. t[i++] = a.w
  44214. }
  44215. return this
  44216. },
  44217. set: function(e, t) {
  44218. return void 0 === t && (t = 0),
  44219. this.array.set(e, t),
  44220. this
  44221. },
  44222. getX: function(e) {
  44223. return this.array[e * this.itemSize]
  44224. },
  44225. setX: function(e, t) {
  44226. return this.array[e * this.itemSize] = t,
  44227. this
  44228. },
  44229. getY: function(e) {
  44230. return this.array[e * this.itemSize + 1]
  44231. },
  44232. setY: function(e, t) {
  44233. return this.array[e * this.itemSize + 1] = t,
  44234. this
  44235. },
  44236. getZ: function(e) {
  44237. return this.array[e * this.itemSize + 2]
  44238. },
  44239. setZ: function(e, t) {
  44240. return this.array[e * this.itemSize + 2] = t,
  44241. this
  44242. },
  44243. getW: function(e) {
  44244. return this.array[e * this.itemSize + 3]
  44245. },
  44246. setW: function(e, t) {
  44247. return this.array[e * this.itemSize + 3] = t,
  44248. this
  44249. },
  44250. setXY: function(e, t, i) {
  44251. return e *= this.itemSize,
  44252. this.array[e + 0] = t,
  44253. this.array[e + 1] = i,
  44254. this
  44255. },
  44256. setXYZ: function(e, t, i, n) {
  44257. return e *= this.itemSize,
  44258. this.array[e + 0] = t,
  44259. this.array[e + 1] = i,
  44260. this.array[e + 2] = n,
  44261. this
  44262. },
  44263. setXYZW: function(e, t, i, n, r) {
  44264. return e *= this.itemSize,
  44265. this.array[e + 0] = t,
  44266. this.array[e + 1] = i,
  44267. this.array[e + 2] = n,
  44268. this.array[e + 3] = r,
  44269. this
  44270. },
  44271. clone: function() {
  44272. return (new this.constructor).copy(this)
  44273. }
  44274. },
  44275. n.Int8Attribute = function(e, t) {
  44276. return new n.BufferAttribute(new Int8Array(e),t)
  44277. }
  44278. ,
  44279. n.Uint8Attribute = function(e, t) {
  44280. return new n.BufferAttribute(new Uint8Array(e),t)
  44281. }
  44282. ,
  44283. n.Uint8ClampedAttribute = function(e, t) {
  44284. return new n.BufferAttribute(new Uint8ClampedArray(e),t)
  44285. }
  44286. ,
  44287. n.Int16Attribute = function(e, t) {
  44288. return new n.BufferAttribute(new Int16Array(e),t)
  44289. }
  44290. ,
  44291. n.Uint16Attribute = function(e, t) {
  44292. return new n.BufferAttribute(new Uint16Array(e),t)
  44293. }
  44294. ;
  44295. n.Int32Attribute = function(e, t) {
  44296. return new n.BufferAttribute(new Int32Array(e),t)
  44297. }
  44298. ;
  44299. n.Uint32Attribute = function(e, t) {
  44300. return new n.BufferAttribute(new Uint32Array(e),t)
  44301. }
  44302. ,
  44303. n.Float32Attribute = function(e, t) {
  44304. return new n.BufferAttribute(new Float32Array(e),t)
  44305. }
  44306. ,
  44307. n.Float64Attribute = function(e, t) {
  44308. return new n.BufferAttribute(new Float64Array(e),t)
  44309. }
  44310. ,
  44311. n.DynamicBufferAttribute = function(e, t) {
  44312. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  44313. new n.BufferAttribute(e,t).setDynamic(!0)
  44314. }
  44315. ,
  44316. n.InstancedBufferAttribute = function(e, t, i) {
  44317. n.BufferAttribute.call(this, e, t),
  44318. this.meshPerAttribute = i || 1
  44319. }
  44320. ,
  44321. n.InstancedBufferAttribute.prototype = Object.create(n.BufferAttribute.prototype),
  44322. n.InstancedBufferAttribute.prototype.constructor = n.InstancedBufferAttribute,
  44323. n.InstancedBufferAttribute.prototype.copy = function(e) {
  44324. return n.BufferAttribute.prototype.copy.call(this, e),
  44325. this.meshPerAttribute = e.meshPerAttribute,
  44326. this
  44327. }
  44328. ,
  44329. n.InterleavedBuffer = function(e, t) {
  44330. this.uuid = n.Math.generateUUID(),
  44331. this.array = e,
  44332. this.stride = t,
  44333. this.dynamic = !1,
  44334. this.updateRange = {
  44335. offset: 0,
  44336. count: -1
  44337. },
  44338. this.version = 0
  44339. }
  44340. ,
  44341. n.InterleavedBuffer.prototype = {
  44342. constructor: n.InterleavedBuffer,
  44343. get length() {
  44344. return this.array.length
  44345. },
  44346. get count() {
  44347. return this.array.length / this.stride
  44348. },
  44349. set needsUpdate(e) {
  44350. e === !0 && this.version++
  44351. },
  44352. setDynamic: function(e) {
  44353. return this.dynamic = e,
  44354. this
  44355. },
  44356. copy: function(e) {
  44357. return this.array = new e.array.constructor(e.array),
  44358. this.stride = e.stride,
  44359. this.dynamic = e.dynamic,
  44360. this
  44361. },
  44362. copyAt: function(e, t, i) {
  44363. e *= this.stride,
  44364. i *= t.stride;
  44365. for (var n = 0, r = this.stride; n < r; n++)
  44366. this.array[e + n] = t.array[i + n];
  44367. return this
  44368. },
  44369. set: function(e, t) {
  44370. return void 0 === t && (t = 0),
  44371. this.array.set(e, t),
  44372. this
  44373. },
  44374. clone: function() {
  44375. return (new this.constructor).copy(this)
  44376. }
  44377. },
  44378. n.InstancedInterleavedBuffer = function(e, t, i) {
  44379. n.InterleavedBuffer.call(this, e, t),
  44380. this.meshPerAttribute = i || 1
  44381. }
  44382. ,
  44383. n.InstancedInterleavedBuffer.prototype = Object.create(n.InterleavedBuffer.prototype),
  44384. n.InstancedInterleavedBuffer.prototype.constructor = n.InstancedInterleavedBuffer,
  44385. n.InstancedInterleavedBuffer.prototype.copy = function(e) {
  44386. return n.InterleavedBuffer.prototype.copy.call(this, e),
  44387. this.meshPerAttribute = e.meshPerAttribute,
  44388. this
  44389. }
  44390. ,
  44391. n.InterleavedBufferAttribute = function(e, t, i) {
  44392. this.uuid = n.Math.generateUUID(),
  44393. this.data = e,
  44394. this.itemSize = t,
  44395. this.offset = i
  44396. }
  44397. ,
  44398. n.InterleavedBufferAttribute.prototype = {
  44399. constructor: n.InterleavedBufferAttribute,
  44400. get length() {
  44401. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  44402. this.array.length
  44403. },
  44404. get count() {
  44405. return this.data.count
  44406. },
  44407. setX: function(e, t) {
  44408. return this.data.array[e * this.data.stride + this.offset] = t,
  44409. this
  44410. },
  44411. setY: function(e, t) {
  44412. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  44413. this
  44414. },
  44415. setZ: function(e, t) {
  44416. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  44417. this
  44418. },
  44419. setW: function(e, t) {
  44420. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  44421. this
  44422. },
  44423. getX: function(e) {
  44424. return this.data.array[e * this.data.stride + this.offset]
  44425. },
  44426. getY: function(e) {
  44427. return this.data.array[e * this.data.stride + this.offset + 1]
  44428. },
  44429. getZ: function(e) {
  44430. return this.data.array[e * this.data.stride + this.offset + 2]
  44431. },
  44432. getW: function(e) {
  44433. return this.data.array[e * this.data.stride + this.offset + 3]
  44434. },
  44435. setXY: function(e, t, i) {
  44436. return e = e * this.data.stride + this.offset,
  44437. this.data.array[e + 0] = t,
  44438. this.data.array[e + 1] = i,
  44439. this
  44440. },
  44441. setXYZ: function(e, t, i, n) {
  44442. return e = e * this.data.stride + this.offset,
  44443. this.data.array[e + 0] = t,
  44444. this.data.array[e + 1] = i,
  44445. this.data.array[e + 2] = n,
  44446. this
  44447. },
  44448. setXYZW: function(e, t, i, n, r) {
  44449. return e = e * this.data.stride + this.offset,
  44450. this.data.array[e + 0] = t,
  44451. this.data.array[e + 1] = i,
  44452. this.data.array[e + 2] = n,
  44453. this.data.array[e + 3] = r,
  44454. this
  44455. }
  44456. },
  44457. n.Geometry = function() {
  44458. Object.defineProperty(this, "id", {
  44459. value: n.GeometryIdCount++
  44460. }),
  44461. this.uuid = n.Math.generateUUID(),
  44462. this.name = "",
  44463. this.type = "Geometry",
  44464. this.vertices = [],
  44465. this.colors = [],
  44466. this.faces = [],
  44467. this.faceVertexUvs = [[]],
  44468. this.morphTargets = [],
  44469. this.morphNormals = [],
  44470. this.skinWeights = [],
  44471. this.skinIndices = [],
  44472. this.lineDistances = [],
  44473. this.boundingBox = null,
  44474. this.boundingSphere = null,
  44475. this.verticesNeedUpdate = !1,
  44476. this.elementsNeedUpdate = !1,
  44477. this.uvsNeedUpdate = !1,
  44478. this.normalsNeedUpdate = !1,
  44479. this.colorsNeedUpdate = !1,
  44480. this.lineDistancesNeedUpdate = !1,
  44481. this.groupsNeedUpdate = !1
  44482. }
  44483. ,
  44484. n.Geometry.prototype = {
  44485. constructor: n.Geometry,
  44486. applyMatrix: function(e) {
  44487. for (var t = (new n.Matrix3).getNormalMatrix(e), i = 0, r = this.vertices.length; i < r; i++) {
  44488. var o = this.vertices[i];
  44489. o.applyMatrix4(e)
  44490. }
  44491. for (var i = 0, r = this.faces.length; i < r; i++) {
  44492. var a = this.faces[i];
  44493. a.normal.applyMatrix3(t).normalize();
  44494. for (var s = 0, l = a.vertexNormals.length; s < l; s++)
  44495. a.vertexNormals[s].applyMatrix3(t).normalize()
  44496. }
  44497. return null !== this.boundingBox && this.computeBoundingBox(),
  44498. null !== this.boundingSphere && this.computeBoundingSphere(),
  44499. this.verticesNeedUpdate = !0,
  44500. this.normalsNeedUpdate = !0,
  44501. this
  44502. },
  44503. rotateX: function() {
  44504. var e;
  44505. return function(t) {
  44506. return void 0 === e && (e = new n.Matrix4),
  44507. e.makeRotationX(t),
  44508. this.applyMatrix(e),
  44509. this
  44510. }
  44511. }(),
  44512. rotateY: function() {
  44513. var e;
  44514. return function(t) {
  44515. return void 0 === e && (e = new n.Matrix4),
  44516. e.makeRotationY(t),
  44517. this.applyMatrix(e),
  44518. this
  44519. }
  44520. }(),
  44521. rotateZ: function() {
  44522. var e;
  44523. return function(t) {
  44524. return void 0 === e && (e = new n.Matrix4),
  44525. e.makeRotationZ(t),
  44526. this.applyMatrix(e),
  44527. this
  44528. }
  44529. }(),
  44530. translate: function() {
  44531. var e;
  44532. return function(t, i, r) {
  44533. return void 0 === e && (e = new n.Matrix4),
  44534. e.makeTranslation(t, i, r),
  44535. this.applyMatrix(e),
  44536. this
  44537. }
  44538. }(),
  44539. scale: function() {
  44540. var e;
  44541. return function(t, i, r) {
  44542. return void 0 === e && (e = new n.Matrix4),
  44543. e.makeScale(t, i, r),
  44544. this.applyMatrix(e),
  44545. this
  44546. }
  44547. }(),
  44548. lookAt: function() {
  44549. var e;
  44550. return function(t) {
  44551. void 0 === e && (e = new n.Object3D),
  44552. e.lookAt(t),
  44553. e.updateMatrix(),
  44554. this.applyMatrix(e.matrix)
  44555. }
  44556. }(),
  44557. fromBufferGeometry: function(e) {
  44558. function t(e, t, r, o) {
  44559. var a = void 0 !== s ? [u[e].clone(), u[t].clone(), u[r].clone()] : []
  44560. , f = void 0 !== l ? [i.colors[e].clone(), i.colors[t].clone(), i.colors[r].clone()] : []
  44561. , g = new n.Face3(e,t,r,a,f,o);
  44562. i.faces.push(g),
  44563. void 0 !== c && i.faceVertexUvs[0].push([d[e].clone(), d[t].clone(), d[r].clone()]),
  44564. void 0 !== h && i.faceVertexUvs[1].push([p[e].clone(), p[t].clone(), p[r].clone()])
  44565. }
  44566. var i = this
  44567. , r = null !== e.index ? e.index.array : void 0
  44568. , o = e.attributes
  44569. , a = o.position.array
  44570. , s = void 0 !== o.normal ? o.normal.array : void 0
  44571. , l = void 0 !== o.color ? o.color.array : void 0
  44572. , c = void 0 !== o.uv ? o.uv.array : void 0
  44573. , h = void 0 !== o.uv2 ? o.uv2.array : void 0;
  44574. void 0 !== h && (this.faceVertexUvs[1] = []);
  44575. for (var u = [], d = [], p = [], f = 0, g = 0; f < a.length; f += 3,
  44576. g += 2)
  44577. i.vertices.push(new n.Vector3(a[f],a[f + 1],a[f + 2])),
  44578. void 0 !== s && u.push(new n.Vector3(s[f],s[f + 1],s[f + 2])),
  44579. void 0 !== l && i.colors.push(new n.Color(l[f],l[f + 1],l[f + 2])),
  44580. void 0 !== c && d.push(new n.Vector2(c[g],c[g + 1])),
  44581. void 0 !== h && p.push(new n.Vector2(h[g],h[g + 1]));
  44582. if (void 0 !== r) {
  44583. var m = e.groups;
  44584. if (m.length > 0)
  44585. for (var f = 0; f < m.length; f++)
  44586. for (var v = m[f], A = v.start, y = v.count, g = A, C = A + y; g < C; g += 3)
  44587. t(r[g], r[g + 1], r[g + 2], v.materialIndex);
  44588. else
  44589. for (var f = 0; f < r.length; f += 3)
  44590. t(r[f], r[f + 1], r[f + 2])
  44591. } else
  44592. for (var f = 0; f < a.length / 3; f += 3)
  44593. t(f, f + 1, f + 2);
  44594. return this.computeFaceNormals(),
  44595. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  44596. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  44597. this
  44598. },
  44599. center: function() {
  44600. this.computeBoundingBox();
  44601. var e = this.boundingBox.center().negate();
  44602. return this.translate(e.x, e.y, e.z),
  44603. e
  44604. },
  44605. normalize: function() {
  44606. this.computeBoundingSphere();
  44607. var e = this.boundingSphere.center
  44608. , t = this.boundingSphere.radius
  44609. , i = 0 === t ? 1 : 1 / t
  44610. , r = new n.Matrix4;
  44611. return r.set(i, 0, 0, -i * e.x, 0, i, 0, -i * e.y, 0, 0, i, -i * e.z, 0, 0, 0, 1),
  44612. this.applyMatrix(r),
  44613. this
  44614. },
  44615. computeFaceNormals: function() {
  44616. for (var e = new n.Vector3, t = new n.Vector3, i = 0, r = this.faces.length; i < r; i++) {
  44617. var o = this.faces[i]
  44618. , a = this.vertices[o.a]
  44619. , s = this.vertices[o.b]
  44620. , l = this.vertices[o.c];
  44621. e.subVectors(l, s),
  44622. t.subVectors(a, s),
  44623. e.cross(t),
  44624. e.normalize(),
  44625. o.normal.copy(e)
  44626. }
  44627. },
  44628. computeVertexNormals: function(e) {
  44629. void 0 === e && (e = !0);
  44630. var t, i, r, o, a, s;
  44631. for (s = new Array(this.vertices.length),
  44632. t = 0,
  44633. i = this.vertices.length; t < i; t++)
  44634. s[t] = new n.Vector3;
  44635. if (e) {
  44636. var l, c, h, u = new n.Vector3, d = new n.Vector3;
  44637. for (r = 0,
  44638. o = this.faces.length; r < o; r++)
  44639. a = this.faces[r],
  44640. l = this.vertices[a.a],
  44641. c = this.vertices[a.b],
  44642. h = this.vertices[a.c],
  44643. u.subVectors(h, c),
  44644. d.subVectors(l, c),
  44645. u.cross(d),
  44646. s[a.a].add(u),
  44647. s[a.b].add(u),
  44648. s[a.c].add(u)
  44649. } else
  44650. for (r = 0,
  44651. o = this.faces.length; r < o; r++)
  44652. a = this.faces[r],
  44653. s[a.a].add(a.normal),
  44654. s[a.b].add(a.normal),
  44655. s[a.c].add(a.normal);
  44656. for (t = 0,
  44657. i = this.vertices.length; t < i; t++)
  44658. s[t].normalize();
  44659. for (r = 0,
  44660. o = this.faces.length; r < o; r++) {
  44661. a = this.faces[r];
  44662. var p = a.vertexNormals;
  44663. 3 === p.length ? (p[0].copy(s[a.a]),
  44664. p[1].copy(s[a.b]),
  44665. p[2].copy(s[a.c])) : (p[0] = s[a.a].clone(),
  44666. p[1] = s[a.b].clone(),
  44667. p[2] = s[a.c].clone())
  44668. }
  44669. this.faces.length > 0 && (this.normalsNeedUpdate = !0)
  44670. },
  44671. computeMorphNormals: function() {
  44672. var e, t, i, r, o;
  44673. for (i = 0,
  44674. r = this.faces.length; i < r; i++)
  44675. for (o = this.faces[i],
  44676. o.__originalFaceNormal ? o.__originalFaceNormal.copy(o.normal) : o.__originalFaceNormal = o.normal.clone(),
  44677. o.__originalVertexNormals || (o.__originalVertexNormals = []),
  44678. e = 0,
  44679. t = o.vertexNormals.length; e < t; e++)
  44680. o.__originalVertexNormals[e] ? o.__originalVertexNormals[e].copy(o.vertexNormals[e]) : o.__originalVertexNormals[e] = o.vertexNormals[e].clone();
  44681. var a = new n.Geometry;
  44682. for (a.faces = this.faces,
  44683. e = 0,
  44684. t = this.morphTargets.length; e < t; e++) {
  44685. if (!this.morphNormals[e]) {
  44686. this.morphNormals[e] = {},
  44687. this.morphNormals[e].faceNormals = [],
  44688. this.morphNormals[e].vertexNormals = [];
  44689. var s, l, c = this.morphNormals[e].faceNormals, h = this.morphNormals[e].vertexNormals;
  44690. for (i = 0,
  44691. r = this.faces.length; i < r; i++)
  44692. s = new n.Vector3,
  44693. l = {
  44694. a: new n.Vector3,
  44695. b: new n.Vector3,
  44696. c: new n.Vector3
  44697. },
  44698. c.push(s),
  44699. h.push(l)
  44700. }
  44701. var u = this.morphNormals[e];
  44702. a.vertices = this.morphTargets[e].vertices,
  44703. a.computeFaceNormals(),
  44704. a.computeVertexNormals();
  44705. var s, l;
  44706. for (i = 0,
  44707. r = this.faces.length; i < r; i++)
  44708. o = this.faces[i],
  44709. s = u.faceNormals[i],
  44710. l = u.vertexNormals[i],
  44711. s.copy(o.normal),
  44712. l.a.copy(o.vertexNormals[0]),
  44713. l.b.copy(o.vertexNormals[1]),
  44714. l.c.copy(o.vertexNormals[2])
  44715. }
  44716. for (i = 0,
  44717. r = this.faces.length; i < r; i++)
  44718. o = this.faces[i],
  44719. o.normal = o.__originalFaceNormal,
  44720. o.vertexNormals = o.__originalVertexNormals
  44721. },
  44722. computeTangents: function() {
  44723. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  44724. },
  44725. computeLineDistances: function() {
  44726. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  44727. i > 0 && (e += t[i].distanceTo(t[i - 1])),
  44728. this.lineDistances[i] = e
  44729. },
  44730. computeBoundingBox: function() {
  44731. null === this.boundingBox && (this.boundingBox = new n.Box3),
  44732. this.boundingBox.setFromPoints(this.vertices)
  44733. },
  44734. computeBoundingSphere: function() {
  44735. null === this.boundingSphere && (this.boundingSphere = new n.Sphere),
  44736. this.boundingSphere.setFromPoints(this.vertices)
  44737. },
  44738. merge: function(e, t, i) {
  44739. if (e instanceof n.Geometry == !1)
  44740. return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e);
  44741. var r, o = this.vertices.length, a = this.vertices, s = e.vertices, l = this.faces, c = e.faces, h = this.faceVertexUvs[0], u = e.faceVertexUvs[0];
  44742. void 0 === i && (i = 0),
  44743. void 0 !== t && (r = (new n.Matrix3).getNormalMatrix(t));
  44744. for (var d = 0, p = s.length; d < p; d++) {
  44745. var f = s[d]
  44746. , g = f.clone();
  44747. void 0 !== t && g.applyMatrix4(t),
  44748. a.push(g)
  44749. }
  44750. for (d = 0,
  44751. p = c.length; d < p; d++) {
  44752. var m, v, A, y = c[d], C = y.vertexNormals, I = y.vertexColors;
  44753. m = new n.Face3(y.a + o,y.b + o,y.c + o),
  44754. m.normal.copy(y.normal),
  44755. void 0 !== r && m.normal.applyMatrix3(r).normalize();
  44756. for (var E = 0, b = C.length; E < b; E++)
  44757. v = C[E].clone(),
  44758. void 0 !== r && v.applyMatrix3(r).normalize(),
  44759. m.vertexNormals.push(v);
  44760. m.color.copy(y.color);
  44761. for (var E = 0, b = I.length; E < b; E++)
  44762. A = I[E],
  44763. m.vertexColors.push(A.clone());
  44764. m.materialIndex = y.materialIndex + i,
  44765. l.push(m)
  44766. }
  44767. for (d = 0,
  44768. p = u.length; d < p; d++) {
  44769. var w = u[d]
  44770. , _ = [];
  44771. if (void 0 !== w) {
  44772. for (var E = 0, b = w.length; E < b; E++)
  44773. _.push(w[E].clone());
  44774. h.push(_)
  44775. }
  44776. }
  44777. },
  44778. mergeMesh: function(e) {
  44779. return e instanceof n.Mesh == !1 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  44780. void this.merge(e.geometry, e.matrix))
  44781. },
  44782. mergeVertices: function() {
  44783. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = 4, d = Math.pow(10, u);
  44784. for (i = 0,
  44785. n = this.vertices.length; i < n; i++)
  44786. e = this.vertices[i],
  44787. t = Math.round(e.x * d) + "_" + Math.round(e.y * d) + "_" + Math.round(e.z * d),
  44788. void 0 === l[t] ? (l[t] = i,
  44789. c.push(this.vertices[i]),
  44790. h[i] = c.length - 1) : h[i] = h[l[t]];
  44791. var p = [];
  44792. for (i = 0,
  44793. n = this.faces.length; i < n; i++) {
  44794. r = this.faces[i],
  44795. r.a = h[r.a],
  44796. r.b = h[r.b],
  44797. r.c = h[r.c],
  44798. o = [r.a, r.b, r.c];
  44799. for (var f = -1, g = 0; g < 3; g++)
  44800. if (o[g] === o[(g + 1) % 3]) {
  44801. f = g,
  44802. p.push(i);
  44803. break
  44804. }
  44805. }
  44806. for (i = p.length - 1; i >= 0; i--) {
  44807. var m = p[i];
  44808. for (this.faces.splice(m, 1),
  44809. a = 0,
  44810. s = this.faceVertexUvs.length; a < s; a++)
  44811. this.faceVertexUvs[a].splice(m, 1)
  44812. }
  44813. var v = this.vertices.length - c.length;
  44814. return this.vertices = c,
  44815. v
  44816. },
  44817. sortFacesByMaterialIndex: function() {
  44818. function e(e, t) {
  44819. return e.materialIndex - t.materialIndex
  44820. }
  44821. for (var t = this.faces, i = t.length, n = 0; n < i; n++)
  44822. t[n]._id = n;
  44823. t.sort(e);
  44824. var r, o, a = this.faceVertexUvs[0], s = this.faceVertexUvs[1];
  44825. a && a.length === i && (r = []),
  44826. s && s.length === i && (o = []);
  44827. for (var n = 0; n < i; n++) {
  44828. var l = t[n]._id;
  44829. r && r.push(a[l]),
  44830. o && o.push(s[l])
  44831. }
  44832. r && (this.faceVertexUvs[0] = r),
  44833. o && (this.faceVertexUvs[1] = o)
  44834. },
  44835. toJSON: function() {
  44836. function e(e, t, i) {
  44837. return i ? e | 1 << t : e & ~(1 << t)
  44838. }
  44839. function t(e) {
  44840. var t = e.x.toString() + e.y.toString() + e.z.toString();
  44841. return void 0 !== d[t] ? d[t] : (d[t] = u.length / 3,
  44842. u.push(e.x, e.y, e.z),
  44843. d[t])
  44844. }
  44845. function i(e) {
  44846. var t = e.r.toString() + e.g.toString() + e.b.toString();
  44847. return void 0 !== f[t] ? f[t] : (f[t] = p.length,
  44848. p.push(e.getHex()),
  44849. f[t])
  44850. }
  44851. function n(e) {
  44852. var t = e.x.toString() + e.y.toString();
  44853. return void 0 !== m[t] ? m[t] : (m[t] = g.length / 2,
  44854. g.push(e.x, e.y),
  44855. m[t])
  44856. }
  44857. var r = {
  44858. metadata: {
  44859. version: 4.4,
  44860. type: "Geometry",
  44861. generator: "Geometry.toJSON"
  44862. }
  44863. };
  44864. if (r.uuid = this.uuid,
  44865. r.type = this.type,
  44866. "" !== this.name && (r.name = this.name),
  44867. void 0 !== this.parameters) {
  44868. var o = this.parameters;
  44869. for (var a in o)
  44870. void 0 !== o[a] && (r[a] = o[a]);
  44871. return r
  44872. }
  44873. for (var s = [], l = 0; l < this.vertices.length; l++) {
  44874. var c = this.vertices[l];
  44875. s.push(c.x, c.y, c.z)
  44876. }
  44877. for (var h = [], u = [], d = {}, p = [], f = {}, g = [], m = {}, l = 0; l < this.faces.length; l++) {
  44878. var v = this.faces[l]
  44879. , A = !0
  44880. , y = !1
  44881. , C = void 0 !== this.faceVertexUvs[0][l]
  44882. , I = v.normal.length() > 0
  44883. , E = v.vertexNormals.length > 0
  44884. , b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  44885. , w = v.vertexColors.length > 0
  44886. , _ = 0;
  44887. if (_ = e(_, 0, 0),
  44888. _ = e(_, 1, A),
  44889. _ = e(_, 2, y),
  44890. _ = e(_, 3, C),
  44891. _ = e(_, 4, I),
  44892. _ = e(_, 5, E),
  44893. _ = e(_, 6, b),
  44894. _ = e(_, 7, w),
  44895. h.push(_),
  44896. h.push(v.a, v.b, v.c),
  44897. h.push(v.materialIndex),
  44898. C) {
  44899. var T = this.faceVertexUvs[0][l];
  44900. h.push(n(T[0]), n(T[1]), n(T[2]))
  44901. }
  44902. if (I && h.push(t(v.normal)),
  44903. E) {
  44904. var x = v.vertexNormals;
  44905. h.push(t(x[0]), t(x[1]), t(x[2]))
  44906. }
  44907. if (b && h.push(i(v.color)),
  44908. w) {
  44909. var S = v.vertexColors;
  44910. h.push(i(S[0]), i(S[1]), i(S[2]))
  44911. }
  44912. }
  44913. return r.data = {},
  44914. r.data.vertices = s,
  44915. r.data.normals = u,
  44916. p.length > 0 && (r.data.colors = p),
  44917. g.length > 0 && (r.data.uvs = [g]),
  44918. r.data.faces = h,
  44919. r
  44920. },
  44921. clone: function() {
  44922. return (new n.Geometry).copy(this)
  44923. },
  44924. copy: function(e) {
  44925. this.vertices = [],
  44926. this.faces = [],
  44927. this.faceVertexUvs = [[]];
  44928. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  44929. this.vertices.push(t[i].clone());
  44930. for (var r = e.faces, i = 0, n = r.length; i < n; i++)
  44931. this.faces.push(r[i].clone());
  44932. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  44933. var o = e.faceVertexUvs[i];
  44934. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  44935. for (var a = 0, s = o.length; a < s; a++) {
  44936. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  44937. var d = l[h];
  44938. c.push(d.clone())
  44939. }
  44940. this.faceVertexUvs[i].push(c)
  44941. }
  44942. }
  44943. return this
  44944. },
  44945. dispose: function() {
  44946. this.dispatchEvent({
  44947. type: "dispose"
  44948. })
  44949. }
  44950. },
  44951. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  44952. n.GeometryIdCount = 0,
  44953. n.DirectGeometry = function() {
  44954. Object.defineProperty(this, "id", {
  44955. value: n.GeometryIdCount++
  44956. }),
  44957. this.uuid = n.Math.generateUUID(),
  44958. this.name = "",
  44959. this.type = "DirectGeometry",
  44960. this.indices = [],
  44961. this.vertices = [],
  44962. this.normals = [],
  44963. this.colors = [],
  44964. this.uvs = [],
  44965. this.uvs2 = [],
  44966. this.groups = [],
  44967. this.morphTargets = {},
  44968. this.skinWeights = [],
  44969. this.skinIndices = [],
  44970. this.boundingBox = null,
  44971. this.boundingSphere = null,
  44972. this.verticesNeedUpdate = !1,
  44973. this.normalsNeedUpdate = !1,
  44974. this.colorsNeedUpdate = !1,
  44975. this.uvsNeedUpdate = !1,
  44976. this.groupsNeedUpdate = !1
  44977. }
  44978. ,
  44979. n.DirectGeometry.prototype = {
  44980. constructor: n.DirectGeometry,
  44981. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  44982. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  44983. computeFaceNormals: function() {
  44984. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  44985. },
  44986. computeVertexNormals: function() {
  44987. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  44988. },
  44989. computeGroups: function(e) {
  44990. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  44991. var a = r[o];
  44992. a.materialIndex !== i && (i = a.materialIndex,
  44993. void 0 !== t && (t.count = 3 * o - t.start,
  44994. n.push(t)),
  44995. t = {
  44996. start: 3 * o,
  44997. materialIndex: i
  44998. })
  44999. }
  45000. void 0 !== t && (t.count = 3 * o - t.start,
  45001. n.push(t)),
  45002. this.groups = n
  45003. },
  45004. fromGeometry: function(e) {
  45005. var t, i = e.faces, r = e.vertices, o = e.faceVertexUvs, a = o[0] && o[0].length > 0, s = o[1] && o[1].length > 0, l = e.morphTargets, c = l.length;
  45006. if (c > 0) {
  45007. t = [];
  45008. for (var h = 0; h < c; h++)
  45009. t[h] = [];
  45010. this.morphTargets.position = t
  45011. }
  45012. var u, d = e.morphNormals, p = d.length;
  45013. if (p > 0) {
  45014. u = [];
  45015. for (var h = 0; h < p; h++)
  45016. u[h] = [];
  45017. this.morphTargets.normal = u
  45018. }
  45019. for (var f = e.skinIndices, g = e.skinWeights, m = f.length === r.length, v = g.length === r.length, h = 0; h < i.length; h++) {
  45020. var A = i[h];
  45021. this.vertices.push(r[A.a], r[A.b], r[A.c]);
  45022. var y = A.vertexNormals;
  45023. if (3 === y.length)
  45024. this.normals.push(y[0], y[1], y[2]);
  45025. else {
  45026. var C = A.normal;
  45027. this.normals.push(C, C, C)
  45028. }
  45029. var I = A.vertexColors;
  45030. if (3 === I.length)
  45031. this.colors.push(I[0], I[1], I[2]);
  45032. else {
  45033. var E = A.color;
  45034. this.colors.push(E, E, E)
  45035. }
  45036. if (a === !0) {
  45037. var b = o[0][h];
  45038. void 0 !== b ? this.uvs.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", h),
  45039. this.uvs.push(new n.Vector2, new n.Vector2, new n.Vector2))
  45040. }
  45041. if (s === !0) {
  45042. var b = o[1][h];
  45043. void 0 !== b ? this.uvs2.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", h),
  45044. this.uvs2.push(new n.Vector2, new n.Vector2, new n.Vector2))
  45045. }
  45046. for (var w = 0; w < c; w++) {
  45047. var _ = l[w].vertices;
  45048. t[w].push(_[A.a], _[A.b], _[A.c])
  45049. }
  45050. for (var w = 0; w < p; w++) {
  45051. var T = d[w].vertexNormals[h];
  45052. u[w].push(T.a, T.b, T.c)
  45053. }
  45054. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]),
  45055. v && this.skinWeights.push(g[A.a], g[A.b], g[A.c])
  45056. }
  45057. return this.computeGroups(e),
  45058. this.verticesNeedUpdate = e.verticesNeedUpdate,
  45059. this.normalsNeedUpdate = e.normalsNeedUpdate,
  45060. this.colorsNeedUpdate = e.colorsNeedUpdate,
  45061. this.uvsNeedUpdate = e.uvsNeedUpdate,
  45062. this.groupsNeedUpdate = e.groupsNeedUpdate,
  45063. this
  45064. },
  45065. dispose: function() {
  45066. this.dispatchEvent({
  45067. type: "dispose"
  45068. })
  45069. }
  45070. },
  45071. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  45072. n.BufferGeometry = function() {
  45073. Object.defineProperty(this, "id", {
  45074. value: n.GeometryIdCount++
  45075. }),
  45076. this.uuid = n.Math.generateUUID(),
  45077. this.name = "",
  45078. this.type = "BufferGeometry",
  45079. this.index = null,
  45080. this.attributes = {},
  45081. this.morphAttributes = {},
  45082. this.groups = [],
  45083. this.boundingBox = null,
  45084. this.boundingSphere = null,
  45085. this.drawRange = {
  45086. start: 0,
  45087. count: 1 / 0
  45088. }
  45089. }
  45090. ,
  45091. n.BufferGeometry.prototype = {
  45092. constructor: n.BufferGeometry,
  45093. getIndex: function() {
  45094. return this.index
  45095. },
  45096. setIndex: function(e) {
  45097. this.index = e
  45098. },
  45099. addAttribute: function(e, t) {
  45100. return t instanceof n.BufferAttribute == !1 && t instanceof n.InterleavedBufferAttribute == !1 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  45101. void this.addAttribute(e, new n.BufferAttribute(arguments[1],arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  45102. void this.setIndex(t)) : (this.attributes[e] = t,
  45103. this)
  45104. },
  45105. getAttribute: function(e) {
  45106. return this.attributes[e]
  45107. },
  45108. removeAttribute: function(e) {
  45109. return delete this.attributes[e],
  45110. this
  45111. },
  45112. addGroup: function(e, t, i) {
  45113. this.groups.push({
  45114. start: e,
  45115. count: t,
  45116. materialIndex: void 0 !== i ? i : 0
  45117. })
  45118. },
  45119. clearGroups: function() {
  45120. this.groups = []
  45121. },
  45122. setDrawRange: function(e, t) {
  45123. this.drawRange.start = e,
  45124. this.drawRange.count = t
  45125. },
  45126. applyMatrix: function(e) {
  45127. var t = this.attributes.position;
  45128. void 0 !== t && (e.applyToVector3Array(t.array),
  45129. t.needsUpdate = !0);
  45130. var i = this.attributes.normal;
  45131. if (void 0 !== i) {
  45132. var r = (new n.Matrix3).getNormalMatrix(e);
  45133. r.applyToVector3Array(i.array),
  45134. i.needsUpdate = !0
  45135. }
  45136. return null !== this.boundingBox && this.computeBoundingBox(),
  45137. null !== this.boundingSphere && this.computeBoundingSphere(),
  45138. this
  45139. },
  45140. rotateX: function() {
  45141. var e;
  45142. return function(t) {
  45143. return void 0 === e && (e = new n.Matrix4),
  45144. e.makeRotationX(t),
  45145. this.applyMatrix(e),
  45146. this
  45147. }
  45148. }(),
  45149. rotateY: function() {
  45150. var e;
  45151. return function(t) {
  45152. return void 0 === e && (e = new n.Matrix4),
  45153. e.makeRotationY(t),
  45154. this.applyMatrix(e),
  45155. this
  45156. }
  45157. }(),
  45158. rotateZ: function() {
  45159. var e;
  45160. return function(t) {
  45161. return void 0 === e && (e = new n.Matrix4),
  45162. e.makeRotationZ(t),
  45163. this.applyMatrix(e),
  45164. this
  45165. }
  45166. }(),
  45167. translate: function() {
  45168. var e;
  45169. return function(t, i, r) {
  45170. return void 0 === e && (e = new n.Matrix4),
  45171. e.makeTranslation(t, i, r),
  45172. this.applyMatrix(e),
  45173. this
  45174. }
  45175. }(),
  45176. scale: function() {
  45177. var e;
  45178. return function(t, i, r) {
  45179. return void 0 === e && (e = new n.Matrix4),
  45180. e.makeScale(t, i, r),
  45181. this.applyMatrix(e),
  45182. this
  45183. }
  45184. }(),
  45185. lookAt: function() {
  45186. var e;
  45187. return function(t) {
  45188. void 0 === e && (e = new n.Object3D),
  45189. e.lookAt(t),
  45190. e.updateMatrix(),
  45191. this.applyMatrix(e.matrix)
  45192. }
  45193. }(),
  45194. center: function() {
  45195. this.computeBoundingBox();
  45196. var e = this.boundingBox.center().negate();
  45197. return this.translate(e.x, e.y, e.z),
  45198. e
  45199. },
  45200. setFromObject: function(e) {
  45201. var t = e.geometry;
  45202. if (e instanceof n.Points || e instanceof n.Line) {
  45203. var i = new n.Float32Attribute(3 * t.vertices.length,3)
  45204. , r = new n.Float32Attribute(3 * t.colors.length,3);
  45205. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  45206. this.addAttribute("color", r.copyColorsArray(t.colors)),
  45207. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  45208. var o = new n.Float32Attribute(t.lineDistances.length,1);
  45209. this.addAttribute("lineDistance", o.copyArray(t.lineDistances))
  45210. }
  45211. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  45212. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  45213. } else
  45214. e instanceof n.Mesh && t instanceof n.Geometry && this.fromGeometry(t);
  45215. return this
  45216. },
  45217. updateFromObject: function(e) {
  45218. var t = e.geometry;
  45219. if (e instanceof n.Mesh) {
  45220. var i = t.__directGeometry;
  45221. if (void 0 === i)
  45222. return this.fromGeometry(t);
  45223. i.verticesNeedUpdate = t.verticesNeedUpdate,
  45224. i.normalsNeedUpdate = t.normalsNeedUpdate,
  45225. i.colorsNeedUpdate = t.colorsNeedUpdate,
  45226. i.uvsNeedUpdate = t.uvsNeedUpdate,
  45227. i.groupsNeedUpdate = t.groupsNeedUpdate,
  45228. t.verticesNeedUpdate = !1,
  45229. t.normalsNeedUpdate = !1,
  45230. t.colorsNeedUpdate = !1,
  45231. t.uvsNeedUpdate = !1,
  45232. t.groupsNeedUpdate = !1,
  45233. t = i
  45234. }
  45235. if (t.verticesNeedUpdate === !0) {
  45236. var r = this.attributes.position;
  45237. void 0 !== r && (r.copyVector3sArray(t.vertices),
  45238. r.needsUpdate = !0),
  45239. t.verticesNeedUpdate = !1
  45240. }
  45241. if (t.normalsNeedUpdate === !0) {
  45242. var r = this.attributes.normal;
  45243. void 0 !== r && (r.copyVector3sArray(t.normals),
  45244. r.needsUpdate = !0),
  45245. t.normalsNeedUpdate = !1
  45246. }
  45247. if (t.colorsNeedUpdate === !0) {
  45248. var r = this.attributes.color;
  45249. void 0 !== r && (r.copyColorsArray(t.colors),
  45250. r.needsUpdate = !0),
  45251. t.colorsNeedUpdate = !1
  45252. }
  45253. if (t.uvsNeedUpdate) {
  45254. var r = this.attributes.uv;
  45255. void 0 !== r && (r.copyVector2sArray(t.uvs),
  45256. r.needsUpdate = !0),
  45257. t.uvsNeedUpdate = !1
  45258. }
  45259. if (t.lineDistancesNeedUpdate) {
  45260. var r = this.attributes.lineDistance;
  45261. void 0 !== r && (r.copyArray(t.lineDistances),
  45262. r.needsUpdate = !0),
  45263. t.lineDistancesNeedUpdate = !1
  45264. }
  45265. return t.groupsNeedUpdate && (t.computeGroups(e.geometry),
  45266. this.groups = t.groups,
  45267. t.groupsNeedUpdate = !1),
  45268. this
  45269. },
  45270. fromGeometry: function(e) {
  45271. return e.__directGeometry = (new n.DirectGeometry).fromGeometry(e),
  45272. this.fromDirectGeometry(e.__directGeometry)
  45273. },
  45274. fromDirectGeometry: function(e) {
  45275. var t = new Float32Array(3 * e.vertices.length);
  45276. if (this.addAttribute("position", new n.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  45277. e.normals.length > 0) {
  45278. var i = new Float32Array(3 * e.normals.length);
  45279. this.addAttribute("normal", new n.BufferAttribute(i,3).copyVector3sArray(e.normals))
  45280. }
  45281. if (e.colors.length > 0) {
  45282. var r = new Float32Array(3 * e.colors.length);
  45283. this.addAttribute("color", new n.BufferAttribute(r,3).copyColorsArray(e.colors))
  45284. }
  45285. if (e.uvs.length > 0) {
  45286. var o = new Float32Array(2 * e.uvs.length);
  45287. this.addAttribute("uv", new n.BufferAttribute(o,2).copyVector2sArray(e.uvs))
  45288. }
  45289. if (e.uvs2.length > 0) {
  45290. var a = new Float32Array(2 * e.uvs2.length);
  45291. this.addAttribute("uv2", new n.BufferAttribute(a,2).copyVector2sArray(e.uvs2))
  45292. }
  45293. if (e.indices.length > 0) {
  45294. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array
  45295. , l = new s(3 * e.indices.length);
  45296. this.setIndex(new n.BufferAttribute(l,1).copyIndicesArray(e.indices))
  45297. }
  45298. this.groups = e.groups;
  45299. for (var c in e.morphTargets) {
  45300. for (var h = [], u = e.morphTargets[c], d = 0, p = u.length; d < p; d++) {
  45301. var f = u[d]
  45302. , g = new n.Float32Attribute(3 * f.length,3);
  45303. h.push(g.copyVector3sArray(f))
  45304. }
  45305. this.morphAttributes[c] = h
  45306. }
  45307. if (e.skinIndices.length > 0) {
  45308. var m = new n.Float32Attribute(4 * e.skinIndices.length,4);
  45309. this.addAttribute("skinIndex", m.copyVector4sArray(e.skinIndices))
  45310. }
  45311. if (e.skinWeights.length > 0) {
  45312. var v = new n.Float32Attribute(4 * e.skinWeights.length,4);
  45313. this.addAttribute("skinWeight", v.copyVector4sArray(e.skinWeights))
  45314. }
  45315. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  45316. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  45317. this
  45318. },
  45319. computeBoundingBox: function() {
  45320. new n.Vector3;
  45321. return function() {
  45322. null === this.boundingBox && (this.boundingBox = new n.Box3);
  45323. var e = this.attributes.position.array;
  45324. e && this.boundingBox.setFromArray(e),
  45325. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  45326. this.boundingBox.max.set(0, 0, 0)),
  45327. (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)
  45328. }
  45329. }(),
  45330. computeBoundingSphere: function() {
  45331. var e = new n.Box3
  45332. , t = new n.Vector3;
  45333. return function() {
  45334. null === this.boundingSphere && (this.boundingSphere = new n.Sphere);
  45335. var i = this.attributes.position.array;
  45336. if (i) {
  45337. var r = this.boundingSphere.center;
  45338. e.setFromArray(i),
  45339. e.center(r);
  45340. for (var o = 0, a = 0, s = i.length; a < s; a += 3)
  45341. t.fromArray(i, a),
  45342. o = Math.max(o, r.distanceToSquared(t));
  45343. this.boundingSphere.radius = Math.sqrt(o),
  45344. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  45345. }
  45346. }
  45347. }(),
  45348. computeFaceNormals: function() {},
  45349. computeVertexNormals: function() {
  45350. var e = this.index
  45351. , t = this.attributes
  45352. , i = this.groups;
  45353. if (t.position) {
  45354. var r = t.position.array;
  45355. if (void 0 === t.normal)
  45356. this.addAttribute("normal", new n.BufferAttribute(new Float32Array(r.length),3));
  45357. else
  45358. for (var o = t.normal.array, a = 0, s = o.length; a < s; a++)
  45359. o[a] = 0;
  45360. var l, c, h, u = t.normal.array, d = new n.Vector3, p = new n.Vector3, f = new n.Vector3, g = new n.Vector3, m = new n.Vector3;
  45361. if (e) {
  45362. var v = e.array;
  45363. 0 === i.length && this.addGroup(0, v.length);
  45364. for (var A = 0, y = i.length; A < y; ++A)
  45365. for (var C = i[A], I = C.start, E = C.count, a = I, s = I + E; a < s; a += 3)
  45366. l = 3 * v[a + 0],
  45367. c = 3 * v[a + 1],
  45368. h = 3 * v[a + 2],
  45369. d.fromArray(r, l),
  45370. p.fromArray(r, c),
  45371. f.fromArray(r, h),
  45372. g.subVectors(f, p),
  45373. m.subVectors(d, p),
  45374. g.cross(m),
  45375. u[l] += g.x,
  45376. u[l + 1] += g.y,
  45377. u[l + 2] += g.z,
  45378. u[c] += g.x,
  45379. u[c + 1] += g.y,
  45380. u[c + 2] += g.z,
  45381. u[h] += g.x,
  45382. u[h + 1] += g.y,
  45383. u[h + 2] += g.z
  45384. } else
  45385. for (var a = 0, s = r.length; a < s; a += 9)
  45386. d.fromArray(r, a),
  45387. p.fromArray(r, a + 3),
  45388. f.fromArray(r, a + 6),
  45389. g.subVectors(f, p),
  45390. m.subVectors(d, p),
  45391. g.cross(m),
  45392. u[a] = g.x,
  45393. u[a + 1] = g.y,
  45394. u[a + 2] = g.z,
  45395. u[a + 3] = g.x,
  45396. u[a + 4] = g.y,
  45397. u[a + 5] = g.z,
  45398. u[a + 6] = g.x,
  45399. u[a + 7] = g.y,
  45400. u[a + 8] = g.z;
  45401. this.normalizeNormals(),
  45402. t.normal.needsUpdate = !0
  45403. }
  45404. },
  45405. merge: function(e, t) {
  45406. if (e instanceof n.BufferGeometry == !1)
  45407. return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e);
  45408. void 0 === t && (t = 0);
  45409. var i = this.attributes;
  45410. for (var r in i)
  45411. if (void 0 !== e.attributes[r])
  45412. for (var o = i[r], a = o.array, s = e.attributes[r], l = s.array, c = s.itemSize, h = 0, u = c * t; h < l.length; h++,
  45413. u++)
  45414. a[u] = l[h];
  45415. return this
  45416. },
  45417. normalizeNormals: function() {
  45418. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  45419. e = r[o],
  45420. t = r[o + 1],
  45421. i = r[o + 2],
  45422. n = 1 / Math.sqrt(e * e + t * t + i * i),
  45423. r[o] *= n,
  45424. r[o + 1] *= n,
  45425. r[o + 2] *= n
  45426. },
  45427. toNonIndexed: function() {
  45428. if (null === this.index)
  45429. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  45430. this;
  45431. var e = new n.BufferGeometry
  45432. , t = this.index.array
  45433. , i = this.attributes;
  45434. for (var r in i) {
  45435. for (var o = i[r], a = o.array, s = o.itemSize, l = new a.constructor(t.length * s), c = 0, h = 0, u = 0, d = t.length; u < d; u++) {
  45436. c = t[u] * s;
  45437. for (var p = 0; p < s; p++)
  45438. l[h++] = a[c++]
  45439. }
  45440. e.addAttribute(r, new n.BufferAttribute(l,s))
  45441. }
  45442. return e
  45443. },
  45444. toJSON: function() {
  45445. var e = {
  45446. metadata: {
  45447. version: 4.4,
  45448. type: "BufferGeometry",
  45449. generator: "BufferGeometry.toJSON"
  45450. }
  45451. };
  45452. if (e.uuid = this.uuid,
  45453. e.type = this.type,
  45454. "" !== this.name && (e.name = this.name),
  45455. void 0 !== this.parameters) {
  45456. var t = this.parameters;
  45457. for (var i in t)
  45458. void 0 !== t[i] && (e[i] = t[i]);
  45459. return e
  45460. }
  45461. e.data = {
  45462. attributes: {}
  45463. };
  45464. var n = this.index;
  45465. if (null !== n) {
  45466. var r = Array.prototype.slice.call(n.array);
  45467. e.data.index = {
  45468. type: n.array.constructor.name,
  45469. array: r
  45470. }
  45471. }
  45472. var o = this.attributes;
  45473. for (var i in o) {
  45474. var a = o[i]
  45475. , r = Array.prototype.slice.call(a.array);
  45476. e.data.attributes[i] = {
  45477. itemSize: a.itemSize,
  45478. type: a.array.constructor.name,
  45479. array: r
  45480. }
  45481. }
  45482. var s = this.groups;
  45483. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)));
  45484. var l = this.boundingSphere;
  45485. return null !== l && (e.data.boundingSphere = {
  45486. center: l.center.toArray(),
  45487. radius: l.radius
  45488. }),
  45489. e
  45490. },
  45491. clone: function() {
  45492. return (new n.BufferGeometry).copy(this)
  45493. },
  45494. copy: function(e) {
  45495. var t = e.index;
  45496. null !== t && this.setIndex(t.clone());
  45497. var i = e.attributes;
  45498. for (var n in i) {
  45499. var r = i[n];
  45500. this.addAttribute(n, r.clone())
  45501. }
  45502. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  45503. var l = o[a];
  45504. this.addGroup(l.start, l.count)
  45505. }
  45506. return this
  45507. },
  45508. dispose: function() {
  45509. this.dispatchEvent({
  45510. type: "dispose"
  45511. })
  45512. }
  45513. },
  45514. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  45515. n.BufferGeometry.MaxIndex = 65535,
  45516. n.InstancedBufferGeometry = function() {
  45517. n.BufferGeometry.call(this),
  45518. this.type = "InstancedBufferGeometry",
  45519. this.maxInstancedCount = void 0
  45520. }
  45521. ,
  45522. n.InstancedBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  45523. n.InstancedBufferGeometry.prototype.constructor = n.InstancedBufferGeometry,
  45524. n.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  45525. this.groups.push({
  45526. start: e,
  45527. count: t,
  45528. instances: i
  45529. })
  45530. }
  45531. ,
  45532. n.InstancedBufferGeometry.prototype.copy = function(e) {
  45533. var t = e.index;
  45534. null !== t && this.setIndex(t.clone());
  45535. var i = e.attributes;
  45536. for (var n in i) {
  45537. var r = i[n];
  45538. this.addAttribute(n, r.clone())
  45539. }
  45540. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  45541. var l = o[a];
  45542. this.addGroup(l.start, l.count, l.instances)
  45543. }
  45544. return this
  45545. }
  45546. ,
  45547. n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),
  45548. n.Uniform = function(e, t) {
  45549. this.type = e,
  45550. this.value = t,
  45551. this.dynamic = !1
  45552. }
  45553. ,
  45554. n.Uniform.prototype = {
  45555. constructor: n.Uniform,
  45556. onUpdate: function(e) {
  45557. return this.dynamic = !0,
  45558. this.onUpdateCallback = e,
  45559. this
  45560. }
  45561. },
  45562. n.AnimationClip = function(e, t, i) {
  45563. this.name = e || n.Math.generateUUID(),
  45564. this.tracks = i,
  45565. this.duration = void 0 !== t ? t : -1,
  45566. this.duration < 0 && this.resetDuration(),
  45567. this.trim(),
  45568. this.optimize()
  45569. }
  45570. ,
  45571. n.AnimationClip.prototype = {
  45572. constructor: n.AnimationClip,
  45573. resetDuration: function() {
  45574. for (var e = this.tracks, t = 0, i = 0, n = e.length; i !== n; ++i) {
  45575. var r = this.tracks[i];
  45576. t = Math.max(t, r.times[r.times.length - 1])
  45577. }
  45578. this.duration = t
  45579. },
  45580. trim: function() {
  45581. for (var e = 0; e < this.tracks.length; e++)
  45582. this.tracks[e].trim(0, this.duration);
  45583. return this
  45584. },
  45585. optimize: function() {
  45586. for (var e = 0; e < this.tracks.length; e++)
  45587. this.tracks[e].optimize();
  45588. return this
  45589. }
  45590. },
  45591. Object.assign(n.AnimationClip, {
  45592. parse: function(e) {
  45593. for (var t = [], i = e.tracks, r = 1 / (e.fps || 1), o = 0, a = i.length; o !== a; ++o)
  45594. t.push(n.KeyframeTrack.parse(i[o]).scale(r));
  45595. return new n.AnimationClip(e.name,e.duration,t)
  45596. },
  45597. toJSON: function(e) {
  45598. for (var t = [], i = e.tracks, r = {
  45599. name: e.name,
  45600. duration: e.duration,
  45601. tracks: t
  45602. }, o = 0, a = i.length; o !== a; ++o)
  45603. t.push(n.KeyframeTrack.toJSON(i[o]));
  45604. return r
  45605. },
  45606. CreateFromMorphTargetSequence: function(e, t, i) {
  45607. for (var r = t.length, o = [], a = 0; a < r; a++) {
  45608. var s = []
  45609. , l = [];
  45610. s.push((a + r - 1) % r, a, (a + 1) % r),
  45611. l.push(0, 1, 0);
  45612. var c = n.AnimationUtils.getKeyframeOrder(s);
  45613. s = n.AnimationUtils.sortedArray(s, 1, c),
  45614. l = n.AnimationUtils.sortedArray(l, 1, c),
  45615. 0 === s[0] && (s.push(r),
  45616. l.push(l[0])),
  45617. o.push(new n.NumberKeyframeTrack(".morphTargetInfluences[" + t[a].name + "]",s,l).scale(1 / i))
  45618. }
  45619. return new n.AnimationClip(e,-1,o)
  45620. },
  45621. findByName: function(e, t) {
  45622. for (var i = 0; i < e.length; i++)
  45623. if (e[i].name === t)
  45624. return e[i];
  45625. return null
  45626. },
  45627. CreateClipsFromMorphTargetSequences: function(e, t) {
  45628. for (var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++) {
  45629. var s = e[o]
  45630. , l = s.name.match(r);
  45631. if (l && l.length > 1) {
  45632. var c = l[1]
  45633. , h = i[c];
  45634. h || (i[c] = h = []),
  45635. h.push(s)
  45636. }
  45637. }
  45638. var u = [];
  45639. for (var c in i)
  45640. u.push(n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t));
  45641. return u
  45642. },
  45643. parseAnimation: function(e, t, i) {
  45644. if (!e)
  45645. return console.error(" no animation in JSONLoader data"),
  45646. null;
  45647. for (var r = function(e, t, i, r, o) {
  45648. if (0 !== i.length) {
  45649. var a = []
  45650. , s = [];
  45651. n.AnimationUtils.flattenJSON(i, a, s, r),
  45652. 0 !== a.length && o.push(new e(t,a,s))
  45653. }
  45654. }, o = [], a = e.name || "default", s = e.length || -1, l = e.fps || 30, c = e.hierarchy || [], h = 0; h < c.length; h++) {
  45655. var u = c[h].keys;
  45656. if (u && 0 != u.length)
  45657. if (u[0].morphTargets) {
  45658. for (var d = {}, p = 0; p < u.length; p++)
  45659. if (u[p].morphTargets)
  45660. for (var f = 0; f < u[p].morphTargets.length; f++)
  45661. d[u[p].morphTargets[f]] = -1;
  45662. for (var g in d) {
  45663. for (var m = [], v = [], f = 0; f !== u[p].morphTargets.length; ++f) {
  45664. var A = u[p];
  45665. m.push(A.time),
  45666. v.push(A.morphTarget === g ? 1 : 0)
  45667. }
  45668. o.push(new n.NumberKeyframeTrack(".morphTargetInfluence[" + g + "]",m,v))
  45669. }
  45670. s = d.length * (l || 1)
  45671. } else {
  45672. var y = ".bones[" + t[h].name + "]";
  45673. r(n.VectorKeyframeTrack, y + ".position", u, "pos", o),
  45674. r(n.QuaternionKeyframeTrack, y + ".quaternion", u, "rot", o),
  45675. r(n.VectorKeyframeTrack, y + ".scale", u, "scl", o)
  45676. }
  45677. }
  45678. if (0 === o.length)
  45679. return null;
  45680. var C = new n.AnimationClip(a,s,o);
  45681. return C
  45682. }
  45683. }),
  45684. n.AnimationMixer = function(e) {
  45685. this._root = e,
  45686. this._initMemoryManager(),
  45687. this._accuIndex = 0,
  45688. this.time = 0,
  45689. this.timeScale = 1
  45690. }
  45691. ,
  45692. n.AnimationMixer.prototype = {
  45693. constructor: n.AnimationMixer,
  45694. clipAction: function(e, t) {
  45695. var i, r = t || this._root, o = r.uuid, a = "string" == typeof e ? e : e.name, s = e !== a ? e : null, l = this._actionsByClip[a];
  45696. if (void 0 !== l) {
  45697. var c = l.actionByRoot[o];
  45698. if (void 0 !== c)
  45699. return c;
  45700. if (i = l.knownActions[0],
  45701. s = i._clip,
  45702. e !== a && e !== s)
  45703. throw new Error("Different clips with the same name detected!")
  45704. }
  45705. if (null === s)
  45706. return null;
  45707. var h = new n.AnimationMixer._Action(this,s,t);
  45708. return this._bindAction(h, i),
  45709. this._addInactiveAction(h, a, o),
  45710. h
  45711. },
  45712. existingAction: function(e, t) {
  45713. var i = t || this._root
  45714. , n = i.uuid
  45715. , r = "string" == typeof e ? e : e.name
  45716. , o = this._actionsByClip[r];
  45717. return void 0 !== o ? o.actionByRoot[n] || null : null
  45718. },
  45719. stopAllAction: function() {
  45720. var e = this._actions
  45721. , t = this._nActiveActions
  45722. , i = this._bindings
  45723. , n = this._nActiveBindings;
  45724. this._nActiveActions = 0,
  45725. this._nActiveBindings = 0;
  45726. for (var r = 0; r !== t; ++r)
  45727. e[r].reset();
  45728. for (var r = 0; r !== n; ++r)
  45729. i[r].useCount = 0;
  45730. return this
  45731. },
  45732. update: function(e) {
  45733. e *= this.timeScale;
  45734. 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) {
  45735. var s = t[a];
  45736. s.enabled && s._update(n, e, r, o)
  45737. }
  45738. for (var l = this._bindings, c = this._nActiveBindings, a = 0; a !== c; ++a)
  45739. l[a].apply(o);
  45740. return this
  45741. },
  45742. getRoot: function() {
  45743. return this._root
  45744. },
  45745. uncacheClip: function(e) {
  45746. var t = this._actions
  45747. , i = e.name
  45748. , n = this._actionsByClip
  45749. , r = n[i];
  45750. if (void 0 !== r) {
  45751. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  45752. var l = o[a];
  45753. this._deactivateAction(l);
  45754. var c = l._cacheIndex
  45755. , h = t[t.length - 1];
  45756. l._cacheIndex = null,
  45757. l._byClipCacheIndex = null,
  45758. h._cacheIndex = c,
  45759. t[c] = h,
  45760. t.pop(),
  45761. this._removeInactiveBindingsForAction(l)
  45762. }
  45763. delete n[i]
  45764. }
  45765. },
  45766. uncacheRoot: function(e) {
  45767. var t = e.uuid
  45768. , i = this._actionsByClip;
  45769. for (var n in i) {
  45770. var r = i[n].actionByRoot
  45771. , o = r[t];
  45772. void 0 !== o && (this._deactivateAction(o),
  45773. this._removeInactiveAction(o))
  45774. }
  45775. var a = this._bindingsByRootAndName
  45776. , s = a[t];
  45777. if (void 0 !== s)
  45778. for (var l in s) {
  45779. var c = s[l];
  45780. c.restoreOriginalState(),
  45781. this._removeInactiveBinding(c)
  45782. }
  45783. },
  45784. uncacheAction: function(e, t) {
  45785. var i = this.existingAction(e, t);
  45786. null !== i && (this._deactivateAction(i),
  45787. this._removeInactiveAction(i))
  45788. }
  45789. },
  45790. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  45791. n.AnimationMixer._Action = function(e, t, i) {
  45792. this._mixer = e,
  45793. this._clip = t,
  45794. this._localRoot = i || null;
  45795. for (var r = t.tracks, o = r.length, a = new Array(o), s = {
  45796. endingStart: n.ZeroCurvatureEnding,
  45797. endingEnd: n.ZeroCurvatureEnding
  45798. }, l = 0; l !== o; ++l) {
  45799. var c = r[l].createInterpolant(null);
  45800. a[l] = c,
  45801. c.settings = s
  45802. }
  45803. this._interpolantSettings = s,
  45804. this._interpolants = a,
  45805. this._propertyBindings = new Array(o),
  45806. this._cacheIndex = null,
  45807. this._byClipCacheIndex = null,
  45808. this._timeScaleInterpolant = null,
  45809. this._weightInterpolant = null,
  45810. this.loop = n.LoopRepeat,
  45811. this._loopCount = -1,
  45812. this._startTime = null,
  45813. this.time = 0,
  45814. this.timeScale = 1,
  45815. this._effectiveTimeScale = 1,
  45816. this.weight = 1,
  45817. this._effectiveWeight = 1,
  45818. this.repetitions = 1 / 0,
  45819. this.paused = !1,
  45820. this.enabled = !0,
  45821. this.clampWhenFinished = !1,
  45822. this.zeroSlopeAtStart = !0,
  45823. this.zeroSlopeAtEnd = !0
  45824. }
  45825. ,
  45826. n.AnimationMixer._Action.prototype = {
  45827. constructor: n.AnimationMixer._Action,
  45828. play: function() {
  45829. return this._mixer._activateAction(this),
  45830. this
  45831. },
  45832. stop: function() {
  45833. return this._mixer._deactivateAction(this),
  45834. this.reset()
  45835. },
  45836. reset: function() {
  45837. return this.paused = !1,
  45838. this.enabled = !0,
  45839. this.time = 0,
  45840. this._loopCount = -1,
  45841. this._startTime = null,
  45842. this.stopFading().stopWarping()
  45843. },
  45844. isRunning: function() {
  45845. this._startTime;
  45846. return this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  45847. },
  45848. isScheduled: function() {
  45849. return this._mixer._isActiveAction(this)
  45850. },
  45851. startAt: function(e) {
  45852. return this._startTime = e,
  45853. this
  45854. },
  45855. setLoop: function(e, t) {
  45856. return this.loop = e,
  45857. this.repetitions = t,
  45858. this
  45859. },
  45860. setEffectiveWeight: function(e) {
  45861. return this.weight = e,
  45862. this._effectiveWeight = this.enabled ? e : 0,
  45863. this.stopFading()
  45864. },
  45865. getEffectiveWeight: function() {
  45866. return this._effectiveWeight
  45867. },
  45868. fadeIn: function(e) {
  45869. return this._scheduleFading(e, 0, 1)
  45870. },
  45871. fadeOut: function(e) {
  45872. return this._scheduleFading(e, 1, 0)
  45873. },
  45874. crossFadeFrom: function(e, t, i) {
  45875. this._mixer;
  45876. if (e.fadeOut(t),
  45877. this.fadeIn(t),
  45878. i) {
  45879. var n = this._clip.duration
  45880. , r = e._clip.duration
  45881. , o = r / n
  45882. , a = n / r;
  45883. e.warp(1, o, t),
  45884. this.warp(a, 1, t)
  45885. }
  45886. return this
  45887. },
  45888. crossFadeTo: function(e, t, i) {
  45889. return e.crossFadeFrom(this, t, i)
  45890. },
  45891. stopFading: function() {
  45892. var e = this._weightInterpolant;
  45893. return null !== e && (this._weightInterpolant = null,
  45894. this._mixer._takeBackControlInterpolant(e)),
  45895. this
  45896. },
  45897. setEffectiveTimeScale: function(e) {
  45898. return this.timeScale = e,
  45899. this._effectiveTimeScale = this.paused ? 0 : e,
  45900. this.stopWarping()
  45901. },
  45902. getEffectiveTimeScale: function() {
  45903. return this._effectiveTimeScale
  45904. },
  45905. setDuration: function(e) {
  45906. return this.timeScale = this._clip.duration / e,
  45907. this.stopWarping()
  45908. },
  45909. syncWith: function(e) {
  45910. return this.time = e.time,
  45911. this.timeScale = e.timeScale,
  45912. this.stopWarping()
  45913. },
  45914. halt: function(e) {
  45915. return this.warp(this._currentTimeScale, 0, e)
  45916. },
  45917. warp: function(e, t, i) {
  45918. var n = this._mixer
  45919. , r = n.time
  45920. , o = this._timeScaleInterpolant
  45921. , a = this.timeScale;
  45922. null === o && (o = n._lendControlInterpolant(),
  45923. this._timeScaleInterpolant = o);
  45924. var s = o.parameterPositions
  45925. , l = o.sampleValues;
  45926. return s[0] = r,
  45927. s[1] = r + i,
  45928. l[0] = e / a,
  45929. l[1] = t / a,
  45930. this
  45931. },
  45932. stopWarping: function() {
  45933. var e = this._timeScaleInterpolant;
  45934. return null !== e && (this._timeScaleInterpolant = null,
  45935. this._mixer._takeBackControlInterpolant(e)),
  45936. this
  45937. },
  45938. getMixer: function() {
  45939. return this._mixer
  45940. },
  45941. getClip: function() {
  45942. return this._clip
  45943. },
  45944. getRoot: function() {
  45945. return this._localRoot || this._mixer._root
  45946. },
  45947. _update: function(e, t, i, n) {
  45948. var r = this._startTime;
  45949. if (null !== r) {
  45950. var o = (e - r) * i;
  45951. if (o < 0 || 0 === i)
  45952. return;
  45953. this._startTime = null,
  45954. t = i * o
  45955. }
  45956. t *= this._updateTimeScale(e);
  45957. var a = this._updateTime(t)
  45958. , s = this._updateWeight(e);
  45959. if (s > 0)
  45960. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  45961. l[h].evaluate(a),
  45962. c[h].accumulate(n, s)
  45963. },
  45964. _updateWeight: function(e) {
  45965. var t = 0;
  45966. if (this.enabled) {
  45967. t = this.weight;
  45968. var i = this._weightInterpolant;
  45969. if (null !== i) {
  45970. var n = i.evaluate(e)[0];
  45971. t *= n,
  45972. e > i.parameterPositions[1] && (this.stopFading(),
  45973. 0 === n && (this.enabled = !1))
  45974. }
  45975. }
  45976. return this._effectiveWeight = t,
  45977. t
  45978. },
  45979. _updateTimeScale: function(e) {
  45980. var t = 0;
  45981. if (!this.paused) {
  45982. t = this.timeScale;
  45983. var i = this._timeScaleInterpolant;
  45984. if (null !== i) {
  45985. var n = i.evaluate(e)[0];
  45986. t *= n,
  45987. e > i.parameterPositions[1] && (this.stopWarping(),
  45988. 0 === t ? this.pause = !0 : this.timeScale = t)
  45989. }
  45990. }
  45991. return this._effectiveTimeScale = t,
  45992. t
  45993. },
  45994. _updateTime: function(e) {
  45995. var t = this.time + e;
  45996. if (0 === e)
  45997. return t;
  45998. var i = this._clip.duration
  45999. , r = this.loop
  46000. , o = this._loopCount
  46001. , a = !1;
  46002. switch (r) {
  46003. case n.LoopOnce:
  46004. if (o === -1 && (this.loopCount = 0,
  46005. this._setEndings(!0, !0, !1)),
  46006. t >= i)
  46007. t = i;
  46008. else {
  46009. if (!(t < 0))
  46010. break;
  46011. t = 0
  46012. }
  46013. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  46014. this._mixer.dispatchEvent({
  46015. type: "finished",
  46016. action: this,
  46017. direction: e < 0 ? -1 : 1
  46018. });
  46019. break;
  46020. case n.LoopPingPong:
  46021. a = !0;
  46022. case n.LoopRepeat:
  46023. if (o === -1 && (e > 0 ? (o = 0,
  46024. this._setEndings(!0, 0 === this.repetitions, a)) : this._setEndings(0 === this.repetitions, !0, a)),
  46025. t >= i || t < 0) {
  46026. var s = Math.floor(t / i);
  46027. t -= i * s,
  46028. o += Math.abs(s);
  46029. var l = this.repetitions - o;
  46030. if (l < 0) {
  46031. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  46032. t = e > 0 ? i : 0,
  46033. this._mixer.dispatchEvent({
  46034. type: "finished",
  46035. action: this,
  46036. direction: e > 0 ? 1 : -1
  46037. });
  46038. break
  46039. }
  46040. if (0 === l) {
  46041. var c = e < 0;
  46042. this._setEndings(c, !c, a)
  46043. } else
  46044. this._setEndings(!1, !1, a);
  46045. this._loopCount = o,
  46046. this._mixer.dispatchEvent({
  46047. type: "loop",
  46048. action: this,
  46049. loopDelta: s
  46050. })
  46051. }
  46052. if (r === n.LoopPingPong && 1 === (1 & o))
  46053. return this.time = t,
  46054. i - t
  46055. }
  46056. return this.time = t,
  46057. t
  46058. },
  46059. _setEndings: function(e, t, i) {
  46060. var r = this._interpolantSettings;
  46061. i ? (r.endingStart = n.ZeroSlopeEnding,
  46062. r.endingEnd = n.ZeroSlopeEnding) : (e ? r.endingStart = this.zeroSlopeAtStart ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingStart = n.WrapAroundEnding,
  46063. t ? r.endingEnd = this.zeroSlopeAtEnd ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingEnd = n.WrapAroundEnding)
  46064. },
  46065. _scheduleFading: function(e, t, i) {
  46066. var n = this._mixer
  46067. , r = n.time
  46068. , o = this._weightInterpolant;
  46069. null === o && (o = n._lendControlInterpolant(),
  46070. this._weightInterpolant = o);
  46071. var a = o.parameterPositions
  46072. , s = o.sampleValues;
  46073. return a[0] = r,
  46074. s[0] = t,
  46075. a[1] = r + e,
  46076. s[1] = i,
  46077. this
  46078. }
  46079. },
  46080. Object.assign(n.AnimationMixer.prototype, {
  46081. _bindAction: function(e, t) {
  46082. var i = e._localRoot || this._root
  46083. , r = e._clip.tracks
  46084. , o = r.length
  46085. , a = e._propertyBindings
  46086. , s = e._interpolants
  46087. , l = i.uuid
  46088. , c = this._bindingsByRootAndName
  46089. , h = c[l];
  46090. void 0 === h && (h = {},
  46091. c[l] = h);
  46092. for (var u = 0; u !== o; ++u) {
  46093. var d = r[u]
  46094. , p = d.name
  46095. , f = h[p];
  46096. if (void 0 !== f)
  46097. a[u] = f;
  46098. else {
  46099. if (f = a[u],
  46100. void 0 !== f) {
  46101. null === f._cacheIndex && (++f.referenceCount,
  46102. this._addInactiveBinding(f, l, p));
  46103. continue
  46104. }
  46105. var g = t && t._propertyBindings[u].binding.parsedPath;
  46106. f = new n.PropertyMixer(n.PropertyBinding.create(i, p, g),d.ValueTypeName,d.getValueSize()),
  46107. ++f.referenceCount,
  46108. this._addInactiveBinding(f, l, p),
  46109. a[u] = f
  46110. }
  46111. s[u].resultBuffer = f.buffer
  46112. }
  46113. },
  46114. _activateAction: function(e) {
  46115. if (!this._isActiveAction(e)) {
  46116. if (null === e._cacheIndex) {
  46117. var t = (e._localRoot || this._root).uuid
  46118. , i = e._clip.name
  46119. , n = this._actionsByClip[i];
  46120. this._bindAction(e, n && n.knownActions[0]),
  46121. this._addInactiveAction(e, i, t)
  46122. }
  46123. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  46124. var s = r[o];
  46125. 0 === s.useCount++ && (this._lendBinding(s),
  46126. s.saveOriginalState())
  46127. }
  46128. this._lendAction(e)
  46129. }
  46130. },
  46131. _deactivateAction: function(e) {
  46132. if (this._isActiveAction(e)) {
  46133. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  46134. var r = t[i];
  46135. 0 === --r.useCount && (r.restoreOriginalState(),
  46136. this._takeBackBinding(r))
  46137. }
  46138. this._takeBackAction(e)
  46139. }
  46140. },
  46141. _initMemoryManager: function() {
  46142. this._actions = [],
  46143. this._nActiveActions = 0,
  46144. this._actionsByClip = {},
  46145. this._bindings = [],
  46146. this._nActiveBindings = 0,
  46147. this._bindingsByRootAndName = {},
  46148. this._controlInterpolants = [],
  46149. this._nActiveControlInterpolants = 0;
  46150. var e = this;
  46151. this.stats = {
  46152. actions: {
  46153. get total() {
  46154. return e._actions.length
  46155. },
  46156. get inUse() {
  46157. return e._nActiveActions
  46158. }
  46159. },
  46160. bindings: {
  46161. get total() {
  46162. return e._bindings.length
  46163. },
  46164. get inUse() {
  46165. return e._nActiveBindings
  46166. }
  46167. },
  46168. controlInterpolants: {
  46169. get total() {
  46170. return e._controlInterpolants.length
  46171. },
  46172. get inUse() {
  46173. return e._nActiveControlInterpolants
  46174. }
  46175. }
  46176. }
  46177. },
  46178. _isActiveAction: function(e) {
  46179. var t = e._cacheIndex;
  46180. return null !== t && t < this._nActiveActions
  46181. },
  46182. _addInactiveAction: function(e, t, i) {
  46183. var n = this._actions
  46184. , r = this._actionsByClip
  46185. , o = r[t];
  46186. if (void 0 === o)
  46187. o = {
  46188. knownActions: [e],
  46189. actionByRoot: {}
  46190. },
  46191. e._byClipCacheIndex = 0,
  46192. r[t] = o;
  46193. else {
  46194. var a = o.knownActions;
  46195. e._byClipCacheIndex = a.length,
  46196. a.push(e)
  46197. }
  46198. e._cacheIndex = n.length,
  46199. n.push(e),
  46200. o.actionByRoot[i] = e
  46201. },
  46202. _removeInactiveAction: function(e) {
  46203. var t = this._actions
  46204. , i = t[t.length - 1]
  46205. , n = e._cacheIndex;
  46206. i._cacheIndex = n,
  46207. t[n] = i,
  46208. t.pop(),
  46209. e._cacheIndex = null;
  46210. var r = e._clip.name
  46211. , o = this._actionsByClip
  46212. , a = o[r]
  46213. , s = a.knownActions
  46214. , l = s[s.length - 1]
  46215. , c = e._byClipCacheIndex;
  46216. l._byClipCacheIndex = c,
  46217. s[c] = l,
  46218. s.pop(),
  46219. e._byClipCacheIndex = null;
  46220. var h = a.actionByRoot
  46221. , u = (t._localRoot || this._root).uuid;
  46222. delete h[u],
  46223. 0 === s.length && delete o[r],
  46224. this._removeInactiveBindingsForAction(e)
  46225. },
  46226. _removeInactiveBindingsForAction: function(e) {
  46227. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  46228. var r = t[i];
  46229. 0 === --r.referenceCount && this._removeInactiveBinding(r)
  46230. }
  46231. },
  46232. _lendAction: function(e) {
  46233. var t = this._actions
  46234. , i = e._cacheIndex
  46235. , n = this._nActiveActions++
  46236. , r = t[n];
  46237. e._cacheIndex = n,
  46238. t[n] = e,
  46239. r._cacheIndex = i,
  46240. t[i] = r
  46241. },
  46242. _takeBackAction: function(e) {
  46243. var t = this._actions
  46244. , i = e._cacheIndex
  46245. , n = --this._nActiveActions
  46246. , r = t[n];
  46247. e._cacheIndex = n,
  46248. t[n] = e,
  46249. r._cacheIndex = i,
  46250. t[i] = r
  46251. },
  46252. _addInactiveBinding: function(e, t, i) {
  46253. var n = this._bindingsByRootAndName
  46254. , r = n[t]
  46255. , o = this._bindings;
  46256. void 0 === r && (r = {},
  46257. n[t] = r),
  46258. r[i] = e,
  46259. e._cacheIndex = o.length,
  46260. o.push(e)
  46261. },
  46262. _removeInactiveBinding: function(e) {
  46263. var t = this._bindings
  46264. , i = e.binding
  46265. , n = i.rootNode.uuid
  46266. , r = i.path
  46267. , o = this._bindingsByRootAndName
  46268. , a = o[n]
  46269. , s = t[t.length - 1]
  46270. , l = e._cacheIndex;
  46271. s._cacheIndex = l,
  46272. t[l] = s,
  46273. t.pop(),
  46274. delete a[r];
  46275. e: {
  46276. for (var c in a)
  46277. break e;
  46278. delete o[n]
  46279. }
  46280. },
  46281. _lendBinding: function(e) {
  46282. var t = this._bindings
  46283. , i = e._cacheIndex
  46284. , n = this._nActiveBindings++
  46285. , r = t[n];
  46286. e._cacheIndex = n,
  46287. t[n] = e,
  46288. r._cacheIndex = i,
  46289. t[i] = r
  46290. },
  46291. _takeBackBinding: function(e) {
  46292. var t = this._bindings
  46293. , i = e._cacheIndex
  46294. , n = --this._nActiveBindings
  46295. , r = t[n];
  46296. e._cacheIndex = n,
  46297. t[n] = e,
  46298. r._cacheIndex = i,
  46299. t[i] = r
  46300. },
  46301. _lendControlInterpolant: function() {
  46302. var e = this._controlInterpolants
  46303. , t = this._nActiveControlInterpolants++
  46304. , i = e[t];
  46305. return void 0 === i && (i = new n.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),
  46306. i.__cacheIndex = t,
  46307. e[t] = i),
  46308. i
  46309. },
  46310. _takeBackControlInterpolant: function(e) {
  46311. var t = this._controlInterpolants
  46312. , i = e.__cacheIndex
  46313. , n = --this._nActiveControlInterpolants
  46314. , r = t[n];
  46315. e.__cacheIndex = n,
  46316. t[n] = e,
  46317. r.__cacheIndex = i,
  46318. t[i] = r
  46319. },
  46320. _controlInterpolantsResultBuffer: new Float32Array(1)
  46321. }),
  46322. n.AnimationObjectGroup = function(e) {
  46323. this.uuid = n.Math.generateUUID(),
  46324. this._objects = Array.prototype.slice.call(arguments),
  46325. this.nCachedObjects_ = 0;
  46326. var t = {};
  46327. this._indicesByUUID = t;
  46328. for (var i = 0, r = arguments.length; i !== r; ++i)
  46329. t[arguments[i].uuid] = i;
  46330. this._paths = [],
  46331. this._parsedPaths = [],
  46332. this._bindings = [],
  46333. this._bindingsIndicesByPath = {};
  46334. var o = this;
  46335. this.stats = {
  46336. objects: {
  46337. get total() {
  46338. return o._objects.length
  46339. },
  46340. get inUse() {
  46341. return this.total - o.nCachedObjects_
  46342. }
  46343. },
  46344. get bindingsPerObject() {
  46345. return o._bindings.length
  46346. }
  46347. }
  46348. }
  46349. ,
  46350. n.AnimationObjectGroup.prototype = {
  46351. constructor: n.AnimationObjectGroup,
  46352. add: function(e) {
  46353. for (var t = this._objects, i = t.length, r = this.nCachedObjects_, o = this._indicesByUUID, a = this._paths, s = this._parsedPaths, l = this._bindings, c = l.length, h = 0, u = arguments.length; h !== u; ++h) {
  46354. var d = arguments[h]
  46355. , p = d.uuid
  46356. , f = o[p];
  46357. if (void 0 === f) {
  46358. f = i++,
  46359. o[p] = f,
  46360. t.push(d);
  46361. for (var g = 0, m = c; g !== m; ++g)
  46362. l[g].push(new n.PropertyBinding(d,a[g],s[g]))
  46363. } else if (f < r) {
  46364. var v = t[f]
  46365. , A = --r
  46366. , y = t[A];
  46367. o[y.uuid] = f,
  46368. t[f] = y,
  46369. o[p] = A,
  46370. t[A] = d;
  46371. for (var g = 0, m = c; g !== m; ++g) {
  46372. var C = l[g]
  46373. , I = C[A]
  46374. , E = C[f];
  46375. C[f] = I,
  46376. void 0 === E && (E = new n.PropertyBinding(d,a[g],s[g])),
  46377. C[A] = E
  46378. }
  46379. } else
  46380. t[f] !== v && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  46381. }
  46382. this.nCachedObjects_ = r
  46383. },
  46384. remove: function(e) {
  46385. for (var t = this._objects, i = (t.length,
  46386. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  46387. var l = arguments[a]
  46388. , c = l.uuid
  46389. , h = n[c];
  46390. if (void 0 !== h && h >= i) {
  46391. var u = i++
  46392. , d = t[u];
  46393. n[d.uuid] = h,
  46394. t[h] = d,
  46395. n[c] = u,
  46396. t[u] = l;
  46397. for (var p = 0, f = o; p !== f; ++p) {
  46398. var g = r[p]
  46399. , m = g[u]
  46400. , v = g[h];
  46401. g[h] = m,
  46402. g[u] = v
  46403. }
  46404. }
  46405. }
  46406. this.nCachedObjects_ = i
  46407. },
  46408. uncache: function(e) {
  46409. 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) {
  46410. var c = arguments[s]
  46411. , h = c.uuid
  46412. , u = r[h];
  46413. if (void 0 !== u)
  46414. if (delete r[h],
  46415. u < n) {
  46416. var d = --n
  46417. , p = t[d]
  46418. , f = --i
  46419. , g = t[f];
  46420. r[p.uuid] = u,
  46421. t[u] = p,
  46422. r[g.uuid] = d,
  46423. t[d] = g,
  46424. t.pop();
  46425. for (var m = 0, v = a; m !== v; ++m) {
  46426. var A = o[m]
  46427. , y = A[d]
  46428. , C = A[f];
  46429. A[u] = y,
  46430. A[d] = C,
  46431. A.pop()
  46432. }
  46433. } else {
  46434. var f = --i
  46435. , g = t[f];
  46436. r[g.uuid] = u,
  46437. t[u] = g,
  46438. t.pop();
  46439. for (var m = 0, v = a; m !== v; ++m) {
  46440. var A = o[m];
  46441. A[u] = A[f],
  46442. A.pop()
  46443. }
  46444. }
  46445. }
  46446. this.nCachedObjects_ = n
  46447. },
  46448. subscribe_: function(e, t) {
  46449. var i = this._bindingsIndicesByPath
  46450. , r = i[e]
  46451. , o = this._bindings;
  46452. if (void 0 !== r)
  46453. return o[r];
  46454. var a = this._paths
  46455. , s = this._parsedPaths
  46456. , l = this._objects
  46457. , c = l.length
  46458. , h = this.nCachedObjects_
  46459. , u = new Array(c);
  46460. r = o.length,
  46461. i[e] = r,
  46462. a.push(e),
  46463. s.push(t),
  46464. o.push(u);
  46465. for (var d = h, p = l.length; d !== p; ++d) {
  46466. var f = l[d];
  46467. u[d] = new n.PropertyBinding(f,e,t)
  46468. }
  46469. return u
  46470. },
  46471. unsubscribe_: function(e) {
  46472. var t = this._bindingsIndicesByPath
  46473. , i = t[e];
  46474. if (void 0 !== i) {
  46475. var n = this._paths
  46476. , r = this._parsedPaths
  46477. , o = this._bindings
  46478. , a = o.length - 1
  46479. , s = o[a]
  46480. , l = e[a];
  46481. t[l] = i,
  46482. o[i] = s,
  46483. o.pop(),
  46484. r[i] = r[a],
  46485. r.pop(),
  46486. n[i] = n[a],
  46487. n.pop()
  46488. }
  46489. }
  46490. },
  46491. n.AnimationUtils = {
  46492. arraySlice: function(e, t, i) {
  46493. return n.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  46494. },
  46495. convertArray: function(e, t, i) {
  46496. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  46497. },
  46498. isTypedArray: function(e) {
  46499. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  46500. },
  46501. getKeyframeOrder: function(e) {
  46502. function t(t, i) {
  46503. return e[t] - e[i]
  46504. }
  46505. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r)
  46506. n[r] = r;
  46507. return n.sort(t),
  46508. n
  46509. },
  46510. sortedArray: function(e, t, i) {
  46511. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  46512. for (var s = i[o] * t, l = 0; l !== t; ++l)
  46513. r[a++] = e[s + l];
  46514. return r
  46515. },
  46516. flattenJSON: function(e, t, i, n) {
  46517. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  46518. o = e[r++];
  46519. if (void 0 !== o) {
  46520. var a = o[n];
  46521. if (void 0 !== a)
  46522. if (Array.isArray(a)) {
  46523. do
  46524. a = o[n],
  46525. void 0 !== a && (t.push(o.time),
  46526. i.push.apply(i, a)),
  46527. o = e[r++];
  46528. while (void 0 !== o)
  46529. } else if (void 0 !== a.toArray) {
  46530. do
  46531. a = o[n],
  46532. void 0 !== a && (t.push(o.time),
  46533. a.toArray(i, i.length)),
  46534. o = e[r++];
  46535. while (void 0 !== o)
  46536. } else
  46537. do
  46538. a = o[n],
  46539. void 0 !== a && (t.push(o.time),
  46540. i.push(a)),
  46541. o = e[r++];
  46542. while (void 0 !== o)
  46543. }
  46544. }
  46545. },
  46546. n.KeyframeTrack = function(e, t, i, r) {
  46547. if (void 0 === e)
  46548. throw new Error("track name is undefined");
  46549. if (void 0 === t || 0 === t.length)
  46550. throw new Error("no keyframes in track named " + e);
  46551. this.name = e,
  46552. this.times = n.AnimationUtils.convertArray(t, this.TimeBufferType),
  46553. this.values = n.AnimationUtils.convertArray(i, this.ValueBufferType),
  46554. this.setInterpolation(r || this.DefaultInterpolation),
  46555. this.validate(),
  46556. this.optimize()
  46557. }
  46558. ,
  46559. n.KeyframeTrack.prototype = {
  46560. constructor: n.KeyframeTrack,
  46561. TimeBufferType: Float32Array,
  46562. ValueBufferType: Float32Array,
  46563. DefaultInterpolation: n.InterpolateLinear,
  46564. InterpolantFactoryMethodDiscrete: function(e) {
  46565. return new n.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  46566. },
  46567. InterpolantFactoryMethodLinear: function(e) {
  46568. return new n.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  46569. },
  46570. InterpolantFactoryMethodSmooth: function(e) {
  46571. return new n.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  46572. },
  46573. setInterpolation: function(e) {
  46574. var t = void 0;
  46575. switch (e) {
  46576. case n.InterpolateDiscrete:
  46577. t = this.InterpolantFactoryMethodDiscrete;
  46578. break;
  46579. case n.InterpolateLinear:
  46580. t = this.InterpolantFactoryMethodLinear;
  46581. break;
  46582. case n.InterpolateSmooth:
  46583. t = this.InterpolantFactoryMethodSmooth
  46584. }
  46585. if (void 0 === t) {
  46586. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  46587. if (void 0 === this.createInterpolant) {
  46588. if (e === this.DefaultInterpolation)
  46589. throw new Error(i);
  46590. this.setInterpolation(this.DefaultInterpolation)
  46591. }
  46592. return void console.warn(i)
  46593. }
  46594. this.createInterpolant = t
  46595. },
  46596. getInterpolation: function() {
  46597. switch (this.createInterpolant) {
  46598. case this.InterpolantFactoryMethodDiscrete:
  46599. return n.InterpolateDiscrete;
  46600. case this.InterpolantFactoryMethodLinear:
  46601. return n.InterpolateLinear;
  46602. case this.InterpolantFactoryMethodSmooth:
  46603. return n.InterpolateSmooth
  46604. }
  46605. },
  46606. getValueSize: function() {
  46607. return this.values.length / this.times.length
  46608. },
  46609. shift: function(e) {
  46610. if (0 !== e)
  46611. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  46612. t[i] += e;
  46613. return this
  46614. },
  46615. scale: function(e) {
  46616. if (1 !== e)
  46617. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  46618. t[i] *= e;
  46619. return this
  46620. },
  46621. trim: function(e, t) {
  46622. for (var i = this.times, r = i.length, o = 0, a = r - 1; o !== r && i[o] < e; )
  46623. ++o;
  46624. for (; a !== -1 && i[a] > t; )
  46625. --a;
  46626. if (++a,
  46627. 0 !== o || a !== r) {
  46628. o >= a && (a = Math.max(a, 1),
  46629. o = a - 1);
  46630. var s = this.getValueSize();
  46631. this.times = n.AnimationUtils.arraySlice(i, o, a),
  46632. this.values = n.AnimationUtils.arraySlice(this.values, o * s, a * s)
  46633. }
  46634. return this
  46635. },
  46636. validate: function() {
  46637. var e = !0
  46638. , t = this.getValueSize();
  46639. t - Math.floor(t) !== 0 && (console.error("invalid value size in track", this),
  46640. e = !1);
  46641. var i = this.times
  46642. , r = this.values
  46643. , o = i.length;
  46644. 0 === o && (console.error("track is empty", this),
  46645. e = !1);
  46646. for (var a = null, s = 0; s !== o; s++) {
  46647. var l = i[s];
  46648. if ("number" == typeof l && isNaN(l)) {
  46649. console.error("time is not a valid number", this, s, l),
  46650. e = !1;
  46651. break
  46652. }
  46653. if (null !== a && a > l) {
  46654. console.error("out of order keys", this, s, l, a),
  46655. e = !1;
  46656. break
  46657. }
  46658. a = l
  46659. }
  46660. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  46661. for (var s = 0, c = r.length; s !== c; ++s) {
  46662. var h = r[s];
  46663. if (isNaN(h)) {
  46664. console.error("value is not a valid number", this, s, h),
  46665. e = !1;
  46666. break
  46667. }
  46668. }
  46669. return e
  46670. },
  46671. optimize: function() {
  46672. for (var e = this.times, t = this.values, i = this.getValueSize(), r = 1, o = 1, a = e.length - 1; o <= a; ++o) {
  46673. var s = !1
  46674. , l = e[o]
  46675. , c = e[o + 1];
  46676. if (l !== c && (1 !== o || l !== l[0]))
  46677. for (var h = o * i, u = h - i, d = h + i, p = 0; p !== i; ++p) {
  46678. var f = t[h + p];
  46679. if (f !== t[u + p] || f !== t[d + p]) {
  46680. s = !0;
  46681. break
  46682. }
  46683. }
  46684. if (s) {
  46685. if (o !== r) {
  46686. e[r] = e[o];
  46687. for (var g = o * i, m = r * i, p = 0; p !== i; ++p)
  46688. t[m + p] = t[g + p]
  46689. }
  46690. ++r
  46691. }
  46692. }
  46693. return r !== e.length && (this.times = n.AnimationUtils.arraySlice(e, 0, r),
  46694. this.values = n.AnimationUtils.arraySlice(t, 0, r * i)),
  46695. this
  46696. }
  46697. },
  46698. Object.assign(n.KeyframeTrack, {
  46699. parse: function(e) {
  46700. if (void 0 === e.type)
  46701. throw new Error("track type undefined, can not parse");
  46702. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  46703. if (void 0 === e.times) {
  46704. console.warn("legacy JSON format detected, converting");
  46705. var i = []
  46706. , r = [];
  46707. n.AnimationUtils.flattenJSON(e.keys, i, r, "value"),
  46708. e.times = i,
  46709. e.values = r
  46710. }
  46711. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  46712. },
  46713. toJSON: function(e) {
  46714. var t, i = e.constructor;
  46715. if (void 0 !== i.toJSON)
  46716. t = i.toJSON(e);
  46717. else {
  46718. t = {
  46719. name: e.name,
  46720. times: n.AnimationUtils.convertArray(e.times, Array),
  46721. values: n.AnimationUtils.convertArray(e.values, Array)
  46722. };
  46723. var r = e.getInterpolation();
  46724. r !== e.DefaultInterpolation && (t.interpolation = r)
  46725. }
  46726. return t.type = e.ValueTypeName,
  46727. t
  46728. },
  46729. _getTrackTypeForValueTypeName: function(e) {
  46730. switch (e.toLowerCase()) {
  46731. case "scalar":
  46732. case "double":
  46733. case "float":
  46734. case "number":
  46735. case "integer":
  46736. return n.NumberKeyframeTrack;
  46737. case "vector":
  46738. case "vector2":
  46739. case "vector3":
  46740. case "vector4":
  46741. return n.VectorKeyframeTrack;
  46742. case "color":
  46743. return n.ColorKeyframeTrack;
  46744. case "quaternion":
  46745. return n.QuaternionKeyframeTrack;
  46746. case "bool":
  46747. case "boolean":
  46748. return n.BooleanKeyframeTrack;
  46749. case "string":
  46750. return n.StringKeyframeTrack
  46751. }
  46752. throw new Error("Unsupported typeName: " + e)
  46753. }
  46754. }),
  46755. n.PropertyBinding = function(e, t, i) {
  46756. this.path = t,
  46757. this.parsedPath = i || n.PropertyBinding.parseTrackName(t),
  46758. this.node = n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  46759. this.rootNode = e
  46760. }
  46761. ,
  46762. n.PropertyBinding.prototype = {
  46763. constructor: n.PropertyBinding,
  46764. getValue: function(e, t) {
  46765. this.bind(),
  46766. this.getValue(e, t)
  46767. },
  46768. setValue: function(e, t) {
  46769. this.bind(),
  46770. this.setValue(e, t)
  46771. },
  46772. bind: function() {
  46773. var e = this.node
  46774. , t = this.parsedPath
  46775. , i = t.objectName
  46776. , r = t.propertyName
  46777. , o = t.propertyIndex;
  46778. if (e || (e = n.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  46779. this.node = e),
  46780. this.getValue = this._getValue_unavailable,
  46781. this.setValue = this._setValue_unavailable,
  46782. !e)
  46783. return void console.error(" trying to update node for track: " + this.path + " but it wasn't found.");
  46784. if (i) {
  46785. var a = t.objectIndex;
  46786. switch (i) {
  46787. case "materials":
  46788. if (!e.material)
  46789. return void console.error(" can not bind to material as node does not have a material", this);
  46790. if (!e.material.materials)
  46791. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  46792. e = e.material.materials;
  46793. break;
  46794. case "bones":
  46795. if (!e.skeleton)
  46796. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  46797. e = e.skeleton.bones;
  46798. for (var s = 0; s < e.length; s++)
  46799. if (e[s].name === a) {
  46800. a = s;
  46801. break
  46802. }
  46803. break;
  46804. default:
  46805. if (void 0 === e[i])
  46806. return void console.error(" can not bind to objectName of node, undefined", this);
  46807. e = e[i]
  46808. }
  46809. if (void 0 !== a) {
  46810. if (void 0 === e[a])
  46811. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  46812. e = e[a]
  46813. }
  46814. }
  46815. var l = e[r];
  46816. if (!l) {
  46817. var c = t.nodeName;
  46818. return void console.error(" trying to update property for track: " + c + "." + r + " but it wasn't found.", e)
  46819. }
  46820. var h = this.Versioning.None;
  46821. void 0 !== e.needsUpdate ? (h = this.Versioning.NeedsUpdate,
  46822. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (h = this.Versioning.MatrixWorldNeedsUpdate,
  46823. this.targetObject = e);
  46824. var u = this.BindingType.Direct;
  46825. if (void 0 !== o) {
  46826. if ("morphTargetInfluences" === r) {
  46827. if (!e.geometry)
  46828. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  46829. if (!e.geometry.morphTargets)
  46830. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  46831. for (var s = 0; s < this.node.geometry.morphTargets.length; s++)
  46832. if (e.geometry.morphTargets[s].name === o) {
  46833. o = s;
  46834. break
  46835. }
  46836. }
  46837. u = this.BindingType.ArrayElement,
  46838. this.resolvedProperty = l,
  46839. this.propertyIndex = o
  46840. } else
  46841. void 0 !== l.fromArray && void 0 !== l.toArray ? (u = this.BindingType.HasFromToArray,
  46842. this.resolvedProperty = l) : void 0 !== l.length ? (u = this.BindingType.EntireArray,
  46843. this.resolvedProperty = l) : this.propertyName = r;
  46844. this.getValue = this.GetterByBindingType[u],
  46845. this.setValue = this.SetterByBindingTypeAndVersioning[u][h]
  46846. },
  46847. unbind: function() {
  46848. this.node = null,
  46849. this.getValue = this._getValue_unbound,
  46850. this.setValue = this._setValue_unbound
  46851. }
  46852. },
  46853. Object.assign(n.PropertyBinding.prototype, {
  46854. _getValue_unavailable: function() {},
  46855. _setValue_unavailable: function() {},
  46856. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  46857. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  46858. BindingType: {
  46859. Direct: 0,
  46860. EntireArray: 1,
  46861. ArrayElement: 2,
  46862. HasFromToArray: 3
  46863. },
  46864. Versioning: {
  46865. None: 0,
  46866. NeedsUpdate: 1,
  46867. MatrixWorldNeedsUpdate: 2
  46868. },
  46869. GetterByBindingType: [function(e, t) {
  46870. e[t] = this.node[this.propertyName]
  46871. }
  46872. , function(e, t) {
  46873. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46874. e[t++] = i[n]
  46875. }
  46876. , function(e, t) {
  46877. e[t] = this.resolvedProperty[this.propertyIndex]
  46878. }
  46879. , function(e, t) {
  46880. this.resolvedProperty.toArray(e, t)
  46881. }
  46882. ],
  46883. SetterByBindingTypeAndVersioning: [[function(e, t) {
  46884. this.node[this.propertyName] = e[t]
  46885. }
  46886. , function(e, t) {
  46887. this.node[this.propertyName] = e[t],
  46888. this.targetObject.needsUpdate = !0
  46889. }
  46890. , function(e, t) {
  46891. this.node[this.propertyName] = e[t],
  46892. this.targetObject.matrixWorldNeedsUpdate = !0
  46893. }
  46894. ], [function(e, t) {
  46895. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46896. i[n] = e[t++]
  46897. }
  46898. , function(e, t) {
  46899. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46900. i[n] = e[t++];
  46901. this.targetObject.needsUpdate = !0
  46902. }
  46903. , function(e, t) {
  46904. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46905. i[n] = e[t++];
  46906. this.targetObject.matrixWorldNeedsUpdate = !0
  46907. }
  46908. ], [function(e, t) {
  46909. this.resolvedProperty[this.propertyIndex] = e[t]
  46910. }
  46911. , function(e, t) {
  46912. this.resolvedProperty[this.propertyIndex] = e[t],
  46913. this.targetObject.needsUpdate = !0
  46914. }
  46915. , function(e, t) {
  46916. this.resolvedProperty[this.propertyIndex] = e[t],
  46917. this.targetObject.matrixWorldNeedsUpdate = !0
  46918. }
  46919. ], [function(e, t) {
  46920. this.resolvedProperty.fromArray(e, t)
  46921. }
  46922. , function(e, t) {
  46923. this.resolvedProperty.fromArray(e, t),
  46924. this.targetObject.needsUpdate = !0
  46925. }
  46926. , function(e, t) {
  46927. this.resolvedProperty.fromArray(e, t),
  46928. this.targetObject.matrixWorldNeedsUpdate = !0
  46929. }
  46930. ]]
  46931. }),
  46932. n.PropertyBinding.Composite = function(e, t, i) {
  46933. var r = i || n.PropertyBinding.parseTrackName(t);
  46934. this._targetGroup = e,
  46935. this._bindings = e.subscribe_(t, r)
  46936. }
  46937. ,
  46938. n.PropertyBinding.Composite.prototype = {
  46939. constructor: n.PropertyBinding.Composite,
  46940. getValue: function(e, t) {
  46941. this.bind();
  46942. var i = this._targetGroup.nCachedObjects_
  46943. , n = this._bindings[i];
  46944. void 0 !== n && n.getValue(e, t)
  46945. },
  46946. setValue: function(e, t) {
  46947. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  46948. i[n].setValue(e, t)
  46949. },
  46950. bind: function() {
  46951. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  46952. e[t].bind()
  46953. },
  46954. unbind: function() {
  46955. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  46956. e[t].unbind()
  46957. }
  46958. },
  46959. n.PropertyBinding.create = function(e, t, i) {
  46960. return e instanceof n.AnimationObjectGroup ? new n.PropertyBinding.Composite(e,t,i) : new n.PropertyBinding(e,t,i)
  46961. }
  46962. ,
  46963. n.PropertyBinding.parseTrackName = function(e) {
  46964. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  46965. , i = t.exec(e);
  46966. if (!i)
  46967. throw new Error("cannot parse trackName at all: " + e);
  46968. i.index === t.lastIndex && t.lastIndex++;
  46969. var n = {
  46970. nodeName: i[3],
  46971. objectName: i[5],
  46972. objectIndex: i[7],
  46973. propertyName: i[9],
  46974. propertyIndex: i[11]
  46975. };
  46976. if (null === n.propertyName || 0 === n.propertyName.length)
  46977. throw new Error("can not parse propertyName from trackName: " + e);
  46978. return n
  46979. }
  46980. ,
  46981. n.PropertyBinding.findNode = function(e, t) {
  46982. if (!t || "" === t || "root" === t || "." === t || t === -1 || t === e.name || t === e.uuid)
  46983. return e;
  46984. if (e.skeleton) {
  46985. var i = function(e) {
  46986. for (var i = 0; i < e.bones.length; i++) {
  46987. var n = e.bones[i];
  46988. if (n.name === t)
  46989. return n
  46990. }
  46991. return null
  46992. }
  46993. , n = i(e.skeleton);
  46994. if (n)
  46995. return n
  46996. }
  46997. if (e.children) {
  46998. var r = function(e) {
  46999. for (var i = 0; i < e.length; i++) {
  47000. var n = e[i];
  47001. if (n.name === t || n.uuid === t)
  47002. return n;
  47003. var o = r(n.children);
  47004. if (o)
  47005. return o
  47006. }
  47007. return null
  47008. }
  47009. , o = r(e.children);
  47010. if (o)
  47011. return o
  47012. }
  47013. return null
  47014. }
  47015. ,
  47016. n.PropertyMixer = function(e, t, i) {
  47017. this.binding = e,
  47018. this.valueSize = i;
  47019. var n, r = Float64Array;
  47020. switch (t) {
  47021. case "quaternion":
  47022. n = this._slerp;
  47023. break;
  47024. case "string":
  47025. case "bool":
  47026. r = Array,
  47027. n = this._select;
  47028. break;
  47029. default:
  47030. n = this._lerp
  47031. }
  47032. this.buffer = new r(4 * i),
  47033. this._mixBufferRegion = n,
  47034. this.cumulativeWeight = 0,
  47035. this.useCount = 0,
  47036. this.referenceCount = 0
  47037. }
  47038. ,
  47039. n.PropertyMixer.prototype = {
  47040. constructor: n.PropertyMixer,
  47041. accumulate: function(e, t) {
  47042. var i = this.buffer
  47043. , n = this.valueSize
  47044. , r = e * n + n
  47045. , o = this.cumulativeWeight;
  47046. if (0 === o) {
  47047. for (var a = 0; a !== n; ++a)
  47048. i[r + a] = i[a];
  47049. o = t
  47050. } else {
  47051. o += t;
  47052. var s = t / o;
  47053. this._mixBufferRegion(i, r, 0, s, n)
  47054. }
  47055. this.cumulativeWeight = o
  47056. },
  47057. apply: function(e) {
  47058. var t = this.valueSize
  47059. , i = this.buffer
  47060. , n = e * t + t
  47061. , r = this.cumulativeWeight
  47062. , o = this.binding;
  47063. if (this.cumulativeWeight = 0,
  47064. r < 1) {
  47065. var a = 3 * t;
  47066. this._mixBufferRegion(i, n, a, 1 - r, t)
  47067. }
  47068. for (var s = t, l = t + t; s !== l; ++s)
  47069. if (i[s] !== i[s + t]) {
  47070. o.setValue(i, n);
  47071. break
  47072. }
  47073. },
  47074. saveOriginalState: function() {
  47075. var e = this.binding
  47076. , t = this.buffer
  47077. , i = this.valueSize
  47078. , n = 3 * i;
  47079. e.getValue(t, n);
  47080. for (var r = i, o = n; r !== o; ++r)
  47081. t[r] = t[n + r % i];
  47082. this.cumulativeWeight = 0
  47083. },
  47084. restoreOriginalState: function() {
  47085. var e = 3 * this.valueSize;
  47086. this.binding.setValue(this.buffer, e)
  47087. },
  47088. _select: function(e, t, i, n, r) {
  47089. if (n >= .5)
  47090. for (var o = 0; o !== r; ++o)
  47091. e[t + o] = e[i + o]
  47092. },
  47093. _slerp: function(e, t, i, r, o) {
  47094. n.Quaternion.slerpFlat(e, t, e, t, e, i, r)
  47095. },
  47096. _lerp: function(e, t, i, n, r) {
  47097. for (var o = 1 - n, a = 0; a !== r; ++a) {
  47098. var s = t + a;
  47099. e[s] = e[s] * o + e[i + a] * n
  47100. }
  47101. }
  47102. },
  47103. n.BooleanKeyframeTrack = function(e, t, i) {
  47104. n.KeyframeTrack.call(this, e, t, i)
  47105. }
  47106. ,
  47107. n.BooleanKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47108. constructor: n.BooleanKeyframeTrack,
  47109. ValueTypeName: "bool",
  47110. ValueBufferType: Array,
  47111. DefaultInterpolation: n.IntepolateDiscrete,
  47112. InterpolantFactoryMethodLinear: void 0,
  47113. InterpolantFactoryMethodSmooth: void 0
  47114. }),
  47115. n.NumberKeyframeTrack = function(e, t, i, r) {
  47116. n.KeyframeTrack.call(this, e, t, i, r)
  47117. }
  47118. ,
  47119. n.NumberKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47120. constructor: n.NumberKeyframeTrack,
  47121. ValueTypeName: "number"
  47122. }),
  47123. n.QuaternionKeyframeTrack = function(e, t, i, r) {
  47124. n.KeyframeTrack.call(this, e, t, i, r)
  47125. }
  47126. ,
  47127. n.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47128. constructor: n.QuaternionKeyframeTrack,
  47129. ValueTypeName: "quaternion",
  47130. DefaultInterpolation: n.InterpolateLinear,
  47131. InterpolantFactoryMethodLinear: function(e) {
  47132. return new n.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  47133. },
  47134. InterpolantFactoryMethodSmooth: void 0
  47135. }),
  47136. n.StringKeyframeTrack = function(e, t, i, r) {
  47137. n.KeyframeTrack.call(this, e, t, i, r)
  47138. }
  47139. ,
  47140. n.StringKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47141. constructor: n.StringKeyframeTrack,
  47142. ValueTypeName: "string",
  47143. ValueBufferType: Array,
  47144. DefaultInterpolation: n.IntepolateDiscrete,
  47145. InterpolantFactoryMethodLinear: void 0,
  47146. InterpolantFactoryMethodSmooth: void 0
  47147. }),
  47148. n.VectorKeyframeTrack = function(e, t, i, r) {
  47149. n.KeyframeTrack.call(this, e, t, i, r)
  47150. }
  47151. ,
  47152. n.VectorKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47153. constructor: n.VectorKeyframeTrack,
  47154. ValueTypeName: "vector"
  47155. }),
  47156. n.Audio = function(e) {
  47157. n.Object3D.call(this),
  47158. this.type = "Audio",
  47159. this.context = e.context,
  47160. this.source = this.context.createBufferSource(),
  47161. this.source.onended = this.onEnded.bind(this),
  47162. this.gain = this.context.createGain(),
  47163. this.gain.connect(e.getInput()),
  47164. this.autoplay = !1,
  47165. this.startTime = 0,
  47166. this.playbackRate = 1,
  47167. this.isPlaying = !1,
  47168. this.hasPlaybackControl = !0,
  47169. this.sourceType = "empty",
  47170. this.filter = null
  47171. }
  47172. ,
  47173. n.Audio.prototype = Object.create(n.Object3D.prototype),
  47174. n.Audio.prototype.constructor = n.Audio,
  47175. n.Audio.prototype.getOutput = function() {
  47176. return this.gain
  47177. }
  47178. ,
  47179. n.Audio.prototype.load = function(e) {
  47180. var t = new n.AudioBuffer(this.context);
  47181. return t.load(e),
  47182. this.setBuffer(t),
  47183. this
  47184. }
  47185. ,
  47186. n.Audio.prototype.setNodeSource = function(e) {
  47187. return this.hasPlaybackControl = !1,
  47188. this.sourceType = "audioNode",
  47189. this.source = e,
  47190. this.connect(),
  47191. this
  47192. }
  47193. ,
  47194. n.Audio.prototype.setBuffer = function(e) {
  47195. var t = this;
  47196. return e.onReady(function(e) {
  47197. t.source.buffer = e,
  47198. t.sourceType = "buffer",
  47199. t.autoplay && t.play()
  47200. }),
  47201. this
  47202. }
  47203. ,
  47204. n.Audio.prototype.play = function() {
  47205. if (this.isPlaying === !0)
  47206. return void console.warn("THREE.Audio: Audio is already playing.");
  47207. if (this.hasPlaybackControl === !1)
  47208. return void console.warn("THREE.Audio: this Audio has no playback control.");
  47209. var e = this.context.createBufferSource();
  47210. e.buffer = this.source.buffer,
  47211. e.loop = this.source.loop,
  47212. e.onended = this.source.onended,
  47213. e.start(0, this.startTime),
  47214. e.playbackRate.value = this.playbackRate,
  47215. this.isPlaying = !0,
  47216. this.source = e,
  47217. this.connect()
  47218. }
  47219. ,
  47220. n.Audio.prototype.pause = function() {
  47221. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  47222. void (this.startTime = this.context.currentTime))
  47223. }
  47224. ,
  47225. n.Audio.prototype.stop = function() {
  47226. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  47227. void (this.startTime = 0))
  47228. }
  47229. ,
  47230. n.Audio.prototype.connect = function() {
  47231. null !== this.filter ? (this.source.connect(this.filter),
  47232. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  47233. }
  47234. ,
  47235. n.Audio.prototype.disconnect = function() {
  47236. null !== this.filter ? (this.source.disconnect(this.filter),
  47237. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  47238. }
  47239. ,
  47240. n.Audio.prototype.getFilter = function() {
  47241. return this.filter
  47242. }
  47243. ,
  47244. n.Audio.prototype.setFilter = function(e) {
  47245. void 0 === e && (e = null),
  47246. this.isPlaying === !0 ? (this.disconnect(),
  47247. this.filter = e,
  47248. this.connect()) : this.filter = e
  47249. }
  47250. ,
  47251. n.Audio.prototype.setPlaybackRate = function(e) {
  47252. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  47253. void (this.isPlaying === !0 && (this.source.playbackRate.value = this.playbackRate)))
  47254. }
  47255. ,
  47256. n.Audio.prototype.getPlaybackRate = function() {
  47257. return this.playbackRate
  47258. }
  47259. ,
  47260. n.Audio.prototype.onEnded = function() {
  47261. this.isPlaying = !1
  47262. }
  47263. ,
  47264. n.Audio.prototype.setLoop = function(e) {
  47265. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  47266. }
  47267. ,
  47268. n.Audio.prototype.getLoop = function() {
  47269. return this.hasPlaybackControl === !1 ? (console.warn("THREE.Audio: this Audio has no playback control."),
  47270. !1) : this.source.loop
  47271. }
  47272. ,
  47273. n.Audio.prototype.setVolume = function(e) {
  47274. this.gain.gain.value = e
  47275. }
  47276. ,
  47277. n.Audio.prototype.getVolume = function() {
  47278. return this.gain.gain.value
  47279. }
  47280. ,
  47281. n.AudioAnalyser = function(e, t) {
  47282. this.analyser = e.context.createAnalyser(),
  47283. this.analyser.fftSize = void 0 !== t ? t : 2048,
  47284. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  47285. e.getOutput().connect(this.analyser)
  47286. }
  47287. ,
  47288. n.AudioAnalyser.prototype = {
  47289. constructor: n.AudioAnalyser,
  47290. getData: function() {
  47291. return this.analyser.getByteFrequencyData(this.data),
  47292. this.data
  47293. }
  47294. },
  47295. n.AudioBuffer = function(e) {
  47296. this.context = e,
  47297. this.ready = !1,
  47298. this.readyCallbacks = []
  47299. }
  47300. ,
  47301. n.AudioBuffer.prototype.load = function(e) {
  47302. var t = this
  47303. , i = new XMLHttpRequest;
  47304. return i.open("GET", e, !0),
  47305. i.responseType = "arraybuffer",
  47306. i.onload = function(e) {
  47307. t.context.decodeAudioData(this.response, function(e) {
  47308. t.buffer = e,
  47309. t.ready = !0;
  47310. for (var i = 0; i < t.readyCallbacks.length; i++)
  47311. t.readyCallbacks[i](t.buffer);
  47312. t.readyCallbacks = []
  47313. })
  47314. }
  47315. ,
  47316. i.send(),
  47317. this
  47318. }
  47319. ,
  47320. n.AudioBuffer.prototype.onReady = function(e) {
  47321. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  47322. }
  47323. ,
  47324. n.PositionalAudio = function(e) {
  47325. n.Audio.call(this, e),
  47326. this.panner = this.context.createPanner(),
  47327. this.panner.connect(this.gain)
  47328. }
  47329. ,
  47330. n.PositionalAudio.prototype = Object.create(n.Audio.prototype),
  47331. n.PositionalAudio.prototype.constructor = n.PositionalAudio,
  47332. n.PositionalAudio.prototype.getOutput = function() {
  47333. return this.panner
  47334. }
  47335. ,
  47336. n.PositionalAudio.prototype.setRefDistance = function(e) {
  47337. this.panner.refDistance = e
  47338. }
  47339. ,
  47340. n.PositionalAudio.prototype.getRefDistance = function() {
  47341. return this.panner.refDistance
  47342. }
  47343. ,
  47344. n.PositionalAudio.prototype.setRolloffFactor = function(e) {
  47345. this.panner.rolloffFactor = e
  47346. }
  47347. ,
  47348. n.PositionalAudio.prototype.getRolloffFactor = function() {
  47349. return this.panner.rolloffFactor
  47350. }
  47351. ,
  47352. n.PositionalAudio.prototype.setDistanceModel = function(e) {
  47353. this.panner.distanceModel = e
  47354. }
  47355. ,
  47356. n.PositionalAudio.prototype.getDistanceModel = function() {
  47357. return this.panner.distanceModel
  47358. }
  47359. ,
  47360. n.PositionalAudio.prototype.setMaxDistance = function(e) {
  47361. this.panner.maxDistance = e
  47362. }
  47363. ,
  47364. n.PositionalAudio.prototype.getMaxDistance = function() {
  47365. return this.panner.maxDistance
  47366. }
  47367. ,
  47368. n.PositionalAudio.prototype.updateMatrixWorld = function() {
  47369. var e = new n.Vector3;
  47370. return function(t) {
  47371. n.Object3D.prototype.updateMatrixWorld.call(this, t),
  47372. e.setFromMatrixPosition(this.matrixWorld),
  47373. this.panner.setPosition(e.x, e.y, e.z)
  47374. }
  47375. }(),
  47376. n.AudioListener = function() {
  47377. n.Object3D.call(this),
  47378. this.type = "AudioListener",
  47379. this.context = new (window.AudioContext || window.webkitAudioContext),
  47380. this.gain = this.context.createGain(),
  47381. this.gain.connect(this.context.destination),
  47382. this.filter = null
  47383. }
  47384. ,
  47385. n.AudioListener.prototype = Object.create(n.Object3D.prototype),
  47386. n.AudioListener.prototype.constructor = n.AudioListener,
  47387. n.AudioListener.prototype.getInput = function() {
  47388. return this.gain
  47389. }
  47390. ,
  47391. n.AudioListener.prototype.removeFilter = function() {
  47392. null !== this.filter && (this.gain.disconnect(this.filter),
  47393. this.filter.disconnect(this.context.destination),
  47394. this.gain.connect(this.context.destination),
  47395. this.filter = null)
  47396. }
  47397. ,
  47398. n.AudioListener.prototype.setFilter = function(e) {
  47399. null !== this.filter ? (this.gain.disconnect(this.filter),
  47400. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  47401. this.filter = e,
  47402. this.gain.connect(this.filter),
  47403. this.filter.connect(this.context.destination)
  47404. }
  47405. ,
  47406. n.AudioListener.prototype.getFilter = function() {
  47407. return this.filter
  47408. }
  47409. ,
  47410. n.AudioListener.prototype.setMasterVolume = function(e) {
  47411. this.gain.gain.value = e
  47412. }
  47413. ,
  47414. n.AudioListener.prototype.getMasterVolume = function() {
  47415. return this.gain.gain.value
  47416. }
  47417. ,
  47418. n.AudioListener.prototype.updateMatrixWorld = function() {
  47419. var e = new n.Vector3
  47420. , t = new n.Quaternion
  47421. , i = new n.Vector3
  47422. , r = new n.Vector3;
  47423. return function(o) {
  47424. n.Object3D.prototype.updateMatrixWorld.call(this, o);
  47425. var a = this.context.listener
  47426. , s = this.up;
  47427. this.matrixWorld.decompose(e, t, i),
  47428. r.set(0, 0, -1).applyQuaternion(t),
  47429. a.setPosition(e.x, e.y, e.z),
  47430. a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z)
  47431. }
  47432. }(),
  47433. n.Camera = function() {
  47434. n.Object3D.call(this),
  47435. this.type = "Camera",
  47436. this.matrixWorldInverse = new n.Matrix4,
  47437. this.projectionMatrix = new n.Matrix4
  47438. }
  47439. ,
  47440. n.Camera.prototype = Object.create(n.Object3D.prototype),
  47441. n.Camera.prototype.constructor = n.Camera,
  47442. n.Camera.prototype.getWorldDirection = function() {
  47443. var e = new n.Quaternion;
  47444. return function(t) {
  47445. var i = t || new n.Vector3;
  47446. return this.getWorldQuaternion(e),
  47447. i.set(0, 0, -1).applyQuaternion(e)
  47448. }
  47449. }(),
  47450. n.Camera.prototype.lookAt = function() {
  47451. var e = new n.Matrix4;
  47452. return function(t) {
  47453. e.lookAt(this.position, t, this.up),
  47454. this.quaternion.setFromRotationMatrix(e)
  47455. }
  47456. }(),
  47457. n.Camera.prototype.clone = function() {
  47458. return (new this.constructor).copy(this)
  47459. }
  47460. ,
  47461. n.Camera.prototype.copy = function(e) {
  47462. return n.Object3D.prototype.copy.call(this, e),
  47463. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  47464. this.projectionMatrix.copy(e.projectionMatrix),
  47465. this
  47466. }
  47467. ,
  47468. n.CubeCamera = function(e, t, i) {
  47469. n.Object3D.call(this),
  47470. this.type = "CubeCamera";
  47471. var r = 90
  47472. , o = 1
  47473. , a = new n.PerspectiveCamera(r,o,e,t);
  47474. a.up.set(0, -1, 0),
  47475. a.lookAt(new n.Vector3(1,0,0)),
  47476. this.add(a);
  47477. var s = new n.PerspectiveCamera(r,o,e,t);
  47478. s.up.set(0, -1, 0),
  47479. s.lookAt(new n.Vector3(-1,0,0)),
  47480. this.add(s);
  47481. var l = new n.PerspectiveCamera(r,o,e,t);
  47482. l.up.set(0, 0, 1),
  47483. l.lookAt(new n.Vector3(0,1,0)),
  47484. this.add(l);
  47485. var c = new n.PerspectiveCamera(r,o,e,t);
  47486. c.up.set(0, 0, -1),
  47487. c.lookAt(new n.Vector3(0,-1,0)),
  47488. this.add(c);
  47489. var h = new n.PerspectiveCamera(r,o,e,t);
  47490. h.up.set(0, -1, 0),
  47491. h.lookAt(new n.Vector3(0,0,1)),
  47492. this.add(h);
  47493. var u = new n.PerspectiveCamera(r,o,e,t);
  47494. u.up.set(0, -1, 0),
  47495. u.lookAt(new n.Vector3(0,0,-1)),
  47496. this.add(u);
  47497. var d = {
  47498. format: n.RGBFormat,
  47499. magFilter: n.LinearFilter,
  47500. minFilter: n.LinearFilter
  47501. };
  47502. this.renderTarget = new n.WebGLRenderTargetCube(i,i,d),
  47503. this.updateCubeMap = function(e, t) {
  47504. null === this.parent && this.updateMatrixWorld();
  47505. var i = this.renderTarget
  47506. , n = i.texture.generateMipmaps;
  47507. i.texture.generateMipmaps = !1,
  47508. i.activeCubeFace = 0,
  47509. e.render(t, a, i),
  47510. i.activeCubeFace = 1,
  47511. e.render(t, s, i),
  47512. i.activeCubeFace = 2,
  47513. e.render(t, l, i),
  47514. i.activeCubeFace = 3,
  47515. e.render(t, c, i),
  47516. i.activeCubeFace = 4,
  47517. e.render(t, h, i),
  47518. i.texture.generateMipmaps = n,
  47519. i.activeCubeFace = 5,
  47520. e.render(t, u, i),
  47521. e.setRenderTarget(null)
  47522. }
  47523. }
  47524. ,
  47525. n.CubeCamera.prototype = Object.create(n.Object3D.prototype),
  47526. n.CubeCamera.prototype.constructor = n.CubeCamera,
  47527. n.OrthographicCamera = function(e, t, i, r, o, a) {
  47528. n.Camera.call(this),
  47529. this.type = "OrthographicCamera",
  47530. this.zoom = 1,
  47531. this.left = e,
  47532. this.right = t,
  47533. this.top = i,
  47534. this.bottom = r,
  47535. this.near = void 0 !== o ? o : .1,
  47536. this.far = void 0 !== a ? a : 2e3,
  47537. this.updateProjectionMatrix()
  47538. }
  47539. ,
  47540. n.OrthographicCamera.prototype = Object.create(n.Camera.prototype),
  47541. n.OrthographicCamera.prototype.constructor = n.OrthographicCamera,
  47542. n.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  47543. var e = (this.right - this.left) / (2 * this.zoom)
  47544. , t = (this.top - this.bottom) / (2 * this.zoom)
  47545. , i = (this.right + this.left) / 2
  47546. , n = (this.top + this.bottom) / 2;
  47547. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  47548. }
  47549. ,
  47550. n.OrthographicCamera.prototype.copy = function(e) {
  47551. return n.Camera.prototype.copy.call(this, e),
  47552. this.left = e.left,
  47553. this.right = e.right,
  47554. this.top = e.top,
  47555. this.bottom = e.bottom,
  47556. this.near = e.near,
  47557. this.far = e.far,
  47558. this.zoom = e.zoom,
  47559. this
  47560. }
  47561. ,
  47562. n.OrthographicCamera.prototype.toJSON = function(e) {
  47563. var t = n.Object3D.prototype.toJSON.call(this, e);
  47564. return t.object.zoom = this.zoom,
  47565. t.object.left = this.left,
  47566. t.object.right = this.right,
  47567. t.object.top = this.top,
  47568. t.object.bottom = this.bottom,
  47569. t.object.near = this.near,
  47570. t.object.far = this.far,
  47571. t
  47572. }
  47573. ,
  47574. n.PerspectiveCamera = function(e, t, i, r) {
  47575. n.Camera.call(this),
  47576. this.type = "PerspectiveCamera",
  47577. this.focalLength = 10,
  47578. this.zoom = 1,
  47579. this.fov = void 0 !== e ? e : 50,
  47580. this.aspect = void 0 !== t ? t : 1,
  47581. this.near = void 0 !== i ? i : .1,
  47582. this.far = void 0 !== r ? r : 2e3,
  47583. this.updateProjectionMatrix()
  47584. }
  47585. ,
  47586. n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype),
  47587. n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera,
  47588. n.PerspectiveCamera.prototype.setLens = function(e, t) {
  47589. void 0 === t && (t = 24),
  47590. this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e))),
  47591. this.updateProjectionMatrix()
  47592. }
  47593. ,
  47594. n.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  47595. this.fullWidth = e,
  47596. this.fullHeight = t,
  47597. this.x = i,
  47598. this.y = n,
  47599. this.width = r,
  47600. this.height = o,
  47601. this.updateProjectionMatrix()
  47602. }
  47603. ,
  47604. n.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  47605. var e = n.Math.radToDeg(2 * Math.atan(Math.tan(.5 * n.Math.degToRad(this.fov)) / this.zoom));
  47606. if (this.fullWidth) {
  47607. var t = this.fullWidth / this.fullHeight
  47608. , i = Math.tan(n.Math.degToRad(.5 * e)) * this.near
  47609. , r = -i
  47610. , o = t * r
  47611. , a = t * i
  47612. , s = Math.abs(a - o)
  47613. , l = Math.abs(i - r);
  47614. this.projectionMatrix.makeFrustum(o + this.x * s / this.fullWidth, o + (this.x + this.width) * s / this.fullWidth, i - (this.y + this.height) * l / this.fullHeight, i - this.y * l / this.fullHeight, this.near, this.far)
  47615. } else
  47616. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  47617. }
  47618. ,
  47619. n.PerspectiveCamera.prototype.copy = function(e) {
  47620. return n.Camera.prototype.copy.call(this, e),
  47621. this.focalLength = e.focalLength,
  47622. this.zoom = e.zoom,
  47623. this.fov = e.fov,
  47624. this.aspect = e.aspect,
  47625. this.near = e.near,
  47626. this.far = e.far,
  47627. this
  47628. }
  47629. ,
  47630. n.PerspectiveCamera.prototype.toJSON = function(e) {
  47631. var t = n.Object3D.prototype.toJSON.call(this, e);
  47632. return t.object.focalLength = this.focalLength,
  47633. t.object.zoom = this.zoom,
  47634. t.object.fov = this.fov,
  47635. t.object.aspect = this.aspect,
  47636. t.object.near = this.near,
  47637. t.object.far = this.far,
  47638. t
  47639. }
  47640. ,
  47641. n.StereoCamera = function() {
  47642. this.type = "StereoCamera",
  47643. this.aspect = 1,
  47644. this.cameraL = new n.PerspectiveCamera,
  47645. this.cameraL.layers.enable(1),
  47646. this.cameraL.matrixAutoUpdate = !1,
  47647. this.cameraR = new n.PerspectiveCamera,
  47648. this.cameraR.layers.enable(2),
  47649. this.cameraR.matrixAutoUpdate = !1
  47650. }
  47651. ,
  47652. n.StereoCamera.prototype = {
  47653. constructor: n.StereoCamera,
  47654. update: function() {
  47655. var e, t, i, r, o, a = new n.Matrix4, s = new n.Matrix4;
  47656. return function(l) {
  47657. var c = e !== l.focalLength || t !== l.fov || i !== l.aspect * this.aspect || r !== l.near || o !== l.far;
  47658. if (c) {
  47659. e = l.focalLength,
  47660. t = l.fov,
  47661. i = l.aspect * this.aspect,
  47662. r = l.near,
  47663. o = l.far;
  47664. var h, u, d = l.projectionMatrix.clone(), p = .032, f = p * r / e, g = r * Math.tan(n.Math.degToRad(.5 * t));
  47665. s.elements[12] = -p,
  47666. a.elements[12] = p,
  47667. h = -g * i + f,
  47668. u = g * i + f,
  47669. d.elements[0] = 2 * r / (u - h),
  47670. d.elements[8] = (u + h) / (u - h),
  47671. this.cameraL.projectionMatrix.copy(d),
  47672. h = -g * i - f,
  47673. u = g * i - f,
  47674. d.elements[0] = 2 * r / (u - h),
  47675. d.elements[8] = (u + h) / (u - h),
  47676. this.cameraR.projectionMatrix.copy(d)
  47677. }
  47678. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s),
  47679. this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a)
  47680. }
  47681. }()
  47682. },
  47683. n.Light = function(e, t) {
  47684. n.Object3D.call(this),
  47685. this.type = "Light",
  47686. this.color = new n.Color(e),
  47687. this.intensity = void 0 !== t ? t : 1,
  47688. this.receiveShadow = void 0
  47689. }
  47690. ,
  47691. n.Light.prototype = Object.create(n.Object3D.prototype),
  47692. n.Light.prototype.constructor = n.Light,
  47693. n.Light.prototype.copy = function(e) {
  47694. return n.Object3D.prototype.copy.call(this, e),
  47695. this.color.copy(e.color),
  47696. this.intensity = e.intensity,
  47697. this
  47698. }
  47699. ,
  47700. n.Light.prototype.toJSON = function(e) {
  47701. var t = n.Object3D.prototype.toJSON.call(this, e);
  47702. return t.object.color = this.color.getHex(),
  47703. t.object.intensity = this.intensity,
  47704. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  47705. void 0 !== this.distance && (t.object.distance = this.distance),
  47706. void 0 !== this.angle && (t.object.angle = this.angle),
  47707. void 0 !== this.decay && (t.object.decay = this.decay),
  47708. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  47709. t
  47710. }
  47711. ,
  47712. n.LightShadow = function(e) {
  47713. this.camera = e,
  47714. this.bias = 0,
  47715. this.radius = 1,
  47716. this.mapSize = new n.Vector2(512,512),
  47717. this.map = null,
  47718. this.matrix = new n.Matrix4
  47719. }
  47720. ,
  47721. n.LightShadow.prototype = {
  47722. constructor: n.LightShadow,
  47723. copy: function(e) {
  47724. return this.camera = e.camera.clone(),
  47725. this.bias = e.bias,
  47726. this.radius = e.radius,
  47727. this.mapSize.copy(e.mapSize),
  47728. this
  47729. },
  47730. clone: function() {
  47731. return (new this.constructor).copy(this)
  47732. }
  47733. },
  47734. n.AmbientLight = function(e, t) {
  47735. n.Light.call(this, e, t),
  47736. this.type = "AmbientLight",
  47737. this.castShadow = void 0
  47738. }
  47739. ,
  47740. n.AmbientLight.prototype = Object.create(n.Light.prototype),
  47741. n.AmbientLight.prototype.constructor = n.AmbientLight,
  47742. n.DirectionalLight = function(e, t) {
  47743. n.Light.call(this, e, t),
  47744. this.type = "DirectionalLight",
  47745. this.position.set(0, 1, 0),
  47746. this.updateMatrix(),
  47747. this.target = new n.Object3D,
  47748. this.shadow = new n.LightShadow(new n.OrthographicCamera(-5,5,5,-5,.5,500))
  47749. }
  47750. ,
  47751. n.DirectionalLight.prototype = Object.create(n.Light.prototype),
  47752. n.DirectionalLight.prototype.constructor = n.DirectionalLight,
  47753. n.DirectionalLight.prototype.copy = function(e) {
  47754. return n.Light.prototype.copy.call(this, e),
  47755. this.target = e.target.clone(),
  47756. this.shadow = e.shadow.clone(),
  47757. this
  47758. }
  47759. ,
  47760. n.HemisphereLight = function(e, t, i) {
  47761. n.Light.call(this, e, i),
  47762. this.type = "HemisphereLight",
  47763. this.castShadow = void 0,
  47764. this.position.set(0, 1, 0),
  47765. this.updateMatrix(),
  47766. this.groundColor = new n.Color(t)
  47767. }
  47768. ,
  47769. n.HemisphereLight.prototype = Object.create(n.Light.prototype),
  47770. n.HemisphereLight.prototype.constructor = n.HemisphereLight,
  47771. n.HemisphereLight.prototype.copy = function(e) {
  47772. return n.Light.prototype.copy.call(this, e),
  47773. this.groundColor.copy(e.groundColor),
  47774. this
  47775. }
  47776. ,
  47777. n.PointLight = function(e, t, i, r) {
  47778. n.Light.call(this, e, t),
  47779. this.type = "PointLight",
  47780. this.distance = void 0 !== i ? i : 0,
  47781. this.decay = void 0 !== r ? r : 1,
  47782. this.shadow = new n.LightShadow(new n.PerspectiveCamera(90,1,.5,500))
  47783. }
  47784. ,
  47785. n.PointLight.prototype = Object.create(n.Light.prototype),
  47786. n.PointLight.prototype.constructor = n.PointLight,
  47787. Object.defineProperty(n.PointLight.prototype, "power", {
  47788. get: function() {
  47789. return 4 * this.intensity * Math.PI
  47790. },
  47791. set: function(e) {
  47792. this.intensity = e / (4 * Math.PI)
  47793. }
  47794. }),
  47795. n.PointLight.prototype.copy = function(e) {
  47796. return n.Light.prototype.copy.call(this, e),
  47797. this.distance = e.distance,
  47798. this.decay = e.decay,
  47799. this.shadow = e.shadow.clone(),
  47800. this
  47801. }
  47802. ,
  47803. n.SpotLight = function(e, t, i, r, o, a) {
  47804. n.Light.call(this, e, t),
  47805. this.type = "SpotLight",
  47806. this.position.set(0, 1, 0),
  47807. this.updateMatrix(),
  47808. this.target = new n.Object3D,
  47809. this.distance = void 0 !== i ? i : 0,
  47810. this.angle = void 0 !== r ? r : Math.PI / 3,
  47811. this.penumbra = void 0 !== o ? o : 0,
  47812. this.decay = void 0 !== a ? a : 1,
  47813. this.shadow = new n.LightShadow(new n.PerspectiveCamera(50,1,.5,500))
  47814. }
  47815. ,
  47816. n.SpotLight.prototype = Object.create(n.Light.prototype),
  47817. n.SpotLight.prototype.constructor = n.SpotLight,
  47818. Object.defineProperty(n.SpotLight.prototype, "power", {
  47819. get: function() {
  47820. return this.intensity * Math.PI
  47821. },
  47822. set: function(e) {
  47823. this.intensity = e / Math.PI
  47824. }
  47825. }),
  47826. n.SpotLight.prototype.copy = function(e) {
  47827. return n.Light.prototype.copy.call(this, e),
  47828. this.distance = e.distance,
  47829. this.angle = e.angle,
  47830. this.penumbra = e.penumbra,
  47831. this.decay = e.decay,
  47832. this.target = e.target.clone(),
  47833. this.shadow = e.shadow.clone(),
  47834. this
  47835. }
  47836. ,
  47837. n.Cache = {
  47838. enabled: !1,
  47839. files: {},
  47840. add: function(e, t) {
  47841. this.enabled !== !1 && (this.files[e] = t)
  47842. },
  47843. get: function(e) {
  47844. if (this.enabled !== !1)
  47845. return this.files[e]
  47846. },
  47847. remove: function(e) {
  47848. delete this.files[e]
  47849. },
  47850. clear: function() {
  47851. this.files = {}
  47852. }
  47853. },
  47854. n.Loader = function() {
  47855. this.onLoadStart = function() {}
  47856. ,
  47857. this.onLoadProgress = function() {}
  47858. ,
  47859. this.onLoadComplete = function() {}
  47860. }
  47861. ,
  47862. n.Loader.prototype = {
  47863. constructor: n.Loader,
  47864. crossOrigin: void 0,
  47865. extractUrlBase: function(e) {
  47866. var t = e.split("/");
  47867. return 1 === t.length ? "./" : (t.pop(),
  47868. t.join("/") + "/")
  47869. },
  47870. initMaterials: function(e, t, i) {
  47871. for (var n = [], r = 0; r < e.length; ++r)
  47872. n[r] = this.createMaterial(e[r], t, i);
  47873. return n
  47874. },
  47875. createMaterial: function() {
  47876. var e, t, i;
  47877. return function(r, o, a) {
  47878. function s(e, i, r, s, c) {
  47879. var h, u = o + e, d = n.Loader.Handlers.get(u);
  47880. null !== d ? h = d.load(u) : (t.setCrossOrigin(a),
  47881. h = t.load(u)),
  47882. void 0 !== i && (h.repeat.fromArray(i),
  47883. 1 !== i[0] && (h.wrapS = n.RepeatWrapping),
  47884. 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  47885. void 0 !== r && h.offset.fromArray(r),
  47886. void 0 !== s && ("repeat" === s[0] && (h.wrapS = n.RepeatWrapping),
  47887. "mirror" === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  47888. "repeat" === s[1] && (h.wrapT = n.RepeatWrapping),
  47889. "mirror" === s[1] && (h.wrapT = n.MirroredRepeatWrapping)),
  47890. void 0 !== c && (h.anisotropy = c);
  47891. var p = n.Math.generateUUID();
  47892. return l[p] = h,
  47893. p
  47894. }
  47895. void 0 === e && (e = new n.Color),
  47896. void 0 === t && (t = new n.TextureLoader),
  47897. void 0 === i && (i = new n.MaterialLoader);
  47898. var l = {}
  47899. , c = {
  47900. uuid: n.Math.generateUUID(),
  47901. type: "MeshLambertMaterial"
  47902. };
  47903. for (var h in r) {
  47904. var u = r[h];
  47905. switch (h) {
  47906. case "DbgColor":
  47907. case "DbgIndex":
  47908. case "opticalDensity":
  47909. case "illumination":
  47910. break;
  47911. case "DbgName":
  47912. c.name = u;
  47913. break;
  47914. case "blending":
  47915. c.blending = n[u];
  47916. break;
  47917. case "colorAmbient":
  47918. case "mapAmbient":
  47919. console.warn("THREE.Loader.createMaterial:", h, "is no longer supported.");
  47920. break;
  47921. case "colorDiffuse":
  47922. c.color = e.fromArray(u).getHex();
  47923. break;
  47924. case "colorSpecular":
  47925. c.specular = e.fromArray(u).getHex();
  47926. break;
  47927. case "colorEmissive":
  47928. c.emissive = e.fromArray(u).getHex();
  47929. break;
  47930. case "specularCoef":
  47931. c.shininess = u;
  47932. break;
  47933. case "shading":
  47934. "basic" === u.toLowerCase() && (c.type = "MeshBasicMaterial"),
  47935. "phong" === u.toLowerCase() && (c.type = "MeshPhongMaterial");
  47936. break;
  47937. case "mapDiffuse":
  47938. c.map = s(u, r.mapDiffuseRepeat, r.mapDiffuseOffset, r.mapDiffuseWrap, r.mapDiffuseAnisotropy);
  47939. break;
  47940. case "mapDiffuseRepeat":
  47941. case "mapDiffuseOffset":
  47942. case "mapDiffuseWrap":
  47943. case "mapDiffuseAnisotropy":
  47944. break;
  47945. case "mapLight":
  47946. c.lightMap = s(u, r.mapLightRepeat, r.mapLightOffset, r.mapLightWrap, r.mapLightAnisotropy);
  47947. break;
  47948. case "mapLightRepeat":
  47949. case "mapLightOffset":
  47950. case "mapLightWrap":
  47951. case "mapLightAnisotropy":
  47952. break;
  47953. case "mapAO":
  47954. c.aoMap = s(u, r.mapAORepeat, r.mapAOOffset, r.mapAOWrap, r.mapAOAnisotropy);
  47955. break;
  47956. case "mapAORepeat":
  47957. case "mapAOOffset":
  47958. case "mapAOWrap":
  47959. case "mapAOAnisotropy":
  47960. break;
  47961. case "mapBump":
  47962. c.bumpMap = s(u, r.mapBumpRepeat, r.mapBumpOffset, r.mapBumpWrap, r.mapBumpAnisotropy);
  47963. break;
  47964. case "mapBumpScale":
  47965. c.bumpScale = u;
  47966. break;
  47967. case "mapBumpRepeat":
  47968. case "mapBumpOffset":
  47969. case "mapBumpWrap":
  47970. case "mapBumpAnisotropy":
  47971. break;
  47972. case "mapNormal":
  47973. c.normalMap = s(u, r.mapNormalRepeat, r.mapNormalOffset, r.mapNormalWrap, r.mapNormalAnisotropy);
  47974. break;
  47975. case "mapNormalFactor":
  47976. c.normalScale = [u, u];
  47977. break;
  47978. case "mapNormalRepeat":
  47979. case "mapNormalOffset":
  47980. case "mapNormalWrap":
  47981. case "mapNormalAnisotropy":
  47982. break;
  47983. case "mapSpecular":
  47984. c.specularMap = s(u, r.mapSpecularRepeat, r.mapSpecularOffset, r.mapSpecularWrap, r.mapSpecularAnisotropy);
  47985. break;
  47986. case "mapSpecularRepeat":
  47987. case "mapSpecularOffset":
  47988. case "mapSpecularWrap":
  47989. case "mapSpecularAnisotropy":
  47990. break;
  47991. case "mapAlpha":
  47992. c.alphaMap = s(u, r.mapAlphaRepeat, r.mapAlphaOffset, r.mapAlphaWrap, r.mapAlphaAnisotropy);
  47993. break;
  47994. case "mapAlphaRepeat":
  47995. case "mapAlphaOffset":
  47996. case "mapAlphaWrap":
  47997. case "mapAlphaAnisotropy":
  47998. break;
  47999. case "flipSided":
  48000. c.side = n.BackSide;
  48001. break;
  48002. case "doubleSided":
  48003. c.side = n.DoubleSide;
  48004. break;
  48005. case "transparency":
  48006. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  48007. c.opacity = u;
  48008. break;
  48009. case "depthTest":
  48010. case "depthWrite":
  48011. case "colorWrite":
  48012. case "opacity":
  48013. case "reflectivity":
  48014. case "transparent":
  48015. case "visible":
  48016. case "wireframe":
  48017. c[h] = u;
  48018. break;
  48019. case "vertexColors":
  48020. u === !0 && (c.vertexColors = n.VertexColors),
  48021. "face" === u && (c.vertexColors = n.FaceColors);
  48022. break;
  48023. default:
  48024. console.error("THREE.Loader.createMaterial: Unsupported", h, u)
  48025. }
  48026. }
  48027. return "MeshBasicMaterial" === c.type && delete c.emissive,
  48028. "MeshPhongMaterial" !== c.type && delete c.specular,
  48029. c.opacity < 1 && (c.transparent = !0),
  48030. i.setTextures(l),
  48031. i.parse(c)
  48032. }
  48033. }()
  48034. },
  48035. n.Loader.Handlers = {
  48036. handlers: [],
  48037. add: function(e, t) {
  48038. this.handlers.push(e, t)
  48039. },
  48040. get: function(e) {
  48041. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  48042. var r = t[i]
  48043. , o = t[i + 1];
  48044. if (r.test(e))
  48045. return o
  48046. }
  48047. return null
  48048. }
  48049. },
  48050. n.XHRLoader = function(e) {
  48051. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48052. }
  48053. ,
  48054. n.XHRLoader.prototype = {
  48055. constructor: n.XHRLoader,
  48056. load: function(e, t, i, r) {
  48057. void 0 !== this.path && (e = this.path + e);
  48058. var o = this
  48059. , a = n.Cache.get(e);
  48060. if (void 0 !== a)
  48061. return t && setTimeout(function() {
  48062. t(a)
  48063. }, 0),
  48064. a;
  48065. var s = new XMLHttpRequest;
  48066. return s.overrideMimeType("text/plain"),
  48067. s.open("GET", e, !0),
  48068. s.addEventListener("load", function(i) {
  48069. var a = i.target.response;
  48070. n.Cache.add(e, a),
  48071. 200 === this.status ? (t && t(a),
  48072. o.manager.itemEnd(e)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  48073. t && t(a),
  48074. o.manager.itemEnd(e)) : (r && r(i),
  48075. o.manager.itemError(e))
  48076. }, !1),
  48077. void 0 !== i && s.addEventListener("progress", function(e) {
  48078. i(e)
  48079. }, !1),
  48080. s.addEventListener("error", function(t) {
  48081. r && r(t),
  48082. o.manager.itemError(e)
  48083. }, !1),
  48084. void 0 !== this.responseType && (s.responseType = this.responseType),
  48085. void 0 !== this.withCredentials && (s.withCredentials = this.withCredentials),
  48086. s.send(null),
  48087. o.manager.itemStart(e),
  48088. s
  48089. },
  48090. setPath: function(e) {
  48091. this.path = e
  48092. },
  48093. setResponseType: function(e) {
  48094. this.responseType = e
  48095. },
  48096. setWithCredentials: function(e) {
  48097. this.withCredentials = e
  48098. }
  48099. },
  48100. n.FontLoader = function(e) {
  48101. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48102. }
  48103. ,
  48104. n.FontLoader.prototype = {
  48105. constructor: n.FontLoader,
  48106. load: function(e, t, i, r) {
  48107. var o = new n.XHRLoader(this.manager);
  48108. o.load(e, function(e) {
  48109. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))))
  48110. }, i, r)
  48111. }
  48112. },
  48113. n.ImageLoader = function(e) {
  48114. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48115. }
  48116. ,
  48117. n.ImageLoader.prototype = {
  48118. constructor: n.ImageLoader,
  48119. load: function(e, t, i, r) {
  48120. void 0 !== this.path && (e = this.path + e);
  48121. var o = this
  48122. , a = n.Cache.get(e);
  48123. if (void 0 !== a)
  48124. return o.manager.itemStart(e),
  48125. t ? setTimeout(function() {
  48126. t(a),
  48127. o.manager.itemEnd(e)
  48128. }, 0) : o.manager.itemEnd(e),
  48129. a;
  48130. var s = document.createElement("img");
  48131. return s.addEventListener("load", function(i) {
  48132. n.Cache.add(e, this),
  48133. t && t(this),
  48134. o.manager.itemEnd(e)
  48135. }, !1),
  48136. void 0 !== i && s.addEventListener("progress", function(e) {
  48137. i(e)
  48138. }, !1),
  48139. s.addEventListener("error", function(t) {
  48140. r && r(t),
  48141. o.manager.itemError(e)
  48142. }, !1),
  48143. void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
  48144. o.manager.itemStart(e),
  48145. s.src = e,
  48146. s
  48147. },
  48148. setCrossOrigin: function(e) {
  48149. this.crossOrigin = e
  48150. },
  48151. setPath: function(e) {
  48152. this.path = e
  48153. }
  48154. },
  48155. n.JSONLoader = function(e) {
  48156. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  48157. e = void 0),
  48158. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48159. this.withCredentials = !1
  48160. }
  48161. ,
  48162. n.JSONLoader.prototype = {
  48163. constructor: n.JSONLoader,
  48164. get statusDomElement() {
  48165. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  48166. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  48167. this._statusDomElement
  48168. },
  48169. load: function(e, t, i, r) {
  48170. var o = this
  48171. , a = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : n.Loader.prototype.extractUrlBase(e)
  48172. , s = new n.XHRLoader(this.manager);
  48173. s.setWithCredentials(this.withCredentials),
  48174. s.load(e, function(i) {
  48175. var n = JSON.parse(i)
  48176. , r = n.metadata;
  48177. if (void 0 !== r) {
  48178. var s = r.type;
  48179. if (void 0 !== s) {
  48180. if ("object" === s.toLowerCase())
  48181. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.ObjectLoader instead.");
  48182. if ("scene" === s.toLowerCase())
  48183. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.SceneLoader instead.")
  48184. }
  48185. }
  48186. var l = o.parse(n, a);
  48187. t(l.geometry, l.materials)
  48188. }, i, r)
  48189. },
  48190. setTexturePath: function(e) {
  48191. this.texturePath = e
  48192. },
  48193. parse: function(e, t) {
  48194. function i(t) {
  48195. function i(e, t) {
  48196. return e & 1 << t
  48197. }
  48198. var r, o, a, l, c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w, _, T, x, S, M, R, P, O = e.faces, L = e.vertices, D = e.normals, N = e.colors, B = 0;
  48199. if (void 0 !== e.uvs) {
  48200. for (r = 0; r < e.uvs.length; r++)
  48201. e.uvs[r].length && B++;
  48202. for (r = 0; r < B; r++)
  48203. s.faceVertexUvs[r] = []
  48204. }
  48205. for (l = 0,
  48206. c = L.length; l < c; )
  48207. E = new n.Vector3,
  48208. E.x = L[l++] * t,
  48209. E.y = L[l++] * t,
  48210. E.z = L[l++] * t,
  48211. s.vertices.push(E);
  48212. for (l = 0,
  48213. c = O.length; l < c; )
  48214. if (f = O[l++],
  48215. g = i(f, 0),
  48216. m = i(f, 1),
  48217. v = i(f, 3),
  48218. A = i(f, 4),
  48219. y = i(f, 5),
  48220. C = i(f, 6),
  48221. I = i(f, 7),
  48222. g) {
  48223. if (w = new n.Face3,
  48224. w.a = O[l],
  48225. w.b = O[l + 1],
  48226. w.c = O[l + 3],
  48227. _ = new n.Face3,
  48228. _.a = O[l + 1],
  48229. _.b = O[l + 2],
  48230. _.c = O[l + 3],
  48231. l += 4,
  48232. m && (p = O[l++],
  48233. w.materialIndex = p,
  48234. _.materialIndex = p),
  48235. a = s.faces.length,
  48236. v)
  48237. for (r = 0; r < B; r++)
  48238. for (S = e.uvs[r],
  48239. s.faceVertexUvs[r][a] = [],
  48240. s.faceVertexUvs[r][a + 1] = [],
  48241. o = 0; o < 4; o++)
  48242. d = O[l++],
  48243. R = S[2 * d],
  48244. P = S[2 * d + 1],
  48245. M = new n.Vector2(R,P),
  48246. 2 !== o && s.faceVertexUvs[r][a].push(M),
  48247. 0 !== o && s.faceVertexUvs[r][a + 1].push(M);
  48248. if (A && (u = 3 * O[l++],
  48249. w.normal.set(D[u++], D[u++], D[u]),
  48250. _.normal.copy(w.normal)),
  48251. y)
  48252. for (r = 0; r < 4; r++)
  48253. u = 3 * O[l++],
  48254. x = new n.Vector3(D[u++],D[u++],D[u]),
  48255. 2 !== r && w.vertexNormals.push(x),
  48256. 0 !== r && _.vertexNormals.push(x);
  48257. if (C && (h = O[l++],
  48258. T = N[h],
  48259. w.color.setHex(T),
  48260. _.color.setHex(T)),
  48261. I)
  48262. for (r = 0; r < 4; r++)
  48263. h = O[l++],
  48264. T = N[h],
  48265. 2 !== r && w.vertexColors.push(new n.Color(T)),
  48266. 0 !== r && _.vertexColors.push(new n.Color(T));
  48267. s.faces.push(w),
  48268. s.faces.push(_)
  48269. } else {
  48270. if (b = new n.Face3,
  48271. b.a = O[l++],
  48272. b.b = O[l++],
  48273. b.c = O[l++],
  48274. m && (p = O[l++],
  48275. b.materialIndex = p),
  48276. a = s.faces.length,
  48277. v)
  48278. for (r = 0; r < B; r++)
  48279. for (S = e.uvs[r],
  48280. s.faceVertexUvs[r][a] = [],
  48281. o = 0; o < 3; o++)
  48282. d = O[l++],
  48283. R = S[2 * d],
  48284. P = S[2 * d + 1],
  48285. M = new n.Vector2(R,P),
  48286. s.faceVertexUvs[r][a].push(M);
  48287. if (A && (u = 3 * O[l++],
  48288. b.normal.set(D[u++], D[u++], D[u])),
  48289. y)
  48290. for (r = 0; r < 3; r++)
  48291. u = 3 * O[l++],
  48292. x = new n.Vector3(D[u++],D[u++],D[u]),
  48293. b.vertexNormals.push(x);
  48294. if (C && (h = O[l++],
  48295. b.color.setHex(N[h])),
  48296. I)
  48297. for (r = 0; r < 3; r++)
  48298. h = O[l++],
  48299. b.vertexColors.push(new n.Color(N[h]));
  48300. s.faces.push(b)
  48301. }
  48302. }
  48303. function r() {
  48304. var t = void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2;
  48305. if (e.skinWeights)
  48306. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  48307. var o = e.skinWeights[i]
  48308. , a = t > 1 ? e.skinWeights[i + 1] : 0
  48309. , l = t > 2 ? e.skinWeights[i + 2] : 0
  48310. , c = t > 3 ? e.skinWeights[i + 3] : 0;
  48311. s.skinWeights.push(new n.Vector4(o,a,l,c))
  48312. }
  48313. if (e.skinIndices)
  48314. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  48315. var h = e.skinIndices[i]
  48316. , u = t > 1 ? e.skinIndices[i + 1] : 0
  48317. , d = t > 2 ? e.skinIndices[i + 2] : 0
  48318. , p = t > 3 ? e.skinIndices[i + 3] : 0;
  48319. s.skinIndices.push(new n.Vector4(h,u,d,p))
  48320. }
  48321. s.bones = e.bones,
  48322. s.bones && s.bones.length > 0 && (s.skinWeights.length !== s.skinIndices.length || s.skinIndices.length !== s.vertices.length) && console.warn("When skinning, number of vertices (" + s.vertices.length + "), skinIndices (" + s.skinIndices.length + "), and skinWeights (" + s.skinWeights.length + ") should match.")
  48323. }
  48324. function o(t) {
  48325. if (void 0 !== e.morphTargets)
  48326. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  48327. s.morphTargets[i] = {},
  48328. s.morphTargets[i].name = e.morphTargets[i].name,
  48329. s.morphTargets[i].vertices = [];
  48330. for (var o = s.morphTargets[i].vertices, a = e.morphTargets[i].vertices, l = 0, c = a.length; l < c; l += 3) {
  48331. var h = new n.Vector3;
  48332. h.x = a[l] * t,
  48333. h.y = a[l + 1] * t,
  48334. h.z = a[l + 2] * t,
  48335. o.push(h)
  48336. }
  48337. }
  48338. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  48339. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  48340. for (var u = s.faces, d = e.morphColors[0].colors, i = 0, r = u.length; i < r; i++)
  48341. u[i].color.fromArray(d, 3 * i)
  48342. }
  48343. }
  48344. function a() {
  48345. var t = []
  48346. , i = [];
  48347. void 0 !== e.animation && i.push(e.animation),
  48348. void 0 !== e.animations && (e.animations.length ? i = i.concat(e.animations) : i.push(e.animations));
  48349. for (var r = 0; r < i.length; r++) {
  48350. var o = n.AnimationClip.parseAnimation(i[r], s.bones);
  48351. o && t.push(o)
  48352. }
  48353. if (s.morphTargets) {
  48354. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets, 10);
  48355. t = t.concat(a)
  48356. }
  48357. t.length > 0 && (s.animations = t)
  48358. }
  48359. var s = new n.Geometry
  48360. , l = void 0 !== e.scale ? 1 / e.scale : 1;
  48361. if (i(l),
  48362. r(),
  48363. o(l),
  48364. a(),
  48365. s.computeFaceNormals(),
  48366. s.computeBoundingSphere(),
  48367. void 0 === e.materials || 0 === e.materials.length)
  48368. return {
  48369. geometry: s
  48370. };
  48371. var c = n.Loader.prototype.initMaterials(e.materials, t, this.crossOrigin);
  48372. return {
  48373. geometry: s,
  48374. materials: c
  48375. }
  48376. }
  48377. },
  48378. n.LoadingManager = function(e, t, i) {
  48379. var n = this
  48380. , r = !1
  48381. , o = 0
  48382. , a = 0;
  48383. this.onStart = void 0,
  48384. this.onLoad = e,
  48385. this.onProgress = t,
  48386. this.onError = i,
  48387. this.itemStart = function(e) {
  48388. a++,
  48389. r === !1 && void 0 !== n.onStart && n.onStart(e, o, a),
  48390. r = !0
  48391. }
  48392. ,
  48393. this.itemEnd = function(e) {
  48394. o++,
  48395. void 0 !== n.onProgress && n.onProgress(e, o, a),
  48396. o === a && (r = !1,
  48397. void 0 !== n.onLoad && n.onLoad())
  48398. }
  48399. ,
  48400. this.itemError = function(e) {
  48401. void 0 !== n.onError && n.onError(e)
  48402. }
  48403. }
  48404. ,
  48405. n.DefaultLoadingManager = new n.LoadingManager,
  48406. n.BufferGeometryLoader = function(e) {
  48407. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48408. }
  48409. ,
  48410. n.BufferGeometryLoader.prototype = {
  48411. constructor: n.BufferGeometryLoader,
  48412. load: function(e, t, i, r) {
  48413. var o = this
  48414. , a = new n.XHRLoader(o.manager);
  48415. a.load(e, function(e) {
  48416. t(o.parse(JSON.parse(e)))
  48417. }, i, r)
  48418. },
  48419. parse: function(e) {
  48420. var t = new n.BufferGeometry
  48421. , i = e.data.index
  48422. , r = {
  48423. Int8Array: Int8Array,
  48424. Uint8Array: Uint8Array,
  48425. Uint8ClampedArray: Uint8ClampedArray,
  48426. Int16Array: Int16Array,
  48427. Uint16Array: Uint16Array,
  48428. Int32Array: Int32Array,
  48429. Uint32Array: Uint32Array,
  48430. Float32Array: Float32Array,
  48431. Float64Array: Float64Array
  48432. };
  48433. if (void 0 !== i) {
  48434. var o = new r[i.type](i.array);
  48435. t.setIndex(new n.BufferAttribute(o,1))
  48436. }
  48437. var a = e.data.attributes;
  48438. for (var s in a) {
  48439. var l = a[s]
  48440. , o = new r[l.type](l.array);
  48441. t.addAttribute(s, new n.BufferAttribute(o,l.itemSize))
  48442. }
  48443. var c = e.data.groups || e.data.drawcalls || e.data.offsets;
  48444. if (void 0 !== c)
  48445. for (var h = 0, u = c.length; h !== u; ++h) {
  48446. var d = c[h];
  48447. t.addGroup(d.start, d.count, d.materialIndex)
  48448. }
  48449. var p = e.data.boundingSphere;
  48450. if (void 0 !== p) {
  48451. var f = new n.Vector3;
  48452. void 0 !== p.center && f.fromArray(p.center),
  48453. t.boundingSphere = new n.Sphere(f,p.radius)
  48454. }
  48455. return t
  48456. }
  48457. },
  48458. n.MaterialLoader = function(e) {
  48459. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48460. this.textures = {}
  48461. }
  48462. ,
  48463. n.MaterialLoader.prototype = {
  48464. constructor: n.MaterialLoader,
  48465. load: function(e, t, i, r) {
  48466. var o = this
  48467. , a = new n.XHRLoader(o.manager);
  48468. a.load(e, function(e) {
  48469. t(o.parse(JSON.parse(e)))
  48470. }, i, r)
  48471. },
  48472. setTextures: function(e) {
  48473. this.textures = e
  48474. },
  48475. getTexture: function(e) {
  48476. var t = this.textures;
  48477. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  48478. t[e]
  48479. },
  48480. parse: function(e) {
  48481. var t = new n[e.type];
  48482. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  48483. void 0 !== e.name && (t.name = e.name),
  48484. void 0 !== e.color && t.color.setHex(e.color),
  48485. void 0 !== e.roughness && (t.roughness = e.roughness),
  48486. void 0 !== e.metalness && (t.metalness = e.metalness),
  48487. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  48488. void 0 !== e.specular && t.specular.setHex(e.specular),
  48489. void 0 !== e.shininess && (t.shininess = e.shininess),
  48490. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  48491. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  48492. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  48493. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  48494. void 0 !== e.shading && (t.shading = e.shading),
  48495. void 0 !== e.blending && (t.blending = e.blending),
  48496. void 0 !== e.side && (t.side = e.side),
  48497. void 0 !== e.opacity && (t.opacity = e.opacity),
  48498. void 0 !== e.transparent && (t.transparent = e.transparent),
  48499. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  48500. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  48501. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  48502. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  48503. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  48504. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  48505. void 0 !== e.size && (t.size = e.size),
  48506. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  48507. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  48508. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  48509. t.transparent = !0),
  48510. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  48511. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  48512. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  48513. void 0 !== e.normalScale) {
  48514. var i = e.normalScale;
  48515. Array.isArray(i) === !1 && (i = [i, i]),
  48516. t.normalScale = (new n.Vector2).fromArray(i)
  48517. }
  48518. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  48519. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  48520. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  48521. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  48522. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  48523. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  48524. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  48525. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  48526. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  48527. t.combine = n.MultiplyOperation),
  48528. e.reflectivity && (t.reflectivity = e.reflectivity),
  48529. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  48530. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  48531. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  48532. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  48533. void 0 !== e.materials)
  48534. for (var r = 0, o = e.materials.length; r < o; r++)
  48535. t.materials.push(this.parse(e.materials[r]));
  48536. return t
  48537. }
  48538. },
  48539. n.ObjectLoader = function(e) {
  48540. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48541. this.texturePath = ""
  48542. }
  48543. ,
  48544. n.ObjectLoader.prototype = {
  48545. constructor: n.ObjectLoader,
  48546. load: function(e, t, i, r) {
  48547. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  48548. var o = this
  48549. , a = new n.XHRLoader(o.manager);
  48550. a.load(e, function(e) {
  48551. o.parse(JSON.parse(e), t)
  48552. }, i, r)
  48553. },
  48554. setTexturePath: function(e) {
  48555. this.texturePath = e
  48556. },
  48557. setCrossOrigin: function(e) {
  48558. this.crossOrigin = e
  48559. },
  48560. parse: function(e, t) {
  48561. var i = this.parseGeometries(e.geometries)
  48562. , n = this.parseImages(e.images, function() {
  48563. void 0 !== t && t(a)
  48564. })
  48565. , r = this.parseTextures(e.textures, n)
  48566. , o = this.parseMaterials(e.materials, r)
  48567. , a = this.parseObject(e.object, i, o);
  48568. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  48569. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  48570. a
  48571. },
  48572. parseGeometries: function(e) {
  48573. var t = {};
  48574. if (void 0 !== e)
  48575. for (var i = new n.JSONLoader, r = new n.BufferGeometryLoader, o = 0, a = e.length; o < a; o++) {
  48576. var s, l = e[o];
  48577. switch (l.type) {
  48578. case "PlaneGeometry":
  48579. case "PlaneBufferGeometry":
  48580. s = new n[l.type](l.width,l.height,l.widthSegments,l.heightSegments);
  48581. break;
  48582. case "BoxGeometry":
  48583. case "BoxBufferGeometry":
  48584. case "CubeGeometry":
  48585. s = new n[l.type](l.width,l.height,l.depth,l.widthSegments,l.heightSegments,l.depthSegments);
  48586. break;
  48587. case "CircleGeometry":
  48588. case "CircleBufferGeometry":
  48589. s = new n[l.type](l.radius,l.segments,l.thetaStart,l.thetaLength);
  48590. break;
  48591. case "CylinderGeometry":
  48592. case "CylinderBufferGeometry":
  48593. s = new n[l.type](l.radiusTop,l.radiusBottom,l.height,l.radialSegments,l.heightSegments,l.openEnded,l.thetaStart,l.thetaLength);
  48594. break;
  48595. case "SphereGeometry":
  48596. case "SphereBufferGeometry":
  48597. s = new n[l.type](l.radius,l.widthSegments,l.heightSegments,l.phiStart,l.phiLength,l.thetaStart,l.thetaLength);
  48598. break;
  48599. case "DodecahedronGeometry":
  48600. s = new n.DodecahedronGeometry(l.radius,l.detail);
  48601. break;
  48602. case "IcosahedronGeometry":
  48603. s = new n.IcosahedronGeometry(l.radius,l.detail);
  48604. break;
  48605. case "OctahedronGeometry":
  48606. s = new n.OctahedronGeometry(l.radius,l.detail);
  48607. break;
  48608. case "TetrahedronGeometry":
  48609. s = new n.TetrahedronGeometry(l.radius,l.detail);
  48610. break;
  48611. case "RingGeometry":
  48612. case "RingBufferGeometry":
  48613. s = new n[l.type](l.innerRadius,l.outerRadius,l.thetaSegments,l.phiSegments,l.thetaStart,l.thetaLength);
  48614. break;
  48615. case "TorusGeometry":
  48616. case "TorusBufferGeometry":
  48617. s = new n[l.type](l.radius,l.tube,l.radialSegments,l.tubularSegments,l.arc);
  48618. break;
  48619. case "TorusKnotGeometry":
  48620. case "TorusKnotBufferGeometry":
  48621. s = new n[l.type](l.radius,l.tube,l.tubularSegments,l.radialSegments,l.p,l.q);
  48622. break;
  48623. case "LatheGeometry":
  48624. s = new n.LatheGeometry(l.points,l.segments,l.phiStart,l.phiLength);
  48625. break;
  48626. case "BufferGeometry":
  48627. s = r.parse(l);
  48628. break;
  48629. case "Geometry":
  48630. s = i.parse(l.data, this.texturePath).geometry;
  48631. break;
  48632. default:
  48633. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + l.type + '"');
  48634. continue
  48635. }
  48636. s.uuid = l.uuid,
  48637. void 0 !== l.name && (s.name = l.name),
  48638. t[l.uuid] = s
  48639. }
  48640. return t
  48641. },
  48642. parseMaterials: function(e, t) {
  48643. var i = {};
  48644. if (void 0 !== e) {
  48645. var r = new n.MaterialLoader;
  48646. r.setTextures(t);
  48647. for (var o = 0, a = e.length; o < a; o++) {
  48648. var s = r.parse(e[o]);
  48649. i[s.uuid] = s
  48650. }
  48651. }
  48652. return i
  48653. },
  48654. parseAnimations: function(e) {
  48655. for (var t = [], i = 0; i < e.length; i++) {
  48656. var r = n.AnimationClip.parse(e[i]);
  48657. t.push(r)
  48658. }
  48659. return t
  48660. },
  48661. parseImages: function(e, t) {
  48662. function i(e) {
  48663. return r.manager.itemStart(e),
  48664. s.load(e, function() {
  48665. r.manager.itemEnd(e)
  48666. })
  48667. }
  48668. var r = this
  48669. , o = {};
  48670. if (void 0 !== e && e.length > 0) {
  48671. var a = new n.LoadingManager(t)
  48672. , s = new n.ImageLoader(a);
  48673. s.setCrossOrigin(this.crossOrigin);
  48674. for (var l = 0, c = e.length; l < c; l++) {
  48675. var h = e[l]
  48676. , u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : r.texturePath + h.url;
  48677. o[h.uuid] = i(u)
  48678. }
  48679. }
  48680. return o
  48681. },
  48682. parseTextures: function(e, t) {
  48683. function i(e) {
  48684. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  48685. n[e])
  48686. }
  48687. var r = {};
  48688. if (void 0 !== e)
  48689. for (var o = 0, a = e.length; o < a; o++) {
  48690. var s = e[o];
  48691. void 0 === s.image && console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid),
  48692. void 0 === t[s.image] && console.warn("THREE.ObjectLoader: Undefined image", s.image);
  48693. var l = new n.Texture(t[s.image]);
  48694. l.needsUpdate = !0,
  48695. l.uuid = s.uuid,
  48696. void 0 !== s.name && (l.name = s.name),
  48697. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  48698. void 0 !== s.offset && (l.offset = new n.Vector2(s.offset[0],s.offset[1])),
  48699. void 0 !== s.repeat && (l.repeat = new n.Vector2(s.repeat[0],s.repeat[1])),
  48700. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  48701. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  48702. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  48703. Array.isArray(s.wrap) && (l.wrapS = i(s.wrap[0]),
  48704. l.wrapT = i(s.wrap[1])),
  48705. r[s.uuid] = l
  48706. }
  48707. return r
  48708. },
  48709. parseObject: function() {
  48710. var e = new n.Matrix4;
  48711. return function(t, i, r) {
  48712. function o(e) {
  48713. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  48714. i[e]
  48715. }
  48716. function a(e) {
  48717. if (void 0 !== e)
  48718. return void 0 === r[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  48719. r[e]
  48720. }
  48721. var s;
  48722. switch (t.type) {
  48723. case "Scene":
  48724. s = new n.Scene;
  48725. break;
  48726. case "PerspectiveCamera":
  48727. s = new n.PerspectiveCamera(t.fov,t.aspect,t.near,t.far);
  48728. break;
  48729. case "OrthographicCamera":
  48730. s = new n.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);
  48731. break;
  48732. case "AmbientLight":
  48733. s = new n.AmbientLight(t.color,t.intensity);
  48734. break;
  48735. case "DirectionalLight":
  48736. s = new n.DirectionalLight(t.color,t.intensity);
  48737. break;
  48738. case "PointLight":
  48739. s = new n.PointLight(t.color,t.intensity,t.distance,t.decay);
  48740. break;
  48741. case "SpotLight":
  48742. s = new n.SpotLight(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);
  48743. break;
  48744. case "HemisphereLight":
  48745. s = new n.HemisphereLight(t.color,t.groundColor,t.intensity);
  48746. break;
  48747. case "Mesh":
  48748. var l = o(t.geometry)
  48749. , c = a(t.material);
  48750. s = l.bones && l.bones.length > 0 ? new n.SkinnedMesh(l,c) : new n.Mesh(l,c);
  48751. break;
  48752. case "LOD":
  48753. s = new n.LOD;
  48754. break;
  48755. case "Line":
  48756. s = new n.Line(o(t.geometry),a(t.material),t.mode);
  48757. break;
  48758. case "PointCloud":
  48759. case "Points":
  48760. s = new n.Points(o(t.geometry),a(t.material));
  48761. break;
  48762. case "Sprite":
  48763. s = new n.Sprite(a(t.material));
  48764. break;
  48765. case "Group":
  48766. s = new n.Group;
  48767. break;
  48768. default:
  48769. s = new n.Object3D
  48770. }
  48771. if (s.uuid = t.uuid,
  48772. void 0 !== t.name && (s.name = t.name),
  48773. void 0 !== t.matrix ? (e.fromArray(t.matrix),
  48774. e.decompose(s.position, s.quaternion, s.scale)) : (void 0 !== t.position && s.position.fromArray(t.position),
  48775. void 0 !== t.rotation && s.rotation.fromArray(t.rotation),
  48776. void 0 !== t.scale && s.scale.fromArray(t.scale)),
  48777. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  48778. void 0 !== t.receiveShadow && (s.receiveShadow = t.receiveShadow),
  48779. void 0 !== t.visible && (s.visible = t.visible),
  48780. void 0 !== t.userData && (s.userData = t.userData),
  48781. void 0 !== t.children)
  48782. for (var h in t.children)
  48783. s.add(this.parseObject(t.children[h], i, r));
  48784. if ("LOD" === t.type)
  48785. for (var u = t.levels, d = 0; d < u.length; d++) {
  48786. var p = u[d]
  48787. , h = s.getObjectByProperty("uuid", p.object);
  48788. void 0 !== h && s.addLevel(h, p.distance)
  48789. }
  48790. return s
  48791. }
  48792. }()
  48793. },
  48794. n.TextureLoader = function(e) {
  48795. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48796. }
  48797. ,
  48798. n.TextureLoader.prototype = {
  48799. constructor: n.TextureLoader,
  48800. load: function(e, t, i, r) {
  48801. var o = new n.Texture
  48802. , a = new n.ImageLoader(this.manager);
  48803. return a.setCrossOrigin(this.crossOrigin),
  48804. a.setPath(this.path),
  48805. a.load(e, function(e) {
  48806. o.image = e,
  48807. o.needsUpdate = !0,
  48808. void 0 !== t && t(o)
  48809. }, i, r),
  48810. o
  48811. },
  48812. setCrossOrigin: function(e) {
  48813. this.crossOrigin = e
  48814. },
  48815. setPath: function(e) {
  48816. this.path = e
  48817. }
  48818. },
  48819. n.CubeTextureLoader = function(e) {
  48820. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48821. }
  48822. ,
  48823. n.CubeTextureLoader.prototype = {
  48824. constructor: n.CubeTextureLoader,
  48825. load: function(e, t, i, r) {
  48826. function o(i) {
  48827. s.load(e[i], function(e) {
  48828. a.images[i] = e,
  48829. l++,
  48830. 6 === l && (a.needsUpdate = !0,
  48831. t && t(a))
  48832. }, void 0, r)
  48833. }
  48834. var a = new n.CubeTexture
  48835. , s = new n.ImageLoader(this.manager);
  48836. s.setCrossOrigin(this.crossOrigin),
  48837. s.setPath(this.path);
  48838. for (var l = 0, c = 0; c < e.length; ++c)
  48839. o(c);
  48840. return a
  48841. },
  48842. setCrossOrigin: function(e) {
  48843. this.crossOrigin = e
  48844. },
  48845. setPath: function(e) {
  48846. this.path = e
  48847. }
  48848. },
  48849. n.DataTextureLoader = n.BinaryTextureLoader = function(e) {
  48850. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48851. this._parser = null
  48852. }
  48853. ,
  48854. n.BinaryTextureLoader.prototype = {
  48855. constructor: n.BinaryTextureLoader,
  48856. load: function(e, t, i, r) {
  48857. var o = this
  48858. , a = new n.DataTexture
  48859. , s = new n.XHRLoader(this.manager);
  48860. return s.setResponseType("arraybuffer"),
  48861. s.load(e, function(e) {
  48862. var i = o._parser(e);
  48863. i && (void 0 !== i.image ? a.image = i.image : void 0 !== i.data && (a.image.width = i.width,
  48864. a.image.height = i.height,
  48865. a.image.data = i.data),
  48866. a.wrapS = void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping,
  48867. a.wrapT = void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping,
  48868. a.magFilter = void 0 !== i.magFilter ? i.magFilter : n.LinearFilter,
  48869. a.minFilter = void 0 !== i.minFilter ? i.minFilter : n.LinearMipMapLinearFilter,
  48870. a.anisotropy = void 0 !== i.anisotropy ? i.anisotropy : 1,
  48871. void 0 !== i.format && (a.format = i.format),
  48872. void 0 !== i.type && (a.type = i.type),
  48873. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  48874. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  48875. a.needsUpdate = !0,
  48876. t && t(a, i))
  48877. }, i, r),
  48878. a
  48879. }
  48880. },
  48881. n.CompressedTextureLoader = function(e) {
  48882. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48883. this._parser = null
  48884. }
  48885. ;
  48886. n.CompressedTextureLoader.prototype = {
  48887. constructor: n.CompressedTextureLoader,
  48888. load: function(e, t, i, r) {
  48889. function o(o) {
  48890. c.load(e[o], function(e) {
  48891. var i = a._parser(e, !0);
  48892. s[o] = {
  48893. width: i.width,
  48894. height: i.height,
  48895. format: i.format,
  48896. mipmaps: i.mipmaps
  48897. },
  48898. h += 1,
  48899. 6 === h && (1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  48900. l.format = i.format,
  48901. l.needsUpdate = !0,
  48902. t && t(l))
  48903. }, i, r)
  48904. }
  48905. var a = this
  48906. , s = []
  48907. , l = new n.CompressedTexture;
  48908. l.image = s;
  48909. var c = new n.XHRLoader(this.manager);
  48910. if (c.setPath(this.path),
  48911. c.setResponseType("arraybuffer"),
  48912. Array.isArray(e))
  48913. for (var h = 0, u = 0, d = e.length; u < d; ++u)
  48914. o(u);
  48915. else
  48916. c.load(e, function(e) {
  48917. var i = a._parser(e, !0);
  48918. if (i.isCubemap)
  48919. for (var r = i.mipmaps.length / i.mipmapCount, o = 0; o < r; o++) {
  48920. s[o] = {
  48921. mipmaps: []
  48922. };
  48923. for (var c = 0; c < i.mipmapCount; c++)
  48924. s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]),
  48925. s[o].format = i.format,
  48926. s[o].width = i.width,
  48927. s[o].height = i.height
  48928. }
  48929. else
  48930. l.image.width = i.width,
  48931. l.image.height = i.height,
  48932. l.mipmaps = i.mipmaps;
  48933. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  48934. l.format = i.format,
  48935. l.needsUpdate = !0,
  48936. t && t(l)
  48937. }, i, r);
  48938. return l
  48939. },
  48940. setPath: function(e) {
  48941. this.path = e
  48942. }
  48943. };
  48944. n.Material = function() {
  48945. Object.defineProperty(this, "id", {
  48946. value: n.MaterialIdCount++
  48947. }),
  48948. this.uuid = n.Math.generateUUID(),
  48949. this.name = "",
  48950. this.type = "Material",
  48951. this.side = n.FrontSide,
  48952. this.opacity = 1,
  48953. this.transparent = !1,
  48954. this.blending = n.NormalBlending,
  48955. this.blendSrc = n.SrcAlphaFactor,
  48956. this.blendDst = n.OneMinusSrcAlphaFactor,
  48957. this.blendEquation = n.AddEquation,
  48958. this.blendSrcAlpha = null,
  48959. this.blendDstAlpha = null,
  48960. this.blendEquationAlpha = null,
  48961. this.depthFunc = n.LessEqualDepth,
  48962. this.depthTest = !0,
  48963. this.depthWrite = !0,
  48964. this.colorWrite = !0,
  48965. this.precision = null,
  48966. this.polygonOffset = !1,
  48967. this.polygonOffsetFactor = 0,
  48968. this.polygonOffsetUnits = 0,
  48969. this.alphaTest = 0,
  48970. this.premultipliedAlpha = !1,
  48971. this.overdraw = 0,
  48972. this.visible = !0,
  48973. this._needsUpdate = !0
  48974. }
  48975. ,
  48976. n.Material.prototype = {
  48977. constructor: n.Material,
  48978. get needsUpdate() {
  48979. return this._needsUpdate
  48980. },
  48981. set needsUpdate(e) {
  48982. e === !0 && this.update(),
  48983. this._needsUpdate = e
  48984. },
  48985. setValues: function(e) {
  48986. if (void 0 !== e)
  48987. for (var t in e) {
  48988. var i = e[t];
  48989. if (void 0 !== i) {
  48990. var r = this[t];
  48991. void 0 !== r ? r instanceof n.Color ? r.set(i) : r instanceof n.Vector3 && i instanceof n.Vector3 ? r.copy(i) : "overdraw" === t ? this[t] = Number(i) : this[t] = i : console.warn("THREE." + this.type + ": '" + t + "' is not a property of this material.")
  48992. } else
  48993. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  48994. }
  48995. },
  48996. toJSON: function(e) {
  48997. function t(e) {
  48998. var t = [];
  48999. for (var i in e) {
  49000. var n = e[i];
  49001. delete n.metadata,
  49002. t.push(n)
  49003. }
  49004. return t
  49005. }
  49006. var i = void 0 === e;
  49007. i && (e = {
  49008. textures: {},
  49009. images: {}
  49010. });
  49011. var r = {
  49012. metadata: {
  49013. version: 4.4,
  49014. type: "Material",
  49015. generator: "Material.toJSON"
  49016. }
  49017. };
  49018. if (r.uuid = this.uuid,
  49019. r.type = this.type,
  49020. "" !== this.name && (r.name = this.name),
  49021. this.color instanceof n.Color && (r.color = this.color.getHex()),
  49022. .5 !== this.roughness && (r.roughness = this.roughness),
  49023. .5 !== this.metalness && (r.metalness = this.metalness),
  49024. this.emissive instanceof n.Color && (r.emissive = this.emissive.getHex()),
  49025. this.specular instanceof n.Color && (r.specular = this.specular.getHex()),
  49026. void 0 !== this.shininess && (r.shininess = this.shininess),
  49027. this.map instanceof n.Texture && (r.map = this.map.toJSON(e).uuid),
  49028. this.alphaMap instanceof n.Texture && (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  49029. this.lightMap instanceof n.Texture && (r.lightMap = this.lightMap.toJSON(e).uuid),
  49030. this.bumpMap instanceof n.Texture && (r.bumpMap = this.bumpMap.toJSON(e).uuid,
  49031. r.bumpScale = this.bumpScale),
  49032. this.normalMap instanceof n.Texture && (r.normalMap = this.normalMap.toJSON(e).uuid,
  49033. r.normalScale = this.normalScale.toArray()),
  49034. this.displacementMap instanceof n.Texture && (r.displacementMap = this.displacementMap.toJSON(e).uuid,
  49035. r.displacementScale = this.displacementScale,
  49036. r.displacementBias = this.displacementBias),
  49037. this.roughnessMap instanceof n.Texture && (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  49038. this.metalnessMap instanceof n.Texture && (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  49039. this.emissiveMap instanceof n.Texture && (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  49040. this.specularMap instanceof n.Texture && (r.specularMap = this.specularMap.toJSON(e).uuid),
  49041. this.envMap instanceof n.Texture && (r.envMap = this.envMap.toJSON(e).uuid,
  49042. r.reflectivity = this.reflectivity),
  49043. void 0 !== this.size && (r.size = this.size),
  49044. void 0 !== this.sizeAttenuation && (r.sizeAttenuation = this.sizeAttenuation),
  49045. void 0 !== this.vertexColors && this.vertexColors !== n.NoColors && (r.vertexColors = this.vertexColors),
  49046. void 0 !== this.shading && this.shading !== n.SmoothShading && (r.shading = this.shading),
  49047. void 0 !== this.blending && this.blending !== n.NormalBlending && (r.blending = this.blending),
  49048. void 0 !== this.side && this.side !== n.FrontSide && (r.side = this.side),
  49049. this.opacity < 1 && (r.opacity = this.opacity),
  49050. this.transparent === !0 && (r.transparent = this.transparent),
  49051. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  49052. this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha),
  49053. this.wireframe === !0 && (r.wireframe = this.wireframe),
  49054. this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth),
  49055. i) {
  49056. var o = t(e.textures)
  49057. , a = t(e.images);
  49058. o.length > 0 && (r.textures = o),
  49059. a.length > 0 && (r.images = a)
  49060. }
  49061. return r
  49062. },
  49063. clone: function() {
  49064. return (new this.constructor).copy(this)
  49065. },
  49066. copy: function(e) {
  49067. return this.name = e.name,
  49068. this.side = e.side,
  49069. this.opacity = e.opacity,
  49070. this.transparent = e.transparent,
  49071. this.blending = e.blending,
  49072. this.blendSrc = e.blendSrc,
  49073. this.blendDst = e.blendDst,
  49074. this.blendEquation = e.blendEquation,
  49075. this.blendSrcAlpha = e.blendSrcAlpha,
  49076. this.blendDstAlpha = e.blendDstAlpha,
  49077. this.blendEquationAlpha = e.blendEquationAlpha,
  49078. this.depthFunc = e.depthFunc,
  49079. this.depthTest = e.depthTest,
  49080. this.depthWrite = e.depthWrite,
  49081. this.colorWrite = e.colorWrite,
  49082. this.precision = e.precision,
  49083. this.polygonOffset = e.polygonOffset,
  49084. this.polygonOffsetFactor = e.polygonOffsetFactor,
  49085. this.polygonOffsetUnits = e.polygonOffsetUnits,
  49086. this.alphaTest = e.alphaTest,
  49087. this.premultipliedAlpha = e.premultipliedAlpha,
  49088. this.overdraw = e.overdraw,
  49089. this.visible = e.visible,
  49090. this
  49091. },
  49092. update: function() {
  49093. this.dispatchEvent({
  49094. type: "update"
  49095. })
  49096. },
  49097. dispose: function() {
  49098. this.dispatchEvent({
  49099. type: "dispose"
  49100. })
  49101. }
  49102. },
  49103. n.EventDispatcher.prototype.apply(n.Material.prototype),
  49104. n.MaterialIdCount = 0,
  49105. n.LineBasicMaterial = function(e) {
  49106. n.Material.call(this),
  49107. this.type = "LineBasicMaterial",
  49108. this.color = new n.Color(16777215),
  49109. this.linewidth = 1,
  49110. this.linecap = "round",
  49111. this.linejoin = "round",
  49112. this.blending = n.NormalBlending,
  49113. this.vertexColors = n.NoColors,
  49114. this.fog = !0,
  49115. this.setValues(e)
  49116. }
  49117. ,
  49118. n.LineBasicMaterial.prototype = Object.create(n.Material.prototype),
  49119. n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial,
  49120. n.LineBasicMaterial.prototype.copy = function(e) {
  49121. return n.Material.prototype.copy.call(this, e),
  49122. this.color.copy(e.color),
  49123. this.linewidth = e.linewidth,
  49124. this.linecap = e.linecap,
  49125. this.linejoin = e.linejoin,
  49126. this.vertexColors = e.vertexColors,
  49127. this.fog = e.fog,
  49128. this
  49129. }
  49130. ,
  49131. n.LineDashedMaterial = function(e) {
  49132. n.Material.call(this),
  49133. this.type = "LineDashedMaterial",
  49134. this.color = new n.Color(16777215),
  49135. this.linewidth = 1,
  49136. this.scale = 1,
  49137. this.dashSize = 3,
  49138. this.gapSize = 1,
  49139. this.blending = n.NormalBlending,
  49140. this.vertexColors = n.NoColors,
  49141. this.fog = !0,
  49142. this.setValues(e)
  49143. }
  49144. ,
  49145. n.LineDashedMaterial.prototype = Object.create(n.Material.prototype),
  49146. n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial,
  49147. n.LineDashedMaterial.prototype.copy = function(e) {
  49148. return n.Material.prototype.copy.call(this, e),
  49149. this.color.copy(e.color),
  49150. this.linewidth = e.linewidth,
  49151. this.scale = e.scale,
  49152. this.dashSize = e.dashSize,
  49153. this.gapSize = e.gapSize,
  49154. this.vertexColors = e.vertexColors,
  49155. this.fog = e.fog,
  49156. this
  49157. }
  49158. ,
  49159. n.MeshBasicMaterial = function(e) {
  49160. n.Material.call(this),
  49161. this.type = "MeshBasicMaterial",
  49162. this.color = new n.Color(16777215),
  49163. this.map = null,
  49164. this.aoMap = null,
  49165. this.aoMapIntensity = 1,
  49166. this.specularMap = null,
  49167. this.alphaMap = null,
  49168. this.envMap = null,
  49169. this.combine = n.MultiplyOperation,
  49170. this.reflectivity = 1,
  49171. this.refractionRatio = .98,
  49172. this.fog = !0,
  49173. this.shading = n.SmoothShading,
  49174. this.blending = n.NormalBlending,
  49175. this.wireframe = !1,
  49176. this.wireframeLinewidth = 1,
  49177. this.wireframeLinecap = "round",
  49178. this.wireframeLinejoin = "round",
  49179. this.vertexColors = n.NoColors,
  49180. this.skinning = !1,
  49181. this.morphTargets = !1,
  49182. this.setValues(e)
  49183. }
  49184. ,
  49185. n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype),
  49186. n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial,
  49187. n.MeshBasicMaterial.prototype.copy = function(e) {
  49188. return n.Material.prototype.copy.call(this, e),
  49189. this.color.copy(e.color),
  49190. this.map = e.map,
  49191. this.aoMap = e.aoMap,
  49192. this.aoMapIntensity = e.aoMapIntensity,
  49193. this.specularMap = e.specularMap,
  49194. this.alphaMap = e.alphaMap,
  49195. this.envMap = e.envMap,
  49196. this.combine = e.combine,
  49197. this.reflectivity = e.reflectivity,
  49198. this.refractionRatio = e.refractionRatio,
  49199. this.fog = e.fog,
  49200. this.shading = e.shading,
  49201. this.wireframe = e.wireframe,
  49202. this.wireframeLinewidth = e.wireframeLinewidth,
  49203. this.wireframeLinecap = e.wireframeLinecap,
  49204. this.wireframeLinejoin = e.wireframeLinejoin,
  49205. this.vertexColors = e.vertexColors,
  49206. this.skinning = e.skinning,
  49207. this.morphTargets = e.morphTargets,
  49208. this
  49209. }
  49210. ,
  49211. n.MeshLambertMaterial = function(e) {
  49212. n.Material.call(this),
  49213. this.type = "MeshLambertMaterial",
  49214. this.color = new n.Color(16777215),
  49215. this.map = null,
  49216. this.lightMap = null,
  49217. this.lightMapIntensity = 1,
  49218. this.aoMap = null,
  49219. this.aoMapIntensity = 1,
  49220. this.emissive = new n.Color(0),
  49221. this.emissiveIntensity = 1,
  49222. this.emissiveMap = null,
  49223. this.specularMap = null,
  49224. this.alphaMap = null,
  49225. this.envMap = null,
  49226. this.combine = n.MultiplyOperation,
  49227. this.reflectivity = 1,
  49228. this.refractionRatio = .98,
  49229. this.fog = !0,
  49230. this.blending = n.NormalBlending,
  49231. this.wireframe = !1,
  49232. this.wireframeLinewidth = 1,
  49233. this.wireframeLinecap = "round",
  49234. this.wireframeLinejoin = "round",
  49235. this.vertexColors = n.NoColors,
  49236. this.skinning = !1,
  49237. this.morphTargets = !1,
  49238. this.morphNormals = !1,
  49239. this.setValues(e)
  49240. }
  49241. ,
  49242. n.MeshLambertMaterial.prototype = Object.create(n.Material.prototype),
  49243. n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial,
  49244. n.MeshLambertMaterial.prototype.copy = function(e) {
  49245. return n.Material.prototype.copy.call(this, e),
  49246. this.color.copy(e.color),
  49247. this.map = e.map,
  49248. this.lightMap = e.lightMap,
  49249. this.lightMapIntensity = e.lightMapIntensity,
  49250. this.aoMap = e.aoMap,
  49251. this.aoMapIntensity = e.aoMapIntensity,
  49252. this.emissive.copy(e.emissive),
  49253. this.emissiveMap = e.emissiveMap,
  49254. this.emissiveIntensity = e.emissiveIntensity,
  49255. this.specularMap = e.specularMap,
  49256. this.alphaMap = e.alphaMap,
  49257. this.envMap = e.envMap,
  49258. this.combine = e.combine,
  49259. this.reflectivity = e.reflectivity,
  49260. this.refractionRatio = e.refractionRatio,
  49261. this.fog = e.fog,
  49262. this.wireframe = e.wireframe,
  49263. this.wireframeLinewidth = e.wireframeLinewidth,
  49264. this.wireframeLinecap = e.wireframeLinecap,
  49265. this.wireframeLinejoin = e.wireframeLinejoin,
  49266. this.vertexColors = e.vertexColors,
  49267. this.skinning = e.skinning,
  49268. this.morphTargets = e.morphTargets,
  49269. this.morphNormals = e.morphNormals,
  49270. this
  49271. }
  49272. ,
  49273. n.MeshPhongMaterial = function(e) {
  49274. n.Material.call(this),
  49275. this.type = "MeshPhongMaterial",
  49276. this.color = new n.Color(16777215),
  49277. this.specular = new n.Color(1118481),
  49278. this.shininess = 30,
  49279. this.map = null,
  49280. this.lightMap = null,
  49281. this.lightMapIntensity = 1,
  49282. this.aoMap = null,
  49283. this.aoMapIntensity = 1,
  49284. this.emissive = new n.Color(0),
  49285. this.emissiveIntensity = 1,
  49286. this.emissiveMap = null,
  49287. this.bumpMap = null,
  49288. this.bumpScale = 1,
  49289. this.normalMap = null,
  49290. this.normalScale = new n.Vector2(1,1),
  49291. this.displacementMap = null,
  49292. this.displacementScale = 1,
  49293. this.displacementBias = 0,
  49294. this.specularMap = null,
  49295. this.alphaMap = null,
  49296. this.envMap = null,
  49297. this.combine = n.MultiplyOperation,
  49298. this.reflectivity = 1,
  49299. this.refractionRatio = .98,
  49300. this.fog = !0,
  49301. this.shading = n.SmoothShading,
  49302. this.blending = n.NormalBlending,
  49303. this.wireframe = !1,
  49304. this.wireframeLinewidth = 1,
  49305. this.wireframeLinecap = "round",
  49306. this.wireframeLinejoin = "round",
  49307. this.vertexColors = n.NoColors,
  49308. this.skinning = !1,
  49309. this.morphTargets = !1,
  49310. this.morphNormals = !1,
  49311. this.setValues(e)
  49312. }
  49313. ,
  49314. n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype),
  49315. n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial,
  49316. n.MeshPhongMaterial.prototype.copy = function(e) {
  49317. return n.Material.prototype.copy.call(this, e),
  49318. this.color.copy(e.color),
  49319. this.specular.copy(e.specular),
  49320. this.shininess = e.shininess,
  49321. this.map = e.map,
  49322. this.lightMap = e.lightMap,
  49323. this.lightMapIntensity = e.lightMapIntensity,
  49324. this.aoMap = e.aoMap,
  49325. this.aoMapIntensity = e.aoMapIntensity,
  49326. this.emissive.copy(e.emissive),
  49327. this.emissiveMap = e.emissiveMap,
  49328. this.emissiveIntensity = e.emissiveIntensity,
  49329. this.bumpMap = e.bumpMap,
  49330. this.bumpScale = e.bumpScale,
  49331. this.normalMap = e.normalMap,
  49332. this.normalScale.copy(e.normalScale),
  49333. this.displacementMap = e.displacementMap,
  49334. this.displacementScale = e.displacementScale,
  49335. this.displacementBias = e.displacementBias,
  49336. this.specularMap = e.specularMap,
  49337. this.alphaMap = e.alphaMap,
  49338. this.envMap = e.envMap,
  49339. this.combine = e.combine,
  49340. this.reflectivity = e.reflectivity,
  49341. this.refractionRatio = e.refractionRatio,
  49342. this.fog = e.fog,
  49343. this.shading = e.shading,
  49344. this.wireframe = e.wireframe,
  49345. this.wireframeLinewidth = e.wireframeLinewidth,
  49346. this.wireframeLinecap = e.wireframeLinecap,
  49347. this.wireframeLinejoin = e.wireframeLinejoin,
  49348. this.vertexColors = e.vertexColors,
  49349. this.skinning = e.skinning,
  49350. this.morphTargets = e.morphTargets,
  49351. this.morphNormals = e.morphNormals,
  49352. this
  49353. }
  49354. ,
  49355. n.MeshStandardMaterial = function(e) {
  49356. n.Material.call(this),
  49357. this.type = "MeshStandardMaterial",
  49358. this.color = new n.Color(16777215),
  49359. this.roughness = .5,
  49360. this.metalness = .5,
  49361. this.map = null,
  49362. this.lightMap = null,
  49363. this.lightMapIntensity = 1,
  49364. this.aoMap = null,
  49365. this.aoMapIntensity = 1,
  49366. this.emissive = new n.Color(0),
  49367. this.emissiveIntensity = 1,
  49368. this.emissiveMap = null,
  49369. this.bumpMap = null,
  49370. this.bumpScale = 1,
  49371. this.normalMap = null,
  49372. this.normalScale = new n.Vector2(1,1),
  49373. this.displacementMap = null,
  49374. this.displacementScale = 1,
  49375. this.displacementBias = 0,
  49376. this.roughnessMap = null,
  49377. this.metalnessMap = null,
  49378. this.alphaMap = null,
  49379. this.envMap = null,
  49380. this.envMapIntensity = 1,
  49381. this.refractionRatio = .98,
  49382. this.fog = !0,
  49383. this.shading = n.SmoothShading,
  49384. this.blending = n.NormalBlending,
  49385. this.wireframe = !1,
  49386. this.wireframeLinewidth = 1,
  49387. this.wireframeLinecap = "round",
  49388. this.wireframeLinejoin = "round",
  49389. this.vertexColors = n.NoColors,
  49390. this.skinning = !1,
  49391. this.morphTargets = !1,
  49392. this.morphNormals = !1,
  49393. this.setValues(e)
  49394. }
  49395. ,
  49396. n.MeshStandardMaterial.prototype = Object.create(n.Material.prototype),
  49397. n.MeshStandardMaterial.prototype.constructor = n.MeshStandardMaterial,
  49398. n.MeshStandardMaterial.prototype.copy = function(e) {
  49399. return n.Material.prototype.copy.call(this, e),
  49400. this.color.copy(e.color),
  49401. this.roughness = e.roughness,
  49402. this.metalness = e.metalness,
  49403. this.map = e.map,
  49404. this.lightMap = e.lightMap,
  49405. this.lightMapIntensity = e.lightMapIntensity,
  49406. this.aoMap = e.aoMap,
  49407. this.aoMapIntensity = e.aoMapIntensity,
  49408. this.emissive.copy(e.emissive),
  49409. this.emissiveMap = e.emissiveMap,
  49410. this.emissiveIntensity = e.emissiveIntensity,
  49411. this.bumpMap = e.bumpMap,
  49412. this.bumpScale = e.bumpScale,
  49413. this.normalMap = e.normalMap,
  49414. this.normalScale.copy(e.normalScale),
  49415. this.displacementMap = e.displacementMap,
  49416. this.displacementScale = e.displacementScale,
  49417. this.displacementBias = e.displacementBias,
  49418. this.roughnessMap = e.roughnessMap,
  49419. this.metalnessMap = e.metalnessMap,
  49420. this.alphaMap = e.alphaMap,
  49421. this.envMap = e.envMap,
  49422. this.envMapIntensity = e.envMapIntensity,
  49423. this.refractionRatio = e.refractionRatio,
  49424. this.fog = e.fog,
  49425. this.shading = e.shading,
  49426. this.wireframe = e.wireframe,
  49427. this.wireframeLinewidth = e.wireframeLinewidth,
  49428. this.wireframeLinecap = e.wireframeLinecap,
  49429. this.wireframeLinejoin = e.wireframeLinejoin,
  49430. this.vertexColors = e.vertexColors,
  49431. this.skinning = e.skinning,
  49432. this.morphTargets = e.morphTargets,
  49433. this.morphNormals = e.morphNormals,
  49434. this
  49435. }
  49436. ,
  49437. n.MeshDepthMaterial = function(e) {
  49438. n.Material.call(this),
  49439. this.type = "MeshDepthMaterial",
  49440. this.morphTargets = !1,
  49441. this.wireframe = !1,
  49442. this.wireframeLinewidth = 1,
  49443. this.setValues(e)
  49444. }
  49445. ,
  49446. n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype),
  49447. n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial,
  49448. n.MeshDepthMaterial.prototype.copy = function(e) {
  49449. return n.Material.prototype.copy.call(this, e),
  49450. this.wireframe = e.wireframe,
  49451. this.wireframeLinewidth = e.wireframeLinewidth,
  49452. this
  49453. }
  49454. ,
  49455. n.MeshNormalMaterial = function(e) {
  49456. n.Material.call(this, e),
  49457. this.type = "MeshNormalMaterial",
  49458. this.wireframe = !1,
  49459. this.wireframeLinewidth = 1,
  49460. this.morphTargets = !1,
  49461. this.setValues(e)
  49462. }
  49463. ,
  49464. n.MeshNormalMaterial.prototype = Object.create(n.Material.prototype),
  49465. n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial,
  49466. n.MeshNormalMaterial.prototype.copy = function(e) {
  49467. return n.Material.prototype.copy.call(this, e),
  49468. this.wireframe = e.wireframe,
  49469. this.wireframeLinewidth = e.wireframeLinewidth,
  49470. this
  49471. }
  49472. ,
  49473. n.MultiMaterial = function(e) {
  49474. this.uuid = n.Math.generateUUID(),
  49475. this.type = "MultiMaterial",
  49476. this.materials = e instanceof Array ? e : [],
  49477. this.visible = !0
  49478. }
  49479. ,
  49480. n.MultiMaterial.prototype = {
  49481. constructor: n.MultiMaterial,
  49482. toJSON: function(e) {
  49483. for (var t = {
  49484. metadata: {
  49485. version: 4.2,
  49486. type: "material",
  49487. generator: "MaterialExporter"
  49488. },
  49489. uuid: this.uuid,
  49490. type: this.type,
  49491. materials: []
  49492. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  49493. var o = i[n].toJSON(e);
  49494. delete o.metadata,
  49495. t.materials.push(o)
  49496. }
  49497. return t.visible = this.visible,
  49498. t
  49499. },
  49500. clone: function() {
  49501. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  49502. e.materials.push(this.materials[t].clone());
  49503. return e.visible = this.visible,
  49504. e
  49505. }
  49506. },
  49507. n.PointsMaterial = function(e) {
  49508. n.Material.call(this),
  49509. this.type = "PointsMaterial",
  49510. this.color = new n.Color(16777215),
  49511. this.map = null,
  49512. this.size = 1,
  49513. this.sizeAttenuation = !0,
  49514. this.blending = n.NormalBlending,
  49515. this.vertexColors = n.NoColors,
  49516. this.fog = !0,
  49517. this.setValues(e)
  49518. }
  49519. ,
  49520. n.PointsMaterial.prototype = Object.create(n.Material.prototype),
  49521. n.PointsMaterial.prototype.constructor = n.PointsMaterial,
  49522. n.PointsMaterial.prototype.copy = function(e) {
  49523. return n.Material.prototype.copy.call(this, e),
  49524. this.color.copy(e.color),
  49525. this.map = e.map,
  49526. this.size = e.size,
  49527. this.sizeAttenuation = e.sizeAttenuation,
  49528. this.vertexColors = e.vertexColors,
  49529. this.fog = e.fog,
  49530. this
  49531. }
  49532. ,
  49533. n.ShaderMaterial = function(e) {
  49534. n.Material.call(this),
  49535. this.type = "ShaderMaterial",
  49536. this.defines = {},
  49537. this.uniforms = {},
  49538. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  49539. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  49540. this.shading = n.SmoothShading,
  49541. this.linewidth = 1,
  49542. this.wireframe = !1,
  49543. this.wireframeLinewidth = 1,
  49544. this.fog = !1,
  49545. this.lights = !1,
  49546. this.vertexColors = n.NoColors,
  49547. this.skinning = !1,
  49548. this.morphTargets = !1,
  49549. this.morphNormals = !1,
  49550. this.extensions = {
  49551. derivatives: !1,
  49552. fragDepth: !1,
  49553. drawBuffers: !1,
  49554. shaderTextureLOD: !1
  49555. },
  49556. this.defaultAttributeValues = {
  49557. color: [1, 1, 1],
  49558. uv: [0, 0],
  49559. uv2: [0, 0]
  49560. },
  49561. this.index0AttributeName = void 0,
  49562. void 0 !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  49563. this.setValues(e))
  49564. }
  49565. ,
  49566. n.ShaderMaterial.prototype = Object.create(n.Material.prototype),
  49567. n.ShaderMaterial.prototype.constructor = n.ShaderMaterial,
  49568. n.ShaderMaterial.prototype.copy = function(e) {
  49569. return n.Material.prototype.copy.call(this, e),
  49570. this.fragmentShader = e.fragmentShader,
  49571. this.vertexShader = e.vertexShader,
  49572. this.uniforms = n.UniformsUtils.clone(e.uniforms),
  49573. this.defines = e.defines,
  49574. this.shading = e.shading,
  49575. this.wireframe = e.wireframe,
  49576. this.wireframeLinewidth = e.wireframeLinewidth,
  49577. this.fog = e.fog,
  49578. this.lights = e.lights,
  49579. this.vertexColors = e.vertexColors,
  49580. this.skinning = e.skinning,
  49581. this.morphTargets = e.morphTargets,
  49582. this.morphNormals = e.morphNormals,
  49583. this.extensions = e.extensions,
  49584. this
  49585. }
  49586. ,
  49587. n.ShaderMaterial.prototype.toJSON = function(e) {
  49588. var t = n.Material.prototype.toJSON.call(this, e);
  49589. return t.uniforms = this.uniforms,
  49590. t.vertexShader = this.vertexShader,
  49591. t.fragmentShader = this.fragmentShader,
  49592. t
  49593. }
  49594. ,
  49595. n.RawShaderMaterial = function(e) {
  49596. n.ShaderMaterial.call(this, e),
  49597. this.type = "RawShaderMaterial"
  49598. }
  49599. ,
  49600. n.RawShaderMaterial.prototype = Object.create(n.ShaderMaterial.prototype),
  49601. n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial,
  49602. n.SpriteMaterial = function(e) {
  49603. n.Material.call(this),
  49604. this.type = "SpriteMaterial",
  49605. this.color = new n.Color(16777215),
  49606. this.map = null,
  49607. this.rotation = 0,
  49608. this.fog = !1,
  49609. this.setValues(e)
  49610. }
  49611. ,
  49612. n.SpriteMaterial.prototype = Object.create(n.Material.prototype),
  49613. n.SpriteMaterial.prototype.constructor = n.SpriteMaterial,
  49614. n.SpriteMaterial.prototype.copy = function(e) {
  49615. return n.Material.prototype.copy.call(this, e),
  49616. this.color.copy(e.color),
  49617. this.map = e.map,
  49618. this.rotation = e.rotation,
  49619. this.fog = e.fog,
  49620. this
  49621. }
  49622. ,
  49623. n.Texture = function(e, t, i, r, o, a, s, l, c) {
  49624. Object.defineProperty(this, "id", {
  49625. value: n.TextureIdCount++
  49626. }),
  49627. this.uuid = n.Math.generateUUID(),
  49628. this.name = "",
  49629. this.sourceFile = "",
  49630. this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE,
  49631. this.mipmaps = [],
  49632. this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING,
  49633. this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping,
  49634. this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping,
  49635. this.magFilter = void 0 !== o ? o : n.LinearFilter,
  49636. this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter,
  49637. this.anisotropy = void 0 !== c ? c : 1,
  49638. this.format = void 0 !== s ? s : n.RGBAFormat,
  49639. this.type = void 0 !== l ? l : n.UnsignedByteType,
  49640. this.offset = new n.Vector2(0,0),
  49641. this.repeat = new n.Vector2(1,1),
  49642. this.generateMipmaps = !0,
  49643. this.premultiplyAlpha = !1,
  49644. this.flipY = !0,
  49645. this.unpackAlignment = 4,
  49646. this.encoding = n.LinearEncoding,
  49647. this.version = 0,
  49648. this.onUpdate = null
  49649. }
  49650. ,
  49651. n.Texture.DEFAULT_IMAGE = void 0,
  49652. n.Texture.DEFAULT_MAPPING = n.UVMapping,
  49653. n.Texture.prototype = {
  49654. constructor: n.Texture,
  49655. set needsUpdate(e) {
  49656. e === !0 && this.version++
  49657. },
  49658. clone: function() {
  49659. return (new this.constructor).copy(this)
  49660. },
  49661. copy: function(e) {
  49662. return this.image = e.image,
  49663. this.mipmaps = e.mipmaps.slice(0),
  49664. this.mapping = e.mapping,
  49665. this.wrapS = e.wrapS,
  49666. this.wrapT = e.wrapT,
  49667. this.magFilter = e.magFilter,
  49668. this.minFilter = e.minFilter,
  49669. this.anisotropy = e.anisotropy,
  49670. this.format = e.format,
  49671. this.type = e.type,
  49672. this.offset.copy(e.offset),
  49673. this.repeat.copy(e.repeat),
  49674. this.generateMipmaps = e.generateMipmaps,
  49675. this.premultiplyAlpha = e.premultiplyAlpha,
  49676. this.flipY = e.flipY,
  49677. this.unpackAlignment = e.unpackAlignment,
  49678. this.encoding = e.encoding,
  49679. this
  49680. },
  49681. toJSON: function(e) {
  49682. function t(e) {
  49683. var t;
  49684. return void 0 !== e.toDataURL ? t = e : (t = document.createElement("canvas"),
  49685. t.width = e.width,
  49686. t.height = e.height,
  49687. t.getContext("2d").drawImage(e, 0, 0, e.width, e.height)),
  49688. t.width > 2048 || t.height > 2048 ? t.toDataURL("image/jpeg", .6) : t.toDataURL("image/png")
  49689. }
  49690. if (void 0 !== e.textures[this.uuid])
  49691. return e.textures[this.uuid];
  49692. var i = {
  49693. metadata: {
  49694. version: 4.4,
  49695. type: "Texture",
  49696. generator: "Texture.toJSON"
  49697. },
  49698. uuid: this.uuid,
  49699. name: this.name,
  49700. mapping: this.mapping,
  49701. repeat: [this.repeat.x, this.repeat.y],
  49702. offset: [this.offset.x, this.offset.y],
  49703. wrap: [this.wrapS, this.wrapT],
  49704. minFilter: this.minFilter,
  49705. magFilter: this.magFilter,
  49706. anisotropy: this.anisotropy
  49707. };
  49708. if (void 0 !== this.image) {
  49709. var r = this.image;
  49710. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  49711. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  49712. uuid: r.uuid,
  49713. url: t(r)
  49714. }),
  49715. i.image = r.uuid
  49716. }
  49717. return e.textures[this.uuid] = i,
  49718. i
  49719. },
  49720. dispose: function() {
  49721. this.dispatchEvent({
  49722. type: "dispose"
  49723. })
  49724. },
  49725. transformUv: function(e) {
  49726. if (this.mapping === n.UVMapping) {
  49727. if (e.multiply(this.repeat),
  49728. e.add(this.offset),
  49729. e.x < 0 || e.x > 1)
  49730. switch (this.wrapS) {
  49731. case n.RepeatWrapping:
  49732. e.x = e.x - Math.floor(e.x);
  49733. break;
  49734. case n.ClampToEdgeWrapping:
  49735. e.x = e.x < 0 ? 0 : 1;
  49736. break;
  49737. case n.MirroredRepeatWrapping:
  49738. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  49739. }
  49740. if (e.y < 0 || e.y > 1)
  49741. switch (this.wrapT) {
  49742. case n.RepeatWrapping:
  49743. e.y = e.y - Math.floor(e.y);
  49744. break;
  49745. case n.ClampToEdgeWrapping:
  49746. e.y = e.y < 0 ? 0 : 1;
  49747. break;
  49748. case n.MirroredRepeatWrapping:
  49749. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  49750. }
  49751. this.flipY && (e.y = 1 - e.y)
  49752. }
  49753. }
  49754. },
  49755. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  49756. n.TextureIdCount = 0,
  49757. n.CanvasTexture = function(e, t, i, r, o, a, s, l, c) {
  49758. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  49759. this.needsUpdate = !0
  49760. }
  49761. ,
  49762. n.CanvasTexture.prototype = Object.create(n.Texture.prototype),
  49763. n.CanvasTexture.prototype.constructor = n.CanvasTexture,
  49764. n.CubeTexture = function(e, t, i, r, o, a, s, l, c) {
  49765. e = void 0 !== e ? e : [],
  49766. t = void 0 !== t ? t : n.CubeReflectionMapping,
  49767. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  49768. this.flipY = !1
  49769. }
  49770. ,
  49771. n.CubeTexture.prototype = Object.create(n.Texture.prototype),
  49772. n.CubeTexture.prototype.constructor = n.CubeTexture,
  49773. Object.defineProperty(n.CubeTexture.prototype, "images", {
  49774. get: function() {
  49775. return this.image
  49776. },
  49777. set: function(e) {
  49778. this.image = e
  49779. }
  49780. }),
  49781. n.CompressedTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  49782. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  49783. this.image = {
  49784. width: t,
  49785. height: i
  49786. },
  49787. this.mipmaps = e,
  49788. this.flipY = !1,
  49789. this.generateMipmaps = !1
  49790. }
  49791. ,
  49792. n.CompressedTexture.prototype = Object.create(n.Texture.prototype),
  49793. n.CompressedTexture.prototype.constructor = n.CompressedTexture,
  49794. n.DataTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  49795. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  49796. this.image = {
  49797. data: e,
  49798. width: t,
  49799. height: i
  49800. },
  49801. this.magFilter = void 0 !== c ? c : n.NearestFilter,
  49802. this.minFilter = void 0 !== h ? h : n.NearestFilter,
  49803. this.flipY = !1,
  49804. this.generateMipmaps = !1
  49805. }
  49806. ,
  49807. n.DataTexture.prototype = Object.create(n.Texture.prototype),
  49808. n.DataTexture.prototype.constructor = n.DataTexture,
  49809. n.VideoTexture = function(e, t, i, r, o, a, s, l, c) {
  49810. function h() {
  49811. requestAnimationFrame(h)
  49812. if( !e.paused && e.readyState === e.HAVE_ENOUGH_DATA){//改 add !e.paused
  49813. u.needsUpdate = !0
  49814. }
  49815. }
  49816. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  49817. this.generateMipmaps = !1;
  49818. var u = this;
  49819. h()
  49820. }
  49821. ,
  49822. n.VideoTexture.prototype = Object.create(n.Texture.prototype),
  49823. n.VideoTexture.prototype.constructor = n.VideoTexture,
  49824. n.Group = function() {
  49825. n.Object3D.call(this),
  49826. this.type = "Group"
  49827. }
  49828. ,
  49829. n.Group.prototype = Object.create(n.Object3D.prototype),
  49830. n.Group.prototype.constructor = n.Group,
  49831. n.Points = function(e, t) {
  49832. n.Object3D.call(this),
  49833. this.type = "Points",
  49834. this.geometry = void 0 !== e ? e : new n.Geometry,
  49835. this.material = void 0 !== t ? t : new n.PointsMaterial({
  49836. color: 16777215 * Math.random()
  49837. })
  49838. }
  49839. ,
  49840. n.Points.prototype = Object.create(n.Object3D.prototype),
  49841. n.Points.prototype.constructor = n.Points,
  49842. n.Points.prototype.raycast = function() {
  49843. var e = new n.Matrix4
  49844. , t = new n.Ray
  49845. , i = new n.Sphere;
  49846. return function(r, o) {
  49847. function a(e, i) {
  49848. var n = t.distanceSqToPoint(e);
  49849. if (n < d) {
  49850. var a = t.closestPointToPoint(e);
  49851. a.applyMatrix4(c);
  49852. var l = r.ray.origin.distanceTo(a);
  49853. if (l < r.near || l > r.far)
  49854. return;
  49855. o.push({
  49856. distance: l,
  49857. distanceToRay: Math.sqrt(n),
  49858. point: a.clone(),
  49859. index: i,
  49860. face: null,
  49861. object: s
  49862. })
  49863. }
  49864. }
  49865. var s = this
  49866. , l = this.geometry
  49867. , c = this.matrixWorld
  49868. , h = r.params.Points.threshold;
  49869. if (null === l.boundingSphere && l.computeBoundingSphere(),
  49870. i.copy(l.boundingSphere),
  49871. i.applyMatrix4(c),
  49872. r.ray.intersectsSphere(i) !== !1) {
  49873. e.getInverse(c),
  49874. t.copy(r.ray).applyMatrix4(e);
  49875. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  49876. , d = u * u
  49877. , p = new n.Vector3;
  49878. if (l instanceof n.BufferGeometry) {
  49879. var f = l.index
  49880. , g = l.attributes
  49881. , m = g.position.array;
  49882. if (null !== f)
  49883. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  49884. var C = v[A];
  49885. p.fromArray(m, 3 * C),
  49886. a(p, C)
  49887. }
  49888. else
  49889. for (var A = 0, I = m.length / 3; A < I; A++)
  49890. p.fromArray(m, 3 * A),
  49891. a(p, A)
  49892. } else
  49893. for (var E = l.vertices, A = 0, I = E.length; A < I; A++)
  49894. a(E[A], A)
  49895. }
  49896. }
  49897. }(),
  49898. n.Points.prototype.clone = function() {
  49899. return new this.constructor(this.geometry,this.material).copy(this)
  49900. }
  49901. ,
  49902. n.Line = function(e, t, i) {
  49903. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  49904. new n.LineSegments(e,t)) : (n.Object3D.call(this),
  49905. this.type = "Line",
  49906. this.geometry = void 0 !== e ? e : new n.Geometry,
  49907. void (this.material = void 0 !== t ? t : new n.LineBasicMaterial({
  49908. color: 16777215 * Math.random()
  49909. })))
  49910. }
  49911. ,
  49912. n.Line.prototype = Object.create(n.Object3D.prototype),
  49913. n.Line.prototype.constructor = n.Line,
  49914. n.Line.prototype.raycast = function() {
  49915. var e = new n.Matrix4
  49916. , t = new n.Ray
  49917. , i = new n.Sphere;
  49918. return function(r, o) {
  49919. var a = r.linePrecision
  49920. , s = a * a
  49921. , l = this.geometry
  49922. , c = this.matrixWorld;
  49923. if (null === l.boundingSphere && l.computeBoundingSphere(),
  49924. i.copy(l.boundingSphere),
  49925. i.applyMatrix4(c),
  49926. r.ray.intersectsSphere(i) !== !1) {
  49927. e.getInverse(c),
  49928. t.copy(r.ray).applyMatrix4(e);
  49929. var h = new n.Vector3
  49930. , u = new n.Vector3
  49931. , d = new n.Vector3
  49932. , p = new n.Vector3
  49933. , f = this instanceof n.LineSegments ? 2 : 1;
  49934. if (l instanceof n.BufferGeometry) {
  49935. var g = l.index
  49936. , m = l.attributes
  49937. , v = m.position.array;
  49938. if (null !== g)
  49939. for (var A = g.array, y = 0, C = A.length - 1; y < C; y += f) {
  49940. var I = A[y]
  49941. , E = A[y + 1];
  49942. h.fromArray(v, 3 * I),
  49943. u.fromArray(v, 3 * E);
  49944. var b = t.distanceSqToSegment(h, u, p, d);
  49945. if (!(b > s)) {
  49946. p.applyMatrix4(this.matrixWorld);
  49947. var w = r.ray.origin.distanceTo(p);
  49948. w < r.near || w > r.far || o.push({
  49949. distance: w,
  49950. point: d.clone().applyMatrix4(this.matrixWorld),
  49951. index: y,
  49952. face: null,
  49953. faceIndex: null,
  49954. object: this
  49955. })
  49956. }
  49957. }
  49958. else
  49959. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  49960. h.fromArray(v, 3 * y),
  49961. u.fromArray(v, 3 * y + 3);
  49962. var b = t.distanceSqToSegment(h, u, p, d);
  49963. if (!(b > s)) {
  49964. p.applyMatrix4(this.matrixWorld);
  49965. var w = r.ray.origin.distanceTo(p);
  49966. w < r.near || w > r.far || o.push({
  49967. distance: w,
  49968. point: d.clone().applyMatrix4(this.matrixWorld),
  49969. index: y,
  49970. face: null,
  49971. faceIndex: null,
  49972. object: this
  49973. })
  49974. }
  49975. }
  49976. } else if (l instanceof n.Geometry)
  49977. for (var _ = l.vertices, T = _.length, y = 0; y < T - 1; y += f) {
  49978. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d);
  49979. if (!(b > s)) {
  49980. p.applyMatrix4(this.matrixWorld);
  49981. var w = r.ray.origin.distanceTo(p);
  49982. w < r.near || w > r.far || o.push({
  49983. distance: w,
  49984. point: d.clone().applyMatrix4(this.matrixWorld),
  49985. index: y,
  49986. face: null,
  49987. faceIndex: null,
  49988. object: this
  49989. })
  49990. }
  49991. }
  49992. }
  49993. }
  49994. }(),
  49995. n.Line.prototype.clone = function() {
  49996. return new this.constructor(this.geometry,this.material).copy(this)
  49997. }
  49998. ,
  49999. n.LineStrip = 0,
  50000. n.LinePieces = 1,
  50001. n.LineSegments = function(e, t) {
  50002. n.Line.call(this, e, t),
  50003. this.type = "LineSegments"
  50004. }
  50005. ,
  50006. n.LineSegments.prototype = Object.create(n.Line.prototype),
  50007. n.LineSegments.prototype.constructor = n.LineSegments,
  50008. n.Mesh = function(e, t) {
  50009. n.Object3D.call(this),
  50010. this.type = "Mesh",
  50011. this.geometry = void 0 !== e ? e : new n.Geometry,
  50012. this.material = void 0 !== t ? t : new n.MeshBasicMaterial({
  50013. color: 16777215 * Math.random()
  50014. }),
  50015. this.drawMode = n.TrianglesDrawMode,
  50016. this.updateMorphTargets()
  50017. }
  50018. ,
  50019. n.Mesh.prototype = Object.create(n.Object3D.prototype),
  50020. n.Mesh.prototype.constructor = n.Mesh,
  50021. n.Mesh.prototype.setDrawMode = function(e) {
  50022. this.drawMode = e
  50023. }
  50024. ,
  50025. n.Mesh.prototype.updateMorphTargets = function() {
  50026. if (void 0 !== this.geometry.morphTargets && this.geometry.morphTargets.length > 0) {
  50027. this.morphTargetBase = -1,
  50028. this.morphTargetInfluences = [],
  50029. this.morphTargetDictionary = {};
  50030. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  50031. this.morphTargetInfluences.push(0),
  50032. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  50033. }
  50034. }
  50035. ,
  50036. n.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  50037. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  50038. 0)
  50039. }
  50040. ,
  50041. n.Mesh.prototype.raycast = function() {
  50042. function e(e, t, i, r, o, a, s) {
  50043. return n.Triangle.barycoordFromPoint(e, t, i, r, m),
  50044. o.multiplyScalar(m.x),
  50045. a.multiplyScalar(m.y),
  50046. s.multiplyScalar(m.z),
  50047. o.add(a).add(s),
  50048. o.clone()
  50049. }
  50050. function t(e, t, i, r, o, a, s) {
  50051. var l, c = e.material;
  50052. if (l = c.side === n.BackSide ? i.intersectTriangle(a, o, r, !0, s) : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s),
  50053. null === l)
  50054. return null;
  50055. A.copy(s),
  50056. A.applyMatrix4(e.matrixWorld);
  50057. var h = t.ray.origin.distanceTo(A);
  50058. return h < t.near || h > t.far ? null : {
  50059. distance: h,
  50060. point: A.clone(),
  50061. object: e
  50062. }
  50063. }
  50064. function i(i, r, o, a, h, u, d, m) {
  50065. s.fromArray(a, 3 * u),
  50066. l.fromArray(a, 3 * d),
  50067. c.fromArray(a, 3 * m);
  50068. var A = t(i, r, o, s, l, c, v);
  50069. return A && (h && (p.fromArray(h, 2 * u),
  50070. f.fromArray(h, 2 * d),
  50071. g.fromArray(h, 2 * m),
  50072. A.uv = e(v, s, l, c, p, f, g)),
  50073. A.face = new n.Face3(u,d,m,n.Triangle.normal(s, l, c)),
  50074. A.faceIndex = u),
  50075. A
  50076. }
  50077. var r = new n.Matrix4
  50078. , o = new n.Ray
  50079. , a = new n.Sphere
  50080. , s = new n.Vector3
  50081. , l = new n.Vector3
  50082. , c = new n.Vector3
  50083. , h = new n.Vector3
  50084. , u = new n.Vector3
  50085. , d = new n.Vector3
  50086. , p = new n.Vector2
  50087. , f = new n.Vector2
  50088. , g = new n.Vector2
  50089. , m = new n.Vector3
  50090. , v = new n.Vector3
  50091. , A = new n.Vector3;
  50092. return function(m, A) {
  50093. var y = this.geometry
  50094. , C = this.material
  50095. , I = this.matrixWorld;
  50096. if (void 0 !== C && (null === y.boundingSphere && y.computeBoundingSphere(),
  50097. a.copy(y.boundingSphere),
  50098. a.applyMatrix4(I),
  50099. m.ray.intersectsSphere(a) !== !1 && (r.getInverse(I),
  50100. o.copy(m.ray).applyMatrix4(r),
  50101. null === y.boundingBox || o.intersectsBox(y.boundingBox) !== !1))) {
  50102. var E, b;
  50103. if (y instanceof n.BufferGeometry) {
  50104. var w, _, T, x = y.index, S = y.attributes, M = S.position.array;
  50105. if (void 0 !== S.uv && (E = S.uv.array),
  50106. null !== x)
  50107. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  50108. w = R[P],
  50109. _ = R[P + 1],
  50110. T = R[P + 2],
  50111. b = i(this, m, o, M, E, w, _, T),
  50112. b && (b.faceIndex = Math.floor(P / 3),
  50113. A.push(b));
  50114. else
  50115. for (var P = 0, O = M.length; P < O; P += 9)
  50116. w = P / 3,
  50117. _ = w + 1,
  50118. T = w + 2,
  50119. b = i(this, m, o, M, E, w, _, T),
  50120. b && (b.index = w,
  50121. A.push(b))
  50122. } else if (y instanceof n.Geometry) {
  50123. var L, D, N, B = C instanceof n.MultiMaterial, F = B === !0 ? C.materials : null, V = y.vertices, U = y.faces, k = y.faceVertexUvs[0];
  50124. k.length > 0 && (E = k);
  50125. for (var H = 0, G = U.length; H < G; H++) {
  50126. var z = U[H]
  50127. , W = B === !0 ? F[z.materialIndex] : C;
  50128. if (void 0 !== W) {
  50129. if (L = V[z.a],
  50130. D = V[z.b],
  50131. N = V[z.c],
  50132. W.morphTargets === !0) {
  50133. var j = y.morphTargets
  50134. , Y = this.morphTargetInfluences;
  50135. s.set(0, 0, 0),
  50136. l.set(0, 0, 0),
  50137. c.set(0, 0, 0);
  50138. for (var X = 0, Z = j.length; X < Z; X++) {
  50139. var q = Y[X];
  50140. if (0 !== q) {
  50141. var K = j[X].vertices;
  50142. s.addScaledVector(h.subVectors(K[z.a], L), q),
  50143. l.addScaledVector(u.subVectors(K[z.b], D), q),
  50144. c.addScaledVector(d.subVectors(K[z.c], N), q)
  50145. }
  50146. }
  50147. s.add(L),
  50148. l.add(D),
  50149. c.add(N),
  50150. L = s,
  50151. D = l,
  50152. N = c
  50153. }
  50154. if (b = t(this, m, o, L, D, N, v)) {
  50155. if (E) {
  50156. var Q = E[H];
  50157. p.copy(Q[0]),
  50158. f.copy(Q[1]),
  50159. g.copy(Q[2]),
  50160. b.uv = e(v, L, D, N, p, f, g)
  50161. }
  50162. b.face = z,
  50163. b.faceIndex = H,
  50164. A.push(b)
  50165. }
  50166. }
  50167. }
  50168. }
  50169. }
  50170. }
  50171. }(),
  50172. n.Mesh.prototype.clone = function() {
  50173. return new this.constructor(this.geometry,this.material).copy(this)
  50174. }
  50175. ,
  50176. n.Bone = function(e) {
  50177. n.Object3D.call(this),
  50178. this.type = "Bone",
  50179. this.skin = e
  50180. }
  50181. ,
  50182. n.Bone.prototype = Object.create(n.Object3D.prototype),
  50183. n.Bone.prototype.constructor = n.Bone,
  50184. n.Bone.prototype.copy = function(e) {
  50185. return n.Object3D.prototype.copy.call(this, e),
  50186. this.skin = e.skin,
  50187. this
  50188. }
  50189. ,
  50190. n.Skeleton = function(e, t, i) {
  50191. if (this.useVertexTexture = void 0 === i || i,
  50192. this.identityMatrix = new n.Matrix4,
  50193. e = e || [],
  50194. this.bones = e.slice(0),
  50195. this.useVertexTexture) {
  50196. var r = Math.sqrt(4 * this.bones.length);
  50197. r = n.Math.nextPowerOfTwo(Math.ceil(r)),
  50198. r = Math.max(r, 4),
  50199. this.boneTextureWidth = r,
  50200. this.boneTextureHeight = r,
  50201. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  50202. this.boneTexture = new n.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,n.RGBAFormat,n.FloatType)
  50203. } else
  50204. this.boneMatrices = new Float32Array(16 * this.bones.length);
  50205. if (void 0 === t)
  50206. this.calculateInverses();
  50207. else if (this.bones.length === t.length)
  50208. this.boneInverses = t.slice(0);
  50209. else {
  50210. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  50211. this.boneInverses = [];
  50212. for (var o = 0, a = this.bones.length; o < a; o++)
  50213. this.boneInverses.push(new n.Matrix4)
  50214. }
  50215. }
  50216. ,
  50217. n.Skeleton.prototype.calculateInverses = function() {
  50218. this.boneInverses = [];
  50219. for (var e = 0, t = this.bones.length; e < t; e++) {
  50220. var i = new n.Matrix4;
  50221. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  50222. this.boneInverses.push(i)
  50223. }
  50224. }
  50225. ,
  50226. n.Skeleton.prototype.pose = function() {
  50227. for (var e, t = 0, i = this.bones.length; t < i; t++)
  50228. e = this.bones[t],
  50229. e && e.matrixWorld.getInverse(this.boneInverses[t]);
  50230. for (var t = 0, i = this.bones.length; t < i; t++)
  50231. e = this.bones[t],
  50232. e && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  50233. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  50234. e.matrix.decompose(e.position, e.quaternion, e.scale));
  50235. }
  50236. ,
  50237. n.Skeleton.prototype.update = function() {
  50238. var e = new n.Matrix4;
  50239. return function() {
  50240. for (var t = 0, i = this.bones.length; t < i; t++) {
  50241. var n = this.bones[t] ? this.bones[t].matrixWorld : this.identityMatrix;
  50242. e.multiplyMatrices(n, this.boneInverses[t]),
  50243. e.flattenToArrayOffset(this.boneMatrices, 16 * t)
  50244. }
  50245. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  50246. }
  50247. }(),
  50248. n.Skeleton.prototype.clone = function() {
  50249. return new n.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  50250. }
  50251. ,
  50252. n.SkinnedMesh = function(e, t, i) {
  50253. n.Mesh.call(this, e, t),
  50254. this.type = "SkinnedMesh",
  50255. this.bindMode = "attached",
  50256. this.bindMatrix = new n.Matrix4,
  50257. this.bindMatrixInverse = new n.Matrix4;
  50258. var r = [];
  50259. if (this.geometry && void 0 !== this.geometry.bones) {
  50260. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  50261. a = this.geometry.bones[s],
  50262. o = new n.Bone(this),
  50263. r.push(o),
  50264. o.name = a.name,
  50265. o.position.fromArray(a.pos),
  50266. o.quaternion.fromArray(a.rotq),
  50267. void 0 !== a.scl && o.scale.fromArray(a.scl);
  50268. for (var s = 0, l = this.geometry.bones.length; s < l; ++s)
  50269. a = this.geometry.bones[s],
  50270. a.parent !== -1 && null !== a.parent ? r[a.parent].add(r[s]) : this.add(r[s])
  50271. }
  50272. this.normalizeSkinWeights(),
  50273. this.updateMatrixWorld(!0),
  50274. this.bind(new n.Skeleton(r,void 0,i), this.matrixWorld)
  50275. }
  50276. ,
  50277. n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype),
  50278. n.SkinnedMesh.prototype.constructor = n.SkinnedMesh,
  50279. n.SkinnedMesh.prototype.bind = function(e, t) {
  50280. this.skeleton = e,
  50281. void 0 === t && (this.updateMatrixWorld(!0),
  50282. this.skeleton.calculateInverses(),
  50283. t = this.matrixWorld),
  50284. this.bindMatrix.copy(t),
  50285. this.bindMatrixInverse.getInverse(t)
  50286. }
  50287. ,
  50288. n.SkinnedMesh.prototype.pose = function() {
  50289. this.skeleton.pose()
  50290. }
  50291. ,
  50292. n.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  50293. if (this.geometry instanceof n.Geometry)
  50294. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  50295. var t = this.geometry.skinWeights[e]
  50296. , i = 1 / t.lengthManhattan();
  50297. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0)
  50298. }
  50299. else if (this.geometry instanceof n.BufferGeometry)
  50300. for (var r = new n.Vector4, o = this.geometry.attributes.skinWeight, e = 0; e < o.count; e++) {
  50301. r.x = o.getX(e),
  50302. r.y = o.getY(e),
  50303. r.z = o.getZ(e),
  50304. r.w = o.getW(e);
  50305. var i = 1 / r.lengthManhattan();
  50306. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0),
  50307. o.setXYZW(e, r.x, r.y, r.z, r.w)
  50308. }
  50309. }
  50310. ,
  50311. n.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  50312. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  50313. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  50314. }
  50315. ,
  50316. n.SkinnedMesh.prototype.clone = function() {
  50317. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  50318. }
  50319. ,
  50320. n.LOD = function() {
  50321. n.Object3D.call(this),
  50322. this.type = "LOD",
  50323. Object.defineProperties(this, {
  50324. levels: {
  50325. enumerable: !0,
  50326. value: []
  50327. },
  50328. objects: {
  50329. get: function() {
  50330. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  50331. this.levels
  50332. }
  50333. }
  50334. })
  50335. }
  50336. ,
  50337. n.LOD.prototype = Object.create(n.Object3D.prototype),
  50338. n.LOD.prototype.constructor = n.LOD,
  50339. n.LOD.prototype.addLevel = function(e, t) {
  50340. void 0 === t && (t = 0),
  50341. t = Math.abs(t);
  50342. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  50343. ;
  50344. i.splice(n, 0, {
  50345. distance: t,
  50346. object: e
  50347. }),
  50348. this.add(e)
  50349. }
  50350. ,
  50351. n.LOD.prototype.getObjectForDistance = function(e) {
  50352. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  50353. ;
  50354. return t[i - 1].object
  50355. }
  50356. ,
  50357. n.LOD.prototype.raycast = function() {
  50358. var e = new n.Vector3;
  50359. return function(t, i) {
  50360. e.setFromMatrixPosition(this.matrixWorld);
  50361. var n = t.ray.origin.distanceTo(e);
  50362. this.getObjectForDistance(n).raycast(t, i)
  50363. }
  50364. }(),
  50365. n.LOD.prototype.update = function() {
  50366. var e = new n.Vector3
  50367. , t = new n.Vector3;
  50368. return function(i) {
  50369. var n = this.levels;
  50370. if (n.length > 1) {
  50371. e.setFromMatrixPosition(i.matrixWorld),
  50372. t.setFromMatrixPosition(this.matrixWorld);
  50373. var r = e.distanceTo(t);
  50374. n[0].object.visible = !0;
  50375. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++)
  50376. n[o - 1].object.visible = !1,
  50377. n[o].object.visible = !0;
  50378. for (; o < a; o++)
  50379. n[o].object.visible = !1
  50380. }
  50381. }
  50382. }(),
  50383. n.LOD.prototype.copy = function(e) {
  50384. n.Object3D.prototype.copy.call(this, e, !1);
  50385. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  50386. var o = t[i];
  50387. this.addLevel(o.object.clone(), o.distance)
  50388. }
  50389. return this
  50390. }
  50391. ,
  50392. n.LOD.prototype.toJSON = function(e) {
  50393. var t = n.Object3D.prototype.toJSON.call(this, e);
  50394. t.object.levels = [];
  50395. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  50396. var a = i[r];
  50397. t.object.levels.push({
  50398. object: a.object.uuid,
  50399. distance: a.distance
  50400. })
  50401. }
  50402. return t
  50403. }
  50404. ,
  50405. n.Sprite = function() {
  50406. var e = new Uint16Array([0, 1, 2, 0, 2, 3])
  50407. , t = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0])
  50408. , i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])
  50409. , r = new n.BufferGeometry;
  50410. return r.setIndex(new n.BufferAttribute(e,1)),
  50411. r.addAttribute("position", new n.BufferAttribute(t,3)),
  50412. r.addAttribute("uv", new n.BufferAttribute(i,2)),
  50413. function(e) {
  50414. n.Object3D.call(this),
  50415. this.type = "Sprite",
  50416. this.geometry = r,
  50417. this.material = void 0 !== e ? e : new n.SpriteMaterial
  50418. }
  50419. }(),
  50420. n.Sprite.prototype = Object.create(n.Object3D.prototype),
  50421. n.Sprite.prototype.constructor = n.Sprite,
  50422. n.Sprite.prototype.raycast = function() {
  50423. var e = new n.Vector3;
  50424. return function(t, i) {
  50425. e.setFromMatrixPosition(this.matrixWorld);
  50426. var n = t.ray.distanceSqToPoint(e)
  50427. , r = this.scale.x * this.scale.y;
  50428. n > r || i.push({
  50429. distance: Math.sqrt(n),
  50430. point: this.position,
  50431. face: null,
  50432. object: this
  50433. })
  50434. }
  50435. }(),
  50436. n.Sprite.prototype.clone = function() {
  50437. return new this.constructor(this.material).copy(this)
  50438. }
  50439. ,
  50440. n.Particle = n.Sprite,
  50441. n.LensFlare = function(e, t, i, r, o) {
  50442. n.Object3D.call(this),
  50443. this.lensFlares = [],
  50444. this.positionScreen = new n.Vector3,
  50445. this.customUpdateCallback = void 0,
  50446. void 0 !== e && this.add(e, t, i, r, o)
  50447. }
  50448. ,
  50449. n.LensFlare.prototype = Object.create(n.Object3D.prototype),
  50450. n.LensFlare.prototype.constructor = n.LensFlare,
  50451. n.LensFlare.prototype.add = function(e, t, i, r, o, a) {
  50452. void 0 === t && (t = -1),
  50453. void 0 === i && (i = 0),
  50454. void 0 === a && (a = 1),
  50455. void 0 === o && (o = new n.Color(16777215)),
  50456. void 0 === r && (r = n.NormalBlending),
  50457. i = Math.min(i, Math.max(0, i)),
  50458. this.lensFlares.push({
  50459. texture: e,
  50460. size: t,
  50461. distance: i,
  50462. x: 0,
  50463. y: 0,
  50464. z: 0,
  50465. scale: 1,
  50466. rotation: 0,
  50467. opacity: a,
  50468. color: o,
  50469. blending: r
  50470. })
  50471. }
  50472. ,
  50473. n.LensFlare.prototype.updateLensFlares = function() {
  50474. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  50475. for (e = 0; e < i; e++)
  50476. t = this.lensFlares[e],
  50477. t.x = this.positionScreen.x + n * t.distance,
  50478. t.y = this.positionScreen.y + r * t.distance,
  50479. t.wantedRotation = t.x * Math.PI * .25,
  50480. t.rotation += .25 * (t.wantedRotation - t.rotation)
  50481. }
  50482. ,
  50483. n.LensFlare.prototype.copy = function(e) {
  50484. n.Object3D.prototype.copy.call(this, e),
  50485. this.positionScreen.copy(e.positionScreen),
  50486. this.customUpdateCallback = e.customUpdateCallback;
  50487. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  50488. this.lensFlares.push(e.lensFlares[t]);
  50489. return this
  50490. }
  50491. ,
  50492. n.Scene = function() {
  50493. n.Object3D.call(this),
  50494. this.type = "Scene",
  50495. this.fog = null,
  50496. this.overrideMaterial = null,
  50497. this.autoUpdate = !0
  50498. }
  50499. ,
  50500. n.Scene.prototype = Object.create(n.Object3D.prototype),
  50501. n.Scene.prototype.constructor = n.Scene,
  50502. n.Scene.prototype.copy = function(e, t) {
  50503. return n.Object3D.prototype.copy.call(this, e, t),
  50504. null !== e.fog && (this.fog = e.fog.clone()),
  50505. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  50506. this.autoUpdate = e.autoUpdate,
  50507. this.matrixAutoUpdate = e.matrixAutoUpdate,
  50508. this
  50509. }
  50510. ,
  50511. n.Fog = function(e, t, i) {
  50512. this.name = "",
  50513. this.color = new n.Color(e),
  50514. this.near = void 0 !== t ? t : 1,
  50515. this.far = void 0 !== i ? i : 1e3
  50516. }
  50517. ,
  50518. n.Fog.prototype.clone = function() {
  50519. return new n.Fog(this.color.getHex(),this.near,this.far)
  50520. }
  50521. ,
  50522. n.FogExp2 = function(e, t) {
  50523. this.name = "",
  50524. this.color = new n.Color(e),
  50525. this.density = void 0 !== t ? t : 25e-5
  50526. }
  50527. ,
  50528. n.FogExp2.prototype.clone = function() {
  50529. return new n.FogExp2(this.color.getHex(),this.density)
  50530. }
  50531. ,
  50532. n.ShaderChunk = {},
  50533. n.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  50534. n.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  50535. n.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  50536. n.ShaderChunk.aomap_fragment = "#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n",
  50537. n.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  50538. n.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  50539. n.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  50540. n.ShaderChunk.bsdfs = "bool testLightInRange( const in float lightDistance, const in float cutoffDistance ) {\n\treturn any( bvec2( cutoffDistance == 0.0, lightDistance < cutoffDistance ) );\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t\t}\n\t\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_Smith( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n",
  50541. n.ShaderChunk.bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n",
  50542. n.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  50543. n.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  50544. n.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  50545. n.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  50546. n.ShaderChunk.common = "#define PI 3.14159\n#define PI2 6.28318\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\n",
  50547. n.ShaderChunk.cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\nconst float cubeUV_textureSize = 1024.0;\nint getFaceFromDirection(vec3 direction) {\n vec3 absDirection = abs(direction);\n int face = -1;\n if( absDirection.x > absDirection.z ) {\n if(absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0 : 3;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n else {\n if(absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2 : 5;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n return face;\n}\nconst float cubeUV_maxLods1 = log2(cubeUV_textureSize*0.25) - 1.0;\nconst float cubeUV_rangeClamp = exp2((6.0 - 1.0) * 2.0);\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n float scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n float dxRoughness = dFdx(roughness);\n float dyRoughness = dFdy(roughness);\n vec3 dx = dFdx( vec * scale * dxRoughness );\n vec3 dy = dFdy( vec * scale * dyRoughness );\n float d = max( dot( dx, dx ), dot( dy, dy ) );\n d = clamp(d, 1.0, cubeUV_rangeClamp);\n float mipLevel = 0.5 * log2(d);\n return vec2(floor(mipLevel), fract(mipLevel));\n}\nconst float cubeUV_maxLods2 = log2(cubeUV_textureSize*0.25) - 2.0;\nconst float cubeUV_rcpTextureSize = 1.0 / cubeUV_textureSize;\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n mipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n float a = 16.0 * cubeUV_rcpTextureSize;\n vec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n vec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n float powScale = exp2_packed.x * exp2_packed.y;\n float scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n float mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n bool bRes = mipLevel == 0.0;\n scale = bRes && (scale < a) ? a : scale;\n vec3 r;\n vec2 offset;\n int face = getFaceFromDirection(direction);\n float rcpPowScale = 1.0 / powScale;\n if( face == 0) {\n r = vec3(direction.x, -direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 1) {\n r = vec3(direction.y, direction.x, direction.z);\n offset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 2) {\n r = vec3(direction.z, direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 3) {\n r = vec3(direction.x, direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else if( face == 4) {\n r = vec3(direction.y, direction.x, -direction.z);\n offset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else {\n r = vec3(direction.z, -direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n r = normalize(r);\n float texelOffset = 0.5 * cubeUV_rcpTextureSize;\n vec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n vec2 base = offset + vec2( texelOffset );\n return base + s * ( scale - 2.0 * texelOffset );\n}\nconst float cubeUV_maxLods3 = log2(cubeUV_textureSize*0.25) - 3.0;\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n float roughnessVal = roughness* cubeUV_maxLods3;\n float r1 = floor(roughnessVal);\n float r2 = r1 + 1.0;\n float t = fract(roughnessVal);\n vec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n float s = mipInfo.y;\n float level0 = mipInfo.x;\n float level1 = level0 + 1.0;\n level1 = level1 > 5.0 ? 5.0 : level1;\n level0 += min( floor( s + 0.5 ), 5.0 );\n vec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n vec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n vec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n vec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n vec4 result = mix(color10, color20, t);\n return vec4(result.rgb, 1.0);\n}\n#endif\n",
  50548. n.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  50549. n.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  50550. n.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  50551. n.ShaderChunk.emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",
  50552. n.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  50553. n.ShaderChunk.encodings_pars_fragment = "\nvec4 LinearToLinear( in vec4 value ) {\n return value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n float maxComponent = max( max( value.r, value.g ), value.b );\n float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n M = ceil( M * 255.0 ) / 255.0;\n return vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float D = max( maxRange / maxRGB, 1.0 );\n D = min( floor( D ) / 255.0, 1.0 );\n return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n vec4 vResult;\n vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n vResult.w = fract(Le);\n vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n return vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n float Le = value.z * 255.0 + value.w;\n vec3 Xp_Y_XYZp;\n Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n return vec4( max(vRGB, 0.0), 1.0 );\n}\n",
  50554. n.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  50555. n.ShaderChunk.envmap_fragment = "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#else\n\t\tfloat flipNormal = 1.0;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n",
  50556. n.ShaderChunk.envmap_pars_fragment = "#if defined( USE_ENVMAP ) || defined( STANDARD )\n\tuniform float reflectivity;\n\tuniform float envMapIntenstiy;\n#endif\n#ifdef USE_ENVMAP\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( STANDARD )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n",
  50557. n.ShaderChunk.envmap_pars_vertex = "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvarying vec3 vReflect;\n\tuniform float refractionRatio;\n#endif\n",
  50558. n.ShaderChunk.envmap_vertex = "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t#ifdef ENVMAP_MODE_REFLECTION\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t#else\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t#endif\n#endif\n",
  50559. n.ShaderChunk.fog_fragment = "#ifdef USE_FOG\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",
  50560. n.ShaderChunk.fog_pars_fragment = "#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",
  50561. n.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  50562. n.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  50563. n.ShaderChunk.lights_lambert_vertex = "vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tdirectLight = getPointDirectLightIrradiance( pointLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tdirectLight = getSpotDirectLightIrradiance( spotLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectLight = getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",
  50564. n.ShaderChunk.lights_pars = "uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tIncidentLight getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tIncidentLight getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tif ( testLightInRange( lightDistance, pointLight.distance ) ) {\n\t\t\tdirectLight.color = pointLight.color;\n\t\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tIncidentLight getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( all( bvec2( angleCos > spotLight.coneCos, testLightInRange( lightDistance, spotLight.distance ) ) ) ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( STANDARD )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t#endif\n\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n",
  50565. n.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  50566. n.ShaderChunk.lights_phong_pars_fragment = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",
  50567. n.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  50568. n.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  50569. n.ShaderChunk.lights_standard_fragment = "StandardMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\nmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n",
  50570. n.ShaderChunk.lights_standard_pars_fragment = "struct StandardMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n};\nvoid RE_Direct_Standard( const in IncidentLight directLight, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n}\nvoid RE_IndirectDiffuse_Standard( const in vec3 irradiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Standard( const in vec3 radiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectSpecular += radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Standard\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Standard\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Standard\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n",
  50571. n.ShaderChunk.lights_template = "\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tdirectLight = getPointDirectLightIrradiance( pointLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tdirectLight = getSpotDirectLightIrradiance( spotLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tdirectLight = getDirectionalDirectLightIrradiance( directionalLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t \tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\tRE_IndirectSpecular( radiance, geometry, material, reflectedLight );\n#endif\n",
  50572. n.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  50573. n.ShaderChunk.logdepthbuf_pars_fragment = "#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",
  50574. n.ShaderChunk.logdepthbuf_pars_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",
  50575. n.ShaderChunk.logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n",
  50576. n.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  50577. n.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  50578. n.ShaderChunk.map_particle_fragment = "#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",
  50579. n.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  50580. n.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  50581. n.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  50582. n.ShaderChunk.morphnormal_vertex = "#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",
  50583. n.ShaderChunk.morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif";
  50584. n.ShaderChunk.morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n";
  50585. n.ShaderChunk.normal_fragment = "#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\t#endif\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",
  50586. n.ShaderChunk.normalmap_pars_fragment = "#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n",
  50587. n.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  50588. n.ShaderChunk.project_vertex = "#ifdef USE_SKINNING\n\tvec4 mvPosition = modelViewMatrix * skinned;\n#else\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n#endif\ngl_Position = projectionMatrix * mvPosition;\n",
  50589. n.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  50590. n.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  50591. n.ShaderChunk.shadowmap_pars_fragment = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat unpackDepth( const in vec4 rgba_depth ) {\n\t\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\t\treturn dot( rgba_depth, bit_shift );\n\t}\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn 1.0;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n",
  50592. n.ShaderChunk.shadowmap_pars_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n",
  50593. n.ShaderChunk.shadowmap_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n",
  50594. n.ShaderChunk.shadowmask_pars_fragment = "float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",
  50595. n.ShaderChunk.skinbase_vertex = "#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",
  50596. n.ShaderChunk.skinning_pars_vertex = "#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneGlobalMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n",
  50597. n.ShaderChunk.skinning_vertex = "#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned = bindMatrixInverse * skinned;\n#endif\n",
  50598. n.ShaderChunk.skinnormal_vertex = "#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n",
  50599. n.ShaderChunk.specularmap_fragment = "float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",
  50600. n.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  50601. n.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  50602. n.ShaderChunk.tonemapping_pars_fragment = "#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n",
  50603. n.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  50604. n.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  50605. n.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  50606. n.ShaderChunk.uv_pars_fragment = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",
  50607. n.ShaderChunk.uv_pars_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n",
  50608. n.ShaderChunk.uv_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",
  50609. n.ShaderChunk.worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( STANDARD ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\t#ifdef USE_SKINNING\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\t#else\n\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t#endif\n#endif\n",
  50610. n.UniformsUtils = {
  50611. merge: function(e) {
  50612. for (var t = {}, i = 0; i < e.length; i++) {
  50613. var n = this.clone(e[i]);
  50614. for (var r in n)
  50615. t[r] = n[r]
  50616. }
  50617. return t
  50618. },
  50619. clone: function(e) {
  50620. var t = {};
  50621. for (var i in e) {
  50622. t[i] = {};
  50623. for (var r in e[i]) {
  50624. var o = e[i][r];
  50625. o instanceof n.Color || o instanceof n.Vector2 || o instanceof n.Vector3 || o instanceof n.Vector4 || o instanceof n.Matrix3 || o instanceof n.Matrix4 || o instanceof n.Texture ? t[i][r] = o.clone() : Array.isArray(o) ? t[i][r] = o.slice() : t[i][r] = o
  50626. }
  50627. }
  50628. return t
  50629. }
  50630. },
  50631. n.UniformsLib = {
  50632. common: {
  50633. diffuse: {
  50634. type: "c",
  50635. value: new n.Color(15658734)
  50636. },
  50637. opacity: {
  50638. type: "f",
  50639. value: 1
  50640. },
  50641. map: {
  50642. type: "t",
  50643. value: null
  50644. },
  50645. offsetRepeat: {
  50646. type: "v4",
  50647. value: new n.Vector4(0,0,1,1)
  50648. },
  50649. specularMap: {
  50650. type: "t",
  50651. value: null
  50652. },
  50653. alphaMap: {
  50654. type: "t",
  50655. value: null
  50656. },
  50657. envMap: {
  50658. type: "t",
  50659. value: null
  50660. },
  50661. flipEnvMap: {
  50662. type: "f",
  50663. value: -1
  50664. },
  50665. reflectivity: {
  50666. type: "f",
  50667. value: 1
  50668. },
  50669. refractionRatio: {
  50670. type: "f",
  50671. value: .98
  50672. }
  50673. },
  50674. aomap: {
  50675. aoMap: {
  50676. type: "t",
  50677. value: null
  50678. },
  50679. aoMapIntensity: {
  50680. type: "f",
  50681. value: 1
  50682. }
  50683. },
  50684. lightmap: {
  50685. lightMap: {
  50686. type: "t",
  50687. value: null
  50688. },
  50689. lightMapIntensity: {
  50690. type: "f",
  50691. value: 1
  50692. }
  50693. },
  50694. emissivemap: {
  50695. emissiveMap: {
  50696. type: "t",
  50697. value: null
  50698. }
  50699. },
  50700. bumpmap: {
  50701. bumpMap: {
  50702. type: "t",
  50703. value: null
  50704. },
  50705. bumpScale: {
  50706. type: "f",
  50707. value: 1
  50708. }
  50709. },
  50710. normalmap: {
  50711. normalMap: {
  50712. type: "t",
  50713. value: null
  50714. },
  50715. normalScale: {
  50716. type: "v2",
  50717. value: new n.Vector2(1,1)
  50718. }
  50719. },
  50720. displacementmap: {
  50721. displacementMap: {
  50722. type: "t",
  50723. value: null
  50724. },
  50725. displacementScale: {
  50726. type: "f",
  50727. value: 1
  50728. },
  50729. displacementBias: {
  50730. type: "f",
  50731. value: 0
  50732. }
  50733. },
  50734. roughnessmap: {
  50735. roughnessMap: {
  50736. type: "t",
  50737. value: null
  50738. }
  50739. },
  50740. metalnessmap: {
  50741. metalnessMap: {
  50742. type: "t",
  50743. value: null
  50744. }
  50745. },
  50746. fog: {
  50747. fogDensity: {
  50748. type: "f",
  50749. value: 25e-5
  50750. },
  50751. fogNear: {
  50752. type: "f",
  50753. value: 1
  50754. },
  50755. fogFar: {
  50756. type: "f",
  50757. value: 2e3
  50758. },
  50759. fogColor: {
  50760. type: "c",
  50761. value: new n.Color(16777215)
  50762. }
  50763. },
  50764. lights: {
  50765. ambientLightColor: {
  50766. type: "fv",
  50767. value: []
  50768. },
  50769. directionalLights: {
  50770. type: "sa",
  50771. value: [],
  50772. properties: {
  50773. direction: {
  50774. type: "v3"
  50775. },
  50776. color: {
  50777. type: "c"
  50778. },
  50779. shadow: {
  50780. type: "i"
  50781. },
  50782. shadowBias: {
  50783. type: "f"
  50784. },
  50785. shadowRadius: {
  50786. type: "f"
  50787. },
  50788. shadowMapSize: {
  50789. type: "v2"
  50790. }
  50791. }
  50792. },
  50793. directionalShadowMap: {
  50794. type: "tv",
  50795. value: []
  50796. },
  50797. directionalShadowMatrix: {
  50798. type: "m4v",
  50799. value: []
  50800. },
  50801. spotLights: {
  50802. type: "sa",
  50803. value: [],
  50804. properties: {
  50805. color: {
  50806. type: "c"
  50807. },
  50808. position: {
  50809. type: "v3"
  50810. },
  50811. direction: {
  50812. type: "v3"
  50813. },
  50814. distance: {
  50815. type: "f"
  50816. },
  50817. coneCos: {
  50818. type: "f"
  50819. },
  50820. penumbraCos: {
  50821. type: "f"
  50822. },
  50823. decay: {
  50824. type: "f"
  50825. },
  50826. shadow: {
  50827. type: "i"
  50828. },
  50829. shadowBias: {
  50830. type: "f"
  50831. },
  50832. shadowRadius: {
  50833. type: "f"
  50834. },
  50835. shadowMapSize: {
  50836. type: "v2"
  50837. }
  50838. }
  50839. },
  50840. spotShadowMap: {
  50841. type: "tv",
  50842. value: []
  50843. },
  50844. spotShadowMatrix: {
  50845. type: "m4v",
  50846. value: []
  50847. },
  50848. pointLights: {
  50849. type: "sa",
  50850. value: [],
  50851. properties: {
  50852. color: {
  50853. type: "c"
  50854. },
  50855. position: {
  50856. type: "v3"
  50857. },
  50858. decay: {
  50859. type: "f"
  50860. },
  50861. distance: {
  50862. type: "f"
  50863. },
  50864. shadow: {
  50865. type: "i"
  50866. },
  50867. shadowBias: {
  50868. type: "f"
  50869. },
  50870. shadowRadius: {
  50871. type: "f"
  50872. },
  50873. shadowMapSize: {
  50874. type: "v2"
  50875. }
  50876. }
  50877. },
  50878. pointShadowMap: {
  50879. type: "tv",
  50880. value: []
  50881. },
  50882. pointShadowMatrix: {
  50883. type: "m4v",
  50884. value: []
  50885. },
  50886. hemisphereLights: {
  50887. type: "sa",
  50888. value: [],
  50889. properties: {
  50890. direction: {
  50891. type: "v3"
  50892. },
  50893. skyColor: {
  50894. type: "c"
  50895. },
  50896. groundColor: {
  50897. type: "c"
  50898. }
  50899. }
  50900. }
  50901. },
  50902. points: {
  50903. diffuse: {
  50904. type: "c",
  50905. value: new n.Color(15658734)
  50906. },
  50907. opacity: {
  50908. type: "f",
  50909. value: 1
  50910. },
  50911. size: {
  50912. type: "f",
  50913. value: 1
  50914. },
  50915. scale: {
  50916. type: "f",
  50917. value: 1
  50918. },
  50919. map: {
  50920. type: "t",
  50921. value: null
  50922. },
  50923. offsetRepeat: {
  50924. type: "v4",
  50925. value: new n.Vector4(0,0,1,1)
  50926. }
  50927. }
  50928. },
  50929. n.ShaderChunk.cube_frag = "uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\t#include <logdepthbuf_fragment>\n}\n",
  50930. n.ShaderChunk.cube_vert = "varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t#include <logdepthbuf_vertex>\n}\n",
  50931. n.ShaderChunk.depth_frag = "uniform float mNear;\nuniform float mFar;\nuniform float opacity;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );\n\tgl_FragColor = vec4( vec3( color ), opacity );\n}\n",
  50932. n.ShaderChunk.depth_vert = "#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  50933. n.ShaderChunk.depthRGBA_frag = "#include <common>\n#include <logdepthbuf_pars_fragment>\nvec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}\n",
  50934. n.ShaderChunk.depthRGBA_vert = "#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  50935. n.ShaderChunk.distanceRGBA_frag = "uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include <common>\nvec4 pack1K ( float depth ) {\n\tdepth /= 1000.0;\n\tconst vec4 bitSh = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bitMsk = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bitSh * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bitMsk;\n\treturn res;\n}\nfloat unpack1K ( vec4 color ) {\n\tconst vec4 bitSh = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\treturn dot( color, bitSh ) * 1000.0;\n}\nvoid main () {\n\tgl_FragColor = pack1K( length( vWorldPosition.xyz - lightPos.xyz ) );\n}\n",
  50936. n.ShaderChunk.distanceRGBA_vert = "varying vec4 vWorldPosition;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\tvWorldPosition = worldPosition;\n}\n",
  50937. n.ShaderChunk.equirect_frag = "uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <logdepthbuf_fragment>\n}\n",
  50938. n.ShaderChunk.equirect_vert = "varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t#include <logdepthbuf_vertex>\n}\n",
  50939. n.ShaderChunk.linedashed_frag = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  50940. n.ShaderChunk.linedashed_vert = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n}\n",
  50941. n.ShaderChunk.meshbasic_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight;\n\treflectedLight.directDiffuse = vec3( 0.0 );\n\treflectedLight.directSpecular = vec3( 0.0 );\n\treflectedLight.indirectDiffuse = diffuseColor.rgb;\n\treflectedLight.indirectSpecular = vec3( 0.0 );\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  50942. n.ShaderChunk.meshbasic_vert = "#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n}\n",
  50943. n.ShaderChunk.meshlambert_frag = "uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  50944. n.ShaderChunk.meshlambert_vert = "#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  50945. n.ShaderChunk.meshphong_frag = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  50946. n.ShaderChunk.meshphong_vert = "#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <lights_phong_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_phong_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  50947. n.ShaderChunk.meshstandard_frag = "#define STANDARD\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\nuniform float envMapIntensity;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars>\n#include <lights_standard_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_standard_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  50948. n.ShaderChunk.meshstandard_vert = "#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  50949. n.ShaderChunk.normal_frag = "uniform float opacity;\nvarying vec3 vNormal;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );\n\t#include <logdepthbuf_fragment>\n}\n",
  50950. n.ShaderChunk.normal_vert = "varying vec3 vNormal;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvNormal = normalize( normalMatrix * normal );\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  50951. n.ShaderChunk.points_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  50952. n.ShaderChunk.points_vert = "uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  50953. n.ShaderLib = {
  50954. basic: {
  50955. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.fog]),
  50956. vertexShader: n.ShaderChunk.meshbasic_vert,
  50957. fragmentShader: n.ShaderChunk.meshbasic_frag
  50958. },
  50959. lambert: {
  50960. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.fog, n.UniformsLib.lights, {
  50961. emissive: {
  50962. type: "c",
  50963. value: new n.Color(0)
  50964. }
  50965. }]),
  50966. vertexShader: n.ShaderChunk.meshlambert_vert,
  50967. fragmentShader: n.ShaderChunk.meshlambert_frag
  50968. },
  50969. phong: {
  50970. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.bumpmap, n.UniformsLib.normalmap, n.UniformsLib.displacementmap, n.UniformsLib.fog, n.UniformsLib.lights, {
  50971. emissive: {
  50972. type: "c",
  50973. value: new n.Color(0)
  50974. },
  50975. specular: {
  50976. type: "c",
  50977. value: new n.Color(1118481)
  50978. },
  50979. shininess: {
  50980. type: "f",
  50981. value: 30
  50982. }
  50983. }]),
  50984. vertexShader: n.ShaderChunk.meshphong_vert,
  50985. fragmentShader: n.ShaderChunk.meshphong_frag
  50986. },
  50987. standard: {
  50988. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.bumpmap, n.UniformsLib.normalmap, n.UniformsLib.displacementmap, n.UniformsLib.roughnessmap, n.UniformsLib.metalnessmap, n.UniformsLib.fog, n.UniformsLib.lights, {
  50989. emissive: {
  50990. type: "c",
  50991. value: new n.Color(0)
  50992. },
  50993. roughness: {
  50994. type: "f",
  50995. value: .5
  50996. },
  50997. metalness: {
  50998. type: "f",
  50999. value: 0
  51000. },
  51001. envMapIntensity: {
  51002. type: "f",
  51003. value: 1
  51004. }
  51005. }]),
  51006. vertexShader: n.ShaderChunk.meshstandard_vert,
  51007. fragmentShader: n.ShaderChunk.meshstandard_frag
  51008. },
  51009. points: {
  51010. uniforms: n.UniformsUtils.merge([n.UniformsLib.points, n.UniformsLib.fog]),
  51011. vertexShader: n.ShaderChunk.points_vert,
  51012. fragmentShader: n.ShaderChunk.points_frag
  51013. },
  51014. dashed: {
  51015. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.fog, {
  51016. scale: {
  51017. type: "f",
  51018. value: 1
  51019. },
  51020. dashSize: {
  51021. type: "f",
  51022. value: 1
  51023. },
  51024. totalSize: {
  51025. type: "f",
  51026. value: 2
  51027. }
  51028. }]),
  51029. vertexShader: n.ShaderChunk.linedashed_vert,
  51030. fragmentShader: n.ShaderChunk.linedashed_frag
  51031. },
  51032. depth: {
  51033. uniforms: {
  51034. mNear: {
  51035. type: "f",
  51036. value: 1
  51037. },
  51038. mFar: {
  51039. type: "f",
  51040. value: 2e3
  51041. },
  51042. opacity: {
  51043. type: "f",
  51044. value: 1
  51045. }
  51046. },
  51047. vertexShader: n.ShaderChunk.depth_vert,
  51048. fragmentShader: n.ShaderChunk.depth_frag
  51049. },
  51050. normal: {
  51051. uniforms: {
  51052. opacity: {
  51053. type: "f",
  51054. value: 1
  51055. }
  51056. },
  51057. vertexShader: n.ShaderChunk.normal_vert,
  51058. fragmentShader: n.ShaderChunk.normal_frag
  51059. },
  51060. cube: {
  51061. uniforms: {
  51062. tCube: {
  51063. type: "t",
  51064. value: null
  51065. },
  51066. tFlip: {
  51067. type: "f",
  51068. value: -1
  51069. }
  51070. },
  51071. vertexShader: n.ShaderChunk.cube_vert,
  51072. fragmentShader: n.ShaderChunk.cube_frag
  51073. },
  51074. equirect: {
  51075. uniforms: {
  51076. tEquirect: {
  51077. type: "t",
  51078. value: null
  51079. },
  51080. tFlip: {
  51081. type: "f",
  51082. value: -1
  51083. }
  51084. },
  51085. vertexShader: n.ShaderChunk.equirect_vert,
  51086. fragmentShader: n.ShaderChunk.equirect_frag
  51087. },
  51088. depthRGBA: {
  51089. uniforms: {},
  51090. vertexShader: n.ShaderChunk.depthRGBA_vert,
  51091. fragmentShader: n.ShaderChunk.depthRGBA_frag
  51092. },
  51093. distanceRGBA: {
  51094. uniforms: {
  51095. lightPos: {
  51096. type: "v3",
  51097. value: new n.Vector3(0,0,0)
  51098. }
  51099. },
  51100. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  51101. fragmentShader: n.ShaderChunk.distanceRGBA_frag
  51102. }
  51103. },
  51104. n.WebGLRenderer = function(e) {
  51105. function t() {
  51106. return null === ye ? Oe : 1
  51107. }
  51108. function i(e, t, i, n) {
  51109. se === !0 && (e *= n,
  51110. t *= n,
  51111. i *= n),
  51112. Ye.clearColor(e, t, i, n)
  51113. }
  51114. function r() {
  51115. Ye.init(),
  51116. Ye.scissor(we.copy(Le).multiplyScalar(Oe)),
  51117. Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)),
  51118. i(Se.r, Se.g, Se.b, Me)
  51119. }
  51120. function o() {
  51121. Ae = null,
  51122. be = null,
  51123. Ee = "",
  51124. Ie = -1,
  51125. Ye.reset()
  51126. }
  51127. function a(e) {
  51128. e.preventDefault(),
  51129. o(),
  51130. r(),
  51131. Xe.clear()
  51132. }
  51133. function s(e) {
  51134. var t = e.target;
  51135. t.removeEventListener("dispose", s),
  51136. h(t),
  51137. ke.textures--
  51138. }
  51139. function l(e) {
  51140. var t = e.target;
  51141. t.removeEventListener("dispose", l),
  51142. u(t),
  51143. ke.textures--
  51144. }
  51145. function c(e) {
  51146. var t = e.target;
  51147. t.removeEventListener("dispose", c),
  51148. d(t)
  51149. }
  51150. function h(e) {
  51151. var t = Xe.get(e);
  51152. if (e.image && t.__image__webglTextureCube)
  51153. Ge.deleteTexture(t.__image__webglTextureCube);
  51154. else {
  51155. if (void 0 === t.__webglInit)
  51156. return;
  51157. Ge.deleteTexture(t.__webglTexture)
  51158. }
  51159. Xe.delete(e)
  51160. }
  51161. function u(e) {
  51162. var t = Xe.get(e)
  51163. , i = Xe.get(e.texture);
  51164. if (e && void 0 !== i.__webglTexture) {
  51165. if (Ge.deleteTexture(i.__webglTexture),
  51166. e instanceof n.WebGLRenderTargetCube)
  51167. for (var r = 0; r < 6; r++)
  51168. Ge.deleteFramebuffer(t.__webglFramebuffer[r]),
  51169. Ge.deleteRenderbuffer(t.__webglDepthbuffer[r]);
  51170. else
  51171. Ge.deleteFramebuffer(t.__webglFramebuffer),
  51172. Ge.deleteRenderbuffer(t.__webglDepthbuffer);
  51173. Xe.delete(e.texture),
  51174. Xe.delete(e)
  51175. }
  51176. }
  51177. function d(e) {
  51178. p(e),
  51179. Xe.delete(e)
  51180. }
  51181. function p(e) {
  51182. var t = Xe.get(e).program;
  51183. e.program = void 0,
  51184. void 0 !== t && qe.releaseProgram(t)
  51185. }
  51186. function f(e, t, i, r) {
  51187. var o;
  51188. if (i instanceof n.InstancedBufferGeometry && (o = We.get("ANGLE_instanced_arrays"),
  51189. null === o))
  51190. return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  51191. void 0 === r && (r = 0),
  51192. Ye.initAttributes();
  51193. var a = i.attributes
  51194. , s = t.getAttributes()
  51195. , l = e.defaultAttributeValues;
  51196. for (var c in s) {
  51197. var h = s[c];
  51198. if (h >= 0) {
  51199. var u = a[c];
  51200. if (void 0 !== u) {
  51201. var d = u.itemSize
  51202. , p = Ze.getAttributeBuffer(u);
  51203. if (u instanceof n.InterleavedBufferAttribute) {
  51204. var f = u.data
  51205. , g = f.stride
  51206. , m = u.offset;
  51207. f instanceof n.InstancedInterleavedBuffer ? (Ye.enableAttributeAndDivisor(h, f.meshPerAttribute, o),
  51208. void 0 === i.maxInstancedCount && (i.maxInstancedCount = f.meshPerAttribute * f.count)) : Ye.enableAttribute(h),
  51209. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  51210. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, g * f.array.BYTES_PER_ELEMENT, (r * g + m) * f.array.BYTES_PER_ELEMENT)
  51211. } else
  51212. u instanceof n.InstancedBufferAttribute ? (Ye.enableAttributeAndDivisor(h, u.meshPerAttribute, o),
  51213. void 0 === i.maxInstancedCount && (i.maxInstancedCount = u.meshPerAttribute * u.count)) : Ye.enableAttribute(h),
  51214. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  51215. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, 0, r * d * 4)
  51216. } else if (void 0 !== l) {
  51217. var v = l[c];
  51218. if (void 0 !== v)
  51219. switch (v.length) {
  51220. case 2:
  51221. Ge.vertexAttrib2fv(h, v);
  51222. break;
  51223. case 3:
  51224. Ge.vertexAttrib3fv(h, v);
  51225. break;
  51226. case 4:
  51227. Ge.vertexAttrib4fv(h, v);
  51228. break;
  51229. default:
  51230. Ge.vertexAttrib1fv(h, v)
  51231. }
  51232. }
  51233. }
  51234. }
  51235. Ye.disableUnusedAttributes()
  51236. }
  51237. function g(e, t) {
  51238. return Math.abs(t[0]) - Math.abs(e[0])
  51239. }
  51240. function m(e, t) {
  51241. 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
  51242. }
  51243. function v(e, t) {
  51244. 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
  51245. }
  51246. function A(e, t, i, n, r) {
  51247. var o, a;
  51248. i.transparent ? (o = de,
  51249. a = ++pe) : (o = he,
  51250. a = ++ue);
  51251. var s = o[a];
  51252. void 0 !== s ? (s.id = e.id,
  51253. s.object = e,
  51254. s.geometry = t,
  51255. s.material = i,
  51256. s.z = Ve.z,
  51257. s.group = r) : (s = {
  51258. id: e.id,
  51259. object: e,
  51260. geometry: t,
  51261. material: i,
  51262. z: Ve.z,
  51263. group: r
  51264. },
  51265. o.push(s))
  51266. }
  51267. function y(e, t) {
  51268. if (e.visible !== !1) {
  51269. if (e.layers.test(t.layers))
  51270. if (e instanceof n.Light)
  51271. ce.push(e);
  51272. else if (e instanceof n.Sprite)
  51273. e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0 || ge.push(e);
  51274. else if (e instanceof n.LensFlare)
  51275. me.push(e);
  51276. else if (e instanceof n.ImmediateRenderObject)
  51277. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  51278. Ve.applyProjection(Fe)),
  51279. A(e, null, e.material, Ve.z, null);
  51280. else if ((e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && (e instanceof n.SkinnedMesh && e.skeleton.update(),
  51281. e.frustumCulled === !1 || Be.intersectsObject(e) === !0)) {
  51282. var i = e.material;
  51283. if (i.visible === !0) {
  51284. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  51285. Ve.applyProjection(Fe));
  51286. var r = Ze.update(e);
  51287. if (i instanceof n.MultiMaterial)
  51288. for (var o = r.groups, a = i.materials, s = 0, l = o.length; s < l; s++) {
  51289. var c = o[s]
  51290. , h = a[c.materialIndex];
  51291. h.visible === !0 && A(e, r, h, Ve.z, c)
  51292. }
  51293. else
  51294. A(e, r, i, Ve.z, null)
  51295. }
  51296. }
  51297. for (var u = e.children, s = 0, l = u.length; s < l; s++)
  51298. y(u[s], t)
  51299. }
  51300. }
  51301. function C(e, t, i, r) {
  51302. for (var o = 0, a = e.length; o < a; o++) {
  51303. var s = e[o]
  51304. , l = s.object
  51305. , c = s.geometry
  51306. , h = void 0 === r ? s.material : r
  51307. , u = s.group;
  51308. if (l.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  51309. l.normalMatrix.getNormalMatrix(l.modelViewMatrix),
  51310. l instanceof n.ImmediateRenderObject) {
  51311. E(h);
  51312. var d = w(t, i, h, l);
  51313. Ee = "",
  51314. l.render(function(e) {
  51315. ve.renderBufferImmediate(e, d, h)
  51316. })
  51317. } else
  51318. ve.renderBufferDirect(t, i, c, h, l, u)
  51319. }
  51320. }
  51321. function I(e, t, i) {
  51322. var r = Xe.get(e)
  51323. , o = qe.getParameters(e, Ue, t, i)
  51324. , a = qe.getProgramCode(e, o)
  51325. , s = r.program
  51326. , l = !0;
  51327. if (void 0 === s)
  51328. e.addEventListener("dispose", c);
  51329. else if (s.code !== a)
  51330. p(e);
  51331. else {
  51332. if (void 0 !== o.shaderID)
  51333. return;
  51334. l = !1
  51335. }
  51336. if (l) {
  51337. if (o.shaderID) {
  51338. var h = n.ShaderLib[o.shaderID];
  51339. r.__webglShader = {
  51340. name: e.type,
  51341. uniforms: n.UniformsUtils.clone(h.uniforms),
  51342. vertexShader: h.vertexShader,
  51343. fragmentShader: h.fragmentShader
  51344. }
  51345. } else
  51346. r.__webglShader = {
  51347. name: e.type,
  51348. uniforms: e.uniforms,
  51349. vertexShader: e.vertexShader,
  51350. fragmentShader: e.fragmentShader
  51351. };
  51352. e.__webglShader = r.__webglShader,
  51353. s = qe.acquireProgram(e, o, a),
  51354. r.program = s,
  51355. e.program = s
  51356. }
  51357. var u = s.getAttributes();
  51358. if (e.morphTargets) {
  51359. e.numSupportedMorphTargets = 0;
  51360. for (var d = 0; d < ve.maxMorphTargets; d++)
  51361. u["morphTarget" + d] >= 0 && e.numSupportedMorphTargets++
  51362. }
  51363. if (e.morphNormals) {
  51364. e.numSupportedMorphNormals = 0;
  51365. for (var d = 0; d < ve.maxMorphNormals; d++)
  51366. u["morphNormal" + d] >= 0 && e.numSupportedMorphNormals++
  51367. }
  51368. r.uniformsList = [];
  51369. var f = r.__webglShader.uniforms
  51370. , g = r.program.getUniforms();
  51371. for (var m in f) {
  51372. var v = g[m];
  51373. v && r.uniformsList.push([r.__webglShader.uniforms[m], v])
  51374. }
  51375. (e instanceof n.MeshPhongMaterial || e instanceof n.MeshLambertMaterial || e instanceof n.MeshStandardMaterial || e.lights) && (r.lightsHash = Ue.hash,
  51376. f.ambientLightColor.value = Ue.ambient,
  51377. f.directionalLights.value = Ue.directional,
  51378. f.spotLights.value = Ue.spot,
  51379. f.pointLights.value = Ue.point,
  51380. f.hemisphereLights.value = Ue.hemi,
  51381. f.directionalShadowMap.value = Ue.directionalShadowMap,
  51382. f.directionalShadowMatrix.value = Ue.directionalShadowMatrix,
  51383. f.spotShadowMap.value = Ue.spotShadowMap,
  51384. f.spotShadowMatrix.value = Ue.spotShadowMatrix,
  51385. f.pointShadowMap.value = Ue.pointShadowMap,
  51386. f.pointShadowMatrix.value = Ue.pointShadowMatrix),
  51387. r.hasDynamicUniforms = !1;
  51388. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  51389. var C = r.uniformsList[A][0];
  51390. if (C.dynamic === !0) {
  51391. r.hasDynamicUniforms = !0;
  51392. break
  51393. }
  51394. }
  51395. }
  51396. function E(e) {
  51397. b(e),
  51398. e.transparent === !0 ? Ye.setBlending(e.blending, e.blendEquation, e.blendSrc, e.blendDst, e.blendEquationAlpha, e.blendSrcAlpha, e.blendDstAlpha, e.premultipliedAlpha) : Ye.setBlending(n.NoBlending),
  51399. Ye.setDepthFunc(e.depthFunc),
  51400. Ye.setDepthTest(e.depthTest),
  51401. Ye.setDepthWrite(e.depthWrite),
  51402. Ye.setColorWrite(e.colorWrite),
  51403. Ye.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  51404. }
  51405. function b(e) {
  51406. e.side !== n.DoubleSide ? Ye.enable(Ge.CULL_FACE) : Ye.disable(Ge.CULL_FACE),
  51407. Ye.setFlipSided(e.side === n.BackSide)
  51408. }
  51409. function w(e, t, i, r) {
  51410. xe = 0;
  51411. var o = Xe.get(i);
  51412. void 0 === o.program && (i.needsUpdate = !0),
  51413. void 0 !== o.lightsHash && o.lightsHash !== Ue.hash && (i.needsUpdate = !0),
  51414. i.needsUpdate && (I(i, t, r),
  51415. i.needsUpdate = !1);
  51416. var a = !1
  51417. , s = !1
  51418. , l = !1
  51419. , c = o.program
  51420. , h = c.getUniforms()
  51421. , u = o.__webglShader.uniforms;
  51422. if (c.id !== Ae && (Ge.useProgram(c.program),
  51423. Ae = c.id,
  51424. a = !0,
  51425. s = !0,
  51426. l = !0),
  51427. i.id !== Ie && (Ie = i.id,
  51428. s = !0),
  51429. (a || e !== be) && (Ge.uniformMatrix4fv(h.projectionMatrix, !1, e.projectionMatrix.elements),
  51430. je.logarithmicDepthBuffer && Ge.uniform1f(h.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  51431. e !== be && (be = e,
  51432. s = !0,
  51433. l = !0),
  51434. (i instanceof n.ShaderMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial || i.envMap) && void 0 !== h.cameraPosition && (Ve.setFromMatrixPosition(e.matrixWorld),
  51435. Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  51436. (i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshBasicMaterial || i instanceof n.MeshStandardMaterial || i instanceof n.ShaderMaterial || i.skinning) && void 0 !== h.viewMatrix && Ge.uniformMatrix4fv(h.viewMatrix, !1, e.matrixWorldInverse.elements),
  51437. void 0 !== h.toneMappingExposure && Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  51438. void 0 !== h.toneMappingWhitePoint && Ge.uniform1f(h.toneMappingWhitePoint, ve.toneMappingWhitePoint)),
  51439. i.skinning)
  51440. if (r.bindMatrix && void 0 !== h.bindMatrix && Ge.uniformMatrix4fv(h.bindMatrix, !1, r.bindMatrix.elements),
  51441. r.bindMatrixInverse && void 0 !== h.bindMatrixInverse && Ge.uniformMatrix4fv(h.bindMatrixInverse, !1, r.bindMatrixInverse.elements),
  51442. je.floatVertexTextures && r.skeleton && r.skeleton.useVertexTexture) {
  51443. if (void 0 !== h.boneTexture) {
  51444. var d = B();
  51445. Ge.uniform1i(h.boneTexture, d),
  51446. ve.setTexture(r.skeleton.boneTexture, d)
  51447. }
  51448. void 0 !== h.boneTextureWidth && Ge.uniform1i(h.boneTextureWidth, r.skeleton.boneTextureWidth),
  51449. void 0 !== h.boneTextureHeight && Ge.uniform1i(h.boneTextureHeight, r.skeleton.boneTextureHeight)
  51450. } else
  51451. r.skeleton && r.skeleton.boneMatrices && void 0 !== h.boneGlobalMatrices && Ge.uniformMatrix4fv(h.boneGlobalMatrices, !1, r.skeleton.boneMatrices);
  51452. return s && ((i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshStandardMaterial || i.lights) && D(u, l),
  51453. t && i.fog && R(u, t),
  51454. (i instanceof n.MeshBasicMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial) && T(u, i),
  51455. i instanceof n.LineBasicMaterial ? x(u, i) : i instanceof n.LineDashedMaterial ? (x(u, i),
  51456. S(u, i)) : i instanceof n.PointsMaterial ? M(u, i) : i instanceof n.MeshLambertMaterial ? P(u, i) : i instanceof n.MeshPhongMaterial ? O(u, i) : i instanceof n.MeshStandardMaterial ? L(u, i) : i instanceof n.MeshDepthMaterial ? (u.mNear.value = e.near,
  51457. u.mFar.value = e.far,
  51458. u.opacity.value = i.opacity) : i instanceof n.MeshNormalMaterial && (u.opacity.value = i.opacity),
  51459. V(o.uniformsList)),
  51460. N(h, r),
  51461. void 0 !== h.modelMatrix && Ge.uniformMatrix4fv(h.modelMatrix, !1, r.matrixWorld.elements),
  51462. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  51463. c
  51464. }
  51465. function _(e, t, i) {
  51466. for (var n = [], r = 0, o = e.length; r < o; r++) {
  51467. var a = e[r][0]
  51468. , s = a.onUpdateCallback;
  51469. void 0 !== s && (s.bind(a)(t, i),
  51470. n.push(e[r]))
  51471. }
  51472. V(n)
  51473. }
  51474. function T(e, t) {
  51475. e.opacity.value = t.opacity,
  51476. e.diffuse.value = t.color,
  51477. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  51478. e.map.value = t.map,
  51479. e.specularMap.value = t.specularMap,
  51480. e.alphaMap.value = t.alphaMap,
  51481. t.aoMap && (e.aoMap.value = t.aoMap,
  51482. e.aoMapIntensity.value = t.aoMapIntensity);
  51483. var i;
  51484. if (t.map ? i = t.map : t.specularMap ? i = t.specularMap : t.displacementMap ? i = t.displacementMap : t.normalMap ? i = t.normalMap : t.bumpMap ? i = t.bumpMap : t.roughnessMap ? i = t.roughnessMap : t.metalnessMap ? i = t.metalnessMap : t.alphaMap ? i = t.alphaMap : t.emissiveMap && (i = t.emissiveMap),
  51485. void 0 !== i) {
  51486. i instanceof n.WebGLRenderTarget && (i = i.texture);
  51487. var r = i.offset
  51488. , o = i.repeat;
  51489. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y)
  51490. }
  51491. e.envMap.value = t.envMap,
  51492. e.flipEnvMap.value = t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1,
  51493. e.reflectivity.value = t.reflectivity,
  51494. e.refractionRatio.value = t.refractionRatio
  51495. }
  51496. function x(e, t) {
  51497. e.diffuse.value = t.color,
  51498. e.opacity.value = t.opacity
  51499. }
  51500. function S(e, t) {
  51501. e.dashSize.value = t.dashSize,
  51502. e.totalSize.value = t.dashSize + t.gapSize,
  51503. e.scale.value = t.scale
  51504. }
  51505. function M(e, t) {
  51506. if (e.diffuse.value = t.color,
  51507. e.opacity.value = t.opacity,
  51508. e.size.value = t.size * Oe,
  51509. e.scale.value = te.clientHeight / 2,
  51510. e.map.value = t.map,
  51511. null !== t.map) {
  51512. var i = t.map.offset
  51513. , n = t.map.repeat;
  51514. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  51515. }
  51516. }
  51517. function R(e, t) {
  51518. e.fogColor.value = t.color,
  51519. t instanceof n.Fog ? (e.fogNear.value = t.near,
  51520. e.fogFar.value = t.far) : t instanceof n.FogExp2 && (e.fogDensity.value = t.density)
  51521. }
  51522. function P(e, t) {
  51523. t.lightMap && (e.lightMap.value = t.lightMap,
  51524. e.lightMapIntensity.value = t.lightMapIntensity),
  51525. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  51526. }
  51527. function O(e, t) {
  51528. e.specular.value = t.specular,
  51529. e.shininess.value = Math.max(t.shininess, 1e-4),
  51530. t.lightMap && (e.lightMap.value = t.lightMap,
  51531. e.lightMapIntensity.value = t.lightMapIntensity),
  51532. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  51533. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  51534. e.bumpScale.value = t.bumpScale),
  51535. t.normalMap && (e.normalMap.value = t.normalMap,
  51536. e.normalScale.value.copy(t.normalScale)),
  51537. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  51538. e.displacementScale.value = t.displacementScale,
  51539. e.displacementBias.value = t.displacementBias)
  51540. }
  51541. function L(e, t) {
  51542. e.roughness.value = t.roughness,
  51543. e.metalness.value = t.metalness,
  51544. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  51545. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  51546. t.lightMap && (e.lightMap.value = t.lightMap,
  51547. e.lightMapIntensity.value = t.lightMapIntensity),
  51548. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  51549. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  51550. e.bumpScale.value = t.bumpScale),
  51551. t.normalMap && (e.normalMap.value = t.normalMap,
  51552. e.normalScale.value.copy(t.normalScale)),
  51553. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  51554. e.displacementScale.value = t.displacementScale,
  51555. e.displacementBias.value = t.displacementBias),
  51556. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  51557. }
  51558. function D(e, t) {
  51559. e.ambientLightColor.needsUpdate = t,
  51560. e.directionalLights.needsUpdate = t,
  51561. e.pointLights.needsUpdate = t,
  51562. e.spotLights.needsUpdate = t,
  51563. e.hemisphereLights.needsUpdate = t
  51564. }
  51565. function N(e, t) {
  51566. Ge.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  51567. e.normalMatrix && Ge.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  51568. }
  51569. function B() {
  51570. var e = xe;
  51571. return e >= je.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + je.maxTextures),
  51572. xe += 1,
  51573. e
  51574. }
  51575. function F(e, t, i, r) {
  51576. var o, a;
  51577. if ("1i" === t)
  51578. Ge.uniform1i(i, r);
  51579. else if ("1f" === t)
  51580. Ge.uniform1f(i, r);
  51581. else if ("2f" === t)
  51582. Ge.uniform2f(i, r[0], r[1]);
  51583. else if ("3f" === t)
  51584. Ge.uniform3f(i, r[0], r[1], r[2]);
  51585. else if ("4f" === t)
  51586. Ge.uniform4f(i, r[0], r[1], r[2], r[3]);
  51587. else if ("1iv" === t)
  51588. Ge.uniform1iv(i, r);
  51589. else if ("3iv" === t)
  51590. Ge.uniform3iv(i, r);
  51591. else if ("1fv" === t)
  51592. Ge.uniform1fv(i, r);
  51593. else if ("2fv" === t)
  51594. Ge.uniform2fv(i, r);
  51595. else if ("3fv" === t)
  51596. Ge.uniform3fv(i, r);
  51597. else if ("4fv" === t)
  51598. Ge.uniform4fv(i, r);
  51599. else if ("Matrix2fv" === t)
  51600. Ge.uniformMatrix2fv(i, !1, r);
  51601. else if ("Matrix3fv" === t)
  51602. Ge.uniformMatrix3fv(i, !1, r);
  51603. else if ("Matrix4fv" === t)
  51604. Ge.uniformMatrix4fv(i, !1, r);
  51605. else if ("i" === t)
  51606. Ge.uniform1i(i, r);
  51607. else if ("f" === t)
  51608. Ge.uniform1f(i, r);
  51609. else if ("v2" === t)
  51610. Ge.uniform2f(i, r.x, r.y);
  51611. else if ("v3" === t)
  51612. Ge.uniform3f(i, r.x, r.y, r.z);
  51613. else if ("v4" === t)
  51614. Ge.uniform4f(i, r.x, r.y, r.z, r.w);
  51615. else if ("c" === t)
  51616. Ge.uniform3f(i, r.r, r.g, r.b);
  51617. else if ("s" === t) {
  51618. var s = e.properties;
  51619. for (var l in s) {
  51620. var c = s[l]
  51621. , h = i[l]
  51622. , u = r[l];
  51623. F(c, c.type, h, u)
  51624. }
  51625. } else if ("sa" === t)
  51626. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  51627. for (var l in s) {
  51628. var c = s[l]
  51629. , h = i[d][l]
  51630. , u = r[d][l];
  51631. F(c, c.type, h, u)
  51632. }
  51633. else if ("iv1" === t)
  51634. Ge.uniform1iv(i, r);
  51635. else if ("iv" === t)
  51636. Ge.uniform3iv(i, r);
  51637. else if ("fv1" === t)
  51638. Ge.uniform1fv(i, r);
  51639. else if ("fv" === t)
  51640. Ge.uniform3fv(i, r);
  51641. else if ("v2v" === t) {
  51642. void 0 === e._array && (e._array = new Float32Array(2 * r.length));
  51643. for (var d = 0, f = 0, g = r.length; d < g; d++,
  51644. f += 2)
  51645. e._array[f + 0] = r[d].x,
  51646. e._array[f + 1] = r[d].y;
  51647. Ge.uniform2fv(i, e._array)
  51648. } else if ("v3v" === t) {
  51649. void 0 === e._array && (e._array = new Float32Array(3 * r.length));
  51650. for (var d = 0, m = 0, g = r.length; d < g; d++,
  51651. m += 3)
  51652. e._array[m + 0] = r[d].x,
  51653. e._array[m + 1] = r[d].y,
  51654. e._array[m + 2] = r[d].z;
  51655. Ge.uniform3fv(i, e._array)
  51656. } else if ("v4v" === t) {
  51657. void 0 === e._array && (e._array = new Float32Array(4 * r.length));
  51658. for (var d = 0, v = 0, g = r.length; d < g; d++,
  51659. v += 4)
  51660. e._array[v + 0] = r[d].x,
  51661. e._array[v + 1] = r[d].y,
  51662. e._array[v + 2] = r[d].z,
  51663. e._array[v + 3] = r[d].w;
  51664. Ge.uniform4fv(i, e._array)
  51665. } else if ("m2" === t)
  51666. Ge.uniformMatrix2fv(i, !1, r.elements);
  51667. else if ("m3" === t)
  51668. Ge.uniformMatrix3fv(i, !1, r.elements);
  51669. else if ("m3v" === t) {
  51670. void 0 === e._array && (e._array = new Float32Array(9 * r.length));
  51671. for (var d = 0, g = r.length; d < g; d++)
  51672. r[d].flattenToArrayOffset(e._array, 9 * d);
  51673. Ge.uniformMatrix3fv(i, !1, e._array)
  51674. } else if ("m4" === t)
  51675. Ge.uniformMatrix4fv(i, !1, r.elements);
  51676. else if ("m4v" === t) {
  51677. void 0 === e._array && (e._array = new Float32Array(16 * r.length));
  51678. for (var d = 0, g = r.length; d < g; d++)
  51679. r[d].flattenToArrayOffset(e._array, 16 * d);
  51680. Ge.uniformMatrix4fv(i, !1, e._array)
  51681. } else if ("t" === t) {
  51682. if (o = r,
  51683. a = B(),
  51684. Ge.uniform1i(i, a),
  51685. !o)
  51686. return;
  51687. o instanceof n.CubeTexture || Array.isArray(o.image) && 6 === o.image.length ? Y(o, a) : o instanceof n.WebGLRenderTargetCube ? X(o.texture, a) : o instanceof n.WebGLRenderTarget ? ve.setTexture(o.texture, a) : ve.setTexture(o, a)
  51688. } else if ("tv" === t) {
  51689. void 0 === e._array && (e._array = []);
  51690. for (var d = 0, g = e.value.length; d < g; d++)
  51691. e._array[d] = B();
  51692. Ge.uniform1iv(i, e._array);
  51693. for (var d = 0, g = e.value.length; d < g; d++)
  51694. o = e.value[d],
  51695. a = e._array[d],
  51696. o && (o instanceof n.CubeTexture || o.image instanceof Array && 6 === o.image.length ? Y(o, a) : o instanceof n.WebGLRenderTarget ? ve.setTexture(o.texture, a) : o instanceof n.WebGLRenderTargetCube ? X(o.texture, a) : ve.setTexture(o, a))
  51697. } else
  51698. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  51699. }
  51700. function V(e) {
  51701. for (var t = 0, i = e.length; t < i; t++) {
  51702. var n = e[t][0];
  51703. if (n.needsUpdate !== !1) {
  51704. var r = n.type
  51705. , o = e[t][1]
  51706. , a = n.value;
  51707. F(n, r, o, a)
  51708. }
  51709. }
  51710. }
  51711. function U(e, t) {
  51712. var i, r, o, a, s, l, c = 0, h = 0, u = 0, d = t.matrixWorldInverse, p = 0, f = 0, g = 0, m = 0, v = 0;
  51713. for (Ue.shadowsPointLight = 0,
  51714. i = 0,
  51715. r = e.length; i < r; i++)
  51716. if (o = e[i],
  51717. a = o.color,
  51718. s = o.intensity,
  51719. l = o.distance,
  51720. o instanceof n.AmbientLight)
  51721. c += a.r * s,
  51722. h += a.g * s,
  51723. u += a.b * s;
  51724. else if (o instanceof n.DirectionalLight) {
  51725. var A = Ke.get(o);
  51726. A.color.copy(o.color).multiplyScalar(o.intensity),
  51727. A.direction.setFromMatrixPosition(o.matrixWorld),
  51728. Ve.setFromMatrixPosition(o.target.matrixWorld),
  51729. A.direction.sub(Ve),
  51730. A.direction.transformDirection(d),
  51731. A.shadow = o.castShadow,
  51732. o.castShadow && (A.shadowBias = o.shadow.bias,
  51733. A.shadowRadius = o.shadow.radius,
  51734. A.shadowMapSize = o.shadow.mapSize,
  51735. Ue.shadows[v++] = o),
  51736. Ue.directionalShadowMap[p] = o.shadow.map,
  51737. Ue.directionalShadowMatrix[p] = o.shadow.matrix,
  51738. Ue.directional[p++] = A
  51739. } else if (o instanceof n.SpotLight) {
  51740. var A = Ke.get(o);
  51741. A.position.setFromMatrixPosition(o.matrixWorld),
  51742. A.position.applyMatrix4(d),
  51743. A.color.copy(a).multiplyScalar(s),
  51744. A.distance = l,
  51745. A.direction.setFromMatrixPosition(o.matrixWorld),
  51746. Ve.setFromMatrixPosition(o.target.matrixWorld),
  51747. A.direction.sub(Ve),
  51748. A.direction.transformDirection(d),
  51749. A.coneCos = Math.cos(o.angle),
  51750. A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra)),
  51751. A.decay = 0 === o.distance ? 0 : o.decay,
  51752. A.shadow = o.castShadow,
  51753. o.castShadow && (A.shadowBias = o.shadow.bias,
  51754. A.shadowRadius = o.shadow.radius,
  51755. A.shadowMapSize = o.shadow.mapSize,
  51756. Ue.shadows[v++] = o),
  51757. Ue.spotShadowMap[g] = o.shadow.map,
  51758. Ue.spotShadowMatrix[g] = o.shadow.matrix,
  51759. Ue.spot[g++] = A
  51760. } else if (o instanceof n.PointLight) {
  51761. var A = Ke.get(o);
  51762. A.position.setFromMatrixPosition(o.matrixWorld),
  51763. A.position.applyMatrix4(d),
  51764. A.color.copy(o.color).multiplyScalar(o.intensity),
  51765. A.distance = o.distance,
  51766. A.decay = 0 === o.distance ? 0 : o.decay,
  51767. A.shadow = o.castShadow,
  51768. o.castShadow && (A.shadowBias = o.shadow.bias,
  51769. A.shadowRadius = o.shadow.radius,
  51770. A.shadowMapSize = o.shadow.mapSize,
  51771. Ue.shadows[v++] = o),
  51772. Ue.pointShadowMap[f] = o.shadow.map,
  51773. void 0 === Ue.pointShadowMatrix[f] && (Ue.pointShadowMatrix[f] = new n.Matrix4),
  51774. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  51775. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  51776. Ue.point[f++] = A
  51777. } else if (o instanceof n.HemisphereLight) {
  51778. var A = Ke.get(o);
  51779. A.direction.setFromMatrixPosition(o.matrixWorld),
  51780. A.direction.transformDirection(d),
  51781. A.direction.normalize(),
  51782. A.skyColor.copy(o.color).multiplyScalar(s),
  51783. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  51784. Ue.hemi[m++] = A
  51785. }
  51786. Ue.ambient[0] = c,
  51787. Ue.ambient[1] = h,
  51788. Ue.ambient[2] = u,
  51789. Ue.directional.length = p,
  51790. Ue.spot.length = g,
  51791. Ue.point.length = f,
  51792. Ue.hemi.length = m,
  51793. Ue.shadows.length = v,
  51794. Ue.hash = p + "," + f + "," + g + "," + m + "," + v
  51795. }
  51796. function k(e, t, i) {
  51797. var r;
  51798. if (i ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  51799. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  51800. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  51801. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter))) : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  51802. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  51803. t.wrapS === n.ClampToEdgeWrapping && t.wrapT === n.ClampToEdgeWrapping || console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.", t),
  51804. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  51805. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  51806. t.minFilter !== n.NearestFilter && t.minFilter !== n.LinearFilter && console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.", t)),
  51807. r = We.get("EXT_texture_filter_anisotropic")) {
  51808. if (t.type === n.FloatType && null === We.get("OES_texture_float_linear"))
  51809. return;
  51810. if (t.type === n.HalfFloatType && null === We.get("OES_texture_half_float_linear"))
  51811. return;
  51812. (t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) && (Ge.texParameterf(e, r.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, ve.getMaxAnisotropy())),
  51813. Xe.get(t).__currentAnisotropy = t.anisotropy)
  51814. }
  51815. }
  51816. function H(e, t, i) {
  51817. void 0 === e.__webglInit && (e.__webglInit = !0,
  51818. t.addEventListener("dispose", s),
  51819. e.__webglTexture = Ge.createTexture(),
  51820. ke.textures++),
  51821. Ye.activeTexture(Ge.TEXTURE0 + i),
  51822. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  51823. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  51824. Ge.pixelStorei(Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  51825. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment);
  51826. var r = G(t.image, je.maxTextureSize);
  51827. W(t) && z(r) === !1 && (r = j(r));
  51828. var o = z(r)
  51829. , a = ee(t.format)
  51830. , l = ee(t.type);
  51831. k(Ge.TEXTURE_2D, t, o);
  51832. var c, h = t.mipmaps;
  51833. if (t instanceof n.DataTexture)
  51834. if (h.length > 0 && o) {
  51835. for (var u = 0, d = h.length; u < d; u++)
  51836. c = h[u],
  51837. Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  51838. t.generateMipmaps = !1
  51839. } else
  51840. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, r.width, r.height, 0, a, l, r.data);
  51841. else if (t instanceof n.CompressedTexture)
  51842. for (var u = 0, d = h.length; u < d; u++)
  51843. c = h[u],
  51844. t.format !== n.RGBAFormat && t.format !== n.RGBFormat ? Ye.getCompressedTextureFormats().indexOf(a) > -1 ? Ye.compressedTexImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, c.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  51845. else if (h.length > 0 && o) {
  51846. for (var u = 0, d = h.length; u < d; u++)
  51847. c = h[u],
  51848. Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c);
  51849. t.generateMipmaps = !1
  51850. } else
  51851. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r);
  51852. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  51853. e.__version = t.version,
  51854. t.onUpdate && t.onUpdate(t)
  51855. }
  51856. function G(e, t) {
  51857. if (e.width > t || e.height > t) {
  51858. var i = t / Math.max(e.width, e.height)
  51859. , n = document.createElement("canvas");
  51860. n.width = Math.floor(e.width * i),
  51861. n.height = Math.floor(e.height * i);
  51862. var r = n.getContext("2d");
  51863. return r.drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  51864. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  51865. n
  51866. }
  51867. return e
  51868. }
  51869. function z(e) {
  51870. return n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  51871. }
  51872. function W(e) {
  51873. return e.wrapS !== n.ClampToEdgeWrapping || e.wrapT !== n.ClampToEdgeWrapping || e.minFilter !== n.NearestFilter && e.minFilter !== n.LinearFilter
  51874. }
  51875. function j(e) {
  51876. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  51877. var t = document.createElement("canvas");
  51878. t.width = n.Math.nearestPowerOfTwo(e.width),
  51879. t.height = n.Math.nearestPowerOfTwo(e.height);
  51880. var i = t.getContext("2d");
  51881. return i.drawImage(e, 0, 0, t.width, t.height),
  51882. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  51883. t
  51884. }
  51885. return e
  51886. }
  51887. function Y(e, t) {
  51888. var i = Xe.get(e);
  51889. if (6 === e.image.length)
  51890. if (e.version > 0 && i.__version !== e.version) {
  51891. i.__image__webglTextureCube || (e.addEventListener("dispose", s),
  51892. i.__image__webglTextureCube = Ge.createTexture(),
  51893. ke.textures++),
  51894. Ye.activeTexture(Ge.TEXTURE0 + t),
  51895. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  51896. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY);
  51897. for (var r = e instanceof n.CompressedTexture, o = e.image[0]instanceof n.DataTexture, a = [], l = 0; l < 6; l++)
  51898. !ve.autoScaleCubemaps || r || o ? a[l] = o ? e.image[l].image : e.image[l] : a[l] = G(e.image[l], je.maxCubemapSize);
  51899. var c = a[0]
  51900. , h = z(c)
  51901. , u = ee(e.format)
  51902. , d = ee(e.type);
  51903. k(Ge.TEXTURE_CUBE_MAP, e, h);
  51904. for (var l = 0; l < 6; l++)
  51905. if (r)
  51906. for (var p, f = a[l].mipmaps, g = 0, m = f.length; g < m; g++)
  51907. p = f[g],
  51908. e.format !== n.RGBAFormat && e.format !== n.RGBFormat ? Ye.getCompressedTextureFormats().indexOf(u) > -1 ? Ye.compressedTexImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, g, u, p.width, p.height, 0, p.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()") : Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, g, u, p.width, p.height, 0, u, d, p.data);
  51909. else
  51910. o ? Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, 0, u, a[l].width, a[l].height, 0, u, d, a[l].data) : Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, 0, u, u, d, a[l]);
  51911. e.generateMipmaps && h && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  51912. i.__version = e.version,
  51913. e.onUpdate && e.onUpdate(e)
  51914. } else
  51915. Ye.activeTexture(Ge.TEXTURE0 + t),
  51916. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  51917. }
  51918. function X(e, t) {
  51919. Ye.activeTexture(Ge.TEXTURE0 + t),
  51920. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture)
  51921. }
  51922. function Z(e, t, i, n) {
  51923. var r = ee(t.texture.format)
  51924. , o = ee(t.texture.type);
  51925. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  51926. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  51927. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, i, n, Xe.get(t.texture).__webglTexture, 0),
  51928. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  51929. }
  51930. function q(e, t) {
  51931. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  51932. t.depthBuffer && !t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_COMPONENT16, t.width, t.height),
  51933. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_ATTACHMENT, Ge.RENDERBUFFER, e)) : t.depthBuffer && t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_STENCIL, t.width, t.height),
  51934. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_STENCIL_ATTACHMENT, Ge.RENDERBUFFER, e)) : Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.RGBA4, t.width, t.height),
  51935. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null)
  51936. }
  51937. function K(e) {
  51938. var t = Xe.get(e)
  51939. , i = e instanceof n.WebGLRenderTargetCube;
  51940. if (i) {
  51941. t.__webglDepthbuffer = [];
  51942. for (var r = 0; r < 6; r++)
  51943. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]),
  51944. t.__webglDepthbuffer[r] = Ge.createRenderbuffer(),
  51945. q(t.__webglDepthbuffer[r], e)
  51946. } else
  51947. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer),
  51948. t.__webglDepthbuffer = Ge.createRenderbuffer(),
  51949. q(t.__webglDepthbuffer, e);
  51950. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  51951. }
  51952. function Q(e) {
  51953. var t = Xe.get(e)
  51954. , i = Xe.get(e.texture);
  51955. e.addEventListener("dispose", l),
  51956. i.__webglTexture = Ge.createTexture(),
  51957. ke.textures++;
  51958. var r = e instanceof n.WebGLRenderTargetCube
  51959. , o = n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height);
  51960. if (r) {
  51961. t.__webglFramebuffer = [];
  51962. for (var a = 0; a < 6; a++)
  51963. t.__webglFramebuffer[a] = Ge.createFramebuffer()
  51964. } else
  51965. t.__webglFramebuffer = Ge.createFramebuffer();
  51966. if (r) {
  51967. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture),
  51968. k(Ge.TEXTURE_CUBE_MAP, e.texture, o);
  51969. for (var a = 0; a < 6; a++)
  51970. Z(t.__webglFramebuffer[a], e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a);
  51971. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  51972. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null)
  51973. } else
  51974. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  51975. k(Ge.TEXTURE_2D, e.texture, o),
  51976. Z(t.__webglFramebuffer, e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_2D),
  51977. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  51978. Ye.bindTexture(Ge.TEXTURE_2D, null);
  51979. e.depthBuffer && K(e)
  51980. }
  51981. function J(e) {
  51982. var t = e instanceof n.WebGLRenderTargetCube ? Ge.TEXTURE_CUBE_MAP : Ge.TEXTURE_2D
  51983. , i = Xe.get(e.texture).__webglTexture;
  51984. Ye.bindTexture(t, i),
  51985. Ge.generateMipmap(t),
  51986. Ye.bindTexture(t, null)
  51987. }
  51988. function $(e) {
  51989. return e === n.NearestFilter || e === n.NearestMipMapNearestFilter || e === n.NearestMipMapLinearFilter ? Ge.NEAREST : Ge.LINEAR
  51990. }
  51991. function ee(e) {
  51992. var t;
  51993. if (e === n.RepeatWrapping)
  51994. return Ge.REPEAT;
  51995. if (e === n.ClampToEdgeWrapping)
  51996. return Ge.CLAMP_TO_EDGE;
  51997. if (e === n.MirroredRepeatWrapping)
  51998. return Ge.MIRRORED_REPEAT;
  51999. if (e === n.NearestFilter)
  52000. return Ge.NEAREST;
  52001. if (e === n.NearestMipMapNearestFilter)
  52002. return Ge.NEAREST_MIPMAP_NEAREST;
  52003. if (e === n.NearestMipMapLinearFilter)
  52004. return Ge.NEAREST_MIPMAP_LINEAR;
  52005. if (e === n.LinearFilter)
  52006. return Ge.LINEAR;
  52007. if (e === n.LinearMipMapNearestFilter)
  52008. return Ge.LINEAR_MIPMAP_NEAREST;
  52009. if (e === n.LinearMipMapLinearFilter)
  52010. return Ge.LINEAR_MIPMAP_LINEAR;
  52011. if (e === n.UnsignedByteType)
  52012. return Ge.UNSIGNED_BYTE;
  52013. if (e === n.UnsignedShort4444Type)
  52014. return Ge.UNSIGNED_SHORT_4_4_4_4;
  52015. if (e === n.UnsignedShort5551Type)
  52016. return Ge.UNSIGNED_SHORT_5_5_5_1;
  52017. if (e === n.UnsignedShort565Type)
  52018. return Ge.UNSIGNED_SHORT_5_6_5;
  52019. if (e === n.ByteType)
  52020. return Ge.BYTE;
  52021. if (e === n.ShortType)
  52022. return Ge.SHORT;
  52023. if (e === n.UnsignedShortType)
  52024. return Ge.UNSIGNED_SHORT;
  52025. if (e === n.IntType)
  52026. return Ge.INT;
  52027. if (e === n.UnsignedIntType)
  52028. return Ge.UNSIGNED_INT;
  52029. if (e === n.FloatType)
  52030. return Ge.FLOAT;
  52031. if (t = We.get("OES_texture_half_float"),
  52032. null !== t && e === n.HalfFloatType)
  52033. return t.HALF_FLOAT_OES;
  52034. if (e === n.AlphaFormat)
  52035. return Ge.ALPHA;
  52036. if (e === n.RGBFormat)
  52037. return Ge.RGB;
  52038. if (e === n.RGBAFormat)
  52039. return Ge.RGBA;
  52040. if (e === n.LuminanceFormat)
  52041. return Ge.LUMINANCE;
  52042. if (e === n.LuminanceAlphaFormat)
  52043. return Ge.LUMINANCE_ALPHA;
  52044. if (e === n.AddEquation)
  52045. return Ge.FUNC_ADD;
  52046. if (e === n.SubtractEquation)
  52047. return Ge.FUNC_SUBTRACT;
  52048. if (e === n.ReverseSubtractEquation)
  52049. return Ge.FUNC_REVERSE_SUBTRACT;
  52050. if (e === n.ZeroFactor)
  52051. return Ge.ZERO;
  52052. if (e === n.OneFactor)
  52053. return Ge.ONE;
  52054. if (e === n.SrcColorFactor)
  52055. return Ge.SRC_COLOR;
  52056. if (e === n.OneMinusSrcColorFactor)
  52057. return Ge.ONE_MINUS_SRC_COLOR;
  52058. if (e === n.SrcAlphaFactor)
  52059. return Ge.SRC_ALPHA;
  52060. if (e === n.OneMinusSrcAlphaFactor)
  52061. return Ge.ONE_MINUS_SRC_ALPHA;
  52062. if (e === n.DstAlphaFactor)
  52063. return Ge.DST_ALPHA;
  52064. if (e === n.OneMinusDstAlphaFactor)
  52065. return Ge.ONE_MINUS_DST_ALPHA;
  52066. if (e === n.DstColorFactor)
  52067. return Ge.DST_COLOR;
  52068. if (e === n.OneMinusDstColorFactor)
  52069. return Ge.ONE_MINUS_DST_COLOR;
  52070. if (e === n.SrcAlphaSaturateFactor)
  52071. return Ge.SRC_ALPHA_SATURATE;
  52072. if (t = We.get("WEBGL_compressed_texture_s3tc"),
  52073. null !== t) {
  52074. if (e === n.RGB_S3TC_DXT1_Format)
  52075. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  52076. if (e === n.RGBA_S3TC_DXT1_Format)
  52077. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  52078. if (e === n.RGBA_S3TC_DXT3_Format)
  52079. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  52080. if (e === n.RGBA_S3TC_DXT5_Format)
  52081. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  52082. }
  52083. if (t = We.get("WEBGL_compressed_texture_pvrtc"),
  52084. null !== t) {
  52085. if (e === n.RGB_PVRTC_4BPPV1_Format)
  52086. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  52087. if (e === n.RGB_PVRTC_2BPPV1_Format)
  52088. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  52089. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  52090. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  52091. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  52092. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  52093. }
  52094. if (t = We.get("WEBGL_compressed_texture_etc1"),
  52095. null !== t && e === n.RGB_ETC1_Format)
  52096. return t.COMPRESSED_RGB_ETC1_WEBGL;
  52097. if (t = We.get("EXT_blend_minmax"),
  52098. null !== t) {
  52099. if (e === n.MinEquation)
  52100. return t.MIN_EXT;
  52101. if (e === n.MaxEquation)
  52102. return t.MAX_EXT
  52103. }
  52104. return 0
  52105. }
  52106. console.log("THREE.WebGLRenderer", n.REVISION),
  52107. e = e || {};
  52108. var te = void 0 !== e.canvas ? e.canvas : document.createElement("canvas")
  52109. , ie = void 0 !== e.context ? e.context : null
  52110. , ne = void 0 !== e.alpha && e.alpha
  52111. , re = void 0 === e.depth || e.depth
  52112. , oe = void 0 === e.stencil || e.stencil
  52113. , ae = void 0 !== e.antialias && e.antialias
  52114. , se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  52115. , le = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  52116. , ce = []
  52117. , he = []
  52118. , ue = -1
  52119. , de = []
  52120. , pe = -1
  52121. , fe = new Float32Array(8)
  52122. , ge = []
  52123. , me = [];
  52124. this.domElement = te,
  52125. this.context = null,
  52126. this.autoClear = !0,
  52127. this.autoClearColor = !0,
  52128. this.autoClearDepth = !0,
  52129. this.autoClearStencil = !0,
  52130. this.sortObjects = !0,
  52131. this.gammaFactor = 2,
  52132. this.gammaInput = !1,
  52133. this.gammaOutput = !1,
  52134. this.physicallyCorrectLights = !1,
  52135. this.toneMapping = n.LinearToneMapping,
  52136. this.toneMappingExposure = 1,
  52137. this.toneMappingWhitePoint = 1,
  52138. this.maxMorphTargets = 8,
  52139. this.maxMorphNormals = 4,
  52140. this.autoScaleCubemaps = !0;
  52141. var ve = this
  52142. , Ae = null
  52143. , ye = null
  52144. , Ce = null
  52145. , Ie = -1
  52146. , Ee = ""
  52147. , be = null
  52148. , we = new n.Vector4
  52149. , _e = null
  52150. , Te = new n.Vector4
  52151. , xe = 0
  52152. , Se = new n.Color(0)
  52153. , Me = 0
  52154. , Re = te.width
  52155. , Pe = te.height
  52156. , Oe = 1
  52157. , Le = new n.Vector4(0,0,Re,Pe)
  52158. , De = !1
  52159. , Ne = new n.Vector4(0,0,Re,Pe)
  52160. , Be = new n.Frustum
  52161. , Fe = new n.Matrix4
  52162. , Ve = new n.Vector3
  52163. , Ue = {
  52164. hash: "",
  52165. ambient: [0, 0, 0],
  52166. directional: [],
  52167. directionalShadowMap: [],
  52168. directionalShadowMatrix: [],
  52169. spot: [],
  52170. spotShadowMap: [],
  52171. spotShadowMatrix: [],
  52172. point: [],
  52173. pointShadowMap: [],
  52174. pointShadowMatrix: [],
  52175. hemi: [],
  52176. shadows: [],
  52177. shadowsPointLight: 0
  52178. }
  52179. , ke = {
  52180. geometries: 0,
  52181. textures: 0
  52182. }
  52183. , He = {
  52184. calls: 0,
  52185. vertices: 0,
  52186. faces: 0,
  52187. points: 0
  52188. };
  52189. this.info = {
  52190. render: He,
  52191. memory: ke,
  52192. programs: null
  52193. };
  52194. var Ge;
  52195. try {
  52196. var ze = {
  52197. alpha: ne,
  52198. depth: re,
  52199. stencil: oe,
  52200. antialias: ae,
  52201. premultipliedAlpha: se,
  52202. preserveDrawingBuffer: le
  52203. };
  52204. if (Ge = ie || te.getContext("webgl", ze) || te.getContext("experimental-webgl", ze),
  52205. null === Ge)
  52206. throw null !== te.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  52207. void 0 === Ge.getShaderPrecisionFormat && (Ge.getShaderPrecisionFormat = function() {
  52208. return {
  52209. rangeMin: 1,
  52210. rangeMax: 1,
  52211. precision: 1
  52212. }
  52213. }
  52214. ),
  52215. te.addEventListener("webglcontextlost", a, !1)
  52216. } catch (e) {
  52217. console.error("THREE.WebGLRenderer: " + e)
  52218. }
  52219. var We = new n.WebGLExtensions(Ge);
  52220. We.get("OES_texture_float"),
  52221. We.get("OES_texture_float_linear"),
  52222. We.get("OES_texture_half_float"),
  52223. We.get("OES_texture_half_float_linear"),
  52224. We.get("OES_standard_derivatives"),
  52225. We.get("ANGLE_instanced_arrays"),
  52226. We.get("OES_element_index_uint") && (n.BufferGeometry.MaxIndex = 4294967296);
  52227. var je = new n.WebGLCapabilities(Ge,We,e)
  52228. , Ye = new n.WebGLState(Ge,We,ee)
  52229. , Xe = new n.WebGLProperties
  52230. , Ze = new n.WebGLObjects(Ge,Xe,this.info)
  52231. , qe = new n.WebGLPrograms(this,je)
  52232. , Ke = new n.WebGLLights;
  52233. this.info.programs = qe.programs;
  52234. var Qe = new n.WebGLBufferRenderer(Ge,We,He)
  52235. , Je = new n.WebGLIndexedBufferRenderer(Ge,We,He);
  52236. r(),
  52237. this.context = Ge,
  52238. this.capabilities = je,
  52239. this.extensions = We,
  52240. this.properties = Xe,
  52241. this.state = Ye;
  52242. var $e = new n.WebGLShadowMap(this,Ue,Ze);
  52243. this.shadowMap = $e;
  52244. var et = new n.SpritePlugin(this,ge)
  52245. , tt = new n.LensFlarePlugin(this,me);
  52246. this.getContext = function() {
  52247. return Ge
  52248. }
  52249. ,
  52250. this.getContextAttributes = function() {
  52251. return Ge.getContextAttributes()
  52252. }
  52253. ,
  52254. this.forceContextLoss = function() {
  52255. We.get("WEBGL_lose_context").loseContext()
  52256. }
  52257. ,
  52258. this.getMaxAnisotropy = function() {
  52259. var e;
  52260. return function() {
  52261. if (void 0 !== e)
  52262. return e;
  52263. var t = We.get("EXT_texture_filter_anisotropic");
  52264. return e = null !== t ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  52265. }
  52266. }(),
  52267. this.getPrecision = function() {
  52268. return je.precision
  52269. }
  52270. ,
  52271. this.getPixelRatio = function() {
  52272. return Oe
  52273. }
  52274. ,
  52275. this.setPixelRatio = function(e) {
  52276. void 0 !== e && (Oe = e,
  52277. this.setSize(Ne.z, Ne.w, !1))
  52278. }
  52279. ,
  52280. this.getSize = function() {
  52281. return {
  52282. width: Re,
  52283. height: Pe
  52284. }
  52285. }
  52286. ,
  52287. this.setSize = function(e, t, i, devicePixelRatio) {
  52288. if(devicePixelRatio != void 0) Oe = devicePixelRatio; //xzw add 改分辨率 始终保持清晰
  52289. Re = e,
  52290. Pe = t,
  52291. te.width = e * Oe,
  52292. te.height = t * Oe,
  52293. i !== !1 && (te.style.width = e + "px",
  52294. te.style.height = t + "px"),
  52295. this.setViewport(0, 0, e, t)
  52296. }
  52297. ,
  52298. this.setViewport = function(e, t, i, n) {
  52299. Ye.viewport(Ne.set(e, t, i, n))
  52300. }
  52301. ,
  52302. this.setScissor = function(e, t, i, n) {
  52303. Ye.scissor(Le.set(e, t, i, n))
  52304. }
  52305. ,
  52306. this.setScissorTest = function(e) {
  52307. Ye.setScissorTest(De = e)
  52308. }
  52309. ,
  52310. this.getClearColor = function() {
  52311. return Se
  52312. }
  52313. ,
  52314. this.setClearColor = function(e, t) {
  52315. Se.set(e),
  52316. Me = void 0 !== t ? t : 1,
  52317. i(Se.r, Se.g, Se.b, Me)
  52318. }
  52319. ,
  52320. this.getClearAlpha = function() {
  52321. return Me
  52322. }
  52323. ,
  52324. this.setClearAlpha = function(e) {
  52325. Me = e,
  52326. i(Se.r, Se.g, Se.b, Me)
  52327. }
  52328. ,
  52329. this.clear = function(e, t, i) {
  52330. var n = 0;
  52331. (void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT),
  52332. (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT),
  52333. (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT),
  52334. Ge.clear(n)
  52335. }
  52336. ,
  52337. this.clearColor = function() {
  52338. this.clear(!0, !1, !1)
  52339. }
  52340. ,
  52341. this.clearDepth = function() {
  52342. this.clear(!1, !0, !1)
  52343. }
  52344. ,
  52345. this.clearStencil = function() {
  52346. this.clear(!1, !1, !0)
  52347. }
  52348. ,
  52349. this.clearTarget = function(e, t, i, n) {
  52350. this.setRenderTarget(e),
  52351. this.clear(t, i, n)
  52352. }
  52353. ,
  52354. this.resetGLState = o,
  52355. this.dispose = function() {
  52356. te.removeEventListener("webglcontextlost", a, !1)
  52357. }
  52358. ,
  52359. this.renderBufferImmediate = function(e, t, i) {
  52360. Ye.initAttributes();
  52361. var r = Xe.get(e);
  52362. e.hasPositions && !r.position && (r.position = Ge.createBuffer()),
  52363. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  52364. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  52365. e.hasColors && !r.color && (r.color = Ge.createBuffer());
  52366. var o = t.getAttributes();
  52367. if (e.hasPositions && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  52368. Ge.bufferData(Ge.ARRAY_BUFFER, e.positionArray, Ge.DYNAMIC_DRAW),
  52369. Ye.enableAttribute(o.position),
  52370. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  52371. e.hasNormals) {
  52372. if (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal),
  52373. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === n.FlatShading)
  52374. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  52375. var l = e.normalArray
  52376. , c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3
  52377. , h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3
  52378. , u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3;
  52379. l[a + 0] = c,
  52380. l[a + 1] = h,
  52381. l[a + 2] = u,
  52382. l[a + 3] = c,
  52383. l[a + 4] = h,
  52384. l[a + 5] = u,
  52385. l[a + 6] = c,
  52386. l[a + 7] = h,
  52387. l[a + 8] = u
  52388. }
  52389. Ge.bufferData(Ge.ARRAY_BUFFER, e.normalArray, Ge.DYNAMIC_DRAW),
  52390. Ye.enableAttribute(o.normal),
  52391. Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0)
  52392. }
  52393. e.hasUvs && i.map && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv),
  52394. Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW),
  52395. Ye.enableAttribute(o.uv),
  52396. Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  52397. e.hasColors && i.vertexColors !== n.NoColors && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  52398. Ge.bufferData(Ge.ARRAY_BUFFER, e.colorArray, Ge.DYNAMIC_DRAW),
  52399. Ye.enableAttribute(o.color),
  52400. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  52401. Ye.disableUnusedAttributes(),
  52402. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  52403. e.count = 0
  52404. }
  52405. ,
  52406. this.renderBufferDirect = function(e, i, r, o, a, s) {
  52407. E(o);
  52408. var l = w(e, i, o, a)
  52409. , c = !1
  52410. , h = r.id + "_" + l.id + "_" + o.wireframe;
  52411. h !== Ee && (Ee = h,
  52412. c = !0);
  52413. var u = a.morphTargetInfluences;
  52414. if (void 0 !== u) {
  52415. for (var d = [], p = 0, m = u.length; p < m; p++) {
  52416. var v = u[p];
  52417. d.push([v, p])
  52418. }
  52419. d.sort(g),
  52420. d.length > 8 && (d.length = 8);
  52421. for (var A = r.morphAttributes, p = 0, m = d.length; p < m; p++) {
  52422. var v = d[p];
  52423. if (fe[p] = v[0],
  52424. 0 !== v[0]) {
  52425. var y = v[1];
  52426. o.morphTargets === !0 && A.position && r.addAttribute("morphTarget" + p, A.position[y]),
  52427. o.morphNormals === !0 && A.normal && r.addAttribute("morphNormal" + p, A.normal[y])
  52428. } else
  52429. o.morphTargets === !0 && r.removeAttribute("morphTarget" + p),
  52430. o.morphNormals === !0 && r.removeAttribute("morphNormal" + p)
  52431. }
  52432. var C = l.getUniforms();
  52433. null !== C.morphTargetInfluences && Ge.uniform1fv(C.morphTargetInfluences, fe),
  52434. c = !0
  52435. }
  52436. var y = r.index
  52437. , I = r.attributes.position;
  52438. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r));
  52439. var b;
  52440. null !== y ? (b = Je,
  52441. b.setIndex(y)) : b = Qe,
  52442. c && (f(o, l, r),
  52443. null !== y && Ge.bindBuffer(Ge.ELEMENT_ARRAY_BUFFER, Ze.getAttributeBuffer(y)));
  52444. var _ = 0
  52445. , T = 1 / 0;
  52446. null !== y ? T = y.count : void 0 !== I && (T = I.count);
  52447. var x = r.drawRange.start
  52448. , S = r.drawRange.count
  52449. , M = null !== s ? s.start : 0
  52450. , R = null !== s ? s.count : 1 / 0
  52451. , P = Math.max(_, x, M)
  52452. , O = Math.min(_ + T, x + S, M + R) - 1
  52453. , L = Math.max(0, O - P + 1);
  52454. if (a instanceof n.Mesh)
  52455. if (o.wireframe === !0)
  52456. Ye.setLineWidth(o.wireframeLinewidth * t()),
  52457. b.setMode(Ge.LINES);
  52458. else
  52459. switch (a.drawMode) {
  52460. case n.TrianglesDrawMode:
  52461. b.setMode(Ge.TRIANGLES);
  52462. break;
  52463. case n.TriangleStripDrawMode:
  52464. b.setMode(Ge.TRIANGLE_STRIP);
  52465. break;
  52466. case n.TriangleFanDrawMode:
  52467. b.setMode(Ge.TRIANGLE_FAN)
  52468. }
  52469. else if (a instanceof n.Line) {
  52470. var D = o.linewidth;
  52471. void 0 === D && (D = 1),
  52472. Ye.setLineWidth(D * t()),
  52473. a instanceof n.LineSegments ? b.setMode(Ge.LINES) : b.setMode(Ge.LINE_STRIP)
  52474. } else
  52475. a instanceof n.Points && b.setMode(Ge.POINTS);
  52476. r instanceof n.InstancedBufferGeometry ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L) : b.render(P, L)
  52477. }
  52478. ,
  52479. this.render = function(e, t, i, r) {
  52480. if (t instanceof n.Camera == !1)
  52481. return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
  52482. var o = e.fog;
  52483. if (Ee = "",
  52484. Ie = -1,
  52485. be = null,
  52486. e.autoUpdate === !0 && e.updateMatrixWorld(),
  52487. null === t.parent && t.updateMatrixWorld(),
  52488. t.matrixWorldInverse.getInverse(t.matrixWorld),
  52489. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  52490. Be.setFromMatrix(Fe),
  52491. ce.length = 0,
  52492. ue = -1,
  52493. pe = -1,
  52494. ge.length = 0,
  52495. me.length = 0,
  52496. y(e, t),
  52497. he.length = ue + 1,
  52498. de.length = pe + 1,
  52499. ve.sortObjects === !0 && (he.sort(m),
  52500. de.sort(v)),
  52501. U(ce, t),
  52502. $e.render(e, t),
  52503. He.calls = 0,
  52504. He.vertices = 0,
  52505. He.faces = 0,
  52506. He.points = 0,
  52507. void 0 === i && (i = null),
  52508. this.setRenderTarget(i),
  52509. (this.autoClear || r) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  52510. e.overrideMaterial) {
  52511. var a = e.overrideMaterial;
  52512. C(he, t, o, a),
  52513. C(de, t, o, a)
  52514. } else
  52515. Ye.setBlending(n.NoBlending),
  52516. C(he, t, o),
  52517. C(de, t, o);
  52518. if (et.render(e, t),
  52519. tt.render(e, t, Te),
  52520. i) {
  52521. var s = i.texture;
  52522. s.generateMipmaps && z(i) && s.minFilter !== n.NearestFilter && s.minFilter !== n.LinearFilter && J(i)
  52523. }
  52524. Ye.setDepthTest(!0),
  52525. Ye.setDepthWrite(!0),
  52526. Ye.setColorWrite(!0)
  52527. }
  52528. ,
  52529. this.setFaceCulling = function(e, t) {
  52530. e === n.CullFaceNone ? Ye.disable(Ge.CULL_FACE) : (t === n.FrontFaceDirectionCW ? Ge.frontFace(Ge.CW) : Ge.frontFace(Ge.CCW),
  52531. e === n.CullFaceBack ? Ge.cullFace(Ge.BACK) : e === n.CullFaceFront ? Ge.cullFace(Ge.FRONT) : Ge.cullFace(Ge.FRONT_AND_BACK),
  52532. Ye.enable(Ge.CULL_FACE))
  52533. }
  52534. ,
  52535. this.setTexture = function(e, t) {
  52536. var i = Xe.get(e);
  52537. if (e.version > 0 && i.__version !== e.version) {
  52538. var n = e.image;
  52539. return void 0 === n ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined", e) : n.complete === !1 ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete", e) : void H(i, e, t)
  52540. }
  52541. Ye.activeTexture(Ge.TEXTURE0 + t),
  52542. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture)
  52543. }
  52544. ,
  52545. this.getCurrentRenderTarget = function() {
  52546. return ye
  52547. }
  52548. ,
  52549. this.setRenderTarget = function(e) {
  52550. ye = e,
  52551. e && void 0 === Xe.get(e).__webglFramebuffer && Q(e);
  52552. var t, i = e instanceof n.WebGLRenderTargetCube;
  52553. if (e) {
  52554. var r = Xe.get(e);
  52555. t = i ? r.__webglFramebuffer[e.activeCubeFace] : r.__webglFramebuffer,
  52556. we.copy(e.scissor),
  52557. _e = e.scissorTest,
  52558. Te.copy(e.viewport)
  52559. } else
  52560. t = null,
  52561. we.copy(Le).multiplyScalar(Oe),
  52562. _e = De,
  52563. Te.copy(Ne).multiplyScalar(Oe);
  52564. if (Ce !== t && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t),
  52565. Ce = t),
  52566. Ye.scissor(we),
  52567. Ye.setScissorTest(_e),
  52568. Ye.viewport(Te),
  52569. i) {
  52570. var o = Xe.get(e.texture);
  52571. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, o.__webglTexture, e.activeMipMapLevel)
  52572. }
  52573. }
  52574. ,
  52575. this.readRenderTargetPixels = function(e, t, i, r, o, a) {
  52576. if (e instanceof n.WebGLRenderTarget == !1)
  52577. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
  52578. var s = Xe.get(e).__webglFramebuffer;
  52579. if (s) {
  52580. var l = !1;
  52581. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s),
  52582. l = !0);
  52583. try {
  52584. var c = e.texture;
  52585. if (c.format !== n.RGBAFormat && ee(c.format) !== Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT))
  52586. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  52587. if (!(c.type === n.UnsignedByteType || ee(c.type) === Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_TYPE) || c.type === n.FloatType && We.get("WEBGL_color_buffer_float") || c.type === n.HalfFloatType && We.get("EXT_color_buffer_half_float")))
  52588. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  52589. Ge.checkFramebufferStatus(Ge.FRAMEBUFFER) === Ge.FRAMEBUFFER_COMPLETE ? Ge.readPixels(t, i, r, o, ee(c.format), ee(c.type), a) : console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")
  52590. } finally {
  52591. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce)
  52592. }
  52593. }
  52594. }
  52595. }
  52596. ,
  52597. n.WebGLRenderTarget = function(e, t, i) {
  52598. this.uuid = n.Math.generateUUID(),
  52599. this.width = e,
  52600. this.height = t,
  52601. this.scissor = new n.Vector4(0,0,e,t),
  52602. this.scissorTest = !1,
  52603. this.viewport = new n.Vector4(0,0,e,t),
  52604. i = i || {},
  52605. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  52606. this.texture = new n.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  52607. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  52608. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  52609. }
  52610. ,
  52611. n.WebGLRenderTarget.prototype = {
  52612. constructor: n.WebGLRenderTarget,
  52613. setSize: function(e, t) {
  52614. this.width === e && this.height === t || (this.width = e,
  52615. this.height = t,
  52616. this.dispose()),
  52617. this.viewport.set(0, 0, e, t),
  52618. this.scissor.set(0, 0, e, t)
  52619. },
  52620. clone: function() {
  52621. return (new this.constructor).copy(this)
  52622. },
  52623. copy: function(e) {
  52624. return this.width = e.width,
  52625. this.height = e.height,
  52626. this.viewport.copy(e.viewport),
  52627. this.texture = e.texture.clone(),
  52628. this.depthBuffer = e.depthBuffer,
  52629. this.stencilBuffer = e.stencilBuffer,
  52630. this
  52631. },
  52632. dispose: function() {
  52633. this.dispatchEvent({
  52634. type: "dispose"
  52635. })
  52636. }
  52637. },
  52638. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  52639. n.WebGLRenderTargetCube = function(e, t, i) {
  52640. n.WebGLRenderTarget.call(this, e, t, i),
  52641. this.activeCubeFace = 0,
  52642. this.activeMipMapLevel = 0
  52643. }
  52644. ,
  52645. n.WebGLRenderTargetCube.prototype = Object.create(n.WebGLRenderTarget.prototype),
  52646. n.WebGLRenderTargetCube.prototype.constructor = n.WebGLRenderTargetCube,
  52647. n.WebGLBufferRenderer = function(e, t, i) {
  52648. function r(e) {
  52649. s = e
  52650. }
  52651. function o(t, n) {
  52652. e.drawArrays(s, t, n),
  52653. i.calls++,
  52654. i.vertices += n,
  52655. s === e.TRIANGLES && (i.faces += n / 3)
  52656. }
  52657. function a(r) {
  52658. var o = t.get("ANGLE_instanced_arrays");
  52659. if (null === o)
  52660. return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  52661. var a = r.attributes.position
  52662. , l = 0;
  52663. a instanceof n.InterleavedBufferAttribute ? (l = a.data.count,
  52664. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)) : (l = a.count,
  52665. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  52666. i.calls++,
  52667. i.vertices += l * r.maxInstancedCount,
  52668. s === e.TRIANGLES && (i.faces += r.maxInstancedCount * l / 3)
  52669. }
  52670. var s;
  52671. this.setMode = r,
  52672. this.render = o,
  52673. this.renderInstances = a
  52674. }
  52675. ,
  52676. n.WebGLIndexedBufferRenderer = function(e, t, i) {
  52677. function n(e) {
  52678. s = e
  52679. }
  52680. function r(i) {
  52681. i.array instanceof Uint32Array && t.get("OES_element_index_uint") ? (l = e.UNSIGNED_INT,
  52682. c = 4) : (l = e.UNSIGNED_SHORT,
  52683. c = 2)
  52684. }
  52685. function o(t, n) {
  52686. e.drawElements(s, n, l, t * c),
  52687. i.calls++,
  52688. i.vertices += n,
  52689. s === e.TRIANGLES && (i.faces += n / 3)
  52690. }
  52691. function a(n, r, o) {
  52692. var a = t.get("ANGLE_instanced_arrays");
  52693. return null === a ? void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.") : (a.drawElementsInstancedANGLE(s, o, l, r * c, n.maxInstancedCount),
  52694. i.calls++,
  52695. i.vertices += o * n.maxInstancedCount,
  52696. void (s === e.TRIANGLES && (i.faces += n.maxInstancedCount * o / 3)))
  52697. }
  52698. var s, l, c;
  52699. this.setMode = n,
  52700. this.setIndex = r,
  52701. this.render = o,
  52702. this.renderInstances = a
  52703. }
  52704. ,
  52705. n.WebGLExtensions = function(e) {
  52706. var t = {};
  52707. this.get = function(i) {
  52708. if (void 0 !== t[i])
  52709. return t[i];
  52710. var n;
  52711. switch (i) {
  52712. case "EXT_texture_filter_anisotropic":
  52713. n = e.getExtension("EXT_texture_filter_anisotropic") || e.getExtension("MOZ_EXT_texture_filter_anisotropic") || e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  52714. break;
  52715. case "WEBGL_compressed_texture_s3tc":
  52716. n = e.getExtension("WEBGL_compressed_texture_s3tc") || e.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  52717. break;
  52718. case "WEBGL_compressed_texture_pvrtc":
  52719. n = e.getExtension("WEBGL_compressed_texture_pvrtc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  52720. break;
  52721. case "WEBGL_compressed_texture_etc1":
  52722. n = e.getExtension("WEBGL_compressed_texture_etc1");
  52723. break;
  52724. default:
  52725. n = e.getExtension(i)
  52726. }
  52727. return null === n && console.warn("THREE.WebGLRenderer: " + i + " extension not supported."),
  52728. t[i] = n,
  52729. n
  52730. }
  52731. }
  52732. ,
  52733. n.WebGLCapabilities = function(e, t, i) {
  52734. function n(t) {
  52735. if ("highp" === t) {
  52736. if (e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0)
  52737. return "highp";
  52738. t = "mediump"
  52739. }
  52740. return "mediump" === t && e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.MEDIUM_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.MEDIUM_FLOAT).precision > 0 ? "mediump" : "lowp"
  52741. }
  52742. this.getMaxPrecision = n,
  52743. this.precision = void 0 !== i.precision ? i.precision : "highp",
  52744. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  52745. this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  52746. this.maxVertexTextures = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  52747. this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE),
  52748. this.maxCubemapSize = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),
  52749. this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  52750. this.maxVertexUniforms = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),
  52751. this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS),
  52752. this.maxFragmentUniforms = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),
  52753. this.vertexTextures = this.maxVertexTextures > 0,
  52754. this.floatFragmentTextures = !!t.get("OES_texture_float"),
  52755. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  52756. var r = n(this.precision);
  52757. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  52758. this.precision = r),
  52759. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!t.get("EXT_frag_depth"))
  52760. }
  52761. ,
  52762. n.WebGLGeometries = function(e, t, i) {
  52763. function r(e) {
  52764. var t = e.geometry;
  52765. if (void 0 !== h[t.id])
  52766. return h[t.id];
  52767. t.addEventListener("dispose", o);
  52768. var r;
  52769. return t instanceof n.BufferGeometry ? r = t : t instanceof n.Geometry && (void 0 === t._bufferGeometry && (t._bufferGeometry = (new n.BufferGeometry).setFromObject(e)),
  52770. r = t._bufferGeometry),
  52771. h[t.id] = r,
  52772. i.memory.geometries++,
  52773. r
  52774. }
  52775. function o(e) {
  52776. var n = e.target
  52777. , r = h[n.id];
  52778. null !== r.index && s(r.index),
  52779. l(r.attributes),
  52780. n.removeEventListener("dispose", o),
  52781. delete h[n.id];
  52782. var a = t.get(n);
  52783. a.wireframe && s(a.wireframe),
  52784. t.delete(n);
  52785. var c = t.get(r);
  52786. c.wireframe && s(c.wireframe),
  52787. t.delete(r),
  52788. i.memory.geometries--
  52789. }
  52790. function a(e) {
  52791. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  52792. }
  52793. function s(t) {
  52794. var i = a(t);
  52795. void 0 !== i && (e.deleteBuffer(i),
  52796. c(t))
  52797. }
  52798. function l(e) {
  52799. for (var t in e)
  52800. s(e[t])
  52801. }
  52802. function c(e) {
  52803. e instanceof n.InterleavedBufferAttribute ? t.delete(e.data) : t.delete(e)
  52804. }
  52805. var h = {};
  52806. this.get = r
  52807. }
  52808. ,
  52809. n.WebGLLights = function() {
  52810. var e = {};
  52811. this.get = function(t) {
  52812. if (void 0 !== e[t.id])
  52813. return e[t.id];
  52814. var i;
  52815. switch (t.type) {
  52816. case "DirectionalLight":
  52817. i = {
  52818. direction: new n.Vector3,
  52819. color: new n.Color,
  52820. shadow: !1,
  52821. shadowBias: 0,
  52822. shadowRadius: 1,
  52823. shadowMapSize: new n.Vector2
  52824. };
  52825. break;
  52826. case "SpotLight":
  52827. i = {
  52828. position: new n.Vector3,
  52829. direction: new n.Vector3,
  52830. color: new n.Color,
  52831. distance: 0,
  52832. coneCos: 0,
  52833. penumbraCos: 0,
  52834. decay: 0,
  52835. shadow: !1,
  52836. shadowBias: 0,
  52837. shadowRadius: 1,
  52838. shadowMapSize: new n.Vector2
  52839. };
  52840. break;
  52841. case "PointLight":
  52842. i = {
  52843. position: new n.Vector3,
  52844. color: new n.Color,
  52845. distance: 0,
  52846. decay: 0,
  52847. shadow: !1,
  52848. shadowBias: 0,
  52849. shadowRadius: 1,
  52850. shadowMapSize: new n.Vector2
  52851. };
  52852. break;
  52853. case "HemisphereLight":
  52854. i = {
  52855. direction: new n.Vector3,
  52856. skyColor: new n.Color,
  52857. groundColor: new n.Color
  52858. }
  52859. }
  52860. return e[t.id] = i,
  52861. i
  52862. }
  52863. }
  52864. ,
  52865. n.WebGLObjects = function(e, t, i) {
  52866. function r(t) {
  52867. var i = u.get(t);
  52868. t.geometry instanceof n.Geometry && i.updateFromObject(t);
  52869. var r = i.index
  52870. , a = i.attributes;
  52871. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER);
  52872. for (var s in a)
  52873. o(a[s], e.ARRAY_BUFFER);
  52874. var l = i.morphAttributes;
  52875. for (var s in l)
  52876. for (var c = l[s], h = 0, d = c.length; h < d; h++)
  52877. o(c[h], e.ARRAY_BUFFER);
  52878. return i
  52879. }
  52880. function o(e, i) {
  52881. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e
  52882. , o = t.get(r);
  52883. void 0 === o.__webglBuffer ? a(o, r, i) : o.version !== r.version && s(o, r, i)
  52884. }
  52885. function a(t, i, n) {
  52886. t.__webglBuffer = e.createBuffer(),
  52887. e.bindBuffer(n, t.__webglBuffer);
  52888. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW;
  52889. e.bufferData(n, i.array, r),
  52890. t.version = i.version
  52891. }
  52892. function s(t, i, n) {
  52893. e.bindBuffer(n, t.__webglBuffer),
  52894. i.dynamic === !1 || i.updateRange.count === -1 ? e.bufferSubData(n, 0, i.array) : 0 === i.updateRange.count ? console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.") : (e.bufferSubData(n, i.updateRange.offset * i.array.BYTES_PER_ELEMENT, i.array.subarray(i.updateRange.offset, i.updateRange.offset + i.updateRange.count)),
  52895. i.updateRange.count = 0),
  52896. t.version = i.version
  52897. }
  52898. function l(e) {
  52899. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  52900. }
  52901. function c(i) {
  52902. var r = t.get(i);
  52903. if (void 0 !== r.wireframe)
  52904. return r.wireframe;
  52905. var a = []
  52906. , s = i.index
  52907. , l = i.attributes
  52908. , c = l.position;
  52909. if (null !== s)
  52910. for (var u = {}, d = s.array, p = 0, f = d.length; p < f; p += 3) {
  52911. var g = d[p + 0]
  52912. , m = d[p + 1]
  52913. , v = d[p + 2];
  52914. h(u, g, m) && a.push(g, m),
  52915. h(u, m, v) && a.push(m, v),
  52916. h(u, v, g) && a.push(v, g)
  52917. }
  52918. else
  52919. for (var d = l.position.array, p = 0, f = d.length / 3 - 1; p < f; p += 3) {
  52920. var g = p + 0
  52921. , m = p + 1
  52922. , v = p + 2;
  52923. a.push(g, m, m, v, v, g)
  52924. }
  52925. var A = c.count > 65535 ? Uint32Array : Uint16Array
  52926. , y = new n.BufferAttribute(new A(a),1);
  52927. return o(y, e.ELEMENT_ARRAY_BUFFER),
  52928. r.wireframe = y,
  52929. y
  52930. }
  52931. function h(e, t, i) {
  52932. if (t > i) {
  52933. var n = t;
  52934. t = i,
  52935. i = n
  52936. }
  52937. var r = e[t];
  52938. return void 0 === r ? (e[t] = [i],
  52939. !0) : r.indexOf(i) === -1 && (r.push(i),
  52940. !0)
  52941. }
  52942. var u = new n.WebGLGeometries(e,t,i);
  52943. this.getAttributeBuffer = l,
  52944. this.getWireframeAttribute = c,
  52945. this.update = r
  52946. }
  52947. ,
  52948. n.WebGLProgram = function() {
  52949. function e(e) {
  52950. switch (e) {
  52951. case n.LinearEncoding:
  52952. return ["Linear", "( value )"];
  52953. case n.sRGBEncoding:
  52954. return ["sRGB", "( value )"];
  52955. case n.RGBEEncoding:
  52956. return ["RGBE", "( value )"];
  52957. case n.RGBM7Encoding:
  52958. return ["RGBM", "( value, 7.0 )"];
  52959. case n.RGBM16Encoding:
  52960. return ["RGBM", "( value, 16.0 )"];
  52961. case n.RGBDEncoding:
  52962. return ["RGBD", "( value, 256.0 )"];
  52963. case n.GammaEncoding:
  52964. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  52965. default:
  52966. throw new Error("unsupported encoding: " + e)
  52967. }
  52968. }
  52969. function t(t, i) {
  52970. var n = e(i);
  52971. return "vec4 " + t + "( vec4 value ) { return " + n[0] + "ToLinear" + n[1] + "; }"
  52972. }
  52973. function i(t, i) {
  52974. var n = e(i);
  52975. return "vec4 " + t + "( vec4 value ) { return LinearTo" + n[0] + n[1] + "; }"
  52976. }
  52977. function r(e, t) {
  52978. var i;
  52979. switch (t) {
  52980. case n.LinearToneMapping:
  52981. i = "Linear";
  52982. break;
  52983. case n.ReinhardToneMapping:
  52984. i = "Reinhard";
  52985. break;
  52986. case n.Uncharted2ToneMapping:
  52987. i = "Uncharted2";
  52988. break;
  52989. case n.CineonToneMapping:
  52990. i = "OptimizedCineon";
  52991. break;
  52992. default:
  52993. throw new Error("unsupported toneMapping: " + t)
  52994. }
  52995. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  52996. }
  52997. function o(e, t, i) {
  52998. e = e || {};
  52999. var n = [e.derivatives || t.envMapCubeUV || t.bumpMap || t.normalMap || t.flatShading ? "#extension GL_OES_standard_derivatives : enable" : "", (e.fragDepth || t.logarithmicDepthBuffer) && i.get("EXT_frag_depth") ? "#extension GL_EXT_frag_depth : enable" : "", e.drawBuffers && i.get("WEBGL_draw_buffers") ? "#extension GL_EXT_draw_buffers : require" : "", (e.shaderTextureLOD || t.envMap) && i.get("EXT_shader_texture_lod") ? "#extension GL_EXT_shader_texture_lod : enable" : ""];
  53000. return n.filter(c).join("\n")
  53001. }
  53002. function a(e) {
  53003. var t = [];
  53004. for (var i in e) {
  53005. var n = e[i];
  53006. n !== !1 && t.push("#define " + i + " " + n)
  53007. }
  53008. return t.join("\n")
  53009. }
  53010. function s(e, t, i) {
  53011. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
  53012. var a = e.getActiveUniform(t, o)
  53013. , s = a.name
  53014. , l = e.getUniformLocation(t, s)
  53015. , c = f.exec(s);
  53016. if (c) {
  53017. var h = c[1]
  53018. , u = c[2]
  53019. , d = n[h];
  53020. d || (d = n[h] = {}),
  53021. d[u] = l
  53022. } else if (c = g.exec(s)) {
  53023. var p = c[1]
  53024. , v = c[2]
  53025. , A = c[3]
  53026. , y = n[p];
  53027. y || (y = n[p] = []);
  53028. var C = y[v];
  53029. C || (C = y[v] = {}),
  53030. C[A] = l
  53031. } else if (c = m.exec(s)) {
  53032. var p = c[1];
  53033. n[p] = l
  53034. } else
  53035. n[s] = l
  53036. }
  53037. return n
  53038. }
  53039. function l(e, t, i) {
  53040. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0; o < r; o++) {
  53041. var a = e.getActiveAttrib(t, o)
  53042. , s = a.name;
  53043. n[s] = e.getAttribLocation(t, s)
  53044. }
  53045. return n
  53046. }
  53047. function c(e) {
  53048. return "" !== e
  53049. }
  53050. function h(e, t) {
  53051. 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)
  53052. }
  53053. function u(e) {
  53054. function t(e, t) {
  53055. var i = n.ShaderChunk[t];
  53056. if (void 0 === i)
  53057. throw new Error("Can not resolve #include <" + t + ">");
  53058. return u(i)
  53059. }
  53060. var i = /#include +<([\w\d.]+)>/g;
  53061. return e.replace(i, t)
  53062. }
  53063. function d(e) {
  53064. function t(e, t, i, n) {
  53065. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  53066. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  53067. return r
  53068. }
  53069. var i = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
  53070. return e.replace(i, t)
  53071. }
  53072. var p = 0
  53073. , f = /^([\w\d_]+)\.([\w\d_]+)$/
  53074. , g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/
  53075. , m = /^([\w\d_]+)\[0\]$/;
  53076. return function(e, f, g, m) {
  53077. var v = e.context
  53078. , A = g.extensions
  53079. , y = g.defines
  53080. , C = g.__webglShader.vertexShader
  53081. , I = g.__webglShader.fragmentShader
  53082. , E = "SHADOWMAP_TYPE_BASIC";
  53083. m.shadowMapType === n.PCFShadowMap ? E = "SHADOWMAP_TYPE_PCF" : m.shadowMapType === n.PCFSoftShadowMap && (E = "SHADOWMAP_TYPE_PCF_SOFT");
  53084. var b = "ENVMAP_TYPE_CUBE"
  53085. , w = "ENVMAP_MODE_REFLECTION"
  53086. , _ = "ENVMAP_BLENDING_MULTIPLY";
  53087. if (m.envMap) {
  53088. switch (g.envMap.mapping) {
  53089. case n.CubeReflectionMapping:
  53090. case n.CubeRefractionMapping:
  53091. b = "ENVMAP_TYPE_CUBE";
  53092. break;
  53093. case n.CubeUVReflectionMapping:
  53094. case n.CubeUVRefractionMapping:
  53095. b = "ENVMAP_TYPE_CUBE_UV";
  53096. break;
  53097. case n.EquirectangularReflectionMapping:
  53098. case n.EquirectangularRefractionMapping:
  53099. b = "ENVMAP_TYPE_EQUIREC";
  53100. break;
  53101. case n.SphericalReflectionMapping:
  53102. b = "ENVMAP_TYPE_SPHERE"
  53103. }
  53104. switch (g.envMap.mapping) {
  53105. case n.CubeRefractionMapping:
  53106. case n.EquirectangularRefractionMapping:
  53107. w = "ENVMAP_MODE_REFRACTION"
  53108. }
  53109. switch (g.combine) {
  53110. case n.MultiplyOperation:
  53111. _ = "ENVMAP_BLENDING_MULTIPLY";
  53112. break;
  53113. case n.MixOperation:
  53114. _ = "ENVMAP_BLENDING_MIX";
  53115. break;
  53116. case n.AddOperation:
  53117. _ = "ENVMAP_BLENDING_ADD"
  53118. }
  53119. }
  53120. var T, x, S = e.gammaFactor > 0 ? e.gammaFactor : 1, M = o(A, m, e.extensions), R = a(y), P = v.createProgram();
  53121. g instanceof n.RawShaderMaterial ? (T = "",
  53122. x = "") : (T = ["precision " + m.precision + " float;", "precision " + m.precision + " int;", "#define SHADER_NAME " + g.__webglShader.name, R, m.supportsVertexTextures ? "#define VERTEX_TEXTURES" : "", "#define GAMMA_FACTOR " + S, "#define MAX_BONES " + m.maxBones, m.map ? "#define USE_MAP" : "", m.envMap ? "#define USE_ENVMAP" : "", m.envMap ? "#define " + w : "", m.lightMap ? "#define USE_LIGHTMAP" : "", m.aoMap ? "#define USE_AOMAP" : "", m.emissiveMap ? "#define USE_EMISSIVEMAP" : "", m.bumpMap ? "#define USE_BUMPMAP" : "", m.normalMap ? "#define USE_NORMALMAP" : "", m.displacementMap && m.supportsVertexTextures ? "#define USE_DISPLACEMENTMAP" : "", m.specularMap ? "#define USE_SPECULARMAP" : "", m.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", m.metalnessMap ? "#define USE_METALNESSMAP" : "", m.alphaMap ? "#define USE_ALPHAMAP" : "", m.vertexColors ? "#define USE_COLOR" : "", m.flatShading ? "#define FLAT_SHADED" : "", m.skinning ? "#define USE_SKINNING" : "", m.useVertexTexture ? "#define BONE_TEXTURE" : "", m.morphTargets ? "#define USE_MORPHTARGETS" : "", m.morphNormals && m.flatShading === !1 ? "#define USE_MORPHNORMALS" : "", m.doubleSided ? "#define DOUBLE_SIDED" : "", m.flipSided ? "#define FLIP_SIDED" : "", m.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", m.shadowMapEnabled ? "#define " + E : "", m.pointLightShadows > 0 ? "#define POINT_LIGHT_SHADOWS" : "", m.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", m.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", m.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", "uniform mat4 modelMatrix;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform mat4 viewMatrix;", "uniform mat3 normalMatrix;", "uniform vec3 cameraPosition;", "attribute vec3 position;", "attribute vec3 normal;", "attribute vec2 uv;", "#ifdef USE_COLOR", "\tattribute vec3 color;", "#endif", "#ifdef USE_MORPHTARGETS", "\tattribute vec3 morphTarget0;", "\tattribute vec3 morphTarget1;", "\tattribute vec3 morphTarget2;", "\tattribute vec3 morphTarget3;", "\t#ifdef USE_MORPHNORMALS", "\t\tattribute vec3 morphNormal0;", "\t\tattribute vec3 morphNormal1;", "\t\tattribute vec3 morphNormal2;", "\t\tattribute vec3 morphNormal3;", "\t#else", "\t\tattribute vec3 morphTarget4;", "\t\tattribute vec3 morphTarget5;", "\t\tattribute vec3 morphTarget6;", "\t\tattribute vec3 morphTarget7;", "\t#endif", "#endif", "#ifdef USE_SKINNING", "\tattribute vec4 skinIndex;", "\tattribute vec4 skinWeight;", "#endif", "\n"].filter(c).join("\n"),
  53123. x = [M, "precision " + m.precision + " float;", "precision " + m.precision + " int;", "#define SHADER_NAME " + g.__webglShader.name, R, m.alphaTest ? "#define ALPHATEST " + m.alphaTest : "", "#define GAMMA_FACTOR " + S, m.useFog && m.fog ? "#define USE_FOG" : "", m.useFog && m.fogExp ? "#define FOG_EXP2" : "", m.map ? "#define USE_MAP" : "", m.envMap ? "#define USE_ENVMAP" : "", m.envMap ? "#define " + b : "", m.envMap ? "#define " + w : "", m.envMap ? "#define " + _ : "", m.lightMap ? "#define USE_LIGHTMAP" : "", m.aoMap ? "#define USE_AOMAP" : "", m.emissiveMap ? "#define USE_EMISSIVEMAP" : "", m.bumpMap ? "#define USE_BUMPMAP" : "", m.normalMap ? "#define USE_NORMALMAP" : "", m.specularMap ? "#define USE_SPECULARMAP" : "", m.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", m.metalnessMap ? "#define USE_METALNESSMAP" : "", m.alphaMap ? "#define USE_ALPHAMAP" : "", m.vertexColors ? "#define USE_COLOR" : "", m.flatShading ? "#define FLAT_SHADED" : "", m.doubleSided ? "#define DOUBLE_SIDED" : "", m.flipSided ? "#define FLIP_SIDED" : "", m.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", m.shadowMapEnabled ? "#define " + E : "", m.pointLightShadows > 0 ? "#define POINT_LIGHT_SHADOWS" : "", m.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "", m.physicallyCorrectLights ? "#define PHYSICALLY_CORRECT_LIGHTS" : "", m.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", m.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", m.envMap && e.extensions.get("EXT_shader_texture_lod") ? "#define TEXTURE_LOD_EXT" : "", "uniform mat4 viewMatrix;", "uniform vec3 cameraPosition;", m.toneMapping !== n.NoToneMapping ? "#define TONE_MAPPING" : "", m.toneMapping !== n.NoToneMapping ? n.ShaderChunk.tonemapping_pars_fragment : "", m.toneMapping !== n.NoToneMapping ? r("toneMapping", m.toneMapping) : "", m.outputEncoding || m.mapEncoding || m.envMapEncoding || m.emissiveMapEncoding ? n.ShaderChunk.encodings_pars_fragment : "", m.mapEncoding ? t("mapTexelToLinear", m.mapEncoding) : "", m.envMapEncoding ? t("envMapTexelToLinear", m.envMapEncoding) : "", m.emissiveMapEncoding ? t("emissiveMapTexelToLinear", m.emissiveMapEncoding) : "", m.outputEncoding ? i("linearToOutputTexel", m.outputEncoding) : "", "\n"].filter(c).join("\n")),
  53124. C = u(C, m),
  53125. C = h(C, m),
  53126. I = u(I, m),
  53127. I = h(I, m),
  53128. g instanceof n.ShaderMaterial == !1 && (C = d(C),
  53129. I = d(I));
  53130. var O = T + C
  53131. , L = x + I
  53132. , D = n.WebGLShader(v, v.VERTEX_SHADER, O)
  53133. , N = n.WebGLShader(v, v.FRAGMENT_SHADER, L);
  53134. v.attachShader(P, D),
  53135. v.attachShader(P, N),
  53136. void 0 !== g.index0AttributeName ? v.bindAttribLocation(P, 0, g.index0AttributeName) : m.morphTargets === !0 && v.bindAttribLocation(P, 0, "position"),
  53137. v.linkProgram(P);
  53138. var B = v.getProgramInfoLog(P)
  53139. , F = v.getShaderInfoLog(D)
  53140. , V = v.getShaderInfoLog(N)
  53141. , U = !0
  53142. , k = !0;
  53143. v.getProgramParameter(P, v.LINK_STATUS) === !1 ? (U = !1,
  53144. console.error("THREE.WebGLProgram: shader error: ", v.getError(), "gl.VALIDATE_STATUS", v.getProgramParameter(P, v.VALIDATE_STATUS), "gl.getProgramInfoLog", B, F, V)) : "" !== B ? console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()", B) : "" !== F && "" !== V || (k = !1),
  53145. k && (this.diagnostics = {
  53146. runnable: U,
  53147. material: g,
  53148. programLog: B,
  53149. vertexShader: {
  53150. log: F,
  53151. prefix: T
  53152. },
  53153. fragmentShader: {
  53154. log: V,
  53155. prefix: x
  53156. }
  53157. }),
  53158. v.deleteShader(D),
  53159. v.deleteShader(N);
  53160. var H;
  53161. this.getUniforms = function() {
  53162. return void 0 === H && (H = s(v, P)),
  53163. H
  53164. }
  53165. ;
  53166. var G;
  53167. return this.getAttributes = function() {
  53168. return void 0 === G && (G = l(v, P)),
  53169. G
  53170. }
  53171. ,
  53172. this.destroy = function() {
  53173. v.deleteProgram(P),
  53174. this.program = void 0
  53175. }
  53176. ,
  53177. Object.defineProperties(this, {
  53178. uniforms: {
  53179. get: function() {
  53180. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  53181. this.getUniforms()
  53182. }
  53183. },
  53184. attributes: {
  53185. get: function() {
  53186. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  53187. this.getAttributes()
  53188. }
  53189. }
  53190. }),
  53191. this.id = p++,
  53192. this.code = f,
  53193. this.usedTimes = 1,
  53194. this.program = P,
  53195. this.vertexShader = D,
  53196. this.fragmentShader = N,
  53197. this
  53198. }
  53199. }(),
  53200. n.WebGLPrograms = function(e, t) {
  53201. function i(e) {
  53202. if (t.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  53203. return 1024;
  53204. var i = t.maxVertexUniforms
  53205. , r = Math.floor((i - 20) / 4)
  53206. , o = r;
  53207. return void 0 !== e && e instanceof n.SkinnedMesh && (o = Math.min(e.skeleton.bones.length, o),
  53208. o < e.skeleton.bones.length && console.warn("WebGLRenderer: too many bones - " + e.skeleton.bones.length + ", this GPU supports just " + o + " (try OpenGL instead of ANGLE)")),
  53209. o
  53210. }
  53211. function r(e, t) {
  53212. var i;
  53213. return e ? e instanceof n.Texture ? i = e.encoding : e instanceof n.WebGLRenderTarget && (i = e.texture.encoding) : i = n.LinearEncoding,
  53214. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  53215. i
  53216. }
  53217. var o = []
  53218. , a = {
  53219. MeshDepthMaterial: "depth",
  53220. MeshNormalMaterial: "normal",
  53221. MeshBasicMaterial: "basic",
  53222. MeshLambertMaterial: "lambert",
  53223. MeshPhongMaterial: "phong",
  53224. MeshStandardMaterial: "standard",
  53225. LineBasicMaterial: "basic",
  53226. LineDashedMaterial: "dashed",
  53227. PointsMaterial: "points"
  53228. }
  53229. , s = ["precision", "supportsVertexTextures", "map", "mapEncoding", "envMap", "envMapMode", "envMapEncoding", "lightMap", "aoMap", "emissiveMap", "emissiveMapEncoding", "bumpMap", "normalMap", "displacementMap", "specularMap", "roughnessMap", "metalnessMap", "alphaMap", "combine", "vertexColors", "fog", "useFog", "fogExp", "flatShading", "sizeAttenuation", "logarithmicDepthBuffer", "skinning", "maxBones", "useVertexTexture", "morphTargets", "morphNormals", "maxMorphTargets", "maxMorphNormals", "premultipliedAlpha", "numDirLights", "numPointLights", "numSpotLights", "numHemiLights", "shadowMapEnabled", "pointLightShadows", "toneMapping", "physicallyCorrectLights", "shadowMapType", "alphaTest", "doubleSided", "flipSided"];
  53230. this.getParameters = function(o, s, l, c) {
  53231. var h = a[o.type]
  53232. , u = i(c)
  53233. , d = e.getPrecision();
  53234. null !== o.precision && (d = t.getMaxPrecision(o.precision),
  53235. d !== o.precision && console.warn("THREE.WebGLProgram.getParameters:", o.precision, "not supported, using", d, "instead."));
  53236. var p = {
  53237. shaderID: h,
  53238. precision: d,
  53239. supportsVertexTextures: t.vertexTextures,
  53240. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  53241. map: !!o.map,
  53242. mapEncoding: r(o.map, e.gammaInput),
  53243. envMap: !!o.envMap,
  53244. envMapMode: o.envMap && o.envMap.mapping,
  53245. envMapEncoding: r(o.envMap, e.gammaInput),
  53246. envMapCubeUV: !!o.envMap && (o.envMap.mapping === n.CubeUVReflectionMapping || o.envMap.mapping === n.CubeUVRefractionMapping),
  53247. lightMap: !!o.lightMap,
  53248. aoMap: !!o.aoMap,
  53249. emissiveMap: !!o.emissiveMap,
  53250. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  53251. bumpMap: !!o.bumpMap,
  53252. normalMap: !!o.normalMap,
  53253. displacementMap: !!o.displacementMap,
  53254. roughnessMap: !!o.roughnessMap,
  53255. metalnessMap: !!o.metalnessMap,
  53256. specularMap: !!o.specularMap,
  53257. alphaMap: !!o.alphaMap,
  53258. combine: o.combine,
  53259. vertexColors: o.vertexColors,
  53260. fog: l,
  53261. useFog: o.fog,
  53262. fogExp: l instanceof n.FogExp2,
  53263. flatShading: o.shading === n.FlatShading,
  53264. sizeAttenuation: o.sizeAttenuation,
  53265. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  53266. skinning: o.skinning,
  53267. maxBones: u,
  53268. useVertexTexture: t.floatVertexTextures && c && c.skeleton && c.skeleton.useVertexTexture,
  53269. morphTargets: o.morphTargets,
  53270. morphNormals: o.morphNormals,
  53271. maxMorphTargets: e.maxMorphTargets,
  53272. maxMorphNormals: e.maxMorphNormals,
  53273. numDirLights: s.directional.length,
  53274. numPointLights: s.point.length,
  53275. numSpotLights: s.spot.length,
  53276. numHemiLights: s.hemi.length,
  53277. pointLightShadows: s.shadowsPointLight,
  53278. shadowMapEnabled: e.shadowMap.enabled && c.receiveShadow && s.shadows.length > 0,
  53279. shadowMapType: e.shadowMap.type,
  53280. toneMapping: e.toneMapping,
  53281. physicallyCorrectLights: e.physicallyCorrectLights,
  53282. premultipliedAlpha: o.premultipliedAlpha,
  53283. alphaTest: o.alphaTest,
  53284. doubleSided: o.side === n.DoubleSide,
  53285. flipSided: o.side === n.BackSide
  53286. };
  53287. return p
  53288. }
  53289. ,
  53290. this.getProgramCode = function(e, t) {
  53291. var i = [];
  53292. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  53293. i.push(e.vertexShader)),
  53294. void 0 !== e.defines)
  53295. for (var n in e.defines)
  53296. i.push(n),
  53297. i.push(e.defines[n]);
  53298. for (var r = 0; r < s.length; r++) {
  53299. var o = s[r];
  53300. i.push(o),
  53301. i.push(t[o])
  53302. }
  53303. return i.join()
  53304. }
  53305. ,
  53306. this.acquireProgram = function(t, i, r) {
  53307. for (var a, s = 0, l = o.length; s < l; s++) {
  53308. var c = o[s];
  53309. if (c.code === r) {
  53310. a = c,
  53311. ++a.usedTimes;
  53312. break
  53313. }
  53314. }
  53315. return void 0 === a && (a = new n.WebGLProgram(e,r,t,i),
  53316. o.push(a)),
  53317. a
  53318. }
  53319. ,
  53320. this.releaseProgram = function(e) {
  53321. if (0 === --e.usedTimes) {
  53322. var t = o.indexOf(e);
  53323. o[t] = o[o.length - 1],
  53324. o.pop(),
  53325. e.destroy()
  53326. }
  53327. }
  53328. ,
  53329. this.programs = o
  53330. }
  53331. ,
  53332. n.WebGLProperties = function() {
  53333. var e = {};
  53334. this.get = function(t) {
  53335. var i = t.uuid
  53336. , n = e[i];
  53337. return void 0 === n && (n = {},
  53338. e[i] = n),
  53339. n
  53340. }
  53341. ,
  53342. this.delete = function(t) {
  53343. delete e[t.uuid]
  53344. }
  53345. ,
  53346. this.clear = function() {
  53347. e = {}
  53348. }
  53349. }
  53350. ,
  53351. n.WebGLShader = function() {
  53352. function e(e) {
  53353. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  53354. t[i] = i + 1 + ": " + t[i];
  53355. return t.join("\n")
  53356. }
  53357. return function(t, i, n) {
  53358. var r = t.createShader(i);
  53359. return t.shaderSource(r, n),
  53360. t.compileShader(r),
  53361. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 && console.error("THREE.WebGLShader: Shader couldn't compile."),
  53362. "" !== t.getShaderInfoLog(r) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", i === t.VERTEX_SHADER ? "vertex" : "fragment", t.getShaderInfoLog(r), e(n)),
  53363. r
  53364. }
  53365. }(),
  53366. n.WebGLShadowMap = function(e, t, i) {
  53367. function r(e, t, i, r) {
  53368. var o = e.geometry
  53369. , a = null
  53370. , s = v
  53371. , l = e.customDepthMaterial;
  53372. if (i && (s = A,
  53373. l = e.customDistanceMaterial),
  53374. l)
  53375. a = l;
  53376. else {
  53377. var c = void 0 !== o.morphTargets && o.morphTargets.length > 0 && t.morphTargets
  53378. , h = e instanceof n.SkinnedMesh && t.skinning
  53379. , u = 0;
  53380. c && (u |= f),
  53381. h && (u |= g),
  53382. a = s[u]
  53383. }
  53384. return a.visible = t.visible,
  53385. a.wireframe = t.wireframe,
  53386. a.wireframeLinewidth = t.wireframeLinewidth,
  53387. i && void 0 !== a.uniforms.lightPos && a.uniforms.lightPos.value.copy(r),
  53388. a
  53389. }
  53390. function o(e, t, i) {
  53391. if (e.visible !== !1) {
  53392. if (e.layers.test(t.layers) && (e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && e.castShadow && (e.frustumCulled === !1 || l.intersectsObject(e) === !0)) {
  53393. var r = e.material;
  53394. r.visible === !0 && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  53395. p.push(e))
  53396. }
  53397. for (var a = e.children, s = 0, c = a.length; s < c; s++)
  53398. o(a[s], t, i)
  53399. }
  53400. }
  53401. for (var a = e.context, s = e.state, l = new n.Frustum, c = new n.Matrix4, h = new n.Vector2, u = new n.Vector3, d = new n.Vector3, p = [], f = 1, g = 2, m = (f | g) + 1, v = new Array(m), A = new Array(m), y = [new n.Vector3(1,0,0), new n.Vector3(-1,0,0), new n.Vector3(0,0,1), new n.Vector3(0,0,-1), new n.Vector3(0,1,0), new n.Vector3(0,-1,0)], C = [new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,0,1), new n.Vector3(0,0,-1)], I = [new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4], E = n.ShaderLib.depthRGBA, b = n.UniformsUtils.clone(E.uniforms), w = n.ShaderLib.distanceRGBA, _ = n.UniformsUtils.clone(w.uniforms), T = 0; T !== m; ++T) {
  53402. var x = 0 !== (T & f)
  53403. , S = 0 !== (T & g)
  53404. , M = new n.ShaderMaterial({
  53405. uniforms: b,
  53406. vertexShader: E.vertexShader,
  53407. fragmentShader: E.fragmentShader,
  53408. morphTargets: x,
  53409. skinning: S
  53410. });
  53411. v[T] = M;
  53412. var R = new n.ShaderMaterial({
  53413. defines: {
  53414. USE_SHADOWMAP: ""
  53415. },
  53416. uniforms: _,
  53417. vertexShader: w.vertexShader,
  53418. fragmentShader: w.fragmentShader,
  53419. morphTargets: x,
  53420. skinning: S
  53421. });
  53422. A[T] = R
  53423. }
  53424. var P = this;
  53425. this.enabled = !1,
  53426. this.autoUpdate = !0,
  53427. this.needsUpdate = !1,
  53428. this.type = n.PCFShadowMap,
  53429. this.cullFace = n.CullFaceFront,
  53430. this.render = function(f, g) {
  53431. var m, v, A = t.shadows;
  53432. if (0 !== A.length && P.enabled !== !1 && (P.autoUpdate !== !1 || P.needsUpdate !== !1)) {
  53433. s.clearColor(1, 1, 1, 1),
  53434. s.disable(a.BLEND),
  53435. s.enable(a.CULL_FACE),
  53436. a.frontFace(a.CCW),
  53437. a.cullFace(P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK),
  53438. s.setDepthTest(!0),
  53439. s.setScissorTest(!1);
  53440. for (var E = 0, b = A.length; E < b; E++) {
  53441. var w = A[E]
  53442. , _ = w.shadow
  53443. , T = _.camera;
  53444. if (h.copy(_.mapSize),
  53445. w instanceof n.PointLight) {
  53446. m = 6,
  53447. v = !0;
  53448. var x = h.x
  53449. , S = h.y;
  53450. I[0].set(2 * x, S, x, S),
  53451. I[1].set(0, S, x, S),
  53452. I[2].set(3 * x, S, x, S),
  53453. I[3].set(x, S, x, S),
  53454. I[4].set(3 * x, 0, x, S),
  53455. I[5].set(x, 0, x, S),
  53456. h.x *= 4,
  53457. h.y *= 2
  53458. } else
  53459. m = 1,
  53460. v = !1;
  53461. if (null === _.map) {
  53462. var M = {
  53463. minFilter: n.NearestFilter,
  53464. magFilter: n.NearestFilter,
  53465. format: n.RGBAFormat
  53466. };
  53467. _.map = new n.WebGLRenderTarget(h.x,h.y,M),
  53468. w instanceof n.SpotLight && (T.aspect = h.x / h.y),
  53469. T.updateProjectionMatrix()
  53470. }
  53471. var R = _.map
  53472. , O = _.matrix;
  53473. d.setFromMatrixPosition(w.matrixWorld),
  53474. T.position.copy(d),
  53475. e.setRenderTarget(R),
  53476. e.clear();
  53477. for (var L = 0; L < m; L++) {
  53478. if (v) {
  53479. u.copy(T.position),
  53480. u.add(y[L]),
  53481. T.up.copy(C[L]),
  53482. T.lookAt(u);
  53483. var D = I[L];
  53484. s.viewport(D)
  53485. } else
  53486. u.setFromMatrixPosition(w.target.matrixWorld),
  53487. T.lookAt(u);
  53488. T.updateMatrixWorld(),
  53489. T.matrixWorldInverse.getInverse(T.matrixWorld),
  53490. O.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  53491. O.multiply(T.projectionMatrix),
  53492. O.multiply(T.matrixWorldInverse),
  53493. c.multiplyMatrices(T.projectionMatrix, T.matrixWorldInverse),
  53494. l.setFromMatrix(c),
  53495. p.length = 0,
  53496. o(f, g, T);
  53497. for (var N = 0, B = p.length; N < B; N++) {
  53498. var F = p[N]
  53499. , V = i.update(F)
  53500. , U = F.material;
  53501. if (U instanceof n.MultiMaterial)
  53502. for (var k = V.groups, H = U.materials, G = 0, z = k.length; G < z; G++) {
  53503. var W = k[G]
  53504. , j = H[W.materialIndex];
  53505. if (j.visible === !0) {
  53506. var Y = r(F, j, v, d);
  53507. e.renderBufferDirect(T, null, V, Y, F, W)
  53508. }
  53509. }
  53510. else {
  53511. var Y = r(F, U, v, d);
  53512. e.renderBufferDirect(T, null, V, Y, F, null)
  53513. }
  53514. }
  53515. }
  53516. }
  53517. var X = e.getClearColor()
  53518. , Z = e.getClearAlpha();
  53519. e.setClearColor(X, Z),
  53520. s.enable(a.BLEND),
  53521. P.cullFace === n.CullFaceFront && a.cullFace(a.BACK),
  53522. P.needsUpdate = !1
  53523. }
  53524. }
  53525. }
  53526. ,
  53527. n.WebGLState = function(e, t, i) {
  53528. var r = this
  53529. , o = new n.Vector4
  53530. , a = new Uint8Array(16)
  53531. , s = new Uint8Array(16)
  53532. , l = new Uint8Array(16)
  53533. , c = {}
  53534. , h = null
  53535. , u = null
  53536. , d = null
  53537. , p = null
  53538. , f = null
  53539. , g = null
  53540. , m = null
  53541. , v = null
  53542. , A = !1
  53543. , y = null
  53544. , C = null
  53545. , I = null
  53546. , E = null
  53547. , b = null
  53548. , w = null
  53549. , _ = null
  53550. , T = null
  53551. , x = null
  53552. , S = null
  53553. , M = null
  53554. , R = null
  53555. , P = null
  53556. , O = null
  53557. , L = null
  53558. , D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  53559. , N = void 0
  53560. , B = {}
  53561. , F = new n.Vector4
  53562. , V = null
  53563. , U = null
  53564. , k = new n.Vector4
  53565. , H = new n.Vector4
  53566. , G = e.createTexture();
  53567. e.bindTexture(e.TEXTURE_2D, G),
  53568. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  53569. e.texImage2D(e.TEXTURE_2D, 0, e.RGB, 1, 1, 0, e.RGB, e.UNSIGNED_BYTE, new Uint8Array(3)),
  53570. this.init = function() {
  53571. this.clearColor(0, 0, 0, 1),
  53572. this.clearDepth(1),
  53573. this.clearStencil(0),
  53574. this.enable(e.DEPTH_TEST),
  53575. e.depthFunc(e.LEQUAL),
  53576. e.frontFace(e.CCW),
  53577. e.cullFace(e.BACK),
  53578. this.enable(e.CULL_FACE),
  53579. this.enable(e.BLEND),
  53580. e.blendEquation(e.FUNC_ADD),
  53581. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  53582. }
  53583. ,
  53584. this.initAttributes = function() {
  53585. for (var e = 0, t = a.length; e < t; e++)
  53586. a[e] = 0
  53587. }
  53588. ,
  53589. this.enableAttribute = function(i) {
  53590. if (a[i] = 1,
  53591. 0 === s[i] && (e.enableVertexAttribArray(i),
  53592. s[i] = 1),
  53593. 0 !== l[i]) {
  53594. var n = t.get("ANGLE_instanced_arrays");
  53595. n.vertexAttribDivisorANGLE(i, 0),
  53596. l[i] = 0
  53597. }
  53598. }
  53599. ,
  53600. this.enableAttributeAndDivisor = function(t, i, n) {
  53601. a[t] = 1,
  53602. 0 === s[t] && (e.enableVertexAttribArray(t),
  53603. s[t] = 1),
  53604. l[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  53605. l[t] = i)
  53606. }
  53607. ,
  53608. this.disableUnusedAttributes = function() {
  53609. for (var t = 0, i = s.length; t < i; t++)
  53610. s[t] !== a[t] && (e.disableVertexAttribArray(t),
  53611. s[t] = 0)
  53612. }
  53613. ,
  53614. this.enable = function(t) {
  53615. c[t] !== !0 && (e.enable(t),
  53616. c[t] = !0)
  53617. }
  53618. ,
  53619. this.disable = function(t) {
  53620. c[t] !== !1 && (e.disable(t),
  53621. c[t] = !1)
  53622. }
  53623. ,
  53624. this.getCompressedTextureFormats = function() {
  53625. if (null === h && (h = [],
  53626. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  53627. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  53628. h.push(i[n]);
  53629. return h
  53630. }
  53631. ,
  53632. this.setBlending = function(t, r, o, a, s, l, c, h) {
  53633. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  53634. t === u && h === A || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53635. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  53636. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53637. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  53638. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53639. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  53640. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53641. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53642. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  53643. u = t,
  53644. A = h),
  53645. t === n.CustomBlending ? (s = s || r,
  53646. l = l || o,
  53647. c = c || a,
  53648. r === d && s === g || (e.blendEquationSeparate(i(r), i(s)),
  53649. d = r,
  53650. g = s),
  53651. o === p && a === f && l === m && c === v || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  53652. p = o,
  53653. f = a,
  53654. m = l,
  53655. v = c)) : (d = null,
  53656. p = null,
  53657. f = null,
  53658. g = null,
  53659. m = null,
  53660. v = null)
  53661. }
  53662. ,
  53663. this.setDepthFunc = function(t) {
  53664. if (y !== t) {
  53665. if (t)
  53666. switch (t) {
  53667. case n.NeverDepth:
  53668. e.depthFunc(e.NEVER);
  53669. break;
  53670. case n.AlwaysDepth:
  53671. e.depthFunc(e.ALWAYS);
  53672. break;
  53673. case n.LessDepth:
  53674. e.depthFunc(e.LESS);
  53675. break;
  53676. case n.LessEqualDepth:
  53677. e.depthFunc(e.LEQUAL);
  53678. break;
  53679. case n.EqualDepth:
  53680. e.depthFunc(e.EQUAL);
  53681. break;
  53682. case n.GreaterEqualDepth:
  53683. e.depthFunc(e.GEQUAL);
  53684. break;
  53685. case n.GreaterDepth:
  53686. e.depthFunc(e.GREATER);
  53687. break;
  53688. case n.NotEqualDepth:
  53689. e.depthFunc(e.NOTEQUAL);
  53690. break;
  53691. default:
  53692. e.depthFunc(e.LEQUAL)
  53693. }
  53694. else
  53695. e.depthFunc(e.LEQUAL);
  53696. y = t
  53697. }
  53698. }
  53699. ,
  53700. this.setDepthTest = function(t) {
  53701. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  53702. }
  53703. ,
  53704. this.setDepthWrite = function(t) {
  53705. C !== t && (e.depthMask(t),
  53706. C = t)
  53707. }
  53708. ,
  53709. this.setColorWrite = function(t) {
  53710. I !== t && (e.colorMask(t, t, t, t),
  53711. I = t)
  53712. }
  53713. ,
  53714. this.setStencilFunc = function(t, i, n) {
  53715. b === t && w === i && _ === n || (e.stencilFunc(t, i, n),
  53716. b = t,
  53717. w = i,
  53718. _ = n)
  53719. }
  53720. ,
  53721. this.setStencilOp = function(t, i, n) {
  53722. T === t && x === i && S === n || (e.stencilOp(t, i, n),
  53723. T = t,
  53724. x = i,
  53725. S = n)
  53726. }
  53727. ,
  53728. this.setStencilTest = function(t) {
  53729. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  53730. }
  53731. ,
  53732. this.setStencilWrite = function(t) {
  53733. E !== t && (e.stencilMask(t),
  53734. E = t)
  53735. }
  53736. ,
  53737. this.setFlipSided = function(t) {
  53738. M !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  53739. M = t)
  53740. }
  53741. ,
  53742. this.setLineWidth = function(t) {
  53743. t !== R && (e.lineWidth(t),
  53744. R = t)
  53745. }
  53746. ,
  53747. this.setPolygonOffset = function(t, i, n) {
  53748. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  53749. !t || P === i && O === n || (e.polygonOffset(i, n),
  53750. P = i,
  53751. O = n)
  53752. }
  53753. ,
  53754. this.getScissorTest = function() {
  53755. return L
  53756. }
  53757. ,
  53758. this.setScissorTest = function(t) {
  53759. L = t,
  53760. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  53761. }
  53762. ,
  53763. this.activeTexture = function(t) {
  53764. void 0 === t && (t = e.TEXTURE0 + D - 1),
  53765. N !== t && (e.activeTexture(t),
  53766. N = t)
  53767. }
  53768. ,
  53769. this.bindTexture = function(t, i) {
  53770. void 0 === N && r.activeTexture();
  53771. var n = B[N];
  53772. void 0 === n && (n = {
  53773. type: void 0,
  53774. texture: void 0
  53775. },
  53776. B[N] = n),
  53777. n.type === t && n.texture === i || (e.bindTexture(t, i || G),
  53778. n.type = t,
  53779. n.texture = i)
  53780. }
  53781. ,
  53782. this.compressedTexImage2D = function() {
  53783. try {
  53784. e.compressedTexImage2D.apply(e, arguments)
  53785. } catch (e) {
  53786. console.error(e)
  53787. }
  53788. }
  53789. ,
  53790. this.texImage2D = function() {
  53791. try {
  53792. e.texImage2D.apply(e, arguments)
  53793. } catch (e) {
  53794. console.error(e)
  53795. }
  53796. }
  53797. ,
  53798. this.clearColor = function(t, i, n, r) {
  53799. o.set(t, i, n, r),
  53800. F.equals(o) === !1 && (e.clearColor(t, i, n, r),
  53801. F.copy(o))
  53802. }
  53803. ,
  53804. this.clearDepth = function(t) {
  53805. V !== t && (e.clearDepth(t),
  53806. V = t)
  53807. }
  53808. ,
  53809. this.clearStencil = function(t) {
  53810. U !== t && (e.clearStencil(t),
  53811. U = t)
  53812. }
  53813. ,
  53814. this.scissor = function(t) {
  53815. k.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  53816. k.copy(t))
  53817. }
  53818. ,
  53819. this.viewport = function(t) {
  53820. H.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  53821. H.copy(t))
  53822. }
  53823. ,
  53824. this.reset = function() {
  53825. for (var t = 0; t < s.length; t++)
  53826. 1 === s[t] && (e.disableVertexAttribArray(t),
  53827. s[t] = 0);
  53828. c = {},
  53829. h = null,
  53830. N = void 0,
  53831. B = {},
  53832. u = null,
  53833. I = null,
  53834. C = null,
  53835. E = null,
  53836. M = null
  53837. }
  53838. }
  53839. ,
  53840. n.LensFlarePlugin = function(e, t) {
  53841. function i() {
  53842. var e = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1])
  53843. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  53844. o = p.createBuffer(),
  53845. a = p.createBuffer(),
  53846. p.bindBuffer(p.ARRAY_BUFFER, o),
  53847. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  53848. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  53849. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  53850. u = p.createTexture(),
  53851. d = p.createTexture(),
  53852. f.bindTexture(p.TEXTURE_2D, u),
  53853. p.texImage2D(p.TEXTURE_2D, 0, p.RGB, 16, 16, 0, p.RGB, p.UNSIGNED_BYTE, null),
  53854. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  53855. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  53856. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  53857. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  53858. f.bindTexture(p.TEXTURE_2D, d),
  53859. p.texImage2D(p.TEXTURE_2D, 0, p.RGBA, 16, 16, 0, p.RGBA, p.UNSIGNED_BYTE, null),
  53860. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  53861. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  53862. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  53863. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  53864. h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0;
  53865. var i;
  53866. i = h ? {
  53867. 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"),
  53868. 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")
  53869. } : {
  53870. 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"),
  53871. 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")
  53872. },
  53873. s = r(i),
  53874. l = {
  53875. vertex: p.getAttribLocation(s, "position"),
  53876. uv: p.getAttribLocation(s, "uv")
  53877. },
  53878. c = {
  53879. renderType: p.getUniformLocation(s, "renderType"),
  53880. map: p.getUniformLocation(s, "map"),
  53881. occlusionMap: p.getUniformLocation(s, "occlusionMap"),
  53882. opacity: p.getUniformLocation(s, "opacity"),
  53883. color: p.getUniformLocation(s, "color"),
  53884. scale: p.getUniformLocation(s, "scale"),
  53885. rotation: p.getUniformLocation(s, "rotation"),
  53886. screenPosition: p.getUniformLocation(s, "screenPosition")
  53887. }
  53888. }
  53889. function r(t) {
  53890. var i = p.createProgram()
  53891. , n = p.createShader(p.FRAGMENT_SHADER)
  53892. , r = p.createShader(p.VERTEX_SHADER)
  53893. , o = "precision " + e.getPrecision() + " float;\n";
  53894. return p.shaderSource(n, o + t.fragmentShader),
  53895. p.shaderSource(r, o + t.vertexShader),
  53896. p.compileShader(n),
  53897. p.compileShader(r),
  53898. p.attachShader(i, n),
  53899. p.attachShader(i, r),
  53900. p.linkProgram(i),
  53901. i
  53902. }
  53903. var o, a, s, l, c, h, u, d, p = e.context, f = e.state;
  53904. this.render = function(r, g, m) {
  53905. if (0 !== t.length) {
  53906. var v = new n.Vector3
  53907. , A = m.w / m.z
  53908. , y = .5 * m.z
  53909. , C = .5 * m.w
  53910. , I = 16 / m.w
  53911. , E = new n.Vector2(I * A,I)
  53912. , b = new n.Vector3(1,1,0)
  53913. , w = new n.Vector2(1,1);
  53914. void 0 === s && i(),
  53915. p.useProgram(s),
  53916. f.initAttributes(),
  53917. f.enableAttribute(l.vertex),
  53918. f.enableAttribute(l.uv),
  53919. f.disableUnusedAttributes(),
  53920. p.uniform1i(c.occlusionMap, 0),
  53921. p.uniform1i(c.map, 1),
  53922. p.bindBuffer(p.ARRAY_BUFFER, o),
  53923. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  53924. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  53925. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  53926. f.disable(p.CULL_FACE),
  53927. f.setDepthWrite(!1);
  53928. for (var _ = 0, T = t.length; _ < T; _++) {
  53929. I = 16 / m.w,
  53930. E.set(I * A, I);
  53931. var x = t[_];
  53932. if (v.set(x.matrixWorld.elements[12], x.matrixWorld.elements[13], x.matrixWorld.elements[14]),
  53933. v.applyMatrix4(g.matrixWorldInverse),
  53934. v.applyProjection(g.projectionMatrix),
  53935. b.copy(v),
  53936. w.x = b.x * y + y,
  53937. w.y = b.y * C + C,
  53938. h || w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w) {
  53939. f.activeTexture(p.TEXTURE0),
  53940. f.bindTexture(p.TEXTURE_2D, null),
  53941. f.activeTexture(p.TEXTURE1),
  53942. f.bindTexture(p.TEXTURE_2D, u),
  53943. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGB, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  53944. p.uniform1i(c.renderType, 0),
  53945. p.uniform2f(c.scale, E.x, E.y),
  53946. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  53947. f.disable(p.BLEND),
  53948. f.enable(p.DEPTH_TEST),
  53949. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  53950. f.activeTexture(p.TEXTURE0),
  53951. f.bindTexture(p.TEXTURE_2D, d),
  53952. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGBA, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  53953. p.uniform1i(c.renderType, 1),
  53954. f.disable(p.DEPTH_TEST),
  53955. f.activeTexture(p.TEXTURE1),
  53956. f.bindTexture(p.TEXTURE_2D, u),
  53957. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  53958. x.positionScreen.copy(b),
  53959. x.customUpdateCallback ? x.customUpdateCallback(x) : x.updateLensFlares(),
  53960. p.uniform1i(c.renderType, 2),
  53961. f.enable(p.BLEND);
  53962. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  53963. var R = x.lensFlares[S];
  53964. R.opacity > .001 && R.scale > .001 && (b.x = R.x,
  53965. b.y = R.y,
  53966. b.z = R.z,
  53967. I = R.size * R.scale / m.w,
  53968. E.x = I * A,
  53969. E.y = I,
  53970. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  53971. p.uniform2f(c.scale, E.x, E.y),
  53972. p.uniform1f(c.rotation, R.rotation),
  53973. p.uniform1f(c.opacity, R.opacity),
  53974. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  53975. f.setBlending(R.blending, R.blendEquation, R.blendSrc, R.blendDst),
  53976. e.setTexture(R.texture, 1),
  53977. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0))
  53978. }
  53979. }
  53980. }
  53981. f.enable(p.CULL_FACE),
  53982. f.enable(p.DEPTH_TEST),
  53983. f.setDepthWrite(!0),
  53984. e.resetGLState()
  53985. }
  53986. }
  53987. }
  53988. ,
  53989. n.SpritePlugin = function(e, t) {
  53990. function i() {
  53991. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  53992. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  53993. a = d.createBuffer(),
  53994. s = d.createBuffer(),
  53995. d.bindBuffer(d.ARRAY_BUFFER, a),
  53996. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  53997. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  53998. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  53999. l = r(),
  54000. c = {
  54001. position: d.getAttribLocation(l, "position"),
  54002. uv: d.getAttribLocation(l, "uv")
  54003. },
  54004. h = {
  54005. uvOffset: d.getUniformLocation(l, "uvOffset"),
  54006. uvScale: d.getUniformLocation(l, "uvScale"),
  54007. rotation: d.getUniformLocation(l, "rotation"),
  54008. scale: d.getUniformLocation(l, "scale"),
  54009. color: d.getUniformLocation(l, "color"),
  54010. map: d.getUniformLocation(l, "map"),
  54011. opacity: d.getUniformLocation(l, "opacity"),
  54012. modelViewMatrix: d.getUniformLocation(l, "modelViewMatrix"),
  54013. projectionMatrix: d.getUniformLocation(l, "projectionMatrix"),
  54014. fogType: d.getUniformLocation(l, "fogType"),
  54015. fogDensity: d.getUniformLocation(l, "fogDensity"),
  54016. fogNear: d.getUniformLocation(l, "fogNear"),
  54017. fogFar: d.getUniformLocation(l, "fogFar"),
  54018. fogColor: d.getUniformLocation(l, "fogColor"),
  54019. alphaTest: d.getUniformLocation(l, "alphaTest")
  54020. };
  54021. var i = document.createElement("canvas");
  54022. i.width = 8,
  54023. i.height = 8;
  54024. var o = i.getContext("2d");
  54025. o.fillStyle = "white",
  54026. o.fillRect(0, 0, 8, 8),
  54027. u = new n.Texture(i),
  54028. u.needsUpdate = !0
  54029. }
  54030. function r() {
  54031. var t = d.createProgram()
  54032. , i = d.createShader(d.VERTEX_SHADER)
  54033. , n = d.createShader(d.FRAGMENT_SHADER);
  54034. return d.shaderSource(i, ["precision " + e.getPrecision() + " float;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform float rotation;", "uniform vec2 scale;", "uniform vec2 uvOffset;", "uniform vec2 uvScale;", "attribute vec2 position;", "attribute vec2 uv;", "varying vec2 vUV;", "void main() {", "vUV = uvOffset + uv * uvScale;", "vec2 alignedPosition = position * scale;", "vec2 rotatedPosition;", "rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;", "rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;", "vec4 finalPosition;", "finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );", "finalPosition.xy += rotatedPosition;", "finalPosition = projectionMatrix * finalPosition;", "gl_Position = finalPosition;", "}"].join("\n")),
  54035. d.shaderSource(n, ["precision " + e.getPrecision() + " float;", "uniform vec3 color;", "uniform sampler2D map;", "uniform float opacity;", "uniform int fogType;", "uniform vec3 fogColor;", "uniform float fogDensity;", "uniform float fogNear;", "uniform float fogFar;", "uniform float alphaTest;", "varying vec2 vUV;", "void main() {", "vec4 texture = texture2D( map, vUV );", "if ( texture.a < alphaTest ) discard;", "gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );", "if ( fogType > 0 ) {", "float depth = gl_FragCoord.z / gl_FragCoord.w;", "float fogFactor = 0.0;", "if ( fogType == 1 ) {", "fogFactor = smoothstep( fogNear, fogFar, depth );", "} else {", "const float LOG2 = 1.442695;", "fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );", "fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );", "}", "gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );", "}", "}"].join("\n")),
  54036. d.compileShader(i),
  54037. d.compileShader(n),
  54038. d.attachShader(t, i),
  54039. d.attachShader(t, n),
  54040. d.linkProgram(t),
  54041. t
  54042. }
  54043. function o(e, t) {
  54044. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  54045. }
  54046. var a, s, l, c, h, u, d = e.context, p = e.state, f = new n.Vector3, g = new n.Quaternion, m = new n.Vector3;
  54047. this.render = function(r, v) {
  54048. if (0 !== t.length) {
  54049. void 0 === l && i(),
  54050. d.useProgram(l),
  54051. p.initAttributes(),
  54052. p.enableAttribute(c.position),
  54053. p.enableAttribute(c.uv),
  54054. p.disableUnusedAttributes(),
  54055. p.disable(d.CULL_FACE),
  54056. p.enable(d.BLEND),
  54057. d.bindBuffer(d.ARRAY_BUFFER, a),
  54058. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  54059. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  54060. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  54061. d.uniformMatrix4fv(h.projectionMatrix, !1, v.projectionMatrix.elements),
  54062. p.activeTexture(d.TEXTURE0),
  54063. d.uniform1i(h.map, 0);
  54064. var A = 0
  54065. , y = 0
  54066. , C = r.fog;
  54067. C ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  54068. C instanceof n.Fog ? (d.uniform1f(h.fogNear, C.near),
  54069. d.uniform1f(h.fogFar, C.far),
  54070. d.uniform1i(h.fogType, 1),
  54071. A = 1,
  54072. y = 1) : C instanceof n.FogExp2 && (d.uniform1f(h.fogDensity, C.density),
  54073. d.uniform1i(h.fogType, 2),
  54074. A = 2,
  54075. y = 2)) : (d.uniform1i(h.fogType, 0),
  54076. A = 0,
  54077. y = 0);
  54078. for (var I = 0, E = t.length; I < E; I++) {
  54079. var b = t[I];
  54080. b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse, b.matrixWorld),
  54081. b.z = -b.modelViewMatrix.elements[14]
  54082. }
  54083. t.sort(o);
  54084. for (var w = [], I = 0, E = t.length; I < E; I++) {
  54085. var b = t[I]
  54086. , _ = b.material;
  54087. d.uniform1f(h.alphaTest, _.alphaTest),
  54088. d.uniformMatrix4fv(h.modelViewMatrix, !1, b.modelViewMatrix.elements),
  54089. b.matrixWorld.decompose(f, g, m),
  54090. w[0] = m.x,
  54091. w[1] = m.y;
  54092. var T = 0;
  54093. r.fog && _.fog && (T = y),
  54094. A !== T && (d.uniform1i(h.fogType, T),
  54095. A = T),
  54096. null !== _.map ? (d.uniform2f(h.uvOffset, _.map.offset.x, _.map.offset.y),
  54097. d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y)) : (d.uniform2f(h.uvOffset, 0, 0),
  54098. d.uniform2f(h.uvScale, 1, 1)),
  54099. d.uniform1f(h.opacity, _.opacity),
  54100. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  54101. d.uniform1f(h.rotation, _.rotation),
  54102. d.uniform2fv(h.scale, w),
  54103. p.setBlending(_.blending, _.blendEquation, _.blendSrc, _.blendDst),
  54104. p.setDepthTest(_.depthTest),
  54105. p.setDepthWrite(_.depthWrite),
  54106. _.map && _.map.image && _.map.image.width ? e.setTexture(_.map, 0) : e.setTexture(u, 0),
  54107. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0)
  54108. }
  54109. p.enable(d.CULL_FACE),
  54110. e.resetGLState()
  54111. }
  54112. }
  54113. }
  54114. ,
  54115. Object.defineProperties(n.Box2.prototype, {
  54116. empty: {
  54117. value: function() {
  54118. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  54119. this.isEmpty()
  54120. }
  54121. },
  54122. isIntersectionBox: {
  54123. value: function(e) {
  54124. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54125. this.intersectsBox(e)
  54126. }
  54127. }
  54128. }),
  54129. Object.defineProperties(n.Box3.prototype, {
  54130. empty: {
  54131. value: function() {
  54132. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  54133. this.isEmpty()
  54134. }
  54135. },
  54136. isIntersectionBox: {
  54137. value: function(e) {
  54138. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54139. this.intersectsBox(e)
  54140. }
  54141. },
  54142. isIntersectionSphere: {
  54143. value: function(e) {
  54144. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  54145. this.intersectsSphere(e)
  54146. }
  54147. }
  54148. }),
  54149. Object.defineProperties(n.Matrix3.prototype, {
  54150. multiplyVector3: {
  54151. value: function(e) {
  54152. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  54153. e.applyMatrix3(this)
  54154. }
  54155. },
  54156. multiplyVector3Array: {
  54157. value: function(e) {
  54158. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  54159. this.applyToVector3Array(e)
  54160. }
  54161. }
  54162. }),
  54163. Object.defineProperties(n.Matrix4.prototype, {
  54164. extractPosition: {
  54165. value: function(e) {
  54166. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  54167. this.copyPosition(e)
  54168. }
  54169. },
  54170. setRotationFromQuaternion: {
  54171. value: function(e) {
  54172. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  54173. this.makeRotationFromQuaternion(e)
  54174. }
  54175. },
  54176. multiplyVector3: {
  54177. value: function(e) {
  54178. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  54179. e.applyProjection(this)
  54180. }
  54181. },
  54182. multiplyVector4: {
  54183. value: function(e) {
  54184. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  54185. e.applyMatrix4(this)
  54186. }
  54187. },
  54188. multiplyVector3Array: {
  54189. value: function(e) {
  54190. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  54191. this.applyToVector3Array(e)
  54192. }
  54193. },
  54194. rotateAxis: {
  54195. value: function(e) {
  54196. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  54197. e.transformDirection(this)
  54198. }
  54199. },
  54200. crossVector: {
  54201. value: function(e) {
  54202. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  54203. e.applyMatrix4(this)
  54204. }
  54205. },
  54206. translate: {
  54207. value: function(e) {
  54208. console.error("THREE.Matrix4: .translate() has been removed.")
  54209. }
  54210. },
  54211. rotateX: {
  54212. value: function(e) {
  54213. console.error("THREE.Matrix4: .rotateX() has been removed.")
  54214. }
  54215. },
  54216. rotateY: {
  54217. value: function(e) {
  54218. console.error("THREE.Matrix4: .rotateY() has been removed.")
  54219. }
  54220. },
  54221. rotateZ: {
  54222. value: function(e) {
  54223. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  54224. }
  54225. },
  54226. rotateByAxis: {
  54227. value: function(e, t) {
  54228. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  54229. }
  54230. }
  54231. }),
  54232. Object.defineProperties(n.Plane.prototype, {
  54233. isIntersectionLine: {
  54234. value: function(e) {
  54235. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  54236. this.intersectsLine(e)
  54237. }
  54238. }
  54239. }),
  54240. Object.defineProperties(n.Quaternion.prototype, {
  54241. multiplyVector3: {
  54242. value: function(e) {
  54243. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  54244. e.applyQuaternion(this)
  54245. }
  54246. }
  54247. }),
  54248. Object.defineProperties(n.Ray.prototype, {
  54249. isIntersectionBox: {
  54250. value: function(e) {
  54251. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54252. this.intersectsBox(e)
  54253. }
  54254. },
  54255. isIntersectionPlane: {
  54256. value: function(e) {
  54257. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  54258. this.intersectsPlane(e)
  54259. }
  54260. },
  54261. isIntersectionSphere: {
  54262. value: function(e) {
  54263. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  54264. this.intersectsSphere(e)
  54265. }
  54266. }
  54267. }),
  54268. Object.defineProperties(n.Vector3.prototype, {
  54269. setEulerFromRotationMatrix: {
  54270. value: function() {
  54271. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  54272. }
  54273. },
  54274. setEulerFromQuaternion: {
  54275. value: function() {
  54276. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  54277. }
  54278. },
  54279. getPositionFromMatrix: {
  54280. value: function(e) {
  54281. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  54282. this.setFromMatrixPosition(e)
  54283. }
  54284. },
  54285. getScaleFromMatrix: {
  54286. value: function(e) {
  54287. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  54288. this.setFromMatrixScale(e)
  54289. }
  54290. },
  54291. getColumnFromMatrix: {
  54292. value: function(e, t) {
  54293. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  54294. this.setFromMatrixColumn(e, t)
  54295. }
  54296. }
  54297. }),
  54298. n.Face4 = function(e, t, i, r, o, a, s) {
  54299. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  54300. new n.Face3(e,t,i,o,a,s)
  54301. }
  54302. ,
  54303. n.Vertex = function(e, t, i) {
  54304. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  54305. new n.Vector3(e,t,i)
  54306. }
  54307. ,
  54308. Object.defineProperties(n.Object3D.prototype, {
  54309. eulerOrder: {
  54310. get: function() {
  54311. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  54312. this.rotation.order
  54313. },
  54314. set: function(e) {
  54315. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  54316. this.rotation.order = e
  54317. }
  54318. },
  54319. getChildByName: {
  54320. value: function(e) {
  54321. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  54322. this.getObjectByName(e)
  54323. }
  54324. },
  54325. renderDepth: {
  54326. set: function(e) {
  54327. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  54328. }
  54329. },
  54330. translate: {
  54331. value: function(e, t) {
  54332. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  54333. this.translateOnAxis(t, e)
  54334. }
  54335. },
  54336. useQuaternion: {
  54337. get: function() {
  54338. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  54339. },
  54340. set: function(e) {
  54341. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  54342. }
  54343. }
  54344. }),
  54345. Object.defineProperties(n, {
  54346. PointCloud: {
  54347. value: function(e, t) {
  54348. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  54349. new n.Points(e,t)
  54350. }
  54351. },
  54352. ParticleSystem: {
  54353. value: function(e, t) {
  54354. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  54355. new n.Points(e,t)
  54356. }
  54357. }
  54358. }),
  54359. Object.defineProperties(n.Light.prototype, {
  54360. onlyShadow: {
  54361. set: function(e) {
  54362. console.warn("THREE.Light: .onlyShadow has been removed.")
  54363. }
  54364. },
  54365. shadowCameraFov: {
  54366. set: function(e) {
  54367. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  54368. this.shadow.camera.fov = e
  54369. }
  54370. },
  54371. shadowCameraLeft: {
  54372. set: function(e) {
  54373. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  54374. this.shadow.camera.left = e
  54375. }
  54376. },
  54377. shadowCameraRight: {
  54378. set: function(e) {
  54379. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  54380. this.shadow.camera.right = e
  54381. }
  54382. },
  54383. shadowCameraTop: {
  54384. set: function(e) {
  54385. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  54386. this.shadow.camera.top = e
  54387. }
  54388. },
  54389. shadowCameraBottom: {
  54390. set: function(e) {
  54391. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  54392. this.shadow.camera.bottom = e
  54393. }
  54394. },
  54395. shadowCameraNear: {
  54396. set: function(e) {
  54397. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  54398. this.shadow.camera.near = e
  54399. }
  54400. },
  54401. shadowCameraFar: {
  54402. set: function(e) {
  54403. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  54404. this.shadow.camera.far = e
  54405. }
  54406. },
  54407. shadowCameraVisible: {
  54408. set: function(e) {
  54409. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  54410. }
  54411. },
  54412. shadowBias: {
  54413. set: function(e) {
  54414. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  54415. this.shadow.bias = e
  54416. }
  54417. },
  54418. shadowDarkness: {
  54419. set: function(e) {
  54420. console.warn("THREE.Light: .shadowDarkness has been removed.")
  54421. }
  54422. },
  54423. shadowMapWidth: {
  54424. set: function(e) {
  54425. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  54426. this.shadow.mapSize.width = e
  54427. }
  54428. },
  54429. shadowMapHeight: {
  54430. set: function(e) {
  54431. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  54432. this.shadow.mapSize.height = e
  54433. }
  54434. }
  54435. }),
  54436. Object.defineProperties(n.BufferAttribute.prototype, {
  54437. length: {
  54438. get: function() {
  54439. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  54440. this.array.length
  54441. }
  54442. }
  54443. }),
  54444. Object.defineProperties(n.BufferGeometry.prototype, {
  54445. drawcalls: {
  54446. get: function() {
  54447. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  54448. this.groups
  54449. }
  54450. },
  54451. offsets: {
  54452. get: function() {
  54453. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  54454. this.groups
  54455. }
  54456. },
  54457. addIndex: {
  54458. value: function(e) {
  54459. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  54460. this.setIndex(e)
  54461. }
  54462. },
  54463. addDrawCall: {
  54464. value: function(e, t, i) {
  54465. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  54466. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  54467. this.addGroup(e, t)
  54468. }
  54469. },
  54470. clearDrawCalls: {
  54471. value: function() {
  54472. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  54473. this.clearGroups()
  54474. }
  54475. },
  54476. computeTangents: {
  54477. value: function() {
  54478. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  54479. }
  54480. },
  54481. computeOffsets: {
  54482. value: function() {
  54483. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  54484. }
  54485. }
  54486. }),
  54487. Object.defineProperties(n.Material.prototype, {
  54488. wrapAround: {
  54489. get: function() {
  54490. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  54491. },
  54492. set: function(e) {
  54493. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  54494. }
  54495. },
  54496. wrapRGB: {
  54497. get: function() {
  54498. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  54499. new n.Color
  54500. }
  54501. }
  54502. }),
  54503. Object.defineProperties(n, {
  54504. PointCloudMaterial: {
  54505. value: function(e) {
  54506. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  54507. new n.PointsMaterial(e)
  54508. }
  54509. },
  54510. ParticleBasicMaterial: {
  54511. value: function(e) {
  54512. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  54513. new n.PointsMaterial(e)
  54514. }
  54515. },
  54516. ParticleSystemMaterial: {
  54517. value: function(e) {
  54518. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  54519. new n.PointsMaterial(e)
  54520. }
  54521. }
  54522. }),
  54523. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  54524. metal: {
  54525. get: function() {
  54526. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  54527. !1
  54528. },
  54529. set: function(e) {
  54530. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  54531. }
  54532. }
  54533. }),
  54534. Object.defineProperties(n.ShaderMaterial.prototype, {
  54535. derivatives: {
  54536. get: function() {
  54537. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  54538. this.extensions.derivatives
  54539. },
  54540. set: function(e) {
  54541. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  54542. this.extensions.derivatives = e
  54543. }
  54544. }
  54545. }),
  54546. Object.defineProperties(n.WebGLRenderer.prototype, {
  54547. supportsFloatTextures: {
  54548. value: function() {
  54549. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  54550. this.extensions.get("OES_texture_float")
  54551. }
  54552. },
  54553. supportsHalfFloatTextures: {
  54554. value: function() {
  54555. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  54556. this.extensions.get("OES_texture_half_float")
  54557. }
  54558. },
  54559. supportsStandardDerivatives: {
  54560. value: function() {
  54561. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  54562. this.extensions.get("OES_standard_derivatives")
  54563. }
  54564. },
  54565. supportsCompressedTextureS3TC: {
  54566. value: function() {
  54567. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  54568. this.extensions.get("WEBGL_compressed_texture_s3tc")
  54569. }
  54570. },
  54571. supportsCompressedTexturePVRTC: {
  54572. value: function() {
  54573. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  54574. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  54575. }
  54576. },
  54577. supportsBlendMinMax: {
  54578. value: function() {
  54579. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  54580. this.extensions.get("EXT_blend_minmax")
  54581. }
  54582. },
  54583. supportsVertexTextures: {
  54584. value: function() {
  54585. return this.capabilities.vertexTextures
  54586. }
  54587. },
  54588. supportsInstancedArrays: {
  54589. value: function() {
  54590. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  54591. this.extensions.get("ANGLE_instanced_arrays")
  54592. }
  54593. },
  54594. enableScissorTest: {
  54595. value: function(e) {
  54596. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  54597. this.setScissorTest(e)
  54598. }
  54599. },
  54600. initMaterial: {
  54601. value: function() {
  54602. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  54603. }
  54604. },
  54605. addPrePlugin: {
  54606. value: function() {
  54607. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  54608. }
  54609. },
  54610. addPostPlugin: {
  54611. value: function() {
  54612. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  54613. }
  54614. },
  54615. updateShadowMap: {
  54616. value: function() {
  54617. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  54618. }
  54619. },
  54620. shadowMapEnabled: {
  54621. get: function() {
  54622. return this.shadowMap.enabled
  54623. },
  54624. set: function(e) {
  54625. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  54626. this.shadowMap.enabled = e
  54627. }
  54628. },
  54629. shadowMapType: {
  54630. get: function() {
  54631. return this.shadowMap.type
  54632. },
  54633. set: function(e) {
  54634. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  54635. this.shadowMap.type = e
  54636. }
  54637. },
  54638. shadowMapCullFace: {
  54639. get: function() {
  54640. return this.shadowMap.cullFace
  54641. },
  54642. set: function(e) {
  54643. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  54644. this.shadowMap.cullFace = e
  54645. }
  54646. }
  54647. }),
  54648. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  54649. wrapS: {
  54650. get: function() {
  54651. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  54652. this.texture.wrapS
  54653. },
  54654. set: function(e) {
  54655. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  54656. this.texture.wrapS = e
  54657. }
  54658. },
  54659. wrapT: {
  54660. get: function() {
  54661. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  54662. this.texture.wrapT
  54663. },
  54664. set: function(e) {
  54665. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  54666. this.texture.wrapT = e
  54667. }
  54668. },
  54669. magFilter: {
  54670. get: function() {
  54671. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  54672. this.texture.magFilter
  54673. },
  54674. set: function(e) {
  54675. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  54676. this.texture.magFilter = e
  54677. }
  54678. },
  54679. minFilter: {
  54680. get: function() {
  54681. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  54682. this.texture.minFilter
  54683. },
  54684. set: function(e) {
  54685. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  54686. this.texture.minFilter = e
  54687. }
  54688. },
  54689. anisotropy: {
  54690. get: function() {
  54691. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  54692. this.texture.anisotropy
  54693. },
  54694. set: function(e) {
  54695. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  54696. this.texture.anisotropy = e
  54697. }
  54698. },
  54699. offset: {
  54700. get: function() {
  54701. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  54702. this.texture.offset
  54703. },
  54704. set: function(e) {
  54705. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  54706. this.texture.offset = e
  54707. }
  54708. },
  54709. repeat: {
  54710. get: function() {
  54711. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  54712. this.texture.repeat
  54713. },
  54714. set: function(e) {
  54715. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  54716. this.texture.repeat = e
  54717. }
  54718. },
  54719. format: {
  54720. get: function() {
  54721. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  54722. this.texture.format
  54723. },
  54724. set: function(e) {
  54725. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  54726. this.texture.format = e
  54727. }
  54728. },
  54729. type: {
  54730. get: function() {
  54731. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  54732. this.texture.type
  54733. },
  54734. set: function(e) {
  54735. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  54736. this.texture.type = e
  54737. }
  54738. },
  54739. generateMipmaps: {
  54740. get: function() {
  54741. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  54742. this.texture.generateMipmaps
  54743. },
  54744. set: function(e) {
  54745. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  54746. this.texture.generateMipmaps = e
  54747. }
  54748. }
  54749. }),
  54750. n.GeometryUtils = {
  54751. merge: function(e, t, i) {
  54752. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");
  54753. var r;
  54754. t instanceof n.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  54755. r = t.matrix,
  54756. t = t.geometry),
  54757. e.merge(t, r, i)
  54758. },
  54759. center: function(e) {
  54760. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  54761. e.center()
  54762. }
  54763. },
  54764. n.ImageUtils = {
  54765. crossOrigin: void 0,
  54766. loadTexture: function(e, t, i, r) {
  54767. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  54768. var o = new n.TextureLoader;
  54769. o.setCrossOrigin(this.crossOrigin);
  54770. var a = o.load(e, i, void 0, r);
  54771. return t && (a.mapping = t),
  54772. a
  54773. },
  54774. loadTextureCube: function(e, t, i, r) {
  54775. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  54776. var o = new n.CubeTextureLoader;
  54777. o.setCrossOrigin(this.crossOrigin);
  54778. var a = o.load(e, i, void 0, r);
  54779. return t && (a.mapping = t),
  54780. a
  54781. },
  54782. loadCompressedTexture: function() {
  54783. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  54784. },
  54785. loadCompressedTextureCube: function() {
  54786. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  54787. }
  54788. },
  54789. n.Projector = function() {
  54790. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  54791. this.projectVector = function(e, t) {
  54792. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  54793. e.project(t)
  54794. }
  54795. ,
  54796. this.unprojectVector = function(e, t) {
  54797. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  54798. e.unproject(t)
  54799. }
  54800. ,
  54801. this.pickingRay = function(e, t) {
  54802. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  54803. }
  54804. }
  54805. ,
  54806. n.CanvasRenderer = function() {
  54807. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  54808. this.domElement = document.createElement("canvas"),
  54809. this.clear = function() {}
  54810. ,
  54811. this.render = function() {}
  54812. ,
  54813. this.setClearColor = function() {}
  54814. ,
  54815. this.setSize = function() {}
  54816. }
  54817. ,
  54818. n.MeshFaceMaterial = n.MultiMaterial,
  54819. n.CurveUtils = {
  54820. tangentQuadraticBezier: function(e, t, i, n) {
  54821. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  54822. },
  54823. tangentCubicBezier: function(e, t, i, n, r) {
  54824. 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
  54825. },
  54826. tangentSpline: function(e, t, i, n, r) {
  54827. var o = 6 * e * e - 6 * e
  54828. , a = 3 * e * e - 4 * e + 1
  54829. , s = -6 * e * e + 6 * e
  54830. , l = 3 * e * e - 2 * e;
  54831. return o + a + s + l
  54832. },
  54833. interpolate: function(e, t, i, n, r) {
  54834. var o = .5 * (i - e)
  54835. , a = .5 * (n - t)
  54836. , s = r * r
  54837. , l = r * s;
  54838. return (2 * t - 2 * i + o + a) * l + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  54839. }
  54840. },
  54841. n.SceneUtils = {
  54842. createMultiMaterialObject: function(e, t) {
  54843. for (var i = new n.Group, r = 0, o = t.length; r < o; r++)
  54844. i.add(new n.Mesh(e,t[r]));
  54845. return i
  54846. },
  54847. detach: function(e, t, i) {
  54848. e.applyMatrix(t.matrixWorld),
  54849. t.remove(e),
  54850. i.add(e)
  54851. },
  54852. attach: function(e, t, i) {
  54853. var r = new n.Matrix4;
  54854. r.getInverse(i.matrixWorld),
  54855. e.applyMatrix(r),
  54856. t.remove(e),
  54857. i.add(e)
  54858. }
  54859. },
  54860. n.ShapeUtils = {
  54861. area: function(e) {
  54862. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  54863. i += e[n].x * e[r].y - e[r].x * e[n].y;
  54864. return .5 * i
  54865. },
  54866. triangulate: function() {
  54867. function e(e, t, i, n, r, o) {
  54868. var a, s, l, c, h, u, d, p, f;
  54869. if (s = e[o[t]].x,
  54870. l = e[o[t]].y,
  54871. c = e[o[i]].x,
  54872. h = e[o[i]].y,
  54873. u = e[o[n]].x,
  54874. d = e[o[n]].y,
  54875. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  54876. return !1;
  54877. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M;
  54878. for (g = u - c,
  54879. m = d - h,
  54880. v = s - u,
  54881. A = l - d,
  54882. y = c - s,
  54883. C = h - l,
  54884. a = 0; a < r; a++)
  54885. if (p = e[o[a]].x,
  54886. f = e[o[a]].y,
  54887. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = p - s,
  54888. E = f - l,
  54889. b = p - c,
  54890. w = f - h,
  54891. _ = p - u,
  54892. T = f - d,
  54893. M = g * w - m * b,
  54894. x = y * E - C * I,
  54895. S = v * T - A * _,
  54896. M >= -Number.EPSILON && S >= -Number.EPSILON && x >= -Number.EPSILON))
  54897. return !1;
  54898. return !0
  54899. }
  54900. return function(t, i) {
  54901. var r = t.length;
  54902. if (r < 3)
  54903. return null;
  54904. var o, a, s, l = [], c = [], h = [];
  54905. if (n.ShapeUtils.area(t) > 0)
  54906. for (a = 0; a < r; a++)
  54907. c[a] = a;
  54908. else
  54909. for (a = 0; a < r; a++)
  54910. c[a] = r - 1 - a;
  54911. var u = r
  54912. , d = 2 * u;
  54913. for (a = u - 1; u > 2; ) {
  54914. if (d-- <= 0)
  54915. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  54916. i ? h : l;
  54917. if (o = a,
  54918. u <= o && (o = 0),
  54919. a = o + 1,
  54920. u <= a && (a = 0),
  54921. s = a + 1,
  54922. u <= s && (s = 0),
  54923. e(t, o, a, s, u, c)) {
  54924. var p, f, g, m, v;
  54925. for (p = c[o],
  54926. f = c[a],
  54927. g = c[s],
  54928. l.push([t[p], t[f], t[g]]),
  54929. h.push([c[o], c[a], c[s]]),
  54930. m = a,
  54931. v = a + 1; v < u; m++,
  54932. v++)
  54933. c[m] = c[v];
  54934. u--,
  54935. d = 2 * u
  54936. }
  54937. }
  54938. return i ? h : l
  54939. }
  54940. }(),
  54941. triangulateShape: function(e, t) {
  54942. function i(e, t, i) {
  54943. 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
  54944. }
  54945. function r(e, t, n, r, o) {
  54946. var a = t.x - e.x
  54947. , s = t.y - e.y
  54948. , l = r.x - n.x
  54949. , c = r.y - n.y
  54950. , h = e.x - n.x
  54951. , u = e.y - n.y
  54952. , d = s * l - a * c
  54953. , p = s * h - a * u;
  54954. if (Math.abs(d) > Number.EPSILON) {
  54955. var f;
  54956. if (d > 0) {
  54957. if (p < 0 || p > d)
  54958. return [];
  54959. if (f = c * h - l * u,
  54960. f < 0 || f > d)
  54961. return []
  54962. } else {
  54963. if (p > 0 || p < d)
  54964. return [];
  54965. if (f = c * h - l * u,
  54966. f > 0 || f < d)
  54967. return []
  54968. }
  54969. if (0 === f)
  54970. return !o || 0 !== p && p !== d ? [e] : [];
  54971. if (f === d)
  54972. return !o || 0 !== p && p !== d ? [t] : [];
  54973. if (0 === p)
  54974. return [n];
  54975. if (p === d)
  54976. return [r];
  54977. var g = f / d;
  54978. return [{
  54979. x: e.x + g * a,
  54980. y: e.y + g * s
  54981. }]
  54982. }
  54983. if (0 !== p || c * h !== l * u)
  54984. return [];
  54985. var m = 0 === a && 0 === s
  54986. , v = 0 === l && 0 === c;
  54987. if (m && v)
  54988. return e.x !== n.x || e.y !== n.y ? [] : [e];
  54989. if (m)
  54990. return i(n, r, e) ? [e] : [];
  54991. if (v)
  54992. return i(e, t, n) ? [n] : [];
  54993. var A, y, C, I, E, b, w, _;
  54994. return 0 !== a ? (e.x < t.x ? (A = e,
  54995. C = e.x,
  54996. y = t,
  54997. I = t.x) : (A = t,
  54998. C = t.x,
  54999. y = e,
  55000. I = e.x),
  55001. n.x < r.x ? (E = n,
  55002. w = n.x,
  55003. b = r,
  55004. _ = r.x) : (E = r,
  55005. w = r.x,
  55006. b = n,
  55007. _ = n.x)) : (e.y < t.y ? (A = e,
  55008. C = e.y,
  55009. y = t,
  55010. I = t.y) : (A = t,
  55011. C = t.y,
  55012. y = e,
  55013. I = e.y),
  55014. n.y < r.y ? (E = n,
  55015. w = n.y,
  55016. b = r,
  55017. _ = r.y) : (E = r,
  55018. w = r.y,
  55019. b = n,
  55020. _ = n.y)),
  55021. C <= w ? I < w ? [] : I === w ? o ? [] : [E] : I <= _ ? [E, y] : [E, b] : C > _ ? [] : C === _ ? o ? [] : [A] : I <= _ ? [A, y] : [A, b]
  55022. }
  55023. function o(e, t, i, n) {
  55024. var r = t.x - e.x
  55025. , o = t.y - e.y
  55026. , a = i.x - e.x
  55027. , s = i.y - e.y
  55028. , l = n.x - e.x
  55029. , c = n.y - e.y
  55030. , h = r * s - o * a
  55031. , u = r * c - o * l;
  55032. if (Math.abs(h) > Number.EPSILON) {
  55033. var d = l * s - c * a;
  55034. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0
  55035. }
  55036. return u > 0
  55037. }
  55038. function a(e, t) {
  55039. function i(e, t) {
  55040. var i = A.length - 1
  55041. , n = e - 1;
  55042. n < 0 && (n = i);
  55043. var r = e + 1;
  55044. r > i && (r = 0);
  55045. var a = o(A[e], A[n], A[r], s[t]);
  55046. if (!a)
  55047. return !1;
  55048. var l = s.length - 1
  55049. , c = t - 1;
  55050. c < 0 && (c = l);
  55051. var h = t + 1;
  55052. return h > l && (h = 0),
  55053. a = o(s[t], s[c], s[h], A[e]),
  55054. !!a
  55055. }
  55056. function n(e, t) {
  55057. var i, n, o;
  55058. for (i = 0; i < A.length; i++)
  55059. if (n = i + 1,
  55060. n %= A.length,
  55061. o = r(e, t, A[i], A[n], !0),
  55062. o.length > 0)
  55063. return !0;
  55064. return !1
  55065. }
  55066. function a(e, i) {
  55067. var n, o, a, s, l;
  55068. for (n = 0; n < y.length; n++)
  55069. for (o = t[y[n]],
  55070. a = 0; a < o.length; a++)
  55071. if (s = a + 1,
  55072. s %= o.length,
  55073. l = r(e, i, o[a], o[s], !0),
  55074. l.length > 0)
  55075. return !0;
  55076. return !1
  55077. }
  55078. for (var s, l, c, h, u, d, p, f, g, m, v, A = e.concat(), y = [], C = [], I = 0, E = t.length; I < E; I++)
  55079. y.push(I);
  55080. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  55081. if (w--,
  55082. w < 0) {
  55083. console.log("Infinite Loop! Holes left:" + y.length + ", Probably Hole outside Shape!");
  55084. break
  55085. }
  55086. for (c = b; c < A.length; c++) {
  55087. h = A[c],
  55088. l = -1;
  55089. for (var I = 0; I < y.length; I++)
  55090. if (d = y[I],
  55091. p = h.x + ":" + h.y + ":" + d,
  55092. void 0 === C[p]) {
  55093. s = t[d];
  55094. for (var _ = 0; _ < s.length; _++)
  55095. if (u = s[_],
  55096. i(c, _) && !n(h, u) && !a(h, u)) {
  55097. l = _,
  55098. y.splice(I, 1),
  55099. f = A.slice(0, c + 1),
  55100. g = A.slice(c),
  55101. m = s.slice(l),
  55102. v = s.slice(0, l + 1),
  55103. A = f.concat(m).concat(v).concat(g),
  55104. b = c;
  55105. break
  55106. }
  55107. if (l >= 0)
  55108. break;
  55109. C[p] = !0
  55110. }
  55111. if (l >= 0)
  55112. break
  55113. }
  55114. }
  55115. return A
  55116. }
  55117. for (var s, l, c, h, u, d, p = {}, f = e.concat(), g = 0, m = t.length; g < m; g++)
  55118. Array.prototype.push.apply(f, t[g]);
  55119. for (s = 0,
  55120. l = f.length; s < l; s++)
  55121. u = f[s].x + ":" + f[s].y,
  55122. void 0 !== p[u] && console.warn("THREE.Shape: Duplicate point", u),
  55123. p[u] = s;
  55124. var v = a(e, t)
  55125. , A = n.ShapeUtils.triangulate(v, !1);
  55126. for (s = 0,
  55127. l = A.length; s < l; s++)
  55128. for (h = A[s],
  55129. c = 0; c < 3; c++)
  55130. u = h[c].x + ":" + h[c].y,
  55131. d = p[u],
  55132. void 0 !== d && (h[c] = d);
  55133. return A.concat()
  55134. },
  55135. isClockWise: function(e) {
  55136. return n.ShapeUtils.area(e) < 0
  55137. },
  55138. b2: function() {
  55139. function e(e, t) {
  55140. var i = 1 - e;
  55141. return i * i * t
  55142. }
  55143. function t(e, t) {
  55144. return 2 * (1 - e) * e * t
  55145. }
  55146. function i(e, t) {
  55147. return e * e * t
  55148. }
  55149. return function(n, r, o, a) {
  55150. return e(n, r) + t(n, o) + i(n, a)
  55151. }
  55152. }(),
  55153. b3: function() {
  55154. function e(e, t) {
  55155. var i = 1 - e;
  55156. return i * i * i * t
  55157. }
  55158. function t(e, t) {
  55159. var i = 1 - e;
  55160. return 3 * i * i * e * t
  55161. }
  55162. function i(e, t) {
  55163. var i = 1 - e;
  55164. return 3 * i * e * e * t
  55165. }
  55166. function n(e, t) {
  55167. return e * e * e * t
  55168. }
  55169. return function(r, o, a, s, l) {
  55170. return e(r, o) + t(r, a) + i(r, s) + n(r, l)
  55171. }
  55172. }()
  55173. },
  55174. n.Curve = function() {}
  55175. ,
  55176. n.Curve.prototype = {
  55177. constructor: n.Curve,
  55178. getPoint: function(e) {
  55179. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  55180. null
  55181. },
  55182. getPointAt: function(e) {
  55183. var t = this.getUtoTmapping(e);
  55184. return this.getPoint(t)
  55185. },
  55186. getPoints: function(e) {
  55187. e || (e = 5);
  55188. var t, i = [];
  55189. for (t = 0; t <= e; t++)
  55190. i.push(this.getPoint(t / e));
  55191. return i
  55192. },
  55193. getSpacedPoints: function(e) {
  55194. e || (e = 5);
  55195. var t, i = [];
  55196. for (t = 0; t <= e; t++)
  55197. i.push(this.getPointAt(t / e));
  55198. return i
  55199. },
  55200. getLength: function() {
  55201. var e = this.getLengths();
  55202. return e[e.length - 1]
  55203. },
  55204. getLengths: function(e) {
  55205. if (e || (e = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  55206. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  55207. return this.cacheArcLengths;
  55208. this.needsUpdate = !1;
  55209. var t, i, n = [], r = this.getPoint(0), o = 0;
  55210. for (n.push(0),
  55211. i = 1; i <= e; i++)
  55212. t = this.getPoint(i / e),
  55213. o += t.distanceTo(r),
  55214. n.push(o),
  55215. r = t;
  55216. return this.cacheArcLengths = n,
  55217. n
  55218. },
  55219. updateArcLengths: function() {
  55220. this.needsUpdate = !0,
  55221. this.getLengths()
  55222. },
  55223. getUtoTmapping: function(e, t) {
  55224. var i, n = this.getLengths(), r = 0, o = n.length;
  55225. i = t ? t : e * n[o - 1];
  55226. for (var a, s = 0, l = o - 1; s <= l; )
  55227. if (r = Math.floor(s + (l - s) / 2),
  55228. a = n[r] - i,
  55229. a < 0)
  55230. s = r + 1;
  55231. else {
  55232. if (!(a > 0)) {
  55233. l = r;
  55234. break
  55235. }
  55236. l = r - 1
  55237. }
  55238. if (r = l,
  55239. n[r] === i) {
  55240. var c = r / (o - 1);
  55241. return c
  55242. }
  55243. var h = n[r]
  55244. , u = n[r + 1]
  55245. , d = u - h
  55246. , p = (i - h) / d
  55247. , c = (r + p) / (o - 1);
  55248. return c
  55249. },
  55250. getTangent: function(e) {
  55251. var t = 1e-4
  55252. , i = e - t
  55253. , n = e + t;
  55254. i < 0 && (i = 0),
  55255. n > 1 && (n = 1);
  55256. var r = this.getPoint(i)
  55257. , o = this.getPoint(n)
  55258. , a = o.clone().sub(r);
  55259. return a.normalize()
  55260. },
  55261. getTangentAt: function(e) {
  55262. var t = this.getUtoTmapping(e);
  55263. return this.getTangent(t)
  55264. }
  55265. },
  55266. n.Curve.create = function(e, t) {
  55267. return e.prototype = Object.create(n.Curve.prototype),
  55268. e.prototype.constructor = e,
  55269. e.prototype.getPoint = t,
  55270. e
  55271. }
  55272. ,
  55273. n.CurvePath = function() {
  55274. this.curves = [],
  55275. this.autoClose = !1
  55276. }
  55277. ,
  55278. n.CurvePath.prototype = Object.create(n.Curve.prototype),
  55279. n.CurvePath.prototype.constructor = n.CurvePath,
  55280. n.CurvePath.prototype.add = function(e) {
  55281. this.curves.push(e)
  55282. }
  55283. ,
  55284. n.CurvePath.prototype.closePath = function() {
  55285. var e = this.curves[0].getPoint(0)
  55286. , t = this.curves[this.curves.length - 1].getPoint(1);
  55287. e.equals(t) || this.curves.push(new n.LineCurve(t,e))
  55288. }
  55289. ,
  55290. n.CurvePath.prototype.getPoint = function(e) {
  55291. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  55292. if (i[n] >= t) {
  55293. var r = i[n] - t
  55294. , o = this.curves[n]
  55295. , a = 1 - r / o.getLength();
  55296. return o.getPointAt(a)
  55297. }
  55298. n++
  55299. }
  55300. return null
  55301. }
  55302. ,
  55303. n.CurvePath.prototype.getLength = function() {
  55304. var e = this.getCurveLengths();
  55305. return e[e.length - 1]
  55306. }
  55307. ,
  55308. n.CurvePath.prototype.getCurveLengths = function() {
  55309. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  55310. return this.cacheLengths;
  55311. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  55312. t += this.curves[i].getLength(),
  55313. e.push(t);
  55314. return this.cacheLengths = e,
  55315. e
  55316. }
  55317. ,
  55318. n.CurvePath.prototype.createPointsGeometry = function(e) {
  55319. var t = this.getPoints(e);
  55320. return this.createGeometry(t)
  55321. }
  55322. ,
  55323. n.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  55324. var t = this.getSpacedPoints(e);
  55325. return this.createGeometry(t)
  55326. }
  55327. ,
  55328. n.CurvePath.prototype.createGeometry = function(e) {
  55329. for (var t = new n.Geometry, i = 0, r = e.length; i < r; i++) {
  55330. var o = e[i];
  55331. t.vertices.push(new n.Vector3(o.x,o.y,o.z || 0))
  55332. }
  55333. return t
  55334. }
  55335. ,
  55336. n.Font = function(e) {
  55337. this.data = e
  55338. }
  55339. ,
  55340. n.Font.prototype = {
  55341. constructor: n.Font,
  55342. generateShapes: function(e, t, i) {
  55343. function r(e) {
  55344. for (var i = String(e).split(""), n = t / a.resolution, r = 0, s = [], l = 0; l < i.length; l++) {
  55345. var c = o(i[l], n, r);
  55346. r += c.offset,
  55347. s.push(c.path)
  55348. }
  55349. return s
  55350. }
  55351. function o(e, t, r) {
  55352. var o = a.glyphs[e] || a.glyphs["?"];
  55353. if (o) {
  55354. var s, l, c, h, u, d, p, f, g, m, v, A = new n.Path, y = [], C = n.ShapeUtils.b2, I = n.ShapeUtils.b3;
  55355. if (o.o)
  55356. for (var E = o._cachedOutline || (o._cachedOutline = o.o.split(" ")), b = 0, w = E.length; b < w; ) {
  55357. var _ = E[b++];
  55358. switch (_) {
  55359. case "m":
  55360. s = E[b++] * t + r,
  55361. l = E[b++] * t,
  55362. A.moveTo(s, l);
  55363. break;
  55364. case "l":
  55365. s = E[b++] * t + r,
  55366. l = E[b++] * t,
  55367. A.lineTo(s, l);
  55368. break;
  55369. case "q":
  55370. if (c = E[b++] * t + r,
  55371. h = E[b++] * t,
  55372. p = E[b++] * t + r,
  55373. f = E[b++] * t,
  55374. A.quadraticCurveTo(p, f, c, h),
  55375. v = y[y.length - 1]) {
  55376. u = v.x,
  55377. d = v.y;
  55378. for (var T = 1; T <= i; T++) {
  55379. var x = T / i;
  55380. C(x, u, p, c),
  55381. C(x, d, f, h)
  55382. }
  55383. }
  55384. break;
  55385. case "b":
  55386. if (c = E[b++] * t + r,
  55387. h = E[b++] * t,
  55388. p = E[b++] * t + r,
  55389. f = E[b++] * t,
  55390. g = E[b++] * t + r,
  55391. m = E[b++] * t,
  55392. A.bezierCurveTo(p, f, g, m, c, h),
  55393. v = y[y.length - 1]) {
  55394. u = v.x,
  55395. d = v.y;
  55396. for (var T = 1; T <= i; T++) {
  55397. var x = T / i;
  55398. I(x, u, p, g, c),
  55399. I(x, d, f, m, h)
  55400. }
  55401. }
  55402. }
  55403. }
  55404. return {
  55405. offset: o.ha * t,
  55406. path: A
  55407. }
  55408. }
  55409. }
  55410. void 0 === t && (t = 100),
  55411. void 0 === i && (i = 4);
  55412. for (var a = this.data, s = r(e), l = [], c = 0, h = s.length; c < h; c++)
  55413. Array.prototype.push.apply(l, s[c].toShapes());
  55414. return l
  55415. }
  55416. },
  55417. n.Path = function(e) {
  55418. n.CurvePath.call(this),
  55419. this.actions = [],
  55420. e && this.fromPoints(e)
  55421. }
  55422. ,
  55423. n.Path.prototype = Object.create(n.CurvePath.prototype),
  55424. n.Path.prototype.constructor = n.Path,
  55425. n.Path.prototype.fromPoints = function(e) {
  55426. this.moveTo(e[0].x, e[0].y);
  55427. for (var t = 1, i = e.length; t < i; t++)
  55428. this.lineTo(e[t].x, e[t].y)
  55429. }
  55430. ,
  55431. n.Path.prototype.moveTo = function(e, t) {
  55432. this.actions.push({
  55433. action: "moveTo",
  55434. args: [e, t]
  55435. })
  55436. }
  55437. ,
  55438. n.Path.prototype.lineTo = function(e, t) {
  55439. var i = this.actions[this.actions.length - 1].args
  55440. , r = i[i.length - 2]
  55441. , o = i[i.length - 1]
  55442. , a = new n.LineCurve(new n.Vector2(r,o),new n.Vector2(e,t));
  55443. this.curves.push(a),
  55444. this.actions.push({
  55445. action: "lineTo",
  55446. args: [e, t]
  55447. })
  55448. }
  55449. ,
  55450. n.Path.prototype.quadraticCurveTo = function(e, t, i, r) {
  55451. var o = this.actions[this.actions.length - 1].args
  55452. , a = o[o.length - 2]
  55453. , s = o[o.length - 1]
  55454. , l = new n.QuadraticBezierCurve(new n.Vector2(a,s),new n.Vector2(e,t),new n.Vector2(i,r));
  55455. this.curves.push(l),
  55456. this.actions.push({
  55457. action: "quadraticCurveTo",
  55458. args: [e, t, i, r]
  55459. })
  55460. }
  55461. ,
  55462. n.Path.prototype.bezierCurveTo = function(e, t, i, r, o, a) {
  55463. var s = this.actions[this.actions.length - 1].args
  55464. , l = s[s.length - 2]
  55465. , c = s[s.length - 1]
  55466. , h = new n.CubicBezierCurve(new n.Vector2(l,c),new n.Vector2(e,t),new n.Vector2(i,r),new n.Vector2(o,a));
  55467. this.curves.push(h),
  55468. this.actions.push({
  55469. action: "bezierCurveTo",
  55470. args: [e, t, i, r, o, a]
  55471. })
  55472. }
  55473. ,
  55474. n.Path.prototype.splineThru = function(e) {
  55475. var t = Array.prototype.slice.call(arguments)
  55476. , i = this.actions[this.actions.length - 1].args
  55477. , r = i[i.length - 2]
  55478. , o = i[i.length - 1]
  55479. , a = [new n.Vector2(r,o)];
  55480. Array.prototype.push.apply(a, e);
  55481. var s = new n.SplineCurve(a);
  55482. this.curves.push(s),
  55483. this.actions.push({
  55484. action: "splineThru",
  55485. args: t
  55486. })
  55487. }
  55488. ,
  55489. n.Path.prototype.arc = function(e, t, i, n, r, o) {
  55490. var a = this.actions[this.actions.length - 1].args
  55491. , s = a[a.length - 2]
  55492. , l = a[a.length - 1];
  55493. this.absarc(e + s, t + l, i, n, r, o)
  55494. }
  55495. ,
  55496. n.Path.prototype.absarc = function(e, t, i, n, r, o) {
  55497. this.absellipse(e, t, i, i, n, r, o)
  55498. }
  55499. ,
  55500. n.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  55501. var l = this.actions[this.actions.length - 1].args
  55502. , c = l[l.length - 2]
  55503. , h = l[l.length - 1];
  55504. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  55505. }
  55506. ,
  55507. n.Path.prototype.absellipse = function(e, t, i, r, o, a, s, l) {
  55508. var c = [e, t, i, r, o, a, s, l || 0]
  55509. , h = new n.EllipseCurve(e,t,i,r,o,a,s,l);
  55510. this.curves.push(h);
  55511. var u = h.getPoint(1);
  55512. c.push(u.x),
  55513. c.push(u.y),
  55514. this.actions.push({
  55515. action: "ellipse",
  55516. args: c
  55517. })
  55518. }
  55519. ,
  55520. n.Path.prototype.getSpacedPoints = function(e) {
  55521. e || (e = 40);
  55522. for (var t = [], i = 0; i < e; i++)
  55523. t.push(this.getPoint(i / e));
  55524. return this.autoClose && t.push(t[0]),
  55525. t
  55526. }
  55527. ,
  55528. n.Path.prototype.getPoints = function(e) {
  55529. e = e || 12;
  55530. for (var t, i, r, o, a, s, l, c, h, u, d, p = n.ShapeUtils.b2, f = n.ShapeUtils.b3, g = [], m = 0, v = this.actions.length; m < v; m++) {
  55531. var A = this.actions[m]
  55532. , y = A.action
  55533. , C = A.args;
  55534. switch (y) {
  55535. case "moveTo":
  55536. g.push(new n.Vector2(C[0],C[1]));
  55537. break;
  55538. case "lineTo":
  55539. g.push(new n.Vector2(C[0],C[1]));
  55540. break;
  55541. case "quadraticCurveTo":
  55542. t = C[2],
  55543. i = C[3],
  55544. a = C[0],
  55545. s = C[1],
  55546. g.length > 0 ? (h = g[g.length - 1],
  55547. l = h.x,
  55548. c = h.y) : (h = this.actions[m - 1].args,
  55549. l = h[h.length - 2],
  55550. c = h[h.length - 1]);
  55551. for (var I = 1; I <= e; I++) {
  55552. var E = I / e;
  55553. u = p(E, l, a, t),
  55554. d = p(E, c, s, i),
  55555. g.push(new n.Vector2(u,d))
  55556. }
  55557. break;
  55558. case "bezierCurveTo":
  55559. t = C[4],
  55560. i = C[5],
  55561. a = C[0],
  55562. s = C[1],
  55563. r = C[2],
  55564. o = C[3],
  55565. g.length > 0 ? (h = g[g.length - 1],
  55566. l = h.x,
  55567. c = h.y) : (h = this.actions[m - 1].args,
  55568. l = h[h.length - 2],
  55569. c = h[h.length - 1]);
  55570. for (var I = 1; I <= e; I++) {
  55571. var E = I / e;
  55572. u = f(E, l, a, r, t),
  55573. d = f(E, c, s, o, i),
  55574. g.push(new n.Vector2(u,d))
  55575. }
  55576. break;
  55577. case "splineThru":
  55578. h = this.actions[m - 1].args;
  55579. var b = new n.Vector2(h[h.length - 2],h[h.length - 1])
  55580. , w = [b]
  55581. , _ = e * C[0].length;
  55582. w = w.concat(C[0]);
  55583. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++)
  55584. g.push(T.getPointAt(I / _));
  55585. break;
  55586. case "arc":
  55587. for (var x, S = C[0], M = C[1], R = C[2], P = C[3], O = C[4], L = !!C[5], D = O - P, N = 2 * e, I = 1; I <= N; I++) {
  55588. var E = I / N;
  55589. L || (E = 1 - E),
  55590. x = P + E * D,
  55591. u = S + R * Math.cos(x),
  55592. d = M + R * Math.sin(x),
  55593. g.push(new n.Vector2(u,d))
  55594. }
  55595. break;
  55596. case "ellipse":
  55597. var x, B, F, S = C[0], M = C[1], V = C[2], U = C[3], P = C[4], O = C[5], L = !!C[6], k = C[7], D = O - P, N = 2 * e;
  55598. 0 !== k && (B = Math.cos(k),
  55599. F = Math.sin(k));
  55600. for (var I = 1; I <= N; I++) {
  55601. var E = I / N;
  55602. if (L || (E = 1 - E),
  55603. x = P + E * D,
  55604. u = S + V * Math.cos(x),
  55605. d = M + U * Math.sin(x),
  55606. 0 !== k) {
  55607. var H = u
  55608. , G = d;
  55609. u = (H - S) * B - (G - M) * F + S,
  55610. d = (H - S) * F + (G - M) * B + M
  55611. }
  55612. g.push(new n.Vector2(u,d))
  55613. }
  55614. }
  55615. }
  55616. var z = g[g.length - 1];
  55617. return Math.abs(z.x - g[0].x) < Number.EPSILON && Math.abs(z.y - g[0].y) < Number.EPSILON && g.splice(g.length - 1, 1),
  55618. this.autoClose && g.push(g[0]),
  55619. g
  55620. }
  55621. ,
  55622. n.Path.prototype.toShapes = function(e, t) {
  55623. function i(e) {
  55624. for (var t = [], i = new n.Path, r = 0, o = e.length; r < o; r++) {
  55625. var a = e[r]
  55626. , s = a.args
  55627. , l = a.action;
  55628. "moveTo" === l && 0 !== i.actions.length && (t.push(i),
  55629. i = new n.Path),
  55630. i[l].apply(i, s)
  55631. }
  55632. return 0 !== i.actions.length && t.push(i),
  55633. t
  55634. }
  55635. function r(e) {
  55636. for (var t = [], i = 0, r = e.length; i < r; i++) {
  55637. var o = e[i]
  55638. , a = new n.Shape;
  55639. a.actions = o.actions,
  55640. a.curves = o.curves,
  55641. t.push(a)
  55642. }
  55643. return t
  55644. }
  55645. function o(e, t) {
  55646. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  55647. var a = t[r]
  55648. , s = t[o]
  55649. , l = s.x - a.x
  55650. , c = s.y - a.y;
  55651. if (Math.abs(c) > Number.EPSILON) {
  55652. if (c < 0 && (a = t[o],
  55653. l = -l,
  55654. s = t[r],
  55655. c = -c),
  55656. e.y < a.y || e.y > s.y)
  55657. continue;
  55658. if (e.y === a.y) {
  55659. if (e.x === a.x)
  55660. return !0
  55661. } else {
  55662. var h = c * (e.x - a.x) - l * (e.y - a.y);
  55663. if (0 === h)
  55664. return !0;
  55665. if (h < 0)
  55666. continue;
  55667. n = !n
  55668. }
  55669. } else {
  55670. if (e.y !== a.y)
  55671. continue;
  55672. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  55673. return !0
  55674. }
  55675. }
  55676. return n
  55677. }
  55678. var a = n.ShapeUtils.isClockWise
  55679. , s = i(this.actions);
  55680. if (0 === s.length)
  55681. return [];
  55682. if (t === !0)
  55683. return r(s);
  55684. var l, c, h, u = [];
  55685. if (1 === s.length)
  55686. return c = s[0],
  55687. h = new n.Shape,
  55688. h.actions = c.actions,
  55689. h.curves = c.curves,
  55690. u.push(h),
  55691. u;
  55692. var d = !a(s[0].getPoints());
  55693. d = e ? !d : d;
  55694. var p, f = [], g = [], m = [], v = 0;
  55695. g[v] = void 0,
  55696. m[v] = [];
  55697. for (var A = 0, y = s.length; A < y; A++)
  55698. c = s[A],
  55699. p = c.getPoints(),
  55700. l = a(p),
  55701. l = e ? !l : l,
  55702. l ? (!d && g[v] && v++,
  55703. g[v] = {
  55704. s: new n.Shape,
  55705. p: p
  55706. },
  55707. g[v].s.actions = c.actions,
  55708. g[v].s.curves = c.curves,
  55709. d && v++,
  55710. m[v] = []) : m[v].push({
  55711. h: c,
  55712. p: p[0]
  55713. });
  55714. if (!g[0])
  55715. return r(s);
  55716. if (g.length > 1) {
  55717. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++)
  55718. f[E] = [];
  55719. for (var E = 0, b = g.length; E < b; E++)
  55720. for (var w = m[E], _ = 0; _ < w.length; _++) {
  55721. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  55722. o(T.p, g[S].p) && (E !== S && I.push({
  55723. froms: E,
  55724. tos: S,
  55725. hole: _
  55726. }),
  55727. x ? (x = !1,
  55728. f[S].push(T)) : C = !0);
  55729. x && f[E].push(T)
  55730. }
  55731. I.length > 0 && (C || (m = f))
  55732. }
  55733. for (var M, A = 0, R = g.length; A < R; A++) {
  55734. h = g[A].s,
  55735. u.push(h),
  55736. M = m[A];
  55737. for (var P = 0, O = M.length; P < O; P++)
  55738. h.holes.push(M[P].h)
  55739. }
  55740. return u
  55741. }
  55742. ,
  55743. n.Shape = function() {
  55744. n.Path.apply(this, arguments),
  55745. this.holes = []
  55746. }
  55747. ,
  55748. n.Shape.prototype = Object.create(n.Path.prototype),
  55749. n.Shape.prototype.constructor = n.Shape,
  55750. n.Shape.prototype.extrude = function(e) {
  55751. return new n.ExtrudeGeometry(this,e)
  55752. }
  55753. ,
  55754. n.Shape.prototype.makeGeometry = function(e) {
  55755. return new n.ShapeGeometry(this,e)
  55756. }
  55757. ,
  55758. n.Shape.prototype.getPointsHoles = function(e) {
  55759. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  55760. t[i] = this.holes[i].getPoints(e);
  55761. return t
  55762. }
  55763. ,
  55764. n.Shape.prototype.extractAllPoints = function(e) {
  55765. return {
  55766. shape: this.getPoints(e),
  55767. holes: this.getPointsHoles(e)
  55768. }
  55769. }
  55770. ,
  55771. n.Shape.prototype.extractPoints = function(e) {
  55772. return this.extractAllPoints(e)
  55773. }
  55774. ,
  55775. n.LineCurve = function(e, t) {
  55776. this.v1 = e,
  55777. this.v2 = t
  55778. }
  55779. ,
  55780. n.LineCurve.prototype = Object.create(n.Curve.prototype),
  55781. n.LineCurve.prototype.constructor = n.LineCurve,
  55782. n.LineCurve.prototype.getPoint = function(e) {
  55783. var t = this.v2.clone().sub(this.v1);
  55784. return t.multiplyScalar(e).add(this.v1),
  55785. t
  55786. }
  55787. ,
  55788. n.LineCurve.prototype.getPointAt = function(e) {
  55789. return this.getPoint(e)
  55790. }
  55791. ,
  55792. n.LineCurve.prototype.getTangent = function(e) {
  55793. var t = this.v2.clone().sub(this.v1);
  55794. return t.normalize()
  55795. }
  55796. ,
  55797. n.QuadraticBezierCurve = function(e, t, i) {
  55798. this.v0 = e,
  55799. this.v1 = t,
  55800. this.v2 = i
  55801. }
  55802. ,
  55803. n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype),
  55804. n.QuadraticBezierCurve.prototype.constructor = n.QuadraticBezierCurve,
  55805. n.QuadraticBezierCurve.prototype.getPoint = function(e) {
  55806. var t = n.ShapeUtils.b2;
  55807. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y))
  55808. }
  55809. ,
  55810. n.QuadraticBezierCurve.prototype.getTangent = function(e) {
  55811. var t = n.CurveUtils.tangentQuadraticBezier;
  55812. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y)).normalize()
  55813. }
  55814. ,
  55815. n.CubicBezierCurve = function(e, t, i, n) {
  55816. this.v0 = e,
  55817. this.v1 = t,
  55818. this.v2 = i,
  55819. this.v3 = n
  55820. }
  55821. ,
  55822. n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype),
  55823. n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve,
  55824. n.CubicBezierCurve.prototype.getPoint = function(e) {
  55825. var t = n.ShapeUtils.b3;
  55826. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y))
  55827. }
  55828. ,
  55829. n.CubicBezierCurve.prototype.getTangent = function(e) {
  55830. var t = n.CurveUtils.tangentCubicBezier;
  55831. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y)).normalize()
  55832. }
  55833. ,
  55834. n.SplineCurve = function(e) {
  55835. this.points = void 0 == e ? [] : e
  55836. }
  55837. ,
  55838. n.SplineCurve.prototype = Object.create(n.Curve.prototype),
  55839. n.SplineCurve.prototype.constructor = n.SplineCurve,
  55840. n.SplineCurve.prototype.getPoint = function(e) {
  55841. var t = this.points
  55842. , i = (t.length - 1) * e
  55843. , r = Math.floor(i)
  55844. , o = i - r
  55845. , a = t[0 === r ? r : r - 1]
  55846. , s = t[r]
  55847. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  55848. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  55849. , h = n.CurveUtils.interpolate;
  55850. return new n.Vector2(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o))
  55851. }
  55852. ,
  55853. n.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  55854. this.aX = e,
  55855. this.aY = t,
  55856. this.xRadius = i,
  55857. this.yRadius = n,
  55858. this.aStartAngle = r,
  55859. this.aEndAngle = o,
  55860. this.aClockwise = a,
  55861. this.aRotation = s || 0
  55862. }
  55863. ,
  55864. n.EllipseCurve.prototype = Object.create(n.Curve.prototype),
  55865. n.EllipseCurve.prototype.constructor = n.EllipseCurve,
  55866. n.EllipseCurve.prototype.getPoint = function(e) {
  55867. var t = this.aEndAngle - this.aStartAngle;
  55868. t < 0 && (t += 2 * Math.PI),
  55869. t > 2 * Math.PI && (t -= 2 * Math.PI);
  55870. var i;
  55871. i = this.aClockwise === !0 ? this.aEndAngle + (1 - e) * (2 * Math.PI - t) : this.aStartAngle + e * t;
  55872. var r = this.aX + this.xRadius * Math.cos(i)
  55873. , o = this.aY + this.yRadius * Math.sin(i);
  55874. if (0 !== this.aRotation) {
  55875. var a = Math.cos(this.aRotation)
  55876. , s = Math.sin(this.aRotation)
  55877. , l = r
  55878. , c = o;
  55879. r = (l - this.aX) * a - (c - this.aY) * s + this.aX,
  55880. o = (l - this.aX) * s + (c - this.aY) * a + this.aY
  55881. }
  55882. return new n.Vector2(r,o)
  55883. }
  55884. ,
  55885. n.ArcCurve = function(e, t, i, r, o, a) {
  55886. n.EllipseCurve.call(this, e, t, i, i, r, o, a)
  55887. }
  55888. ,
  55889. n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype),
  55890. n.ArcCurve.prototype.constructor = n.ArcCurve,
  55891. n.LineCurve3 = n.Curve.create(function(e, t) {
  55892. this.v1 = e,
  55893. this.v2 = t
  55894. }, function(e) {
  55895. var t = new n.Vector3;
  55896. return t.subVectors(this.v2, this.v1),
  55897. t.multiplyScalar(e),
  55898. t.add(this.v1),
  55899. t
  55900. }),
  55901. n.QuadraticBezierCurve3 = n.Curve.create(function(e, t, i) {
  55902. this.v0 = e,
  55903. this.v1 = t,
  55904. this.v2 = i
  55905. }, function(e) {
  55906. var t = n.ShapeUtils.b2;
  55907. return new n.Vector3(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y),t(e, this.v0.z, this.v1.z, this.v2.z))
  55908. }),
  55909. n.CubicBezierCurve3 = n.Curve.create(function(e, t, i, n) {
  55910. this.v0 = e,
  55911. this.v1 = t,
  55912. this.v2 = i,
  55913. this.v3 = n
  55914. }, function(e) {
  55915. var t = n.ShapeUtils.b3;
  55916. return new n.Vector3(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y),t(e, this.v0.z, this.v1.z, this.v2.z, this.v3.z))
  55917. }),
  55918. n.SplineCurve3 = n.Curve.create(function(e) {
  55919. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  55920. this.points = void 0 == e ? [] : e
  55921. }, function(e) {
  55922. var t = this.points
  55923. , i = (t.length - 1) * e
  55924. , r = Math.floor(i)
  55925. , o = i - r
  55926. , a = t[0 == r ? r : r - 1]
  55927. , s = t[r]
  55928. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  55929. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  55930. , h = n.CurveUtils.interpolate;
  55931. return new n.Vector3(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o),h(a.z, s.z, l.z, c.z, o))
  55932. }),
  55933. n.CatmullRomCurve3 = function() {
  55934. function e() {}
  55935. var t = new n.Vector3
  55936. , i = new e
  55937. , r = new e
  55938. , o = new e;
  55939. return e.prototype.init = function(e, t, i, n) {
  55940. this.c0 = e,
  55941. this.c1 = i,
  55942. this.c2 = -3 * e + 3 * t - 2 * i - n,
  55943. this.c3 = 2 * e - 2 * t + i + n
  55944. }
  55945. ,
  55946. e.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  55947. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  55948. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  55949. s *= o,
  55950. l *= o,
  55951. this.init(t, i, s, l)
  55952. }
  55953. ,
  55954. e.prototype.initCatmullRom = function(e, t, i, n, r) {
  55955. this.init(t, i, r * (i - e), r * (n - t))
  55956. }
  55957. ,
  55958. e.prototype.calc = function(e) {
  55959. var t = e * e
  55960. , i = t * e;
  55961. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  55962. }
  55963. ,
  55964. n.Curve.create(function(e) {
  55965. this.points = e || [],
  55966. this.closed = !1
  55967. }, function(e) {
  55968. var a, s, l, c, h = this.points;
  55969. c = h.length,
  55970. c < 2 && console.log("duh, you need at least 2 points"),
  55971. a = (c - (this.closed ? 0 : 1)) * e,
  55972. s = Math.floor(a),
  55973. l = a - s,
  55974. this.closed ? s += s > 0 ? 0 : (Math.floor(Math.abs(s) / h.length) + 1) * h.length : 0 === l && s === c - 1 && (s = c - 2,
  55975. l = 1);
  55976. var u, d, p, f;
  55977. if (this.closed || s > 0 ? u = h[(s - 1) % c] : (t.subVectors(h[0], h[1]).add(h[0]),
  55978. u = t),
  55979. d = h[s % c],
  55980. p = h[(s + 1) % c],
  55981. this.closed || s + 2 < c ? f = h[(s + 2) % c] : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]),
  55982. f = t),
  55983. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  55984. var g = "chordal" === this.type ? .5 : .25
  55985. , m = Math.pow(u.distanceToSquared(d), g)
  55986. , v = Math.pow(d.distanceToSquared(p), g)
  55987. , A = Math.pow(p.distanceToSquared(f), g);
  55988. v < 1e-4 && (v = 1),
  55989. m < 1e-4 && (m = v),
  55990. A < 1e-4 && (A = v),
  55991. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  55992. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  55993. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A)
  55994. } else if ("catmullrom" === this.type) {
  55995. var y = void 0 !== this.tension ? this.tension : .5;
  55996. i.initCatmullRom(u.x, d.x, p.x, f.x, y),
  55997. r.initCatmullRom(u.y, d.y, p.y, f.y, y),
  55998. o.initCatmullRom(u.z, d.z, p.z, f.z, y)
  55999. }
  56000. var C = new n.Vector3(i.calc(l),r.calc(l),o.calc(l));
  56001. return C
  56002. })
  56003. }(),
  56004. n.ClosedSplineCurve3 = function(e) {
  56005. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  56006. n.CatmullRomCurve3.call(this, e),
  56007. this.type = "catmullrom",
  56008. this.closed = !0
  56009. }
  56010. ,
  56011. n.ClosedSplineCurve3.prototype = Object.create(n.CatmullRomCurve3.prototype),
  56012. n.BoxGeometry = function(e, t, i, r, o, a) {
  56013. n.Geometry.call(this),
  56014. this.type = "BoxGeometry",
  56015. this.parameters = {
  56016. width: e,
  56017. height: t,
  56018. depth: i,
  56019. widthSegments: r,
  56020. heightSegments: o,
  56021. depthSegments: a
  56022. },
  56023. this.fromBufferGeometry(new n.BoxBufferGeometry(e,t,i,r,o,a)),
  56024. this.mergeVertices()
  56025. }
  56026. ,
  56027. n.BoxGeometry.prototype = Object.create(n.Geometry.prototype),
  56028. n.BoxGeometry.prototype.constructor = n.BoxGeometry,
  56029. n.CubeGeometry = n.BoxGeometry,
  56030. n.BoxBufferGeometry = function(e, t, i, r, o, a) {
  56031. function s(e, t, i) {
  56032. var n = 0;
  56033. return n += e * t * 2,
  56034. n += e * i * 2,
  56035. n += i * t * 2,
  56036. 4 * n
  56037. }
  56038. function l(e, t, i, r, o, a, s, l, h, u, I) {
  56039. for (var E = a / h, b = s / u, w = a / 2, _ = s / 2, T = l / 2, x = h + 1, S = u + 1, M = 0, R = 0, P = new n.Vector3, O = 0; O < S; O++)
  56040. for (var L = O * b - _, D = 0; D < x; D++) {
  56041. var N = D * E - w;
  56042. P[e] = N * r,
  56043. P[t] = L * o,
  56044. P[i] = T,
  56045. p[m] = P.x,
  56046. p[m + 1] = P.y,
  56047. p[m + 2] = P.z,
  56048. P[e] = 0,
  56049. P[t] = 0,
  56050. P[i] = l > 0 ? 1 : -1,
  56051. f[m] = P.x,
  56052. f[m + 1] = P.y,
  56053. f[m + 2] = P.z,
  56054. g[v] = D / h,
  56055. g[v + 1] = 1 - O / u,
  56056. m += 3,
  56057. v += 2,
  56058. M += 1
  56059. }
  56060. for (O = 0; O < u; O++)
  56061. for (D = 0; D < h; D++) {
  56062. var B = y + D + x * O
  56063. , F = y + D + x * (O + 1)
  56064. , V = y + (D + 1) + x * (O + 1)
  56065. , U = y + (D + 1) + x * O;
  56066. d[A] = B,
  56067. d[A + 1] = F,
  56068. d[A + 2] = U,
  56069. d[A + 3] = F,
  56070. d[A + 4] = V,
  56071. d[A + 5] = U,
  56072. A += 6,
  56073. R += 6
  56074. }
  56075. c.addGroup(C, R, I),
  56076. C += R,
  56077. y += M
  56078. }
  56079. n.BufferGeometry.call(this),
  56080. this.type = "BoxBufferGeometry",
  56081. this.parameters = {
  56082. width: e,
  56083. height: t,
  56084. depth: i,
  56085. widthSegments: r,
  56086. heightSegments: o,
  56087. depthSegments: a
  56088. };
  56089. var c = this;
  56090. r = Math.floor(r) || 1,
  56091. o = Math.floor(o) || 1,
  56092. a = Math.floor(a) || 1;
  56093. var h = s(r, o, a)
  56094. , u = h / 4 * 6
  56095. , d = new (u > 65535 ? Uint32Array : Uint16Array)(u)
  56096. , p = new Float32Array(3 * h)
  56097. , f = new Float32Array(3 * h)
  56098. , g = new Float32Array(2 * h)
  56099. , m = 0
  56100. , v = 0
  56101. , A = 0
  56102. , y = 0
  56103. , C = 0;
  56104. l("z", "y", "x", -1, -1, i, t, e, a, o, 0),
  56105. l("z", "y", "x", 1, -1, i, t, -e, a, o, 1),
  56106. l("x", "z", "y", 1, 1, e, i, t, r, a, 2),
  56107. l("x", "z", "y", 1, -1, e, i, -t, r, a, 3),
  56108. l("x", "y", "z", 1, -1, e, t, i, r, o, 4),
  56109. l("x", "y", "z", -1, -1, e, t, -i, r, o, 5),
  56110. this.setIndex(new n.BufferAttribute(d,1)),
  56111. this.addAttribute("position", new n.BufferAttribute(p,3)),
  56112. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  56113. this.addAttribute("uv", new n.BufferAttribute(g,2))
  56114. }
  56115. ,
  56116. n.BoxBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56117. n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry,
  56118. n.CircleGeometry = function(e, t, i, r) {
  56119. n.Geometry.call(this),
  56120. this.type = "CircleGeometry",
  56121. this.parameters = {
  56122. radius: e,
  56123. segments: t,
  56124. thetaStart: i,
  56125. thetaLength: r
  56126. },
  56127. this.fromBufferGeometry(new n.CircleBufferGeometry(e,t,i,r))
  56128. }
  56129. ,
  56130. n.CircleGeometry.prototype = Object.create(n.Geometry.prototype),
  56131. n.CircleGeometry.prototype.constructor = n.CircleGeometry,
  56132. n.CircleBufferGeometry = function(e, t, i, r) {
  56133. n.BufferGeometry.call(this),
  56134. this.type = "CircleBufferGeometry",
  56135. this.parameters = {
  56136. radius: e,
  56137. segments: t,
  56138. thetaStart: i,
  56139. thetaLength: r
  56140. },
  56141. e = e || 50,
  56142. t = void 0 !== t ? Math.max(3, t) : 8,
  56143. i = void 0 !== i ? i : 0,
  56144. r = void 0 !== r ? r : 2 * Math.PI;
  56145. var o = t + 2
  56146. , a = new Float32Array(3 * o)
  56147. , s = new Float32Array(3 * o)
  56148. , l = new Float32Array(2 * o);
  56149. s[2] = 1,
  56150. l[0] = .5,
  56151. l[1] = .5;
  56152. for (var c = 0, h = 3, u = 2; c <= t; c++,
  56153. h += 3,
  56154. u += 2) {
  56155. var d = i + c / t * r;
  56156. a[h] = e * Math.cos(d),
  56157. a[h + 1] = e * Math.sin(d),
  56158. s[h + 2] = 1,
  56159. l[u] = (a[h] / e + 1) / 2,
  56160. l[u + 1] = (a[h + 1] / e + 1) / 2
  56161. }
  56162. for (var p = [], h = 1; h <= t; h++)
  56163. p.push(h, h + 1, 0);
  56164. this.setIndex(new n.BufferAttribute(new Uint16Array(p),1)),
  56165. this.addAttribute("position", new n.BufferAttribute(a,3)),
  56166. this.addAttribute("normal", new n.BufferAttribute(s,3)),
  56167. this.addAttribute("uv", new n.BufferAttribute(l,2)),
  56168. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  56169. }
  56170. ,
  56171. n.CircleBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56172. n.CircleBufferGeometry.prototype.constructor = n.CircleBufferGeometry,
  56173. n.CylinderBufferGeometry = function(e, t, i, r, o, a, s, l) {
  56174. function c() {
  56175. var e = (r + 1) * (o + 1);
  56176. return a === !1 && (e += 2 * (r + 1) + 2 * r),
  56177. e
  56178. }
  56179. function h() {
  56180. var e = r * o * 2 * 3;
  56181. return a === !1 && (e += 2 * r * 3),
  56182. e
  56183. }
  56184. function u() {
  56185. var a, c, h = new n.Vector3, u = new n.Vector3, d = (t - e) / i;
  56186. for (c = 0; c <= o; c++) {
  56187. var p = []
  56188. , f = c / o
  56189. , b = f * (t - e) + e;
  56190. for (a = 0; a <= r; a++) {
  56191. var w = a / r;
  56192. u.x = b * Math.sin(w * l + s),
  56193. u.y = -f * i + E,
  56194. u.z = b * Math.cos(w * l + s),
  56195. m.setXYZ(y, u.x, u.y, u.z),
  56196. h.copy(u),
  56197. (0 === e && 0 === c || 0 === t && c === o) && (h.x = Math.sin(w * l + s),
  56198. h.z = Math.cos(w * l + s)),
  56199. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  56200. v.setXYZ(y, h.x, h.y, h.z),
  56201. A.setXY(y, w, 1 - f),
  56202. p.push(y),
  56203. y++
  56204. }
  56205. I.push(p)
  56206. }
  56207. for (a = 0; a < r; a++)
  56208. for (c = 0; c < o; c++) {
  56209. var _ = I[c][a]
  56210. , T = I[c + 1][a]
  56211. , x = I[c + 1][a + 1]
  56212. , S = I[c][a + 1];
  56213. g.setX(C, _),
  56214. C++,
  56215. g.setX(C, T),
  56216. C++,
  56217. g.setX(C, S),
  56218. C++,
  56219. g.setX(C, T),
  56220. C++,
  56221. g.setX(C, x),
  56222. C++,
  56223. g.setX(C, S),
  56224. C++
  56225. }
  56226. }
  56227. function d(i) {
  56228. var o, a, c, h = new n.Vector2, u = new n.Vector3, d = i === !0 ? e : t, p = i === !0 ? 1 : -1;
  56229. for (a = y,
  56230. o = 1; o <= r; o++)
  56231. m.setXYZ(y, 0, E * p, 0),
  56232. v.setXYZ(y, 0, p, 0),
  56233. i === !0 ? (h.x = o / r,
  56234. h.y = 0) : (h.x = (o - 1) / r,
  56235. h.y = 1),
  56236. A.setXY(y, h.x, h.y),
  56237. y++;
  56238. for (c = y,
  56239. o = 0; o <= r; o++) {
  56240. var f = o / r;
  56241. u.x = d * Math.sin(f * l + s),
  56242. u.y = E * p,
  56243. u.z = d * Math.cos(f * l + s),
  56244. m.setXYZ(y, u.x, u.y, u.z),
  56245. v.setXYZ(y, 0, p, 0),
  56246. A.setXY(y, f, i === !0 ? 1 : 0),
  56247. y++
  56248. }
  56249. for (o = 0; o < r; o++) {
  56250. var I = a + o
  56251. , b = c + o;
  56252. i === !0 ? (g.setX(C, b),
  56253. C++,
  56254. g.setX(C, b + 1),
  56255. C++,
  56256. g.setX(C, I),
  56257. C++) : (g.setX(C, b + 1),
  56258. C++,
  56259. g.setX(C, b),
  56260. C++,
  56261. g.setX(C, I),
  56262. C++)
  56263. }
  56264. }
  56265. n.BufferGeometry.call(this),
  56266. this.type = "CylinderBufferGeometry",
  56267. this.parameters = {
  56268. radiusTop: e,
  56269. radiusBottom: t,
  56270. height: i,
  56271. radialSegments: r,
  56272. heightSegments: o,
  56273. openEnded: a,
  56274. thetaStart: s,
  56275. thetaLength: l
  56276. },
  56277. e = void 0 !== e ? e : 20,
  56278. t = void 0 !== t ? t : 20,
  56279. i = void 0 !== i ? i : 100,
  56280. r = Math.floor(r) || 8,
  56281. o = Math.floor(o) || 1,
  56282. a = void 0 !== a && a,
  56283. s = void 0 !== s ? s : 0,
  56284. l = void 0 !== l ? l : 2 * Math.PI;
  56285. var p = c()
  56286. , f = h()
  56287. , g = new n.BufferAttribute(new (f > 65535 ? Uint32Array : Uint16Array)(f),1)
  56288. , m = new n.BufferAttribute(new Float32Array(3 * p),3)
  56289. , v = new n.BufferAttribute(new Float32Array(3 * p),3)
  56290. , A = new n.BufferAttribute(new Float32Array(2 * p),2)
  56291. , y = 0
  56292. , C = 0
  56293. , I = []
  56294. , E = i / 2;
  56295. u(),
  56296. a === !1 && (e > 0 && d(!0),
  56297. t > 0 && d(!1)),
  56298. this.setIndex(g),
  56299. this.addAttribute("position", m),
  56300. this.addAttribute("normal", v),
  56301. this.addAttribute("uv", A)
  56302. }
  56303. ,
  56304. n.CylinderBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56305. n.CylinderBufferGeometry.prototype.constructor = n.CylinderBufferGeometry,
  56306. n.CylinderGeometry = function(e, t, i, r, o, a, s, l) {
  56307. n.Geometry.call(this),
  56308. this.type = "CylinderGeometry",
  56309. this.parameters = {
  56310. radiusTop: e,
  56311. radiusBottom: t,
  56312. height: i,
  56313. radialSegments: r,
  56314. heightSegments: o,
  56315. openEnded: a,
  56316. thetaStart: s,
  56317. thetaLength: l
  56318. },
  56319. this.fromBufferGeometry(new n.CylinderBufferGeometry(e,t,i,r,o,a,s,l)),
  56320. this.mergeVertices()
  56321. }
  56322. ,
  56323. n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype),
  56324. n.CylinderGeometry.prototype.constructor = n.CylinderGeometry,
  56325. n.EdgesGeometry = function(e, t) {
  56326. function i(e, t) {
  56327. return e - t
  56328. }
  56329. n.BufferGeometry.call(this),
  56330. t = void 0 !== t ? t : 1;
  56331. var r, o = Math.cos(n.Math.degToRad(t)), a = [0, 0], s = {}, l = ["a", "b", "c"];
  56332. e instanceof n.BufferGeometry ? (r = new n.Geometry,
  56333. r.fromBufferGeometry(e)) : r = e.clone(),
  56334. r.mergeVertices(),
  56335. r.computeFaceNormals();
  56336. for (var c = r.vertices, h = r.faces, u = 0, d = h.length; u < d; u++)
  56337. for (var p = h[u], f = 0; f < 3; f++) {
  56338. a[0] = p[l[f]],
  56339. a[1] = p[l[(f + 1) % 3]],
  56340. a.sort(i);
  56341. var g = a.toString();
  56342. void 0 === s[g] ? s[g] = {
  56343. vert1: a[0],
  56344. vert2: a[1],
  56345. face1: u,
  56346. face2: void 0
  56347. } : s[g].face2 = u
  56348. }
  56349. var m = [];
  56350. for (var g in s) {
  56351. var v = s[g];
  56352. if (void 0 === v.face2 || h[v.face1].normal.dot(h[v.face2].normal) <= o) {
  56353. var A = c[v.vert1];
  56354. m.push(A.x),
  56355. m.push(A.y),
  56356. m.push(A.z),
  56357. A = c[v.vert2],
  56358. m.push(A.x),
  56359. m.push(A.y),
  56360. m.push(A.z)
  56361. }
  56362. }
  56363. this.addAttribute("position", new n.BufferAttribute(new Float32Array(m),3))
  56364. }
  56365. ,
  56366. n.EdgesGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56367. n.EdgesGeometry.prototype.constructor = n.EdgesGeometry,
  56368. n.ExtrudeGeometry = function(e, t) {
  56369. return "undefined" == typeof e ? void (e = []) : (n.Geometry.call(this),
  56370. this.type = "ExtrudeGeometry",
  56371. e = Array.isArray(e) ? e : [e],
  56372. this.addShapeList(e, t),
  56373. void this.computeFaceNormals())
  56374. }
  56375. ;
  56376. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype);
  56377. n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry,
  56378. n.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  56379. for (var i = e.length, n = 0; n < i; n++) {
  56380. var r = e[n];
  56381. this.addShape(r, t)
  56382. }
  56383. }
  56384. ,
  56385. n.ExtrudeGeometry.prototype.addShape = function(e, t) {
  56386. function i(e, t, i) {
  56387. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  56388. t.clone().multiplyScalar(i).add(e)
  56389. }
  56390. function r(e, t, i) {
  56391. var r, o, a = 1, s = e.x - t.x, l = e.y - t.y, c = i.x - e.x, h = i.y - e.y, u = s * s + l * l, d = s * h - l * c;
  56392. if (Math.abs(d) > Number.EPSILON) {
  56393. var p = Math.sqrt(u)
  56394. , f = Math.sqrt(c * c + h * h)
  56395. , g = t.x - l / p
  56396. , m = t.y + s / p
  56397. , v = i.x - h / f
  56398. , A = i.y + c / f
  56399. , y = ((v - g) * h - (A - m) * c) / (s * h - l * c);
  56400. r = g + s * y - e.x,
  56401. o = m + l * y - e.y;
  56402. var C = r * r + o * o;
  56403. if (C <= 2)
  56404. return new n.Vector2(r,o);
  56405. a = Math.sqrt(C / 2)
  56406. } else {
  56407. var I = !1;
  56408. s > Number.EPSILON ? c > Number.EPSILON && (I = !0) : s < -Number.EPSILON ? c < -Number.EPSILON && (I = !0) : Math.sign(l) === Math.sign(h) && (I = !0),
  56409. I ? (r = -l,
  56410. o = s,
  56411. a = Math.sqrt(u)) : (r = s,
  56412. o = l,
  56413. a = Math.sqrt(u / 2))
  56414. }
  56415. return new n.Vector2(r / a,o / a)
  56416. }
  56417. function o() {
  56418. if (C) {
  56419. var e = 0
  56420. , t = z * e;
  56421. for (Y = 0; Y < W; Y++)
  56422. G = N[Y],
  56423. c(G[2] + t, G[1] + t, G[0] + t);
  56424. for (e = E + 2 * y,
  56425. t = z * e,
  56426. Y = 0; Y < W; Y++)
  56427. G = N[Y],
  56428. c(G[0] + t, G[1] + t, G[2] + t)
  56429. } else {
  56430. for (Y = 0; Y < W; Y++)
  56431. G = N[Y],
  56432. c(G[2], G[1], G[0]);
  56433. for (Y = 0; Y < W; Y++)
  56434. G = N[Y],
  56435. c(G[0] + z * E, G[1] + z * E, G[2] + z * E)
  56436. }
  56437. }
  56438. function a() {
  56439. var e = 0;
  56440. for (s(B, e),
  56441. e += B.length,
  56442. x = 0,
  56443. S = L.length; x < S; x++)
  56444. T = L[x],
  56445. s(T, e),
  56446. e += T.length
  56447. }
  56448. function s(e, t) {
  56449. var i, n;
  56450. for (Y = e.length; --Y >= 0; ) {
  56451. i = Y,
  56452. n = Y - 1,
  56453. n < 0 && (n = e.length - 1);
  56454. var r = 0
  56455. , o = E + 2 * y;
  56456. for (r = 0; r < o; r++) {
  56457. var a = z * r
  56458. , s = z * (r + 1)
  56459. , l = t + i + a
  56460. , c = t + n + a
  56461. , u = t + n + s
  56462. , d = t + i + s;
  56463. h(l, c, u, d, e, r, o, i, n)
  56464. }
  56465. }
  56466. }
  56467. function l(e, t, i) {
  56468. M.vertices.push(new n.Vector3(e,t,i))
  56469. }
  56470. function c(e, t, i) {
  56471. e += R,
  56472. t += R,
  56473. i += R,
  56474. M.faces.push(new n.Face3(e,t,i,null,null,0));
  56475. var r = _.generateTopUV(M, e, t, i);
  56476. M.faceVertexUvs[0].push(r)
  56477. }
  56478. function h(e, t, i, r, o, a, s, l, c) {
  56479. e += R,
  56480. t += R,
  56481. i += R,
  56482. r += R,
  56483. M.faces.push(new n.Face3(e,t,r,null,null,1)),
  56484. M.faces.push(new n.Face3(t,i,r,null,null,1));
  56485. var h = _.generateSideWallUV(M, e, t, i, r);
  56486. M.faceVertexUvs[0].push([h[0], h[1], h[3]]),
  56487. M.faceVertexUvs[0].push([h[1], h[2], h[3]])
  56488. }
  56489. var u, d, p, f, g, m = void 0 !== t.amount ? t.amount : 100, v = void 0 !== t.bevelThickness ? t.bevelThickness : 6, A = void 0 !== t.bevelSize ? t.bevelSize : v - 2, y = void 0 !== t.bevelSegments ? t.bevelSegments : 3, C = void 0 === t.bevelEnabled || t.bevelEnabled, I = void 0 !== t.curveSegments ? t.curveSegments : 12, E = void 0 !== t.steps ? t.steps : 1, b = t.extrudePath, w = !1, _ = void 0 !== t.UVGenerator ? t.UVGenerator : n.ExtrudeGeometry.WorldUVGenerator;
  56490. b && (u = b.getSpacedPoints(E),
  56491. w = !0,
  56492. C = !1,
  56493. d = void 0 !== t.frames ? t.frames : new n.TubeGeometry.FrenetFrames(b,E,!1),
  56494. p = new n.Vector3,
  56495. f = new n.Vector3,
  56496. g = new n.Vector3),
  56497. C || (y = 0,
  56498. v = 0,
  56499. A = 0);
  56500. var T, x, S, M = this, R = this.vertices.length, P = e.extractPoints(I), O = P.shape, L = P.holes, D = !n.ShapeUtils.isClockWise(O);
  56501. if (D) {
  56502. for (O = O.reverse(),
  56503. x = 0,
  56504. S = L.length; x < S; x++)
  56505. T = L[x],
  56506. n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse());
  56507. D = !1
  56508. }
  56509. var N = n.ShapeUtils.triangulateShape(O, L)
  56510. , B = O;
  56511. for (x = 0,
  56512. S = L.length; x < S; x++)
  56513. T = L[x],
  56514. O = O.concat(T);
  56515. for (var F, V, U, k, H, G, z = O.length, W = N.length, j = [], Y = 0, X = B.length, Z = X - 1, q = Y + 1; Y < X; Y++,
  56516. Z++,
  56517. q++)
  56518. Z === X && (Z = 0),
  56519. q === X && (q = 0),
  56520. j[Y] = r(B[Y], B[Z], B[q]);
  56521. var K, Q = [], J = j.concat();
  56522. for (x = 0,
  56523. S = L.length; x < S; x++) {
  56524. for (T = L[x],
  56525. K = [],
  56526. Y = 0,
  56527. X = T.length,
  56528. Z = X - 1,
  56529. q = Y + 1; Y < X; Y++,
  56530. Z++,
  56531. q++)
  56532. Z === X && (Z = 0),
  56533. q === X && (q = 0),
  56534. K[Y] = r(T[Y], T[Z], T[q]);
  56535. Q.push(K),
  56536. J = J.concat(K)
  56537. }
  56538. for (F = 0; F < y; F++) {
  56539. for (U = F / y,
  56540. k = v * (1 - U),
  56541. V = A * Math.sin(U * Math.PI / 2),
  56542. Y = 0,
  56543. X = B.length; Y < X; Y++)
  56544. H = i(B[Y], j[Y], V),
  56545. l(H.x, H.y, -k);
  56546. for (x = 0,
  56547. S = L.length; x < S; x++)
  56548. for (T = L[x],
  56549. K = Q[x],
  56550. Y = 0,
  56551. X = T.length; Y < X; Y++)
  56552. H = i(T[Y], K[Y], V),
  56553. l(H.x, H.y, -k)
  56554. }
  56555. for (V = A,
  56556. Y = 0; Y < z; Y++)
  56557. H = C ? i(O[Y], J[Y], V) : O[Y],
  56558. w ? (f.copy(d.normals[0]).multiplyScalar(H.x),
  56559. p.copy(d.binormals[0]).multiplyScalar(H.y),
  56560. g.copy(u[0]).add(f).add(p),
  56561. l(g.x, g.y, g.z)) : l(H.x, H.y, 0);
  56562. var $;
  56563. for ($ = 1; $ <= E; $++)
  56564. for (Y = 0; Y < z; Y++)
  56565. H = C ? i(O[Y], J[Y], V) : O[Y],
  56566. w ? (f.copy(d.normals[$]).multiplyScalar(H.x),
  56567. p.copy(d.binormals[$]).multiplyScalar(H.y),
  56568. g.copy(u[$]).add(f).add(p),
  56569. l(g.x, g.y, g.z)) : l(H.x, H.y, m / E * $);
  56570. for (F = y - 1; F >= 0; F--) {
  56571. for (U = F / y,
  56572. k = v * (1 - U),
  56573. V = A * Math.sin(U * Math.PI / 2),
  56574. Y = 0,
  56575. X = B.length; Y < X; Y++)
  56576. H = i(B[Y], j[Y], V),
  56577. l(H.x, H.y, m + k);
  56578. for (x = 0,
  56579. S = L.length; x < S; x++)
  56580. for (T = L[x],
  56581. K = Q[x],
  56582. Y = 0,
  56583. X = T.length; Y < X; Y++)
  56584. H = i(T[Y], K[Y], V),
  56585. w ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k) : l(H.x, H.y, m + k)
  56586. }
  56587. o(),
  56588. a()
  56589. }
  56590. ,
  56591. n.ExtrudeGeometry.WorldUVGenerator = {
  56592. generateTopUV: function(e, t, i, r) {
  56593. var o = e.vertices
  56594. , a = o[t]
  56595. , s = o[i]
  56596. , l = o[r];
  56597. return [new n.Vector2(a.x,a.y), new n.Vector2(s.x,s.y), new n.Vector2(l.x,l.y)]
  56598. },
  56599. generateSideWallUV: function(e, t, i, r, o) {
  56600. var a = e.vertices
  56601. , s = a[t]
  56602. , l = a[i]
  56603. , c = a[r]
  56604. , h = a[o];
  56605. return Math.abs(s.y - l.y) < .01 ? [new n.Vector2(s.x,1 - s.z), new n.Vector2(l.x,1 - l.z), new n.Vector2(c.x,1 - c.z), new n.Vector2(h.x,1 - h.z)] : [new n.Vector2(s.y,1 - s.z), new n.Vector2(l.y,1 - l.z), new n.Vector2(c.y,1 - c.z), new n.Vector2(h.y,1 - h.z)]
  56606. }
  56607. },
  56608. n.ShapeGeometry = function(e, t) {
  56609. n.Geometry.call(this),
  56610. this.type = "ShapeGeometry",
  56611. Array.isArray(e) === !1 && (e = [e]),
  56612. this.addShapeList(e, t),
  56613. this.computeFaceNormals()
  56614. }
  56615. ,
  56616. n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype),
  56617. n.ShapeGeometry.prototype.constructor = n.ShapeGeometry,
  56618. n.ShapeGeometry.prototype.addShapeList = function(e, t) {
  56619. for (var i = 0, n = e.length; i < n; i++)
  56620. this.addShape(e[i], t);
  56621. return this
  56622. }
  56623. ,
  56624. n.ShapeGeometry.prototype.addShape = function(e, t) {
  56625. void 0 === t && (t = {});
  56626. var i, r, o, a = void 0 !== t.curveSegments ? t.curveSegments : 12, s = t.material, l = void 0 === t.UVGenerator ? n.ExtrudeGeometry.WorldUVGenerator : t.UVGenerator, c = this.vertices.length, h = e.extractPoints(a), u = h.shape, d = h.holes, p = !n.ShapeUtils.isClockWise(u);
  56627. if (p) {
  56628. for (u = u.reverse(),
  56629. i = 0,
  56630. r = d.length; i < r; i++)
  56631. o = d[i],
  56632. n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse());
  56633. p = !1
  56634. }
  56635. var f = n.ShapeUtils.triangulateShape(u, d);
  56636. for (i = 0,
  56637. r = d.length; i < r; i++)
  56638. o = d[i],
  56639. u = u.concat(o);
  56640. var g, m, v = u.length, A = f.length;
  56641. for (i = 0; i < v; i++)
  56642. g = u[i],
  56643. this.vertices.push(new n.Vector3(g.x,g.y,0));
  56644. for (i = 0; i < A; i++) {
  56645. m = f[i];
  56646. var y = m[0] + c
  56647. , C = m[1] + c
  56648. , I = m[2] + c;
  56649. this.faces.push(new n.Face3(y,C,I,null,null,s)),
  56650. this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I))
  56651. }
  56652. }
  56653. ,
  56654. n.LatheBufferGeometry = function(e, t, i, r) {
  56655. n.BufferGeometry.call(this),
  56656. this.type = "LatheBufferGeometry",
  56657. this.parameters = {
  56658. points: e,
  56659. segments: t,
  56660. phiStart: i,
  56661. phiLength: r
  56662. },
  56663. t = Math.floor(t) || 12,
  56664. i = i || 0,
  56665. r = r || 2 * Math.PI,
  56666. r = n.Math.clamp(r, 0, 2 * Math.PI);
  56667. var o, a, s, l = (t + 1) * e.length, c = t * e.length * 2 * 3, h = new n.BufferAttribute(new (c > 65535 ? Uint32Array : Uint16Array)(c),1), u = new n.BufferAttribute(new Float32Array(3 * l),3), d = new n.BufferAttribute(new Float32Array(2 * l),2), p = 0, f = 0, g = (1 / (e.length - 1),
  56668. 1 / t), m = new n.Vector3, v = new n.Vector2;
  56669. for (a = 0; a <= t; a++) {
  56670. var A = i + a * g * r
  56671. , y = Math.sin(A)
  56672. , C = Math.cos(A);
  56673. for (s = 0; s <= e.length - 1; s++)
  56674. m.x = e[s].x * y,
  56675. m.y = e[s].y,
  56676. m.z = e[s].x * C,
  56677. u.setXYZ(p, m.x, m.y, m.z),
  56678. v.x = a / t,
  56679. v.y = s / (e.length - 1),
  56680. d.setXY(p, v.x, v.y),
  56681. p++
  56682. }
  56683. for (a = 0; a < t; a++)
  56684. for (s = 0; s < e.length - 1; s++) {
  56685. o = s + a * e.length;
  56686. var I = o
  56687. , E = o + e.length
  56688. , b = o + e.length + 1
  56689. , w = o + 1;
  56690. h.setX(f, I),
  56691. f++,
  56692. h.setX(f, E),
  56693. f++,
  56694. h.setX(f, w),
  56695. f++,
  56696. h.setX(f, E),
  56697. f++,
  56698. h.setX(f, b),
  56699. f++,
  56700. h.setX(f, w),
  56701. f++
  56702. }
  56703. if (this.setIndex(h),
  56704. this.addAttribute("position", u),
  56705. this.addAttribute("uv", d),
  56706. this.computeVertexNormals(),
  56707. r === 2 * Math.PI) {
  56708. var _ = this.attributes.normal.array
  56709. , T = new n.Vector3
  56710. , x = new n.Vector3
  56711. , S = new n.Vector3;
  56712. for (o = t * e.length * 3,
  56713. a = 0,
  56714. s = 0; a < e.length; a++,
  56715. s += 3)
  56716. T.x = _[s + 0],
  56717. T.y = _[s + 1],
  56718. T.z = _[s + 2],
  56719. x.x = _[o + s + 0],
  56720. x.y = _[o + s + 1],
  56721. x.z = _[o + s + 2],
  56722. S.addVectors(T, x).normalize(),
  56723. _[s + 0] = _[o + s + 0] = S.x,
  56724. _[s + 1] = _[o + s + 1] = S.y,
  56725. _[s + 2] = _[o + s + 2] = S.z
  56726. }
  56727. }
  56728. ,
  56729. n.LatheBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56730. n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry,
  56731. n.LatheGeometry = function(e, t, i, r) {
  56732. n.Geometry.call(this),
  56733. this.type = "LatheGeometry",
  56734. this.parameters = {
  56735. points: e,
  56736. segments: t,
  56737. phiStart: i,
  56738. phiLength: r
  56739. },
  56740. this.fromBufferGeometry(new n.LatheBufferGeometry(e,t,i,r)),
  56741. this.mergeVertices()
  56742. }
  56743. ,
  56744. n.LatheGeometry.prototype = Object.create(n.Geometry.prototype),
  56745. n.LatheGeometry.prototype.constructor = n.LatheGeometry,
  56746. n.PlaneGeometry = function(e, t, i, r) {
  56747. n.Geometry.call(this),
  56748. this.type = "PlaneGeometry",
  56749. this.parameters = {
  56750. width: e,
  56751. height: t,
  56752. widthSegments: i,
  56753. heightSegments: r
  56754. },
  56755. this.fromBufferGeometry(new n.PlaneBufferGeometry(e,t,i,r))
  56756. }
  56757. ,
  56758. n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype),
  56759. n.PlaneGeometry.prototype.constructor = n.PlaneGeometry,
  56760. n.PlaneBufferGeometry = function(e, t, i, r) {
  56761. n.BufferGeometry.call(this),
  56762. this.type = "PlaneBufferGeometry",
  56763. this.parameters = {
  56764. width: e,
  56765. height: t,
  56766. widthSegments: i,
  56767. heightSegments: r
  56768. };
  56769. for (var o = e / 2, a = t / 2, s = Math.floor(i) || 1, l = Math.floor(r) || 1, c = s + 1, h = l + 1, u = e / s, d = t / l, p = new Float32Array(c * h * 3), f = new Float32Array(c * h * 3), g = new Float32Array(c * h * 2), m = 0, v = 0, A = 0; A < h; A++)
  56770. for (var y = A * d - a, C = 0; C < c; C++) {
  56771. var I = C * u - o;
  56772. p[m] = I,
  56773. p[m + 1] = -y,
  56774. f[m + 2] = 1,
  56775. g[v] = C / s,
  56776. g[v + 1] = 1 - A / l,
  56777. m += 3,
  56778. v += 2
  56779. }
  56780. m = 0;
  56781. for (var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(s * l * 6), A = 0; A < l; A++)
  56782. for (var C = 0; C < s; C++) {
  56783. var b = C + c * A
  56784. , w = C + c * (A + 1)
  56785. , _ = C + 1 + c * (A + 1)
  56786. , T = C + 1 + c * A;
  56787. E[m] = b,
  56788. E[m + 1] = w,
  56789. E[m + 2] = T,
  56790. E[m + 3] = w,
  56791. E[m + 4] = _,
  56792. E[m + 5] = T,
  56793. m += 6
  56794. }
  56795. this.setIndex(new n.BufferAttribute(E,1)),
  56796. this.addAttribute("position", new n.BufferAttribute(p,3)),
  56797. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  56798. this.addAttribute("uv", new n.BufferAttribute(g,2))
  56799. }
  56800. ,
  56801. n.PlaneBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56802. n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry,
  56803. n.RingBufferGeometry = function(e, t, i, r, o, a) {
  56804. n.BufferGeometry.call(this),
  56805. this.type = "RingBufferGeometry",
  56806. this.parameters = {
  56807. innerRadius: e,
  56808. outerRadius: t,
  56809. thetaSegments: i,
  56810. phiSegments: r,
  56811. thetaStart: o,
  56812. thetaLength: a
  56813. },
  56814. e = e || 20,
  56815. t = t || 50,
  56816. o = void 0 !== o ? o : 0,
  56817. a = void 0 !== a ? a : 2 * Math.PI,
  56818. i = void 0 !== i ? Math.max(3, i) : 8,
  56819. r = void 0 !== r ? Math.max(1, r) : 1;
  56820. var s, l, c, h = (i + 1) * (r + 1), u = i * r * 2 * 3, d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u),1), p = new n.BufferAttribute(new Float32Array(3 * h),3), f = new n.BufferAttribute(new Float32Array(3 * h),3), g = new n.BufferAttribute(new Float32Array(2 * h),2), m = 0, v = 0, A = e, y = (t - e) / r, C = new n.Vector3, I = new n.Vector2;
  56821. for (l = 0; l <= r; l++) {
  56822. for (c = 0; c <= i; c++)
  56823. s = o + c / i * a,
  56824. C.x = A * Math.cos(s),
  56825. C.y = A * Math.sin(s),
  56826. p.setXYZ(m, C.x, C.y, C.z),
  56827. f.setXYZ(m, 0, 0, 1),
  56828. I.x = (C.x / t + 1) / 2,
  56829. I.y = (C.y / t + 1) / 2,
  56830. g.setXY(m, I.x, I.y),
  56831. m++;
  56832. A += y
  56833. }
  56834. for (l = 0; l < r; l++) {
  56835. var E = l * (i + 1);
  56836. for (c = 0; c < i; c++) {
  56837. s = c + E;
  56838. var b = s
  56839. , w = s + i + 1
  56840. , _ = s + i + 2
  56841. , T = s + 1;
  56842. d.setX(v, b),
  56843. v++,
  56844. d.setX(v, w),
  56845. v++,
  56846. d.setX(v, _),
  56847. v++,
  56848. d.setX(v, b),
  56849. v++,
  56850. d.setX(v, _),
  56851. v++,
  56852. d.setX(v, T),
  56853. v++
  56854. }
  56855. }
  56856. this.setIndex(d),
  56857. this.addAttribute("position", p),
  56858. this.addAttribute("normal", f),
  56859. this.addAttribute("uv", g)
  56860. }
  56861. ,
  56862. n.RingBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56863. n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry,
  56864. n.RingGeometry = function(e, t, i, r, o, a) {
  56865. n.Geometry.call(this),
  56866. this.type = "RingGeometry",
  56867. this.parameters = {
  56868. innerRadius: e,
  56869. outerRadius: t,
  56870. thetaSegments: i,
  56871. phiSegments: r,
  56872. thetaStart: o,
  56873. thetaLength: a
  56874. },
  56875. this.fromBufferGeometry(new n.RingBufferGeometry(e,t,i,r,o,a))
  56876. }
  56877. ,
  56878. n.RingGeometry.prototype = Object.create(n.Geometry.prototype),
  56879. n.RingGeometry.prototype.constructor = n.RingGeometry,
  56880. n.SphereGeometry = function(e, t, i, r, o, a, s) {
  56881. n.Geometry.call(this),
  56882. this.type = "SphereGeometry",
  56883. this.parameters = {
  56884. radius: e,
  56885. widthSegments: t,
  56886. heightSegments: i,
  56887. phiStart: r,
  56888. phiLength: o,
  56889. thetaStart: a,
  56890. thetaLength: s
  56891. },
  56892. this.fromBufferGeometry(new n.SphereBufferGeometry(e,t,i,r,o,a,s))
  56893. }
  56894. ,
  56895. n.SphereGeometry.prototype = Object.create(n.Geometry.prototype),
  56896. n.SphereGeometry.prototype.constructor = n.SphereGeometry,
  56897. n.SphereBufferGeometry = function(e, t, i, r, o, a, s) {
  56898. n.BufferGeometry.call(this),
  56899. this.type = "SphereBufferGeometry",
  56900. this.parameters = {
  56901. radius: e,
  56902. widthSegments: t,
  56903. heightSegments: i,
  56904. phiStart: r,
  56905. phiLength: o,
  56906. thetaStart: a,
  56907. thetaLength: s
  56908. },
  56909. e = e || 50,
  56910. t = Math.max(3, Math.floor(t) || 8),
  56911. i = Math.max(2, Math.floor(i) || 6),
  56912. r = void 0 !== r ? r : 0,
  56913. o = void 0 !== o ? o : 2 * Math.PI,
  56914. a = void 0 !== a ? a : 0,
  56915. s = void 0 !== s ? s : Math.PI;
  56916. for (var l = a + s, c = (t + 1) * (i + 1), h = new n.BufferAttribute(new Float32Array(3 * c),3), u = new n.BufferAttribute(new Float32Array(3 * c),3), d = new n.BufferAttribute(new Float32Array(2 * c),2), p = 0, f = [], g = new n.Vector3, m = 0; m <= i; m++) {
  56917. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  56918. var C = y / t
  56919. , I = -e * Math.cos(r + C * o) * Math.sin(a + A * s)
  56920. , E = e * Math.cos(a + A * s)
  56921. , b = e * Math.sin(r + C * o) * Math.sin(a + A * s);
  56922. g.set(I, E, b).normalize(),
  56923. h.setXYZ(p, I, E, b),
  56924. u.setXYZ(p, g.x, g.y, g.z),
  56925. d.setXY(p, C, 1 - A),
  56926. v.push(p),
  56927. p++
  56928. }
  56929. f.push(v)
  56930. }
  56931. for (var w = [], m = 0; m < i; m++)
  56932. for (var y = 0; y < t; y++) {
  56933. var _ = f[m][y + 1]
  56934. , T = f[m][y]
  56935. , x = f[m + 1][y]
  56936. , S = f[m + 1][y + 1];
  56937. (0 !== m || a > 0) && w.push(_, T, S),
  56938. (m !== i - 1 || l < Math.PI) && w.push(T, x, S)
  56939. }
  56940. this.setIndex(new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(w,1)),
  56941. this.addAttribute("position", h),
  56942. this.addAttribute("normal", u),
  56943. this.addAttribute("uv", d),
  56944. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  56945. }
  56946. ,
  56947. n.SphereBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56948. n.SphereBufferGeometry.prototype.constructor = n.SphereBufferGeometry,
  56949. n.TextGeometry = function(e, t) {
  56950. t = t || {};
  56951. var i = t.font;
  56952. if (i instanceof n.Font == !1)
  56953. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  56954. new n.Geometry;
  56955. var r = i.generateShapes(e, t.size, t.curveSegments);
  56956. t.amount = void 0 !== t.height ? t.height : 50,
  56957. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  56958. void 0 === t.bevelSize && (t.bevelSize = 8),
  56959. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  56960. n.ExtrudeGeometry.call(this, r, t),
  56961. this.type = "TextGeometry"
  56962. }
  56963. ,
  56964. n.TextGeometry.prototype = Object.create(n.ExtrudeGeometry.prototype),
  56965. n.TextGeometry.prototype.constructor = n.TextGeometry,
  56966. n.TorusBufferGeometry = function(e, t, i, r, o) {
  56967. n.BufferGeometry.call(this),
  56968. this.type = "TorusBufferGeometry",
  56969. this.parameters = {
  56970. radius: e,
  56971. tube: t,
  56972. radialSegments: i,
  56973. tubularSegments: r,
  56974. arc: o
  56975. },
  56976. e = e || 100,
  56977. t = t || 40,
  56978. i = Math.floor(i) || 8,
  56979. r = Math.floor(r) || 6,
  56980. o = o || 2 * Math.PI;
  56981. var a, s, l = (i + 1) * (r + 1), c = i * r * 2 * 3, h = new (c > 65535 ? Uint32Array : Uint16Array)(c), u = new Float32Array(3 * l), d = new Float32Array(3 * l), p = new Float32Array(2 * l), f = 0, g = 0, m = 0, v = new n.Vector3, A = new n.Vector3, y = new n.Vector3;
  56982. for (a = 0; a <= i; a++)
  56983. for (s = 0; s <= r; s++) {
  56984. var C = s / r * o
  56985. , I = a / i * Math.PI * 2;
  56986. A.x = (e + t * Math.cos(I)) * Math.cos(C),
  56987. A.y = (e + t * Math.cos(I)) * Math.sin(C),
  56988. A.z = t * Math.sin(I),
  56989. u[f] = A.x,
  56990. u[f + 1] = A.y,
  56991. u[f + 2] = A.z,
  56992. v.x = e * Math.cos(C),
  56993. v.y = e * Math.sin(C),
  56994. y.subVectors(A, v).normalize(),
  56995. d[f] = y.x,
  56996. d[f + 1] = y.y,
  56997. d[f + 2] = y.z,
  56998. p[g] = s / r,
  56999. p[g + 1] = a / i,
  57000. f += 3,
  57001. g += 2
  57002. }
  57003. for (a = 1; a <= i; a++)
  57004. for (s = 1; s <= r; s++) {
  57005. var E = (r + 1) * a + s - 1
  57006. , b = (r + 1) * (a - 1) + s - 1
  57007. , w = (r + 1) * (a - 1) + s
  57008. , _ = (r + 1) * a + s;
  57009. h[m] = E,
  57010. h[m + 1] = b,
  57011. h[m + 2] = _,
  57012. h[m + 3] = b,
  57013. h[m + 4] = w,
  57014. h[m + 5] = _,
  57015. m += 6
  57016. }
  57017. this.setIndex(new n.BufferAttribute(h,1)),
  57018. this.addAttribute("position", new n.BufferAttribute(u,3)),
  57019. this.addAttribute("normal", new n.BufferAttribute(d,3)),
  57020. this.addAttribute("uv", new n.BufferAttribute(p,2))
  57021. }
  57022. ,
  57023. n.TorusBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57024. n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry,
  57025. n.TorusGeometry = function(e, t, i, r, o) {
  57026. n.Geometry.call(this),
  57027. this.type = "TorusGeometry",
  57028. this.parameters = {
  57029. radius: e,
  57030. tube: t,
  57031. radialSegments: i,
  57032. tubularSegments: r,
  57033. arc: o
  57034. },
  57035. this.fromBufferGeometry(new n.TorusBufferGeometry(e,t,i,r,o))
  57036. }
  57037. ,
  57038. n.TorusGeometry.prototype = Object.create(n.Geometry.prototype),
  57039. n.TorusGeometry.prototype.constructor = n.TorusGeometry,
  57040. n.TorusKnotBufferGeometry = function(e, t, i, r, o, a) {
  57041. function s(e, t, i, n, r) {
  57042. var o = Math.cos(e)
  57043. , a = Math.sin(e)
  57044. , s = i / t * e
  57045. , l = Math.cos(s);
  57046. r.x = n * (2 + l) * .5 * o,
  57047. r.y = n * (2 + l) * a * .5,
  57048. r.z = n * Math.sin(s) * .5
  57049. }
  57050. n.BufferGeometry.call(this),
  57051. this.type = "TorusKnotBufferGeometry",
  57052. this.parameters = {
  57053. radius: e,
  57054. tube: t,
  57055. tubularSegments: i,
  57056. radialSegments: r,
  57057. p: o,
  57058. q: a
  57059. },
  57060. e = e || 100,
  57061. t = t || 40,
  57062. i = Math.floor(i) || 64,
  57063. r = Math.floor(r) || 8,
  57064. o = o || 2,
  57065. a = a || 3;
  57066. var l, c, h = (r + 1) * (i + 1), u = r * i * 2 * 3, d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u),1), p = new n.BufferAttribute(new Float32Array(3 * h),3), f = new n.BufferAttribute(new Float32Array(3 * h),3), g = new n.BufferAttribute(new Float32Array(2 * h),2), m = 0, v = 0, A = new n.Vector3, y = new n.Vector3, C = new n.Vector2, I = new n.Vector3, E = new n.Vector3, b = new n.Vector3, w = new n.Vector3, _ = new n.Vector3;
  57067. for (l = 0; l <= i; ++l) {
  57068. var T = l / i * o * Math.PI * 2;
  57069. for (s(T, o, a, e, I),
  57070. s(T + .01, o, a, e, E),
  57071. w.subVectors(E, I),
  57072. _.addVectors(E, I),
  57073. b.crossVectors(w, _),
  57074. _.crossVectors(b, w),
  57075. b.normalize(),
  57076. _.normalize(),
  57077. c = 0; c <= r; ++c) {
  57078. var x = c / r * Math.PI * 2
  57079. , S = -t * Math.cos(x)
  57080. , M = t * Math.sin(x);
  57081. A.x = I.x + (S * _.x + M * b.x),
  57082. A.y = I.y + (S * _.y + M * b.y),
  57083. A.z = I.z + (S * _.z + M * b.z),
  57084. p.setXYZ(m, A.x, A.y, A.z),
  57085. y.subVectors(A, I).normalize(),
  57086. f.setXYZ(m, y.x, y.y, y.z),
  57087. C.x = l / i,
  57088. C.y = c / r,
  57089. g.setXY(m, C.x, C.y),
  57090. m++
  57091. }
  57092. }
  57093. for (c = 1; c <= i; c++)
  57094. for (l = 1; l <= r; l++) {
  57095. var R = (r + 1) * (c - 1) + (l - 1)
  57096. , P = (r + 1) * c + (l - 1)
  57097. , O = (r + 1) * c + l
  57098. , L = (r + 1) * (c - 1) + l;
  57099. d.setX(v, R),
  57100. v++,
  57101. d.setX(v, P),
  57102. v++,
  57103. d.setX(v, L),
  57104. v++,
  57105. d.setX(v, P),
  57106. v++,
  57107. d.setX(v, O),
  57108. v++,
  57109. d.setX(v, L),
  57110. v++
  57111. }
  57112. this.setIndex(d),
  57113. this.addAttribute("position", p),
  57114. this.addAttribute("normal", f),
  57115. this.addAttribute("uv", g)
  57116. }
  57117. ,
  57118. n.TorusKnotBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57119. n.TorusKnotBufferGeometry.prototype.constructor = n.TorusKnotBufferGeometry,
  57120. n.TorusKnotGeometry = function(e, t, i, r, o, a, s) {
  57121. n.Geometry.call(this),
  57122. this.type = "TorusKnotGeometry",
  57123. this.parameters = {
  57124. radius: e,
  57125. tube: t,
  57126. tubularSegments: i,
  57127. radialSegments: r,
  57128. p: o,
  57129. q: a
  57130. },
  57131. void 0 !== s && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  57132. this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e,t,i,r,o,a)),
  57133. this.mergeVertices()
  57134. }
  57135. ,
  57136. n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype),
  57137. n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry,
  57138. n.TubeGeometry = function(e, t, i, r, o, a) {
  57139. function s(e, t, i) {
  57140. return R.vertices.push(new n.Vector3(e,t,i)) - 1
  57141. }
  57142. n.Geometry.call(this),
  57143. this.type = "TubeGeometry",
  57144. this.parameters = {
  57145. path: e,
  57146. segments: t,
  57147. radius: i,
  57148. radialSegments: r,
  57149. closed: o,
  57150. taper: a
  57151. },
  57152. t = t || 64,
  57153. i = i || 1,
  57154. r = r || 8,
  57155. o = o || !1,
  57156. a = a || n.TubeGeometry.NoTaper;
  57157. var l, c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w, _, T, x, S, M = [], R = this, P = t + 1, O = new n.Vector3, L = new n.TubeGeometry.FrenetFrames(e,t,o), D = L.tangents, N = L.normals, B = L.binormals;
  57158. for (this.tangents = D,
  57159. this.normals = N,
  57160. this.binormals = B,
  57161. v = 0; v < P; v++)
  57162. for (M[v] = [],
  57163. u = v / (P - 1),
  57164. m = e.getPointAt(u),
  57165. l = D[v],
  57166. c = N[v],
  57167. h = B[v],
  57168. p = i * a(u),
  57169. A = 0; A < r; A++)
  57170. d = A / r * 2 * Math.PI,
  57171. f = -p * Math.cos(d),
  57172. g = p * Math.sin(d),
  57173. O.copy(m),
  57174. O.x += f * c.x + g * h.x,
  57175. O.y += f * c.y + g * h.y,
  57176. O.z += f * c.z + g * h.z,
  57177. M[v][A] = s(O.x, O.y, O.z);
  57178. for (v = 0; v < t; v++)
  57179. for (A = 0; A < r; A++)
  57180. y = o ? (v + 1) % t : v + 1,
  57181. C = (A + 1) % r,
  57182. I = M[v][A],
  57183. E = M[y][A],
  57184. b = M[y][C],
  57185. w = M[v][C],
  57186. _ = new n.Vector2(v / t,A / r),
  57187. T = new n.Vector2((v + 1) / t,A / r),
  57188. x = new n.Vector2((v + 1) / t,(A + 1) / r),
  57189. S = new n.Vector2(v / t,(A + 1) / r),
  57190. this.faces.push(new n.Face3(I,E,w)),
  57191. this.faceVertexUvs[0].push([_, T, S]),
  57192. this.faces.push(new n.Face3(E,b,w)),
  57193. this.faceVertexUvs[0].push([T.clone(), x, S.clone()]);
  57194. this.computeFaceNormals(),
  57195. this.computeVertexNormals()
  57196. }
  57197. ,
  57198. n.TubeGeometry.prototype = Object.create(n.Geometry.prototype),
  57199. n.TubeGeometry.prototype.constructor = n.TubeGeometry,
  57200. n.TubeGeometry.NoTaper = function(e) {
  57201. return 1
  57202. }
  57203. ,
  57204. n.TubeGeometry.SinusoidalTaper = function(e) {
  57205. return Math.sin(Math.PI * e)
  57206. }
  57207. ,
  57208. n.TubeGeometry.FrenetFrames = function(e, t, i) {
  57209. function r() {
  57210. f[0] = new n.Vector3,
  57211. g[0] = new n.Vector3,
  57212. a = Number.MAX_VALUE,
  57213. s = Math.abs(p[0].x),
  57214. l = Math.abs(p[0].y),
  57215. c = Math.abs(p[0].z),
  57216. s <= a && (a = s,
  57217. d.set(1, 0, 0)),
  57218. l <= a && (a = l,
  57219. d.set(0, 1, 0)),
  57220. c <= a && d.set(0, 0, 1),
  57221. m.crossVectors(p[0], d).normalize(),
  57222. f[0].crossVectors(p[0], m),
  57223. g[0].crossVectors(p[0], f[0])
  57224. }
  57225. var o, a, s, l, c, h, u, d = new n.Vector3, p = [], f = [], g = [], m = new n.Vector3, v = new n.Matrix4, A = t + 1;
  57226. for (this.tangents = p,
  57227. this.normals = f,
  57228. this.binormals = g,
  57229. h = 0; h < A; h++)
  57230. u = h / (A - 1),
  57231. p[h] = e.getTangentAt(u),
  57232. p[h].normalize();
  57233. for (r(),
  57234. h = 1; h < A; h++)
  57235. f[h] = f[h - 1].clone(),
  57236. g[h] = g[h - 1].clone(),
  57237. m.crossVectors(p[h - 1], p[h]),
  57238. m.length() > Number.EPSILON && (m.normalize(),
  57239. o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1)),
  57240. f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  57241. g[h].crossVectors(p[h], f[h]);
  57242. if (i)
  57243. for (o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)),
  57244. o /= A - 1,
  57245. p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o),
  57246. h = 1; h < A; h++)
  57247. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)),
  57248. g[h].crossVectors(p[h], f[h])
  57249. }
  57250. ,
  57251. n.PolyhedronGeometry = function(e, t, i, r) {
  57252. function o(e) {
  57253. var t = e.normalize().clone();
  57254. t.index = u.vertices.push(t) - 1;
  57255. var i = l(e) / 2 / Math.PI + .5
  57256. , r = c(e) / Math.PI + .5;
  57257. return t.uv = new n.Vector2(i,1 - r),
  57258. t
  57259. }
  57260. function a(e, t, i, r) {
  57261. var o = new n.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,r);
  57262. u.faces.push(o),
  57263. C.copy(e).add(t).add(i).divideScalar(3);
  57264. var a = l(C);
  57265. u.faceVertexUvs[0].push([h(e.uv, e, a), h(t.uv, t, a), h(i.uv, i, a)])
  57266. }
  57267. function s(e, t) {
  57268. for (var i = Math.pow(2, t), n = o(u.vertices[e.a]), r = o(u.vertices[e.b]), s = o(u.vertices[e.c]), l = [], c = e.materialIndex, h = 0; h <= i; h++) {
  57269. l[h] = [];
  57270. for (var d = o(n.clone().lerp(s, h / i)), p = o(r.clone().lerp(s, h / i)), f = i - h, g = 0; g <= f; g++)
  57271. 0 === g && h === i ? l[h][g] = d : l[h][g] = o(d.clone().lerp(p, g / f))
  57272. }
  57273. for (var h = 0; h < i; h++)
  57274. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  57275. var m = Math.floor(g / 2);
  57276. g % 2 === 0 ? a(l[h][m + 1], l[h + 1][m], l[h][m], c) : a(l[h][m + 1], l[h + 1][m + 1], l[h + 1][m], c)
  57277. }
  57278. }
  57279. function l(e) {
  57280. return Math.atan2(e.z, -e.x)
  57281. }
  57282. function c(e) {
  57283. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  57284. }
  57285. function h(e, t, i) {
  57286. return i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1,e.y)),
  57287. 0 === t.x && 0 === t.z && (e = new n.Vector2(i / 2 / Math.PI + .5,e.y)),
  57288. e.clone()
  57289. }
  57290. n.Geometry.call(this),
  57291. this.type = "PolyhedronGeometry",
  57292. this.parameters = {
  57293. vertices: e,
  57294. indices: t,
  57295. radius: i,
  57296. detail: r
  57297. },
  57298. i = i || 1,
  57299. r = r || 0;
  57300. for (var u = this, d = 0, p = e.length; d < p; d += 3)
  57301. o(new n.Vector3(e[d],e[d + 1],e[d + 2]));
  57302. for (var f = this.vertices, g = [], d = 0, m = 0, p = t.length; d < p; d += 3,
  57303. m++) {
  57304. var v = f[t[d]]
  57305. , A = f[t[d + 1]]
  57306. , y = f[t[d + 2]];
  57307. g[m] = new n.Face3(v.index,A.index,y.index,[v.clone(), A.clone(), y.clone()],void 0,m)
  57308. }
  57309. for (var C = new n.Vector3, d = 0, p = g.length; d < p; d++)
  57310. s(g[d], r);
  57311. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  57312. var I = this.faceVertexUvs[0][d]
  57313. , E = I[0].x
  57314. , b = I[1].x
  57315. , w = I[2].x
  57316. , _ = Math.max(E, b, w)
  57317. , T = Math.min(E, b, w);
  57318. _ > .9 && T < .1 && (E < .2 && (I[0].x += 1),
  57319. b < .2 && (I[1].x += 1),
  57320. w < .2 && (I[2].x += 1))
  57321. }
  57322. for (var d = 0, p = this.vertices.length; d < p; d++)
  57323. this.vertices[d].multiplyScalar(i);
  57324. this.mergeVertices(),
  57325. this.computeFaceNormals(),
  57326. this.boundingSphere = new n.Sphere(new n.Vector3,i)
  57327. }
  57328. ,
  57329. n.PolyhedronGeometry.prototype = Object.create(n.Geometry.prototype),
  57330. n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry,
  57331. n.DodecahedronGeometry = function(e, t) {
  57332. var i = (1 + Math.sqrt(5)) / 2
  57333. , r = 1 / i
  57334. , o = [-1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 0, -r, -i, 0, -r, i, 0, r, -i, 0, r, i, -r, -i, 0, -r, i, 0, r, -i, 0, r, i, 0, -i, 0, -r, i, 0, -r, -i, 0, r, i, 0, r]
  57335. , a = [3, 11, 7, 3, 7, 15, 3, 15, 13, 7, 19, 17, 7, 17, 6, 7, 6, 15, 17, 4, 8, 17, 8, 10, 17, 10, 6, 8, 0, 16, 8, 16, 2, 8, 2, 10, 0, 12, 1, 0, 1, 18, 0, 18, 16, 6, 10, 2, 6, 2, 13, 6, 13, 15, 2, 16, 18, 2, 18, 3, 2, 3, 13, 18, 1, 9, 18, 9, 11, 18, 11, 3, 4, 14, 12, 4, 12, 0, 4, 0, 8, 11, 9, 5, 11, 5, 19, 11, 19, 7, 19, 5, 14, 19, 14, 4, 19, 4, 17, 1, 12, 14, 1, 14, 5, 1, 5, 9];
  57336. n.PolyhedronGeometry.call(this, o, a, e, t),
  57337. this.type = "DodecahedronGeometry",
  57338. this.parameters = {
  57339. radius: e,
  57340. detail: t
  57341. }
  57342. }
  57343. ,
  57344. n.DodecahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57345. n.DodecahedronGeometry.prototype.constructor = n.DodecahedronGeometry,
  57346. n.IcosahedronGeometry = function(e, t) {
  57347. var i = (1 + Math.sqrt(5)) / 2
  57348. , r = [-1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, 0, 0, -1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, i, 0, -1, i, 0, 1, -i, 0, -1, -i, 0, 1]
  57349. , o = [0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1];
  57350. n.PolyhedronGeometry.call(this, r, o, e, t),
  57351. this.type = "IcosahedronGeometry",
  57352. this.parameters = {
  57353. radius: e,
  57354. detail: t
  57355. }
  57356. }
  57357. ,
  57358. n.IcosahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57359. n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry,
  57360. n.OctahedronGeometry = function(e, t) {
  57361. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1]
  57362. , r = [0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2];
  57363. n.PolyhedronGeometry.call(this, i, r, e, t),
  57364. this.type = "OctahedronGeometry",
  57365. this.parameters = {
  57366. radius: e,
  57367. detail: t
  57368. }
  57369. }
  57370. ,
  57371. n.OctahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57372. n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry,
  57373. n.TetrahedronGeometry = function(e, t) {
  57374. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1]
  57375. , r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1];
  57376. n.PolyhedronGeometry.call(this, i, r, e, t),
  57377. this.type = "TetrahedronGeometry",
  57378. this.parameters = {
  57379. radius: e,
  57380. detail: t
  57381. }
  57382. }
  57383. ,
  57384. n.TetrahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57385. n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry,
  57386. n.ParametricGeometry = function(e, t, i) {
  57387. n.Geometry.call(this),
  57388. this.type = "ParametricGeometry",
  57389. this.parameters = {
  57390. func: e,
  57391. slices: t,
  57392. stacks: i
  57393. };
  57394. var r, o, a, s, l, c = this.vertices, h = this.faces, u = this.faceVertexUvs[0], d = t + 1;
  57395. for (r = 0; r <= i; r++)
  57396. for (l = r / i,
  57397. o = 0; o <= t; o++)
  57398. s = o / t,
  57399. a = e(s, l),
  57400. c.push(a);
  57401. var p, f, g, m, v, A, y, C;
  57402. for (r = 0; r < i; r++)
  57403. for (o = 0; o < t; o++)
  57404. p = r * d + o,
  57405. f = r * d + o + 1,
  57406. g = (r + 1) * d + o + 1,
  57407. m = (r + 1) * d + o,
  57408. v = new n.Vector2(o / t,r / i),
  57409. A = new n.Vector2((o + 1) / t,r / i),
  57410. y = new n.Vector2((o + 1) / t,(r + 1) / i),
  57411. C = new n.Vector2(o / t,(r + 1) / i),
  57412. h.push(new n.Face3(p,f,m)),
  57413. u.push([v, A, C]),
  57414. h.push(new n.Face3(f,g,m)),
  57415. u.push([A.clone(), y, C.clone()]);
  57416. this.computeFaceNormals(),
  57417. this.computeVertexNormals()
  57418. }
  57419. ,
  57420. n.ParametricGeometry.prototype = Object.create(n.Geometry.prototype),
  57421. n.ParametricGeometry.prototype.constructor = n.ParametricGeometry,
  57422. n.WireframeGeometry = function(e) {
  57423. function t(e, t) {
  57424. return e - t
  57425. }
  57426. n.BufferGeometry.call(this);
  57427. var i = [0, 0]
  57428. , r = {}
  57429. , o = ["a", "b", "c"];
  57430. if (e instanceof n.Geometry) {
  57431. for (var a = e.vertices, s = e.faces, l = 0, c = new Uint32Array(6 * s.length), h = 0, u = s.length; h < u; h++)
  57432. for (var d = s[h], p = 0; p < 3; p++) {
  57433. i[0] = d[o[p]],
  57434. i[1] = d[o[(p + 1) % 3]],
  57435. i.sort(t);
  57436. var f = i.toString();
  57437. void 0 === r[f] && (c[2 * l] = i[0],
  57438. c[2 * l + 1] = i[1],
  57439. r[f] = !0,
  57440. l++)
  57441. }
  57442. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  57443. for (var p = 0; p < 2; p++) {
  57444. var m = a[c[2 * h + p]]
  57445. , v = 6 * h + 3 * p;
  57446. g[v + 0] = m.x,
  57447. g[v + 1] = m.y,
  57448. g[v + 2] = m.z
  57449. }
  57450. this.addAttribute("position", new n.BufferAttribute(g,3))
  57451. } else if (e instanceof n.BufferGeometry)
  57452. if (null !== e.index) {
  57453. var A = e.index.array
  57454. , a = e.attributes.position
  57455. , y = e.groups
  57456. , l = 0;
  57457. 0 === y.length && e.addGroup(0, A.length);
  57458. for (var c = new Uint32Array(2 * A.length), C = 0, I = y.length; C < I; ++C)
  57459. for (var E = y[C], b = E.start, w = E.count, h = b, _ = b + w; h < _; h += 3)
  57460. for (var p = 0; p < 3; p++) {
  57461. i[0] = A[h + p],
  57462. i[1] = A[h + (p + 1) % 3],
  57463. i.sort(t);
  57464. var f = i.toString();
  57465. void 0 === r[f] && (c[2 * l] = i[0],
  57466. c[2 * l + 1] = i[1],
  57467. r[f] = !0,
  57468. l++)
  57469. }
  57470. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  57471. for (var p = 0; p < 2; p++) {
  57472. var v = 6 * h + 3 * p
  57473. , T = c[2 * h + p];
  57474. g[v + 0] = a.getX(T),
  57475. g[v + 1] = a.getY(T),
  57476. g[v + 2] = a.getZ(T)
  57477. }
  57478. this.addAttribute("position", new n.BufferAttribute(g,3))
  57479. } else {
  57480. for (var a = e.attributes.position.array, l = a.length / 3, x = l / 3, g = new Float32Array(2 * l * 3), h = 0, u = x; h < u; h++)
  57481. for (var p = 0; p < 3; p++) {
  57482. var v = 18 * h + 6 * p
  57483. , S = 9 * h + 3 * p;
  57484. g[v + 0] = a[S],
  57485. g[v + 1] = a[S + 1],
  57486. g[v + 2] = a[S + 2];
  57487. var T = 9 * h + 3 * ((p + 1) % 3);
  57488. g[v + 3] = a[T],
  57489. g[v + 4] = a[T + 1],
  57490. g[v + 5] = a[T + 2]
  57491. }
  57492. this.addAttribute("position", new n.BufferAttribute(g,3))
  57493. }
  57494. }
  57495. ,
  57496. n.WireframeGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57497. n.WireframeGeometry.prototype.constructor = n.WireframeGeometry,
  57498. n.AxisHelper = function(e) {
  57499. e = e || 1;
  57500. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  57501. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  57502. , r = new n.BufferGeometry;
  57503. r.addAttribute("position", new n.BufferAttribute(t,3)),
  57504. r.addAttribute("color", new n.BufferAttribute(i,3));
  57505. var o = new n.LineBasicMaterial({
  57506. vertexColors: n.VertexColors
  57507. });
  57508. n.LineSegments.call(this, r, o)
  57509. }
  57510. ,
  57511. n.AxisHelper.prototype = Object.create(n.LineSegments.prototype),
  57512. n.AxisHelper.prototype.constructor = n.AxisHelper,
  57513. n.ArrowHelper = function() {
  57514. var e = new n.Geometry;
  57515. e.vertices.push(new n.Vector3(0,0,0), new n.Vector3(0,1,0));
  57516. var t = new n.CylinderGeometry(0,.5,1,5,1);
  57517. return t.translate(0, -.5, 0),
  57518. function(i, r, o, a, s, l) {
  57519. n.Object3D.call(this),
  57520. void 0 === a && (a = 16776960),
  57521. void 0 === o && (o = 1),
  57522. void 0 === s && (s = .2 * o),
  57523. void 0 === l && (l = .2 * s),
  57524. this.position.copy(r),
  57525. this.line = new n.Line(e,new n.LineBasicMaterial({
  57526. color: a
  57527. })),
  57528. this.line.matrixAutoUpdate = !1,
  57529. this.add(this.line),
  57530. this.cone = new n.Mesh(t,new n.MeshBasicMaterial({
  57531. color: a
  57532. })),
  57533. this.cone.matrixAutoUpdate = !1,
  57534. this.add(this.cone),
  57535. this.setDirection(i),
  57536. this.setLength(o, s, l)
  57537. }
  57538. }(),
  57539. n.ArrowHelper.prototype = Object.create(n.Object3D.prototype),
  57540. n.ArrowHelper.prototype.constructor = n.ArrowHelper,
  57541. n.ArrowHelper.prototype.setDirection = function() {
  57542. var e, t = new n.Vector3;
  57543. return function(i) {
  57544. i.y > .99999 ? this.quaternion.set(0, 0, 0, 1) : i.y < -.99999 ? this.quaternion.set(1, 0, 0, 0) : (t.set(i.z, 0, -i.x).normalize(),
  57545. e = Math.acos(i.y),
  57546. this.quaternion.setFromAxisAngle(t, e))
  57547. }
  57548. }(),
  57549. n.ArrowHelper.prototype.setLength = function(e, t, i) {
  57550. void 0 === t && (t = .2 * e),
  57551. void 0 === i && (i = .2 * t),
  57552. this.line.scale.set(1, Math.max(0, e - t), 1),
  57553. this.line.updateMatrix(),
  57554. this.cone.scale.set(i, t, i),
  57555. this.cone.position.y = e,
  57556. this.cone.updateMatrix()
  57557. }
  57558. ,
  57559. n.ArrowHelper.prototype.setColor = function(e) {
  57560. this.line.material.color.set(e),
  57561. this.cone.material.color.set(e)
  57562. }
  57563. ,
  57564. n.BoxHelper = function(e) {
  57565. 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])
  57566. , i = new Float32Array(24)
  57567. , r = new n.BufferGeometry;
  57568. r.setIndex(new n.BufferAttribute(t,1)),
  57569. r.addAttribute("position", new n.BufferAttribute(i,3)),
  57570. n.LineSegments.call(this, r, new n.LineBasicMaterial({
  57571. color: 16776960
  57572. })),
  57573. void 0 !== e && this.update(e)
  57574. }
  57575. ,
  57576. n.BoxHelper.prototype = Object.create(n.LineSegments.prototype),
  57577. n.BoxHelper.prototype.constructor = n.BoxHelper,
  57578. n.BoxHelper.prototype.update = function() {
  57579. var e = new n.Box3;
  57580. return function(t) {
  57581. if (e.setFromObject(t),
  57582. !e.isEmpty()) {
  57583. var i = e.min
  57584. , n = e.max
  57585. , r = this.geometry.attributes.position
  57586. , o = r.array;
  57587. o[0] = n.x,
  57588. o[1] = n.y,
  57589. o[2] = n.z,
  57590. o[3] = i.x,
  57591. o[4] = n.y,
  57592. o[5] = n.z,
  57593. o[6] = i.x,
  57594. o[7] = i.y,
  57595. o[8] = n.z,
  57596. o[9] = n.x,
  57597. o[10] = i.y,
  57598. o[11] = n.z,
  57599. o[12] = n.x,
  57600. o[13] = n.y,
  57601. o[14] = i.z,
  57602. o[15] = i.x,
  57603. o[16] = n.y,
  57604. o[17] = i.z,
  57605. o[18] = i.x,
  57606. o[19] = i.y,
  57607. o[20] = i.z,
  57608. o[21] = n.x,
  57609. o[22] = i.y,
  57610. o[23] = i.z,
  57611. r.needsUpdate = !0,
  57612. this.geometry.computeBoundingSphere()
  57613. }
  57614. }
  57615. }(),
  57616. n.BoundingBoxHelper = function(e, t) {
  57617. var i = void 0 !== t ? t : 8947848;
  57618. this.object = e,
  57619. this.box = new n.Box3,
  57620. n.Mesh.call(this, new n.BoxGeometry(1,1,1), new n.MeshBasicMaterial({
  57621. color: i,
  57622. wireframe: !0
  57623. }))
  57624. }
  57625. ,
  57626. n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype),
  57627. n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper,
  57628. n.BoundingBoxHelper.prototype.update = function() {
  57629. this.box.setFromObject(this.object),
  57630. this.box.size(this.scale),
  57631. this.box.center(this.position)
  57632. }
  57633. ,
  57634. n.CameraHelper = function(e) {
  57635. function t(e, t, n) {
  57636. i(e, n),
  57637. i(t, n)
  57638. }
  57639. function i(e, t) {
  57640. r.vertices.push(new n.Vector3),
  57641. r.colors.push(new n.Color(t)),
  57642. void 0 === a[e] && (a[e] = []),
  57643. a[e].push(r.vertices.length - 1)
  57644. }
  57645. var r = new n.Geometry
  57646. , o = new n.LineBasicMaterial({
  57647. color: 16777215,
  57648. vertexColors: n.FaceColors
  57649. })
  57650. , a = {}
  57651. , s = 16755200
  57652. , l = 16711680
  57653. , c = 43775
  57654. , h = 16777215
  57655. , u = 3355443;
  57656. t("n1", "n2", s),
  57657. t("n2", "n4", s),
  57658. t("n4", "n3", s),
  57659. t("n3", "n1", s),
  57660. t("f1", "f2", s),
  57661. t("f2", "f4", s),
  57662. t("f4", "f3", s),
  57663. t("f3", "f1", s),
  57664. t("n1", "f1", s),
  57665. t("n2", "f2", s),
  57666. t("n3", "f3", s),
  57667. t("n4", "f4", s),
  57668. t("p", "n1", l),
  57669. t("p", "n2", l),
  57670. t("p", "n3", l),
  57671. t("p", "n4", l),
  57672. t("u1", "u2", c),
  57673. t("u2", "u3", c),
  57674. t("u3", "u1", c),
  57675. t("c", "t", h),
  57676. t("p", "c", u),
  57677. t("cn1", "cn2", u),
  57678. t("cn3", "cn4", u),
  57679. t("cf1", "cf2", u),
  57680. t("cf3", "cf4", u),
  57681. n.LineSegments.call(this, r, o),
  57682. this.camera = e,
  57683. this.camera.updateProjectionMatrix(),
  57684. this.matrix = e.matrixWorld,
  57685. this.matrixAutoUpdate = !1,
  57686. this.pointMap = a,
  57687. this.update()
  57688. }
  57689. ,
  57690. n.CameraHelper.prototype = Object.create(n.LineSegments.prototype),
  57691. n.CameraHelper.prototype.constructor = n.CameraHelper,
  57692. n.CameraHelper.prototype.update = function() {
  57693. function e(e, n, a, s) {
  57694. r.set(n, a, s).unproject(o);
  57695. var l = i[e];
  57696. if (void 0 !== l)
  57697. for (var c = 0, h = l.length; c < h; c++)
  57698. t.vertices[l[c]].copy(r)
  57699. }
  57700. var t, i, r = new n.Vector3, o = new n.Camera;
  57701. return function() {
  57702. t = this.geometry,
  57703. i = this.pointMap;
  57704. var n = 1
  57705. , r = 1;
  57706. o.projectionMatrix.copy(this.camera.projectionMatrix),
  57707. e("c", 0, 0, -1),
  57708. e("t", 0, 0, 1),
  57709. e("n1", -n, -r, -1),
  57710. e("n2", n, -r, -1),
  57711. e("n3", -n, r, -1),
  57712. e("n4", n, r, -1),
  57713. e("f1", -n, -r, 1),
  57714. e("f2", n, -r, 1),
  57715. e("f3", -n, r, 1),
  57716. e("f4", n, r, 1),
  57717. e("u1", .7 * n, 1.1 * r, -1),
  57718. e("u2", .7 * -n, 1.1 * r, -1),
  57719. e("u3", 0, 2 * r, -1),
  57720. e("cf1", -n, 0, 1),
  57721. e("cf2", n, 0, 1),
  57722. e("cf3", 0, -r, 1),
  57723. e("cf4", 0, r, 1),
  57724. e("cn1", -n, 0, -1),
  57725. e("cn2", n, 0, -1),
  57726. e("cn3", 0, -r, -1),
  57727. e("cn4", 0, r, -1),
  57728. t.verticesNeedUpdate = !0
  57729. }
  57730. }(),
  57731. n.DirectionalLightHelper = function(e, t) {
  57732. n.Object3D.call(this),
  57733. this.light = e,
  57734. this.light.updateMatrixWorld(),
  57735. this.matrix = e.matrixWorld,
  57736. this.matrixAutoUpdate = !1,
  57737. t = t || 1;
  57738. var i = new n.Geometry;
  57739. i.vertices.push(new n.Vector3(-t,t,0), new n.Vector3(t,t,0), new n.Vector3(t,-t,0), new n.Vector3(-t,-t,0), new n.Vector3(-t,t,0));
  57740. var r = new n.LineBasicMaterial({
  57741. fog: !1
  57742. });
  57743. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57744. this.lightPlane = new n.Line(i,r),
  57745. this.add(this.lightPlane),
  57746. i = new n.Geometry,
  57747. i.vertices.push(new n.Vector3, new n.Vector3),
  57748. r = new n.LineBasicMaterial({
  57749. fog: !1
  57750. }),
  57751. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57752. this.targetLine = new n.Line(i,r),
  57753. this.add(this.targetLine),
  57754. this.update()
  57755. }
  57756. ,
  57757. n.DirectionalLightHelper.prototype = Object.create(n.Object3D.prototype),
  57758. n.DirectionalLightHelper.prototype.constructor = n.DirectionalLightHelper,
  57759. n.DirectionalLightHelper.prototype.dispose = function() {
  57760. this.lightPlane.geometry.dispose(),
  57761. this.lightPlane.material.dispose(),
  57762. this.targetLine.geometry.dispose(),
  57763. this.targetLine.material.dispose()
  57764. }
  57765. ,
  57766. n.DirectionalLightHelper.prototype.update = function() {
  57767. var e = new n.Vector3
  57768. , t = new n.Vector3
  57769. , i = new n.Vector3;
  57770. return function() {
  57771. e.setFromMatrixPosition(this.light.matrixWorld),
  57772. t.setFromMatrixPosition(this.light.target.matrixWorld),
  57773. i.subVectors(t, e),
  57774. this.lightPlane.lookAt(i),
  57775. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57776. this.targetLine.geometry.vertices[1].copy(i),
  57777. this.targetLine.geometry.verticesNeedUpdate = !0,
  57778. this.targetLine.material.color.copy(this.lightPlane.material.color)
  57779. }
  57780. }(),
  57781. n.EdgesHelper = function(e, t, i) {
  57782. var r = void 0 !== t ? t : 16777215;
  57783. n.LineSegments.call(this, new n.EdgesGeometry(e.geometry,i), new n.LineBasicMaterial({
  57784. color: r
  57785. })),
  57786. this.matrix = e.matrixWorld,
  57787. this.matrixAutoUpdate = !1
  57788. }
  57789. ,
  57790. n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype),
  57791. n.EdgesHelper.prototype.constructor = n.EdgesHelper,
  57792. n.FaceNormalsHelper = function(e, t, i, r) {
  57793. this.object = e,
  57794. this.size = void 0 !== t ? t : 1;
  57795. var o = void 0 !== i ? i : 16776960
  57796. , a = void 0 !== r ? r : 1
  57797. , s = 0
  57798. , l = this.object.geometry;
  57799. l instanceof n.Geometry ? s = l.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  57800. var c = new n.BufferGeometry
  57801. , h = new n.Float32Attribute(2 * s * 3,3);
  57802. c.addAttribute("position", h),
  57803. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  57804. color: o,
  57805. linewidth: a
  57806. })),
  57807. this.matrixAutoUpdate = !1,
  57808. this.update()
  57809. }
  57810. ,
  57811. n.FaceNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  57812. n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper,
  57813. n.FaceNormalsHelper.prototype.update = function() {
  57814. var e = new n.Vector3
  57815. , t = new n.Vector3
  57816. , i = new n.Matrix3;
  57817. return function() {
  57818. this.object.updateMatrixWorld(!0),
  57819. i.getNormalMatrix(this.object.matrixWorld);
  57820. for (var n = this.object.matrixWorld, r = this.geometry.attributes.position, o = this.object.geometry, a = o.vertices, s = o.faces, l = 0, c = 0, h = s.length; c < h; c++) {
  57821. var u = s[c]
  57822. , d = u.normal;
  57823. e.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(n),
  57824. t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  57825. r.setXYZ(l, e.x, e.y, e.z),
  57826. l += 1,
  57827. r.setXYZ(l, t.x, t.y, t.z),
  57828. l += 1
  57829. }
  57830. return r.needsUpdate = !0,
  57831. this
  57832. }
  57833. }(),
  57834. n.GridHelper = function(e, t) {
  57835. var i = new n.Geometry
  57836. , r = new n.LineBasicMaterial({
  57837. vertexColors: n.VertexColors
  57838. });
  57839. this.color1 = new n.Color(4473924),
  57840. this.color2 = new n.Color(8947848);
  57841. for (var o = -e; o <= e; o += t) {
  57842. i.vertices.push(new n.Vector3(-e,0,o), new n.Vector3(e,0,o), new n.Vector3(o,0,-e), new n.Vector3(o,0,e));
  57843. var a = 0 === o ? this.color1 : this.color2;
  57844. i.colors.push(a, a, a, a)
  57845. }
  57846. n.LineSegments.call(this, i, r)
  57847. }
  57848. ,
  57849. n.GridHelper.prototype = Object.create(n.LineSegments.prototype),
  57850. n.GridHelper.prototype.constructor = n.GridHelper,
  57851. n.GridHelper.prototype.setColors = function(e, t) {
  57852. this.color1.set(e),
  57853. this.color2.set(t),
  57854. this.geometry.colorsNeedUpdate = !0
  57855. }
  57856. ,
  57857. n.HemisphereLightHelper = function(e, t) {
  57858. n.Object3D.call(this),
  57859. this.light = e,
  57860. this.light.updateMatrixWorld(),
  57861. this.matrix = e.matrixWorld,
  57862. this.matrixAutoUpdate = !1,
  57863. this.colors = [new n.Color, new n.Color];
  57864. var i = new n.SphereGeometry(t,4,2);
  57865. i.rotateX(-Math.PI / 2);
  57866. for (var r = 0, o = 8; r < o; r++)
  57867. i.faces[r].color = this.colors[r < 4 ? 0 : 1];
  57868. var a = new n.MeshBasicMaterial({
  57869. vertexColors: n.FaceColors,
  57870. wireframe: !0
  57871. });
  57872. this.lightSphere = new n.Mesh(i,a),
  57873. this.add(this.lightSphere),
  57874. this.update()
  57875. }
  57876. ,
  57877. n.HemisphereLightHelper.prototype = Object.create(n.Object3D.prototype),
  57878. n.HemisphereLightHelper.prototype.constructor = n.HemisphereLightHelper,
  57879. n.HemisphereLightHelper.prototype.dispose = function() {
  57880. this.lightSphere.geometry.dispose(),
  57881. this.lightSphere.material.dispose()
  57882. }
  57883. ,
  57884. n.HemisphereLightHelper.prototype.update = function() {
  57885. var e = new n.Vector3;
  57886. return function() {
  57887. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  57888. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  57889. this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),
  57890. this.lightSphere.geometry.colorsNeedUpdate = !0
  57891. }
  57892. }(),
  57893. n.PointLightHelper = function(e, t) {
  57894. this.light = e,
  57895. this.light.updateMatrixWorld();
  57896. var i = new n.SphereGeometry(t,4,2)
  57897. , r = new n.MeshBasicMaterial({
  57898. wireframe: !0,
  57899. fog: !1
  57900. });
  57901. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57902. n.Mesh.call(this, i, r),
  57903. this.matrix = this.light.matrixWorld,
  57904. this.matrixAutoUpdate = !1
  57905. }
  57906. ,
  57907. n.PointLightHelper.prototype = Object.create(n.Mesh.prototype),
  57908. n.PointLightHelper.prototype.constructor = n.PointLightHelper,
  57909. n.PointLightHelper.prototype.dispose = function() {
  57910. this.geometry.dispose(),
  57911. this.material.dispose()
  57912. }
  57913. ,
  57914. n.PointLightHelper.prototype.update = function() {
  57915. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  57916. }
  57917. ,
  57918. n.SkeletonHelper = function(e) {
  57919. this.bones = this.getBoneList(e);
  57920. for (var t = new n.Geometry, i = 0; i < this.bones.length; i++) {
  57921. var r = this.bones[i];
  57922. r.parent instanceof n.Bone && (t.vertices.push(new n.Vector3),
  57923. t.vertices.push(new n.Vector3),
  57924. t.colors.push(new n.Color(0,0,1)),
  57925. t.colors.push(new n.Color(0,1,0)))
  57926. }
  57927. t.dynamic = !0;
  57928. var o = new n.LineBasicMaterial({
  57929. vertexColors: n.VertexColors,
  57930. depthTest: !1,
  57931. depthWrite: !1,
  57932. transparent: !0
  57933. });
  57934. n.LineSegments.call(this, t, o),
  57935. this.root = e,
  57936. this.matrix = e.matrixWorld,
  57937. this.matrixAutoUpdate = !1,
  57938. this.update()
  57939. }
  57940. ,
  57941. n.SkeletonHelper.prototype = Object.create(n.LineSegments.prototype),
  57942. n.SkeletonHelper.prototype.constructor = n.SkeletonHelper,
  57943. n.SkeletonHelper.prototype.getBoneList = function(e) {
  57944. var t = [];
  57945. e instanceof n.Bone && t.push(e);
  57946. for (var i = 0; i < e.children.length; i++)
  57947. t.push.apply(t, this.getBoneList(e.children[i]));
  57948. return t
  57949. }
  57950. ,
  57951. n.SkeletonHelper.prototype.update = function() {
  57952. for (var e = this.geometry, t = (new n.Matrix4).getInverse(this.root.matrixWorld), i = new n.Matrix4, r = 0, o = 0; o < this.bones.length; o++) {
  57953. var a = this.bones[o];
  57954. a.parent instanceof n.Bone && (i.multiplyMatrices(t, a.matrixWorld),
  57955. e.vertices[r].setFromMatrixPosition(i),
  57956. i.multiplyMatrices(t, a.parent.matrixWorld),
  57957. e.vertices[r + 1].setFromMatrixPosition(i),
  57958. r += 2)
  57959. }
  57960. e.verticesNeedUpdate = !0,
  57961. e.computeBoundingSphere()
  57962. }
  57963. ,
  57964. n.SpotLightHelper = function(e) {
  57965. n.Object3D.call(this),
  57966. this.light = e,
  57967. this.light.updateMatrixWorld(),
  57968. this.matrix = e.matrixWorld,
  57969. this.matrixAutoUpdate = !1;
  57970. var t = new n.CylinderGeometry(0,1,1,8,1,!0);
  57971. t.translate(0, -.5, 0),
  57972. t.rotateX(-Math.PI / 2);
  57973. var i = new n.MeshBasicMaterial({
  57974. wireframe: !0,
  57975. fog: !1
  57976. });
  57977. this.cone = new n.Mesh(t,i),
  57978. this.add(this.cone),
  57979. this.update()
  57980. }
  57981. ,
  57982. n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype),
  57983. n.SpotLightHelper.prototype.constructor = n.SpotLightHelper,
  57984. n.SpotLightHelper.prototype.dispose = function() {
  57985. this.cone.geometry.dispose(),
  57986. this.cone.material.dispose()
  57987. }
  57988. ,
  57989. n.SpotLightHelper.prototype.update = function() {
  57990. var e = new n.Vector3
  57991. , t = new n.Vector3;
  57992. return function() {
  57993. var i = this.light.distance ? this.light.distance : 1e4
  57994. , n = i * Math.tan(this.light.angle);
  57995. this.cone.scale.set(n, n, i),
  57996. e.setFromMatrixPosition(this.light.matrixWorld),
  57997. t.setFromMatrixPosition(this.light.target.matrixWorld),
  57998. this.cone.lookAt(t.sub(e)),
  57999. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  58000. }
  58001. }(),
  58002. n.VertexNormalsHelper = function(e, t, i, r) {
  58003. this.object = e,
  58004. this.size = void 0 !== t ? t : 1;
  58005. var o = void 0 !== i ? i : 16711680
  58006. , a = void 0 !== r ? r : 1
  58007. , s = 0
  58008. , l = this.object.geometry;
  58009. l instanceof n.Geometry ? s = 3 * l.faces.length : l instanceof n.BufferGeometry && (s = l.attributes.normal.count);
  58010. var c = new n.BufferGeometry
  58011. , h = new n.Float32Attribute(2 * s * 3,3);
  58012. c.addAttribute("position", h),
  58013. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  58014. color: o,
  58015. linewidth: a
  58016. })),
  58017. this.matrixAutoUpdate = !1,
  58018. this.update()
  58019. }
  58020. ,
  58021. n.VertexNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  58022. n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper,
  58023. n.VertexNormalsHelper.prototype.update = function() {
  58024. var e = new n.Vector3
  58025. , t = new n.Vector3
  58026. , i = new n.Matrix3;
  58027. return function() {
  58028. var r = ["a", "b", "c"];
  58029. this.object.updateMatrixWorld(!0),
  58030. i.getNormalMatrix(this.object.matrixWorld);
  58031. var o = this.object.matrixWorld
  58032. , a = this.geometry.attributes.position
  58033. , s = this.object.geometry;
  58034. if (s instanceof n.Geometry)
  58035. for (var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length; u < d; u++)
  58036. for (var p = c[u], f = 0, g = p.vertexNormals.length; f < g; f++) {
  58037. var m = l[p[r[f]]]
  58038. , v = p.vertexNormals[f];
  58039. e.copy(m).applyMatrix4(o),
  58040. t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  58041. a.setXYZ(h, e.x, e.y, e.z),
  58042. h += 1,
  58043. a.setXYZ(h, t.x, t.y, t.z),
  58044. h += 1
  58045. }
  58046. else if (s instanceof n.BufferGeometry)
  58047. for (var A = s.attributes.position, y = s.attributes.normal, h = 0, f = 0, g = A.count; f < g; f++)
  58048. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  58049. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  58050. t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  58051. a.setXYZ(h, e.x, e.y, e.z),
  58052. h += 1,
  58053. a.setXYZ(h, t.x, t.y, t.z),
  58054. h += 1;
  58055. return a.needsUpdate = !0,
  58056. this
  58057. }
  58058. }(),
  58059. n.WireframeHelper = function(e, t) {
  58060. var i = void 0 !== t ? t : 16777215;
  58061. n.LineSegments.call(this, new n.WireframeGeometry(e.geometry), new n.LineBasicMaterial({
  58062. color: i
  58063. })),
  58064. this.matrix = e.matrixWorld,
  58065. this.matrixAutoUpdate = !1
  58066. }
  58067. ,
  58068. n.WireframeHelper.prototype = Object.create(n.LineSegments.prototype),
  58069. n.WireframeHelper.prototype.constructor = n.WireframeHelper,
  58070. n.ImmediateRenderObject = function(e) {
  58071. n.Object3D.call(this),
  58072. this.material = e,
  58073. this.render = function(e) {}
  58074. }
  58075. ,
  58076. n.ImmediateRenderObject.prototype = Object.create(n.Object3D.prototype),
  58077. n.ImmediateRenderObject.prototype.constructor = n.ImmediateRenderObject,
  58078. n.MorphBlendMesh = function(e, t) {
  58079. n.Mesh.call(this, e, t),
  58080. this.animationsMap = {},
  58081. this.animationsList = [];
  58082. var i = this.geometry.morphTargets.length
  58083. , r = "__default"
  58084. , o = 0
  58085. , a = i - 1
  58086. , s = i / 1;
  58087. this.createAnimation(r, o, a, s),
  58088. this.setAnimationWeight(r, 1)
  58089. }
  58090. ,
  58091. n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype),
  58092. n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh,
  58093. n.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  58094. var r = {
  58095. start: t,
  58096. end: i,
  58097. length: i - t + 1,
  58098. fps: n,
  58099. duration: (i - t) / n,
  58100. lastFrame: 0,
  58101. currentFrame: 0,
  58102. active: !1,
  58103. time: 0,
  58104. direction: 1,
  58105. weight: 1,
  58106. directionBackwards: !1,
  58107. mirroredLoop: !1
  58108. };
  58109. this.animationsMap[e] = r,
  58110. this.animationsList.push(r)
  58111. }
  58112. ,
  58113. n.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  58114. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  58115. var s = r.morphTargets[o]
  58116. , l = s.name.match(i);
  58117. if (l && l.length > 1) {
  58118. var c = l[1];
  58119. n[c] || (n[c] = {
  58120. start: 1 / 0,
  58121. end: -(1 / 0)
  58122. });
  58123. var h = n[c];
  58124. o < h.start && (h.start = o),
  58125. o > h.end && (h.end = o),
  58126. t || (t = c)
  58127. }
  58128. }
  58129. for (var c in n) {
  58130. var h = n[c];
  58131. this.createAnimation(c, h.start, h.end, e)
  58132. }
  58133. this.firstAnimation = t
  58134. }
  58135. ,
  58136. n.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  58137. var t = this.animationsMap[e];
  58138. t && (t.direction = 1,
  58139. t.directionBackwards = !1)
  58140. }
  58141. ,
  58142. n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  58143. var t = this.animationsMap[e];
  58144. t && (t.direction = -1,
  58145. t.directionBackwards = !0)
  58146. }
  58147. ,
  58148. n.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  58149. var i = this.animationsMap[e];
  58150. i && (i.fps = t,
  58151. i.duration = (i.end - i.start) / i.fps)
  58152. }
  58153. ,
  58154. n.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  58155. var i = this.animationsMap[e];
  58156. i && (i.duration = t,
  58157. i.fps = (i.end - i.start) / i.duration)
  58158. }
  58159. ,
  58160. n.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  58161. var i = this.animationsMap[e];
  58162. i && (i.weight = t)
  58163. }
  58164. ,
  58165. n.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  58166. var i = this.animationsMap[e];
  58167. i && (i.time = t)
  58168. }
  58169. ,
  58170. n.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  58171. var t = 0
  58172. , i = this.animationsMap[e];
  58173. return i && (t = i.time),
  58174. t
  58175. }
  58176. ,
  58177. n.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  58178. var t = -1
  58179. , i = this.animationsMap[e];
  58180. return i && (t = i.duration),
  58181. t
  58182. }
  58183. ,
  58184. n.MorphBlendMesh.prototype.playAnimation = function(e) {
  58185. var t = this.animationsMap[e];
  58186. t ? (t.time = 0,
  58187. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  58188. }
  58189. ,
  58190. n.MorphBlendMesh.prototype.stopAnimation = function(e) {
  58191. var t = this.animationsMap[e];
  58192. t && (t.active = !1)
  58193. }
  58194. ,
  58195. n.MorphBlendMesh.prototype.update = function(e) {
  58196. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  58197. var r = this.animationsList[t];
  58198. if (r.active) {
  58199. var o = r.duration / r.length;
  58200. r.time += r.direction * e,
  58201. r.mirroredLoop ? (r.time > r.duration || r.time < 0) && (r.direction *= -1,
  58202. r.time > r.duration && (r.time = r.duration,
  58203. r.directionBackwards = !0),
  58204. r.time < 0 && (r.time = 0,
  58205. r.directionBackwards = !1)) : (r.time = r.time % r.duration,
  58206. r.time < 0 && (r.time += r.duration));
  58207. var a = r.start + n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1)
  58208. , s = r.weight;
  58209. a !== r.currentFrame && (this.morphTargetInfluences[r.lastFrame] = 0,
  58210. this.morphTargetInfluences[r.currentFrame] = 1 * s,
  58211. this.morphTargetInfluences[a] = 0,
  58212. r.lastFrame = r.currentFrame,
  58213. r.currentFrame = a);
  58214. var l = r.time % o / o;
  58215. r.directionBackwards && (l = 1 - l),
  58216. r.currentFrame !== r.lastFrame ? (this.morphTargetInfluences[r.currentFrame] = l * s,
  58217. this.morphTargetInfluences[r.lastFrame] = (1 - l) * s) : this.morphTargetInfluences[r.currentFrame] = s
  58218. }
  58219. }
  58220. }
  58221. ,
  58222. "undefined" != typeof i ? ("undefined" != typeof t && t.exports && (i = t.exports = n),
  58223. i.THREE = n) : this.THREE = n
  58224. window.THREE = n
  58225. }
  58226. , {}]
  58227. }, {}, [116]);
  58228. function initTransitionPass(THREE){
  58229. THREE.TransitionPass = function ( scene, camera ) {
  58230. this.renderScene = scene;
  58231. this.renderCamera = camera;
  58232. this.coverRenderTarget = new THREE.WebGLRenderTarget( 100, 100, {
  58233. minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter,
  58234. format: THREE.RGBAFormat
  58235. });
  58236. this.coverTex = this.coverRenderTarget.texture;
  58237. this.enabled = false;
  58238. this.oldClearColor = new THREE.Color();
  58239. this.oldClearAlpha = 1;
  58240. this.camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
  58241. this.scene = new THREE.Scene();
  58242. this.material = this.getMaskMaterial()
  58243. var copyShader = THREE.CopyShader;
  58244. this.materialCopy = new THREE.ShaderMaterial( {
  58245. uniforms: this.copyUniforms,
  58246. vertexShader: copyShader.vertexShader,
  58247. fragmentShader: copyShader.fragmentShader,
  58248. blending: THREE.NoBlending,
  58249. depthTest: false,
  58250. depthWrite: false,
  58251. transparent: true
  58252. } );
  58253. this.quad = new THREE.Mesh( new THREE.PlaneBufferGeometry( 2, 2 ), this.material);
  58254. this.quad.frustumCulled = false; // Avoid getting clipped
  58255. this.scene.add( this.quad );
  58256. }
  58257. THREE.TransitionPass.prototype = {//波形扩散,出下一个画面
  58258. constructor: THREE.TransitionPass,
  58259. setSize: function ( width, height ) {
  58260. this.coverRenderTarget.setSize( width, height );
  58261. },
  58262. render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {
  58263. var oldAutoClear = renderer.autoClear;
  58264. renderer.autoClear = false;
  58265. var uniforms = this.quad.material.uniforms
  58266. uniforms.bgTex.value = readBuffer.texture;
  58267. uniforms.coverTex.value = this.coverTex;
  58268. uniforms.progress.value = player.model.skybox.material.uniforms.progress.value//
  58269. uniforms.screenRatio.value = player.domElement.clientWidth / player.domElement.clientHeight;// 使波纹为圆形
  58270. uniforms.screenRatio.value *= uniforms.screenRatio.value
  58271. renderer.render( this.scene, this.camera);
  58272. renderer.autoClear = oldAutoClear;
  58273. },
  58274. start:function(sceneRenderer){
  58275. this.enabled = true
  58276. //draw coverTex
  58277. this.quad.material.uniforms.progress.value = 1;
  58278. sceneRenderer.renderer.render( sceneRenderer.scene, sceneRenderer.camera, this.coverRenderTarget, true );
  58279. },
  58280. stop:function(){
  58281. this.enabled = false
  58282. }
  58283. ,
  58284. getMaskMaterial :function(){
  58285. return new THREE.ShaderMaterial( {
  58286. uniforms: {
  58287. coverTex: {
  58288. type: "t",
  58289. value: null
  58290. },
  58291. bgTex: {
  58292. type: "t",
  58293. value: null
  58294. },
  58295. progress:{
  58296. type: "f",
  58297. value: 0
  58298. },
  58299. screenRatio:{
  58300. type: "f",
  58301. value: 1
  58302. }
  58303. },
  58304. vertexShader: `
  58305. varying vec2 vUv;
  58306. void main()
  58307. {
  58308. vUv = uv;
  58309. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  58310. }
  58311. `,
  58312. fragmentShader: `
  58313. uniform sampler2D coverTex;
  58314. uniform sampler2D bgTex;
  58315. uniform float progress;
  58316. uniform float screenRatio;
  58317. varying vec2 vUv;
  58318. void main() {
  58319. const float maxRadius = 0.708; // sqrt(0.5^2+0.5^2)
  58320. const float minRadius = 0.0 ;
  58321. float radius = sqrt((vUv.x - 0.5)*(vUv.x - 0.5) + (vUv.y - 0.5)*(vUv.y - 0.5)/screenRatio);
  58322. float diff = 0.15;
  58323. float radiusIn = maxRadius * progress + minRadius * (1.0-progress);
  58324. float radiusOut = radiusIn + diff;
  58325. if(radius < radiusIn) {
  58326. gl_FragColor = texture2D(bgTex, vUv);
  58327. //gl_FragColor = vec4(0.0,0.0,1.0,1.0);//
  58328. }else if(radius>radiusOut){
  58329. gl_FragColor = texture2D(coverTex, vUv) ;
  58330. //gl_FragColor = vec4(1.0,1.0,0.0,1.0);//
  58331. }else{
  58332. vec4 color1 = texture2D(bgTex, vUv);
  58333. vec4 color2 = texture2D(coverTex, vUv);
  58334. float rotio = smoothstep(radiusIn ,radiusOut,radius);
  58335. gl_FragColor = mix(color1, color2, rotio);
  58336. }
  58337. }
  58338. `
  58339. } );
  58340. },
  58341. }
  58342. }
  58343. /*
  58344. 笔记:
  58345. 导览缩放的几处: 1 搜索smoothZoomFovTo 2 flightStepWalk里
  58346. */