main_2020_edit.js 2.5 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949
  1. if (function() {
  2. "use strict";
  3. function o(e, t) {
  4. return typeof e === t
  5. }
  6. function a(e, t) {
  7. return e instanceof t
  8. }
  9. function s(e) {
  10. return e && e.nodeType
  11. }
  12. function l(e) {
  13. return s(e) ? e : a(e, y) ? e[0] : void 0
  14. }
  15. function e(e, i, n) {
  16. return y.each(e, function(e, t) {
  17. n = i.call(t, n, e, t)
  18. }),
  19. n
  20. }
  21. function t(e, t, i) {
  22. var n, r, o;
  23. if (e === t)
  24. return !0;
  25. if (!e || !t || e.constructor !== t.constructor)
  26. return !1;
  27. for (n = 0,
  28. r = i.length; n < r; n += 1) {
  29. if (e[o = i[n]] && E(e[o].equals) && !e[o].equals(t[o]))
  30. return !1;
  31. if (e[o] !== t[o])
  32. return !1
  33. }
  34. return !0
  35. }
  36. function c(e, t, i, n) {
  37. this.left = w(e),
  38. this.top = w(t),
  39. this.width = w(i),
  40. this.height = w(n),
  41. this.right = this.left + this.width,
  42. this.bottom = this.top + this.height
  43. }
  44. function h(e, t, i, n) {
  45. this.visible = e || 0,
  46. this.viewport = t || 0,
  47. this.possible = i || 0,
  48. this.rects = n && I({}, n) || null
  49. }
  50. function r(e, t) {
  51. this.els = e,
  52. this.viewport = t
  53. }
  54. function n(e, t) {
  55. return e.val - t.val
  56. }
  57. function u(e, t) {
  58. return t.val - e.val
  59. }
  60. function d(e) {
  61. var t = c.ofContent(e, !0)
  62. , i = c.ofViewport(e, !0)
  63. , n = t.width - i.width
  64. , r = t.height - i.height;
  65. this.content = t,
  66. this.viewport = i,
  67. this.width = n <= 0 ? null : i.left / n,
  68. this.height = r <= 0 ? null : i.top / r,
  69. this.left = i.left,
  70. this.top = i.top,
  71. this.right = t.right - i.right,
  72. this.bottom = t.bottom - i.bottom
  73. }
  74. function p(e) {
  75. this.el = e || window
  76. }
  77. function f(e, t) {
  78. this.context = e,
  79. this.viewport = t,
  80. this.init()
  81. }
  82. function g(e, t, i, n) {
  83. this.context = new r(e,t),
  84. this.property = i,
  85. this.descending = n,
  86. this.init()
  87. }
  88. function m(e) {
  89. e && e !== window && e !== document ? (this.context = e,
  90. this.$autoTarget = y(e)) : this.context = window,
  91. this.init()
  92. }
  93. var i, v, y = jQuery, A = y(window), C = y(document), I = y.extend, E = y.isFunction, _ = Math.max, b = Math.min, w = Math.round, T = (i = {},
  94. v = 1,
  95. function(e) {
  96. return e ? (i[e] || (i[e] = v,
  97. v += 1),
  98. i[e]) : 0
  99. }
  100. );
  101. I(c.prototype, {
  102. equals: function(e) {
  103. return t(this, e, ["left", "top", "width", "height"])
  104. },
  105. area: function() {
  106. return this.width * this.height
  107. },
  108. relativeTo: function(e) {
  109. return new c(this.left - e.left,this.top - e.top,this.width,this.height)
  110. },
  111. intersection: function(e) {
  112. if (!a(e, c))
  113. return null;
  114. var t = _(this.left, e.left)
  115. , i = b(this.right, e.right)
  116. , n = _(this.top, e.top)
  117. , r = i - t
  118. , o = b(this.bottom, e.bottom) - n;
  119. return 0 <= r && 0 <= o ? new c(t,n,r,o) : null
  120. },
  121. envelope: function(e) {
  122. if (!a(e, c))
  123. return this;
  124. var t = b(this.left, e.left)
  125. , i = _(this.right, e.right)
  126. , n = b(this.top, e.top);
  127. return new c(t,n,i - t,_(this.bottom, e.bottom) - n)
  128. }
  129. }),
  130. I(c, {
  131. ofContent: function(e, t) {
  132. return e && e !== document && e !== window ? t ? new c(0,0,e.scrollWidth,e.scrollHeight) : new c(e.offsetLeft - e.scrollLeft,e.offsetTop - e.scrollTop,e.scrollWidth,e.scrollHeight) : new c(0,0,C.width(),C.height())
  133. },
  134. ofViewport: function(e, t) {
  135. return e && e !== document && e !== window ? t ? new c(e.scrollLeft,e.scrollTop,e.clientWidth,e.clientHeight) : new c(e.offsetLeft,e.offsetTop,e.clientWidth,e.clientHeight) : new c(A.scrollLeft(),A.scrollTop(),A.width(),A.height())
  136. },
  137. ofElement: function(e) {
  138. var t = y(e);
  139. if (!t.is(":visible"))
  140. return null;
  141. var i = t.offset();
  142. return new c(i.left,i.top,t.outerWidth(),t.outerHeight())
  143. }
  144. }),
  145. I(h.prototype, {
  146. equals: function(e) {
  147. return this.fracsEqual(e) && this.rectsEqual(e)
  148. },
  149. fracsEqual: function(e) {
  150. return t(this, e, ["visible", "viewport", "possible"])
  151. },
  152. rectsEqual: function(e) {
  153. return t(this.rects, e.rects, ["document", "element", "viewport"])
  154. }
  155. }),
  156. I(h, {
  157. of: function(e, t) {
  158. var i, n, r;
  159. return e = s(e) && c.ofElement(e) || e,
  160. t = s(t) && c.ofViewport(t) || t || c.ofViewport(),
  161. e instanceof c && (i = e.intersection(t)) ? (n = i.area(),
  162. r = b(e.width, t.width) * b(e.height, t.height),
  163. new h(n / e.area(),n / t.area(),n / r,{
  164. document: i,
  165. element: i.relativeTo(e),
  166. viewport: i.relativeTo(t)
  167. })) : new h
  168. }
  169. });
  170. var x = ["width", "height", "left", "right", "top", "bottom"]
  171. , S = ["possible", "visible", "viewport"];
  172. I(r.prototype, {
  173. sorted: function(t, e) {
  174. var i = this.viewport;
  175. return y.map(this.els, function(e) {
  176. return {
  177. el: e,
  178. val: function(e, t, i) {
  179. var n;
  180. return 0 <= y.inArray(i, x) ? n = c.ofElement(e) : 0 <= y.inArray(i, S) && (n = h.of(e, t)),
  181. n ? n[i] : 0
  182. }(e, i, t)
  183. }
  184. }).sort(e ? u : n)
  185. },
  186. best: function(e, t) {
  187. return this.els.length ? this.sorted(e, t)[0] : null
  188. }
  189. }),
  190. I(d.prototype, {
  191. equals: function(e) {
  192. return t(this, e, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  193. }
  194. }),
  195. I(p.prototype, {
  196. equals: function(e) {
  197. return t(this, e, ["el"])
  198. },
  199. scrollState: function() {
  200. return new d(this.el)
  201. },
  202. scrollTo: function(e, t, i) {
  203. var n = y(this.el === window ? "html,body" : this.el);
  204. e = e || 0,
  205. t = t || 0,
  206. i = isNaN(i) ? 1e3 : i,
  207. n.stop(!0).animate({
  208. scrollLeft: e,
  209. scrollTop: t
  210. }, i)
  211. },
  212. scroll: function(e, t, i) {
  213. var n = this.el === window ? A : y(this.el);
  214. e = e || 0,
  215. t = t || 0,
  216. this.scrollTo(n.scrollLeft() + e, n.scrollTop() + t, i)
  217. },
  218. scrollToRect: function(e, t, i, n) {
  219. t = t || 0,
  220. i = i || 0,
  221. this.scrollTo(e.left - t, e.top - i, n)
  222. },
  223. scrollToElement: function(e, t, i, n) {
  224. var r = c.ofElement(e).relativeTo(c.ofContent(this.el));
  225. this.scrollToRect(r, t, i, n)
  226. }
  227. });
  228. var M = {
  229. init: function() {
  230. this.callbacks = y.Callbacks("memory unique"),
  231. this.currVal = null,
  232. this.prevVal = null,
  233. this.checkProxy = y.proxy(this.check, this),
  234. this.autoCheck()
  235. },
  236. bind: function(e) {
  237. this.callbacks.add(e)
  238. },
  239. unbind: function(e) {
  240. e ? this.callbacks.remove(e) : this.callbacks.empty()
  241. },
  242. trigger: function() {
  243. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  244. },
  245. check: function(e) {
  246. var t = this.updatedValue(e);
  247. return void 0 !== t && (this.prevVal = this.currVal,
  248. this.currVal = t,
  249. this.trigger(),
  250. !0)
  251. },
  252. $autoTarget: A,
  253. autoEvents: "load resize scroll",
  254. autoCheck: function(e) {
  255. this.$autoTarget[!1 === e ? "off" : "on"](this.autoEvents, this.checkProxy)
  256. }
  257. };
  258. I(f.prototype, M, {
  259. updatedValue: function() {
  260. var e = h.of(this.context, this.viewport);
  261. return this.currVal && this.currVal.equals(e) ? void 0 : e
  262. }
  263. }),
  264. I(g.prototype, M, {
  265. updatedValue: function() {
  266. var e = this.context.best(this.property, this.descending);
  267. return e && (e = 0 < e.val ? e.el : null,
  268. this.currVal !== e) ? e : void 0
  269. }
  270. }),
  271. I(m.prototype, M, {
  272. updatedValue: function() {
  273. var e = new d(this.context);
  274. return this.currVal && this.currVal.equals(e) ? void 0 : e
  275. }
  276. });
  277. var R, P, O, L, D, N, F, B, V, k, U = "fracs";
  278. function H(e, t, i, n) {
  279. return i = N(i) ? i.apply(e, t) : i,
  280. N(n[i]) ? n[i].apply(e, t) : void L.error('Method "' + i + '" does not exist on jQuery.' + R)
  281. }
  282. R = U,
  283. P = {
  284. statics: {
  285. version: "0.15.0",
  286. Rect: c,
  287. Fractions: h,
  288. Group: r,
  289. ScrollState: d,
  290. Viewport: p,
  291. FracsCallbacks: f,
  292. GroupCallbacks: g,
  293. ScrollStateCallbacks: m,
  294. fracs: function(e, t) {
  295. return h.of(e, t)
  296. }
  297. },
  298. methods: {
  299. content: function(e) {
  300. return this.length ? c.ofContent(this[0], e) : null
  301. },
  302. envelope: function() {
  303. return e(this, function(e) {
  304. var t = c.ofElement(this);
  305. return e ? e.envelope(t) : t
  306. })
  307. },
  308. fracs: function(e, i, n) {
  309. o(e, "string") || (n = i,
  310. i = e,
  311. e = null),
  312. E(i) || (n = i,
  313. i = null),
  314. n = l(n);
  315. var r = U + ".fracs." + T(n);
  316. return "unbind" === e ? this.each(function() {
  317. var e = y(this).data(r);
  318. e && e.unbind(i)
  319. }) : "check" === e ? this.each(function() {
  320. var e = y(this).data(r);
  321. e && e.check()
  322. }) : E(i) ? this.each(function() {
  323. var e = y(this)
  324. , t = e.data(r);
  325. t || (t = new f(this,n),
  326. e.data(r, t)),
  327. t.bind(i)
  328. }) : this.length ? h.of(this[0], n) : null
  329. },
  330. intersection: function() {
  331. return e(this, function(e) {
  332. var t = c.ofElement(this);
  333. return e ? e.intersection(t) : t
  334. })
  335. },
  336. max: function(e, t, i) {
  337. return E(t) || (i = t,
  338. t = null),
  339. i = l(i),
  340. t ? (new g(this,i,e,!0).bind(t),
  341. this) : this.pushStack(new r(this,i).best(e, !0).el)
  342. },
  343. min: function(e, t, i) {
  344. return E(t) || (i = t,
  345. t = null),
  346. i = l(i),
  347. t ? (new g(this,i,e).bind(t),
  348. this) : this.pushStack(new r(this,i).best(e).el)
  349. },
  350. rect: function() {
  351. return this.length ? c.ofElement(this[0]) : null
  352. },
  353. scrollState: function(e, i) {
  354. var n = U + ".scrollState";
  355. return o(e, "string") || (i = e,
  356. e = null),
  357. "unbind" === e ? this.each(function() {
  358. var e = y(this).data(n);
  359. e && e.unbind(i)
  360. }) : "check" === e ? this.each(function() {
  361. var e = y(this).data(n);
  362. e && e.check()
  363. }) : E(i) ? this.each(function() {
  364. var e = y(this)
  365. , t = e.data(n);
  366. t || (t = new m(this),
  367. e.data(n, t)),
  368. t.bind(i)
  369. }) : this.length ? new d(this[0]) : null
  370. },
  371. scroll: function(e, t, i) {
  372. return this.each(function() {
  373. new p(this).scroll(e, t, i)
  374. })
  375. },
  376. scrollTo: function(e, t, i, n) {
  377. return y.isNumeric(e) && (n = i,
  378. i = t,
  379. t = e,
  380. e = null),
  381. e = l(e),
  382. this.each(function() {
  383. e ? new p(this).scrollToElement(e, t, i, n) : new p(this).scrollTo(t, i, n)
  384. })
  385. },
  386. scrollToThis: function(e, t, i, n) {
  387. return (n = new p(l(n))).scrollToElement(this[0], e, t, i),
  388. this
  389. },
  390. softLink: function(t, i, n, r) {
  391. return r = new p(l(r)),
  392. this.filter("a[href^=#]").each(function() {
  393. var e = y(this);
  394. e.on("click", function() {
  395. r.scrollToElement(y(e.attr("href"))[0], t, i, n)
  396. })
  397. })
  398. },
  399. sort: function(e, t, i) {
  400. return o(t, "boolean") || (i = t,
  401. t = null),
  402. i = l(i),
  403. this.pushStack(y.map(new r(this,i).sorted(e, !t), function(e) {
  404. return e.el
  405. }))
  406. },
  407. viewport: function(e) {
  408. return this.length ? c.ofViewport(this[0], e) : null
  409. }
  410. },
  411. defaultStatic: "fracs",
  412. defaultMethod: "fracs"
  413. },
  414. O = [].slice,
  415. L = jQuery,
  416. D = L.extend,
  417. N = L.isFunction,
  418. F = D({}, P),
  419. B = function() {
  420. return H(this, O.call(arguments), F.defaultStatic, B)
  421. }
  422. ,
  423. V = function(e) {
  424. return N(V[e]) ? V[e].apply(this, O.call(arguments, 1)) : H(this, O.call(arguments), F.defaultMethod, V)
  425. }
  426. ,
  427. (k = function(e) {
  428. e && (D(B, e.statics),
  429. D(V, e.methods)),
  430. B.modplug = k
  431. }
  432. ).prev = {
  433. statics: L[R],
  434. methods: L.fn[R]
  435. },
  436. k(P),
  437. L[R] = B,
  438. L.fn[R] = V
  439. }(),
  440. "undefined" == typeof jQuery)
  441. throw new Error("Bootstrap's JavaScript requires jQuery");
  442. !function(m) {
  443. "use strict";
  444. function r(e, t) {
  445. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  446. this.init("tooltip", e, t)
  447. }
  448. r.VERSION = "3.2.0",
  449. r.DEFAULTS = {
  450. animation: !0,
  451. placement: "top",
  452. selector: !1,
  453. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  454. trigger: "hover focus",
  455. title: "",
  456. delay: 0,
  457. html: !1,
  458. container: !1,
  459. viewport: {
  460. selector: "body",
  461. padding: 0
  462. }
  463. },
  464. r.prototype.init = function(e, t, i) {
  465. this.enabled = !0,
  466. this.type = e,
  467. this.$element = m(t),
  468. this.options = this.getOptions(i),
  469. this.$viewport = this.options.viewport && m(this.options.viewport.selector || this.options.viewport);
  470. for (var n = this.options.trigger.split(" "), r = n.length; r--; ) {
  471. var o = n[r];
  472. if ("click" == o)
  473. this.$element.on("click." + this.type, this.options.selector, m.proxy(this.toggle, this));
  474. else if ("manual" != o) {
  475. var a = "hover" == o ? "mouseenter" : "focusin"
  476. , s = "hover" == o ? "mouseleave" : "focusout";
  477. this.$element.on(a + "." + this.type, this.options.selector, m.proxy(this.enter, this)),
  478. this.$element.on(s + "." + this.type, this.options.selector, m.proxy(this.leave, this))
  479. }
  480. }
  481. this.options.selector ? this._options = m.extend({}, this.options, {
  482. trigger: "manual",
  483. selector: ""
  484. }) : this.fixTitle()
  485. }
  486. ,
  487. r.prototype.getDefaults = function() {
  488. return r.DEFAULTS
  489. }
  490. ,
  491. r.prototype.getOptions = function(e) {
  492. return (e = m.extend({}, this.getDefaults(), this.$element.data(), e)).delay && "number" == typeof e.delay && (e.delay = {
  493. show: e.delay,
  494. hide: e.delay
  495. }),
  496. e
  497. }
  498. ,
  499. r.prototype.getDelegateOptions = function() {
  500. var i = {}
  501. , n = this.getDefaults();
  502. return this._options && m.each(this._options, function(e, t) {
  503. n[e] != t && (i[e] = t)
  504. }),
  505. i
  506. }
  507. ,
  508. r.prototype.enter = function(e) {
  509. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  510. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  511. m(e.currentTarget).data("bs." + this.type, t)),
  512. clearTimeout(t.timeout),
  513. t.hoverState = "in",
  514. t.options.delay && t.options.delay.show ? void (t.timeout = setTimeout(function() {}, t.options.delay.show)) : t.show()
  515. }
  516. ,
  517. r.prototype.leave = function(e) {
  518. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  519. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  520. m(e.currentTarget).data("bs." + this.type, t)),
  521. clearTimeout(t.timeout),
  522. t.hoverState = "out",
  523. t.options.delay && t.options.delay.hide ? void (t.timeout = setTimeout(function() {
  524. "out" == t.hoverState && t.hide()
  525. }, t.options.delay.hide)) : t.hide()
  526. }
  527. ,
  528. r.prototype.show = function() {
  529. var e = m.Event("show.bs." + this.type);
  530. if (this.hasContent() && this.enabled) {
  531. this.$element.trigger(e);
  532. var t = m.contains(document.documentElement, this.$element[0]);
  533. if (e.isDefaultPrevented() || !t)
  534. return;
  535. var i = this
  536. , n = this.tip()
  537. , r = this.getUID(this.type);
  538. this.setContent(),
  539. n.attr("id", r),
  540. this.$element.attr("aria-describedby", r),
  541. this.options.animation && n.addClass("fade");
  542. var o = "function" == typeof this.options.placement ? this.options.placement.call(this, n[0], this.$element[0]) : this.options.placement
  543. , a = /\s?auto?\s?/i
  544. , s = a.test(o);
  545. s && (o = o.replace(a, "") || "top"),
  546. n.detach().css({
  547. top: 0,
  548. left: 0,
  549. display: "block"
  550. }).addClass(o).data("bs." + this.type, this),
  551. this.options.container ? n.appendTo(this.options.container) : n.insertAfter(this.$element);
  552. var l = this.getPosition()
  553. , c = n[0].offsetWidth
  554. , h = n[0].offsetHeight;
  555. if (s) {
  556. var u = o
  557. , d = this.$element.parent()
  558. , p = this.getPosition(d);
  559. o = "bottom" == o && l.top + l.height + h - p.scroll > p.height ? "top" : "top" == o && l.top - p.scroll - h < 0 ? "bottom" : "right" == o && l.right + c > p.width ? "left" : "left" == o && l.left - c < p.left ? "right" : o,
  560. n.removeClass(u).addClass(o)
  561. }
  562. var f = this.getCalculatedOffset(o, l, c, h);
  563. this.applyPlacement(f, o);
  564. var g = function() {
  565. i.$element.trigger("shown.bs." + i.type),
  566. i.hoverState = null
  567. };
  568. m.support.transition && this.$tip.hasClass("fade") ? n.one("bsTransitionEnd", g).emulateTransitionEnd(150) : g()
  569. }
  570. }
  571. ,
  572. r.prototype.applyPlacement = function(e, t) {
  573. var i = this.tip()
  574. , n = i[0].offsetWidth
  575. , r = i[0].offsetHeight
  576. , o = parseInt(i.css("margin-top"), 10)
  577. , a = parseInt(i.css("margin-left"), 10);
  578. isNaN(o) && (o = 0),
  579. isNaN(a) && (a = 0),
  580. e.top = e.top + o,
  581. e.left = e.left + a,
  582. m.offset.setOffset(i[0], m.extend({
  583. using: function(e) {
  584. i.css({
  585. top: Math.round(e.top),
  586. left: Math.round(e.left)
  587. })
  588. }
  589. }, e), 0),
  590. i.addClass("in");
  591. var s = i[0].offsetWidth
  592. , l = i[0].offsetHeight;
  593. "top" == t && l != r && (e.top = e.top + r - l);
  594. var c = this.getViewportAdjustedDelta(t, e, s, l);
  595. c.left ? e.left += c.left : e.top += c.top;
  596. var h = c.left ? 2 * c.left - n + s : 2 * c.top - r + l
  597. , u = c.left ? "left" : "top"
  598. , d = c.left ? "offsetWidth" : "offsetHeight";
  599. i.offset(e),
  600. this.replaceArrow(h, i[0][d], u)
  601. }
  602. ,
  603. r.prototype.replaceArrow = function(e, t, i) {
  604. this.arrow().css(i, e ? 50 * (1 - e / t) + "%" : "")
  605. }
  606. ,
  607. r.prototype.setContent = function() {
  608. var e = this.tip()
  609. , t = this.getTitle();
  610. e.find(".tooltip-inner")[this.options.html ? "html" : "text"](t),
  611. e.removeClass("fade in top bottom left right")
  612. }
  613. ,
  614. r.prototype.hide = function() {
  615. function e() {
  616. "in" != t.hoverState && i.detach(),
  617. t.$element.trigger("hidden.bs." + t.type)
  618. }
  619. var t = this
  620. , i = this.tip()
  621. , n = m.Event("hide.bs." + this.type);
  622. if (this.$element.removeAttr("aria-describedby"),
  623. this.$element.trigger(n),
  624. !n.isDefaultPrevented())
  625. return i.removeClass("in"),
  626. m.support.transition && this.$tip.hasClass("fade") ? i.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  627. this.hoverState = null,
  628. this
  629. }
  630. ,
  631. r.prototype.fixTitle = function() {
  632. var e = this.$element;
  633. !e.attr("title") && "string" == typeof e.attr("data-original-title") || e.attr("data-original-title", e.attr("title") || "").attr("title", "")
  634. }
  635. ,
  636. r.prototype.hasContent = function() {
  637. return this.getTitle()
  638. }
  639. ,
  640. r.prototype.getPosition = function(e) {
  641. var t = (e = e || this.$element)[0]
  642. , i = "BODY" == t.tagName;
  643. return m.extend({}, "function" == typeof t.getBoundingClientRect ? t.getBoundingClientRect() : null, {
  644. scroll: i ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  645. width: i ? m(window).width() : e.outerWidth(),
  646. height: i ? m(window).height() : e.outerHeight()
  647. }, i ? {
  648. top: 0,
  649. left: 0
  650. } : e.offset())
  651. }
  652. ,
  653. r.prototype.getCalculatedOffset = function(e, t, i, n) {
  654. return "bottom" == e ? {
  655. top: t.top + t.height,
  656. left: t.left + t.width / 2 - i / 2
  657. } : "top" == e ? {
  658. top: t.top - n,
  659. left: t.left + t.width / 2 - i / 2
  660. } : "left" == e ? {
  661. top: t.top + t.height / 2 - n / 2,
  662. left: t.left - i
  663. } : {
  664. top: t.top + t.height / 2 - n / 2,
  665. left: t.left + t.width
  666. }
  667. }
  668. ,
  669. r.prototype.getViewportAdjustedDelta = function(e, t, i, n) {
  670. var r = {
  671. top: 0,
  672. left: 0
  673. };
  674. if (!this.$viewport)
  675. return r;
  676. var o = this.options.viewport && this.options.viewport.padding || 0
  677. , a = this.getPosition(this.$viewport);
  678. if (/right|left/.test(e)) {
  679. var s = t.top - o - a.scroll
  680. , l = t.top + o - a.scroll + n;
  681. s < a.top ? r.top = a.top - s : l > a.top + a.height && (r.top = a.top + a.height - l)
  682. } else {
  683. var c = t.left - o
  684. , h = t.left + o + i;
  685. c < a.left ? r.left = a.left - c : h > a.width && (r.left = a.left + a.width - h)
  686. }
  687. return r
  688. }
  689. ,
  690. r.prototype.getTitle = function() {
  691. var e = this.$element
  692. , t = this.options;
  693. return e.attr("data-original-title") || ("function" == typeof t.title ? t.title.call(e[0]) : t.title)
  694. }
  695. ,
  696. r.prototype.getUID = function(e) {
  697. for (; e += ~~(1e6 * Math.random()),
  698. document.getElementById(e); )
  699. ;
  700. return e
  701. }
  702. ,
  703. r.prototype.tip = function() {
  704. return this.$tip = this.$tip || m(this.options.template)
  705. }
  706. ,
  707. r.prototype.arrow = function() {
  708. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  709. }
  710. ,
  711. r.prototype.validate = function() {
  712. this.$element[0].parentNode || (this.hide(),
  713. this.$element = null,
  714. this.options = null)
  715. }
  716. ,
  717. r.prototype.enable = function() {
  718. this.enabled = !0
  719. }
  720. ,
  721. r.prototype.disable = function() {
  722. this.enabled = !1
  723. }
  724. ,
  725. r.prototype.toggleEnabled = function() {
  726. this.enabled = !this.enabled
  727. }
  728. ,
  729. r.prototype.toggle = function(e) {
  730. var t = this;
  731. e && ((t = m(e.currentTarget).data("bs." + this.type)) || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  732. m(e.currentTarget).data("bs." + this.type, t))),
  733. t.tip().hasClass("in") ? t.leave(t) : t.enter(t)
  734. }
  735. ,
  736. r.prototype.destroy = function() {
  737. clearTimeout(this.timeout),
  738. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  739. }
  740. ;
  741. var e = m.fn.tooltip;
  742. m.fn.tooltip = function(n) {
  743. return this.each(function() {
  744. var e = m(this)
  745. , t = e.data("bs.tooltip")
  746. , i = "object" == typeof n && n;
  747. !t && "destroy" == n || (t || e.data("bs.tooltip", t = new r(this,i)),
  748. "string" == typeof n && t[n]())
  749. })
  750. }
  751. ,
  752. m.fn.tooltip.Constructor = r,
  753. m.fn.tooltip.noConflict = function() {
  754. return m.fn.tooltip = e,
  755. this
  756. }
  757. }(jQuery),
  758. function(e, t, i) {
  759. "undefined" != typeof module && module.exports ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : t.Keen = i()
  760. }(0, this, function() {
  761. "use strict";
  762. function Keen() {
  763. return _init.apply(this, arguments)
  764. }
  765. function _init(e) {
  766. if (_isUndefined(e))
  767. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  768. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  769. throw new Error("Please provide a projectId");
  770. this.configure(e)
  771. }
  772. function _extend(e) {
  773. for (var t = 1; t < arguments.length; t++)
  774. for (var i in arguments[t])
  775. e[i] = arguments[t][i];
  776. return e
  777. }
  778. function _isUndefined(e) {
  779. return void 0 === e
  780. }
  781. function _type(e) {
  782. var t = e && e.constructor ? e.constructor.toString() : void 0;
  783. return t ? t.match(/function (.*)\(/)[1] : "Null"
  784. }
  785. function _each(e, t, i) {
  786. var n;
  787. if (!e)
  788. return 0;
  789. if (i = i || e,
  790. "array" === _type(e)) {
  791. for (n = 0; n < e.length; n++)
  792. if (!1 === t.call(i, e[n], n, e))
  793. return 0
  794. } else
  795. for (n in e)
  796. if (e.hasOwnProperty(n) && !1 === t.call(i, e[n], n, e))
  797. return 0;
  798. return 1
  799. }
  800. function _parse_params(e) {
  801. for (var t, i = {}, n = /\+/g, r = /([^&=]+)=?([^&]*)/g, o = function(e) {
  802. return decodeURIComponent(e.replace(n, " "))
  803. }, a = e.split("?")[1]; t = r.exec(a); )
  804. i[o(t[1])] = o(t[2]);
  805. return i
  806. }
  807. function _set_protocol(e) {
  808. switch (e) {
  809. case "http":
  810. return "http";
  811. case "auto":
  812. return location.protocol.replace(/:/g, "");
  813. case "https":
  814. case void 0:
  815. default:
  816. return "https"
  817. }
  818. }
  819. function _set_request_type(e) {
  820. var t = e || "jsonp"
  821. , i = !1;
  822. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (i = !0),
  823. null == t || "xhr" == t ? i ? "xhr" : "jsonp" : t
  824. }
  825. function _build_url(e) {
  826. return this.client.endpoint + "/projects/" + this.client.projectId + e
  827. }
  828. function _uploadEvent(e, t, i, n, r) {
  829. var o = _build_url.apply(this, ["/events/" + e])
  830. , a = {};
  831. for (var s in i = !1 !== i,
  832. this.client.globalProperties && (a = this.client.globalProperties(e)),
  833. t)
  834. t.hasOwnProperty(s) && (a[s] = t[s]);
  835. switch (this.client.requestType) {
  836. case "xhr":
  837. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, i, n, r]);
  838. break;
  839. case "jsonp":
  840. var l = JSON.stringify(a)
  841. , c = Keen.Base64.encode(l);
  842. o = (o = (o = o + "?api_key=" + this.client.writeKey) + "&data=" + c) + "&modified=" + (new Date).getTime(),
  843. _request.jsonp.apply(this, [o, this.client.writeKey, n, r]);
  844. break;
  845. case "beacon":
  846. l = JSON.stringify(a),
  847. c = Keen.Base64.encode(l);
  848. o = (o = (o = o + "?api_key=" + encodeURIComponent(this.client.writeKey)) + "&data=" + encodeURIComponent(c)) + "&modified=" + encodeURIComponent((new Date).getTime()),
  849. o += "&c=clv1",
  850. _request.beacon.apply(this, [o, null, n, r])
  851. }
  852. }
  853. Keen.prototype.configure = function(e) {
  854. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  855. e.protocol = _set_protocol(e.protocol),
  856. e.requestType = _set_request_type(e.requestType),
  857. this.client = {
  858. projectId: e.projectId,
  859. writeKey: e.writeKey,
  860. readKey: e.readKey,
  861. globalProperties: null,
  862. endpoint: e.protocol + "://" + e.host,
  863. requestType: e.requestType
  864. },
  865. Keen.trigger("client", this, e),
  866. this.trigger("ready"),
  867. this
  868. }
  869. ;
  870. var _request = {
  871. xhr: function(e, t, i, n, r, o, a, s) {
  872. if (!r)
  873. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  874. var l = new XMLHttpRequest;
  875. if (l.onreadystatechange = function() {
  876. if (4 == l.readyState)
  877. if (200 <= l.status && l.status < 300) {
  878. var e;
  879. try {
  880. e = JSON.parse(l.responseText)
  881. } catch (e) {
  882. Keen.log("Could not JSON parse HTTP response: " + l.responseText),
  883. s && s(l, e)
  884. }
  885. a && e && a(e)
  886. } else
  887. Keen.log("HTTP request failed."),
  888. s && s(l, null)
  889. }
  890. ,
  891. l.open(e, t, o),
  892. r && l.setRequestHeader("Authorization", r),
  893. n && l.setRequestHeader("Content-Type", "application/json"),
  894. i)
  895. for (var c in i)
  896. i.hasOwnProperty(c) && l.setRequestHeader(c, i[c]);
  897. var h = n ? JSON.stringify(n) : null;
  898. l.send(h)
  899. },
  900. jsonp: function(e, t, i, n) {
  901. if (!t)
  902. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  903. if (t && e.indexOf("api_key") < 0) {
  904. var r = 0 < e.indexOf("?") ? "&" : "?";
  905. e = e + r + "api_key=" + t
  906. }
  907. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  908. o += "a";
  909. var a = !1;
  910. window[o] = function(e) {
  911. a = !0,
  912. i && e && i(e),
  913. window[o] = void 0
  914. }
  915. ,
  916. e = e + "&jsonp=" + o;
  917. var s = document.createElement("script");
  918. s.id = "keen-jsonp",
  919. s.src = e,
  920. document.getElementsByTagName("head")[0].appendChild(s),
  921. s.onreadystatechange = function() {
  922. !1 === a && "loaded" === this.readyState && (a = !0,
  923. n && n())
  924. }
  925. ,
  926. s.onerror = function() {
  927. !1 === a && (a = !0,
  928. n && n())
  929. }
  930. },
  931. beacon: function(e, t, i, n) {
  932. if (t && e.indexOf("api_key") < 0) {
  933. var r = 0 < e.indexOf("?") ? "&" : "?";
  934. e = e + r + "api_key=" + t
  935. }
  936. var o = document.createElement("img");
  937. o.onload = function() {
  938. if (!0,
  939. "naturalHeight"in this) {
  940. if (this.naturalHeight + this.naturalWidth === 0)
  941. return void this.onerror()
  942. } else if (this.width + this.height === 0)
  943. return void this.onerror();
  944. i && i({
  945. created: !0
  946. })
  947. }
  948. ,
  949. o.onerror = function() {
  950. !0,
  951. n && n()
  952. }
  953. ,
  954. o.src = e
  955. }
  956. }
  957. , Events = Keen.Events = {
  958. on: function(e, t) {
  959. return this.listeners || (this.listeners = {}),
  960. (this.listeners[e] || (this.listeners[e] = [])).push({
  961. callback: t
  962. }),
  963. this
  964. },
  965. off: function(e, t) {
  966. if (!e && !t)
  967. return this.listeners = void 0,
  968. delete this.listeners,
  969. this;
  970. for (var i = this.listeners[e] || [], n = i.length; n--; )
  971. t && t == i[n].callback && this.listeners[e].splice(n, 1),
  972. t && 0 != i.length || (this.listeners[e] = void 0,
  973. delete this.listeners[e]);
  974. return this
  975. },
  976. trigger: function(e) {
  977. if (!this.listeners)
  978. return this;
  979. for (var t = Array.prototype.slice.call(arguments, 1), i = this.listeners[e] || [], n = 0; n < i.length; n++)
  980. i[n].callback.apply(this, t);
  981. return this
  982. }
  983. };
  984. _extend(Keen.prototype, Events),
  985. _extend(Keen, Events),
  986. Keen.loaded = !0,
  987. Keen.utils = {
  988. each: _each,
  989. extend: _extend,
  990. parseParams: _parse_params
  991. },
  992. Keen.ready = function(e) {
  993. Keen.loaded ? e() : Keen.on("ready", e)
  994. }
  995. ,
  996. Keen.log = function(e) {
  997. "object" == typeof console && console.log("[Keen IO]", e)
  998. }
  999. ;
  1000. var Plugins = Keen.Plugins = {}, Hh, Ih;
  1001. Keen.prototype.addEvent = function() {
  1002. _uploadEvent.apply(this, arguments)
  1003. }
  1004. ,
  1005. Keen.prototype.addEventSync = function(e, t, i, n) {
  1006. _uploadEvent.apply(this, [e, t, !1, i, n])
  1007. }
  1008. ,
  1009. Keen.prototype.trackExternalLink = function(e, t, i, n, r) {
  1010. var o = e
  1011. , a = o.metaKey
  1012. , s = o.target
  1013. , l = !1
  1014. , c = function() {};
  1015. return void 0 === n && (n = 500),
  1016. "A" === s.nodeName ? c = function() {
  1017. a || l || (l = !0,
  1018. window.location = s.href)
  1019. }
  1020. : "FORM" === s.nodeName && (c = function() {
  1021. l || (l = !0,
  1022. s.submit())
  1023. }
  1024. ),
  1025. r && (c = function() {
  1026. l || (l = !0,
  1027. r())
  1028. }
  1029. ),
  1030. _uploadEvent.call(this, t, i, c, c),
  1031. setTimeout(function() {
  1032. c()
  1033. }, n),
  1034. !!a && void 0
  1035. }
  1036. ,
  1037. Keen.prototype.setGlobalProperties = function(e) {
  1038. if (!this.client)
  1039. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1040. if (!e || "function" != typeof e)
  1041. throw new Error("Invalid value for global properties: " + e);
  1042. this.client.globalProperties = e
  1043. }
  1044. ,
  1045. Keen.Base64 = {
  1046. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1047. encode: function(e) {
  1048. var t, i, n, r, o, a, s, l = "", c = 0, h = this.map;
  1049. for (e = this.utf8.encode(e); c < e.length; )
  1050. t = e.charCodeAt(c++),
  1051. i = e.charCodeAt(c++),
  1052. n = e.charCodeAt(c++),
  1053. r = t >> 2,
  1054. o = (3 & t) << 4 | i >> 4,
  1055. a = isNaN(i) ? 64 : (15 & i) << 2 | n >> 6,
  1056. s = isNaN(i) || isNaN(n) ? 64 : 63 & n,
  1057. l = l + h.charAt(r) + h.charAt(o) + h.charAt(a) + h.charAt(s);
  1058. return l
  1059. },
  1060. decode: function(e) {
  1061. var t, i, n, r, o, a, s = "", l = 0, c = this.map, h = String.fromCharCode;
  1062. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1063. t = c.indexOf(e.charAt(l++)),
  1064. o = (15 & (i = c.indexOf(e.charAt(l++)))) << 4 | (n = c.indexOf(e.charAt(l++))) >> 2,
  1065. a = (3 & n) << 6 | (r = c.indexOf(e.charAt(l++))),
  1066. s = s + (h(t << 2 | i >> 4) + (64 != n ? h(o) : "")) + (64 != r ? h(a) : "");
  1067. return this.utf8.decode(s)
  1068. },
  1069. utf8: {
  1070. encode: function(e) {
  1071. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1072. i += (t = e.charCodeAt(n++)) < 128 ? r(t) : 127 < t && t < 2048 ? r(t >> 6 | 192) + r(63 & t | 128) : r(t >> 12 | 224) + r(t >> 6 & 63 | 128) + r(63 & t | 128);
  1073. return i
  1074. },
  1075. decode: function(e) {
  1076. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1077. i += (t = e.charCodeAt(n)) < 128 ? [r(t), n++][0] : 191 < t && t < 224 ? [r((31 & t) << 6 | 63 & e.charCodeAt(n + 1)), n += 2][0] : [r((15 & t) << 12 | (63 & e.charCodeAt(n + 1)) << 6 | 63 & (c3 = e.charCodeAt(n + 2))), n += 3][0];
  1078. return i
  1079. }
  1080. }
  1081. },
  1082. "object" != typeof JSON && (JSON = {}),
  1083. function() {
  1084. function f(e) {
  1085. return e < 10 ? "0" + e : e
  1086. }
  1087. function quote(e) {
  1088. return escapable.lastIndex = 0,
  1089. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1090. var t = meta[e];
  1091. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1092. }) + '"' : '"' + e + '"'
  1093. }
  1094. function str(e, t) {
  1095. var i, n, r, o, a, s = gap, l = t[e];
  1096. switch (l && "object" == typeof l && "function" == typeof l.toJSON && (l = l.toJSON(e)),
  1097. "function" == typeof rep && (l = rep.call(t, e, l)),
  1098. typeof l) {
  1099. case "string":
  1100. return quote(l);
  1101. case "number":
  1102. return isFinite(l) ? String(l) : "null";
  1103. case "boolean":
  1104. case "null":
  1105. return String(l);
  1106. case "object":
  1107. if (!l)
  1108. return "null";
  1109. if (gap += indent,
  1110. a = [],
  1111. "[object Array]" === Object.prototype.toString.apply(l)) {
  1112. for (o = l.length,
  1113. i = 0; i < o; i += 1)
  1114. a[i] = str(i, l) || "null";
  1115. return r = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + s + "]" : "[" + a.join(",") + "]",
  1116. gap = s,
  1117. r
  1118. }
  1119. if (rep && "object" == typeof rep)
  1120. for (o = rep.length,
  1121. i = 0; i < o; i += 1)
  1122. "string" == typeof rep[i] && ((r = str(n = rep[i], l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1123. else
  1124. for (n in l)
  1125. Object.prototype.hasOwnProperty.call(l, n) && ((r = str(n, l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1126. return r = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + s + "}" : "{" + a.join(",") + "}",
  1127. gap = s,
  1128. r
  1129. }
  1130. }
  1131. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1132. 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
  1133. }
  1134. ,
  1135. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1136. return this.valueOf()
  1137. }
  1138. );
  1139. 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 = {
  1140. "\b": "\\b",
  1141. "\t": "\\t",
  1142. "\n": "\\n",
  1143. "\f": "\\f",
  1144. "\r": "\\r",
  1145. '"': '\\"',
  1146. "\\": "\\\\"
  1147. }, rep;
  1148. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, i) {
  1149. var n;
  1150. if (indent = gap = "",
  1151. "number" == typeof i)
  1152. for (n = 0; n < i; n += 1)
  1153. indent += " ";
  1154. else
  1155. "string" == typeof i && (indent = i);
  1156. if ((rep = t) && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1157. throw new Error("JSON.stringify");
  1158. return str("", {
  1159. "": e
  1160. })
  1161. }
  1162. ),
  1163. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1164. function walk(e, t) {
  1165. var i, n, r = e[t];
  1166. if (r && "object" == typeof r)
  1167. for (i in r)
  1168. Object.prototype.hasOwnProperty.call(r, i) && (void 0 !== (n = walk(r, i)) ? r[i] = n : delete r[i]);
  1169. return reviver.call(e, t, r)
  1170. }
  1171. var j;
  1172. if (text = String(text),
  1173. cx.lastIndex = 0,
  1174. cx.test(text) && (text = text.replace(cx, function(e) {
  1175. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1176. })),
  1177. /^[\],:{}\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, "")))
  1178. return j = eval("(" + text + ")"),
  1179. "function" == typeof reviver ? walk({
  1180. "": j
  1181. }, "") : j;
  1182. throw new SyntaxError("JSON.parse")
  1183. }
  1184. )
  1185. }(),
  1186. Hh = Keen.utils,
  1187. Ih = function(i) {
  1188. function e(e) {
  1189. for (u = 1; e = n.shift(); )
  1190. e()
  1191. }
  1192. var t, n = [], r = document, o = r.documentElement, a = o.doScroll, s = "DOMContentLoaded", l = "addEventListener", c = "onreadystatechange", h = "readyState", u = (a ? /^loaded|^c/ : /^loaded|c/).test(r[h]);
  1193. return r[l] && r[l](s, t = function() {
  1194. r.removeEventListener(s, t, !1),
  1195. e()
  1196. }
  1197. , !1),
  1198. a && r.attachEvent(c, t = function() {
  1199. /^c/.test(r[h]) && (r.detachEvent(c, t),
  1200. e())
  1201. }
  1202. ),
  1203. i = a ? function(t) {
  1204. self != top ? u ? t() : n.push(t) : function() {
  1205. try {
  1206. o.doScroll("left")
  1207. } catch (e) {
  1208. return setTimeout(function() {
  1209. i(t)
  1210. }, 50)
  1211. }
  1212. t()
  1213. }()
  1214. }
  1215. : function(e) {
  1216. u ? e() : n.push(e)
  1217. }
  1218. }
  1219. ,
  1220. "undefined" != typeof module && module.exports ? module.exports = Ih() : "function" == typeof define && define.amd ? define(Ih) : Hh.domready = Ih();
  1221. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1222. if (loaded && cached) {
  1223. for (var instance in clients = cached.clients || {},
  1224. ready = cached.ready || [],
  1225. clients)
  1226. if (clients.hasOwnProperty(instance)) {
  1227. var client = clients[instance];
  1228. for (var method in Keen.prototype)
  1229. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1230. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1231. ,
  1232. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1233. ,
  1234. client._config && (client.configure.call(client, client._config),
  1235. delete client._config),
  1236. client._setGlobalProperties) {
  1237. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1238. client.setGlobalProperties.apply(client, globals[i]);
  1239. delete client._setGlobalProperties
  1240. }
  1241. if (client._addEvent) {
  1242. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1243. client.addEvent.apply(client, queue[i]);
  1244. delete client._addEvent
  1245. }
  1246. var callback = client._on || [];
  1247. if (client._on) {
  1248. for (var i = 0; i < callback.length; i++)
  1249. client.on.apply(client, callback[i]);
  1250. client.trigger("ready"),
  1251. delete client._on
  1252. }
  1253. }
  1254. for (var i = 0; i < ready.length; i++) {
  1255. var callback = ready[i];
  1256. Keen.on("ready", function() {
  1257. callback()
  1258. })
  1259. }
  1260. }
  1261. return Keen.loaded && setTimeout(function() {
  1262. Keen.utils.domready(function() {
  1263. Keen.trigger("ready")
  1264. })
  1265. }, 0),
  1266. Keen
  1267. }),
  1268. function() {
  1269. var i = window.analytics = window.analytics || [];
  1270. if (!i.initialize) {
  1271. if (i.invoked)
  1272. return window.console && console.error && console.error("Segment snippet included twice.");
  1273. i.invoked = !0,
  1274. i.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1275. i.factory = function(t) {
  1276. return function() {
  1277. var e = Array.prototype.slice.call(arguments);
  1278. return e.unshift(t),
  1279. i.push(e),
  1280. i
  1281. }
  1282. }
  1283. ;
  1284. for (var e = 0; e < i.methods.length; e++) {
  1285. var t = i.methods[e];
  1286. i[t] = i.factory(t)
  1287. }
  1288. i.load = function(e) {
  1289. var t = document.createElement("script");
  1290. t.type = "text/javascript",
  1291. t.async = !0,
  1292. t.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + e + "/analytics.min.js";
  1293. var i = document.getElementsByTagName("script")[0];
  1294. i.parentNode.insertBefore(t, i)
  1295. }
  1296. ,
  1297. i.SNIPPET_VERSION = "4.0.0"
  1298. }
  1299. }(),
  1300. function(i, u) {
  1301. "use strict";
  1302. var d = "function"
  1303. , p = "undefined"
  1304. , f = "object"
  1305. , e = "major"
  1306. , t = "model"
  1307. , n = "name"
  1308. , r = "type"
  1309. , o = "vendor"
  1310. , a = "version"
  1311. , s = "architecture"
  1312. , l = "console"
  1313. , c = "mobile"
  1314. , h = "tablet"
  1315. , g = {
  1316. has: function(e, t) {
  1317. return -1 !== t.toLowerCase().indexOf(e.toLowerCase())
  1318. },
  1319. lowerize: function(e) {
  1320. return e.toLowerCase()
  1321. }
  1322. }
  1323. , m = {
  1324. rgx: function() {
  1325. for (var e, t, i, n, r, o, a, s = 0, l = arguments; s < l.length; s += 2) {
  1326. var c = l[s]
  1327. , h = l[s + 1];
  1328. if (typeof e == p)
  1329. for (n in e = {},
  1330. h)
  1331. typeof (r = h[n]) == f ? e[r[0]] = u : e[r] = u;
  1332. for (t = i = 0; t < c.length; t++)
  1333. if (o = c[t].exec(this.getUA())) {
  1334. for (n = 0; n < h.length; n++)
  1335. a = o[++i],
  1336. typeof (r = h[n]) == f && 0 < r.length ? 2 == r.length ? typeof r[1] == d ? e[r[0]] = r[1].call(this, a) : e[r[0]] = r[1] : 3 == r.length ? typeof r[1] != d || r[1].exec && r[1].test ? e[r[0]] = a ? a.replace(r[1], r[2]) : u : e[r[0]] = a ? r[1].call(this, a, r[2]) : u : 4 == r.length && (e[r[0]] = a ? r[3].call(this, a.replace(r[1], r[2])) : u) : e[r] = a || u;
  1337. break
  1338. }
  1339. if (o)
  1340. break
  1341. }
  1342. return e
  1343. },
  1344. str: function(e, t) {
  1345. for (var i in t)
  1346. if (typeof t[i] == f && 0 < t[i].length) {
  1347. for (var n = 0; n < t[i].length; n++)
  1348. if (g.has(t[i][n], e))
  1349. return "?" === i ? u : i
  1350. } else if (g.has(t[i], e))
  1351. return "?" === i ? u : i;
  1352. return e
  1353. }
  1354. }
  1355. , v = {
  1356. browser: {
  1357. oldsafari: {
  1358. major: {
  1359. 1: ["/8", "/1", "/3"],
  1360. 2: "/4",
  1361. "?": "/"
  1362. },
  1363. version: {
  1364. "1.0": "/8",
  1365. 1.2: "/1",
  1366. 1.3: "/3",
  1367. "2.0": "/412",
  1368. "2.0.2": "/416",
  1369. "2.0.3": "/417",
  1370. "2.0.4": "/419",
  1371. "?": "/"
  1372. }
  1373. }
  1374. },
  1375. device: {
  1376. sprint: {
  1377. model: {
  1378. "Evo Shift 4G": "7373KT"
  1379. },
  1380. vendor: {
  1381. HTC: "APA",
  1382. Sprint: "Sprint"
  1383. }
  1384. }
  1385. },
  1386. os: {
  1387. windows: {
  1388. version: {
  1389. ME: "4.90",
  1390. "NT 3.11": "NT3.51",
  1391. "NT 4.0": "NT4.0",
  1392. 2e3: "NT 5.0",
  1393. XP: ["NT 5.1", "NT 5.2"],
  1394. Vista: "NT 6.0",
  1395. 7: "NT 6.1",
  1396. 8: "NT 6.2",
  1397. 8.1: "NT 6.3",
  1398. RT: "ARM"
  1399. }
  1400. }
  1401. }
  1402. }
  1403. , y = {
  1404. browser: [[/(opera\smini)\/((\d+)?[\w\.-]+)/i, /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, /(opera).+version\/((\d+)?[\w\.]+)/i, /(opera)[\/\s]+((\d+)?[\w\.]+)/i], [n, a, e], [/\s(opr)\/((\d+)?[\w\.]+)/i], [[n, "Opera"], a, e], [/(kindle)\/((\d+)?[\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i, /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i, /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i, /(rekonq)((?:\/)[\w\.]+)*/i, /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i], [n, a, e], [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i], [[n, "IE"], a, e], [/(yabrowser)\/((\d+)?[\w\.]+)/i], [[n, "Yandex"], a, e], [/(comodo_dragon)\/((\d+)?[\w\.]+)/i], [[n, /_/g, " "], a, e], [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i], [n, a, e], [/(dolfin)\/((\d+)?[\w\.]+)/i], [[n, "Dolphin"], a, e], [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i], [[n, "Chrome"], a, e], [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i], [a, e, [n, "Mobile Safari"]], [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i], [a, e, n], [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i], [n, [e, m.str, v.browser.oldsafari.major], [a, m.str, v.browser.oldsafari.version]], [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i], [n, a, e], [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i], [[n, "Netscape"], a, e], [/(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i, /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i, /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i, /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i, /(links)\s\(((\d+)?[\w\.]+)/i, /(gobrowser)\/?((\d+)?[\w\.]+)*/i, /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i, /(mosaic)[\/\s]((\d+)?[\w\.]+)/i], [n, a, e], [/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i], [n, a, e], [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i], [n, a], [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i], [n, a, e], [/(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i, /(clementine|music player daemon)\s((\d+)[\w\.-]+)/i, /(lg player|nexplayer)\s((\d+)[\d\.]+)/i, /player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i], [n, a, e], [/(nexplayer)\s((\d+)[\w\.-]+)/i], [n, a, e], [/(flrp)\/((\d+)[\w\.-]+)/i], [[n, "Flip Player"], a, e], [/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i], [n], [/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i], [n, a, e], [/(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i, /(lavf)((\d+)[\d\.]+)/i], [n, a, e], [/(htc_one_s)\/((\d+)[\d\.]+)/i], [[n, /_/g, " "], a, e], [/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i], [n, a], [/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i], [n, a, e], [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i], [n], [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i], [n, a, e], [/(nokia\d+)\/((\d+)[\w\.-]+)/i], [n, a, e], [/\s(songbird)\/((\d+)[\w\.-]+)/i], [n, a, e], [/(winamp)3 version ((\d+)[\w\.-]+)/i, /(winamp)\s((\d+)[\w\.-]+)/i, /(winamp)mpeg\/((\d+)[\w\.-]+)/i], [n, a, e], [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i], [n], [/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i], [n, a, e], [/(smp)((\d+)[\d\.]+)/i], [n, a, e], [/(vlc) media player - version ((\d+)[\w\.]+)/i, /(vlc)\/((\d+)[\w\.-]+)/i, /(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i, /(foobar2000)\/((\d+)[\d\.]+)/i, /(itunes)\/((\d+)[\d\.]+)/i], [n, a, e], [/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i], [[n, /-/g, " "], a, e], [/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i], [a, e, [n, "Windows"]], [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i], [n, a, e], [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i], [[n, "rad.io"], a, e]],
  1405. cpu: [[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i], [[s, "amd64"]], [/(ia32(?=;))/i], [[s, g.lowerize]], [/((?:i[346]|x)86)[;\)]/i], [[s, "ia32"]], [/windows\s(ce|mobile);\sppc;/i], [[s, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i], [[s, /ower/, "", g.lowerize]], [/(sun4\w)[;\)]/i], [[s, "sparc"]], [/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i], [s, g.lowerize]],
  1406. device: [[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i], [t, o, [r, h]], [/applecoremedia\/[\w\.]+ \((ipad)/], [t, [o, "Apple"], [r, h]], [/(apple\s{0,1}tv)/i], [[t, "Apple TV"], [o, "Apple"]], [/(hp).+(touchpad)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i], [o, t, [r, h]], [/\((ip[honed|\s\w*]+);.+(apple)/i], [t, o, [r, c]], [/\((ip[honed|\s\w*]+);/i], [t, [o, "Apple"], [r, c]], [/(blackberry)[\s-]?(\w+)/i, /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i, /(hp)\s([\w\s]+\w)/i, /(asus)-?(\w+)/i], [o, t, [r, c]], [/\((bb10);\s(\w+)/i], [[o, "BlackBerry"], t, [r, c]], [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i], [[o, "Asus"], t, [r, h]], [/(sony)\s(tablet\s[ps])/i], [o, t, [r, h]], [/(nintendo)\s([wids3u]+)/i], [o, t, [r, l]], [/((playstation)\s[3portablevi]+)/i], [[o, "Sony"], t, [r, l]], [/(sprint\s(\w+))/i], [[o, m.str, v.device.sprint.vendor], [t, m.str, v.device.sprint.model], [r, c]], [/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, /(zte)-(\w+)*/i, /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i], [o, [t, /_/g, " "], [r, c]], [/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i, /(mot)[\s-]?(\w+)*/i], [[o, "Motorola"], t, [r, c]], [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i], [[o, "Motorola"], t, [r, h]], [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i], [[o, "Samsung"], t, [r, h]], [/((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i, /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i, /sec-((sgh\w+))/i], [[o, "Samsung"], t, [r, c]], [/(sie)-(\w+)*/i], [[o, "Siemens"], t, [r, c]], [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i], [[o, "Nokia"], t, [r, c]], [/android\s3\.[\s\w-;]{10}((a\d{3}))/i], [[o, "Acer"], t, [r, h]], [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i], [[o, "LG"], t, [r, h]], [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i], [[o, "LG"], t, [r, c]], [/android.+((ideatab[a-z0-9\-\s]+))/i], [[o, "Lenovo"], t, [r, h]], [/(lg) netcast\.tv/i], [o, [r, "smarttv"]], [/(mobile|tablet);.+rv\:.+gecko\//i], [r, o, t]],
  1407. engine: [[/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i], [n, a], [/rv\:([\w\.]+).*(gecko)/i], [a, n]],
  1408. os: [[/microsoft\s(windows)\s(vista|xp)/i], [n, a], [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i], [n, [a, m.str, v.os.windows.version]], [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i], [[n, "Windows"], [a, m.str, v.os.windows.version]], [/\((bb)(10);/i], [[n, "BlackBerry"], a], [/(blackberry)\w*\/?([\w\.]+)*/i, /(tizen)\/([\w\.]+)/i, /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i], [n, a], [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i], [[n, "Symbian"], a], [/mozilla.+\(mobile;.+gecko.+firefox/i], [[n, "Firefox OS"], a], [/(nintendo|playstation)\s([wids3portablevu]+)/i, /(mint)[\/\s\(]?(\w+)*/i, /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i, /(hurd|linux)\s?([\w\.]+)*/i, /(gnu)\s?([\w\.]+)*/i], [n, a], [/(cros)\s[\w]+\s([\w\.]+\w)/i], [[n, "Chromium OS"], a], [/(sunos)\s?([\w\.]+\d)*/i], [[n, "Solaris"], a], [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i], [n, a], [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i], [[n, "iOS"], [a, /_/g, "."]], [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i], [n, [a, /_/g, "."]], [/(haiku)\s(\w+)/i, /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i, /(unix)\s?([\w\.]+)*/i], [n, a]]
  1409. }
  1410. , A = function(e) {
  1411. var t = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : "");
  1412. return this instanceof A ? (this.getBrowser = function() {
  1413. return m.rgx.apply(this, y.browser)
  1414. }
  1415. ,
  1416. this.getCPU = function() {
  1417. return m.rgx.apply(this, y.cpu)
  1418. }
  1419. ,
  1420. this.getDevice = function() {
  1421. return m.rgx.apply(this, y.device)
  1422. }
  1423. ,
  1424. this.getEngine = function() {
  1425. return m.rgx.apply(this, y.engine)
  1426. }
  1427. ,
  1428. this.getOS = function() {
  1429. return m.rgx.apply(this, y.os)
  1430. }
  1431. ,
  1432. this.getResult = function() {
  1433. return {
  1434. ua: this.getUA(),
  1435. browser: this.getBrowser(),
  1436. engine: this.getEngine(),
  1437. os: this.getOS(),
  1438. device: this.getDevice(),
  1439. cpu: this.getCPU()
  1440. }
  1441. }
  1442. ,
  1443. this.getUA = function() {
  1444. return t
  1445. }
  1446. ,
  1447. this.setUA = function(e) {
  1448. return t = e,
  1449. this
  1450. }
  1451. ,
  1452. void this.setUA(t)) : new A(e).getResult()
  1453. };
  1454. if (typeof exports != p)
  1455. typeof module != p && module.exports && (exports = module.exports = A),
  1456. exports.UAParser = A;
  1457. else if (i.UAParser = A,
  1458. typeof define == d && define.amd && define(function() {
  1459. return A
  1460. }),
  1461. typeof i.jQuery != p) {
  1462. var C = i.jQuery
  1463. , I = new A;
  1464. C.ua = I.getResult(),
  1465. C.ua.get = function() {
  1466. return I.getUA()
  1467. }
  1468. ,
  1469. C.ua.set = function(e) {
  1470. I.setUA(e);
  1471. var t = I.getResult();
  1472. for (var i in t)
  1473. C.ua[i] = t[i]
  1474. }
  1475. }
  1476. }(this),
  1477. window.Modernizr = function(e, t) {
  1478. function i(e, t) {
  1479. return typeof e === t
  1480. }
  1481. var n, r, o, a = {}, s = t.documentElement, l = t.createElement("modernizr"), c = l.style, h = {}, u = [], d = u.slice, p = {}.hasOwnProperty;
  1482. for (var f in r = i(p, "undefined") || i(p.call, "undefined") ? function(e, t) {
  1483. return t in e && i(e.constructor.prototype[t], "undefined")
  1484. }
  1485. : function(e, t) {
  1486. return p.call(e, t)
  1487. }
  1488. ,
  1489. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1490. var r = this;
  1491. if ("function" != typeof r)
  1492. throw new TypeError;
  1493. var o = d.call(arguments, 1)
  1494. , a = function() {
  1495. if (this instanceof a) {
  1496. function e() {}
  1497. e.prototype = r.prototype;
  1498. var t = new e
  1499. , i = r.apply(t, o.concat(d.call(arguments)));
  1500. return Object(i) === i ? i : t
  1501. }
  1502. return r.apply(n, o.concat(d.call(arguments)))
  1503. };
  1504. return a
  1505. }
  1506. ),
  1507. h.webgl = function() {
  1508. return !!e.WebGLRenderingContext
  1509. }
  1510. ,
  1511. h)
  1512. r(h, f) && (n = f.toLowerCase(),
  1513. a[n] = h[f](),
  1514. u.push((a[n] ? "" : "no-") + n));
  1515. return a.addTest = function(e, t) {
  1516. if ("object" == typeof e)
  1517. for (var i in e)
  1518. r(e, i) && a.addTest(i, e[i]);
  1519. else {
  1520. if (e = e.toLowerCase(),
  1521. void 0 !== a[e])
  1522. return a;
  1523. t = "function" == typeof t ? t() : t,
  1524. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (t ? "" : "no-") + e),
  1525. a[e] = t
  1526. }
  1527. return a
  1528. }
  1529. ,
  1530. o = "",
  1531. c.cssText = o,
  1532. l = null,
  1533. a._version = "2.8.2",
  1534. a
  1535. }(this, this.document),
  1536. function(xe, e, Se) {
  1537. "use strict";
  1538. function Me(s, e, n) {
  1539. function a(e) {
  1540. var t = Q.length;
  1541. if (G.old = xe.extend({}, G),
  1542. H = V ? 0 : k[F.horizontal ? "width" : "height"](),
  1543. Y = W[F.horizontal ? "width" : "height"](),
  1544. z = V ? s : U[F.horizontal ? "outerWidth" : "outerHeight"](),
  1545. Q.length = 0,
  1546. G.start = 0,
  1547. G.end = nt(z - H, 0),
  1548. le) {
  1549. $.length,
  1550. J = U.children(F.itemSelector),
  1551. $.length = 0;
  1552. var h, u = Ne(U, F.horizontal ? "paddingLeft" : "paddingTop"), d = Ne(U, F.horizontal ? "paddingRight" : "paddingBottom"), i = "border-box" === xe(J).css("boxSizing"), p = "none" !== J.css("float"), f = 0, g = J.length - 1;
  1553. z = 0,
  1554. J.each(function(e, t) {
  1555. var i = xe(t)
  1556. , n = t.getBoundingClientRect()
  1557. , r = it(F.horizontal ? n.width || n.right - n.left : n.height || n.bottom - n.top)
  1558. , o = Ne(i, F.horizontal ? "marginLeft" : "marginTop")
  1559. , a = Ne(i, F.horizontal ? "marginRight" : "marginBottom")
  1560. , s = r + o + a
  1561. , l = !o || !a
  1562. , c = {};
  1563. c.el = t,
  1564. c.size = l ? r : s,
  1565. c.half = c.size / 2,
  1566. c.start = z + (l ? o : 0),
  1567. c.center = c.start - it(H / 2 - c.size / 2),
  1568. c.end = c.start - H + c.size,
  1569. e || (z += u),
  1570. z += s,
  1571. F.horizontal || p || a && o && 0 < e && (z -= rt(o, a)),
  1572. e === g && (c.end += d,
  1573. z += d,
  1574. f = l ? a : 0),
  1575. $.push(c),
  1576. h = c
  1577. }),
  1578. U[0].style[F.horizontal ? "width" : "height"] = (i ? z : z - u - d) + "px",
  1579. z -= f,
  1580. $.length ? (G.start = $[0][ae ? "center" : "start"],
  1581. G.end = ae ? h.center : H < z ? h.end : G.start) : G.start = G.end = 0
  1582. }
  1583. if (G.center = it(G.end / 2 + G.start / 2),
  1584. v(),
  1585. j.length && 0 < Y && (F.dynamicHandle ? (q = Fe(q = G.start === G.end ? Y : it(Y * H / z), F.minHandleSize, Y),
  1586. j[0].style[F.horizontal ? "width" : "height"] = q + "px") : q = j[F.horizontal ? "outerWidth" : "outerHeight"](),
  1587. X.end = Y - q,
  1588. _e || c()),
  1589. !V && 0 < H) {
  1590. var n = G.start
  1591. , r = "";
  1592. if (le)
  1593. xe.each($, function(e, t) {
  1594. ae ? Q.push(t.center) : t.start + t.size > n && n <= G.end && (n = t.start,
  1595. Q.push(n),
  1596. (n += H) > G.end && n < G.end + H && Q.push(G.end))
  1597. });
  1598. else
  1599. for (; n - H < G.end; )
  1600. Q.push(n),
  1601. n += H;
  1602. if (Z[0] && t !== Q.length) {
  1603. for (var o = 0; o < Q.length; o++)
  1604. r += F.pageBuilder.call(B, o);
  1605. (K = Z.html(r).children()).eq(ee.activePage).addClass(F.activeClass)
  1606. }
  1607. }
  1608. if (ee.slideeSize = z,
  1609. ee.frameSize = H,
  1610. ee.sbSize = Y,
  1611. ee.handleSize = q,
  1612. le) {
  1613. e && null != F.startAt && (m(F.startAt),
  1614. B[se ? "toCenter" : "toStart"](F.startAt));
  1615. var a = $[ee.activeItem];
  1616. l(se && a ? a.center : Fe(G.dest, G.start, G.end))
  1617. } else
  1618. e ? null != F.startAt && l(F.startAt, 1) : l(Fe(G.dest, G.start, G.end));
  1619. L("load")
  1620. }
  1621. function l(e, t, i) {
  1622. if (le && Ie.released && !i) {
  1623. var n = d(e)
  1624. , r = e > G.start && e < G.end;
  1625. se ? (r && (e = $[n.centerItem].center),
  1626. ae && F.activateMiddle && m(n.centerItem)) : r && (e = $[n.firstItem].start)
  1627. }
  1628. Ie.init && Ie.slidee && F.elasticBounds ? e > G.end ? e = G.end + (e - G.end) / 6 : e < G.start && (e = G.start + (e - G.start) / 6) : e = Fe(e, G.start, G.end),
  1629. Ae.start = +new Date,
  1630. Ae.time = 0,
  1631. Ae.from = G.cur,
  1632. Ae.to = e,
  1633. Ae.delta = e - G.cur,
  1634. Ae.tweesing = Ie.tweese || Ie.init && !Ie.slidee,
  1635. Ae.immediate = !Ae.tweesing && (t || Ie.init && Ie.slidee || !F.speed),
  1636. Ie.tweese = 0,
  1637. e !== G.dest && (G.dest = e,
  1638. L("change"),
  1639. _e || o()),
  1640. g(),
  1641. v(),
  1642. p(),
  1643. K[0] && ye.page !== ee.activePage && (ye.page = ee.activePage,
  1644. K.removeClass(F.activeClass).eq(ee.activePage).addClass(F.activeClass),
  1645. L("activePage", ye.page))
  1646. }
  1647. function o() {
  1648. if (B.initialized) {
  1649. if (!_e)
  1650. return _e = Ge(o),
  1651. void (Ie.released && L("moveStart"));
  1652. Ae.immediate ? G.cur = Ae.to : Ae.tweesing ? (Ae.tweeseDelta = Ae.to - G.cur,
  1653. $e(Ae.tweeseDelta) < .1 ? G.cur = Ae.to : G.cur += Ae.tweeseDelta * (Ie.released ? F.swingSpeed : F.syncSpeed)) : (Ae.time = rt(+new Date - Ae.start, F.speed),
  1654. G.cur = Ae.from + Ae.delta * xe.easing[F.easing](Ae.time / F.speed, Ae.time, 0, 1, F.speed)),
  1655. Ae.to === G.cur ? (G.cur = Ae.to,
  1656. Ie.tweese = _e = 0) : _e = Ge(o),
  1657. L("move"),
  1658. V || (Ve ? U[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + -G.cur + "px)" : U[0].style[F.horizontal ? "left" : "top"] = -it(G.cur) + "px"),
  1659. !_e && Ie.released && L("moveEnd"),
  1660. c()
  1661. }
  1662. }
  1663. function c() {
  1664. j.length && (X.cur = G.start === G.end ? 0 : ((Ie.init && !Ie.slidee ? G.dest : G.cur) - G.start) / (G.end - G.start) * X.end,
  1665. X.cur = Fe(it(X.cur), X.start, X.end),
  1666. ye.hPos !== X.cur && (ye.hPos = X.cur,
  1667. Ve ? j[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + X.cur + "px)" : j[0].style[F.horizontal ? "left" : "top"] = X.cur + "px"))
  1668. }
  1669. function t() {
  1670. Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) || B.stop(),
  1671. Te = Ie.init ? Ge(t) : 0,
  1672. Ce.now = +new Date,
  1673. Ce.pos = G.cur + (Ce.now - Ce.lastTime) / 1e3 * Ce.speed,
  1674. l(Ie.init ? Ce.pos : it(Ce.pos)),
  1675. Ie.init || G.cur !== G.dest || L("moveEnd"),
  1676. Ce.lastTime = Ce.now
  1677. }
  1678. function i(e, t, i) {
  1679. if ("boolean" === Re(t) && (i = t,
  1680. t = Se),
  1681. t === Se)
  1682. l(G[e], i);
  1683. else {
  1684. if (se && "center" !== e)
  1685. return;
  1686. var n = B.getPos(t);
  1687. n && l(n[e], i, !se)
  1688. }
  1689. }
  1690. function h(e) {
  1691. return null != e ? De(e) ? 0 <= e && e < $.length ? e : -1 : J.index(e) : -1
  1692. }
  1693. function u(e) {
  1694. return h(De(e) && e < 0 ? e + $.length : e)
  1695. }
  1696. function m(e, t) {
  1697. var i = h(e);
  1698. return !(!le || i < 0) && (ye.active === i && !t || (J.eq(ee.activeItem).removeClass(F.activeClass),
  1699. J.eq(i).addClass(F.activeClass),
  1700. ye.active = ee.activeItem = i,
  1701. p(),
  1702. L("active", i)),
  1703. i)
  1704. }
  1705. function d(e) {
  1706. e = Fe(De(e) ? e : G.dest, G.start, G.end);
  1707. var t = {}
  1708. , i = ae ? 0 : H / 2;
  1709. if (!V)
  1710. for (var n = 0, r = Q.length; n < r; n++) {
  1711. if (e >= G.end || n === Q.length - 1) {
  1712. t.activePage = Q.length - 1;
  1713. break
  1714. }
  1715. if (e <= Q[n] + i) {
  1716. t.activePage = n;
  1717. break
  1718. }
  1719. }
  1720. if (le) {
  1721. for (var o = !1, a = !1, s = !1, l = 0, c = $.length; l < c; l++)
  1722. if (!1 === o && e <= $[l].start + $[l].half && (o = l),
  1723. !1 === s && e <= $[l].center + $[l].half && (s = l),
  1724. l === c - 1 || e <= $[l].end + $[l].half) {
  1725. a = l;
  1726. break
  1727. }
  1728. t.firstItem = De(o) ? o : 0,
  1729. t.centerItem = De(s) ? s : t.firstItem,
  1730. t.lastItem = De(a) ? a : t.centerItem
  1731. }
  1732. return t
  1733. }
  1734. function v(e) {
  1735. xe.extend(ee, d(e))
  1736. }
  1737. function p() {
  1738. var e = G.dest <= G.start
  1739. , t = G.dest >= G.end
  1740. , i = (e ? 1 : 0) | (t ? 2 : 0);
  1741. if (ye.slideePosState !== i && (ye.slideePosState = i,
  1742. ge.is("button,input") && ge.prop("disabled", e),
  1743. me.is("button,input") && me.prop("disabled", t),
  1744. ge.add(de)[e ? "addClass" : "removeClass"](F.disabledClass),
  1745. me.add(ue)[t ? "addClass" : "removeClass"](F.disabledClass)),
  1746. ye.fwdbwdState !== i && Ie.released && (ye.fwdbwdState = i,
  1747. de.is("button,input") && de.prop("disabled", e),
  1748. ue.is("button,input") && ue.prop("disabled", t)),
  1749. le && null != ee.activeItem) {
  1750. var n = 0 === ee.activeItem
  1751. , r = ee.activeItem >= $.length - 1
  1752. , o = (n ? 1 : 0) | (r ? 2 : 0);
  1753. ye.itemsButtonState !== o && (ye.itemsButtonState = o,
  1754. pe.is("button,input") && pe.prop("disabled", n),
  1755. fe.is("button,input") && fe.prop("disabled", r),
  1756. pe[n ? "addClass" : "removeClass"](F.disabledClass),
  1757. fe[r ? "addClass" : "removeClass"](F.disabledClass))
  1758. }
  1759. }
  1760. function r(e, t, i) {
  1761. if (e = u(e),
  1762. t = u(t),
  1763. -1 < e && -1 < t && e !== t && (!i || t !== e - 1) && (i || t !== e + 1)) {
  1764. J.eq(e)[i ? "insertAfter" : "insertBefore"]($[t].el);
  1765. var n = e < t ? e : i ? t : t - 1
  1766. , r = t < e ? e : i ? t + 1 : t
  1767. , o = t < e;
  1768. null != ee.activeItem && (e === ee.activeItem ? ye.active = ee.activeItem = i ? o ? t + 1 : t : o ? t : t - 1 : ee.activeItem > n && ee.activeItem < r && (ye.active = ee.activeItem += o ? 1 : -1)),
  1769. a()
  1770. }
  1771. }
  1772. function f(e, t) {
  1773. for (var i = 0, n = ve[e].length; i < n; i++)
  1774. if (ve[e][i] === t)
  1775. return i;
  1776. return -1
  1777. }
  1778. function g() {
  1779. Ie.released && !B.isPaused && B.resume()
  1780. }
  1781. function y(e) {
  1782. return it(Fe(e, X.start, X.end) / X.end * (G.end - G.start)) + G.start
  1783. }
  1784. function A() {
  1785. Ie.history[0] = Ie.history[1],
  1786. Ie.history[1] = Ie.history[2],
  1787. Ie.history[2] = Ie.history[3],
  1788. Ie.history[3] = Ie.delta
  1789. }
  1790. function C(e) {
  1791. Ie.released = 0,
  1792. Ie.source = e,
  1793. Ie.slidee = "slidee" === e
  1794. }
  1795. function I(e) {
  1796. var t = "touchstart" === e.type
  1797. , i = e.data.source
  1798. , n = "slidee" === i;
  1799. Ie.init || !t && b(e.target) || !("handle" !== i || F.dragHandle && X.start !== X.end) || n && !(t ? F.touchDragging : F.mouseDragging && e.which < 2) || (t || Pe(e),
  1800. C(i),
  1801. Ie.init = 0,
  1802. Ie.$source = xe(e.target),
  1803. Ie.touch = t,
  1804. Ie.pointer = t ? e.originalEvent.touches[0] : e,
  1805. Ie.initX = Ie.pointer.pageX,
  1806. Ie.initY = Ie.pointer.pageY,
  1807. Ie.initPos = n ? G.cur : X.cur,
  1808. Ie.start = +new Date,
  1809. Ie.time = 0,
  1810. Ie.path = 0,
  1811. Ie.delta = 0,
  1812. Ie.locked = 0,
  1813. Ie.history = [0, 0, 0, 0],
  1814. Ie.pathToLock = n ? t ? 30 : 10 : 0,
  1815. We.on(t ? qe : Ye, E),
  1816. B.pause(1),
  1817. (n ? U : j).addClass(F.draggedClass),
  1818. L("moveStart"),
  1819. n && (be = setInterval(A, 10)))
  1820. }
  1821. function E(e) {
  1822. if (Ie.released = "mouseup" === e.type || "touchend" === e.type,
  1823. Ie.pointer = Ie.touch ? e.originalEvent[Ie.released ? "changedTouches" : "touches"][0] : e,
  1824. Ie.pathX = Ie.pointer.pageX - Ie.initX,
  1825. Ie.pathY = Ie.pointer.pageY - Ie.initY,
  1826. Ie.path = et(tt(Ie.pathX, 2) + tt(Ie.pathY, 2)),
  1827. Ie.delta = F.horizontal ? Ie.pathX : Ie.pathY,
  1828. Ie.released || !(Ie.path < 1)) {
  1829. if (!Ie.init) {
  1830. if (!(F.horizontal ? $e(Ie.pathX) > $e(Ie.pathY) : $e(Ie.pathX) < $e(Ie.pathY)))
  1831. return _();
  1832. Ie.init = 1
  1833. }
  1834. Pe(e),
  1835. !Ie.locked && Ie.path > Ie.pathToLock && Ie.slidee && (Ie.locked = 1,
  1836. Ie.$source.on(Ze, Oe)),
  1837. Ie.released && (_(),
  1838. F.releaseSwing && Ie.slidee && (Ie.swing = (Ie.delta - Ie.history[0]) / 40 * 300,
  1839. Ie.delta += Ie.swing,
  1840. Ie.tweese = 10 < $e(Ie.swing))),
  1841. l(Ie.slidee ? it(Ie.initPos - Ie.delta) : y(Ie.initPos + Ie.delta))
  1842. }
  1843. }
  1844. function _() {
  1845. clearInterval(be),
  1846. Ie.released = !0,
  1847. We.off(Ie.touch ? qe : Ye, E),
  1848. (Ie.slidee ? U : j).removeClass(F.draggedClass),
  1849. setTimeout(function() {
  1850. Ie.$source.off(Ze, Oe)
  1851. }),
  1852. G.cur === G.dest && Ie.init && L("moveEnd"),
  1853. B.resume(1),
  1854. Ie.init = 0
  1855. }
  1856. function b(e) {
  1857. return ~xe.inArray(e.nodeName, Qe) || xe(e).is(F.interactive)
  1858. }
  1859. function w() {
  1860. B.stop(),
  1861. We.off("mouseup", w)
  1862. }
  1863. function T(e) {
  1864. switch (Pe(e),
  1865. this) {
  1866. case ue[0]:
  1867. case de[0]:
  1868. B.moveBy(ue.is(this) ? F.moveBy : -F.moveBy),
  1869. We.on("mouseup", w);
  1870. break;
  1871. case pe[0]:
  1872. B.prev();
  1873. break;
  1874. case fe[0]:
  1875. B.next();
  1876. break;
  1877. case ge[0]:
  1878. B.prevPage();
  1879. break;
  1880. case me[0]:
  1881. B.nextPage()
  1882. }
  1883. }
  1884. function x(e) {
  1885. e.originalEvent[He] = B;
  1886. var t = +new Date;
  1887. if (ot + F.scrollHijack > t && ce[0] !== document && ce[0] !== window)
  1888. ot = t;
  1889. else if (F.scrollBy && G.start !== G.end) {
  1890. var i = function(e) {
  1891. return Ee.curDelta = (F.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1892. Ee.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1893. le ? (Ue = +new Date,
  1894. Ee.last < Ue - Ee.resetTime && (Ee.delta = 0),
  1895. Ee.last = Ue,
  1896. Ee.delta += Ee.curDelta,
  1897. $e(Ee.delta) < 1 ? Ee.finalDelta = 0 : (Ee.finalDelta = it(Ee.delta / 1),
  1898. Ee.delta %= 1),
  1899. Ee.finalDelta) : Ee.curDelta
  1900. }(e.originalEvent);
  1901. (F.scrollTrap || 0 < i && G.dest < G.end || i < 0 && G.dest > G.start) && Pe(e, 1),
  1902. B.slideBy(F.scrollBy * i)
  1903. }
  1904. }
  1905. function S(e) {
  1906. F.clickBar && e.target === W[0] && (Pe(e),
  1907. l(y((F.horizontal ? e.pageX - W.offset().left : e.pageY - W.offset().top) - q / 2)))
  1908. }
  1909. function M(e) {
  1910. if (F.keyboardNavBy)
  1911. switch (e.which) {
  1912. case F.horizontal ? 37 : 38:
  1913. Pe(e),
  1914. B["pages" === F.keyboardNavBy ? "prevPage" : "prev"]();
  1915. break;
  1916. case F.horizontal ? 39 : 40:
  1917. Pe(e),
  1918. B["pages" === F.keyboardNavBy ? "nextPage" : "next"]()
  1919. }
  1920. }
  1921. function R(e) {
  1922. return b(this) ? void (e.originalEvent[He + "ignore"] = !0) : void (this.parentNode !== U[0] || e.originalEvent[He + "ignore"] || B.activate(this))
  1923. }
  1924. function P() {
  1925. this.parentNode === Z[0] && B.activatePage(K.index(this))
  1926. }
  1927. function O(e) {
  1928. F.pauseOnHover && B["mouseenter" === e.type ? "pause" : "resume"](2)
  1929. }
  1930. function L(e, t) {
  1931. if (ve[e]) {
  1932. for (N = ve[e].length,
  1933. Je.length = 0,
  1934. D = 0; D < N; D++)
  1935. Je.push(ve[e][D]);
  1936. for (D = 0; D < N; D++)
  1937. Je[D].call(B, e, t)
  1938. }
  1939. }
  1940. var D, N, F = xe.extend({}, Me.defaults, e), B = this, V = De(s), k = xe(s), U = F.slidee ? xe(F.slidee).eq(0) : k.children().eq(0), H = 0, z = 0, G = {
  1941. start: 0,
  1942. center: 0,
  1943. end: 0,
  1944. cur: 0,
  1945. dest: 0
  1946. }, W = xe(F.scrollBar).eq(0), j = W.children().eq(0), Y = 0, q = 0, X = {
  1947. start: 0,
  1948. end: 0,
  1949. cur: 0
  1950. }, Z = xe(F.pagesBar), K = 0, Q = [], J = 0, $ = [], ee = {
  1951. firstItem: 0,
  1952. lastItem: 0,
  1953. centerItem: 0,
  1954. activeItem: null,
  1955. activePage: 0
  1956. }, te = new Be(k[0]), ie = new Be(U[0]), ne = new Be(W[0]), re = new Be(j[0]), oe = "basic" === F.itemNav, ae = "forceCentered" === F.itemNav, se = "centered" === F.itemNav || ae, le = !V && (oe || se || ae), ce = F.scrollSource ? xe(F.scrollSource) : k, he = F.dragSource ? xe(F.dragSource) : k, ue = xe(F.forward), de = xe(F.backward), pe = xe(F.prev), fe = xe(F.next), ge = xe(F.prevPage), me = xe(F.nextPage), ve = {}, ye = {}, Ae = {}, Ce = {}, Ie = {
  1957. released: 1
  1958. }, Ee = {
  1959. last: 0,
  1960. delta: 0,
  1961. resetTime: 200
  1962. }, _e = 0, be = 0, we = 0, Te = 0;
  1963. V || (s = k[0]),
  1964. B.initialized = 0,
  1965. B.frame = s,
  1966. B.slidee = U[0],
  1967. B.pos = G,
  1968. B.rel = ee,
  1969. B.items = $,
  1970. B.pages = Q,
  1971. B.isPaused = 0,
  1972. B.options = F,
  1973. B.dragging = Ie,
  1974. B.reload = function() {
  1975. a()
  1976. }
  1977. ,
  1978. B.getPos = function(e) {
  1979. if (le) {
  1980. var t = h(e);
  1981. return -1 !== t && $[t]
  1982. }
  1983. var i = U.find(e).eq(0);
  1984. if (i[0]) {
  1985. var n = F.horizontal ? i.offset().left - U.offset().left : i.offset().top - U.offset().top
  1986. , r = i[F.horizontal ? "outerWidth" : "outerHeight"]();
  1987. return {
  1988. start: n,
  1989. center: n - H / 2 + r / 2,
  1990. end: n - H + r,
  1991. size: r
  1992. }
  1993. }
  1994. return !1
  1995. }
  1996. ,
  1997. B.moveBy = function(e) {
  1998. Ce.speed = e,
  1999. !Ie.init && Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) && (Ce.lastTime = +new Date,
  2000. Ce.startPos = G.cur,
  2001. C("button"),
  2002. Ie.init = 1,
  2003. L("moveStart"),
  2004. ze(Te),
  2005. t())
  2006. }
  2007. ,
  2008. B.stop = function() {
  2009. "button" === Ie.source && (Ie.init = 0,
  2010. Ie.released = 1)
  2011. }
  2012. ,
  2013. B.prev = function() {
  2014. B.activate(null == ee.activeItem ? 0 : ee.activeItem - 1)
  2015. }
  2016. ,
  2017. B.next = function() {
  2018. B.activate(null == ee.activeItem ? 0 : ee.activeItem + 1)
  2019. }
  2020. ,
  2021. B.prevPage = function() {
  2022. B.activatePage(ee.activePage - 1)
  2023. }
  2024. ,
  2025. B.nextPage = function() {
  2026. B.activatePage(ee.activePage + 1)
  2027. }
  2028. ,
  2029. B.slideBy = function(e, t) {
  2030. e && (le ? B[se ? "toCenter" : "toStart"](Fe((se ? ee.centerItem : ee.firstItem) + F.scrollBy * e, 0, $.length)) : l(G.dest + e, t))
  2031. }
  2032. ,
  2033. B.slideTo = function(e, t) {
  2034. l(e, t)
  2035. }
  2036. ,
  2037. B.toStart = function(e, t) {
  2038. i("start", e, t)
  2039. }
  2040. ,
  2041. B.toEnd = function(e, t) {
  2042. i("end", e, t)
  2043. }
  2044. ,
  2045. B.toCenter = function(e, t) {
  2046. i("center", e, t)
  2047. }
  2048. ,
  2049. B.getIndex = h,
  2050. B.activate = function(e, t) {
  2051. var i = m(e);
  2052. F.smart && !1 !== i && (se ? B.toCenter(i, t) : i >= ee.lastItem ? B.toStart(i, t) : i <= ee.firstItem ? B.toEnd(i, t) : g())
  2053. }
  2054. ,
  2055. B.activatePage = function(e, t) {
  2056. De(e) && l(Q[Fe(e, 0, Q.length - 1)], t)
  2057. }
  2058. ,
  2059. B.resume = function(e) {
  2060. F.cycleBy && F.cycleInterval && ("items" !== F.cycleBy || $[0] && null != ee.activeItem) && !(e < B.isPaused) && (B.isPaused = 0,
  2061. we ? we = clearTimeout(we) : L("resume"),
  2062. we = setTimeout(function() {
  2063. switch (L("cycle"),
  2064. F.cycleBy) {
  2065. case "items":
  2066. B.activate(ee.activeItem >= $.length - 1 ? 0 : ee.activeItem + 1);
  2067. break;
  2068. case "pages":
  2069. B.activatePage(ee.activePage >= Q.length - 1 ? 0 : ee.activePage + 1)
  2070. }
  2071. }, F.cycleInterval))
  2072. }
  2073. ,
  2074. B.pause = function(e) {
  2075. e < B.isPaused || (B.isPaused = e || 100,
  2076. we && (we = clearTimeout(we),
  2077. L("pause")))
  2078. }
  2079. ,
  2080. B.toggle = function() {
  2081. B[we ? "pause" : "resume"]()
  2082. }
  2083. ,
  2084. B.set = function(e, t) {
  2085. xe.isPlainObject(e) ? xe.extend(F, e) : F.hasOwnProperty(e) && (F[e] = t)
  2086. }
  2087. ,
  2088. B.add = function(e, t) {
  2089. var i = xe(e);
  2090. le ? (null == t || !$[0] || t >= $.length ? i.appendTo(U) : $.length && i.insertBefore($[t].el),
  2091. null != ee.activeItem && t <= ee.activeItem && (ye.active = ee.activeItem += i.length)) : U.append(i),
  2092. a()
  2093. }
  2094. ,
  2095. B.remove = function(e) {
  2096. if (le) {
  2097. var t = u(e);
  2098. if (-1 < t) {
  2099. J.eq(t).remove();
  2100. var i = t === ee.activeItem;
  2101. null != ee.activeItem && t < ee.activeItem && (ye.active = --ee.activeItem),
  2102. a(),
  2103. i && (ye.active = null,
  2104. B.activate(ee.activeItem))
  2105. }
  2106. } else
  2107. xe(e).remove(),
  2108. a()
  2109. }
  2110. ,
  2111. B.moveAfter = function(e, t) {
  2112. r(e, t, 1)
  2113. }
  2114. ,
  2115. B.moveBefore = function(e, t) {
  2116. r(e, t)
  2117. }
  2118. ,
  2119. B.on = function(e, t) {
  2120. if ("object" === Re(e))
  2121. for (var i in e)
  2122. e.hasOwnProperty(i) && B.on(i, e[i]);
  2123. else if ("function" === Re(t))
  2124. for (var n = e.split(" "), r = 0, o = n.length; r < o; r++)
  2125. ve[n[r]] = ve[n[r]] || [],
  2126. -1 === f(n[r], t) && ve[n[r]].push(t);
  2127. else if ("array" === Re(t))
  2128. for (var a = 0, s = t.length; a < s; a++)
  2129. B.on(e, t[a])
  2130. }
  2131. ,
  2132. B.one = function(t, i) {
  2133. B.on(t, function e() {
  2134. i.apply(B, arguments),
  2135. B.off(t, e)
  2136. })
  2137. }
  2138. ,
  2139. B.off = function(e, t) {
  2140. if (t instanceof Array)
  2141. for (var i = 0, n = t.length; i < n; i++)
  2142. B.off(e, t[i]);
  2143. else
  2144. for (var r = e.split(" "), o = 0, a = r.length; o < a; o++)
  2145. if (ve[r[o]] = ve[r[o]] || [],
  2146. null == t)
  2147. ve[r[o]].length = 0;
  2148. else {
  2149. var s = f(r[o], t);
  2150. -1 !== s && ve[r[o]].splice(s, 1)
  2151. }
  2152. }
  2153. ,
  2154. B.destroy = function() {
  2155. return ce.add(j).add(W).add(Z).add(ue).add(de).add(pe).add(fe).add(ge).add(me).off("." + He),
  2156. We.off("keydown", M),
  2157. pe.add(fe).add(ge).add(me).removeClass(F.disabledClass),
  2158. J && null != ee.activeItem && J.eq(ee.activeItem).removeClass(F.activeClass),
  2159. Z.empty(),
  2160. V || (k.off("." + He),
  2161. te.restore(),
  2162. ie.restore(),
  2163. ne.restore(),
  2164. re.restore(),
  2165. xe.removeData(s, He)),
  2166. $.length = Q.length = 0,
  2167. ye = {},
  2168. B.initialized = 0,
  2169. B
  2170. }
  2171. ,
  2172. B.init = function() {
  2173. if (!B.initialized) {
  2174. B.on(n);
  2175. var e = ["overflow", "position"]
  2176. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2177. te.save.apply(te, e),
  2178. ne.save.apply(ne, e),
  2179. ie.save.apply(ie, t),
  2180. re.save.apply(re, t);
  2181. var i = j;
  2182. return V || (i = i.add(U),
  2183. k.css("overflow", "hidden"),
  2184. Ve || "static" !== k.css("position") || k.css("position", "relative")),
  2185. Ve ? ke && i.css(Ve, ke) : ("static" === W.css("position") && W.css("position", "relative"),
  2186. i.css({
  2187. position: "absolute"
  2188. })),
  2189. F.forward && ue.on(Ke, T),
  2190. F.backward && de.on(Ke, T),
  2191. F.prev && pe.on(Ze, T),
  2192. F.next && fe.on(Ze, T),
  2193. F.prevPage && ge.on(Ze, T),
  2194. F.nextPage && me.on(Ze, T),
  2195. ce.on(Xe, x),
  2196. W[0] && W.on(Ze, S),
  2197. le && F.activateOn && k.on(F.activateOn + "." + He, "*", R),
  2198. Z[0] && F.activatePageOn && Z.on(F.activatePageOn + "." + He, "*", P),
  2199. he.on(je, {
  2200. source: "slidee"
  2201. }, I),
  2202. j && j.on(je, {
  2203. source: "handle"
  2204. }, I),
  2205. We.on("keydown", M),
  2206. V || (k.on("mouseenter." + He + " mouseleave." + He, O),
  2207. k.on("scroll." + He, Le)),
  2208. B.initialized = 1,
  2209. a(!0),
  2210. F.cycleBy && !V && B[F.startPaused ? "pause" : "resume"](),
  2211. B
  2212. }
  2213. }
  2214. }
  2215. function Re(e) {
  2216. 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
  2217. }
  2218. function Pe(e, t) {
  2219. e.preventDefault(),
  2220. t && e.stopPropagation()
  2221. }
  2222. function Oe(e) {
  2223. Pe(e, 1),
  2224. xe(this).off(e.type, Oe)
  2225. }
  2226. function Le() {
  2227. this.scrollLeft = 0,
  2228. this.scrollTop = 0
  2229. }
  2230. function De(e) {
  2231. return !isNaN(parseFloat(e)) && isFinite(e)
  2232. }
  2233. function Ne(e, t) {
  2234. return 0 | it(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2235. }
  2236. function Fe(e, t, i) {
  2237. return e < t ? t : i < e ? i : e
  2238. }
  2239. function Be(t) {
  2240. var i = {
  2241. style: {},
  2242. save: function() {
  2243. if (t && t.nodeType) {
  2244. for (var e = 0; e < arguments.length; e++)
  2245. i.style[arguments[e]] = t.style[arguments[e]];
  2246. return i
  2247. }
  2248. },
  2249. restore: function() {
  2250. if (t && t.nodeType) {
  2251. for (var e in i.style)
  2252. i.style.hasOwnProperty(e) && (t.style[e] = i.style[e]);
  2253. return i
  2254. }
  2255. }
  2256. };
  2257. return i
  2258. }
  2259. var Ve, ke, Ue, r, o, He = "sly", ze = e.cancelAnimationFrame || e.cancelRequestAnimationFrame, Ge = e.requestAnimationFrame, We = xe(document), je = "touchstart." + He + " mousedown." + He, Ye = "mousemove." + He + " mouseup." + He, qe = "touchmove." + He + " touchend." + He, Xe = (document.implementation.hasFeature("Event.wheel", "3.0") ? "wheel." : "mousewheel.") + He, Ze = "click." + He, Ke = "mousedown." + He, Qe = ["INPUT", "SELECT", "BUTTON", "TEXTAREA"], Je = [], $e = Math.abs, et = Math.sqrt, tt = Math.pow, it = Math.round, nt = Math.max, rt = Math.min, ot = 0;
  2260. function t(e) {
  2261. for (var t = 0, i = r.length; t < i; t++) {
  2262. var n = r[t] ? r[t] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2263. if (null != o.style[n])
  2264. return n
  2265. }
  2266. }
  2267. We.on(Xe, function(e) {
  2268. var t = e.originalEvent[He]
  2269. , i = +new Date;
  2270. (!t || t.options.scrollHijack < i - ot) && (ot = i)
  2271. }),
  2272. function(t) {
  2273. Ge = t.requestAnimationFrame || t.webkitRequestAnimationFrame || function(e) {
  2274. var t = (new Date).getTime()
  2275. , i = Math.max(0, 16 - (t - r))
  2276. , n = setTimeout(e, i);
  2277. return r = t,
  2278. n
  2279. }
  2280. ;
  2281. var r = (new Date).getTime()
  2282. , i = t.cancelAnimationFrame || t.webkitCancelAnimationFrame || t.clearTimeout;
  2283. ze = function(e) {
  2284. i.call(t, e)
  2285. }
  2286. }(window),
  2287. r = ["", "webkit", "moz", "ms", "o"],
  2288. o = document.createElement("div"),
  2289. Ve = t("transform"),
  2290. ke = t("perspective") ? "translateZ(0) " : "",
  2291. e.Sly = Me,
  2292. xe.fn.sly = function(n, r) {
  2293. var o, a;
  2294. return xe.isPlainObject(n) || ("string" !== Re(n) && !1 !== n || (o = !1 === n ? "destroy" : n,
  2295. a = Array.prototype.slice.call(arguments, 1)),
  2296. n = {}),
  2297. this.each(function(e, t) {
  2298. var i = xe.data(t, He);
  2299. i || o ? i && o && i[o] && i[o].apply(i, a) : i = xe.data(t, He, new Me(t,n,r).init())
  2300. })
  2301. }
  2302. ,
  2303. Me.defaults = {
  2304. slidee: null,
  2305. horizontal: !1,
  2306. itemNav: null,
  2307. itemSelector: null,
  2308. smart: !1,
  2309. activateOn: null,
  2310. activateMiddle: !1,
  2311. scrollSource: null,
  2312. scrollBy: 0,
  2313. scrollHijack: 300,
  2314. scrollTrap: !1,
  2315. dragSource: null,
  2316. mouseDragging: !1,
  2317. touchDragging: !1,
  2318. releaseSwing: !1,
  2319. swingSpeed: .2,
  2320. elasticBounds: !1,
  2321. interactive: null,
  2322. scrollBar: null,
  2323. dragHandle: !1,
  2324. dynamicHandle: !1,
  2325. minHandleSize: 50,
  2326. clickBar: !1,
  2327. syncSpeed: .5,
  2328. pagesBar: null,
  2329. activatePageOn: null,
  2330. pageBuilder: function(e) {
  2331. return "<li>" + (e + 1) + "</li>"
  2332. },
  2333. forward: null,
  2334. backward: null,
  2335. prev: null,
  2336. next: null,
  2337. prevPage: null,
  2338. nextPage: null,
  2339. cycleBy: null,
  2340. cycleInterval: 5e3,
  2341. pauseOnHover: !1,
  2342. startPaused: !1,
  2343. moveBy: 300,
  2344. speed: 0,
  2345. easing: "swing",
  2346. startAt: null,
  2347. keyboardNavBy: null,
  2348. draggedClass: "dragged",
  2349. activeClass: "active",
  2350. disabledClass: "disabled"
  2351. }
  2352. }(jQuery, window),
  2353. function o(a, s, l) {
  2354. function c(i, e) {
  2355. if (!s[i]) {
  2356. if (!a[i]) {
  2357. var t = "function" == typeof require && require;
  2358. if (!e && t)
  2359. return t(i, !0);
  2360. if (h)
  2361. return h(i, !0);
  2362. var n = new Error("Cannot find module '" + i + "'");
  2363. throw n.code = "MODULE_NOT_FOUND",
  2364. n
  2365. }
  2366. var r = s[i] = {
  2367. exports: {}
  2368. };
  2369. a[i][0].call(r.exports, function(e) {
  2370. var t = a[i][1][e];
  2371. return c(t || e)
  2372. }, r, r.exports, o, a, s, l)
  2373. }
  2374. return s[i].exports
  2375. }
  2376. for (var h = "function" == typeof require && require, e = 0; e < l.length; e++)
  2377. c(l[e]);
  2378. return c
  2379. }({
  2380. 1: [function(p, f, e) {
  2381. (function(e) {
  2382. "use strict";
  2383. function t(e) {
  2384. this.player = null,
  2385. this.director = null,
  2386. this.modelManager = null,
  2387. this.container = null,
  2388. this.tagManager = null,
  2389. this.fadeInSpeed = e,
  2390. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2391. }
  2392. var r = p("three")
  2393. , i = p("./util/logger")
  2394. , n = (p("./util/common"),
  2395. p("./enum/PlayerEvents"))
  2396. , o = p("./enum/DirectorEvents")
  2397. , a = p("./settings")
  2398. , s = p("./enum/Viewmode")
  2399. , l = (p("./enum/WarpStyle"),
  2400. p("./enum/BlackoutStyle"),
  2401. p("./enum/ModelManagerEvents"))
  2402. , c = p("./enum/tagEvents")
  2403. , h = p("./util/transitions")
  2404. , u = p("./util/lerp")
  2405. , d = new i(e);
  2406. t.prototype.init = function(e, t, i, n, r) {
  2407. (window.app = this).player = t,
  2408. this.director = e,
  2409. this.modelManager = i,
  2410. this.tagManager = n,
  2411. this.container = r,
  2412. this.updateModel(),
  2413. this.bindEvents()
  2414. }
  2415. ,
  2416. t.prototype.bindEvents = function() {
  2417. this.modelManager.on(l.ActiveModelChanged, this.updateModel.bind(this)),
  2418. this.player.on(n.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2419. this.player.on(n.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2420. this.player.on(n.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2421. this.player.on(n.StartInside, this.handleStartInside.bind(this)),
  2422. this.player.on(n.StartOutside, this.handleStartOutside.bind(this)),
  2423. this.player.on(n.WarpStarted, this.handleWarpStarted.bind(this)),
  2424. this.director.on(o.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2425. this.tagManager.on(c.TagActivated, this.ontagActivated.bind(this)),
  2426. this.tagManager.on(c.TagNavigation, this.onNavigationTotag.bind(this))
  2427. }
  2428. ,
  2429. t.prototype.updateModel = function() {
  2430. this.model = this.modelManager.getActiveModel()
  2431. }
  2432. ,
  2433. t.prototype.handleWarpStarted = function() {
  2434. this.hidePlayerReticule()
  2435. }
  2436. ,
  2437. t.prototype.ontagActivated = function() {
  2438. this.hidePlayerReticule()
  2439. }
  2440. ,
  2441. t.prototype.onNavigationTotag = function() {
  2442. this.hidePlayerReticule()
  2443. }
  2444. ,
  2445. t.prototype.handlePlayerModeChanging = function(e, t, i) {
  2446. var n = this.modelManager.getActiveModel()
  2447. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : a[t].markerOpacity;
  2448. n.fadePanoMarkers(r),
  2449. n.setMode(t)
  2450. }
  2451. ,
  2452. t.prototype.handlePlayerModeChanged = function(e, t) {
  2453. var i = this.modelManager.getActiveModel()
  2454. , n = t === s.PANORAMA ? r.DoubleSide : r.FrontSide;
  2455. i.setSide(n),
  2456. i.setMode(t)
  2457. }
  2458. ,
  2459. t.prototype.handleClosestPanoChanging = function(e, t, i) {
  2460. i !== s.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2461. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2462. }
  2463. ,
  2464. t.prototype.handleActionInterruption = function() {}
  2465. ,
  2466. t.prototype.handleStartInside = function(e) {
  2467. var t = a[this.player.mode]
  2468. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2469. this.fadeIn(this.fadeInSpeed),
  2470. this.model.alpha = 0,
  2471. this.model.skybox.material.uniforms.opacity.value = 1,
  2472. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2473. var n = this.player.reticule;
  2474. h.start(u.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2475. }
  2476. ,
  2477. t.prototype.handleStartOutside = function(e) {
  2478. this.fadeIn(e)
  2479. }
  2480. ,
  2481. t.prototype.fadeIn = function(e) {
  2482. null != e || (e = 2e3,
  2483. d.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2484. $(this.container).fadeIn(e)
  2485. }
  2486. ,
  2487. t.prototype.hidePlayerReticule = function() {
  2488. this.player.reticule.hide()
  2489. }
  2490. ,
  2491. f.exports = t
  2492. }
  2493. ).call(this, "/js/DisplayController.js")
  2494. }
  2495. , {
  2496. "./enum/BlackoutStyle": 18,
  2497. "./enum/DirectorEvents": 23,
  2498. "./enum/tagEvents": 32,
  2499. "./enum/ModelManagerEvents": 33,
  2500. "./enum/PlayerEvents": 40,
  2501. "./enum/Viewmode": 51,
  2502. "./enum/WarpStyle": 52,
  2503. "./settings": 166,
  2504. "./util/common": 185,
  2505. "./util/lerp": 188,
  2506. "./util/logger": 189,
  2507. "./util/transitions": 195,
  2508. three: 217
  2509. }],
  2510. 2: [function(e, t, i) {
  2511. "use strict";
  2512. function n() {
  2513. this.baseStartTime = performance.timing.navigationStart,
  2514. this.loadingStartTime = null,
  2515. this.waitingStartTime = null,
  2516. this.appReadyTime = null
  2517. }
  2518. n.prototype.setBaseStartTime = function(e) {
  2519. this.baseStartTime = e || Date.now()
  2520. }
  2521. ,
  2522. n.prototype.setWaitingStartTime = function(e) {
  2523. this.waitingStartTime = e || Date.now()
  2524. }
  2525. ,
  2526. n.prototype.setLoadingStartTime = function(e) {
  2527. this.loadingStartTime = e || Date.now()
  2528. }
  2529. ,
  2530. n.prototype.setAppReadyTime = function(e) {
  2531. this.appReadyTime = e || Date.now()
  2532. }
  2533. ,
  2534. n.prototype.calcFullLoadingTime = function() {
  2535. var e = this.appReadyTime - this.baseStartTime;
  2536. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2537. e
  2538. }
  2539. ,
  2540. t.exports = n
  2541. }
  2542. , {}],
  2543. 3: [function(i, n, e) {
  2544. (function(e) {
  2545. "use strict";
  2546. function a() {
  2547. return 100 * Math.random()
  2548. }
  2549. var t = i("./util/logger")
  2550. , s = i("./util/browser")
  2551. , l = new t(e)
  2552. , c = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2553. initialized: !1,
  2554. init: function(e, t) {
  2555. if (t = t || {},
  2556. !this.initialized) {
  2557. for (var i in this.initialized = !0,
  2558. s.valueFromHash("tilegen") && (t.tilegen = 1 === s.valueFromHash("tilegen", 0)),
  2559. s.valueFromHash("imgopt") && (t.imgopt = 1 === s.valueFromHash("imgopt", 0)),
  2560. e) {
  2561. var n = i.match("^sc_tilegen_([0-9]+)$");
  2562. n && (c.tilegen = a() < parseInt(n[1]));
  2563. var r = i.match("^sc_imgopt_([0-9]+)$");
  2564. r && (c.imgopt = a() < parseInt(r[1]))
  2565. }
  2566. for (var o in t)
  2567. c[o] = t[o],
  2568. l.debug("A/B override:", o, c[o])
  2569. }
  2570. },
  2571. changeIfTileGenerating: function(e) {
  2572. return c.tilegen && (e += -1 === e.indexOf("?") ? "?" : "&",
  2573. e += ""),
  2574. e
  2575. },
  2576. changeIfImageOptimzing: function(e) {
  2577. if(e.includes("blob:http"))return e;//add
  2578. return c.imgopt && -1 === e.indexOf("imgopt=1") && (e += -1 === e.indexOf("?") ? "?" : "&",
  2579. e += ""),
  2580. e
  2581. },
  2582. tilegen: !1,
  2583. imgopt: !1
  2584. };
  2585. n.exports = c
  2586. }
  2587. ).call(this, "/js/ab.js")
  2588. }
  2589. , {
  2590. "./util/browser": 182,
  2591. "./util/logger": 189
  2592. }],
  2593. 4: [function(u, d, e) {
  2594. (function(e) {
  2595. "use strict";
  2596. function r(n, e, t, i) {
  2597. function r(e) {
  2598. a[e.sid] = !0;
  2599. var t = e.billboard.media && e.billboard.media.type
  2600. , i = {
  2601. tag_id: e.sid,
  2602. tags_visited: Object.keys(a).length,
  2603. tag_count: Object.keys(n.tags).length,
  2604. tag_view_count: ++d,
  2605. has_media: !!t
  2606. };
  2607. t && (i.media_type = t),
  2608. g("tag_opened", i)
  2609. }
  2610. var o, a = {}, s = Date.now() - P, l = null;
  2611. i && (l = Date.now() - window.navigationStart);
  2612. try {
  2613. o = /* n.data.player_options.highlight_reel && */ 0 < n.heroLocations.length
  2614. } catch (n) {
  2615. o = !1
  2616. }
  2617. var c, h = n.supportsVR;
  2618. h || (c = "VR disabled at the model/account level",
  2619. y.valueFromHash("vr") === w.NONE ? c = "VR disabled, using &vr=0" : y.detectAndroid() ? _.isDeviceSupported(b.Android) || (c = "VR disabled, unsupported Android version") : y.detectIOS() && (_.isDeviceSupported(b.IOS) || (c = "VR disabled, unsupported iOS version"))),
  2620. g("model_loaded", {
  2621. duration: s,
  2622. duration_from_navigation_start: l,
  2623. has_hlr: o,
  2624. has_vr: h,
  2625. vr_reason: c
  2626. });
  2627. var u = 0;
  2628. n.panos.forEach(function(e) {
  2629. e.on("enter", function() {
  2630. f("pano_viewed", {
  2631. pano_id: e.id,
  2632. pano_view_count: ++u,
  2633. alignment_type: e.alignmentType,
  2634. interaction_source: R,
  2635. navigation_source: v
  2636. })
  2637. })
  2638. });
  2639. var d = 0;
  2640. for (var p in n.tags)
  2641. n.tags[p].billboard.on(M.OPENED, r.bind(this, n.tags[p]));
  2642. e.on("tour_auto", function(e) {
  2643. v = "tour_" + e
  2644. }),
  2645. e.on("tour_manual", function(e) {
  2646. R = "gui-" + e,
  2647. v = "tour_manual"
  2648. }),
  2649. t.on(C.InteractionKey, function() {
  2650. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionKey)
  2651. }),
  2652. t.on(C.InteractionDirect, function() {
  2653. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionDirect)
  2654. }),
  2655. function(t) {
  2656. I.on(T.OPENED, function() {
  2657. f("showcase_share_intent", {
  2658. pano_id: t.currentPano && t.currentPano.id
  2659. })
  2660. }),
  2661. I.on(T.LINK_CLICKED, function(e) {
  2662. f("showcase_share_action", {
  2663. channel: e.channel,
  2664. pano_id: t.currentPano && t.currentPano.id
  2665. })
  2666. }),
  2667. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2668. f("showcase_share_origin_link_clicked")
  2669. })
  2670. }(e),
  2671. function() {
  2672. _.on(S.OPENED, f.bind(this, "showcase_gui", {
  2673. gui_action: "click_vr_button"
  2674. })),
  2675. _.on(S.LAUNCH, function(e) {
  2676. f("showcase_gui", {
  2677. gui_action: "launch_vr",
  2678. vr_platform: e.vr_platform,
  2679. vr_app: e.vr_app
  2680. })
  2681. }),
  2682. _.on(S.PREV, f.bind(this, "showcase_gui", {
  2683. gui_action: "vr_modal_prev"
  2684. })),
  2685. _.on(S.NEXT, function(e) {
  2686. f("showcase_gui", {
  2687. gui_action: e.nextAction
  2688. })
  2689. }),
  2690. _.on(S.CLOSED, f.bind(this, "showcase_gui", {
  2691. gui_action: "vr_modal_close"
  2692. })),
  2693. _.on(S.falseICECHOSEN, function(e) {
  2694. f("showcase_gui", {
  2695. gui_action: e.name + " "
  2696. })
  2697. }),
  2698. _.on(S.STORE, function(e) {
  2699. f("showcase_gui", {
  2700. gui_action: "launch_store",
  2701. store: e
  2702. })
  2703. })
  2704. }()
  2705. }
  2706. function f(e, t) {
  2707. if (t = t || {},
  2708. i)
  2709. try {
  2710. window.analytics.track(e, s.extendObject(t, c), {
  2711. context: {
  2712. app: {
  2713. name: "showcase",
  2714. version: "2.25.6-0-gd87e5b1"
  2715. },
  2716. screen: {
  2717. width: window.screen.width,
  2718. height: window.screen.height,
  2719. density: window.devicePixelRatio
  2720. }
  2721. }
  2722. })
  2723. } catch (t) {
  2724. console.warn("Failed to send data to segment for " + e)
  2725. }
  2726. }
  2727. function g(e, t) {
  2728. f(e, t = t || {})
  2729. }
  2730. function m(e, t) {
  2731. R = e === C.InteractionGui ? "gui-" + t : e,
  2732. v = "self_guided"
  2733. }
  2734. var v, o, a = (u("three"),
  2735. u("./util/ajax"),
  2736. u("./ab")), y = u("./util/browser"), s = u("./util/common"), t = u("./settings"), A = (u("./localization/localize"),
  2737. u("./enum/Viewmode")), C = u("./enum/ControlEvents"), I = u("./gui/sharing/modal"), E = u("./gui/title/titleBar"), _ = u("./gui/vr/vrModal"), b = u("./enum/VRPlatforms"), w = u("./enum/VROption"), T = u("./gui/sharing/ShareEvents"), x = u("./gui/title/TitleEvents"), S = u("./gui/vr/vrEvent"), M = u("./tag/Billboard/BillboardEvent"), l = new (u("./util/logger"))(e), R = (u("./enum/PlayerEvents"),
  2738. "direct"), i = null, n = !1, P = null, c = null, h = s.uuid4();
  2739. d.exports = {
  2740. report: function(e, t, i, n) {
  2741. !function(e, t) {
  2742. if (o)
  2743. try {
  2744. o.addEvent(e, s.extendObject({
  2745. host: window.location.host,
  2746. keen: {
  2747. addons: [{
  2748. name: "keen:ua_parser",
  2749. input: {
  2750. ua_string: "user_agent"
  2751. },
  2752. output: "parsed_user_agent"
  2753. }]
  2754. },
  2755. user_agent: "${keen.user_agent}",
  2756. referrer: {
  2757. url: s.normalizeUrl(document.referrer),
  2758. domain: s.domainFromUrl(document.referrer),
  2759. url_original: document.referrer
  2760. },
  2761. embedded: y.inIframe(),
  2762. is_mobile: y.isMobile(),
  2763. version: "2.25.6-0-gd87e5b1"
  2764. }, t))
  2765. } catch (e) {
  2766. l.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2767. }
  2768. }("Session starts", {
  2769. model: e,
  2770. status: t,
  2771. loadtime: Date.now() - (P || Date.now()),
  2772. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2773. autoplay: i,
  2774. quickstart: n,
  2775. ab_tilegen: a.tilegen,
  2776. ab_imgopt: a.imgopt
  2777. })
  2778. },
  2779. impression: function(e) {
  2780. g("impression", {
  2781. visible: void 0 === (e = e || {}).isVisible || e.isVisible,
  2782. url_params: (void 0 !== e.immediate && e.immediate,
  2783. window.location.search.substr(1).split("&"))
  2784. })
  2785. },
  2786. initKeen: function(e) {
  2787. return e.token && e.appId ? void (o = new Keen({
  2788. projectId: e.appId,
  2789. writeKey: e.token,
  2790. readKey: "",
  2791. requestType: "xhr"
  2792. })) : void l.warn("no keen token/appId")
  2793. },
  2794. initSegment: function(e) {
  2795. return e.token ? (i = e.token,
  2796. window.analytics.load(e.token),
  2797. c = {
  2798. model_id: e.model,
  2799. start_source: e.startSource,
  2800. autoplay: e.autoplay,
  2801. quickstart: e.quickstart,
  2802. language_tag: t.languageTag,
  2803. is_mobile: y.isMobile(),
  2804. iframe: y.inIframe(),
  2805. aspect_ratio: y.aspectRatio(),
  2806. session_id: h,
  2807. window: {
  2808. width: $("#player").width(),
  2809. height: $("#player").height()
  2810. },
  2811. platform: {
  2812. browser: {
  2813. name: $.ua.browser.name,
  2814. major: $.ua.browser.major,
  2815. version: $.ua.browser.version
  2816. },
  2817. os: {
  2818. name: $.ua.os.name,
  2819. version: $.ua.os.version
  2820. },
  2821. device: {
  2822. vendor: $.ua.device.vendor,
  2823. model: $.ua.device.model,
  2824. type: $.ua.device.type
  2825. }
  2826. }
  2827. },
  2828. n = Math.random() < t.analytics.sessionTrackingRate,
  2829. l.debug("tracking sample rate = " + t.analytics.sessionTrackingRate),
  2830. void l.debug("tracking this session = " + n)) : void l.warn("no segment token")
  2831. },
  2832. sessionStart: function(e) {
  2833. l.debug("analytics user_session_start"),
  2834. f("session_started"),
  2835. P = Date.now(),
  2836. window.addEventListener("unload", function() {
  2837. !function(e, t) {
  2838. if (t = t || {},
  2839. navigator.sendBeacon && i)
  2840. try {
  2841. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2842. event: e,
  2843. anonymousId: window.analytics.user().anonymousId(),
  2844. properties: s.extendObject(t, c),
  2845. writeKey: i,
  2846. sentAt: Date.now(),
  2847. type: "track",
  2848. context: {
  2849. userAgent: y.userAgent(),
  2850. library: {
  2851. name: "showcase-beacon",
  2852. version: "2.25.6-0-gd87e5b1"
  2853. },
  2854. app: {
  2855. name: "showcase",
  2856. version: "2.25.6-0-gd87e5b1"
  2857. }
  2858. }
  2859. }))
  2860. } catch (e) {
  2861. console.warn("Failed to send async segment request")
  2862. }
  2863. }("session_ended", {
  2864. duration: Date.now() - P
  2865. })
  2866. })
  2867. },
  2868. modelLoaded: function(e, t, i, n) {
  2869. r(e, t, i, n)
  2870. },
  2871. loadComplete: function(e) {
  2872. f("load_times", {
  2873. time_to_app_start: e
  2874. })
  2875. },
  2876. track: function(e, t) {
  2877. n && (l.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2878. f(e, t))
  2879. },
  2880. trackAlways: function(e, t) {
  2881. l.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2882. f(e, t)
  2883. },
  2884. getSessionId: function() {
  2885. return h
  2886. },
  2887. updateInteraction: m
  2888. }
  2889. }
  2890. ).call(this, "/js/analytics.js")
  2891. }
  2892. , {
  2893. "./ab": 3,
  2894. "./enum/ControlEvents": 21,
  2895. "./enum/PlayerEvents": 40,
  2896. "./enum/VROption": 47,
  2897. "./enum/VRPlatforms": 49,
  2898. "./enum/Viewmode": 51,
  2899. "./gui/sharing/ShareEvents": 76,
  2900. "./gui/sharing/modal": 77,
  2901. "./gui/title/TitleEvents": 80,
  2902. "./gui/title/titleBar": 82,
  2903. "./gui/vr/vrEvent": 85,
  2904. "./gui/vr/vrModal": 87,
  2905. "./localization/localize": 108,
  2906. "./tag/Billboard/BillboardEvent": 120,
  2907. "./settings": 166,
  2908. "./util/ajax": 181,
  2909. "./util/browser": 182,
  2910. "./util/common": 185,
  2911. "./util/logger": 189,
  2912. three: 217
  2913. }],
  2914. 5: [function(e, t, i) {
  2915. "use strict";
  2916. function n() {
  2917. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  2918. this.controls = null
  2919. }
  2920. var r = e("three")
  2921. , o = e("../constants")
  2922. , a = e("../util/cameraLight");
  2923. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  2924. this.aspect = e,
  2925. this.updateProjectionMatrix()
  2926. }
  2927. ,
  2928. t.exports = n
  2929. }
  2930. , {
  2931. "../constants": 8,
  2932. "../util/cameraLight": 184,
  2933. three: 217
  2934. }],
  2935. 6: [function(e, t, i) {
  2936. "use strict";
  2937. function n() {
  2938. var e = $("#player").width() / $("#player").height();
  2939. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  2940. this.controls = null,
  2941. this.updateAspect(e)
  2942. }
  2943. var r = e("three")
  2944. , o = e("../constants");
  2945. (n.prototype = Object.create(r.OrthographicCamera.prototype)).updateAspect = function(e) {
  2946. this.aspect = e,
  2947. this.top = o.orthoBase / e,
  2948. this.bottom = -o.orthoBase / e,
  2949. this.updateProjectionMatrix()
  2950. }
  2951. ,
  2952. t.exports = n
  2953. }
  2954. , {
  2955. "../constants": 8,
  2956. three: 217
  2957. }],
  2958. 7: [function(e, t, i) {
  2959. "use strict";
  2960. function n() {
  2961. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  2962. this.controls = null
  2963. }
  2964. var r = e("three")
  2965. , o = e("../settings")
  2966. , a = e("../util/cameraLight");
  2967. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  2968. this.aspect = e,
  2969. this.updateProjectionMatrix()
  2970. }
  2971. ,
  2972. t.exports = n
  2973. }
  2974. , {
  2975. "../settings": 166,
  2976. "../util/cameraLight": 184,
  2977. three: 217
  2978. }],
  2979. 8: [function(e, t, i) {
  2980. "use strict";
  2981. t.exports = {
  2982. signedUrlDefaultExpireTime: 24e4,
  2983. signedUrlCheckInterval: 1e4,
  2984. signedUrlRefreshBuffer: 15e3,
  2985. dollhouseFOV: 70,
  2986. dollhouseNear: .1,//1,
  2987. dollhouseFar: 5e3,
  2988. insideFOV: 70,
  2989. insideFOVMax: 120,
  2990. insideNear: 0.01,//.1,
  2991. insideFar: 5e3,
  2992. insideLookSpeed: .12,
  2993. insideLookLimitUp: 40,
  2994. insideLookLimitDown: -40,
  2995. orthoNear: 1,
  2996. orthoFar: 5e3,
  2997. orthoBase: 10,
  2998. narrowLandscapeHeight: 290,
  2999. reallyNarrowLandscapeHeight: 250,
  3000. visionTilingStartDate: new Date("8/26/2016"),
  3001. visionTilingStartVersion: "1.1.407.13667",
  3002. windowHeightHighQualityThreshold: 900,
  3003. tourStepDelayDefault: 3500,
  3004. tourStepDelaySlideShow: 5e3,
  3005. workshopApsect: 9 / 16,
  3006. highQualityMaxZoom: 2,
  3007. ultraHighQualityMaxZoom: 3
  3008. }
  3009. }
  3010. , {}],
  3011. 9: [function(e, t, i) {
  3012. "use strict";
  3013. function n() {
  3014. this.activeControl = null,
  3015. this.controls = {},
  3016. this.cameras = {}
  3017. }
  3018. var a = e("./PanoramaControls")
  3019. , s = e("./DollhouseControls")
  3020. , l = e("./FloorplanControls")
  3021. , c = e("../cameras/PanoramaCamera")
  3022. , h = e("../cameras/DollhouseCamera")
  3023. , u = e("../cameras/FloorplanCamera")
  3024. , r = e("events").EventEmitter
  3025. , d = e("../enum/ControlEvents")
  3026. , o = e("../enum/ModelManagerEvents")
  3027. , p = e("../enum/Viewmode")
  3028. , f = e("../settings");
  3029. (n.prototype = Object.create(r.prototype)).init = function(e, t) {
  3030. this.setUpControls(),
  3031. this.bindEvents(e, t)
  3032. }
  3033. ,
  3034. n.prototype.activateControls = function(e) {
  3035. this.activeControl && (this.activeControl.reset(),
  3036. this.activeControl.enabled = !1),
  3037. this.controls[e] && (this.controls[e].enabled = !0),
  3038. this.activeControl = this.controls[e]
  3039. }
  3040. ,
  3041. n.prototype.setUpControls = function() {
  3042. var i = {}
  3043. , n = {}
  3044. , e = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3045. , r = [c, h, u]
  3046. , o = [a, s, l];
  3047. e.forEach(function(e, t) {
  3048. i[e] = new r[t],
  3049. n[e] = new o[t](i[e]),
  3050. n[e].on(d.Move, this.emit.bind(this, d.Move)),
  3051. n[e].on(d.InputStart, this.emit.bind(this, d.InputStart)),
  3052. n[e].on(d.InteractionDirect, this.emit.bind(this, d.InteractionDirect)),
  3053. n[e].on(d.InteractionKey, this.emit.bind(this, d.InteractionKey)),
  3054. n[e].on(d.Pinch, this.emit.bind(this, d.Pinch)),
  3055. n[e].on(d.Scroll, this.emit.bind(this, d.Scroll))
  3056. }
  3057. .bind(this)),
  3058. this.controls = n,
  3059. this.cameras = i
  3060. }
  3061. ,
  3062. n.prototype.bindEvents = function(e, t) {
  3063. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3064. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3065. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3066. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3067. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this), {
  3068. passive: !1
  3069. }),
  3070. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3071. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3072. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3073. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3074. e.addEventListener("contextmenu", function(e) {
  3075. e.preventDefault()
  3076. }),
  3077. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3078. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3079. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3080. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3081. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3082. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3083. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3084. t.on(o.ActiveModelChanged, function(e) {
  3085. this.setModelForControls(e.model)
  3086. }
  3087. .bind(this))
  3088. }
  3089. ,
  3090. n.prototype.setModelForControls = function(e) {
  3091. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3092. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3093. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3094. this.controls[e].setBounds(t)
  3095. }
  3096. .bind(this))
  3097. }
  3098. ,
  3099. n.prototype.onMouseDown = function(e) {
  3100. e.preventDefault(),
  3101. this.activeControl && this.activeControl.onMouseDown(e)
  3102. }
  3103. ,
  3104. n.prototype.onMouseMove = function(e) {
  3105. e.preventDefault(),
  3106. this.activeControl && this.activeControl.onMouseMove(e)
  3107. }
  3108. ,
  3109. n.prototype.onMouseUp = function(e) {
  3110. e.preventDefault(),
  3111. this.activeControl && this.activeControl.onMouseUp(e)
  3112. }
  3113. ,
  3114. n.prototype.onMouseOver = function(e) {
  3115. e.preventDefault(),
  3116. this.activeControl && this.activeControl.onMouseOver(e)
  3117. }
  3118. ,
  3119. n.prototype.onMouseWheel = function(e) {
  3120. e.preventDefault(),
  3121. this.activeControl && this.activeControl.onMouseWheel(e)
  3122. }
  3123. ,
  3124. n.prototype.onTouchStart = function(e) {
  3125. e.preventDefault(),
  3126. this.activeControl && this.activeControl.onTouchStart(e),
  3127. $("#hotListWrap")[0].classList.remove("hotListActive"),
  3128. $("#hotListContent ul .active").removeClass("active"),
  3129. $("#hotList")[0].classList.remove("active")
  3130. }
  3131. ,
  3132. n.prototype.onTouchMove = function(e) {
  3133. e.preventDefault(),
  3134. this.activeControl && this.activeControl.onTouchMove(e)
  3135. }
  3136. ,
  3137. n.prototype.onTouchEnd = function(e) {
  3138. e.preventDefault(),
  3139. this.activeControl && this.activeControl.onTouchEnd(e)
  3140. }
  3141. ,
  3142. n.prototype.onPointerDown = function(e) {
  3143. if (e.preventDefault(),
  3144. this.activeControl)
  3145. switch (e.pointerType) {
  3146. case "mouse":
  3147. this.activeControl.onMouseDown(e);
  3148. break;
  3149. default:
  3150. this.activeControl.onPointerDown(e)
  3151. }
  3152. }
  3153. ,
  3154. n.prototype.onPointerMove = function(e) {
  3155. if (e.preventDefault(),
  3156. this.activeControl)
  3157. switch (e.pointerType) {
  3158. case "mouse":
  3159. this.activeControl.onMouseMove(e);
  3160. break;
  3161. default:
  3162. this.activeControl.onPointerMove(e)
  3163. }
  3164. }
  3165. ,
  3166. n.prototype.onPointerUp = function(e) {
  3167. if (e.preventDefault(),
  3168. this.activeControl)
  3169. switch (e.pointerType) {
  3170. case "mouse":
  3171. this.activeControl.onMouseUp(e);
  3172. break;
  3173. default:
  3174. this.activeControl.onPointerUp(e)
  3175. }
  3176. }
  3177. ,
  3178. n.prototype.onPointerCancel = function(e) {
  3179. e.preventDefault(),
  3180. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3181. }
  3182. ,
  3183. n.prototype.onKeyDown = function(e) {
  3184. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3185. this.activeControl && this.activeControl.onKeyDown(e))
  3186. }
  3187. ,
  3188. n.prototype.onKeyUp = function(e) {
  3189. e.preventDefault(),
  3190. this.activeControl && this.activeControl.onKeyUp(e)
  3191. }
  3192. ,
  3193. t.exports = n
  3194. }
  3195. , {
  3196. "../cameras/DollhouseCamera": 5,
  3197. "../cameras/FloorplanCamera": 6,
  3198. "../cameras/PanoramaCamera": 7,
  3199. "../enum/ControlEvents": 21,
  3200. "../enum/ModelManagerEvents": 33,
  3201. "../enum/Viewmode": 51,
  3202. "../settings": 166,
  3203. "./DollhouseControls": 10,
  3204. "./FloorplanControls": 11,
  3205. "./PanoramaControls": 13,
  3206. events: 202
  3207. }],
  3208. 10: [function(e, t, i) {
  3209. "use strict";
  3210. function n(e) {
  3211. a.call(this, e),
  3212. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3213. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3214. this.minDistance = o.dollhouseDefault.minDistance,
  3215. this.maxDistance = o.dollhouseDefault.maxDistance,
  3216. this.adjustedMinDistance = this.minDistance,
  3217. this.adjustedMaxDistance = this.maxDistance
  3218. }
  3219. var r = e("three")
  3220. , o = e("../settings")
  3221. , a = e("./OutsideControls");
  3222. (n.prototype = Object.create(a.prototype)).pan = function(e, t) {
  3223. this.camera.updateMatrix();
  3224. var i = this.camera.position.clone().sub(this.target).length();
  3225. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3226. this.panLeft(2 * e * i / $("#player").height()),
  3227. this.panUp(-2 * t * i / $("#player").height())
  3228. }
  3229. ,
  3230. n.prototype.updateZoom = function() {
  3231. return this.offset.length() * this.scale
  3232. }
  3233. ,
  3234. n.prototype.setZoomBounds = function(e) {
  3235. var t = e.min.distanceTo(e.max);
  3236. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3237. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3238. this.minDistance = this.adjustedMinDistance,
  3239. this.maxDistance = this.adjustedMaxDistance
  3240. }
  3241. ,
  3242. n.prototype.resetRanges = function(e, t) {
  3243. e ? (this.minDistance = Math.min(e, this.minDistance),
  3244. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3245. this.maxDistance = this.adjustedMaxDistance),
  3246. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3247. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3248. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3249. }
  3250. ,
  3251. n.prototype.toJSON = function() {
  3252. return a.prototype.toJSON.call(this)
  3253. }
  3254. ,
  3255. t.exports = n
  3256. }
  3257. , {
  3258. "../settings": 166,
  3259. "./OutsideControls": 12,
  3260. three: 217
  3261. }],
  3262. 11: [function(e, t, i) {
  3263. "use strict";
  3264. function n(e) {
  3265. c.call(this, e),
  3266. this.minDistance = 15,
  3267. this.maxDistance = 50,
  3268. this.noRotateUpDown = !0,
  3269. this.minPolarAngle = 0,
  3270. this.maxPolarAngle = 0,
  3271. this.mouseActions[u.LEFT] = h.PAN,
  3272. this.mouseActions[u.MIDDLE] = h.DOLLY,
  3273. this.mouseActions[u.RIGHT] = h.ROTATE,
  3274. this.touchActions[1] = h.PAN,
  3275. this.touchActions[2] = h.ROTATE_DOLLY,
  3276. this.absoluteScale = 1,
  3277. this.currentScale = 1
  3278. }
  3279. var r, o, a, s = e("three"), l = e("../settings"), c = e("./OutsideControls"), h = e("../enum/ControlActions"), u = e("../enum/MouseButton"), d = e("../util/math"), p = e("../util/browser");
  3280. (n.prototype = Object.create(c.prototype)).zoomToContain = function(e) {
  3281. this.absoluteScale = this.getDefaultAbsoluteScale(e);
  3282. this.currentScale = this.absoluteScale
  3283. }
  3284. ,
  3285. /* n.prototype.getDefaultAbsoluteScale = function(modelSize) {
  3286. var t = Math.max(modelSize.x, modelSize.z)
  3287. , i = Math.min(modelSize.x, modelSize.z)
  3288. , n = Math.max(t, i * this.camera.aspect)
  3289. , r = Math.max(i, t * this.camera.aspect);
  3290. var absoluteScale = (p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase * 1.2
  3291. return absoluteScale
  3292. }, */
  3293. n.prototype.getDefaultAbsoluteScale = function(modelSize, ratio) {
  3294. let defaultRatio = 1.2 , absoluteScale
  3295. if(_settings.floorPlanAngle){//指定了角度的话,就和browser.aspectRatio()无关,总使用纵向
  3296. var angle = parseFloat(_settings.floorPlanAngle)
  3297. /* if(_settings.angleShift2d){ //怎么算都会超出,仔细想了下是无法算准的
  3298. angle += THREE.Math.degToRad(_settings.angleShift2d)
  3299. } */
  3300. modelSize = modelSize.clone().applyEuler(new THREE.Euler(0, angle, 0))
  3301. var n = Math.max(Math.abs(modelSize.x), Math.abs(modelSize.z) * this.camera.aspect) //视口宽高比 >= 1 情况下,模型所占最大视口尺寸
  3302. var screenSize = Math.min($("#player").width(), $("#player").height())
  3303. var maxSize = 800;//模型最大占据像素
  3304. ratio = ratio != void 0 ? ratio : Math.max(screenSize * defaultRatio / maxSize, defaultRatio) ;
  3305. absoluteScale = n / 2 / l.orthoBase * ratio; //根据模型所占最大视口尺寸调整缩放
  3306. }else{
  3307. var t = Math.max(modelSize.x, modelSize.z)
  3308. , i = Math.min(modelSize.x, modelSize.z)
  3309. , n = Math.max(t, i * this.camera.aspect)
  3310. , r = Math.max(i, t * this.camera.aspect);
  3311. absoluteScale = (p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase * defaultRatio
  3312. }
  3313. return absoluteScale
  3314. },
  3315. n.prototype.rotateToView = function(modelSize, direction, type) {
  3316. let i = 0, n = p.aspectRatio() < 1 //是否模型尺寸显“细长”
  3317. if(_settings.floorPlanAngle ){//规定了cadImage旋转值的话 (0是无效的,将不设置)
  3318. i = parseFloat(_settings.floorPlanAngle)
  3319. }else{
  3320. let r = modelSize.x < modelSize.z; //是否视口为“窄屏”
  3321. if(n === r) //“细长” 且 “窄屏”,说明模型尺寸比例与视口比例匹配,相机坐标只需要调转“前”“后”
  3322. {
  3323. if(direction.z > 0) //(第一种情况)相机是否位于背面。 注:在默认情况下webgl的相机朝向-z, direction.z > 0 说明相机视野已经偏向+z,说明相机位于模型“背面”
  3324. {
  3325. i = Math.PI; //经度上做180度轨道角位移,使相机移到静止模型的“前面”
  3326. }
  3327. //(第二种情况) 不做处理
  3328. }
  3329. else if(direction.x > 0)
  3330. {
  3331. i = Math.PI / 2;
  3332. }
  3333. else
  3334. {
  3335. i = -Math.PI / 2;
  3336. }
  3337. }
  3338. if(_settings.angleShift2d){
  3339. i += THREE.Math.degToRad(_settings.angleShift2d)
  3340. }
  3341. if(type == 'update'){//若不是update,只能是从其他模式刚转到floorplan
  3342. i += this.lon
  3343. }
  3344. this.rotateLeft(i);
  3345. this.update(0);
  3346. }
  3347. ,
  3348. n.prototype.updateRotate = function(angle){//add 在floorplan模式直接旋转
  3349. this.rotateToView(player.model.size, player.getDirection(),'update');
  3350. }
  3351. /* n.prototype.rotateToAngle = function(angle){//add 旋转到特定角度
  3352. this.rotateLeft(angle + this.lon);
  3353. this.update(0);
  3354. } */
  3355. ,
  3356. n.prototype.pan = function(e, t) {
  3357. this.camera.updateMatrix(),
  3358. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3359. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3360. }
  3361. ,
  3362. n.prototype.updateZoom = function() {
  3363. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3364. this.absoluteScale = Math.max(l.zoomNearLimit, Math.min(this.absoluteScale, l.zoomFarLimit)),
  3365. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3366. this.camera.left = -l.orthoBase * this.currentScale,
  3367. this.camera.right = l.orthoBase * this.currentScale,
  3368. this.camera.top = l.orthoBase * this.currentScale / this.camera.aspect,
  3369. this.camera.bottom = -l.orthoBase * this.currentScale / this.camera.aspect,
  3370. this.camera.updateProjectionMatrix(),
  3371. this.offset.length()
  3372. }
  3373. ,
  3374. n.prototype.toJSON = (r = new s.Quaternion,
  3375. o = (new s.Quaternion).setFromAxisAngle(new s.Vector3(0,1,0), s.Math.degToRad(90)),
  3376. a = new s.Quaternion,
  3377. function() {
  3378. var e = c.prototype.toJSON.call(this);
  3379. return r.copy(e.camera_quaternion),
  3380. a.copy(o),
  3381. a.multiply(r),
  3382. e.camera_quaternion.x = d.toPrecision(a.x, 4),
  3383. e.camera_quaternion.y = d.toPrecision(a.y, 4),
  3384. e.camera_quaternion.z = d.toPrecision(a.z, 4),
  3385. e.camera_quaternion.w = d.toPrecision(a.w, 4),
  3386. e.ortho_zoom = d.toPrecision(this.currentScale * this.camera.aspect, 4),
  3387. e
  3388. }
  3389. ),
  3390. t.exports = n
  3391. }
  3392. , {
  3393. "../enum/ControlActions": 20,
  3394. "../enum/MouseButton": 34,
  3395. "../settings": 166,
  3396. "../util/browser": 182,
  3397. "../util/math": 190,
  3398. "./OutsideControls": 12,
  3399. three: 217
  3400. }],
  3401. 12: [function(e, t, i) {
  3402. "use strict";
  3403. function n(e) {
  3404. this.camera = e,
  3405. (this.camera.controls = this).enabled = !1,
  3406. this.target = new a.Vector3,
  3407. this.targetBounds = new a.Box3,
  3408. this.zoomSpeed = 2,//编辑时缩放快一些
  3409. this.minDistance = 0,
  3410. this.maxDistance = 1 / 0,
  3411. this.noRotateUpDown = !1,
  3412. this.rotateSpeed = 1,
  3413. this.keyboardZoomSpeed = 0,
  3414. this.keyPanSpeed = 7,
  3415. this.autoRotate = !1,
  3416. this.autoRotateSpeed = 2,
  3417. this.autoPan = !1,
  3418. this.autoPanPosition = new a.Vector3,
  3419. this.minPolarAngle = a.Math.degToRad(25),
  3420. this.maxPolarAngle = a.Math.degToRad(65),
  3421. this.rotationAcceleration = new a.Vector2,
  3422. this.rotationSpeed = new a.Vector2,
  3423. this.panAcceleration = new a.Vector2,
  3424. this.panSpeed = new a.Vector2,
  3425. this.rotateStart = new a.Vector2,
  3426. this.rotateEnd = new a.Vector2,
  3427. this.rotateDelta = new a.Vector2,
  3428. this.panStart = new a.Vector2,
  3429. this.panEnd = new a.Vector2,
  3430. this.panDelta = new a.Vector2,
  3431. this.panOffset = new a.Vector3,
  3432. this.offset = new a.Vector3,
  3433. this.dollyStart = new a.Vector2,
  3434. this.dollyEnd = new a.Vector2,
  3435. this.dollyDelta = new a.Vector2,
  3436. this.phiDelta = 0,
  3437. this.thetaDelta = 0,
  3438. this.scale = 1,
  3439. this.panVector = new a.Vector3,
  3440. this.lastPosition = new a.Vector3,
  3441. this.state = u.NONE,
  3442. this.mouseActions = {},
  3443. this.mouseActions[d.LEFT] = u.ROTATE,
  3444. this.mouseActions[d.MIDDLE] = u.DOLLY,
  3445. this.mouseActions[d.RIGHT] = u.PAN,
  3446. this.touchActions = {},
  3447. this.touchActions[1] = u.ROTATE,
  3448. this.touchActions[2] = u.PAN_DOLLY,
  3449. this.lastMoveTime = 0,
  3450. this.pointersLimit = 2,
  3451. this.pointers = []
  3452. }
  3453. var r, o, a = e("three"), c = e("../settings"), h = e("../util/common"), s = e("../util/math"), l = e("../enum/Vectors"), u = e("../enum/ControlActions"), d = e("../enum/MouseButton"), p = e("../enum/Keys"), f = e("../enum/ControlEvents"), g = e("events").EventEmitter;
  3454. (n.prototype = Object.create(g.prototype)).setBounds = function(e) {
  3455. this.targetBounds = e
  3456. }
  3457. ,
  3458. n.prototype.isEngaged = function() {
  3459. return this.state !== u.NONE
  3460. }
  3461. ,
  3462. n.prototype.rotateLeft = function(e) {
  3463. void 0 === e && (e = this.getAutoRotationAngle()),
  3464. this.thetaDelta -= e
  3465. }
  3466. ,
  3467. n.prototype.rotateUp = function(e) {
  3468. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3469. this.phiDelta -= e)
  3470. }
  3471. ,
  3472. n.prototype.panLeft = function(e) {
  3473. var t = this.camera.matrix.elements;
  3474. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3475. this.panOffset.multiplyScalar(-e),
  3476. this.panVector.add(this.panOffset)
  3477. }
  3478. ,
  3479. n.prototype.panUp = function(e) {
  3480. var t = this.camera.matrix.elements;
  3481. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3482. this.panOffset.multiplyScalar(-e),
  3483. this.panVector.add(this.panOffset)
  3484. }
  3485. ,
  3486. n.prototype.startRotating = function(e, t) {
  3487. e && this.navRotationAcc("x", e),
  3488. t && this.navRotationAcc("y", t)
  3489. }
  3490. ,
  3491. n.prototype.stopRotating = function(e) {
  3492. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3493. this.navRotationAcc("x", 0),
  3494. this.navRotationAcc("y", 0)
  3495. }
  3496. ,
  3497. n.prototype.setAutoPanPosition = (r = new a.Vector3,
  3498. o = new a.Vector3,
  3499. function(e, t) {
  3500. r.copy(this.camera.position),
  3501. void 0 === e && null === e || r.setX(e),
  3502. void 0 === t && null === t || r.setZ(t);
  3503. var i = this.camera.position.distanceTo(this.target)
  3504. , n = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3505. this.targetClamped = !1,
  3506. o.copy(r).addScaledVector(n, i),
  3507. this.targetBounds.containsPoint(o) || (this.targetBounds.clampPoint(o, o),
  3508. r.copy(o).addScaledVector(n, -i),
  3509. this.targetClamped = !0),
  3510. this.autoPanPosition.x = r.x,
  3511. this.autoPanPosition.z = r.z,
  3512. this.autoPan && this.stopAutoPanning()
  3513. }
  3514. ),
  3515. n.prototype.stopAutoPanning = function() {
  3516. var e = this.autoPan;
  3517. this.autoPan = !1,
  3518. this.emit(this.targetClamped ? f.AutoPanClamped : e ? f.AutoPanInterrupt : f.AutoPanComplete)
  3519. }
  3520. ,
  3521. n.prototype.dollyIn = function(e) {
  3522. void 0 === e && (e = this.getZoomScale()),
  3523. this.scale /= e
  3524. }
  3525. ,
  3526. n.prototype.dollyOut = function(e) {
  3527. void 0 === e && (e = this.getZoomScale()),
  3528. this.scale *= e
  3529. }
  3530. ,
  3531. n.prototype.updatePan = function(e) {
  3532. if (this.panSpeed.multiplyScalar(1 - c.panFriction).addScaledVector(this.panAcceleration, c.panAccelerationOutside * e),
  3533. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3534. this.autoPan) {
  3535. var t = (new a.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3536. t.setY(0).clampLength(0, 50 * e),
  3537. this.target.add(t),
  3538. this.camera.position.add(t),
  3539. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3540. this.stopAutoPanning())
  3541. }
  3542. }
  3543. ,
  3544. n.prototype.update = function(e) {
  3545. e = e || 1 / 60,
  3546. this.rotationSpeed.multiplyScalar(1 - c.rotationFriction).addScaledVector(this.rotationAcceleration, c.rotationAccelerationOutside * e),
  3547. this.rotateLeft(-this.rotationSpeed.x),
  3548. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3549. this.updatePan(e);
  3550. var t = this.camera.position;
  3551. this.offset.copy(t).sub(this.target);
  3552. var i = Math.atan2(this.offset.x, this.offset.z)
  3553. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3554. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3555. i += this.thetaDelta,
  3556. n += this.phiDelta,
  3557. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3558. n = Math.max(1e-6, Math.min(Math.PI - 1e-6, n));
  3559. this.lon = i, this.lat = n//add
  3560. var r = this.updateZoom();
  3561. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3562. this.target.add(this.panVector),
  3563. this.targetBounds.clampPoint(this.target, this.target),
  3564. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3565. this.offset.y = r * Math.cos(n),
  3566. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3567. t.copy(this.target).add(this.offset),
  3568. this.camera.lookAt(this.target),
  3569. this.thetaDelta = 0,
  3570. this.phiDelta = 0,
  3571. this.scale = 1,
  3572. this.panVector.set(0, 0, 0),
  3573. 0 < this.lastPosition.distanceTo(this.camera.position) && this.lastPosition.copy(this.camera.position)
  3574. }
  3575. ,
  3576. n.prototype.getAutoRotationAngle = function() {
  3577. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3578. }
  3579. ,
  3580. n.prototype.getZoomScale = function() {
  3581. return Math.pow(.95, this.zoomSpeed)
  3582. }
  3583. ,
  3584. n.prototype.onMouseDown = function(e) {
  3585. if (this.enabled) {
  3586. switch (e.preventDefault(),
  3587. this.stopAutoPanning(),
  3588. this.mouseDown = !0,
  3589. this.state = this.mouseActions[e.button],
  3590. this.state) {
  3591. case u.ROTATE:
  3592. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3593. this.rotationSpeed.set(0, 0);
  3594. break;
  3595. case u.DOLLY:
  3596. this.dollyStart.set(e.clientX, e.clientY);
  3597. break;
  3598. case u.PAN:
  3599. this.panStart.set(e.clientX, e.clientY)
  3600. }
  3601. this.emit(f.InputStart, "mouse")
  3602. }
  3603. }
  3604. ,
  3605. n.prototype.onMouseMove = function(e) {
  3606. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3607. switch (e.preventDefault(),
  3608. this.state) {
  3609. case u.ROTATE:
  3610. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3611. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3612. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3613. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3614. this.rotateStart.copy(this.rotateEnd);
  3615. break;
  3616. case u.DOLLY:
  3617. this.dollyEnd.set(e.clientX, e.clientY),
  3618. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart),
  3619. (0 < this.dollyDelta.y ? this.dollyIn : this.dollyOut).call(this),
  3620. this.dollyStart.copy(this.dollyEnd);
  3621. break;
  3622. case u.PAN:
  3623. this.panEnd.set(e.clientX, e.clientY),
  3624. this.panDelta.subVectors(this.panEnd, this.panStart),
  3625. this.pan(this.panDelta.x, this.panDelta.y),
  3626. this.panStart.copy(this.panEnd)
  3627. }
  3628. this.emit(f.Move, "mouse"),
  3629. this.lastMoveTime = e.timeStamp,
  3630. this.update()
  3631. }
  3632. }
  3633. ,
  3634. n.prototype.onMouseUp = function(e) {
  3635. this.enabled && (this.mouseDown = !1,
  3636. this.state = u.NONE,
  3637. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3638. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3639. this.update(),
  3640. this.rotationAcceleration.set(0, 0),
  3641. this.rotateDelta.set(0, 0)))
  3642. }
  3643. ,
  3644. n.prototype.onMouseOver = function(e) {
  3645. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3646. }
  3647. ,
  3648. n.prototype.onMouseWheel = function(e) {
  3649. this.enabled && c.useWheel && (this.emit(f.Move, "wheel"),
  3650. (0 < (e.wheelDelta || -e.detail) ? this.dollyOut : this.dollyIn).call(this),
  3651. this.update())
  3652. }
  3653. ,
  3654. n.prototype.onKeyDown = function(e) {
  3655. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3656. this.handleKeyDown(e.which)))
  3657. }
  3658. ,
  3659. n.prototype.navRotationAcc = function(e, t) {
  3660. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3661. }
  3662. ,
  3663. n.prototype.navPanAcc = function(e, t) {
  3664. this.stopAutoPanning(),
  3665. this.panAcceleration[e] = t
  3666. }
  3667. ,
  3668. n.prototype.handleKeyDown = function(e) {
  3669. var t = !0;
  3670. switch (e) {
  3671. case p.UPARROW:
  3672. case p.I:
  3673. this.navRotationAcc("y", 1);
  3674. break;
  3675. case p.DOWNARROW:
  3676. case p.K:
  3677. this.navRotationAcc("y", -1);
  3678. break;
  3679. case p.LEFTARROW:
  3680. case p.J:
  3681. this.navRotationAcc("x", -1);
  3682. break;
  3683. case p.RIGHTARROW:
  3684. case p.L:
  3685. this.navRotationAcc("x", 1);
  3686. break;
  3687. case p.W:
  3688. this.navPanAcc("y", 1);
  3689. break;
  3690. case p.S:
  3691. this.navPanAcc("y", -1);
  3692. break;
  3693. case p.A:
  3694. this.navPanAcc("x", -1);
  3695. break;
  3696. case p.D:
  3697. this.navPanAcc("x", 1);
  3698. break;
  3699. default:
  3700. t = !1
  3701. }
  3702. t && this.emit(f.Move, "key")
  3703. }
  3704. ,
  3705. n.prototype.onKeyUp = function(e) {
  3706. this.enabled && (e.preventDefault(),
  3707. e.stopPropagation(),
  3708. this.handleKeyUp(e.which))
  3709. }
  3710. ,
  3711. n.prototype.handleKeyUp = function(e) {
  3712. switch (e) {
  3713. case p.I:
  3714. case p.K:
  3715. case p.UPARROW:
  3716. case p.DOWNARROW:
  3717. this.keyboardZoomSpeed = 0,
  3718. this.rotationAcceleration.y = 0;
  3719. break;
  3720. case p.J:
  3721. case p.L:
  3722. case p.LEFTARROW:
  3723. case p.RIGHTARROW:
  3724. this.rotationAcceleration.x = 0;
  3725. break;
  3726. case p.S:
  3727. case p.W:
  3728. this.panAcceleration.y = 0;
  3729. break;
  3730. case p.A:
  3731. case p.D:
  3732. this.panAcceleration.x = 0
  3733. }
  3734. }
  3735. ,
  3736. n.prototype.onTouchStart = function(i) {
  3737. if (this.enabled || this.state === u.NONE) {
  3738. i.preventDefault(),
  3739. i.stopPropagation(),
  3740. this.stopAutoPanning();
  3741. var e = function() {
  3742. if (2 === i.touches.length) {
  3743. var e = i.touches[0].pageX - i.touches[1].pageX
  3744. , t = i.touches[0].pageY - i.touches[1].pageY;
  3745. this.dollyStart.set(e, t)
  3746. }
  3747. }
  3748. .bind(this)
  3749. , t = function() {
  3750. this.panStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3751. }
  3752. .bind(this)
  3753. , n = function() {
  3754. this.rotateStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3755. }
  3756. .bind(this);
  3757. switch (this.state = this.touchActions[i.touches.length],
  3758. this.state) {
  3759. case u.PAN_DOLLY:
  3760. e();
  3761. case u.PAN:
  3762. t();
  3763. break;
  3764. case u.ROTATE_DOLLY:
  3765. e();
  3766. case u.ROTATE:
  3767. n()
  3768. }
  3769. this.rotationSpeed.set(0, 0),
  3770. this.emit(f.InputStart, "touch")
  3771. }
  3772. }
  3773. ,
  3774. n.prototype.onTouchMove = function(a) {
  3775. if (this.enabled && this.state !== u.NONE) {
  3776. a.preventDefault(),
  3777. a.stopPropagation();
  3778. var s = function() {
  3779. var e = a.touches[0].pageX - a.touches[1].pageX
  3780. , t = a.touches[0].pageY - a.touches[1].pageY;
  3781. this.dollyEnd.set(e, t);
  3782. var i = this.dollyStart.length() - this.dollyEnd.length();
  3783. 0 < i ? this.dollyOut(1 + i / 500) : this.dollyIn(1 - i / 500),
  3784. this.dollyStart.copy(this.dollyEnd)
  3785. }
  3786. .bind(this)
  3787. , e = function() {
  3788. this.panEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3789. this.panDelta.subVectors(this.panEnd, this.panStart),
  3790. this.pan(this.panDelta.x, this.panDelta.y),
  3791. this.panStart.copy(this.panEnd),
  3792. this.rotateDelta.set(0, 0)
  3793. }
  3794. .bind(this)
  3795. , l = function() {
  3796. this.rotateEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3797. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3798. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3799. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3800. this.rotateStart.copy(this.rotateEnd)
  3801. }
  3802. .bind(this)
  3803. , t = function() {
  3804. if (2 === a.touches.length) {
  3805. var e = window.devicePixelRatio || 1
  3806. , t = a.touches[1].pageX - a.touches[0].pageX
  3807. , i = a.touches[1].pageY - a.touches[0].pageY
  3808. , n = Math.sqrt(t * t + i * i);
  3809. if (Math.abs(this.dollyStart.length() - n) > c.input.touchMoveThreshold * e)
  3810. this.state = u.DOLLY,
  3811. s();
  3812. else {
  3813. var r = h.average(a.touches, "pageX")
  3814. , o = h.average(a.touches, "pageY");
  3815. this.rotateDelta.set(r, o).sub(this.rotateStart).length() > c.input.touchMoveThreshold && (this.state = u.ROTATE,
  3816. this.rotateStart.set(r, o),
  3817. l())
  3818. }
  3819. }
  3820. }
  3821. .bind(this);
  3822. switch (this.state) {
  3823. case u.PAN_DOLLY:
  3824. s();
  3825. case u.PAN:
  3826. e();
  3827. break;
  3828. case u.ROTATE_DOLLY:
  3829. t();
  3830. break;
  3831. case u.DOLLY:
  3832. s();
  3833. break;
  3834. case u.ROTATE:
  3835. l();
  3836. break;
  3837. default:
  3838. this.state = u.NONE
  3839. }
  3840. this.lastMoveTime = a.timeStamp,
  3841. this.emit(f.Move, "touch")
  3842. }
  3843. }
  3844. ,
  3845. n.prototype.onTouchEnd = function(e) {
  3846. this.enabled && (this.state === u.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3847. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3848. this.state = u.NONE,
  3849. this.update(),
  3850. this.rotationAcceleration.set(0, 0),
  3851. this.rotateDelta.set(0, 0))
  3852. }
  3853. ,
  3854. n.prototype.onPointerDown = function(e) {
  3855. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3856. id: e.pointerId,
  3857. pageX: e.pageX,
  3858. pageY: e.pageY
  3859. }),
  3860. e.touches = this.pointers,
  3861. this.onTouchStart(e)),
  3862. this.emit(f.InputStart, "pointer"))
  3863. }
  3864. ,
  3865. n.prototype.onPointerMove = function(t) {
  3866. this.enabled && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  3867. t.pointerId === e.id && (e.pageX = t.pageX,
  3868. e.pageY = t.pageY)
  3869. }),
  3870. t.touches = this.pointers,
  3871. this.onTouchMove(t))
  3872. }
  3873. ,
  3874. n.prototype.onPointerUp = function(i) {
  3875. this.enabled && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  3876. i.pointerId === e.id && this.pointers.splice(t, 1)
  3877. }
  3878. .bind(this)),
  3879. i.touches = this.pointers,
  3880. this.onTouchEnd(i))
  3881. }
  3882. ,
  3883. n.prototype.reset = function() {
  3884. this.state = u.NONE,
  3885. this.stopAutoPanning(),
  3886. this.rotationSpeed.set(0, 0),
  3887. this.rotationAcceleration.set(0, 0),
  3888. this.panSpeed.set(0, 0),
  3889. this.panAcceleration.set(0, 0)
  3890. }
  3891. ,
  3892. n.prototype.toJSON = function() {
  3893. return {
  3894. camera_position: {
  3895. x: s.toPrecision(this.camera.position.x, 4),
  3896. y: s.toPrecision(this.camera.position.y, 4),
  3897. z: s.toPrecision(this.camera.position.z, 4)
  3898. },
  3899. camera_quaternion: {
  3900. x: s.toPrecision(this.camera.quaternion.x, 4),
  3901. y: s.toPrecision(this.camera.quaternion.y, 4),
  3902. z: s.toPrecision(this.camera.quaternion.z, 4),
  3903. w: s.toPrecision(this.camera.quaternion.w, 4)
  3904. }
  3905. }
  3906. }
  3907. ,
  3908. t.exports = n
  3909. }
  3910. , {
  3911. "../enum/ControlActions": 20,
  3912. "../enum/ControlEvents": 21,
  3913. "../enum/Keys": 30,
  3914. "../enum/MouseButton": 34,
  3915. "../enum/Vectors": 50,
  3916. "../settings": 166,
  3917. "../util/common": 185,
  3918. "../util/math": 190,
  3919. events: 202,
  3920. three: 217
  3921. }],
  3922. 13: [function(u, d, e) {
  3923. (function(e) {
  3924. "use strict";
  3925. function t(e) {
  3926. this.camera = e,
  3927. (this.camera.controls = this).target = new s.Vector3(0,0,0),
  3928. this.lookVector = new s.Vector3,
  3929. this.lookSpeed = .05,
  3930. this.rotationAcc = new s.Vector2,
  3931. this.rotationSpeed = new s.Vector2,
  3932. this.lat = 0,
  3933. this.lon = 0,
  3934. this.phi = 0,
  3935. this.theta = 0,
  3936. this.enabled = !1,
  3937. this.locked = !1,
  3938. this.pointer = new s.Vector2(0,0),
  3939. this.rotationHistory = [],
  3940. this.rotationDifference = new s.Vector2,
  3941. this.pointerDragOn = !1,
  3942. this.pointerDragStart = new s.Vector2(0,0),
  3943. this.pinchDistance = 0,
  3944. this.moveStart = new s.Vector2,
  3945. this.moveTolerance = .01,
  3946. this.pointersLimit = 2,
  3947. this.pointers = []
  3948. //watch(this, 'enabled', this.enabled)
  3949. }
  3950. var s = u("three")
  3951. , i = u("../util/logger")
  3952. , n = u("../settings")
  3953. , r = u("../util/common")
  3954. , o = u("../util/math")
  3955. , a = (u("../enum/Vectors"),
  3956. u("../enum/MouseButton"))
  3957. , l = u("../enum/Keys")
  3958. , c = u("../enum/ControlEvents")
  3959. , h = u("events").EventEmitter;
  3960. new i(e),
  3961. (t.prototype = Object.create(h.prototype)).usable = function() {
  3962. return this.enabled && !this.locked
  3963. }
  3964. ,
  3965. /* t.prototype.lookAt = function(e) {
  3966. var t = this.camera.position.clone().sub(e)
  3967. , i = Math.atan(t.z / t.x);
  3968. i += t.x < 0 ? Math.PI : 0,
  3969. i += 0 < t.x && t.z < 0 ? 2 * Math.PI : 0,
  3970. this.lon = s.Math.radToDeg(i) + 180;
  3971. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  3972. , r = Math.atan(t.y / n);
  3973. this.lat = -s.Math.radToDeg(r)
  3974. } */
  3975. t.prototype.lookAt = function(aim, dir) {
  3976. var t = dir || this.camera.position.clone().sub(aim); //aim所指点的笛卡尔坐标系
  3977. var i = Math.atan(t.z / t.x);
  3978. i += t.x < 0 ? Math.PI : 0;
  3979. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0;
  3980. this.lon = s.Math.radToDeg(i) + 180;
  3981. var n = Math.sqrt(t.x * t.x + t.z * t.z),
  3982. o = Math.atan(t.y / n);
  3983. this.lat = -s.Math.radToDeg(o);
  3984. }
  3985. ,
  3986. t.prototype.startRotationFrom = function(e, t) {
  3987. o.convertScreenPositionToNDC(e, t, this.pointer),
  3988. this.pointerDragOn = !0,
  3989. this.pointerDragStart.copy(this.pointer),
  3990. this.moveStart.copy(this.pointer),
  3991. this.rotationHistory = [],
  3992. this.rotationSpeed.set(0, 0)
  3993. }
  3994. ,
  3995. t.prototype.onMouseOver = function(e) {
  3996. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3997. }
  3998. ,
  3999. t.prototype.onTouchStart = function(e) {
  4000. if (this.usable()) {
  4001. switch (e.preventDefault(),
  4002. e.stopPropagation(),
  4003. e.touches.length) {
  4004. case 1:
  4005. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4006. break;
  4007. case 2:
  4008. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4009. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  4010. this.pinchDistance = Math.sqrt(t * t + i * i)
  4011. }
  4012. this.emit(c.InputStart, "touch")
  4013. }
  4014. }
  4015. ,
  4016. t.prototype.onPointerDown = function(e) {
  4017. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4018. id: e.pointerId,
  4019. clientX: e.clientX,
  4020. clientY: e.clientY
  4021. }),
  4022. e.touches = this.pointers,
  4023. this.onTouchStart(e),
  4024. this.emit(c.InputStart, "pointer"))
  4025. }
  4026. ,
  4027. t.prototype.onMouseDown = function(e) {
  4028. if (this.usable()) {
  4029. switch (e.preventDefault(),
  4030. e.stopPropagation(),
  4031. e.button) {
  4032. case a.LEFT:
  4033. this.startRotationFrom(e.clientX, e.clientY)
  4034. }
  4035. this.emit(c.InputStart, "mouse")
  4036. }
  4037. }
  4038. ,
  4039. t.prototype.updateRotation = function() {
  4040. if (this.usable() && this.pointerDragOn) {
  4041. var e = new s.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4042. , t = new s.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4043. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4044. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4045. , r = Math.atan2(e.y, i)
  4046. , o = Math.atan2(t.y, n);
  4047. this.rotationDifference.y = s.Math.radToDeg(r - o),
  4048. e.y = 0,
  4049. t.y = 0;
  4050. var a = Math.acos(e.dot(t) / e.length() / t.length());
  4051. isNaN(a) || (this.rotationDifference.x = s.Math.radToDeg(a),
  4052. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4053. this.pointerDragStart.copy(this.pointer)
  4054. }
  4055. }
  4056. ,
  4057. t.prototype.onMouseMove = function(e) {
  4058. this.usable() && (o.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4059. this.pointerDragOn && (Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance || Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) && this.emit(c.Move, "mouse"))
  4060. }
  4061. ,
  4062. t.prototype.onTouchMove = function(e) {
  4063. if (this.usable())
  4064. switch (this.emit(c.Move, "touch"),
  4065. e.touches.length) {
  4066. case 1:
  4067. o.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4068. break;
  4069. case 2:
  4070. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4071. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4072. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4073. .01 < Math.abs(n) && (this.emit(c.InteractionDirect),
  4074. this.emit(c.Pinch, n),
  4075. this.pinchDistance -= n)
  4076. }
  4077. }
  4078. ,
  4079. t.prototype.onPointerMove = function(t) {
  4080. this.usable() && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  4081. t.pointerId === e.id && (e.clientX = t.clientX,
  4082. e.clientY = t.clientY)
  4083. }),
  4084. t.touches = this.pointers,
  4085. this.onTouchMove(t))
  4086. }
  4087. ,
  4088. t.prototype.endRotation = function() {
  4089. this.pointerDragOn = !1;
  4090. var e = r.averageVectors(this.rotationHistory);
  4091. this.rotationSpeed.set(e.x * n.rotationAfterMoveMultiplier, e.y * n.rotationAfterMoveMultiplier)
  4092. }
  4093. ,
  4094. t.prototype.onTouchEnd = function(e) {
  4095. this.usable() && (e.preventDefault(),
  4096. e.stopPropagation(),
  4097. this.endRotation())
  4098. }
  4099. ,
  4100. t.prototype.onMouseUp = function(e) {
  4101. this.usable() && (e.preventDefault(),
  4102. e.stopPropagation(),
  4103. this.endRotation())
  4104. }
  4105. ,
  4106. t.prototype.onPointerUp = function(i) {
  4107. this.usable() && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  4108. i.pointerId === e.id && this.pointers.splice(t, 1)
  4109. }
  4110. .bind(this)),
  4111. i.touches = this.pointers,
  4112. this.onTouchEnd(i))
  4113. }
  4114. ,
  4115. t.prototype.update = function(e) {
  4116. for (this.lon,
  4117. this.lat,
  4118. this.updateRotation(),
  4119. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > n.rotationAfterMoveHistoryCount; )
  4120. this.rotationHistory.shift();
  4121. this.lon += this.rotationDifference.x,
  4122. this.lat += this.rotationDifference.y,
  4123. this.rotationDifference.set(0, 0),
  4124. this.rotationSpeed.x = this.rotationSpeed.x * (1 - n.rotationFriction) + this.rotationAcc.x * n.rotationAccelerationInside,
  4125. this.rotationSpeed.y = this.rotationSpeed.y * (1 - n.rotationFriction) + this.rotationAcc.y * n.rotationAccelerationInside,
  4126. this.lon += this.rotationSpeed.x * e,
  4127. this.lat += this.rotationSpeed.y * e
  4128. let insideLookLimitDown = this.insideLookLimitDown != void 0 ? this.insideLookLimitDown : n.insideLookLimitDown
  4129. let insideLookLimitUp = this.insideLookLimitUp != void 0 ? this.insideLookLimitUp : n.insideLookLimitUp
  4130. insideLookLimitDown = insideLookLimitDown - n.insideFOV/2 + this.camera.fov / 2
  4131. insideLookLimitUp = insideLookLimitUp + n.insideFOV/2 - this.camera.fov / 2
  4132. 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 );
  4133. //this.lat = Math.max(n.insideLookLimitDown, Math.min(n.insideLookLimitUp, this.lat)),
  4134. this.phi = s.Math.degToRad(90 - this.lat),
  4135. this.theta = s.Math.degToRad(this.lon),
  4136. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4137. this.lookVector.y = Math.cos(this.phi),
  4138. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4139. this.target.copy(this.lookVector).add(this.camera.position),
  4140. this.camera.lookAt(this.target)
  4141. }
  4142. ,
  4143. t.prototype.onMouseWheel = function(e) {
  4144. if (this.usable()) {
  4145. var t = e.wheelDelta || -e.detail;
  4146. this.emit(c.InteractionDirect),
  4147. this.emit(c.Scroll, t)
  4148. }
  4149. }
  4150. ,
  4151. t.prototype.onKeyDown = function(e) {
  4152. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4153. this.handleKeyDown(e.which)))
  4154. }
  4155. ,
  4156. t.prototype.handleKeyDown = function(e) {
  4157. var t = function(e, t) {
  4158. this.rotationAcc[e] = t
  4159. }
  4160. .bind(this);
  4161. this.emit(c.InteractionKey);
  4162. var i = !0;
  4163. switch (e) {
  4164. case l.LEFTARROW:
  4165. case l.J:
  4166. t("x", -1);
  4167. break;
  4168. case l.RIGHTARROW:
  4169. case l.L:
  4170. t("x", 1);
  4171. break;
  4172. case l.I:
  4173. t("y", 1);
  4174. break;
  4175. case l.K:
  4176. t("y", -1);
  4177. break;
  4178. default:
  4179. i = !1
  4180. }
  4181. i && this.emit(c.Move, "key")
  4182. }
  4183. ,
  4184. t.prototype.onKeyUp = function(e) {
  4185. this.usable() && (e.preventDefault(),
  4186. e.stopPropagation(),
  4187. this.handleKeyUp(e.which))
  4188. }
  4189. ,
  4190. t.prototype.handleKeyUp = function(e) {
  4191. switch (e) {
  4192. case l.LEFTARROW:
  4193. case l.J:
  4194. case l.RIGHTARROW:
  4195. case l.L:
  4196. this.rotationAcc.x = 0;
  4197. break;
  4198. case l.I:
  4199. case l.K:
  4200. this.rotationAcc.y = 0
  4201. }
  4202. }
  4203. ,
  4204. t.prototype.startRotating = function(e, t) {
  4205. e && (this.rotationAcc.x = e),
  4206. t && (this.rotationAcc.y = t)
  4207. }
  4208. ,
  4209. t.prototype.stopRotating = function(e) {
  4210. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4211. this.rotationAcc.set(0, 0)
  4212. }
  4213. ,
  4214. t.prototype.reset = function() {
  4215. this.pointerDragOn = !1,
  4216. this.rotationAcc.set(0, 0),
  4217. this.rotationSpeed.set(0, 0),
  4218. this.pointers = []
  4219. }
  4220. ,
  4221. t.prototype.toJSON = function() {
  4222. return {
  4223. camera_position: {
  4224. x: o.toPrecision(this.camera.position.x, 4),
  4225. y: o.toPrecision(this.camera.position.y, 4),
  4226. z: o.toPrecision(this.camera.position.z, 4)
  4227. },
  4228. camera_quaternion: {
  4229. x: o.toPrecision(this.camera.quaternion.x, 4),
  4230. y: o.toPrecision(this.camera.quaternion.y, 4),
  4231. z: o.toPrecision(this.camera.quaternion.z, 4),
  4232. w: o.toPrecision(this.camera.quaternion.w, 4)
  4233. }
  4234. }
  4235. }
  4236. ,
  4237. t.prototype.setStateFromJSON = function(e) {
  4238. this.camera.position.copy(e.camera_position),
  4239. this.camera.quaternion.copy(e.camera_quaternion)
  4240. }
  4241. ,
  4242. d.exports = t
  4243. }
  4244. ).call(this, "/js/controls/PanoramaControls.js")
  4245. }
  4246. , {
  4247. "../enum/ControlEvents": 21,
  4248. "../enum/Keys": 30,
  4249. "../enum/MouseButton": 34,
  4250. "../enum/Vectors": 50,
  4251. "../settings": 166,
  4252. "../util/common": 185,
  4253. "../util/logger": 189,
  4254. "../util/math": 190,
  4255. events: 202,
  4256. three: 217
  4257. }],
  4258. 14: [function(t, i, e) {
  4259. (function(e) {
  4260. "use strict";
  4261. var c = t("three")
  4262. , h = t("../enum/Viewmode")
  4263. , u = new (t("../util/logger"))(e);
  4264. i.exports = {
  4265. serialize: function(e) {
  4266. return encodeURI(JSON.stringify(e))
  4267. },
  4268. deserialize: function(e) {
  4269. function t(e) {
  4270. return e.reduce(function(e, t) {
  4271. return e && "number" == typeof t && !isNaN(t)
  4272. }, !0)
  4273. }
  4274. try {
  4275. var i = JSON.parse(decodeURI(e))
  4276. , n = {
  4277. mode: h.fromInt(i.camera_mode),
  4278. panoId: i.scan_id,
  4279. position: (new c.Vector3).copy(i.camera_position),
  4280. quaternion: (new c.Quaternion).copy(i.camera_quaternion),
  4281. zoom: i.ortho_zoom,
  4282. floorVisibility: i.floor_visibility
  4283. }
  4284. , r = n.position;
  4285. t([r.x, r.y, r.z]) || n.position.set(0, 0, 0);
  4286. var o = n.quaternion;
  4287. return t([o.x, o.y, o.z, o.w]) || n.quaternion.set(0, 0, 0, 1),
  4288. n
  4289. } catch (i) {
  4290. u.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4291. try {
  4292. var a = e.split(",")
  4293. , s = {
  4294. x: parseFloat(a[2]),
  4295. y: parseFloat(a[3]),
  4296. z: parseFloat(a[4])
  4297. }
  4298. , l = {
  4299. x: parseFloat(a[5]),
  4300. y: parseFloat(a[6]),
  4301. z: parseFloat(a[7]),
  4302. w: parseFloat(a[8])
  4303. };
  4304. return t([s.x, s.y, s.z]) || (s.x = 0,
  4305. s.y = 0,
  4306. s.z = 0),
  4307. t([l.x, l.y, l.z, l.w]) || (l.x = 0,
  4308. l.y = 0,
  4309. l.z = 0,
  4310. l.w = 1),
  4311. {
  4312. mode: h.fromInt(a[0]),
  4313. panoId: a[1],
  4314. position: (new c.Vector3).copy(s),
  4315. quaternion: (new c.Quaternion).copy(l)
  4316. }
  4317. } catch (t) {
  4318. u.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4319. }
  4320. }
  4321. return null
  4322. }
  4323. }
  4324. }
  4325. ).call(this, "/js/controls/serializer.js")
  4326. }
  4327. , {
  4328. "../enum/Viewmode": 51,
  4329. "../util/logger": 189,
  4330. three: 217
  4331. }],
  4332. 15: [function(C, I, e) {
  4333. (function(e) {
  4334. "use strict";
  4335. function t() {
  4336. this.endlessLoop = r.warp.loop,
  4337. this.clock = new i.Clock(!0),
  4338. this.model = null,
  4339. this.player = null,
  4340. this.currentItem = null,
  4341. this.destinationItem = null,
  4342. this.tourIsPlaying = !1,
  4343. this.transitionStage = v.None,
  4344. this.nextFunc = null,
  4345. this.onTheBus = !1,
  4346. this.tourInProgress = !1,
  4347. this.reachSource = null,
  4348. this.interrupted = !1,
  4349. this.nItems = 0,
  4350. this.walkingSectionPaused = !1
  4351. }
  4352. var i = C("three")
  4353. , n = C("./util/logger")
  4354. , r = C("./settings")
  4355. , o = C("./util/transitions")
  4356. , a = C("events").EventEmitter
  4357. , s = C("./enum/Viewmode")
  4358. , l = C("./analytics")
  4359. , c = C("./enum/WarpStyle")
  4360. , h = (o = C("./util/transitions"),
  4361. C("./model/ModelManager"),
  4362. C("./enum/ModelManagerEvents"))
  4363. , u = C("./enum/DirectorEvents")
  4364. , d = C("./enum/PlayerEvents")
  4365. , p = (C("./enum/ControlEvents"),
  4366. C("./enum/BlackoutStyle"))
  4367. , f = C("./enum/PathDiscardMode")
  4368. , g = C("./enum/PathDisplayMode")
  4369. , m = (C("./player"),
  4370. new n(e))
  4371. , v = Object.freeze({
  4372. None: 0,
  4373. Moving: 1,
  4374. Aiming: 2,
  4375. Interlude: 3
  4376. })
  4377. , y = Object.freeze({
  4378. Forward: 1,
  4379. NoChange: 0,
  4380. Backwards: -1
  4381. })
  4382. , A = o.getUniqueId();
  4383. (t.prototype = Object.create(a.prototype)).init = function(e, t) {
  4384. this.player = e,
  4385. this.modelManager = t,
  4386. this.updateModel(),
  4387. this.resetAll(),
  4388. this.bindEvents()
  4389. }
  4390. ,
  4391. t.prototype.resetAll = function() {
  4392. if (this.currentItem = null,
  4393. this.destinationItem = null,
  4394. this.tourIsPlaying = !1,
  4395. //this.bgmReplay(),
  4396. this.transitionStage = v.None,
  4397. this.nextFunc = null,
  4398. this.onTheBus = !1,
  4399. this.reachSource = null,
  4400. this.interrupted = !1,
  4401. this.model) {
  4402. var e = r.path.typ === c.WALK ? c.WALK : c.STD;
  4403. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && !1 === this.model.data.player_options.fast_transitions ? e : c.BLACK
  4404. } else
  4405. this.defaultWarpStyle = c.BLACK,
  4406. m.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4407. this.resetSpecialTransition()
  4408. }
  4409. ,
  4410. t.prototype.updateModel = function() {
  4411. this.model = this.modelManager.getActiveModel(),
  4412. this.nItems = this.model.heroLocations.length
  4413. }
  4414. ,
  4415. t.prototype.bindEvents = function() {
  4416. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  4417. this.player.on(d.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4418. this.player.on(d.Move, this.handlePlayerMove.bind(this)),
  4419. this.player.on(d.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4420. this.player.on(d.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4421. this.player.on(d.InputStart, this.handlePlayerInputStart.bind(this)),
  4422. this.player.on(d.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4423. this.player.once(d.Move, function() {
  4424. o.cancelById(A)
  4425. })
  4426. }
  4427. ,
  4428. t.prototype.checkAndHandleWalkingtourInterruption = function(e) {//快速停止。 改:去掉判断nextWarpStyle,因为这个属性改乱了,导致点击停止按钮不执行
  4429. return /* e === c.WALK && ( */this.interrupt(p.NONE),
  4430. this.pauseWalkingSection(),
  4431. this.player.fastForwardActivePanoFlight(),
  4432. !0/* ) */
  4433. }
  4434. ,
  4435. t.prototype.handlePlayerMove = function(e) {
  4436. this.transitionStage === v.Interlude && this.interrupt(p.NONE),
  4437. this.emit("update.controls")
  4438. }
  4439. ,
  4440. t.prototype.handlePlayerPanoChosen = function(e, t) {
  4441. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4442. this.emit("update.controls"))
  4443. }
  4444. ,
  4445. t.prototype.handlePlayerModeChanged = function(e, t) {
  4446. this.intermediateState() || e === t || (this.onTheBus = !1,
  4447. this.emit("update.controls"))
  4448. }
  4449. ,
  4450. t.prototype.handlePlayerInputStart = function(e) {
  4451. this.transitionStage === v.Interlude && this.interrupt(p.NONE)
  4452. }
  4453. ,
  4454. t.prototype.handlePlayerFlyingStarted = function() {
  4455. this.clearWalkingSectionPaused()
  4456. }
  4457. ,
  4458. t.prototype.describe = function() {
  4459. return {
  4460. nItems: this.nItems,
  4461. currentItem: this.currentItem,
  4462. destinationItem: this.destinationItem,
  4463. tourIsPlaying: this.tourIsPlaying,
  4464. onTheBus: this.onTheBus,
  4465. endlessLoop: this.endlessLoop,
  4466. viewMode: this.player.mode,
  4467. inTransition: this._inTransition(),
  4468. transitionStage: this.transitionStage,
  4469. tourInProgress: this.tourInProgress
  4470. }
  4471. }
  4472. ,
  4473. t.prototype._inTransition = function() {
  4474. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === s.TRANSITIONING || this.tourIsPlaying
  4475. }
  4476. ,
  4477. t.prototype.bounceable = function() {
  4478. var e = this.clock.getDelta();
  4479. return this.isInterrupted() || e < .9 && .01 < e || this.player.flying && !this.player.isWarping()
  4480. }
  4481. ,
  4482. t.prototype.itemCompare = function(item1, item2, type){//add
  4483. if(type == 'equal'){//==
  4484. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  4485. }else if(type == 'less'){//<
  4486. return item1 && item2 && (item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
  4487. }
  4488. }
  4489. t.prototype.currentMoveDirection = function() {
  4490. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4491. 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
  4492. }
  4493. ,
  4494. t.prototype.clearPath = function() {
  4495. this._inTransition() || this.player.path.discardPathObject()
  4496. }
  4497. ,
  4498. t.prototype.allFloors = function() {
  4499. this.model.toggleAllFloors()
  4500. }
  4501. ,
  4502. t.prototype.actionComplete = function(e) {
  4503. if (this.interrupted = !1,
  4504. this.transitionStage = v.None,
  4505. this.resetSpecialTransition(),
  4506. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4507. this.tourIsPlaying || (this.player.disablePreRendering(),
  4508. this.player.mode === s.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4509. this.emit("update.controls"),
  4510. this.nextFunc) {
  4511. var t = this.nextFunc;
  4512. this.nextFunc = null,
  4513. t()
  4514. }
  4515. }
  4516. ,
  4517. t.prototype.awaitCompletion = function(e, t) {
  4518. this.nextFunc = t,
  4519. e()
  4520. }
  4521. ,
  4522. t.prototype.updateSuccessFunction = function(e) {
  4523. this.nextFunc = e
  4524. }
  4525. ,
  4526. t.prototype.interrupt = function(e, t) {
  4527. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4528. this.tourIsPlaying = !1,
  4529. //this.bgmReplay(),
  4530. this.interrupted = !0,
  4531. this.nextFunc = null,
  4532. this.emit(u.ActionInterrupted),
  4533. null != e || (e = p.BEGINNING),
  4534. this.player.interruptAndFastForward(e, t),
  4535. !0)
  4536. }
  4537. ,
  4538. t.prototype.wouldInterrupt = function() {
  4539. return this.transitionStage !== v.None
  4540. }
  4541. ,
  4542. t.prototype.intermediateState = function() {
  4543. return this.transitionStage !== v.None
  4544. }
  4545. ,
  4546. t.prototype.isInterrupted = function() {
  4547. return this.interrupted
  4548. }
  4549. ,
  4550. t.prototype.pauseWalkingSection = function() {
  4551. this.walkingSectionPaused = !0
  4552. }
  4553. ,
  4554. t.prototype.clearWalkingSectionPaused = function() {
  4555. this.walkingSectionPaused = !1
  4556. }
  4557. ,
  4558. t.prototype.autoTour = function() {
  4559. var i = Date.now();
  4560. this.model.auxDataPromise.then(function() {
  4561. i = Date.now() - i;
  4562. var e = r.warp.auto
  4563. , t = this.model.data && this.model.data.player_options/* && this.model.data.player_options.highlight_reel */;
  4564. 0 <= e && 1 < this.model.heroCount() && t && o.trigger({
  4565. duration: Math.max(1e3 * Math.min(300, e) - i, 0),
  4566. done: function() {
  4567. this.playTour()
  4568. }
  4569. .bind(this),
  4570. name: "_atr",
  4571. id: A
  4572. })
  4573. }
  4574. .bind(this))
  4575. }
  4576. ,
  4577. t.prototype.atDestinationPano = function() {
  4578. if (!this.player.currentPano || null === this.destinationItem)
  4579. return !1;
  4580. var e = this.player.currentPano.id;
  4581. if (void 0 === e)
  4582. return !1;
  4583. var t = this.model.heroLocations;
  4584. //return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4585. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  4586. return destination && destination.panoId == e
  4587. }
  4588. ,
  4589. t.prototype.redirectToItem = function(e, t) {
  4590. if (null != e)
  4591. if (this.wouldInterrupt())
  4592. if (this.player.mode !== s.TRANSITIONING) {
  4593. m.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4594. var i = function() {
  4595. o.setTimeout(function() {
  4596. this.setDestinationItem(e),
  4597. this.goToDestination(!0, p.BEGINNING, r.warp.warpInterruptionRedirectTime, !1)
  4598. }
  4599. .bind(this), 0)
  4600. }
  4601. .bind(this);
  4602. this.interrupt(p.END, 0),
  4603. this.updateSuccessFunction(i)
  4604. } else
  4605. m.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4606. else
  4607. m.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4608. else
  4609. m.warn("Director.redirectToItem() -> Redirecting to null item.")
  4610. }
  4611. ,
  4612. t.prototype.useSpecialTransition = function(e) {
  4613. void 0 !== e && this.defaultWarpStyle !== c.BLACK && m.debug("useSpecialTransition(): " + e),
  4614. this.nextWarpStyle = c.BLACK
  4615. }
  4616. ,
  4617. t.prototype.resetSpecialTransition = function() {
  4618. this.nextWarpStyle = this.defaultWarpStyle
  4619. }
  4620. ,
  4621. t.prototype.arrivedAtDestination = function(e) {
  4622. if (this.player.flying || this.player.isWarping())
  4623. m.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4624. else {
  4625. this.transitionStage = v.Aiming;
  4626. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4627. this.player.model.fadePanoMarkers(0),
  4628. this.awaitCompletion(function() {
  4629. this.resetSpecialTransition(),
  4630. e ? this.player.aimTourCamera(this.destinationItem, g.Retain, g.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4631. }
  4632. .bind(this), t)
  4633. }
  4634. }
  4635. ,
  4636. t.prototype.goToDestination = function(e, t, i, n) {
  4637. //音频
  4638. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo //只有外层有音乐
  4639. if(musicInfo && musicInfo.music){
  4640. let src = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  4641. let audioObj = SoundManager.list.find(e=>e.name == 'tour')
  4642. let audioSrc1 = common.getFileNameFromUrl(audioObj.src);
  4643. let audioSrc2 = common.getFileNameFromUrl(src)
  4644. if(audioSrc1 == audioSrc2){//应该是继续播放该folder
  4645. if(this.destinationItem[1] == 0){//从头开始播放 因为可能暂停后然后再点该缩略图播
  4646. SoundManager.play('tour',null,0) // currentTime = 0;
  4647. }else if( audioObj.audio.paused && audioObj.audio.currentTime < audioObj.audio.duration ){//未播完
  4648. SoundManager.play('tour')//继续播。 如果不是< 说明播完了,item[1]不为0应该是继续播放就不需要从头
  4649. }
  4650. }else{//很可能是该folder的起始
  4651. SoundManager.play('tour', manage.dealURL(src))
  4652. }
  4653. }
  4654. if (this.onTheBus = !0,
  4655. this.emit("update.controls"),
  4656. this.player.updateLastView(),
  4657. n || !this.atDestinationPano()){
  4658. if (this.player.flying || this.player.isWarping())
  4659. m.warn("Cannot go to new destination while player is flying or warping.");
  4660. else {
  4661. var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4662. , s = null
  4663. , l = null;
  4664. if (a.isPano()) {
  4665. var o1 = e ? 'black' : this.getMomentTour(this.destinationItem) //window.DATA.momentTour || "walk";
  4666. l = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, g.Show, f.Slow, o1, !0, i, this.actionComplete.bind(this)),
  4667. s = this.arrivedAtDestination.bind(this, !0)
  4668. //add
  4669. if(o1=='black' && a.zoom && a.zoom != this.player.zoomLevel){
  4670. this.player.smoothZoomFovTo(null, a.zoom, r.warp.teleportTime) //瞬间过渡的时间
  4671. }
  4672. } else{
  4673. l = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4674. s = this.arrivedAtDestination.bind(this, !1);
  4675. }
  4676. this.transitionStage = v.Moving,
  4677. this.model.fadePanoMarkers(0),
  4678. this.awaitCompletion(function() {
  4679. l()
  4680. }
  4681. .bind(this), s),
  4682. this.emit("update.controls")
  4683. }
  4684. }else{
  4685. //add 原地旋转时, 写到_warpCameraAim里,因那有时间
  4686. /* var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4687. if(a.zoom && a.zoom != this.player.zoomLevel){
  4688. this.player.smoothZoomFovTo(null, a.zoom, r.warp.teleportTime) //瞬间过渡的时间
  4689. } */
  4690. this.arrivedAtDestination(!0)
  4691. }
  4692. }
  4693. ,
  4694. t.prototype.tourInterlude = function() {
  4695. if (l.trackAlways("reach_highlight", {
  4696. reach_source: this.reachSource
  4697. }),
  4698. this.model.fadePanoMarkers(0),
  4699. this.emit("update.controls"),
  4700. this.tourIsPlaying)
  4701. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4702. this.stopTour(),
  4703. this.emit(u.TourEnd),
  4704. void (this.player.mode === s.PANORAMA && this.model.fadePanoMarkers(r.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4705. this.transitionStage = v.Interlude,
  4706. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4707. }
  4708. .bind(this), this.goNext.bind(this))
  4709. }
  4710. ,
  4711. t.prototype.findNearestItem = function(endToStart=true){//找到离currentPano最近的导览
  4712. /* if(this.atDestinationPano(this.player.currentPano)){//在终点直接从头。但有的场景可能不希望如此,就想跳到所属的展区开始。
  4713. return [0,0] //2023.7.7发现在点击item后播放会从头开始
  4714. } */
  4715. //注:没有判断此刻是否在panorama模式,就使用currentPano
  4716. var result = {item:[0,0], dis:Infinity};
  4717. var compare = (location, item)=>{
  4718. if(location.panoId != void 0 && location.panoId!= "outside"){
  4719. var pano = this.model.panos.index[location.panoId];
  4720. var dis = pano.position.distanceTo(this.player.currentPano.position)
  4721. if(dis<result.dis){
  4722. result.item = item, result.dis = dis
  4723. }else if(dis == result.dis){//如果两个位置相同,优先播放在导览条上离激活的最近的那段导览
  4724. /* if(this.itemCompare(item, this.currentItem, 'equal')){
  4725. result.item = item, result.dis = dis
  4726. } */
  4727. if(this.currentItem && Math.abs(item[0]-this.currentItem[0]) < Math.abs(result.item[0]-this.currentItem[0])){
  4728. result.item = item, result.dis = dis
  4729. }
  4730. }
  4731. }
  4732. }
  4733. this.model.heroLocations.forEach((e,i)=>{
  4734. if(e.heroLocations){
  4735. /* e.heroLocations.forEach((a,j)=>{
  4736. compare(a, [i,j])
  4737. }) */
  4738. var location = e.heroLocations.find(e=>e.panoId != void 0)
  4739. location && compare(location, [i,0]) //跳到此区域开头
  4740. }else{
  4741. compare(e, [i,0])
  4742. }
  4743. })
  4744. if(endToStart && this.atEndOfTour(result.item)){ //如果是最后一个点,直接跳到开头,否则导览开始就在终点的话不会从头开始
  4745. return [0,0] //但注意最后是区域的话result.item是区域开头,除非站在最末最末尾的位置,上面的atDestinationPano直接返回
  4746. }
  4747. return result.item
  4748. }
  4749. ,
  4750. t.prototype.playTour = function() {
  4751. if (!this.bounceable())
  4752. return this.tourIsPlaying ? void m.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4753. this.tourInProgress = !0,
  4754. this.reachSource = "play",
  4755. this.tourIsPlaying = !0,
  4756. this.wasZoomEnabled = this.player.zoomEnabled,
  4757. this.player.zoomEnabled = !1,
  4758. this.resetSpecialTransition(),
  4759. this.emit("update.controls"),
  4760. this.emit(u.TourStart),
  4761. this.player.enablePreRendering(),
  4762. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4763. this.goToDestination()) : /* this.goNext() */(
  4764. this.atEndOfTour() ? this.goNext() : ( this.tourAdvance(0) , this.goToDestination())) )
  4765. ) //xzw: 不要直接跳到下一个点开始,从当前点开始,否则当一段区域内只有一个导览时播放会立刻跳到下一个缩略图进行。
  4766. }
  4767. ,
  4768. t.prototype.playTourNearBy = function() {//就近导览
  4769. if (!this.bounceable()){
  4770. return this.tourIsPlaying ? void m.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4771. this.tourInProgress = !0,
  4772. this.reachSource = "play",
  4773. this.tourIsPlaying = !0,
  4774. this.wasZoomEnabled = this.player.zoomEnabled,
  4775. this.player.zoomEnabled = !1,
  4776. this.resetSpecialTransition(),
  4777. this.emit("update.controls"),
  4778. this.emit(p.TourStart),
  4779. this.player.enablePreRendering(),
  4780. /* this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4781. this.goToDestination()) : this.goNext())) */
  4782. this.setDestinationItem(this.findNearestItem()) , this.goToDestination()) )
  4783. }
  4784. },
  4785. t.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4786. this.isInterrupted() || this.transitionStage === v.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4787. this.tourIsPlaying = !1,
  4788. //(!isAutoStop || g_tourAudio && g_tourAudio.paused )&&this.bgmReplay(),//xzw
  4789. this.interrupt(),
  4790. this.clearWalkingSectionPaused(),
  4791. this.resetSpecialTransition(),
  4792. this.emit("update.controls"))
  4793. }
  4794. ,
  4795. t.prototype.endTourProgress = function() {
  4796. this.tourInProgress = !1,
  4797. this.emit("update.controls"),
  4798. this.emit(u.TourEnd)
  4799. }
  4800. ,
  4801. t.prototype.goToHighlight = function(e) {
  4802. if (this.wouldInterrupt())
  4803. this.itemCompare(this.destinationItem,e,'equal') ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4804. else {
  4805. if (m.debug("<tour.goto " + e + ">"),
  4806. this.isInterrupted())
  4807. return;
  4808. this.clearWalkingSectionPaused(),
  4809. this.setDestinationItem(e),
  4810. this.useSpecialTransition("Hilight"),
  4811. this.goToDestination(true),//add true
  4812. l.trackAlways("reach_highlight", {
  4813. reach_source: "thumb"
  4814. })
  4815. }
  4816. }
  4817. ,
  4818. t.prototype.prevHighlight = function() {
  4819. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4820. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4821. this.reachSource = "prev",
  4822. this.goPrev()))
  4823. }
  4824. ,
  4825. t.prototype.nextHighlight = function() {
  4826. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4827. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4828. this.reachSource = "next",
  4829. this.goNext()))
  4830. }
  4831. ,
  4832. t.prototype.changeMode = function(e) {
  4833. var t = $.Deferred()
  4834. , i = t.resolve.bind(t)
  4835. , n = t.reject.bind(t);
  4836. if (this.emit(u.StartModeChange),
  4837. !function() {
  4838. return this.clearWalkingSectionPaused(),
  4839. !!this.wouldInterrupt() && (this.interrupt(),
  4840. !0)
  4841. }
  4842. .bind(this)()) {
  4843. switch (e) {
  4844. case s.PANORAMA:
  4845. this.player.mode === s.PANORAMA ? this.player.currentPano.isAligned() || this.player.goToLastView(!0).done(i).fail(n) : this.player.insideMode(this.player.lastInsideView.pano).done(i).fail(n);
  4846. break;
  4847. case s.DOLLHOUSE:
  4848. case s.FLOORPLAN:
  4849. this.player.flyToNewMode({
  4850. mode: e
  4851. }).done(i).fail(n);
  4852. break;
  4853. case s.OUTDOOR:
  4854. this.player.model.has360Views && (this.player.mode !== s.PANORAMA || this.player.mode === s.PANORAMA && this.player.currentPano.isAligned()) && this.player.goToLastView(!1).done(i).fail(n)
  4855. }
  4856. return t.promise()
  4857. }
  4858. }
  4859. ,
  4860. t.prototype.atEndOfTour = function(item) {
  4861. //return this.currentItem >= this.nItems - 1
  4862. var end = this.currentItem && this.currentItem[0] >= this.nItems - 1;
  4863. if(end){
  4864. var heroLocations = this.model.heroLocations[this.nItems-1].heroLocations
  4865. if(heroLocations){
  4866. end = this.currentItem[1] >= heroLocations.length - 1
  4867. }
  4868. }
  4869. return end;
  4870. }
  4871. ,
  4872. t.prototype.firstDestination = function() {
  4873. //return 0 < this.nItems ? 0 : null
  4874. return 0 < this.nItems ? [0,0]: null
  4875. }
  4876. ,
  4877. t.prototype.finalDestination = function() {
  4878. //return 0 < this.nItems ? this.nItems - 1 : null
  4879. return 0 < this.nItems ? [this.nItems - 1,0]: null
  4880. }
  4881. ,
  4882. t.prototype.goPrev = function() {
  4883. this.tourAdvance(-1)
  4884. }
  4885. ,
  4886. t.prototype.goNext = function() {
  4887. this.tourAdvance(1)
  4888. }
  4889. ,
  4890. t.prototype.setDestinationItem = function(e) {
  4891. this.destinationItem = e,
  4892. this.emit("update.controls")
  4893. }
  4894. ,
  4895. t.prototype.setCurrentItem = function(e) {
  4896. this.currentItem = e,
  4897. this.emit("update.controls")
  4898. }
  4899. ,
  4900. t.prototype.nextItem = function(currentItem) {
  4901. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4902. if(currentItem == void 0)return this.firstDestination()
  4903. var currentLocation = this.model.heroLocations[currentItem[0]];
  4904. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  4905. var item;
  4906. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  4907. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  4908. }else{
  4909. item = [currentItem[0] , currentItem[1]+1]
  4910. }
  4911. if(item[0] >= this.nItems ){
  4912. item = this.firstDestination()
  4913. }
  4914. return item;
  4915. //暂时不理会endlessLoop,默认为false
  4916. }
  4917. ,
  4918. t.prototype.prevItem = function(currentItem) {
  4919. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4920. if(currentItem == void 0)return this.firstDestination()//finalDestination?
  4921. var item;
  4922. var lastLocation = this.model.heroLocations[currentItem[0]-1];
  4923. if(!lastLocation) return this.finalDestination()//[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  4924. else{
  4925. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  4926. if(this.currentItem[1] == 0){//子目录中第一个
  4927. return [currentItem[0] - 1, lastChildNum-1]
  4928. }else{
  4929. return [currentItem[0], currentItem[1]-1]
  4930. }
  4931. }
  4932. }
  4933. ,
  4934. t.prototype.tourAdvance = function(e) {//e是1或-1或0
  4935. m.debug("tourAdvance(" + e + ")")
  4936. if(null === this.currentItem || void 0 === this.currentItem){
  4937. this.setDestinationItem(this.firstDestination())
  4938. }else{
  4939. var item = this.currentItem
  4940. if(e == 1){
  4941. item = this.nextItem(this.currentItem)
  4942. }else if(e == -1){
  4943. item = this.prevItem(this.currentItem)
  4944. }
  4945. this.setDestinationItem(item)
  4946. }
  4947. if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')[0] < 0 ){
  4948. this.useSpecialTransition("reverse-looping to end")
  4949. }else if(this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')){
  4950. this.useSpecialTransition("looping back to start")
  4951. }
  4952. /* if(this.destinationItem[0] < 0 ){
  4953. this.setDestinationItem(this.finalDestination())
  4954. this.useSpecialTransition("reverse-looping to end")
  4955. }else{
  4956. this.destinationItem[0] >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  4957. this.useSpecialTransition("looping back to start"))
  4958. } */
  4959. /* var momentTour = this.getMomentTour(this.destinationItem);
  4960. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  4961. var i = this.player.zoomLevel;
  4962. this.player.zoomEnabled = !0;
  4963. var t = function(e, t) {
  4964. this.player.zoomTo((1 - e) * i, !0)
  4965. }
  4966. .bind(this);
  4967. o.start(t, 1500, function() {}, 0, h.easeOutQuad, "zoom")
  4968. } */
  4969. this.goToDestination()
  4970. }
  4971. ,
  4972. t.prototype.getMomentTour = function(destinationItem) {//add
  4973. var wholeMomentTour = window.DATA.momentTour || "walk"; //最外层
  4974. if(!destinationItem) return wholeMomentTour
  4975. else{
  4976. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem)//最内层。 如果有使用最内层
  4977. if(currentLocation.momentTour)return currentLocation.momentTour;
  4978. var currentLocation_ = this.model.heroLocations[destinationItem[0]];
  4979. return currentLocation_.momentTour || wholeMomentTour; //若中间层或最内层有就使用,否则使用最外层
  4980. }
  4981. }
  4982. ,
  4983. I.exports = t
  4984. }
  4985. ).call(this, "/js/director.js")
  4986. }
  4987. , {
  4988. "./analytics": 4,
  4989. "./enum/BlackoutStyle": 18,
  4990. "./enum/ControlEvents": 21,
  4991. "./enum/DirectorEvents": 23,
  4992. "./enum/ModelManagerEvents": 33,
  4993. "./enum/PathDiscardMode": 38,
  4994. "./enum/PathDisplayMode": 39,
  4995. "./enum/PlayerEvents": 40,
  4996. "./enum/Viewmode": 51,
  4997. "./enum/WarpStyle": 52,
  4998. "./model/ModelManager": 140,
  4999. "./player": 155,
  5000. "./settings": 166,
  5001. "./util/logger": 189,
  5002. "./util/transitions": 195,
  5003. events: 202,
  5004. three: 217
  5005. }],
  5006. 16: [function(e, t, i) {
  5007. "use strict";
  5008. var n = e("three")
  5009. , r = e("./enum/Viewmode")
  5010. , o = (e("./settings"),
  5011. e("./util/transitions"))
  5012. , a = e("./enum/PlayerEvents")
  5013. , s = new n.ShaderPass(n.HorizontalBlurShader)
  5014. , l = new n.ShaderPass(n.VerticalBlurShader);
  5015. l.renderToScreen = !0;
  5016. var c = $("#player").width() / $("#player").height();
  5017. isNaN(c) && (c = 1);
  5018. //initTransitionPass(n)
  5019. var h = {
  5020. currentBlur: 0,
  5021. aspect: c,
  5022. blurStrength: 1,
  5023. hblurPass: s,
  5024. vblurPass: l,
  5025. fastTranMaskPass : new n.TransitionPass(),
  5026. bindEvents: function(e) {
  5027. e.on(a.ModeChanged, function(e, t) {
  5028. e === r.PANORAMA && (o.cancel(h.blur),
  5029. o.cancel(h.addBlur),
  5030. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  5031. })
  5032. },
  5033. blur: function(e) {
  5034. var t = (h.currentBlur = e) * h.blurStrength;
  5035. l.uniforms.v.value = t / 512 * h.aspect,
  5036. s.uniforms.h.value = t / 512
  5037. },
  5038. addBlur: function(e) {
  5039. e = Math.max(e, h.currentBlur),
  5040. h.blur(e)
  5041. },
  5042. removeBlur: function(e) {
  5043. e = Math.min(1 - e, h.currentBlur),
  5044. h.blur(e)
  5045. }
  5046. };
  5047. h.blur(0),
  5048. t.exports = h
  5049. }
  5050. , {
  5051. "./enum/PlayerEvents": 40,
  5052. "./enum/Viewmode": 51,
  5053. "./settings": 166,
  5054. "./util/transitions": 195,
  5055. three: 217
  5056. }],
  5057. 17: [function(e, t, i) {
  5058. "use strict";
  5059. t.exports = {
  5060. UNKNOWN: 0,
  5061. ALIGNED: 1,
  5062. UNALIGNED: 2,
  5063. PLACED: 3
  5064. }
  5065. }
  5066. , {}],
  5067. 18: [function(e, t, i) {
  5068. "use strict";
  5069. t.exports = {
  5070. NONE: 0,
  5071. MIDDLE: 1,
  5072. END: 2,
  5073. BEGINNING: 3,
  5074. FADEIN: 4
  5075. }
  5076. }
  5077. , {}],
  5078. 19: [function(e, t, i) {
  5079. "use strict";
  5080. var r = e("three");
  5081. t.exports = {
  5082. newBlue: new r.Color(4967932),
  5083. altBlue: new r.Color(47355),
  5084. tagDefault: new r.Color(223357),
  5085. classicBlue: new r.Color(53759),
  5086. mpYellow: new r.Color(16502016),
  5087. mpOrange: new r.Color(16428055),
  5088. mpBlue: new r.Color(12096),
  5089. mpLtGrey: new r.Color(13751252),
  5090. mpDkGrey: new r.Color(10000019),
  5091. mpRed: new r.Color(12525854),
  5092. mpOrangeDesat: new r.Color(16764529),
  5093. mpBlueDesat: new r.Color(4034734),
  5094. mpRedDesat: new r.Color(14705505),
  5095. white: new r.Color(16777215),
  5096. black: new r.Color(0),
  5097. _desat: function(e, t) {
  5098. var i = t || .3
  5099. , n = (new r.Color).copy(e).getHSL();
  5100. return (new r.Color).setHSL(n.h, n.s * (1 - i), n.l)
  5101. },
  5102. _darken: function(e, t) {
  5103. var i = t || .2
  5104. , n = e.getHSL();
  5105. return (new r.Color).setHSL(n.h, n.s, n.l * (1 - i))
  5106. }
  5107. }
  5108. }
  5109. , {
  5110. three: 217
  5111. }],
  5112. 20: [function(e, t, i) {
  5113. "use strict";
  5114. t.exports = {
  5115. NONE: -1,
  5116. ROTATE: 0,
  5117. DOLLY: 1,
  5118. PAN: 2,
  5119. ROTATE_DOLLY: 3,
  5120. PAN_DOLLY: 4
  5121. }
  5122. }
  5123. , {}],
  5124. 21: [function(e, t, i) {
  5125. "use strict";
  5126. t.exports = {
  5127. Move: "move",
  5128. InteractionDirect: "interaction.direct",
  5129. InteractionKey: "interaction.key",
  5130. InteractionGui: "interaction.gui",
  5131. FlyInDirection: "fly.direction",
  5132. InputStart: "input.start",
  5133. Pinch: "input.pinch",
  5134. Scroll: "input.scroll",
  5135. AutoPanInterrupt: "autopan.interrupt",
  5136. AutoPanComplete: "autopan.complete",
  5137. AutoPanClamped: "autopan.clamped",
  5138. LongTap: "longtap"
  5139. }
  5140. }
  5141. , {}],
  5142. 22: [function(e, t, i) {
  5143. "use strict";
  5144. t.exports = Object.freeze({
  5145. FORWARD: "FORWARD",
  5146. LEFT: "LEFT",
  5147. RIGHT: "RIGHT",
  5148. BACK: "BACK",
  5149. UP: "UP",
  5150. DOWN: "DOWN"
  5151. })
  5152. }
  5153. , {}],
  5154. 23: [function(e, t, i) {
  5155. "use strict";
  5156. t.exports = {
  5157. ActionInterrupted: "action.interrupted",
  5158. TourStart: "tour.start",
  5159. TourEnd: "tour.end",
  5160. StartModeChange: "mode.startChange"
  5161. }
  5162. }
  5163. , {}],
  5164. 24: [function(e, t, i) {
  5165. "use strict";
  5166. t.exports = Object.freeze({
  5167. None: 0,
  5168. Queued: 1,
  5169. ForceQueued: 2,
  5170. Downloading: 3,
  5171. Downloaded: 4,
  5172. DownloadFailed: 5
  5173. })
  5174. }
  5175. , {}],
  5176. 25: [function(e, t, i) {
  5177. "use strict";
  5178. t.exports = {
  5179. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5180. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5181. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5182. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5183. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5184. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5185. }
  5186. }
  5187. , {}],
  5188. 26: [function(e, t, i) {
  5189. "use strict";
  5190. t.exports = {
  5191. Texture2D: 0,
  5192. TextureCube: 1
  5193. }
  5194. }
  5195. , {}],
  5196. 27: [function(e, t, i) {
  5197. "use strict";
  5198. t.exports = {
  5199. SMALL: "small",
  5200. LARGE: "large"
  5201. }
  5202. }
  5203. , {}],
  5204. 28: [function(e, t, i) {
  5205. "use strict";
  5206. var n = e("./Viewmode")
  5207. , r = {
  5208. LANDING: {},
  5209. NAVIGATION: "navigation",
  5210. MORE_HELP: "moreHelp",
  5211. TOUR_INTERACTION: {}
  5212. };
  5213. r.LANDING[n.PANORAMA] = "panorama.landing",
  5214. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5215. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5216. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5217. r.TOUR_INTERACTION.standard = "standard.tour",
  5218. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5219. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5220. t.exports = r
  5221. }
  5222. , {
  5223. "./Viewmode": 51
  5224. }],
  5225. 29: [function(e, t, i) {
  5226. "use strict";
  5227. var n = {
  5228. UP: 1,
  5229. DOWN: -1,
  5230. LEFT: "L",
  5231. RIGHT: "R",
  5232. FORWARD: "F",
  5233. BACK: "B",
  5234. reverse: {},
  5235. opposite: function(e) {
  5236. return this.reverse[e.toString()]
  5237. }
  5238. };
  5239. n.reverse[n.UP] = n.DOWN,
  5240. n.reverse[n.DOWN] = n.UP,
  5241. n.reverse[n.LEFT] = n.RIGHT,
  5242. n.reverse[n.RIGHT] = n.LEFT,
  5243. n.reverse[n.FORWARD] = n.BACK,
  5244. n.reverse[n.BACK] = n.FORWARD,
  5245. t.exports = n
  5246. }
  5247. , {}],
  5248. 30: [function(e, t, i) {
  5249. "use strict";
  5250. var n = {
  5251. ZERO: 48,
  5252. ONE: 49,
  5253. TWO: 50,
  5254. THREE: 51,
  5255. FOUR: 52,
  5256. FIVE: 53,
  5257. SIX: 54,
  5258. SEVEN: 55,
  5259. EIGHT: 56,
  5260. NINE: 57,
  5261. LEFTARROW: 37,
  5262. UPARROW: 38,
  5263. RIGHTARROW: 39,
  5264. DOWNARROW: 40,
  5265. A: 65,
  5266. B: 66,
  5267. C: 67,
  5268. D: 68,
  5269. E: 69,
  5270. F: 70,
  5271. G: 71,
  5272. H: 72,
  5273. I: 73,
  5274. J: 74,
  5275. K: 75,
  5276. L: 76,
  5277. M: 77,
  5278. N: 78,
  5279. O: 79,
  5280. P: 80,
  5281. Q: 81,
  5282. R: 82,
  5283. S: 83,
  5284. T: 84,
  5285. U: 85,
  5286. V: 86,
  5287. W: 87,
  5288. X: 88,
  5289. Y: 89,
  5290. Z: 90,
  5291. SPACE: 32,
  5292. RETURN: 13,
  5293. SEMICOLON: 186,
  5294. PLUSEQUALS: 187,
  5295. DASHUNDERSCORE: 189,
  5296. OPENBRACKET: 219
  5297. };
  5298. e("../util/browser").detectFirefox() && (n.SEMICOLON = 59,
  5299. n.PLUSEQUALS = 61,
  5300. n.DASHUNDERSCORE = 173),
  5301. t.exports = n
  5302. }
  5303. , {
  5304. "../util/browser": 182
  5305. }],
  5306. 31: [function(e, t, i) {
  5307. "use strict";
  5308. t.exports = {
  5309. EN_US: "en-US",
  5310. ES_MX: "es-MX",
  5311. FR_FR: "fr-FR",
  5312. DE_DE: "de-DE",
  5313. RU_RU: "ru-RU",
  5314. CN_CN: "cn-CN",
  5315. JP_JP: "jp-JP"
  5316. }
  5317. }
  5318. , {}],
  5319. 32: [function(e, t, i) {
  5320. "use strict";
  5321. t.exports = {
  5322. TagActivated: "tag.activated",
  5323. TagDismissed: "tag.dismissed",
  5324. TagNavigation: "tag.navigation"
  5325. }
  5326. }
  5327. , {}],
  5328. 33: [function(e, t, i) {
  5329. "use strict";
  5330. t.exports = {
  5331. ModelAdded: "model-added",
  5332. ActiveModelChanged: "active-model-changed"
  5333. }
  5334. }
  5335. , {}],
  5336. 34: [function(e, t, i) {
  5337. "use strict";
  5338. t.exports = {
  5339. LEFT: 0,
  5340. MIDDLE: 1,
  5341. RIGHT: 2
  5342. }
  5343. }
  5344. , {}],
  5345. 35: [function(e, t, i) {
  5346. "use strict";
  5347. t.exports = {
  5348. PanoRenderComplete: "panorama.render.complete",
  5349. TileRenderFailure: "panorama.tile.render.failed",
  5350. TileRenderSuccess: "panorama.tile.render.success",
  5351. TileUploadAttempted: "panorama.tile.upload.attempted",
  5352. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5353. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5354. }
  5355. }
  5356. , {}],
  5357. 36: [function(e, t, i) {
  5358. "use strict";
  5359. t.exports = {
  5360. BASE: 1,
  5361. STANDARD: 2,
  5362. HIGH: 3,
  5363. ULTRAHIGH: 4
  5364. }
  5365. }
  5366. , {}],
  5367. 37: [function(e, t, i) {
  5368. "use strict";
  5369. t.exports = {
  5370. LoadComplete: "panorama.load.complete",
  5371. LoadFailed: "panorama.load.failed",
  5372. TileLoaded: "panorama.tile.loaded"
  5373. }
  5374. }
  5375. , {}],
  5376. 38: [function(e, t, i) {
  5377. "use strict";
  5378. t.exports = Object.freeze({
  5379. Standard: 0,
  5380. Slow: 1,
  5381. Retain: 2
  5382. })
  5383. }
  5384. , {}],
  5385. 39: [function(e, t, i) {
  5386. "use strict";
  5387. t.exports = Object.freeze({
  5388. Show: 0,
  5389. Hide: 1,
  5390. Retain: 2
  5391. })
  5392. }
  5393. , {}],
  5394. 40: [function(e, t, i) {
  5395. "use strict";
  5396. t.exports = {
  5397. Move: "move",
  5398. MoveComplete: "move.complete",
  5399. ModeChanged: "mode.changed",
  5400. ModeChanging: "mode.changing",
  5401. PanoChosen: "pano.chosen",
  5402. ClosestPanoChanging: "closest.pano.changing",
  5403. WarpStarted: "warp.started",
  5404. WarpInterrupted: "warp.interrupted",
  5405. WarpEnded: "warp.ended",
  5406. FlyinFinished: "flyin.finished",
  5407. FlyingStarted: "flying.started",
  5408. FlyingInterrupted: "flying.interrupted",
  5409. FlyingEnded: "flying.ended",
  5410. Ready: "ready",
  5411. StartInside: "start.inside",
  5412. StartOutside: "start.outside",
  5413. ViewChanged: "view.changed",
  5414. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5415. InputStart: "input.start"
  5416. }
  5417. }
  5418. , {}],
  5419. 41: [function(e, t, i) {
  5420. "use strict";
  5421. t.exports = Object.freeze({
  5422. DEFAULT: 0,
  5423. PANOMARKERS: 1,
  5424. RETICULE: 2,
  5425. TAG: 3
  5426. })
  5427. }
  5428. , {}],
  5429. 42: [function(e, t, i) {
  5430. "use strict";
  5431. t.exports = {
  5432. visibleFloor: 1,
  5433. ghostFloor: 3,
  5434. boundingSkybox: 1,
  5435. panoMarker: 2,
  5436. reticule: 3,
  5437. tagStem: 4,
  5438. tagDisc: 5,
  5439. ribbon: 100
  5440. }
  5441. }
  5442. , {}],
  5443. 43: [function(e, t, i) {
  5444. "use strict";
  5445. t.exports = {
  5446. ContextCreated: "scene-renderer-context-created",
  5447. AfterRender: "after-render",
  5448. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5449. }
  5450. }
  5451. , {}],
  5452. 44: [function(e, t, i) {
  5453. "use strict";
  5454. t.exports = {
  5455. IDLE: "idle",
  5456. BROWSE: "browse",
  5457. EXAMINE: "examine"
  5458. }
  5459. }
  5460. , {}],
  5461. 45: [function(e, t, i) {
  5462. "use strict";
  5463. t.exports = {
  5464. TileDownloadSuccess: "tiledownloader.download.success",
  5465. TileDownloadFailure: "tiledownloader.download.failure",
  5466. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5467. }
  5468. }
  5469. , {}],
  5470. 46: [function(e, t, i) {
  5471. "use strict";
  5472. t.exports = {
  5473. CardboardAndroid: "googlevr",
  5474. GearVR: "gearvr",
  5475. CardboardIOS: "googlevrios",
  5476. Cardboard: "googlevr"
  5477. }
  5478. }
  5479. , {}],
  5480. 47: [function(e, t, i) {
  5481. "use strict";
  5482. t.exports = {
  5483. NONE: 0,
  5484. CONTEXTUAL: 1,
  5485. ANDROID: 2
  5486. }
  5487. }
  5488. , {}],
  5489. 48: [function(e, t, i) {
  5490. "use strict";
  5491. var n = {
  5492. Title: 0,
  5493. Cardboard: 1
  5494. }
  5495. , r = {
  5496. Title: 0,
  5497. Cardboard: 1,
  5498. Gear: 2
  5499. };
  5500. [n, r].forEach(function(e) {
  5501. e.pageCount = Object.keys(e).length
  5502. }),
  5503. t.exports.ios = n,
  5504. t.exports.standard = r
  5505. }
  5506. , {}],
  5507. 49: [function(e, t, i) {
  5508. "use strict";
  5509. t.exports = {
  5510. Android: "android",
  5511. IOS: "ios",
  5512. Desktop: "desktop",
  5513. UnsupportedAndroid: "android-unsupported"
  5514. }
  5515. }
  5516. , {}],
  5517. 50: [function(e, t, i) {
  5518. "use strict";
  5519. var n = e("three");
  5520. t.exports = {
  5521. UP: new n.Vector3(0,1,0),
  5522. DOWN: new n.Vector3(0,-1,0),
  5523. LEFT: new n.Vector3(-1,0,0),
  5524. RIGHT: new n.Vector3(1,0,0),
  5525. FORWARD: new n.Vector3(0,0,-1),
  5526. BACK: new n.Vector3(0,0,1)
  5527. }
  5528. }
  5529. , {
  5530. three: 217
  5531. }],
  5532. 51: [function(e, t, i) {
  5533. "use strict";
  5534. var n = e("../exception/ViewmodeConvertException")
  5535. , r = e("./coreViewmodes")
  5536. , o = {
  5537. MESH: "mesh",
  5538. OUTDOOR: "outdoor",
  5539. TRANSITIONING: "transitioning",
  5540. toInt: function(e) {
  5541. switch (e) {
  5542. case this.PANORAMA:
  5543. return 1;
  5544. case this.DOLLHOUSE:
  5545. return 2;
  5546. case this.FLOORPLAN:
  5547. return 3;
  5548. case this.OUTDOOR:
  5549. return 4;
  5550. case this.TRANSITIONING:
  5551. return -1
  5552. }
  5553. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5554. },
  5555. fromInt: function(e) {
  5556. switch (e) {
  5557. case "1":
  5558. case 1:
  5559. return this.PANORAMA;
  5560. case "2":
  5561. case 2:
  5562. return this.DOLLHOUSE;
  5563. case "3":
  5564. case 3:
  5565. return this.FLOORPLAN;
  5566. case "4":
  5567. case 4:
  5568. return this.OUTDOOR
  5569. }
  5570. throw new n("No known conversion for int to viewmode for int: " + e)
  5571. },
  5572. convertWorkshopModeInt: function(e) {
  5573. switch (e) {
  5574. case "0":
  5575. case 0:
  5576. case void 0:
  5577. return this.PANORAMA;
  5578. case "1":
  5579. case 1:
  5580. return this.FLOORPLAN;
  5581. case "2":
  5582. case 2:
  5583. return this.DOLLHOUSE;
  5584. case "3":
  5585. case 3:
  5586. return this.MESH
  5587. }
  5588. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5589. }
  5590. };
  5591. e("../util/common").extendObject(o, r),
  5592. t.exports = o
  5593. }
  5594. , {
  5595. "../exception/ViewmodeConvertException": 58,
  5596. "../util/common": 185,
  5597. "./coreViewmodes": 54
  5598. }],
  5599. 52: [function(e, t, i) {
  5600. "use strict";
  5601. t.exports = {
  5602. BLACK: "black",
  5603. STD: "std",
  5604. WALK: "walk"
  5605. }
  5606. }
  5607. , {}],
  5608. 53: [function(e, t, i) {
  5609. "use strict";
  5610. t.exports = {
  5611. ZoomIn: "zoom.in",
  5612. ZoomOut: "zoom.out",
  5613. ZoomMax: "zoom.max",
  5614. ZoomMin: "zoom.min"
  5615. }
  5616. }
  5617. , {}],
  5618. 54: [function(e, t, i) {
  5619. "use strict";
  5620. t.exports = {
  5621. PANORAMA: "panorama",
  5622. DOLLHOUSE: "dollhouse",
  5623. FLOORPLAN: "floorplan"
  5624. }
  5625. }
  5626. , {}],
  5627. 55: [function(e, t, i) {
  5628. "use strict";
  5629. t.exports = function(e) {
  5630. this.message = e
  5631. }
  5632. }
  5633. , {}],
  5634. 56: [function(e, t, i) {
  5635. "use strict";
  5636. function n(e) {
  5637. r.call(this, e)
  5638. }
  5639. var r = e("./BasicException");
  5640. n.prototype = Object.create(r.prototype),
  5641. t.exports = n
  5642. }
  5643. , {
  5644. "./BasicException": 55
  5645. }],
  5646. 57: [function(e, t, i) {
  5647. "use strict";
  5648. function n(e) {
  5649. r.call(this, e)
  5650. }
  5651. var r = e("./BasicException");
  5652. n.prototype = Object.create(r.prototype),
  5653. t.exports = n
  5654. }
  5655. , {
  5656. "./BasicException": 55
  5657. }],
  5658. 58: [function(e, t, i) {
  5659. "use strict";
  5660. function n(e) {
  5661. r.call(this, e)
  5662. }
  5663. var r = e("./BasicException");
  5664. n.prototype = Object.create(r.prototype),
  5665. t.exports = n
  5666. }
  5667. , {
  5668. "./BasicException": 55
  5669. }],
  5670. 59: [function(a, s, e) {
  5671. (function(e) {
  5672. "use strict";
  5673. var i = a("./util/ajax")
  5674. , n = a("./util/showcase")
  5675. , t = a("./util/logger")
  5676. , r = new t(e)
  5677. , o = {};
  5678. s.exports = {
  5679. loadFeatureFlags: function(e) {
  5680. var t = $.Deferred();
  5681. return i.get(e.urlBase + "", {
  5682. responseType: "json",
  5683. prefetchFrom: "user",
  5684. auth: n.getAuthorizationHeader()
  5685. }).done(function(e) {
  5686. (o = function(e) {
  5687. var t = {};
  5688. if (e) {
  5689. var i = e.flags;
  5690. if (i)
  5691. for (var n in i)
  5692. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5693. return t
  5694. }
  5695. return r.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5696. null
  5697. }(e)) ? t.resolve(o) : t.reject("loading-failed")
  5698. }).fail(function() {
  5699. r.debug("Retrieval of feature flags failed."),
  5700. t.reject("loading-failed")
  5701. }),
  5702. t.promise()
  5703. },
  5704. getFlags: function() {
  5705. return o
  5706. },
  5707. updateDependentSettings: function(e, t) {
  5708. (e = e || o).labels && (t.labels.enabled = !0),
  5709. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5710. e.showcase_sdk && (t.sdkInit = !0),
  5711. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5712. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5713. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5714. e.hide_sc_sharing && (t.share.enabled = !1)
  5715. }
  5716. }
  5717. }
  5718. ).call(this, "/js/featureflags.js")
  5719. }
  5720. , {
  5721. "./util/ajax": 181,
  5722. "./util/logger": 189,
  5723. "./util/showcase": 193
  5724. }],
  5725. 60: [function(e, t, i) {
  5726. "use strict";
  5727. var n = (e("../util/common"),
  5728. {
  5729. status: 0,
  5730. set: function(e) {
  5731. if (isNaN(e))
  5732. return !1;
  5733. var t = $(".progressbar");
  5734. e < 0 && (e = 0),
  5735. 100 < e && (e = 100);
  5736. var i = e * (parseInt(t.css("width").replace("px", "")) / 100)
  5737. , n = Math.round(e)
  5738. , r = parseInt(i) - 15;
  5739. t.find(".bar").css("width", i),
  5740. t.find(".label").css("left", r),
  5741. t.find(".perc").text(n + "%"),
  5742. this.status = e
  5743. },
  5744. done: function(e) {
  5745. return e || this.status ? (this.status = null,
  5746. this.set(100)) : this
  5747. }
  5748. });
  5749. t.exports.circleLoader = n
  5750. }
  5751. , {
  5752. "../util/common": 185
  5753. }],
  5754. 61: [function(e, t, i) {
  5755. "use strict";
  5756. t.exports = Object.freeze({
  5757. CLOSE: "modal.closer.close"
  5758. })
  5759. }
  5760. , {}],
  5761. 62: [function(e, t, i) {
  5762. "use strict";
  5763. function n(t, e) {
  5764. function i() {
  5765. var e = t.offsetHeight >= $("#player").height() && t.offsetWidth >= $("#player").width();
  5766. e !== p && ((p = e) ? (t.classList.add("closeByFooter"),
  5767. c.classList.add("closeByFooter")) : (t.classList.remove("closeByFooter"),
  5768. c.classList.remove("closeByFooter")))
  5769. }
  5770. e ? setTimeout(i, r.guiAnimationSpeed) : i()
  5771. }
  5772. var r = e("../../settings")
  5773. , o = (e("../../tag/Media/MediaEvent"),
  5774. e("../../util/browser"))
  5775. , a = e("../../util/common")
  5776. , s = e("./ModalCloserEvent")
  5777. , l = e("events").EventEmitter
  5778. , c = document.getElementsByClassName("footer")[0]
  5779. , h = c.querySelectorAll(".close")[0]
  5780. , u = null
  5781. , d = null
  5782. , p = null
  5783. , f = (o.isMobile(),
  5784. {
  5785. open: function(e) {
  5786. e && (n(e),
  5787. u && h.removeEventListener("click", u, !0),
  5788. u = function(e, t) {
  5789. t && (t.stopPropagation(),
  5790. t.preventDefault()),
  5791. e && this.emit(s.CLOSE, e),
  5792. f.reset()
  5793. }
  5794. .bind(this, e.id),
  5795. h.addEventListener("click", u, !0),
  5796. d && window.removeEventListener("resize", d, !0),
  5797. d = n.bind(this, e),
  5798. window.addEventListener("resize", d, !0))
  5799. },
  5800. reset: function() {
  5801. c.classList.remove("closeByFooter"),
  5802. h.removeEventListener("click", u, !0),
  5803. window.removeEventListener("resize", d, !0),
  5804. u = d = p = null
  5805. }
  5806. });
  5807. a.extendObject(f, l.prototype),
  5808. t.exports = f
  5809. }
  5810. , {
  5811. "../../tag/Media/MediaEvent": 131,
  5812. "../../settings": 166,
  5813. "../../util/browser": 182,
  5814. "../../util/common": 185,
  5815. "./ModalCloserEvent": 61,
  5816. events: 202
  5817. }],
  5818. 63: [function(e, t, i) {
  5819. "use strict";
  5820. var A = e("../lib/dat.gui")
  5821. , C = e("three")
  5822. , I = e("../util/easing")
  5823. , E = e("../enum/Viewmode")
  5824. , _ = e("../enum/Colors")
  5825. , b = e("../enum/WarpStyle")
  5826. , w = e("../settings");
  5827. e("../tag/tag"),
  5828. A.GUI.prototype.removeFolder = function(e) {
  5829. var t = this.__folders[e];
  5830. t && (t.close(),
  5831. this.__ul.removeChild(t.domElement.parentNode),
  5832. delete this.__folders[e],
  5833. this.onResize())
  5834. }
  5835. ,
  5836. t.exports.toggle = function(t, e, i) {
  5837. var n = new A.GUI({
  5838. width: 400
  5839. })
  5840. , r = n.addFolder("Flydown from Dollhouse");
  5841. r.add(w.flydown, "movementEasing", Object.keys(I)),
  5842. r.add(w.flydown, "movementDelay", 0, 1).step(.01),
  5843. r.add(w.flydown, "rotationEasing", Object.keys(I)),
  5844. r.add(w.flydown, "rotationDelay", 0, 1).step(.01),
  5845. r.add(w.flydown, "modelTextureDelay", 0, 1).step(.01),
  5846. r.add(w.flydown, "skyboxDelay", 0, 1).step(.01),
  5847. r.add(w.dollhouseDefault, "minPolarAngle", 0, C.Math.degToRad(50)),
  5848. r.add(w.dollhouseDefault, "maxPolarAngle", C.Math.degToRad(50), C.Math.degToRad(170));
  5849. var o = n.addFolder("Transition between panos");
  5850. o.add(w.transition, "blur", 0, 10).onFinishChange(function() {}),
  5851. o.add(w.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5852. w.transition.flyTime = 0,
  5853. o.__controllers.forEach(function(e) {
  5854. e.updateDisplay()
  5855. })
  5856. }),
  5857. o.add(w.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5858. w.transition.flySpeed = 0,
  5859. o.__controllers.forEach(function(e) {
  5860. e.updateDisplay()
  5861. })
  5862. }),
  5863. o.add(w.transition, "aimTime", 500, 2500).step(50),
  5864. o.add(w.transition, "aimSlowFactor", 1, 3).step(.1),
  5865. o.add(w.transition, "movementEasing", Object.keys(I));
  5866. var a = n.addFolder("Path Display");
  5867. a.add(w.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5868. a.add(w.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5869. a.add(w.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5870. a.add(w.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5871. a.add(w.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5872. a.add(w.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5873. a.add(w.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5874. a.add(w.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5875. a.add(w.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5876. a.add(w.path, "color", Object.keys(_)).onFinishChange(function() {
  5877. w.path.color = _[w.path.color],
  5878. w.path.colorUp = _._desat(w.path.color),
  5879. w.path.colorDown = _.darken(w.path.color)
  5880. }),
  5881. a.add(w, "reticuleColor", Object.keys(_)).onFinishChange(function() {
  5882. w.reticuleColor = _[w.reticuleColor]
  5883. });
  5884. var s = n.addFolder("Warping")
  5885. , l = s.addFolder("Warp/Teleport");
  5886. l.add(w.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5887. l.add(w.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5888. l.add(w.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5889. l.add(w.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5890. l.add(w.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5891. l.add(w.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5892. l.add(w.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5893. l.add(w.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5894. l.add(w.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5895. l.add(w.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5896. l.add(w.path, "mapGuides").onFinishChange(function() {}),
  5897. l.add(w.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5898. l.add(w.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5899. l.add(w.path, "typ", Object.keys(b)).onFinishChange(function() {
  5900. w.path.typ = b[w.path.typ]
  5901. }),
  5902. l.add(w.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5903. e.endlessLoop = w.warp.loop
  5904. }),
  5905. l.add(w.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5906. l.add(w.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5907. l.add(w.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5908. var c = s.addFolder("Long Warp Only");
  5909. c.add(w.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5910. w.warp.flySpeed = 0,
  5911. c.__controllers.forEach(function(e) {
  5912. e.updateDisplay()
  5913. })
  5914. }),
  5915. c.add(w.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5916. c.add(w.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5917. c.add(w.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5918. c.add(w.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5919. c.add(w.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5920. c.add(w.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5921. c.add(w.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5922. c.add(w.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5923. c.add(w.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5924. var h = n.addFolder("Warp Esoterica");
  5925. h.add(w.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5926. h.add(w.warp, "blur", .01, 1).onFinishChange(function() {}),
  5927. h.add(w.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5928. w.warp.minWarpTime = 0,
  5929. h.__controllers.forEach(function(e) {
  5930. e.updateDisplay()
  5931. })
  5932. }),
  5933. h.add(w.warp, "showBunny").onFinishChange(function() {}),
  5934. h.add(w.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  5935. h.add(w.warp, "movementEasing", Object.keys(I));
  5936. var u = n.addFolder("Misc");
  5937. u.add(w, "dollhouseFOV", 10, 180).onChange(function() {
  5938. i.cameras[E.DOLLHOUSE].fov = w.dollhouseFOV
  5939. }),
  5940. u.add(w, "insideFOV", 10, 180).onChange(function() {
  5941. i.cameras[E.PANORAMA].fov = w.insideFOV
  5942. }),
  5943. u.add(w, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  5944. u.add(w, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  5945. u.add(w, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  5946. var d = n.addFolder("Navigation");
  5947. d.add(w.navigation, "panoScores").onFinishChange(function() {
  5948. w.navigation.panoScores || t.panos.forEach(function(e) {
  5949. e.floor.remove(e.text3d),
  5950. e.text3d = null
  5951. })
  5952. }),
  5953. d.add(w.navigation, "mouseDirection"),
  5954. d.add(w.navigation, "filterStrictness", 0, 1),
  5955. d.add(w.navigation, "angleFactor", -60, 0),
  5956. d.add(w.navigation, "directionFactor", 1, 20),
  5957. d.add(w.navigation, "distanceFactor", -5, 5),
  5958. d.add(w.navigation, "optionalityFactor", .1, 10);
  5959. var p = n.addFolder("tags")
  5960. , f = p.addFolder("Tag Creation");
  5961. f.add(w.tags.pole, "enabled").name("poleEnabled"),
  5962. f.add(w.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  5963. f.add(w.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  5964. f.add(w.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  5965. var g = p.addFolder("Visibility");
  5966. g.add(w.tags.visibility, "anyDistance"),
  5967. g.add(w.tags.visibility, "visibleDistance", .1, 30).step(.1),
  5968. g.add(w.tags.visibility, "cameraClearance", 0, 1).step(.01),
  5969. g.add(w.tags.visibility, "hideViaFloor"),
  5970. g.add(w.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  5971. g.add(w.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  5972. var m = p.addFolder("Disc Parameters");
  5973. m.add(w.tags.disc.scale, "nearBound", .1, 10).step(.1),
  5974. m.add(w.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  5975. m.add(w.tags.disc.scale, "linkFarBound").onChange(function(e) {
  5976. e && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - w.tags.disc.scale.linkPercent / 100))
  5977. }),
  5978. m.add(w.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  5979. w.tags.disc.scale.linkFarBound && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - e / 100))
  5980. }),
  5981. m.add(w.tags.disc.scale, "maxSize", 40, 200).step(1),
  5982. m.add(w.tags.disc.scale, "minSize", 20, 100).step(1),
  5983. m.add(w.tags.disc.scale, "responsiveness", 0, 100).step(1);
  5984. var v = p.addFolder("Navigate");
  5985. v.add(w.tags.navigate, "nearestPano").name("nearestPano"),
  5986. v.add(w.tags.navigate, "lineOfSight").name("lineOfSight"),
  5987. v.add(w.tags.navigate, "reactivate").name("reactivate"),
  5988. v.add(w.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  5989. v.add(w.tags.navigate, "tiltTolerance", 0, 50).step(1),
  5990. v.add(w.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  5991. var y = n.addFolder("Debug");
  5992. y.add(w, "wireframe").onFinishChange(function() {
  5993. t.chunks.forEach(function(e) {
  5994. e.material && (e.wireframeTwin || (e.wireframeTwin = new C.WireframeHelper(e),
  5995. e.wireframeTwin.material.depthWrite = !1,
  5996. e.wireframeTwin.material.depthTest = !1,
  5997. e.wireframeTwin.material.opacity = .5,
  5998. e.wireframeTwin.material.transparent = !0),
  5999. w.wireframe ? t.add(e.wireframeTwin) : t.remove(e.wireframeTwin))
  6000. })
  6001. }),
  6002. y.add(w, "skyboxWireframe").onFinishChange(function() {
  6003. w.skyboxWireframe ? (t.skybox.wireframe = new C.WireframeHelper(t.skybox),
  6004. t.add(t.skybox.wireframe)) : (t.remove(t.skybox.wireframe),
  6005. t.skybox.wireframe = null)
  6006. }),
  6007. y.add(w, "showSweeps").onFinishChange(function() {
  6008. t.setSweepVisibility(w.showSweeps)
  6009. }),
  6010. y.add(w, "showMesh").onFinishChange(function() {
  6011. t.chunks.forEach(function(e) {
  6012. e.visible = w.showMesh
  6013. })
  6014. }),
  6015. y.add(w, "showFloors").onFinishChange(function() {
  6016. t.floors.forEach(function(e) {
  6017. e.collider.children.forEach(function(e) {
  6018. e.material.visible = w.showFloors
  6019. })
  6020. })
  6021. }),
  6022. y.add(w, "showSkyboxes").onFinishChange(function() {
  6023. t.panos.forEach(function(e) {
  6024. e.skyboxMesh.visible = w.showSkyboxes
  6025. })
  6026. }),
  6027. y.add(w, "showNeighbors").onChange(function() {}),
  6028. y.add(t, "alpha", 0, 1)
  6029. }
  6030. }
  6031. , {
  6032. "../enum/Colors": 19,
  6033. "../enum/Viewmode": 51,
  6034. "../enum/WarpStyle": 52,
  6035. "../lib/dat.gui": 93,
  6036. "../tag/tag": 123,
  6037. "../settings": 166,
  6038. "../util/easing": 186,
  6039. three: 217
  6040. }],
  6041. 64: [function(c, h, e) {
  6042. (function(e) {
  6043. "use strict";
  6044. function i(e, t, i, n) {
  6045. $(".gui-error .error-problem-text").text(e),
  6046. $(".gui-error .error-solution-text").text(t),
  6047. $(".gui-error .error-explanation").text(i),
  6048. $(".gui-error .error-actions").html(n),
  6049. $(window).resize(),
  6050. $(".gui-error").fadeIn(),
  6051. $("#bottom-logo").fadeIn()
  6052. }
  6053. function n(e) {
  6054. 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("");
  6055. i(e, s.ERROR_BROWSER_SOLUTION, s.ERROR_BROWSER_EXPLANATION, t),
  6056. r.isMobile() || $("[rel=tiletip]").tooltip({
  6057. placement: "bottom",
  6058. delay: {
  6059. show: 50,
  6060. hide: 0
  6061. },
  6062. trigger: "hover",
  6063. viewport: {
  6064. selector: "body",
  6065. padding: 10
  6066. }
  6067. })
  6068. }
  6069. function t() {
  6070. var e = r.isMobile() ? "" : '<span class="link install-browser">' + s.ERROR_GENERIC_ACTIONS_2 + "</span>" + s.ERROR_GENERIC_ACTIONS_3
  6071. , t = [s.ERROR_GENERIC_ACTIONS_1, e].join("");
  6072. i(s.ERROR_GENERIC_PROBLEM, s.ERROR_GENERIC_SOLUTION, "", t),
  6073. r.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  6074. e.preventDefault(),
  6075. e.stopPropagation(),
  6076. n(" ")
  6077. })
  6078. }
  6079. var r = c("./../util/browser")
  6080. , o = c("./../analytics")
  6081. , a = c("./../settings")
  6082. , s = c("../localization/localize")
  6083. , l = new (c("./../util/logger"))(e);
  6084. h.exports.error = function(e) {
  6085. if ($("head title").text(a.pageTitle),
  6086. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  6087. $("#gui-loading").fadeOut(250),
  6088. $("#quick-blackout").hide(),
  6089. o.track("showcase_error", {
  6090. error_key: e
  6091. }),
  6092. s.locale || s.init(),
  6093. "webgl-unsupported" === e)
  6094. r.isMobile() ? t() : n(s.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6095. else if ("webgl-ios" === e)
  6096. i(s.ERROR_WEBGL_IOS_PROBLEM, s.ERROR_WEBGL_IOS_SOLUTION, "", s.ERROR_WEBGL_IOS_ACTIONS_1 + "<strong>" + s.ERROR_WEBGL_IOS_ACTIONS_2 + "</strong>.");
  6097. else if ("webgl-safari" === e)
  6098. i(s.ERROR_WEBGL_SAFARI_PROBLEM, "", "", s.ERROR_WEBGL_SAFARI_ACTIONS_1 + "<strong>" + s.ERROR_WEBGL_SAFARI_ACTIONS_2 + "</strong>. " + s.ERROR_WEBGL_SAFARI_ACTIONS_3 + "<strong>" + s.ERROR_WEBGL_SAFARI_ACTIONS_4 + "</strong>.");
  6099. else if ("webgl-generic" === e)
  6100. t();
  6101. else if ("missing-urls" === e)
  6102. i(s.ERROR_MISSING_URLS_PROBLEM, "", s.ERROR_MISSING_URLS_EXPLANATION);
  6103. else if ("loading-failed" === e)
  6104. i(s.ERROR_LOADING_FAILED_PROBLEM, "", "", s.ERROR_LOADING_FAILED_ACTIONS_1 + '<a class="link" target="_blank" href="https://support.port.com/hc/articles/208220058">' + s.ERROR_LOADING_FAILED_ACTIONS_2 + "</a>.");
  6105. else {
  6106. if ("loading-failed-maintenance" !== e)
  6107. return void l.error("Unhandled error: " + e);
  6108. i(s.ERROR_MAINTENANCE_PROBLEM, s.ERROR_MAINTENANCE_SOLUTION)
  6109. }
  6110. }
  6111. }
  6112. ).call(this, "/js/gui/error.js")
  6113. }
  6114. , {
  6115. "../localization/localize": 108,
  6116. "./../analytics": 4,
  6117. "./../settings": 166,
  6118. "./../util/browser": 182,
  6119. "./../util/logger": 189
  6120. }],
  6121. 65: [function(Oe, Le, e) {
  6122. (function(e) {
  6123. "use strict";
  6124. function c() {
  6125. for (var e in Ce)
  6126. if (Ce.hasOwnProperty(e)) {
  6127. var t = Ce[e];
  6128. if (!t.visible)
  6129. for (var i = 0; i < t.elements.length; i++)
  6130. $(t.elements[i]).hide()
  6131. }
  6132. Ce.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6133. !1 === Ce.tourControls.visible && $("#drawer").addClass("fullWidth"),
  6134. ge = [],
  6135. Ce.floors.visible && ge.push(".gui-floor", ".gui-floor-title"),
  6136. ge.push(".hideTarget", ".pinTop.right")
  6137. }
  6138. function v(e, t) {
  6139. var i = !S.isMobile() && M.zoom.enabled && t.mode === ie.PANORAMA && !e.tourIsPlaying;
  6140. $("#gui-zoomin").toggle(i),
  6141. $("#gui-zoomout").toggle(i)
  6142. }
  6143. function l() {
  6144. n(),
  6145. $(".pinBottom").toggleClass("open"),
  6146. $("#drawer").toggleClass("open"),
  6147. $(".footer").toggleClass("open"),
  6148. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", se.CLOSE_HIGHLIGHTS),
  6149. _e("highlights")) : ($("#pullTab .icon").attr("data-original-title", se.OPEN_HIGHLIGHTS),
  6150. O.resetDrawer()),
  6151. setTimeout(function() {
  6152. $("#pullTab").toggleClass("opened")
  6153. }, $("#drawer").hasClass("open") ? 0 : M.highlightAnimationDuration),
  6154. $(".pinBottom").hasClass("open") && t($(".vr-popup")) && $(".vr-popup").is(":visible") && X.dismiss()
  6155. }
  6156. function t(e) {
  6157. var t;
  6158. return "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6159. t = e.position().top + e.outerHeight(),
  6160. e.attr("style", "display: none")),
  6161. $("#player").outerHeight() - 130 < t + 25
  6162. }
  6163. function y(e) {
  6164. "touchstart" === e.type && e.preventDefault(),
  6165. e.stopPropagation()
  6166. }
  6167. function n() {
  6168. w && (w.reload(),
  6169. w.init())
  6170. }
  6171. function r() {
  6172. $("#gui-spinner").stop(!0, !0),
  6173. $("#gui-spinner").fadeOut(1e3),
  6174. !(Ae = !0)
  6175. }
  6176. function A(e, t) {
  6177. var i = e.mode
  6178. , n = t || e.currentPano;
  6179. $("#gui-modes-dollhouse").toggleClass("active", i === ie.DOLLHOUSE),
  6180. $("#gui-modes-floorplan").toggleClass("active", i === ie.FLOORPLAN),
  6181. $("#gui-modes-inside").toggleClass("active", i === ie.PANORAMA),
  6182. i === ie.PANORAMA ? ($("#view-controllers").slideUp(500),
  6183. M.show360Views.enabled && !n.isAligned() ? ($(".gui-floor").addClass("hidden"),
  6184. $("#gui-modes-outside").addClass("desktop-only")) : ($(".gui-floor").removeClass("hidden"),
  6185. $("#gui-modes-outside").removeClass("desktop-only")),
  6186. $("#gui-modes-outside").removeClass("hidden")) : i !== ie.TRANSITIONING && (r(),
  6187. pe = i,
  6188. $("#gui-modes-outside").addClass("hidden"),
  6189. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6190. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(M.guiAnimationSpeed))
  6191. }
  6192. function C(t, i) {
  6193. function e() {
  6194. document.getElementById("vr").classList.remove("hidden"),
  6195. M.vr.allowWebVR ? S.getVRDisplay().then(function(e) {
  6196. S.supportsFullscreen() ? function(e) {
  6197. ue.info(e.displayName + " detected, VR button activates WebVR experience"),
  6198. Q.init(t.data, i, e, x),
  6199. Q.on(J.OPENED, _e.bind(gui, "vr")),
  6200. Q.on(J.SHOW_TERMS, W.show.bind(W))
  6201. }(e) : (ue.warn("Unable to use WebVR when full screen is not supported"),
  6202. $(".improper-embed").toggleClass("hidden", !1),
  6203. n())
  6204. }, function(e) {
  6205. n()
  6206. }) : n()
  6207. }
  6208. function n() {
  6209. var e;
  6210. ue.info("WebVR support not found, VR button activates native app VR modal"),
  6211. X.init(t.data, x),
  6212. X.on(Z.OPENED, (e = document.getElementById("vr-modal"),
  6213. function() {
  6214. _e("vr"),
  6215. V.open(e)
  6216. }
  6217. )),
  6218. X.on(Z.CLOSED, V.reset)
  6219. }
  6220. if (M.vr.enabled && t.supportsVR && !S.valueFromHash("mls", 0))
  6221. switch (M.vr.option) {
  6222. case le.CONTEXTUAL:
  6223. e();
  6224. break;
  6225. case le.ANDROID:
  6226. S.detectAndroid() && e();
  6227. break;
  6228. case le.NONE:
  6229. }
  6230. }
  6231. function h(e, i) {
  6232. for (var n = $(".gui-floor"), t = 0; t < e.floors.length; t++)
  6233. if ("372" !== getQueryVariable("m")) {
  6234. var r = $('<div class="floorChoice" data-index="' + t + '"></div>').text(e.floors.get(t).name);
  6235. $(".gui-floor").find(".container").prepend(r)
  6236. }
  6237. n.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + se.FLOOR_ALL + "</div>"),
  6238. n.on("click", function(e) {
  6239. y(e),
  6240. _e("floor"),
  6241. n.toggleClass("open")
  6242. }),
  6243. $(".floorChoice").on("click", function(e) {
  6244. y(e);
  6245. var t = $(this).data("index");
  6246. "all" !== t ? (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6247. i.player.gotoFloor(t),
  6248. R.track("showcase_gui", {
  6249. gui_action: "click_floor_select_button",
  6250. interaction_source: "gui"
  6251. })) : (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6252. _e("move"),
  6253. i.allFloors(),
  6254. R.track("showcase_gui", {
  6255. gui_action: "click_toggle_all_floors_button",
  6256. interaction_source: "gui"
  6257. })),
  6258. n.removeClass("open")
  6259. })
  6260. }
  6261. function I(e, t) {
  6262. e && (t === ie.DOLLHOUSE || t === ie.FLOORPLAN ? ($(".allFloorBtn").show(),
  6263. $(".gui-floor-icon").hide(),
  6264. $(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),
  6265. $(".gui-floor-icon").show(),
  6266. $(".gui-floor-title").hide()),
  6267. e.model.allFloorsVisible ? ($(".gui-floor-title").text(se.FLOOR_ALL),
  6268. $(".gui-floor-number").text(se.FLOOR_ALL),
  6269. $(".floorChoice").removeClass("active"),
  6270. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6271. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6272. $(".floorChoice").removeClass("active"),
  6273. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6274. }
  6275. function E() {
  6276. var e = $("#player").width() - 20
  6277. , t = $("#scroller")
  6278. , i = $("#drawer")
  6279. , n = $(".pinBottom");
  6280. $("#player").width() < 488 || $("#player").height() < 488 ? (t.addClass("hidden"),
  6281. i.addClass("noScroll"),
  6282. n.addClass("noScroll")) : e < T != !i.hasClass("noScroll") && (t.toggleClass("hidden"),
  6283. i.toggleClass("noScroll"),
  6284. n.toggleClass("noScroll"))
  6285. }
  6286. function _(e) {
  6287. e.waitQueue.length <= 0 ? r() : ye || function(e) {
  6288. e = e || 0,
  6289. Ae = !1,
  6290. window.setTimeout(function() {
  6291. Ae || (!0,
  6292. $("#gui-spinner").stop(!0, !0).show())
  6293. }
  6294. .bind(this), e)
  6295. }(M.modelComponentLoadSpinnerDelay)
  6296. }
  6297. function b(e, t) {
  6298. for (var i = []; e; )
  6299. i.push(e),
  6300. e = e.parentNode;
  6301. for (; t && -1 === i.indexOf(t); )
  6302. t = t.parentNode;
  6303. return t
  6304. }
  6305. var w, T, o, a, x, i, s, u, d, p, f, g, S = (Oe("three"),
  6306. Oe("../util/ajax"),
  6307. Oe("../util/browser")), M = Oe("../settings"), R = Oe("../analytics"), m = (Oe("../util/transitions"),
  6308. Oe("../util/camera"),
  6309. Oe("../util/logger")), P = (Oe("../objects/Snapshot"),
  6310. Oe("./helpManager")), O = Oe("./immersiveMode"), L = Oe("./loadingScreen"), D = Oe("./landingScreen"), N = Oe("./playButton"), F = Oe("./populateModal"), B = Oe("./memoryUsage"), V = Oe("./closer/modalCloser"), k = Oe("./closer/ModalCloserEvent"), U = Oe("./help/help"), H = Oe("./help/HelpEvent"), z = Oe("./title/titleBar"), G = Oe("./title/TitleEvents"), W = Oe("./terms/terms"), j = Oe("./terms/TermsEvent"), Y = Oe("./title/tagToggle"), q = Oe("./tourInteraction"), X = Oe("./vr/vrModal"), Z = Oe("./vr/vrEvent"), K = Oe("./sharing/modal"), Q = Oe("./webvr/webVRgui"), J = Oe("./webvr/WebVrEvent"), ee = Oe("../controls/serializer"), te = Oe("../enum/Keys"), ie = Oe("../enum/Viewmode"), ne = (Oe("../enum/BlackoutStyle"),
  6311. Oe("../tag/Media/MediaEvent")), re = (Oe("../enum/PathDiscardMode"),
  6312. Oe("../enum/PathDisplayMode"),
  6313. Oe("../enum/DirectorEvents"),
  6314. Oe("../enum/PlayerEvents")), oe = Oe("../enum/ControlEvents"), ae = Oe("./sharing/ShareEvents"), se = Oe("../localization/localize"), le = (Oe("../enum/Vectors"),
  6315. Oe("../enum/WarpStyle"),
  6316. Oe("../enum/AlignmentType"),
  6317. Oe("../enum/VROption")), ce = Oe("./konami"), he = Oe("../lib/dat.gui"), ue = new m(e), de = (Oe("../util/showcase"),
  6318. Oe("../enum/ZoomEvents")), pe = ie.DOLLHOUSE, fe = 0, ge = [".hideTarget"], me = null, ve = null, ye = !1, Ae = !1, Ce = {
  6319. coBrand: {
  6320. visible: !0,
  6321. elements: [".co-brand", "#loaderCoBrand"]
  6322. },
  6323. help: {
  6324. visible: !0,
  6325. elements: [".nav-help", "#nav-help"]
  6326. },
  6327. tourControls: {
  6328. visible: !0,
  6329. elements: [".next", ".previous", "#play"]
  6330. },
  6331. highlight: {
  6332. visible: !0,
  6333. elements: ["#drawer", "#pullTab"]
  6334. },
  6335. share: {
  6336. visible: !0,
  6337. elements: [".socialButton", "#share"]
  6338. },
  6339. fullScreen: {
  6340. visible: !0,
  6341. elements: ["#gui-fullscreen"]
  6342. },
  6343. floors: {
  6344. visible: !0,
  6345. elements: [".gui-floor"]
  6346. }
  6347. }, Ie = (g = document.getElementById("drawer"),
  6348. function() {
  6349. $("#player").height() < 400 && g.classList.contains("open") && l()
  6350. }
  6351. ), Ee = (f = document.getElementById("meta-info"),
  6352. function() {
  6353. $("#player").height() < 400 && f.classList.contains("expand") && z.toggleMeta(!0)
  6354. }
  6355. ), _e = (i = document.getElementById("meta-info"),
  6356. s = document.getElementById("interaction-modal"),
  6357. u = $("#drawer").eq(0),
  6358. d = $(".gui-floor").eq(0),
  6359. p = $(".vr-popup").eq(0),
  6360. function(e) {
  6361. switch (e) {
  6362. case "info":
  6363. we(),
  6364. Te(),
  6365. Ie(),
  6366. Me(),
  6367. Re(),
  6368. xe(),
  6369. Pe();
  6370. break;
  6371. case "terms":
  6372. be(),
  6373. Te(),
  6374. Se(),
  6375. Me(),
  6376. Re(),
  6377. xe(),
  6378. Pe();
  6379. break;
  6380. case "help":
  6381. be(),
  6382. we(),
  6383. Me(),
  6384. Re(),
  6385. xe(),
  6386. Pe();
  6387. break;
  6388. case "vr":
  6389. be(),
  6390. we(),
  6391. Me(),
  6392. Re(),
  6393. Te(),
  6394. Pe(),
  6395. t(p) && Se();
  6396. break;
  6397. case "highlights":
  6398. Ee(),
  6399. we(),
  6400. Me(),
  6401. Re();
  6402. break;
  6403. case "share":
  6404. be(),
  6405. we(),
  6406. Te(),
  6407. Re(),
  6408. xe(),
  6409. Pe();
  6410. break;
  6411. case "floor":
  6412. we(),
  6413. Me(),
  6414. xe();
  6415. break;
  6416. case "view":
  6417. Re(),
  6418. Me(),
  6419. we(),
  6420. xe();
  6421. break;
  6422. case "tour":
  6423. case "move":
  6424. we(),
  6425. Me(),
  6426. Re(),
  6427. xe();
  6428. break;
  6429. case "resize":
  6430. be(),
  6431. Ie(),
  6432. Re();
  6433. break;
  6434. case "tag":
  6435. we(),
  6436. Te(),
  6437. Me(),
  6438. Re(),
  6439. xe()
  6440. }
  6441. }
  6442. );
  6443. function be() {
  6444. i.classList.contains("expand") && z.toggleMeta(!0)
  6445. }
  6446. function we() {
  6447. W.hide()
  6448. }
  6449. function Te() {
  6450. U.close()
  6451. }
  6452. function xe() {
  6453. X.dismiss()
  6454. }
  6455. function Se() {
  6456. u.hasClass("open") && l()
  6457. }
  6458. function Me() {
  6459. K.hide()
  6460. }
  6461. function Re() {
  6462. d.hasClass("open") && d.removeClass("open")
  6463. }
  6464. function Pe() {
  6465. s.classList.contains("fadeIn") && (s.classList.contains("landing") ? D.dismissModal() : s.classList.contains("tour") && q.dismissModal())
  6466. }
  6467. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  6468. $("#gui-fullscreen").toggle(!S.isFullscreen()),
  6469. $("#gui-fullscreen-exit").toggle(!!S.isFullscreen()),
  6470. setTimeout(function() {
  6471. $(".icon:visible").hide().show(0)
  6472. }, 100)
  6473. }),
  6474. $("#gui-fullscreen").find("a").on("click", function(e) {
  6475. y(e),
  6476. S.requestFullscreen($("body")[0]),
  6477. R.track("showcase_gui", {
  6478. gui_action: "click_enter_fullscreen",
  6479. interaction_source: "gui"
  6480. })
  6481. }),
  6482. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  6483. y(e),
  6484. S.exitFullscreen(),
  6485. R.track("showcase_gui", {
  6486. gui_action: "click_exit_fullscreen",
  6487. interaction_source: "gui"
  6488. })
  6489. }),
  6490. $(window).on("resize", function(e) {
  6491. var t = e.target.innerHeight
  6492. , i = e.target.innerWidth;
  6493. t === o && i === a || (Ce.highlight.visible && E(),
  6494. _e("resize"),
  6495. $(".pinTop.right").removeClass("hideUnderMeta"),
  6496. n(),
  6497. o = t,
  6498. a = i)
  6499. }).resize(),
  6500. S.supportsFullscreen() || $("#gui-fullscreen").hide(),
  6501. $("#pullTab").on("click", function(e) {
  6502. y(e),
  6503. $("#drawer").hasClass("open") ? (R.trackAlways("showcase_gui", {
  6504. gui_action: "hide_highlight_reel"
  6505. }),
  6506. $(this).addClass("open").children("img").attr("src", "images/auto.png")) : (R.trackAlways("showcase_gui", {
  6507. gui_action: "show_highlight_reel"
  6508. }),
  6509. $(this).removeClass("open").children("img").attr("src", "images/auto-suspend.png")),
  6510. l()
  6511. }),
  6512. window.DATA.showHotListSta && ($("#hotList").css("display", ""),
  6513. $("#hotList").on("click", function(e) {
  6514. y(e);
  6515. var t = $("#hotListWrap")[0];
  6516. t.classList.contains("hotListActive") ? (t.classList.remove("hotListActive"),
  6517. this.classList.remove("active")) : (t.classList.add("hotListActive"),
  6518. this.classList.add("active"))
  6519. }),
  6520. $("#hotListContent ul").on("mouseover", function(e) {
  6521. y(e);
  6522. var t = e.target
  6523. , i = document.getElementById("hotListWrap");
  6524. if ("SPAN" === t.tagName) {
  6525. var n = t.parentElement.parentElement;
  6526. t.offsetWidth + 116 >= n.clientWidth ? i.style.width = t.offsetWidth + 116 + "px" : i.style.width = ""
  6527. } else if ("LI" === t.tagName) {
  6528. n = t.parentElement;
  6529. t.children[0].offsetWidth + 116 >= n.clientWidth ? i.style.width = t.children[0].offsetWidth + 116 + "px" : i.style.width = ""
  6530. } else
  6531. i.style.width = ""
  6532. }),
  6533. $("#hotListContent ul").on("click", function(e) {
  6534. y(e),
  6535. this.preElem && this.preElem.classList.remove("active"),
  6536. "SPAN" === e.target.tagName ? (e.target.parentElement.classList.add("active"),
  6537. e.target.parentElement.hot && e.target.parentElement.hot.examine(!0),
  6538. this.preElem = e.target.parentElement) : (e.target.classList.add("active"),
  6539. e.target.hot && e.target.hot.examine(!0),
  6540. this.preElem = e.target)
  6541. }),
  6542. $("#hotListClose").on("click", function(e) {
  6543. y(e),
  6544. $("#hotListWrap")[0].classList.remove("hotListActive"),
  6545. $("#hotListContent ul .active").removeClass("active"),
  6546. $("#hotList")[0].classList.remove("active")
  6547. })),
  6548. "true" === window.DATA.supportsVR && $("#vr").css("display", ""),
  6549. $("#more-menu-button").on("click", function(e) {
  6550. y(e),
  6551. $("#more-menu").toggleClass("open")
  6552. }),
  6553. Le.exports.init = function(s, l, c, e, t, i, n) {
  6554. var r;
  6555. x = n,
  6556. s.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6557. s.supportedModes[ie.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6558. F.init(),
  6559. D.init(s, i),
  6560. ce.init(s, l, e),
  6561. $(".icon").on("mouseover", function() {
  6562. l.player && l.player.reticule.hide()
  6563. }),
  6564. function(e, t) {
  6565. var i = t.player;
  6566. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6567. y(e),
  6568. R.updateInteraction(oe.InteractionGui, "inside-button"),
  6569. R.track("USER", {
  6570. event_type: "showcase_gui",
  6571. gui_action: "click_inside_mode_button"
  6572. }),
  6573. t.changeMode(ie.PANORAMA)
  6574. }),
  6575. $("#gui-modes-outside").find("a").on("click", function(e) {
  6576. y(e),
  6577. R.track("showcase_gui", {
  6578. gui_action: "click_outside_mode_button"
  6579. }),
  6580. t.changeMode(pe)
  6581. }),
  6582. $("#gui-modes-floorplan").on("click", function(e) {
  6583. y(e),
  6584. i.mode !== ie.FLOORPLAN && (R.track("showcase_gui", {
  6585. gui_action: "click_floorplan_mode_button"
  6586. }),
  6587. t.changeMode(ie.FLOORPLAN))
  6588. }),
  6589. $("#gui-modes-dollhouse").on("click", function(e) {
  6590. y(e),
  6591. i.mode !== ie.DOLLHOUSE && (R.track("showcase_gui", {
  6592. gui_action: "click_dollhouse_mode_button"
  6593. }),
  6594. t.changeMode(ie.DOLLHOUSE))
  6595. })
  6596. }(0, l),
  6597. function(e, t) {
  6598. $("#play").on("mousedown touchstart", function(e) {
  6599. y(e),
  6600. _e("tour"),
  6601. q.play(),
  6602. R.trackAlways("showcase_gui", {
  6603. gui_action: "play_highlights"
  6604. })
  6605. }),
  6606. window.startAndPlay = function(e) {
  6607. _e("tour"),
  6608. q.play(),
  6609. R.trackAlways("showcase_gui", {
  6610. gui_action: "play_highlights"
  6611. })
  6612. }
  6613. ,
  6614. $("#pause").on("mousedown touchstart", function(e) {
  6615. y(e),
  6616. q.pause(),
  6617. R.trackAlways("showcase_gui", {
  6618. gui_action: "pause_highlights"
  6619. })
  6620. }),
  6621. $("#gui-zoomin").find("a").on("click", function(e) {
  6622. y(e),
  6623. t.player.zoomInIncrementally()
  6624. }),
  6625. $("#gui-zoomout").find("a").on("click", function(e) {
  6626. y(e),
  6627. t.player.zoomOutIncrementally()
  6628. })
  6629. }(0, l),
  6630. s.data.enable_social_sharing && s.data.is_public && M.share.enabled && (K.init(DATA.name/* s.data.name */),
  6631. K.on(ae.OPENED, (r = document.getElementById("share-modal"),
  6632. function() {
  6633. _e("share"),
  6634. V.open(r)
  6635. }
  6636. )),
  6637. K.on(ae.CLOSED, V.reset)),
  6638. 0 < s.heroLocations.length ? function(e, i, t) {
  6639. var n = 100 / (fe = e.heroLocations.length) + "%"
  6640. , r = $("#thumb-container")
  6641. , o = $("#progressBar");
  6642. $("#status").find(".totalSteps").text(fe);
  6643. for (var a = 0; a < fe; a++) {
  6644. var s = e.heroLocations[a]
  6645. , l = $('<li class="thumbImg" data-index=""><img src=""></li>');
  6646. if(s.heroLocations){//有子项,选第一张截图
  6647. var tmp = s.heroLocations[0].thumbUrl.replace('https://','').replace('http://','')
  6648. }else{
  6649. var tmp = s.thumbUrl.replace('https://','').replace('http://','')
  6650. }
  6651. if (l.attr("data-index", a),
  6652. //Ce.highlight.visible && l.find("img").attr("src",'https://'+tmp),
  6653. Ce.highlight.visible && l.find("img").attr("src", 'http://'+tmp),// xzw改 导览图片 https在某些服务器打不开
  6654. s.name) {
  6655. var c = $('<div class="overlay"></div>').text(s.name);
  6656. l.prepend(c)
  6657. }
  6658. if (e.has360Views && s.cameraMode === ie.PANORAMA) {
  6659. var h = e.panos.get(s.panoId)
  6660. , u = h && !h.isAligned() ? '<div><img class="mark360View" src="images/mark-360-white-v2.png"></div>' : '<div><img class="markInsideView" src="images/mark-inside-white.png"></div>';
  6661. l.prepend(u)
  6662. }
  6663. r.append(l),
  6664. o.append('<div class="step" data-idx="' + a + '" style="width:' + n + '"></div>')
  6665. }
  6666. T = 144 * fe,
  6667. 111 * fe,
  6668. $(".thumbImg").on("mouseover", function() {
  6669. !function(e) {
  6670. return e.describe().inTransition
  6671. }(i) && t.showPathToHeroLocation([$(this).data("index"),0])//改
  6672. }),
  6673. $(".thumbImg").on("mouseout", function() {
  6674. i.clearPath()
  6675. }),
  6676. $(".thumbImg").on("click", function(e) {
  6677. y(e);
  6678. var t = $(this);
  6679. R.updateInteraction(oe.InteractionGui, "thumbnail"),
  6680. R.trackAlways("showcase_gui", {
  6681. gui_action: "click_highlight"
  6682. }),
  6683. i.goToHighlight([t.data("index"),0])//改
  6684. }),
  6685. $(".previous").find("a").on("click", function(e) {
  6686. y(e),
  6687. R.trackAlways("showcase_gui", {
  6688. gui_action: "prev_highlight"
  6689. }),
  6690. i.prevHighlight()
  6691. }),
  6692. $(".next").find("a").on("click", function(e) {
  6693. y(e),
  6694. R.trackAlways("showcase_gui", {
  6695. gui_action: "next_highlight"
  6696. }),
  6697. i.nextHighlight()
  6698. }),
  6699. $("#drawer").on("mouseleave", function(t) {
  6700. var i;
  6701. y(t);
  6702. try {
  6703. i = new MouseEvent("mouseup",{
  6704. clientX: t.clientX,
  6705. clientY: t.clientY,
  6706. screenX: t.screenX,
  6707. screenY: t.screenY
  6708. })
  6709. } catch (e) {
  6710. (i = document.createEvent("MouseEvents")).initMouseEvent("mouseup", t.bubbles, t.cancelable, t.view, t.detail, t.screenX, t.screenY, t.clientX, t.clientY, t.ctrlKey, t.altKey, t.shiftKey, t.metaKey, t.button, t.relatedTarget)
  6711. }
  6712. document.dispatchEvent(i)
  6713. }),
  6714. (w = new Sly($("#scrollFrame"),{
  6715. horizontal: !0,
  6716. itemNav: "centered",
  6717. smart: !0,
  6718. scrollTrap: !0,
  6719. scrollBy: 1,
  6720. mouseDragging: !0,
  6721. touchDragging: !0,
  6722. speed: 300,
  6723. dragHandle: !0,
  6724. dynamicHandle: !0,
  6725. clickBar: !0,
  6726. scrollBar: $("#scroller"),
  6727. activateOn: null
  6728. }).init()).on("active", function(e, t) {
  6729. t,
  6730. _e("tour"),
  6731. $(".step").removeClass("active"),
  6732. $("#status").find(".curIdx").text(t + 1);
  6733. for (var i = 0; i <= t; i++)
  6734. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6735. }),
  6736. E()
  6737. //add :
  6738. let scrollFrame = $(w.frame)
  6739. scrollFrame.on("wheel.sly", function() {
  6740. lastMoveScrollTime = Date.now()
  6741. })
  6742. let dragstart
  6743. /* scrollFrame.on("pointerdown", function() {
  6744. dragstart = true
  6745. })
  6746. scrollFrame.on("pointerup", function() {
  6747. dragstart = false
  6748. }) */
  6749. scrollFrame.on("pointermove", function() {
  6750. //if(dragstart){
  6751. lastMoveScrollTime = Date.now()
  6752. //}
  6753. })
  6754. }(s, l, c) : (Ce.highlight.visible = !1,
  6755. Ce.tourControls.visible = !1),
  6756. z.on(G.OPEN_INFO, _e.bind(this, "info")),
  6757. function() {
  6758. var n;
  6759. document.body.addEventListener("mousedown", function(e) {
  6760. n = 0 === e.button || 1 === e.which ? e.target : null
  6761. }, !0),
  6762. document.body.addEventListener("mouseup", function(t) {
  6763. n !== t.target && (n = b(n, t.target));
  6764. var e = document.getElementById("gui-parent");
  6765. if (b(e, n) !== e && (n = null),
  6766. n) {
  6767. var i;
  6768. try {
  6769. i = new MouseEvent("click",t)
  6770. } catch (e) {
  6771. (i = document.createEvent("MouseEvents")).initMouseEvent("click", t.bubbles, t.cancelable, t.view, t.detail, t.screenX, t.screenY, t.clientX, t.clientY, t.ctrlKey, t.altKey, t.shiftKey, t.metaKey, t.button, t.relatedTarget)
  6772. }
  6773. i.syntheticClick = !0,
  6774. n.dispatchEvent(i),
  6775. n = null
  6776. }
  6777. }, !0),
  6778. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6779. e.syntheticClick || (e.stopPropagation(),
  6780. "A" === e.target.nodeName && e.preventDefault())
  6781. }, !0)
  6782. }(),
  6783. A(c),
  6784. C(s, t),
  6785. s.on("floor.changed", I),
  6786. s.on("waiting", function(e) {
  6787. _(e)
  6788. }
  6789. .bind(this, s)),
  6790. s.on("waiting-done", function(e) {
  6791. _(e)
  6792. }
  6793. .bind(this, s)),
  6794. c.on(re.ModeChanged, function(e, t) {
  6795. A(c),
  6796. v(l, c),
  6797. t === ie.PANORAMA && c.currentPano && !c.currentPano.isAligned() && (t = ie.OUTDOOR),
  6798. U.updateMode(t)
  6799. }),
  6800. e.on(oe.Move, _e.bind(this, "move")),
  6801. c.on(re.Ready, function() {
  6802. O.init(e, c, c.tagManager, l),
  6803. c.on(re.ModeChanged, function(e, t) {
  6804. e !== t && $(".vr-popup").is(":visible") && X.dismiss()
  6805. })
  6806. }),
  6807. c.on(re.PanoChosen, function(e, t) {
  6808. A(c, t),
  6809. U.updateMode(t && !t.isAligned() ? ie.OUTDOOR : ie.PANORAMA)
  6810. }),
  6811. V.on(k.CLOSE, function(e) {
  6812. switch (e) {
  6813. case "vr-modal":
  6814. X.dismiss();
  6815. break;
  6816. case "share-modal":
  6817. K.hide();
  6818. break;
  6819. case "terms-modal":
  6820. W.hide()
  6821. }
  6822. });
  6823. var lastMoveScrollTime = 0;//add
  6824. var o, h = $("#play").eq(0), u = $("#pause").eq(0), d = $(".pinBottom").toArray(), p = $("#drawer").eq(0), f = $("#playHead").eq(0), a = $("#progressBar").eq(0), g = $("#thumb-container").eq(0).children(), m = a.children();
  6825. l.on("update.controls", function() {
  6826. var e, t, i, n = l.describe();
  6827. if (n.tourIsPlaying || c.isWarping() ? (Ce.tourControls.visible && (h.hide(),
  6828. u.show()),
  6829. n.tourInProgress && (d.forEach(function(e) {
  6830. e.classList.add("playing")
  6831. }),
  6832. p.addClass("playing"),
  6833. f.addClass("playing"))) : (Ce.tourControls.visible && (h.show(),
  6834. u.hide()),
  6835. n.tourInProgress || (q.stopTour(),
  6836. d.forEach(function(e) {
  6837. e.classList.remove("playing")
  6838. }),
  6839. p.removeClass("playing"),
  6840. f.removeClass("playing"))),
  6841. null !== n.currentItem) {
  6842. var r, o;
  6843. $("#status").find(".curIdx").text(n.currentItem[0] + 1),
  6844. n.onTheBus ? (r = "active",
  6845. o = "recent") : (o = "active",
  6846. r = "recent");
  6847. var a = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
  6848. for (e = 0; e < s.heroLocations.length; e += 1)
  6849. i = g.eq(e),
  6850. t = m.eq(e),
  6851. i.removeClass(o),
  6852. t.removeClass(o),
  6853. n.onTheBus && e === n.destinationItem[0] ? (i.addClass(r),
  6854. t.addClass(r),
  6855. // 如果一段时间内用户不拖拽滚动scroll,才focus回这个item
  6856. (Date.now() - lastMoveScrollTime > 2000) && w.activate(e)
  6857. ): n.onTheBus && a && e === n.currentItem[0] ? (i.addClass(r),
  6858. t.addClass(r)) : (i.removeClass(r),
  6859. t.removeClass(r))
  6860. } else
  6861. for (e = 0; e < s.heroLocations.length; e += 1)
  6862. i = g.eq(e),
  6863. t = m.eq(e),
  6864. i.removeClass("active recent"),
  6865. t.removeClass("active recent");
  6866. v(l, c)
  6867. }),
  6868. document.addEventListener("keydown", function(e) {
  6869. switch (R.updateInteraction(oe.InteractionKey),
  6870. e.which) {
  6871. case te.ZERO:
  6872. M.debug && s.toggleAlpha();
  6873. break;
  6874. case te.NINE:
  6875. M.debug && B.toggle();
  6876. break;
  6877. case te.ONE:
  6878. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.PANORAMA);
  6879. break;
  6880. case te.TWO:
  6881. s.outsideAllowed() && !c.isInMode(ie.DOLLHOUSE, ie.TRANSITIONING) && l.changeMode(ie.DOLLHOUSE);
  6882. break;
  6883. case te.THREE:
  6884. s.outsideAllowed() && !c.isInMode(ie.FLOORPLAN, ie.TRANSITIONING) && l.changeMode(ie.FLOORPLAN);
  6885. break;
  6886. case te.FOUR:
  6887. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.OUTDOOR);
  6888. break;
  6889. case te.SPACE:
  6890. Ce.tourControls.visible && ($("#playHead").hasClass("playing") || _e("tour"));
  6891. break;
  6892. case te.RETURN:
  6893. M.debug && s.toggleExplodeUp();
  6894. break;
  6895. case te.P:
  6896. !function(e) {
  6897. me.gui || (me.gui = function(e) {
  6898. var t = new he.GUI;
  6899. return t.add(M, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6900. e.setSweepVisibility(M.showSweeps)
  6901. }),
  6902. t.add(M, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6903. t.add(M.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6904. M.transition.flySpeed = 0,
  6905. t.__controllers.forEach(function(e) {
  6906. e.updateDisplay()
  6907. })
  6908. }),
  6909. t.add(M.path, "opacity", 0, 1).name("Path opacity"),
  6910. $(t.__closeButton).hide(),
  6911. t
  6912. }(me.model)),
  6913. (me.visible = e) ? $(me.gui.domElement).show() : $(me.gui.domElement).hide()
  6914. }(!me.visible);
  6915. break;
  6916. case te.U:
  6917. !function(e) {
  6918. ve.gui || (ve.gui = function(t, i) {
  6919. function e() {
  6920. var e = i.toJSON();
  6921. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + t.sid + "&start=" + ee.serialize(e),
  6922. i.tagManager.activeTag && (n.linkToLocation += "&tag=" + i.tagManager.activeTag.sid)
  6923. }
  6924. var n = {}
  6925. , r = new he.GUI({
  6926. autoPlace: !0,
  6927. width: "60%"
  6928. });
  6929. return e(),
  6930. i.on(re.ViewChanged, e),
  6931. r.add(n, "linkToLocation").name(se.LINK_TO_LOCATION).listen(),
  6932. r.domElement.id = "datLinks",
  6933. [].slice.call(r.domElement.querySelectorAll(".property-name")).forEach(function(e) {
  6934. if (!S.detectSafari()) {
  6935. var t = document.createElement("button");
  6936. t.classList.add("btn-deep-link"),
  6937. t.innerText = se.MENU_COPY,
  6938. e.nextSibling.appendChild(t);
  6939. var n = function() {
  6940. alert(se.LINK_ALERT_COPY),
  6941. t.hide()
  6942. };
  6943. t.addEventListener("click", function(e) {
  6944. try {
  6945. var t = e.target.parentNode.childNodes[0];
  6946. t.select();
  6947. var i = document.execCommand("copy");
  6948. t.blur(),
  6949. i || n()
  6950. } catch (e) {
  6951. n()
  6952. }
  6953. })
  6954. }
  6955. }),
  6956. $(r.__closeButton).hide(),
  6957. r
  6958. }(ve.model, ve.player)),
  6959. (ve.visible = e) ? $(ve.gui.domElement).show() : $(ve.gui.domElement).hide()
  6960. }(!ve.visible);
  6961. break;
  6962. case te.X:
  6963. M.debug && s.toggleExplode();
  6964. break;
  6965. case te.PLUSEQUALS:
  6966. l.player.activatePersistentZooming(!0),
  6967. O.hideUi();
  6968. break;
  6969. case te.DASHUNDERSCORE:
  6970. l.player.activatePersistentZooming(!1),
  6971. O.hideUi();
  6972. break;
  6973. case te.SEVEN:
  6974. ue.info("Zoom level: " + l.player.zoomLevel + ", FOV: " + l.player.zoomFov);
  6975. break;
  6976. case te.EIGHT:
  6977. l.player.decreaseZoomSpeed();
  6978. break;
  6979. case te.NINE:
  6980. l.player.increaseZoomSpeed()
  6981. }
  6982. return c && c.reticule.hide(),
  6983. !0
  6984. }
  6985. .bind(this)),
  6986. document.addEventListener("keyup", function(e) {
  6987. switch (e.which) {
  6988. case te.PLUSEQUALS:
  6989. l.player.deactivatePersistentZooming();
  6990. break;
  6991. case te.DASHUNDERSCORE:
  6992. l.player.deactivatePersistentZooming()
  6993. }
  6994. }
  6995. .bind(this)),
  6996. function(e) {
  6997. me = {
  6998. gui: null,
  6999. visible: !1,
  7000. model: e
  7001. }
  7002. }(s),
  7003. function(e, t) {
  7004. ve = {
  7005. gui: null,
  7006. visible: !1,
  7007. model: e,
  7008. player: t
  7009. }
  7010. }(s, l.player),
  7011. function(e) {
  7012. function t(e, i) {
  7013. $(e).find("a").each(function(e, t) {
  7014. i ? $(t).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(t).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  7015. t.style.pointerEvents = i ? "auto" : "none"
  7016. })
  7017. }
  7018. e.on(de.ZoomMax, function() {
  7019. t("#gui-zoomin", !1),
  7020. t("#gui-zoomout", !0)
  7021. }),
  7022. e.on(de.ZoomMin, function() {
  7023. t("#gui-zoomin", !0),
  7024. t("#gui-zoomout", !1)
  7025. }),
  7026. e.on(de.ZoomIn, function() {
  7027. t("#gui-zoomout", !0)
  7028. }),
  7029. e.on(de.ZoomOut, function() {
  7030. t("#gui-zoomin", !0)
  7031. }),
  7032. e.zoomLevel >= M.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  7033. e.zoomLevel <= M.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  7034. }(c),
  7035. P.setAutoPlay(s.heroCount()),
  7036. U.init(c, i.mode),
  7037. U.on(H.OPENED, _e.bind(this, "help")),
  7038. W.init(),
  7039. W.on(j.OPENED, (o = document.getElementById("terms-modal"),
  7040. function() {
  7041. _e("terms"),
  7042. V.open(o)
  7043. }
  7044. )),
  7045. W.on(j.CLOSED, V.reset),
  7046. M.quickstart.enabled || D.delayLanding(i.mode).then(D.showMessage.bind(this, c, l, Ce.coBrand.visible)),
  7047. (M.quickstart.enabled || c.model.outsideAllowed()) && O.init(e, c, c.tagManager, l),
  7048. M.profiling.enabled && B.show(),
  7049. q.init(l)
  7050. }
  7051. ,
  7052. Le.exports.startLoading = function(e, t, i, n, r, o) {
  7053. function a() {
  7054. o.setLoadingStartTime(),
  7055. function() {
  7056. function e(e) {
  7057. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)
  7058. }
  7059. $("body").css("touch-action", "none"),
  7060. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {});
  7061. var t = document.getElementById("terms-text")
  7062. , i = document.getElementById("more-help-wrapper")
  7063. , n = (document.getElementById("navigation-help-wrapper"),
  7064. document.getElementById("help-dialog"),
  7065. document.getElementById("tag-billboards"));
  7066. M.useWheel && (document.body.addEventListener("mousewheel", e, {
  7067. passive: !1
  7068. }),
  7069. document.body.addEventListener("DOMMouseScroll", e)),
  7070. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  7071. e.stopPropagation()
  7072. })
  7073. }(),
  7074. r ? (D.showMessage(t, i, Ce.coBrand.visible),
  7075. l()) : function(e) {
  7076. L.show(e),
  7077. c()
  7078. }(l)
  7079. }
  7080. var s = $.Deferred()
  7081. , l = s.resolve.bind(s);
  7082. ye = !0,
  7083. _(e);
  7084. e.data.player_options && function(e) {
  7085. Ce.tourControls.visible = true//e.tour_buttons && S.valueFromHash("gt", 1),
  7086. Ce.coBrand.visible = e.presented_by && 1 !== M.specialEdition && M.brand && !S.valueFromHash("mls", !1),
  7087. Ce.highlight.visible = /* e.highlight_reel && */ 1 !== M.specialEdition && M.showHighlights
  7088. }(e.data.player_options),
  7089. 1 === M.specialEdition && $("body").addClass("specialEdition");
  7090. se.localizeGUI();
  7091. !function(i) {
  7092. function e(e, t) {
  7093. return !!i.player_options[e] && i[t || e]
  7094. }
  7095. $(".model-title").text(i.name);
  7096. var t = M.pageTitle;
  7097. 2 !== S.valueFromHash("mls", 0) && i.name && (t = i.name),
  7098. document.title = t,
  7099. S.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  7100. delay: {
  7101. show: 50,
  7102. hide: 0
  7103. },
  7104. trigger: "hover",
  7105. html: !1,
  7106. viewport: {
  7107. selector: "body",
  7108. padding: 10
  7109. }
  7110. }),
  7111. S.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  7112. z.populate({
  7113. name: e("model_name", "name"),
  7114. coBrand: e("presented_by"),
  7115. description: e("model_summary", "summary") || "暂无内容",
  7116. contactName: e("contact_name"),
  7117. address: e("address"),
  7118. phone: e("contact_phone"),
  7119. formattedPhone: i.formatted_contact_phone,
  7120. email: e("contact_email"),
  7121. url: e("external_url"),
  7122. socialSharing: i.enable_social_sharing && i.is_public
  7123. })
  7124. }(e.data);
  7125. r || $(".quick").addClass("hidden");
  7126. n ? (R.impression(),
  7127. a()) : (o.setWaitingStartTime(),
  7128. N.show(r, a))
  7129. return s
  7130. }
  7131. ,
  7132. Le.exports.endLoading = function(e, t, i) {
  7133. var n = t.player;
  7134. function r() {
  7135. i.dismissExaminedTag(),
  7136. i.disableHovering()
  7137. }
  7138. $("#gui-thumb").fadeOut(2500),
  7139. L.hide(function() {
  7140. ye = !1
  7141. }),
  7142. Y.init(e, i),
  7143. z.finishSetup(Object.keys(e.tags).length),
  7144. i.on(ne.IMAGE_OPENED, _e.bind(this, "tag")),
  7145. X.on(Z.OPENED, r),
  7146. K.on(ae.OPENED, r),
  7147. U.on(H.OPENED, r),
  7148. W.on(j.OPENED, r);
  7149. var o = i.enableHovering.bind(i);
  7150. if (X.on(Z.CLOSED, o),
  7151. K.on(ae.CLOSED, o),
  7152. U.on(H.CLOSED, o),
  7153. W.on(j.CLOSED, o),
  7154. M.labels.enabled && Object.keys(e.labels).length,
  7155. e.floors.length <= 1 || !Ce.floors.visible ? Ce.floors.visible = !1 : (h(e, t),
  7156. I(e.currentFloor, n.mode)),
  7157. "372" === getQueryVariable("m") && (Ce.floors.visible = 1,
  7158. h(e, t)),
  7159. c(),
  7160. v(t, t.player),
  7161. $("#gui").fadeIn(1500),
  7162. Ce.highlight.visible && (2 !== M.startHighlights || e.has360Views) && setTimeout(function() {
  7163. l(),
  7164. (!e.has360Views && 1 !== M.startHighlights || e.has360Views && 0 === M.startHighlights) && setTimeout(l, 2e3)
  7165. }, 2e3),
  7166. !S.isMobile())
  7167. for (var a = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], s = 0; s < a.length; s++)
  7168. $(a[s]).addClass("hasHover");
  7169. _(e),
  7170. z.setupToggling(),
  7171. window.editHotPanel && editHotPanel(),
  7172. function() {
  7173. var i = $("#pullTab")
  7174. , e = {
  7175. bottom: {
  7176. "border-bottom-left-radius": "10px",
  7177. "border-bottom-right-radius": "10px"
  7178. },
  7179. top: {
  7180. "border-top-left-radius": "10px",
  7181. "border-top-right-radius": "10px"
  7182. }
  7183. }
  7184. , t = {
  7185. bottom: {
  7186. "border-top-right-radius": "10px",
  7187. "border-bottom-right-radius": "10px"
  7188. },
  7189. top: {
  7190. "border-bottom-left-radius": "10px",
  7191. "border-top-left-radius": "10px"
  7192. }
  7193. };
  7194. function n(e, t) {
  7195. $("#gui-modes-map > div:visible:last").css(e),
  7196. i.is(":visible") ? $(".viewContainer > div:visible:first").css(t) : $("#gui-modes-map > div:visible:first").css(t)
  7197. }
  7198. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n(e.bottom, e.top) : n(t.bottom, t.top);
  7199. (window.DATA.model.special || "true" === window.DATA.special) && window.specialScene && specialScene.special().afterImplement()
  7200. }()
  7201. $(".toolRight a").removeClass('hasHover')
  7202. }
  7203. ,
  7204. Le.exports.onProgress = function(e) {
  7205. L.progress(e)
  7206. }
  7207. }
  7208. ).call(this, "/js/gui/gui.js")
  7209. }
  7210. , {
  7211. "../analytics": 4,
  7212. "../controls/serializer": 14,
  7213. "../enum/AlignmentType": 17,
  7214. "../enum/BlackoutStyle": 18,
  7215. "../enum/ControlEvents": 21,
  7216. "../enum/DirectorEvents": 23,
  7217. "../enum/Keys": 30,
  7218. "../enum/PathDiscardMode": 38,
  7219. "../enum/PathDisplayMode": 39,
  7220. "../enum/PlayerEvents": 40,
  7221. "../enum/VROption": 47,
  7222. "../enum/Vectors": 50,
  7223. "../enum/Viewmode": 51,
  7224. "../enum/WarpStyle": 52,
  7225. "../enum/ZoomEvents": 53,
  7226. "../lib/dat.gui": 93,
  7227. "../localization/localize": 108,
  7228. "../tag/Media/MediaEvent": 131,
  7229. "../objects/Snapshot": 153,
  7230. "../settings": 166,
  7231. "../util/ajax": 181,
  7232. "../util/browser": 182,
  7233. "../util/camera": 183,
  7234. "../util/logger": 189,
  7235. "../util/showcase": 193,
  7236. "../util/transitions": 195,
  7237. "./closer/ModalCloserEvent": 61,
  7238. "./closer/modalCloser": 62,
  7239. "./help/HelpEvent": 66,
  7240. "./help/help": 67,
  7241. "./helpManager": 68,
  7242. "./immersiveMode": 69,
  7243. "./konami": 70,
  7244. "./landingScreen": 71,
  7245. "./loadingScreen": 72,
  7246. "./memoryUsage": 73,
  7247. "./playButton": 74,
  7248. "./populateModal": 75,
  7249. "./sharing/ShareEvents": 76,
  7250. "./sharing/modal": 77,
  7251. "./terms/TermsEvent": 78,
  7252. "./terms/terms": 79,
  7253. "./title/TitleEvents": 80,
  7254. "./title/tagToggle": 81,
  7255. "./title/titleBar": 82,
  7256. "./tourInteraction": 84,
  7257. "./vr/vrEvent": 85,
  7258. "./vr/vrModal": 87,
  7259. "./webvr/WebVrEvent": 88,
  7260. "./webvr/webVRgui": 89,
  7261. three: 217
  7262. }],
  7263. 66: [function(e, t, i) {
  7264. "use strict";
  7265. t.exports = Object.freeze({
  7266. OPENED: "help.opened",
  7267. CLOSED: "help.closed"
  7268. })
  7269. }
  7270. , {}],
  7271. 67: [function(e, t, i) {
  7272. "use strict";
  7273. function n() {
  7274. p.on("click", function(e) {
  7275. T && T !== a.TRANSITIONING && (0 < window.getComputedStyle(v).getPropertyValue("opacity") && !x ? S.close() : T && T !== a.TRANSITIONING && (x = !0,
  7276. setTimeout(function() {
  7277. x = !1
  7278. }, h.help.modalStayDuration),
  7279. S.emit(l.OPENED),
  7280. f.addClass("open " + T),
  7281. p.addClass("open"),
  7282. o(),
  7283. r(),
  7284. v.style.removeProperty ? v.style.removeProperty("display") : v.style.removeAttribute("display"),
  7285. v.classList.add("fadeIn")))
  7286. }),
  7287. E.on("click", function(e) {
  7288. S.close()
  7289. }),
  7290. C.on("click", function(e) {
  7291. T && T !== a.TRANSITIONING && (o(),
  7292. r())
  7293. }),
  7294. I.on("click", function(e) {
  7295. o(),
  7296. I.addClass("underline-tab"),
  7297. c.fill(b, s.MORE_HELP),
  7298. f.addClass("more-help")
  7299. })
  7300. }
  7301. function r() {
  7302. C.addClass("underline-tab"),
  7303. c.fill(_, s.NAVIGATION, T),
  7304. f.addClass(T)
  7305. }
  7306. function o() {
  7307. f.removeClass("more-help " + a.PANORAMA + " " + a.DOLLHOUSE + " " + a.FLOORPLAN + " " + a.OUTDOOR),
  7308. A.forEach(function(e) {
  7309. e.classList.remove("underline-tab")
  7310. })
  7311. }
  7312. var a = e("../../enum/Viewmode")
  7313. , s = e("../../enum/HelpModalType")
  7314. , l = e("./HelpEvent")
  7315. , c = (e("../helpManager"),
  7316. e("./../populateModal"))
  7317. , h = e("../../settings")
  7318. , u = e("../../util/common")
  7319. , d = e("events").EventEmitter
  7320. , p = $(".footer-help").eq(0)
  7321. , f = $("#help-dialog").eq(0)
  7322. , g = document.querySelector("#quick-logo")
  7323. , m = document.querySelector("#loaderCoBrand")
  7324. , v = document.querySelector("#help-dialog")
  7325. , y = document.querySelector(".footer")
  7326. , A = $(".help-tabs").children().toArray()
  7327. , C = $(".navigation-tab").eq(0)
  7328. , I = $(".more-help-tab").eq(0)
  7329. , E = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7330. f.find(".close").eq(0))
  7331. , _ = f.find(".interactions").toArray()
  7332. , b = f.find(".ui-instructions").toArray()
  7333. , w = a.PANORAMA
  7334. , T = a.PANORAMA
  7335. , x = !1
  7336. , S = {
  7337. init: function(e, t) {
  7338. w = T = t,
  7339. [v, m, g, y].forEach(function(e) {
  7340. e.classList.add(c.deviceType)
  7341. }),
  7342. n()
  7343. },
  7344. close: function() {
  7345. if (f.hasClass("open") && (this.emit(l.CLOSED),
  7346. p.removeClass("open"),
  7347. f.removeClass("open"),
  7348. v.classList.contains("fadeIn"))) {
  7349. v.classList.remove("fadeIn");
  7350. var e = T === a.TRANSITIONING ? w : T;
  7351. c.clear(_, s.NAVIGATION, e)
  7352. }
  7353. },
  7354. updateMode: function(e) {
  7355. w = T,
  7356. T = e
  7357. }
  7358. };
  7359. u.extendObject(S, d.prototype),
  7360. t.exports = S
  7361. }
  7362. , {
  7363. "../../enum/HelpModalType": 28,
  7364. "../../enum/Viewmode": 51,
  7365. "../../settings": 166,
  7366. "../../util/common": 185,
  7367. "../helpManager": 68,
  7368. "./../populateModal": 75,
  7369. "./HelpEvent": 66,
  7370. events: 202
  7371. }],
  7372. 68: [function(s, l, e) {
  7373. (function(e) {
  7374. "use strict";
  7375. var t = s("../util/browser")
  7376. , i = s("./../util/logger")
  7377. , n = s("./../settings")
  7378. , r = new i(e)
  7379. , o = function() {
  7380. var t;
  7381. try {
  7382. return t = window.localStorage.getItem("visitCount") || "0",
  7383. t = (parseFloat(t) + 1).toString(),
  7384. window.localStorage.setItem("visitCount", t),
  7385. r.debug("visitCount = " + t),
  7386. t
  7387. } catch (e) {
  7388. t = "1",
  7389. r.debug("couldn't set local storage")
  7390. }
  7391. }()
  7392. , a = !1;
  7393. l.exports = {
  7394. isHelpDisabled: function() {
  7395. return "0" === t.valueFromHash("help", null) || a
  7396. },
  7397. isLargeHelpEnabled: function() {
  7398. return ("1" === o || "1" === t.valueFromHash("help", null)) && !this.isHelpDisabled()
  7399. },
  7400. isSmallHelpEnabled: function() {
  7401. return "2" === t.valueFromHash("help", null) && !this.isHelpDisabled()
  7402. },
  7403. isHelpEnabled: function() {
  7404. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7405. },
  7406. setAutoPlay: function(e) {
  7407. a = 0 <= n.warp.auto && 1 < e
  7408. }
  7409. }
  7410. }
  7411. ).call(this, "/js/gui/helpManager.js")
  7412. }
  7413. , {
  7414. "../util/browser": 182,
  7415. "./../settings": 166,
  7416. "./../util/logger": 189
  7417. }],
  7418. 69: [function(e, t, i) {
  7419. "use strict";
  7420. function r(e) {
  7421. M || n(e) && C.hasClass("playing") || (clearTimeout(x),
  7422. T = !0,
  7423. h.close(),
  7424. function(e) {
  7425. !n(e) && S ? v.forEach(function(e) {
  7426. e.classList.remove("drawerOpen"),
  7427. e.classList.add("duringTour")
  7428. }) : C.hasClass("open") ? v.forEach(function(e) {
  7429. e.classList.remove("duringTour"),
  7430. e.classList.add("drawerOpen")
  7431. }) : P || R === g.FLOORPLAN || R === g.DOLLHOUSE || v.forEach(function(e) {
  7432. e.classList.add("fadeOut")
  7433. })
  7434. }(e),
  7435. R !== g.DOLLHOUSE && R !== g.FLOORPLAN && (E.hasClass("expand") && !_.hasClass("closed") || l.valueFromHash("title", 1),
  7436. C.hasClass("playing") || (y.forEach(function(e) {
  7437. e.classList.add("detectHover")
  7438. }),
  7439. x = setTimeout(a, c.immersive.timeToShowAgain))))
  7440. }
  7441. function o() {
  7442. C.hasClass("playing") || (clearTimeout(x),
  7443. x = setTimeout(a, c.immersive.timeToShowAgain))
  7444. }
  7445. function a() {
  7446. clearTimeout(x),
  7447. T = !1,
  7448. m.forEach(function(e) {
  7449. e.classList.remove("drawerOpen")
  7450. }),
  7451. S || v.forEach(function(e) {
  7452. e.classList.remove("duringTour")
  7453. }),
  7454. y.forEach(function(e) {
  7455. e.classList.remove("detectHover")
  7456. })
  7457. }
  7458. function s() {
  7459. T ? a() : r(),
  7460. M = !0,
  7461. setTimeout(function() {
  7462. M = !1
  7463. }, c.immersive.uiStayDuration)
  7464. }
  7465. function n(e) {
  7466. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7467. }
  7468. var l = e("../util/browser")
  7469. , c = e("../settings")
  7470. , h = e("./help/help")
  7471. , u = e("../enum/tagEvents")
  7472. , d = e("../enum/ControlEvents")
  7473. , p = e("../enum/PlayerEvents")
  7474. , f = e("../enum/DirectorEvents")
  7475. , g = (p = e("../enum/PlayerEvents"),
  7476. e("../enum/Viewmode"))
  7477. , m = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7478. , v = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7479. , y = $("#hover-bottom, #hover-top").toArray()
  7480. , A = ($("#pullTab").eq(0),
  7481. $("#playHead").eq(0),
  7482. $(".pinBottom-container").eq(0))
  7483. , C = $("#drawer").eq(0)
  7484. , I = $("#drawer-container").eq(0)
  7485. , E = $("#meta-info").eq(0)
  7486. , _ = $(".pinTop.left").eq(0)
  7487. , b = $("#player").eq(0)
  7488. , w = document.getElementById("pullTab")
  7489. , T = !1
  7490. , x = null
  7491. , S = !1
  7492. , M = !1
  7493. , R = null
  7494. , P = !1;
  7495. t.exports.init = function(e, t, i, n) {
  7496. (function(t, i, e, n) {
  7497. [g.PANORAMA, g.DOLLHOUSE, g.FLOORPLAN].forEach(function(e) {
  7498. t.controls[e].on(d.Move, r),
  7499. t.controls[e].on(d.LongTap, s)
  7500. }),
  7501. b.on("mousewheel DOMMouseScroll", r),
  7502. e.on(u.TagActivated, r),
  7503. e.on(u.TagNavigation, r),
  7504. i.on(p.FlyingEnded, o),
  7505. i.on(p.ModeChanging, function(e, t) {
  7506. P = t !== g.PANORAMA && e !== g.PANORAMA
  7507. }),
  7508. i.on(p.ModeChanged, function(e, t) {
  7509. R = i.mode,
  7510. t !== g.TRANSITIONING ? a() : r("modeChange")
  7511. }),
  7512. n.on(f.TourStart, function() {
  7513. S = !0,
  7514. r()
  7515. }),
  7516. n.on(f.TourEnd, function() {
  7517. S = !1,
  7518. a()
  7519. }),
  7520. n.on(f.ActionInterrupted, function() {
  7521. S = !1
  7522. }),
  7523. w.addEventListener("touchend", function() {
  7524. $("#pullTab").hasClass("opened") && !S && a()
  7525. }, !0)
  7526. }
  7527. )(e, t, i, n),
  7528. l.isMobile() ? (y.forEach(function(e) {
  7529. e.classList.add("mobile")
  7530. }),
  7531. A.click(a)) : (y.forEach(function(e) {
  7532. e.addEventListener("mouseleave", function() {
  7533. !b.is(":hover") && y[0].classList.contains("detectHover") && a()
  7534. }, !0)
  7535. }),
  7536. b.mouseleave(function() {
  7537. y[0].classList.contains("detectHover") && a()
  7538. })),
  7539. R = t.mode
  7540. }
  7541. ,
  7542. t.exports.hideUi = r,
  7543. t.exports.resetDrawer = function() {
  7544. I.hasClass("duringTour") || (S = !1,
  7545. r("gui"),
  7546. a())
  7547. }
  7548. }
  7549. , {
  7550. "../enum/ControlEvents": 21,
  7551. "../enum/DirectorEvents": 23,
  7552. "../enum/tagEvents": 32,
  7553. "../enum/PlayerEvents": 40,
  7554. "../enum/Viewmode": 51,
  7555. "../settings": 166,
  7556. "../util/browser": 182,
  7557. "./help/help": 67
  7558. }],
  7559. 70: [function(i, n, e) {
  7560. (function(e) {
  7561. "use strict";
  7562. var t = i("./../util/logger")
  7563. , o = i("./../settings")
  7564. , a = i("./debug")
  7565. , s = i("./../util/common")
  7566. , l = (i("./gui"),
  7567. new t(e));
  7568. o.console && $("body").append('<div id="debug-console"></div>'),
  7569. n.exports.init = function(i, n, r) {
  7570. l.debug("konami has the modelInstance");
  7571. var t = [];
  7572. $(window).on("keydown", function(e) {
  7573. t.push(e.which),
  7574. t.length > o.secretPanelWord.length && t.shift(),
  7575. s.equalLists(t, o.secretPanelWord) && (l.debug("Developer mode active."),
  7576. o.debug = !0)
  7577. }),
  7578. $(window).on("keydown", function e(t) {
  7579. o.debug && 72 === t.which && (i && r ? (a.toggle(i, n, r),
  7580. $(window).off("keydown", e)) : console.warn("sorry we're not ready yet"))
  7581. })
  7582. }
  7583. }
  7584. ).call(this, "/js/gui/konami.js")
  7585. }
  7586. , {
  7587. "./../settings": 166,
  7588. "./../util/common": 185,
  7589. "./../util/logger": 189,
  7590. "./debug": 63,
  7591. "./gui": 65
  7592. }],
  7593. 71: [function(e, t, i) {
  7594. "use strict";
  7595. function r() {
  7596. s.clear(m, l.LANDING[v]),
  7597. g.removeClass("fadeIn")
  7598. }
  7599. var o = e("../settings")
  7600. , a = (e("./help/help"),
  7601. e("./helpManager"))
  7602. , s = e("./populateModal")
  7603. , l = e("../enum/HelpModalType")
  7604. , n = e("../enum/Viewmode")
  7605. , c = e("../enum/DirectorEvents")
  7606. , h = e("../enum/PlayerEvents")
  7607. , u = $("#quick-blackout").eq(0)
  7608. , d = $("#quick-logo").eq(0)
  7609. , p = $(".quick-brand").toArray()
  7610. , f = $("#loaderCoBrand").eq(0)
  7611. , g = $("#interaction-modal").eq(0)
  7612. , m = g.find(".interaction").toArray()
  7613. , v = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7614. "");
  7615. t.exports.delayLanding = function(e) {
  7616. var t = $.Deferred();
  7617. e || t.resolve();
  7618. var i = o.startupFlyinDelay;
  7619. return e === n.PANORAMA && (i += o.dollhouse.transitionTime),
  7620. setTimeout(t.resolve.bind(t), i),
  7621. t
  7622. }
  7623. ,
  7624. t.exports.showMessage = function(e, t, i) {
  7625. var n = 0;
  7626. o.quickstart.enabled && (function(e) {
  7627. /* e && (f.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7628. d.before(f),
  7629. p = $(".quick-brand").toArray()), */
  7630. u.addClass("fadeOut")
  7631. /* setTimeout(function() {
  7632. p.forEach(function(e) {
  7633. e.classList.add("fadeIn")
  7634. })
  7635. }, o.quickstart.showTextDelay),
  7636. setTimeout(function() {
  7637. p.forEach(function(e) {
  7638. e.classList.add("fadeOut")
  7639. })
  7640. }, o.quickstart.fadeOutDelay) */
  7641. }(i),
  7642. n = o.quickstart.showTextDelay + o.quickstart.fadeOutDelay),
  7643. function(e, t) {
  7644. setTimeout(function() {
  7645. if (a.isHelpEnabled()) {
  7646. if (t(),
  7647. s.init(),
  7648. g.addClass("fadeIn landing " + s.deviceType),
  7649. a.isSmallHelpEnabled())
  7650. return void g.addClass("small");
  7651. s.fill(m, l.LANDING[v]),
  7652. g.addClass(v)
  7653. }
  7654. }, e);
  7655. var i = {
  7656. pc: ["images/pc_step1.png", "images/pc_step2.png", "images/pc_step3.png"],
  7657. mobile: ["images/phone_step1.png", "images/phone_step2.png", "images/phone_step3.png"]
  7658. }
  7659. , n = $(".nav-icon .icon");
  7660. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) && n.attr("src", i.mobile[0]);
  7661. function r(e) {
  7662. e.on("click", function() {
  7663. var e = null;
  7664. if (e = "plus" == $(this).attr("data-id") ? +n.attr("data-page") + 1 : +n.attr("data-page") - 1,
  7665. i.length < e || e < 1)
  7666. return !1;
  7667. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n.attr({
  7668. "data-page": e,
  7669. src: i.mobile[e - 1]
  7670. }) : n.attr({
  7671. "data-page": e,
  7672. src: i.pc[e - 1]
  7673. })
  7674. })
  7675. }
  7676. r($(".next-button")),
  7677. r($(".prev-button"))
  7678. }(n, function() {
  7679. e.once(h.Move, r),
  7680. t.once(c.TourStart, r)
  7681. })
  7682. }
  7683. ,
  7684. t.exports.init = function(e, t) {
  7685. v = t.mode === n.PANORAMA && t.pano && !t.pano.isAligned() ? n.OUTDOOR : t.mode
  7686. }
  7687. ,
  7688. t.exports.dismissModal = r
  7689. }
  7690. , {
  7691. "../enum/DirectorEvents": 23,
  7692. "../enum/HelpModalType": 28,
  7693. "../enum/PlayerEvents": 40,
  7694. "../enum/Viewmode": 51,
  7695. "../settings": 166,
  7696. "./help/help": 67,
  7697. "./helpManager": 68,
  7698. "./populateModal": 75
  7699. }],
  7700. 72: [function(e, t, i) {
  7701. "use strict";
  7702. var n = e("./circleLoader").circleLoader;
  7703. t.exports = {
  7704. element: $("#gui-loading"),
  7705. hide: function(e) {
  7706. n.done(),
  7707. this.element.fadeOut(1500, e)
  7708. },
  7709. show: function(e) {
  7710. this.element.fadeIn(500, function() {
  7711. this.element.css("display", "table"),
  7712. e && e()
  7713. }
  7714. .bind(this))
  7715. },
  7716. progress: function(e) {
  7717. n.set(e)
  7718. }
  7719. }
  7720. }
  7721. , {
  7722. "./circleLoader": 60
  7723. }],
  7724. 73: [function(e, t, i) {
  7725. "use strict";
  7726. var n = e("../settings")
  7727. , r = $("#memory-info")
  7728. , o = r.find("#memory-gpu")
  7729. , a = !1;
  7730. t.exports = {
  7731. show: function() {
  7732. n.profiling.enabled && (r.show(),
  7733. a = !0)
  7734. },
  7735. hide: function() {
  7736. r.hide(),
  7737. a = !1
  7738. },
  7739. toggle: function() {
  7740. a ? this.hide() : this.show()
  7741. },
  7742. update: function(e) {
  7743. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7744. }
  7745. }
  7746. }
  7747. , {
  7748. "../settings": 166
  7749. }],
  7750. 74: [function(e, t, i) {
  7751. "use strict";
  7752. e("../util/browser"),
  7753. e("../analytics");
  7754. e("../settings"),
  7755. t.exports = {
  7756. show: function(e, t) {
  7757. $("#gui-message").fadeOut(500, function() {
  7758. t()
  7759. })
  7760. }
  7761. }
  7762. }
  7763. , {
  7764. "../analytics": 4,
  7765. "../settings": 166,
  7766. "../util/browser": 182
  7767. }],
  7768. 75: [function(e, t, i) {
  7769. "use strict";
  7770. function n(e, t, i, n) {
  7771. i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  7772. }
  7773. var r = e("../util/browser")
  7774. , o = e("../localization/localize")
  7775. , a = e("../enum/HelpModalType")
  7776. , s = (e("../enum/HelpModalSize"),
  7777. e("../enum/Viewmode"));
  7778. t.exports = {
  7779. init: function() {
  7780. if (!this.hasInitialized) {
  7781. this.hasInitialized = !0,
  7782. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7783. this.assets = {},
  7784. this.assets[a.LANDING[s.PANORAMA]] = {
  7785. desktop: {
  7786. left: {
  7787. "top-info": o.ROTATE,
  7788. "big-image": "images/nav_help_mouse_drag_left.png",
  7789. keyboard: "images/nav_help_keyboard_left_right.png"
  7790. },
  7791. middle: {
  7792. "top-info": o.MOVE,
  7793. "big-image": "images/nav_help_mouse_click.png",
  7794. keyboard: "images/nav_help_keyboard_up_down.png"
  7795. },
  7796. right: {
  7797. "top-info": o.ZOOM,
  7798. "big-image": "images/nav_help_mouse_zoom.png",
  7799. keyboard: "images/nav_help_zoom_keys.png"
  7800. }
  7801. },
  7802. mobile: {
  7803. left: {
  7804. "top-info": o.ROTATE,
  7805. "big-image": "images/nav_help_gesture_drag.png"
  7806. },
  7807. middle: {
  7808. "top-info": o.MOVE,
  7809. "big-image": "images/nav_help_gesture_tap.png"
  7810. },
  7811. right: {
  7812. "top-info": o.ZOOM,
  7813. "big-image": "images/nav_help_gesture_pinch.png"
  7814. }
  7815. }
  7816. },
  7817. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7818. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7819. desktop: {
  7820. left: {
  7821. "top-info": o.ROTATE,
  7822. "big-image": "images/nav_help_mouse_drag_left.png",
  7823. keyboard: "images/nav_help_keyboard_left_right.png"
  7824. },
  7825. middle: {
  7826. "top-info": o.MOVE,
  7827. "big-image": "images/nav_help_mouse_position_right.png"
  7828. }
  7829. },
  7830. mobile: {
  7831. left: {
  7832. "top-info": o.ROTATE,
  7833. "big-image": "images/nav_help_gesture_drag.png"
  7834. },
  7835. middle: {
  7836. "top-info": o.MOVE,
  7837. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7838. }
  7839. }
  7840. },
  7841. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7842. desktop: {
  7843. left: {
  7844. "top-info": o.MOVE,
  7845. "big-image": "images/nav_help_mouse_position_left.png"
  7846. },
  7847. middle: {
  7848. "top-info": o.ROTATE,
  7849. "big-image": "images/nav_help_mouse_drag_right.png",
  7850. keyboard: "images/nav_help_keyboard_left_right.png"
  7851. }
  7852. },
  7853. mobile: {
  7854. left: {
  7855. "top-info": o.MOVE,
  7856. "big-image": "images/nav_help_gesture_position.png"
  7857. },
  7858. middle: {
  7859. "top-info": o.ROTATE,
  7860. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7861. }
  7862. }
  7863. };
  7864. var e = {
  7865. "top-info": o.INSIDE,
  7866. "big-image": "images/nav_help_click_inside.png",
  7867. keyboard: "images/nav_help_inside_key.png"
  7868. };
  7869. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7870. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7871. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7872. var t = {
  7873. "top-info": o.INSIDE,
  7874. "big-image": "images/nav_help_tap_inside.png"
  7875. };
  7876. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7877. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7878. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7879. this.assets[a.NAVIGATION] = {},
  7880. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7881. desktop: {
  7882. left: {
  7883. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7884. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7885. "big-image": "images/nav_help_mouse_drag_left.png",
  7886. keyboard: "images/nav_help_keyboard_left_right.png"
  7887. },
  7888. middle: {
  7889. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7890. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7891. "big-image": "images/nav_help_mouse_click.png",
  7892. keyboard: "images/nav_help_keyboard_up_down.png"
  7893. },
  7894. right: {
  7895. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7896. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7897. "big-image": "images/nav_help_mouse_zoom.png",
  7898. keyboard: "images/nav_help_zoom_keys.png"
  7899. }
  7900. },
  7901. mobile: {
  7902. left: {
  7903. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7904. "big-image": "images/nav_help_gesture_drag.png"
  7905. },
  7906. middle: {
  7907. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7908. "big-image": "images/nav_help_gesture_tap.png"
  7909. },
  7910. right: {
  7911. "top-info": o.HELP_MOBILE_3,
  7912. "big-image": "images/nav_help_gesture_pinch.png"
  7913. }
  7914. }
  7915. },
  7916. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7917. desktop: {
  7918. left: {
  7919. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7920. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7921. "big-image": "images/nav_help_mouse_drag_left.png",
  7922. keyboard: "images/nav_help_keyboard_all.png"
  7923. },
  7924. middle: {
  7925. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  7926. "big-image": "images/nav_help_mouse_position_right.png"
  7927. },
  7928. right: {
  7929. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  7930. "big-image": "images/nav_help_mouse_zoom.png"
  7931. }
  7932. },
  7933. mobile: {
  7934. left: {
  7935. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  7936. "big-image": "images/nav_help_gesture_drag.png"
  7937. },
  7938. middle: {
  7939. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  7940. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7941. },
  7942. right: {
  7943. "top-info": o.HELP_MOBILE_3,
  7944. "big-image": "images/nav_help_gesture_pinch.png"
  7945. }
  7946. }
  7947. },
  7948. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  7949. desktop: {
  7950. left: {
  7951. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  7952. "big-image": "images/nav_help_mouse_position_left.png"
  7953. },
  7954. middle: {
  7955. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  7956. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  7957. "big-image": "images/nav_help_mouse_drag_right.png",
  7958. keyboard: "images/nav_help_keyboard_left_right.png"
  7959. },
  7960. right: {
  7961. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  7962. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  7963. "big-image": "images/nav_help_mouse_zoom.png",
  7964. keyboard: "images/nav_help_keyboard_up_down.png"
  7965. }
  7966. },
  7967. mobile: {
  7968. left: {
  7969. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  7970. "big-image": "images/nav_help_gesture_position.png"
  7971. },
  7972. middle: {
  7973. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  7974. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7975. },
  7976. right: {
  7977. "top-info": o.HELP_MOBILE_3,
  7978. "big-image": "images/nav_help_gesture_pinch.png"
  7979. }
  7980. }
  7981. },
  7982. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  7983. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  7984. "top-info": o.HELP_DESKTOP_360_2A,
  7985. "bottom-info": o.HELP_DESKTOP_360_2B,
  7986. "big-image": "images/nav_help_click_inside.png",
  7987. keyboard: "images/nav_help_inside_key.png"
  7988. },
  7989. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  7990. "top-info": o.HELP_MOBILE_360_2,
  7991. "big-image": "images/nav_help_tap_inside.png"
  7992. },
  7993. this.assets[a.MORE_HELP] = {
  7994. desktop: {
  7995. "more-help-hlr": {
  7996. "top-info": o.HELP_MORE_HLR_A,
  7997. "big-image": "images/nav_help_expand.svg",
  7998. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7999. },
  8000. "more-help-dollhouse": {
  8001. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8002. "big-image": "images/nav_help_dollhouse.svg",
  8003. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8004. },
  8005. "more-help-floors": {
  8006. "top-info": o.HELP_MORE_FLOORS_A,
  8007. "big-image": "images/nav_help_floor picker.svg",
  8008. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8009. },
  8010. "more-help-tag": {
  8011. "top-info": o.HELP_MORE_TAG_A,
  8012. "big-image": "images/nav_help_tag.svg",
  8013. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  8014. },
  8015. "more-help-zoom": {
  8016. "top-info": o.HELP_MORE_ZOOM_A,
  8017. "big-image": "images/nav_help_zoom.svg",
  8018. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  8019. },
  8020. "more-help-tour": {
  8021. "top-info": o.HELP_MORE_TOUR_A,
  8022. "big-image": "images/nav_help_play.png",
  8023. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8024. },
  8025. "more-help-inside": {
  8026. "top-info": o.HELP_MORE_INSIDE_A,
  8027. "big-image": "images/nav_help_inside.svg",
  8028. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  8029. },
  8030. "more-help-vr": {
  8031. "top-info": o.HELP_MORE_VR_A,
  8032. "big-image": "images/nav_help_vr.svg",
  8033. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  8034. },
  8035. "more-help-360": {
  8036. "top-info": o.HELP_MORE_360_A,
  8037. "big-image": "images/nav_help_360.svg",
  8038. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  8039. },
  8040. "more-help-fullscreen": {
  8041. "top-info": o.HELP_MORE_FULLSCREEN_A,
  8042. "big-image": "images/nav_help_fullscreen.svg",
  8043. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8044. }
  8045. },
  8046. mobile: {
  8047. "more-help-hlr": {
  8048. "top-info": o.HELP_MORE_HLR_A,
  8049. "big-image": "images/nav_help_expand.svg",
  8050. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8051. },
  8052. "more-help-dollhouse": {
  8053. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8054. "big-image": "images/nav_help_dollhouse.svg",
  8055. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8056. },
  8057. "more-help-floors": {
  8058. "top-info": o.HELP_MORE_FLOORS_A,
  8059. "big-image": "images/nav_help_floor picker.svg",
  8060. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8061. },
  8062. "more-help-tag": {
  8063. "top-info": o.HELP_MORE_TAG_A,
  8064. "big-image": "images/nav_help_tag.svg",
  8065. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8066. },
  8067. "more-help-tour": {
  8068. "top-info": o.HELP_MORE_TOUR_A,
  8069. "big-image": "images/nav_help_play.png",
  8070. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8071. },
  8072. "more-help-inside": {
  8073. "top-info": o.HELP_MORE_INSIDE_A,
  8074. "big-image": "images/nav_help_inside.svg",
  8075. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8076. },
  8077. "more-help-vr": {
  8078. "top-info": o.HELP_MORE_VR_A,
  8079. "big-image": "images/webvr.svg",
  8080. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8081. },
  8082. "more-help-360": {
  8083. "top-info": o.HELP_MORE_360_A,
  8084. "big-image": "images/nav_help_360.svg",
  8085. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8086. }
  8087. }
  8088. },
  8089. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8090. desktop: {
  8091. left: {
  8092. "top-info": o.ROTATE,
  8093. "big-image": "images/nav_help_mouse_drag_left.png",
  8094. keyboard: "images/nav_help_keyboard_left_right.png"
  8095. },
  8096. middle: {
  8097. "top-info": o.MOVE,
  8098. "big-image": "images/nav_help_mouse_click.png",
  8099. keyboard: "images/nav_help_keyboard_up_down.png"
  8100. },
  8101. right: {
  8102. "top-info": o.PLAY,
  8103. "big-image": "images/Desktop-help-play-button.svg",
  8104. keyboard: "images/Desktop-help-spacebar-2.svg"
  8105. }
  8106. },
  8107. mobile: {
  8108. left: {
  8109. "top-info": o.ROTATE,
  8110. "big-image": "images/nav_help_gesture_drag.png"
  8111. },
  8112. middle: {
  8113. "top-info": o.MOVE,
  8114. "big-image": "images/nav_help_gesture_tap.png"
  8115. },
  8116. right: {
  8117. "top-info": o.PLAY,
  8118. "big-image": "images/mobile-help-play-button.svg"
  8119. }
  8120. }
  8121. },
  8122. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8123. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8124. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8125. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8126. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8127. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8128. }
  8129. },
  8130. fill: function(e, t, i) {
  8131. n.call(this, e, t, i, !0)
  8132. },
  8133. clear: function(e, t, i) {
  8134. n.call(this, e, t, i, !1)
  8135. }
  8136. }
  8137. }
  8138. , {
  8139. "../enum/HelpModalSize": 27,
  8140. "../enum/HelpModalType": 28,
  8141. "../enum/Viewmode": 51,
  8142. "../localization/localize": 108,
  8143. "../util/browser": 182
  8144. }],
  8145. 76: [function(e, t, i) {
  8146. "use strict";
  8147. t.exports = Object.freeze({
  8148. OPENED: "share.open",
  8149. CLOSED: "share.closed",
  8150. LINK_CLICKED: "share.linked"
  8151. })
  8152. }
  8153. , {}],
  8154. 77: [function(e, t, i) {
  8155. "use strict";
  8156. function n(n) {
  8157. function e(e, t) {
  8158. var i = "top=" + (window.screenY + ($("#player").height() - t) / 2) + ",left=" + (window.screenX + ($("#player").width() - e) / 2) + ",width=" + e + ",height=" + t;
  8159. I.emit(l.LINK_CLICKED, {
  8160. channel: n
  8161. }),
  8162. window.open(C[n], "shareWindow", i)
  8163. }
  8164. switch (n) {
  8165. case A.FACEBOOK:
  8166. e(580, 420);
  8167. break;
  8168. case A.TWITTER:
  8169. e(550, 440);
  8170. break;
  8171. case A.MAIL:
  8172. I.emit(l.LINK_CLICKED, {
  8173. channel: "email"
  8174. }),
  8175. window.open(C[n], "_blank");
  8176. break;
  8177. case A.LINKEDIN:
  8178. }
  8179. }
  8180. function r(e) {
  8181. I.emit(l.LINK_CLICKED, {
  8182. channel: "copylink"
  8183. });
  8184. var t = document.createRange();
  8185. t.selectNodeContents(v);
  8186. var i = window.getSelection();
  8187. i.removeAllRanges(),
  8188. i.addRange(t),
  8189. document.execCommand("copy"),
  8190. y.classList.remove("hidden"),
  8191. v.classList.add("highlighted")
  8192. }
  8193. function o(e) {
  8194. e && (e.stopPropagation(),
  8195. e.target === v) || (window.getSelection().removeAllRanges(),
  8196. v.classList.remove("highlighted"),
  8197. y.classList.add("hidden"))
  8198. }
  8199. var a = e("../../util/browser")
  8200. , s = e("../../localization/localize")
  8201. , l = e("./ShareEvents")
  8202. , c = e("../../util/common")
  8203. , h = e("events").EventEmitter
  8204. , u = document.getElementById("sharing")
  8205. , d = document.getElementById("share-modal")
  8206. , p = document.getElementById("share-close")
  8207. , f = document.getElementById("facebook-share")
  8208. , g = document.getElementById("twitter-share")
  8209. , m = document.getElementById("mail-share")
  8210. , v = document.getElementById("share-url-text")
  8211. , y = document.getElementById("copy-success")
  8212. , A = Object.freeze({
  8213. FACEBOOK: "facebook",
  8214. TWITTER: "twitter",
  8215. MAIL: "mail",
  8216. LINKEDIN: "linkedin"
  8217. })
  8218. , C = {};
  8219. C[A.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8220. C[A.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8221. C[A.MAIL] = "mailto:?subject=";
  8222. var I = {
  8223. init: function(e) {
  8224. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8225. C[A.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8226. C[A.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8227. C[A.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8228. u.addEventListener("click", this.toggle.bind(this)),
  8229. p.addEventListener("click", this.hide.bind(this)),
  8230. v.addEventListener("click", r),
  8231. d.addEventListener("click", o),
  8232. f.addEventListener("click", n.bind(this, A.FACEBOOK)),
  8233. g.addEventListener("click", n.bind(this, A.TWITTER)),
  8234. m.addEventListener("click", n.bind(this, A.MAIL)),
  8235. v.textContent = window.location.href + "&utm_source=4",
  8236. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8237. u.classList.remove("hidden")
  8238. },
  8239. show: function() {
  8240. this.emit(l.OPENED),
  8241. d.classList.add("fadeIn")
  8242. },
  8243. hide: function() {
  8244. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8245. document.selection && document.selection.empty(),
  8246. window.getSelection().removeAllRanges(),
  8247. o(),
  8248. d.classList.remove("fadeIn"))
  8249. },
  8250. toggle: function() {
  8251. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8252. }
  8253. };
  8254. c.extendObject(I, h.prototype),
  8255. t.exports = I
  8256. }
  8257. , {
  8258. "../../localization/localize": 108,
  8259. "../../util/browser": 182,
  8260. "../../util/common": 185,
  8261. "./ShareEvents": 76,
  8262. events: 202
  8263. }],
  8264. 78: [function(e, t, i) {
  8265. "use strict";
  8266. t.exports = Object.freeze({
  8267. OPENED: "terms.opened",
  8268. CLOSED: "terms.closed"
  8269. })
  8270. }
  8271. , {}],
  8272. 79: [function(e, t, i) {
  8273. "use strict";
  8274. var n = e("./TermsEvent")
  8275. , r = e("../../localization/localize")
  8276. , o = e("../../analytics")
  8277. , a = e("../../util/ajax")
  8278. , s = e("../../util/common")
  8279. , l = e("events").EventEmitter
  8280. , c = document.getElementById("terms-modal")
  8281. , h = {
  8282. init: function() {
  8283. $(".footer-terms").on("click", function(e) {
  8284. e.preventDefault(),
  8285. this.show()
  8286. }
  8287. .bind(this)),
  8288. $("#terms-modal .close").on("click", this.hide.bind(this))
  8289. },
  8290. show: function() {
  8291. this.emit(n.OPENED),
  8292. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8293. var t = $("#terms-text").html(e);
  8294. o.track("showcase_gui", {
  8295. gui_action: "click_terms_button",
  8296. interaction_source: "gui"
  8297. }),
  8298. t.find("a").attr("target", "_blank")
  8299. }).fail(function() {
  8300. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8301. }),
  8302. c.classList.add("fadeIn")
  8303. },
  8304. hide: function(e) {
  8305. e && e.preventDefault(),
  8306. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8307. c.classList.remove("fadeIn")
  8308. }
  8309. };
  8310. s.extendObject(h, l.prototype),
  8311. t.exports = h
  8312. }
  8313. , {
  8314. "../../analytics": 4,
  8315. "../../localization/localize": 108,
  8316. "../../util/ajax": 181,
  8317. "../../util/common": 185,
  8318. "./TermsEvent": 78,
  8319. events: 202
  8320. }],
  8321. 80: [function(e, t, i) {
  8322. "use strict";
  8323. t.exports = Object.freeze({
  8324. OPEN_INFO: "title.open.info",
  8325. CLOSE_INFO: "title.close.info",
  8326. SHOW_INFO: "title.show.info",
  8327. HIDE_INFO: "title.hide.info",
  8328. LINK_CLICKED: "title.link.click",
  8329. CONTACT_LINK_CLICKED: "title.contact.click",
  8330. ORIGIN_LINK_CLICKED: "title.origin.click"
  8331. })
  8332. }
  8333. , {}],
  8334. 81: [function(e, t, i) {
  8335. "use strict";
  8336. var o = e("../../settings");
  8337. t.exports.init = function(e, t) {
  8338. o.tags.enabled && 0 !== Object.keys(e.tags).length && function(t, i) {
  8339. function e(e) {
  8340. t.shouldShowtags = "show" === this.value,
  8341. t.shouldShowtags ? i.showAlltags(o.tags.startup.fadeInDuration) : i.hideAlltags(o.tags.startup.fadeInDuration)
  8342. }
  8343. document.getElementById("tag-toggles").classList.remove("hidden"),
  8344. document.getElementById("radio-tag-show").checked = !0;
  8345. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8346. n[r].addEventListener("change", e)
  8347. }(e, t)
  8348. }
  8349. }
  8350. , {
  8351. "../../settings": 166
  8352. }],
  8353. 82: [function(S, M, e) {
  8354. (function(e) {
  8355. "use strict";
  8356. function i(e) {
  8357. return !(!e || l.inIframe() && document.referrer === e || (E.classList.remove("hidden"),
  8358. _.innerHTML = r.WEBVR_LEARN_MORE + ": ",
  8359. _.appendChild(function(e) {
  8360. var t = document.createElement("a");
  8361. return t.id = "url",
  8362. t.target = "_blank",
  8363. t.href = e,
  8364. t.innerText = e,
  8365. t.addEventListener("click", x.emit.bind(x, a.ORIGIN_LINK_CLICKED)),
  8366. t
  8367. }(e)),
  8368. b.forEach(function(e) {
  8369. e.classList.add("share-link")
  8370. }),
  8371. 0))
  8372. }
  8373. function s(e, t) {
  8374. var i = e
  8375. , n = t;
  8376. return function(e, t) {
  8377. i.push(t || n, e)
  8378. }
  8379. }
  8380. var l = S("../../util/browser")
  8381. , t = S("../../util/common")
  8382. , n = S("../../util/logger")
  8383. , r = S("../../localization/localize")
  8384. , o = S("./titleBarSettings")
  8385. , c = S("../../settings")
  8386. , a = S("./TitleEvents")
  8387. , h = S("events").EventEmitter
  8388. , u = new n(e)
  8389. , d = document.querySelector(".pinTop.left")
  8390. , p = document.getElementsByClassName("title-container")[0]
  8391. , f = document.getElementById("title-toggle").querySelector("i")
  8392. , g = document.getElementById("meta-info-wrapper")
  8393. , m = document.getElementById("meta-info")
  8394. , v = document.getElementById("meta-description")
  8395. , y = document.getElementsByClassName("contact-info")[0]
  8396. , A = document.getElementById("contact-data")
  8397. , C = document.getElementById("addressTxt")
  8398. , I = document.getElementById("tag-toggles")
  8399. , E = document.getElementById("share-origin")
  8400. , _ = document.getElementById("share-link-wrapper")
  8401. , b = [m, g, p]
  8402. , w = !1
  8403. , T = !1
  8404. , x = {
  8405. populate: function(e) {
  8406. if (function(e, t) {
  8407. return e && l.valueFromHash("title", 1) && 2 !== l.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8408. (g_weixinObj.title = e).length > o.minTooltipCharacters && p.parentElement.setAttribute("data-original-title", e),
  8409. t && 1 !== c.specialEdition && c.brand && !c.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8410. document.getElementById("gui-name").classList.add("noCoBrand"),
  8411. document.getElementById("cobrandTitle").classList.add("hidden")),
  8412. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8413. !1)
  8414. }(DATA.name, e.coBrand)) {
  8415. if (function(e) {
  8416. e ? (w = !0,
  8417. v.innerHTML = e) : v.classList.add("hidden")
  8418. }(e.description),
  8419. function(e, t, i, n) {
  8420. if ((e || t || i) && c.brand && !l.valueFromHash("mls", !1)) {
  8421. w = !0;
  8422. var r = []
  8423. , o = s(r, "<br>");
  8424. if (e && o('<span id="contactName">' + e + "</span>"),
  8425. t) {
  8426. var a = n || t;
  8427. o(l.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>")
  8428. }
  8429. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8430. r[0] = "",
  8431. A.innerHTML = r.join("")
  8432. } else
  8433. y.classList.add("hidden")
  8434. }(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8435. function(e) {
  8436. if ("string" == typeof e)
  8437. try {
  8438. e = JSON.parse(e)
  8439. } catch (e) {
  8440. return u.warn("Unable to parse address data"),
  8441. C.parentElement.classList.add("hidden")
  8442. }
  8443. if (e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)) {
  8444. w = !0;
  8445. var t = []
  8446. , i = s(t, " ");
  8447. e.address_1 && i(e.address_1),
  8448. e.address_2 && i(e.address_2),
  8449. e.city && i(e.city, ", "),
  8450. e.state && i(e.state, ", "),
  8451. e.zip && i(e.zip, e.state ? " " : ", "),
  8452. t[0] = "",
  8453. C.innerText = t.join("")
  8454. } else
  8455. C.parentElement.classList.add("hidden")
  8456. }(e.address),
  8457. w) {
  8458. var t = document.createElement("br");
  8459. I.insertBefore(t, I.firstElementChild)
  8460. }
  8461. e.socialSharing && c.share.enabled && (T = i(e.url))
  8462. }
  8463. },
  8464. finishSetup: function(e) {
  8465. w = w || !!e,
  8466. document.getElementById("title-toggle").addEventListener("click", x.toggleTitle.bind(x)),
  8467. w && p.addEventListener("click", x.toggleMeta.bind(x, !1)),
  8468. [].slice.call(v.querySelectorAll("a")).forEach(function(e) {
  8469. e.addEventListener("click", x.emit.bind(x, a.LINK_CLICKED))
  8470. }),
  8471. [].slice.call(y.querySelectorAll("a")).forEach(function(e) {
  8472. e.addEventListener("click", x.emit.bind(x, a.CONTACT_LINK_CLICKED, {
  8473. contact_type: e.getAttribute("id")
  8474. }))
  8475. }),
  8476. w || (T ? p.classList.add("share-only") : p.classList.add("no-meta"))
  8477. },
  8478. toggleMeta: function(e, t) {
  8479. var i = document.getElementById("model-title");
  8480. t && t.preventDefault();
  8481. var n = m.classList.contains("expand");
  8482. e && !n || (n ? (b.forEach(function(e) {
  8483. e.classList.remove("expand")
  8484. }),
  8485. this.emit(a.CLOSE_INFO),
  8486. i.classList.remove("expand")) : (b.forEach(function(e) {
  8487. e.classList.add("expand")
  8488. }),
  8489. i.classList.add("expand"),
  8490. this.emit(a.OPEN_INFO)))
  8491. },
  8492. setupToggling: function() {
  8493. g.style.height = m.offsetHeight + "px",
  8494. m.addEventListener("transitionend", function() {
  8495. g.style.height = m.offsetHeight + "px"
  8496. })
  8497. },
  8498. toggleTitle: function(e) {
  8499. e && e.preventDefault(),
  8500. d.classList.contains("closed") ? (d.classList.add("open"),
  8501. f.classList.remove("icon-dpad-right"),
  8502. f.classList.add("icon-dpad-left"),
  8503. this.emit(a.SHOW_INFO),
  8504. setTimeout(function() {
  8505. d.classList.remove("closed"),
  8506. d.classList.remove("open")
  8507. }, o.removeAnimationClasses)) : (d.classList.add("closed"),
  8508. f.classList.remove("icon-dpad-left"),
  8509. f.classList.add("icon-dpad-right"),
  8510. this.emit(a.HIDE_INFO))
  8511. }
  8512. };
  8513. t.extendObject(x, h.prototype),
  8514. M.exports = x
  8515. }
  8516. ).call(this, "/js/gui/title/titleBar.js")
  8517. }
  8518. , {
  8519. "../../localization/localize": 108,
  8520. "../../settings": 166,
  8521. "../../util/browser": 182,
  8522. "../../util/common": 185,
  8523. "../../util/logger": 189,
  8524. "./TitleEvents": 80,
  8525. "./titleBarSettings": 83,
  8526. events: 202
  8527. }],
  8528. 83: [function(e, t, i) {
  8529. "use strict";
  8530. t.exports = Object.freeze({
  8531. minTooltipCharacters: 19,
  8532. removeAnimationClasses: 500
  8533. })
  8534. }
  8535. , {}],
  8536. 84: [function(e, t, i) {
  8537. "use strict";
  8538. function n() {
  8539. settings.playTourNearBy ? v.playTourNearBy() : v.playTour()
  8540. y && clearTimeout(y),
  8541. c(),
  8542. E.removeClass("fadeIn")
  8543. }
  8544. function r() {
  8545. A.classList.contains("playing") && (v.stopTour(),
  8546. E.addClass("fadeIn"),
  8547. setTimeout(function() {
  8548. E.removeClass("fadeIn")
  8549. }, h.tourInteraction.showPauseButton),
  8550. M || (clearTimeout(y),
  8551. y = setTimeout(s, h.tourInteraction.showModal)),
  8552. setTimeout(function() {
  8553. A.classList.remove("playing")
  8554. }, h.tourInteraction.allowNextClick))
  8555. }
  8556. function o() {
  8557. v.tourInProgress && (v.stopTour(),
  8558. v.endTourProgress(),
  8559. A.classList.remove("playing"))
  8560. }
  8561. function a() {
  8562. _.is(":visible") ? n() : r()
  8563. }
  8564. function s() {//去掉导览结束时的提示
  8565. /* if (!h.tourInteraction.disabled) {
  8566. T.removeClass("small landing " + d.FLOORPLAN + " " + d.OUTDOOR + " " + d.PANORAMA),
  8567. T.addClass("fadeIn tour " + p.deviceType);
  8568. var e, t = h.tourInteraction.smallModal ? m.SMALL : m.LARGE;
  8569. if (!h.tourInteraction.smallModal)
  8570. e = v.player.mode === d.PANORAMA && !v.player.currentPano.isAligned() || v.player.mode === d.DOLLHOUSE ? d.OUTDOOR : v.player.mode === d.FLOORPLAN ? d.FLOORPLAN : d.PANORAMA,
  8571. p.fill(x, g.TOUR_INTERACTION[e]),
  8572. T.addClass(e);
  8573. T.addClass(t)
  8574. } */
  8575. }
  8576. function l(e, t) {
  8577. if (t) {
  8578. if($.contains($('.toolRight')[0],t.target))return //add 防止编辑时input 空格开始导览
  8579. var i = "keydown" === t.type
  8580. , n = t.which === u.SPACE || v.tourIsPlaying;
  8581. i && n || e || (M = !0),
  8582. v.atEndOfTour() && c(),
  8583. !v.tourIsPlaying && v.tourInProgress && (E.removeClass("fadeIn"),
  8584. c(),
  8585. t.which !== u.SPACE && o()),
  8586. i && n && a()
  8587. }
  8588. }
  8589. function c() {
  8590. T.removeClass("fadeIn")
  8591. }
  8592. var h = (e("../util/browser"),
  8593. e("../settings"))
  8594. , u = e("../enum/Keys")
  8595. , d = e("../enum/Viewmode")
  8596. , p = (e("./helpManager"),
  8597. e("./populateModal"))
  8598. , f = e("../enum/DirectorEvents")
  8599. , g = e("../enum/HelpModalType")
  8600. , m = e("../enum/HelpModalSize")
  8601. , v = null
  8602. , y = null
  8603. , A = document.getElementById("pause-overlay")
  8604. , C = document.getElementById("player")
  8605. , I = document.getElementById("gui")
  8606. , E = $("#pause-icon").eq(0)
  8607. , _ = $("#play").eq(0)
  8608. , b = $("#playHead").eq(0)
  8609. , w = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8610. , T = $("#interaction-modal").eq(0)
  8611. , x = $("#interaction-modal .interaction").toArray()
  8612. , S = ["touchstart", "mousedown", "pointerdown"]
  8613. , M = !1;
  8614. t.exports.init = function(e) {
  8615. v = e,
  8616. S.forEach(function(t) {
  8617. C.addEventListener(t, l.bind(this, !1), !0),
  8618. I.addEventListener(t, l.bind(this, !0), !0),
  8619. A.addEventListener(t, r, !0),
  8620. w.forEach(function(e) {
  8621. e.addEventListener(t, o, !0)
  8622. }),
  8623. $("#drawer img").on(t, o)
  8624. }),
  8625. document.addEventListener("keydown", l.bind(this, !1), !0),
  8626. v.on(f.TourStart, function() {
  8627. A.classList.add("playing")
  8628. })
  8629. }
  8630. ,
  8631. t.exports.play = n,
  8632. t.exports.pause = r,
  8633. t.exports.pauseWithoutCTA = o,
  8634. t.exports.togglePlay = a,
  8635. t.exports.stopTour = function() {
  8636. b.hasClass("playing") && (clearTimeout(y),
  8637. v.atEndOfTour() ? (A.classList.remove("playing"),
  8638. s()) : E.removeClass("fadeIn"))
  8639. }
  8640. ,
  8641. t.exports.dismissModal = c
  8642. }
  8643. , {
  8644. "../enum/DirectorEvents": 23,
  8645. "../enum/HelpModalSize": 27,
  8646. "../enum/HelpModalType": 28,
  8647. "../enum/Keys": 30,
  8648. "../enum/Viewmode": 51,
  8649. "../settings": 166,
  8650. "../util/browser": 182,
  8651. "./helpManager": 68,
  8652. "./populateModal": 75
  8653. }],
  8654. 85: [function(e, t, i) {
  8655. "use strict";
  8656. t.exports = Object.freeze({
  8657. OPENED: "vr.modal.opened",
  8658. LAUNCH: "vr.modal.launch",
  8659. CLOSED: "vr.modal.closed",
  8660. NEXT: "vr.modal.next",
  8661. PREV: "vr.modal.prev",
  8662. STORE: "vr.modal.store",
  8663. falseICECHOSEN: "vr.modal.device"
  8664. })
  8665. }
  8666. , {}],
  8667. 86: [function(e, t, i) {
  8668. "use strict";
  8669. var h = e("../../util/browser")
  8670. , u = e("../../enum/VRApps")
  8671. , n = e("../../enum/VRPlatforms")
  8672. , d = e("../../util/ajax")
  8673. , p = e("../../settings")
  8674. , r = {};
  8675. for (var o in r[u.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8676. r[u.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8677. r[u.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=",
  8678. u) {
  8679. var a = u[o];
  8680. r[a] += encodeURIComponent(document.referrer + "&display=" + a)
  8681. }
  8682. var s, f = {}, g = (-1 === (s = window.location.host).indexOf(".port.com") && -1 === s.indexOf("localhost") && (s = "my.port.com"),
  8683. "https://" + s);
  8684. t.exports.init = function(e, t, o) {
  8685. function a(e, t, i, n) {
  8686. function r() {
  8687. return "&utm_medium=" + (h.inIframe() ? "embed" : "direct") + ("&utm_source=" + s) + ("&utm_showcase_session_id=" + o)
  8688. }
  8689. return h.valueFromHash("vrcoll", !1) ? l + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(i) + "&ld=" + encodeURIComponent(n) + "&display=" + e + r() : c + "&m=" + t + "&display=" + e + r()
  8690. }
  8691. var s = h.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8692. , l = g + "/vr/dlist/?ret=" + s
  8693. , c = g + "/vr/show/?ret=" + s;
  8694. switch (e) {
  8695. case n.IOS:
  8696. !function(t, e, i, n) {
  8697. var r = a(t, e, i, n)
  8698. , o = {
  8699. responseType: "json",
  8700. data: {
  8701. branch_key: p.appConfig.branch_key,
  8702. data: {
  8703. m: e,
  8704. full_url: r,
  8705. $desktop_url: "",
  8706. $og_app_id: "331853976762864119",
  8707. $og_title: i,
  8708. $og_description: n,
  8709. $og_image_url: location.origin + "/api/v1/player/models/" + e + "/thumb",
  8710. $canonical_url: window.location.href
  8711. }
  8712. }
  8713. };
  8714. d.post("https://api.branch.io/v1/url", o).done(function(e) {
  8715. f[t] = e.url
  8716. }).fail(function(e) {
  8717. f[t] = e
  8718. }
  8719. .bind(this, r))
  8720. }(u.CardboardIOS, t.sid, t.name, t.summary);
  8721. break;
  8722. default:
  8723. !function(e, t, i) {
  8724. for (var n in u) {
  8725. var r = u[n]
  8726. , o = a(r, e, t, i);
  8727. f[r] = o
  8728. }
  8729. }(t.sid, t.name, t.summary)
  8730. }
  8731. }
  8732. ,
  8733. t.exports.launch = function(e) {
  8734. var t = f[e];
  8735. window.open(t, "_blank")
  8736. }
  8737. ,
  8738. t.exports.launchStore = function(e) {
  8739. var t = r[e];
  8740. window.open(t, "_blank")
  8741. }
  8742. }
  8743. , {
  8744. "../../enum/VRApps": 46,
  8745. "../../enum/VRPlatforms": 49,
  8746. "../../settings": 166,
  8747. "../../util/ajax": 181,
  8748. "../../util/browser": 182
  8749. }],
  8750. 87: [function(e, t, i) {
  8751. "use strict";
  8752. function c(e) {
  8753. var t;
  8754. switch (e) {
  8755. case y.IOS:
  8756. return 9 < (t = g.iosVersion()).major || 9 === t.major && 1 <= t.minor;
  8757. case y.Android:
  8758. return 4 < (t = g.androidVersion()).major || 4 === t.major && 4 < t.minor || 4 === t.major && 4 === t.minor && 4 <= t.patch
  8759. }
  8760. return !1
  8761. }
  8762. function h(e) {
  8763. switch (e) {
  8764. case y.Android:
  8765. x.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8766. x.filter(".gearvr").off().on("click", q.gear),
  8767. n(k, U, "logo-button", "same-line");
  8768. break;
  8769. case y.UnsupportedAndroid:
  8770. n("", H, "", "");
  8771. break;
  8772. case y.IOS:
  8773. x.filter(".cardboard").off().on("click", q.cardboardIOS),
  8774. n(k, "", "logo-button", "");
  8775. break;
  8776. case y.Desktop:
  8777. x.filter(".cardboard").off().on("click", r.bind(this, null, N, B)),
  8778. x.filter(".gearvr").off().on("click", r.bind(this, U, F, null)),
  8779. n(k, U, "logo-button", "same-line"),
  8780. Q.cardboard()
  8781. }
  8782. }
  8783. function u(e) {
  8784. $(".p1, .p2, .p3").hide(),
  8785. l.insertAfter(T),
  8786. w.removeClass("front-page"),
  8787. w.removeClass("details-page"),
  8788. w.removeClass("lastPage"),
  8789. x.removeClass("logo-button"),
  8790. x.removeClass("same-line"),
  8791. T.removeClass("headsetOptions"),
  8792. S.attr("src", ""),
  8793. S.filter(".second").removeClass("gear"),
  8794. S.css("display", "inline-block"),
  8795. S.off(),
  8796. M.filter(".second").css("display", ""),
  8797. O.css("display", "none"),
  8798. $(".p" + (e + 1) + _).show(),
  8799. S.filter(".third").insertBefore(M.filter(".third"))
  8800. }
  8801. function n(e, t, i, n) {
  8802. w.addClass("front-page"),
  8803. S.filter(".first").attr("src", e),
  8804. S.filter(".second").attr("src", t),
  8805. x.filter(".first").addClass(i),
  8806. x.filter(".second").addClass(i),
  8807. x.addClass(n),
  8808. ".show-desktop" === _ && T.insertAfter(l)
  8809. }
  8810. function r(e, t, i) {
  8811. T.addClass("headsetOptions"),
  8812. x.off(),
  8813. S.filter(".second").attr("src", t),
  8814. O.css("display", "block"),
  8815. M.filter(".second").css("display", "none"),
  8816. O.on("click", function() {
  8817. u(b.Title),
  8818. h(y.Desktop)
  8819. }),
  8820. e && (X.emit(C.falseICECHOSEN, {
  8821. name: v.GearVR
  8822. }),
  8823. S.filter(".first").attr("src", e),
  8824. S.filter(".second").addClass("gear"),
  8825. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8826. Q.gearvr()),
  8827. i && (X.emit(C.falseICECHOSEN, {
  8828. name: v.Cardboard
  8829. }),
  8830. S.filter(".third").attr("src", i),
  8831. S.filter(".third").show(),
  8832. S.filter(".third").insertAfter(S.filter(".second")),
  8833. S.filter(".third").addClass("link"),
  8834. S.filter(".second").addClass("link"),
  8835. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8836. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid)),
  8837. Q.cardboard())
  8838. }
  8839. function d(e, t) {
  8840. switch (t) {
  8841. case y.IOS:
  8842. j = W,
  8843. Y = G;
  8844. break;
  8845. case y.Desktop:
  8846. e === b.Cardboard ? (j = N,
  8847. Y = B,
  8848. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8849. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid))) : (j = F,
  8850. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8851. Y = "");
  8852. break;
  8853. default:
  8854. Y = e === b.Cardboard ? (j = H,
  8855. G) : (j = V,
  8856. z)
  8857. }
  8858. }
  8859. function p(e, t, i) {
  8860. w.find(".inner").addClass("details-page"),
  8861. w.addClass("details-page"),
  8862. S.filter(".first").attr("src", e),
  8863. S.filter(".second").attr("src", t),
  8864. S.filter(".third").attr("src", i)
  8865. }
  8866. function f() {
  8867. var e = 1 < g.aspectRatio() && g.isMobile();
  8868. w.toggleClass("landscape", e).toggleClass("portrait", !e),
  8869. w.toggleClass("tiny", $("#player").height() <= o.narrowLandscapeHeight),
  8870. w.toggleClass("tinier", $("#player").height() <= o.reallyNarrowLandscapeHeight)
  8871. }
  8872. var g = e("../../util/browser")
  8873. , m = e("./vrLink")
  8874. , v = e("../../enum/VRApps")
  8875. , y = e("../../enum/VRPlatforms")
  8876. , A = e("../../enum/VRPages")
  8877. , C = e("./vrEvent")
  8878. , o = (e("../../settings"),
  8879. e("../../constants"))
  8880. , I = e("../../localization/localize")
  8881. , a = e("../../util/common")
  8882. , s = e("events").EventEmitter
  8883. , E = 0
  8884. , _ = null
  8885. , b = A.standard
  8886. , w = $(".vr-popup")
  8887. , l = w.find(".vr-popup-body")
  8888. , T = w.find(".vr-images")
  8889. , x = w.find(".img-container")
  8890. , S = w.find(".vr-sm-image")
  8891. , M = x.find(".vr-img-caption")
  8892. , R = $(".vr-buttons").find(".prev-button")
  8893. , P = $(".vr-buttons").find(".next-button")
  8894. , O = T.find(".front-close")
  8895. , L = $(".vr-page")
  8896. , D = w.find("img")
  8897. , N = "images/apple-store.png"
  8898. , F = "images/badge-oculus.png"
  8899. , B = "images/badge-cardboard.png"
  8900. , V = "images/logo-samsung.png"
  8901. , k = "images/headset-cardboard.png"
  8902. , U = "images/headset-gearvr.png"
  8903. , H = "images/ico-android-robot.png"
  8904. , z = "images/ico-gearvr.png"
  8905. , G = "images/ico-vr.png"
  8906. , W = "images/apple-logo-white.svg"
  8907. , j = null
  8908. , Y = null
  8909. , q = {}
  8910. , X = {
  8911. init: function(e, t) {
  8912. function i(e) {
  8913. X.emit(C.STORE, {
  8914. type: e
  8915. }),
  8916. m.launchStore(e)
  8917. }
  8918. function n(e) {
  8919. switch (e !== b.pageCount && (u(e),
  8920. L.text(e + 1 + " / " + b.pageCount)),
  8921. e) {
  8922. case b.Title:
  8923. R.css("display", "none"),
  8924. P.text(a[e]),
  8925. h(r);
  8926. break;
  8927. case b.Cardboard:
  8928. R.css("display", "block"),
  8929. P.text(a[e]),
  8930. x.filter(".cardboard").off(),
  8931. x.filter(".gearvr").off(),
  8932. d(e, r),
  8933. p(k, j, Y);
  8934. break;
  8935. case b.Gear:
  8936. P.text(a[e]),
  8937. d(e, r),
  8938. w.addClass("lastPage"),
  8939. p(U, j, Y);
  8940. break;
  8941. case b.pageCount:
  8942. w.removeClass("fadeIn"),
  8943. X.emit(C.CLOSED)
  8944. }
  8945. D.filter("[src='']").hide()
  8946. }
  8947. var r = g.detectAndroid() ? g.detectAndroidMobile() && c(y.Android) ? (w.addClass("supported"),
  8948. _ = ".show-supported",
  8949. y.Android) : (w.addClass("unsupported"),
  8950. _ = ".show-unsupported",
  8951. y.UnsupportedAndroid) : g.detectIPhone() || g.detectIPod() ? (w.addClass("ios"),
  8952. _ = ".show-ios",
  8953. b = A.ios,
  8954. y.IOS) : (w.addClass("desktop"),
  8955. _ = ".show-desktop",
  8956. y.Desktop);
  8957. function o(e) {
  8958. X.emit(C.LAUNCH, {
  8959. vr_platform: r,
  8960. vr_app: e
  8961. }),
  8962. m.launch(e)
  8963. }
  8964. m.init(r, e, t),
  8965. r !== y.Desktop && w.addClass("mobile"),
  8966. q.cardboardAndroid = o.bind(this, v.CardboardAndroid),
  8967. q.gear = o.bind(this, v.GearVR),
  8968. q.cardboardIOS = o.bind(this, v.CardboardIOS),
  8969. f(),
  8970. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  8971. $(_).show();
  8972. var a = [I.VR_LEARN_MORE_CAPS, I.VR_NEXT_CAPS, I.VR_GOT_IT_CAPS]
  8973. , s = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  8974. r === y.IOS && (a.splice(1, 1),
  8975. s.splice(1, 1)),
  8976. $("#vr").on("click", function(e) {
  8977. e.preventDefault(),
  8978. window.vrEnabled || (window.vrEnabled = !0,
  8979. this.classList.add("active"),
  8980. $("#gui div").not("#vrOff").addClass("vrHide"),
  8981. $("#vrOffImg").css({
  8982. display: "inline-block"
  8983. }))
  8984. }),
  8985. $("#vrOff").on("click", function() {
  8986. window.vrEnabled = !1,
  8987. $("#gui div").not("#vrOff").removeClass("vrHide"),
  8988. $("#vrOffImg").css({
  8989. display: "none"
  8990. }),
  8991. $("#player canvas").css({
  8992. width: "",
  8993. height: ""
  8994. }),
  8995. $("#vr").removeClass("active")
  8996. });
  8997. var l = "https://my.port.com/vr/show/?m=" + e.sid;
  8998. r === y.IOS ? $(".cardboardLink").on("click", i.bind(this, v.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, v.CardboardAndroid)),
  8999. $(".gearLink").on("click", i.bind(this, v.GearVR)),
  9000. $("span.modelLink").text(l),
  9001. R.on("click", function(e) {
  9002. X.emit(C.PREV),
  9003. n(--E)
  9004. }),
  9005. P.on("click", function(e) {
  9006. P.text(),
  9007. X.emit(C.NEXT, {
  9008. nextAction: s[E]
  9009. }),
  9010. n(++E)
  9011. }),
  9012. w.find(".close").on("click", X.dismiss)
  9013. },
  9014. dismiss: function() {
  9015. w.hasClass("fadeIn") && (w.removeClass("fadeIn"),
  9016. X.emit(C.CLOSED))
  9017. },
  9018. isDeviceSupported: c
  9019. };
  9020. a.extendObject(X, s.prototype),
  9021. $(window).resize(f);
  9022. var Z, K, Q = (Z = M.filter(".first").find(".cardboard"),
  9023. K = M.filter(".first").find(".gearvr"),
  9024. {
  9025. cardboard: function() {
  9026. K.addClass("hidden"),
  9027. Z.removeClass("hidden")
  9028. },
  9029. gearvr: function() {
  9030. Z.addClass("hidden"),
  9031. K.removeClass("hidden")
  9032. }
  9033. });
  9034. t.exports = X
  9035. }
  9036. , {
  9037. "../../constants": 8,
  9038. "../../enum/VRApps": 46,
  9039. "../../enum/VRPages": 48,
  9040. "../../enum/VRPlatforms": 49,
  9041. "../../localization/localize": 108,
  9042. "../../settings": 166,
  9043. "../../util/browser": 182,
  9044. "../../util/common": 185,
  9045. "./vrEvent": 85,
  9046. "./vrLink": 86,
  9047. events: 202
  9048. }],
  9049. 88: [function(e, t, i) {
  9050. "use strict";
  9051. t.exports = Object.freeze({
  9052. OPENED: "webvr.modal.opened",
  9053. SHOW_TERMS: "webvr.footer.show.terms"
  9054. })
  9055. }
  9056. , {}],
  9057. 89: [function(B, V, e) {
  9058. (function(e) {
  9059. "use strict";
  9060. function a() {
  9061. function t() {
  9062. p.isPresenting || (r.info("exiting webVR"),
  9063. c("webvr_exit_app"),
  9064. -1 === window.location.search.indexOf("&qs=1") ? window.location = window.location + "&qs=1" : window.location = window.location,
  9065. window.removeEventListener("vrdisplaypresentchange", t))
  9066. }
  9067. r.info("Headset mounted"),
  9068. u.suspend();
  9069. var e = document.createElement("canvas");
  9070. for (e.getContext("webgl"),
  9071. e.className = "webvr-canvas",
  9072. document.bgColor = "#000",
  9073. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9074. document.body.removeChild(document.body.firstChild);
  9075. document.body.appendChild(e),
  9076. c("webvr_enter_app"),
  9077. p.requestPresent([{
  9078. source: e,
  9079. predistorted: !0
  9080. }]).catch(function(e) {
  9081. r.error("Failed to present: " + e),
  9082. c("webvr_exit_calibrate"),
  9083. t()
  9084. }),
  9085. d.then(function() {
  9086. window.dispatchEvent(new Event("vrapp-start"))
  9087. }),
  9088. window.addEventListener("vrdisplaypresentchange", t)
  9089. }
  9090. function s() {
  9091. c("webvr_modal_close"),
  9092. _.find(".enter-button").off("click", a),
  9093. E.fadeOut(g.guiAnimationSpeed, function() {
  9094. _.toggleClass("hidden", !1),
  9095. b.toggleClass("hidden", !0),
  9096. f.exitFullscreen()
  9097. }),
  9098. I.fadeIn(g.guiAnimationSpeed)
  9099. }
  9100. function t() {
  9101. M.toggleClass("hidden", !0),
  9102. S.toggleClass("hidden", !1)
  9103. }
  9104. function l() {
  9105. _.toggleClass("hidden"),
  9106. b.toggleClass("hidden")
  9107. }
  9108. function c(e) {
  9109. var t = f.isLandscape() ? "landscape" : "portrait";
  9110. i.trackAlways("showcase_gui", {
  9111. gui_action: e,
  9112. orientation: t
  9113. })
  9114. }
  9115. function h() {
  9116. var e = f.isLandscape();
  9117. E.toggleClass("landscape", e).toggleClass("portrait", !e)
  9118. }
  9119. var u, d, p, f = B("../../util/browser"), g = B("../../settings"), m = (B("./../gui"),
  9120. B("../../enum/VRPlatforms")), v = B("../../enum/VRApps"), y = B("./../vr/vrLink"), A = B("./WebVrEvent"), i = B("../../analytics"), C = (B("../../constants"),
  9121. B("../../localization/localize")), n = B("../../util/common"), r = new (B("../../util/logger"))(e), o = B("events").EventEmitter, I = $("#gui"), E = $(".webvr-popup"), _ = $(".webvr-popup .page.p1"), b = $(".webvr-popup .page.p2"), w = E.find(".image"), T = $(".webvr-popup .detail.headset"), x = $(".webvr-popup .detail.phone"), S = $(".webvr-popup .tab-content.webvr"), M = $(".webvr-popup .tab-content.native"), R = "images/headset-cardboard.png", P = "https://madeby.google.com/vr/", O = "webvr_daydream_link", L = P, D = O, N = {
  9122. init: function(e, t, i, n) {
  9123. function r(e) {
  9124. e.preventDefault(),
  9125. o(e.currentTarget.id)
  9126. }
  9127. function o(i) {
  9128. F[i](),
  9129. Object.keys(F).map(function(e, t) {
  9130. $("#" + e).toggleClass("tabs-underlined", e === i)
  9131. })
  9132. }
  9133. p = i,
  9134. u = t,
  9135. y.init(m.Android, e, n),
  9136. h(),
  9137. new RegExp("daydream","i").test(p.displayName) ? (o("tabdaydream"),
  9138. w.filter(".device-headset-side").attr("src", "images/device-daydream-side.png"),
  9139. _.find(".title").text(C.localizeText("WEBVR_FOR_DAYDREAM"))) : (o("tabcardboard"),
  9140. w.filter(".device-headset-side").attr("src", R),
  9141. _.find(".title").text(C.localizeText("WEBVR_FOR_CARDBOARD"))),
  9142. $("#vr").on("click", function(e) {
  9143. e.preventDefault(),
  9144. c("click_webvr_button"),
  9145. E.is(":hidden") && (N.emit(A.OPENED),
  9146. I.fadeOut(g.guiAnimationSpeed),
  9147. E.fadeIn(g.guiAnimationSpeed),
  9148. function() {
  9149. if (!d) {
  9150. var n = "https://static.port.com/webvr/" + (f.valueFromHash("webvr") || g.appConfig.webvr_version) + "/js/main.js";
  9151. d = new Promise(function(e, t) {
  9152. var i = document.createElement("script");
  9153. i.type = "text/javascript",
  9154. i.src = n,
  9155. i.onload = e,
  9156. document.head.appendChild(i)
  9157. }
  9158. )
  9159. }
  9160. _.find(".enter-button").on("click", a)
  9161. }())
  9162. }),
  9163. $(".webvr-popup .close").on("click", function(e) {
  9164. e.preventDefault(),
  9165. _.hasClass("hidden") ? (c("webvr_help_close"),
  9166. l()) : s()
  9167. }),
  9168. $("#tabcardboard").on("click", r),
  9169. $("#tabdaydream").on("click", r),
  9170. $("#tabnative").on("click", r),
  9171. $(".webvr-popup .open-with-app").on("click", function(e) {
  9172. e.preventDefault(),
  9173. c("webvr_learn_more"),
  9174. o("tabnative"),
  9175. l()
  9176. }),
  9177. $(".webvr-popup .help").on("click", function(e) {
  9178. e.preventDefault(),
  9179. c(_.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9180. l()
  9181. }),
  9182. $(".webvr-popup .terms").on("click", function(e) {
  9183. e.preventDefault(),
  9184. c("webvr_click_terms"),
  9185. s(),
  9186. N.emit(A.SHOW_TERMS)
  9187. }),
  9188. T.on("click", function(e) {
  9189. e.preventDefault(),
  9190. c(D),
  9191. window.open(L, "_blank")
  9192. }),
  9193. x.on("click", function(e) {
  9194. e.preventDefault(),
  9195. c("webvr_phone_link"),
  9196. window.open("https://vr.google.com/daydream/phones/", "_blank")
  9197. }),
  9198. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9199. e.preventDefault(),
  9200. c("webvr_cardboard_link"),
  9201. y.launch(v.CardboardAndroid)
  9202. }),
  9203. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9204. e.preventDefault(),
  9205. c("webvr_oculus_link"),
  9206. y.launch(v.GearVR)
  9207. })
  9208. }
  9209. }, F = {
  9210. tabcardboard: function() {
  9211. w.filter(".device-headset").attr("src", R),
  9212. w.filter(".device-phone").attr("src", "images/ico-android-robot.png"),
  9213. L = "https://vr.google.com/cardboard/get-cardboard/",
  9214. D = "webvr_cardboard_link",
  9215. T.text(C.localizeText("VR_GOOGLE_CARDBOARD")),
  9216. x.text(C.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9217. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9218. t()
  9219. },
  9220. tabdaydream: function() {
  9221. w.filter(".device-headset").attr("src", "images/device-daydream.png"),
  9222. w.filter(".device-phone").attr("src", "images/device-pixel.png"),
  9223. L = P,
  9224. D = O,
  9225. T.text(C.localizeText("WEBVR_DAYDREAM_VIEW")),
  9226. x.text(C.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9227. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9228. t()
  9229. },
  9230. tabnative: function() {
  9231. w.filter(".badge-cardboard").attr("src", "images/badge-cardboard.png"),
  9232. w.filter(".badge-oculus").attr("src", "images/badge-oculus.png"),
  9233. M.toggleClass("hidden", !1),
  9234. S.toggleClass("hidden", !0)
  9235. }
  9236. };
  9237. n.extendObject(N, o.prototype),
  9238. $(window).resize(h),
  9239. V.exports = N
  9240. }
  9241. ).call(this, "/js/gui/webvr/webVRgui.js")
  9242. }
  9243. , {
  9244. "../../analytics": 4,
  9245. "../../constants": 8,
  9246. "../../enum/VRApps": 46,
  9247. "../../enum/VRPlatforms": 49,
  9248. "../../localization/localize": 108,
  9249. "../../settings": 166,
  9250. "../../util/browser": 182,
  9251. "../../util/common": 185,
  9252. "../../util/logger": 189,
  9253. "./../gui": 65,
  9254. "./../vr/vrLink": 86,
  9255. "./WebVrEvent": 88,
  9256. events: 202
  9257. }],
  9258. 90: [function(e, t, i) {
  9259. "use strict";
  9260. function n(e, t, i, n, r) {
  9261. this.floorId = n || 0 === n ? n : -1,
  9262. this.roomId = r || "",
  9263. this.labelId = e,
  9264. this.position = (new o.Vector3).copy(t),
  9265. this.text = i
  9266. }
  9267. var o = e("three")
  9268. , r = e("../util/browser");
  9269. n.prototype.build = function() {
  9270. var e = window.document.createElement("div");
  9271. r.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9272. var t = window.document.createElement("div");
  9273. t.setAttribute("class", "gui-floorplan-label-text");
  9274. var i = window.document.createTextNode(this.text);
  9275. t.appendChild(i),
  9276. e.appendChild(t),
  9277. window.document.body.appendChild(e),
  9278. this.labelGui = e,
  9279. this.textBlock = t,
  9280. $(this.labelGui).hide();
  9281. var n = window.getComputedStyle(this.labelGui);
  9282. this.initialTransform = n.transform || n.webkitTransform
  9283. }
  9284. ,
  9285. t.exports = n
  9286. }
  9287. , {
  9288. "../util/browser": 182,
  9289. three: 217
  9290. }],
  9291. 91: [function(e, t, i) {
  9292. "use strict";
  9293. function n() {
  9294. this.player = null,
  9295. this.modelManager = null,
  9296. this.container = null
  9297. }
  9298. var c, o, r = e("three"), a = (e("../util/common"),
  9299. e("../enum/PlayerEvents")), s = (e("../enum/DirectorEvents"),
  9300. e("../enum/ModelManagerEvents")), l = e("../settings"), h = e("../enum/Viewmode"), u = (e("../enum/WarpStyle"),
  9301. e("../util/transitions"),
  9302. e("../util/lerp"),
  9303. e("../util/browser"));
  9304. n.prototype.init = function(e, t, i) {
  9305. this.player = e,
  9306. this.modelManager = t,
  9307. this.container = i,
  9308. this.updateModel(),
  9309. this.bindEvents()
  9310. }
  9311. ,
  9312. n.prototype.bindEvents = function() {
  9313. this.modelManager.on(s.ActiveModelChanged, this.updateModel.bind(this)),
  9314. this.player.on(a.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9315. this.player.on(a.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9316. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  9317. this.player.on(a.StartOutside, this.handleStartOutside.bind(this))
  9318. }
  9319. ,
  9320. n.prototype.updateModel = function() {
  9321. this.model = this.modelManager.getActiveModel()
  9322. }
  9323. ,
  9324. n.prototype.handlePlayerViewChanged = function() {
  9325. this.updateLabelVisibility(),
  9326. this.updateLabelDisplay()
  9327. }
  9328. ,
  9329. n.prototype.getLabelsForFloor = function(t, i) {
  9330. return (i = i || []).length = 0,
  9331. this.model.labels.forEach(function(e) {
  9332. this.labelVisibleForFloor(e, t) && i.push(e)
  9333. }
  9334. .bind(this)),
  9335. i
  9336. }
  9337. ,
  9338. n.prototype.getLabelsForCurrentFloor = function(e) {
  9339. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9340. }
  9341. ,
  9342. n.prototype.labelVisibleForFloor = function(e, t) {
  9343. var i = u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.mobile || !u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.desktop;
  9344. if (!this.model.showingLabels || !e.labelGui || !i)
  9345. return !1;
  9346. var n = e.floorId === this.model.floors.size() - 1;
  9347. return this.model.allFloorsVisible ? n : e.floorId === t
  9348. }
  9349. ,
  9350. n.prototype.updateLabelVisibility = function(e) {
  9351. this.model.labels.forEach(function(e) {
  9352. this.supportedMode() && this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex) ? this.showLabel(e, l.labels.fadeInDelay, l.labels.fadeInDuration) : this.hideLabel(e, l.labels.fadeOutDelay, l.labels.fadeOutDuration)
  9353. }
  9354. .bind(this))
  9355. }
  9356. ,
  9357. n.prototype.showAllLabels = function(t, i) {
  9358. this.model.labels.forEach(function(e) {
  9359. this.showLabel(e, t, i)
  9360. }
  9361. .bind(this))
  9362. }
  9363. ,
  9364. n.prototype.hideAllLabels = function(t, i) {
  9365. this.model.labels.forEach(function(e) {
  9366. this.hideLabel(e, t, i)
  9367. }
  9368. .bind(this))
  9369. }
  9370. ,
  9371. n.prototype.showLabel = function(e, t, i) {
  9372. this.model.showingLabels && (e.visible || (e.visible = !0,
  9373. e.labelGui.style.display = "block",
  9374. e.labelGui.style.opacity = 0,
  9375. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9376. }
  9377. ,
  9378. n.prototype.hideLabel = function(e, t, i) {
  9379. e.visible && (e.visible = !1,
  9380. u.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9381. }
  9382. ,
  9383. n.prototype.supportedMode = function() {
  9384. return this.player.mode === h.FLOORPLAN
  9385. }
  9386. ,
  9387. n.prototype.updateLabelDisplay = (new r.Vector3,
  9388. new r.Vector3,
  9389. o = [],
  9390. function() {
  9391. var e = this.player.getLabelScaleFactor()
  9392. , t = 1.2 * (1 - e) + .6
  9393. , i = u.isMobile() ? l.labels.zoomTruncateThreshhold.mobile : l.labels.zoomTruncateThreshhold.desktop;
  9394. this.getLabelsForCurrentFloor(o);
  9395. for (var n = 0; n < o.length; n++) {
  9396. var r = o[n];
  9397. this.supportedMode() && r.labelGui && (this.updateProjectedGuiElement(r.labelGui, r.textBlock, r.position, t, t),
  9398. i <= e && r.text.length >= l.labels.minLengthForTruncate ? r.textBlock.innerText = r.text.substring(0, l.labels.truncateLength) + l.labels.truncateSuffix : r.textBlock.innerText = r.text)
  9399. }
  9400. }
  9401. ),
  9402. n.prototype.updateProjectedGuiElement = (c = new r.Vector3,
  9403. new r.Vector3,
  9404. function(e, t, i, n, r) {
  9405. t.style.fontSize = 100 * r + "%";
  9406. var o = .5 * $("#player").width()
  9407. , a = .5 * $("#player").height();
  9408. c.copy(i),
  9409. c.project(this.player.camera);
  9410. var s = c.x * o + o
  9411. , l = -c.y * a + a;
  9412. s -= e.offsetWidth / 2,
  9413. l -= e.offsetHeight / 2,
  9414. e.style.left = s + "px",
  9415. e.style.top = l + "px"
  9416. }
  9417. ),
  9418. n.prototype.handleStartInside = function(e) {
  9419. this.updateLabelVisibility()
  9420. }
  9421. ,
  9422. n.prototype.handleStartOutside = function() {
  9423. this.updateLabelVisibility()
  9424. }
  9425. ,
  9426. t.exports = n
  9427. }
  9428. , {
  9429. "../enum/DirectorEvents": 23,
  9430. "../enum/ModelManagerEvents": 33,
  9431. "../enum/PlayerEvents": 40,
  9432. "../enum/Viewmode": 51,
  9433. "../enum/WarpStyle": 52,
  9434. "../settings": 166,
  9435. "../util/browser": 182,
  9436. "../util/common": 185,
  9437. "../util/lerp": 188,
  9438. "../util/transitions": 195,
  9439. three: 217
  9440. }],
  9441. 92: [function(e, t, i) {
  9442. "use strict";
  9443. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9444. if (null == this)
  9445. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9446. if ("function" != typeof e)
  9447. throw new TypeError("predicate must be a function");
  9448. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9449. if (t = i[o],
  9450. e.call(r, t, o, i))
  9451. return o;
  9452. return -1
  9453. }
  9454. ),
  9455. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9456. value: function(e) {
  9457. if (null == this)
  9458. throw new TypeError('"this" is null or not defined');
  9459. var t = Object(this)
  9460. , i = t.length >>> 0;
  9461. if ("function" != typeof e)
  9462. throw new TypeError("predicate must be a function");
  9463. for (var n = arguments[1], r = 0; r < i; ) {
  9464. var o = t[r];
  9465. if (e.call(n, o, r, t))
  9466. return o;
  9467. r++
  9468. }
  9469. }
  9470. })
  9471. }
  9472. , {}],
  9473. 93: [function(e, t, i) {
  9474. "use strict";
  9475. var n, r, o, a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M, R, P, O, L, D, N, F, B, V, k, U, H, z, G, W, j, Y, q, X, Z, K, Q, J, ee = ee || {};
  9476. function te() {
  9477. this.backgroundElement = document.createElement("div"),
  9478. r.extend(this.backgroundElement.style, {
  9479. backgroundColor: "rgba(0,0,0,0.8)",
  9480. top: 0,
  9481. left: 0,
  9482. display: "none",
  9483. zIndex: "1000",
  9484. opacity: 0,
  9485. WebkitTransition: "opacity 0.2s linear"
  9486. }),
  9487. n.makeFullscreen(this.backgroundElement),
  9488. this.backgroundElement.style.position = "fixed",
  9489. this.domElement = document.createElement("div"),
  9490. r.extend(this.domElement.style, {
  9491. position: "fixed",
  9492. display: "none",
  9493. zIndex: "1001",
  9494. opacity: 0,
  9495. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  9496. }),
  9497. document.body.appendChild(this.backgroundElement),
  9498. document.body.appendChild(this.domElement);
  9499. var e = this;
  9500. n.bind(this.backgroundElement, "click", function() {
  9501. e.hide()
  9502. })
  9503. }
  9504. function ie(e, t, i) {
  9505. Object.defineProperty(e, t, {
  9506. get: function() {
  9507. return "RGB" === this.__state.space || re(this, t, i),
  9508. this.__state[t]
  9509. },
  9510. set: function(e) {
  9511. "RGB" !== this.__state.space && (re(this, t, i),
  9512. this.__state.space = "RGB"),
  9513. this.__state[t] = e
  9514. }
  9515. })
  9516. }
  9517. function ne(e, t) {
  9518. Object.defineProperty(e, t, {
  9519. get: function() {
  9520. return "HSV" === this.__state.space || oe(this),
  9521. this.__state[t]
  9522. },
  9523. set: function(e) {
  9524. "HSV" !== this.__state.space && (oe(this),
  9525. this.__state.space = "HSV"),
  9526. this.__state[t] = e
  9527. }
  9528. })
  9529. }
  9530. function re(e, t, i) {
  9531. if ("HEX" === e.__state.space)
  9532. e.__state[t] = a.component_from_hex(e.__state.hex, i);
  9533. else {
  9534. if ("HSV" !== e.__state.space)
  9535. throw "Corrupted color state";
  9536. l.extend(e.__state, a.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  9537. }
  9538. }
  9539. function oe(e) {
  9540. var t = a.rgb_to_hsv(e.r, e.g, e.b);
  9541. l.extend(e.__state, {
  9542. s: t.s,
  9543. v: t.v
  9544. }),
  9545. l.isNaN(t.h) ? l.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = t.h
  9546. }
  9547. function ae() {
  9548. if (this.__state = o.apply(this, arguments),
  9549. !1 === this.__state)
  9550. throw "Failed to interpret color arguments";
  9551. this.__state.a = this.__state.a || 1
  9552. }
  9553. function se(e) {
  9554. return -1 < (e = e.toString()).indexOf(".") ? e.length - e.indexOf(".") - 1 : 0
  9555. }
  9556. function le(e, t) {
  9557. this.initialValue = e[t],
  9558. this.domElement = document.createElement("div"),
  9559. this.object = e,
  9560. this.property = t,
  9561. this.__onChange = void 0,
  9562. this.__onFinishChange = void 0
  9563. }
  9564. (t.exports = ee).gui = ee.gui || {},
  9565. ee.utils = ee.utils || {},
  9566. ee.controllers = ee.controllers || {},
  9567. ee.dom = ee.dom || {},
  9568. ee.color = ee.color || {},
  9569. ee.utils.css = {
  9570. load: function(e, t) {
  9571. var i = (t = t || document).createElement("link");
  9572. i.type = "text/css",
  9573. i.rel = "stylesheet",
  9574. i.href = e,
  9575. t.getElementsByTagName("head")[0].appendChild(i)
  9576. },
  9577. inject: function(e, t) {
  9578. t = t || document;
  9579. var i = document.createElement("style");
  9580. i.type = "text/css",
  9581. i.innerHTML = e,
  9582. t.getElementsByTagName("head")[0].appendChild(i)
  9583. }
  9584. },
  9585. ee.utils.common = (Q = Array.prototype.forEach,
  9586. J = Array.prototype.slice,
  9587. {
  9588. BREAK: {},
  9589. extend: function(i) {
  9590. return this.each(J.call(arguments, 1), function(e) {
  9591. for (var t in e)
  9592. this.isUndefined(e[t]) || (i[t] = e[t])
  9593. }, this),
  9594. i
  9595. },
  9596. defaults: function(i) {
  9597. return this.each(J.call(arguments, 1), function(e) {
  9598. for (var t in e)
  9599. this.isUndefined(i[t]) && (i[t] = e[t])
  9600. }, this),
  9601. i
  9602. },
  9603. compose: function() {
  9604. var i = J.call(arguments);
  9605. return function() {
  9606. for (var e = J.call(arguments), t = i.length - 1; 0 <= t; t--)
  9607. e = [i[t].apply(this, e)];
  9608. return e[0]
  9609. }
  9610. },
  9611. each: function(e, t, i) {
  9612. if (e)
  9613. if (Q && e.forEach && e.forEach === Q)
  9614. e.forEach(t, i);
  9615. else if (e.length === e.length + 0) {
  9616. for (var n = 0, r = e.length; n < r; n++)
  9617. if (n in e && t.call(i, e[n], n) === this.BREAK)
  9618. return
  9619. } else
  9620. for (var n in e)
  9621. if (t.call(i, e[n], n) === this.BREAK)
  9622. return
  9623. },
  9624. defer: function(e) {
  9625. setTimeout(e, 0)
  9626. },
  9627. toArray: function(e) {
  9628. return e.toArray ? e.toArray() : J.call(e)
  9629. },
  9630. isUndefined: function(e) {
  9631. return void 0 === e
  9632. },
  9633. isNull: function(e) {
  9634. return null === e
  9635. },
  9636. isNaN: function(e) {
  9637. return e != e
  9638. },
  9639. isArray: Array.isArray || function(e) {
  9640. return e.constructor === Array
  9641. }
  9642. ,
  9643. isObject: function(e) {
  9644. return e === Object(e)
  9645. },
  9646. isNumber: function(e) {
  9647. return e === e + 0
  9648. },
  9649. isString: function(e) {
  9650. return e === e + ""
  9651. },
  9652. isBoolean: function(e) {
  9653. return !1 === e || !0 === e
  9654. },
  9655. isFunction: function(e) {
  9656. return "[object Function]" === Object.prototype.toString.call(e)
  9657. }
  9658. }),
  9659. ee.controllers.Controller = (ee.utils.common.extend(le.prototype, {
  9660. onChange: function(e) {
  9661. return this.__onChange = e,
  9662. this
  9663. },
  9664. onFinishChange: function(e) {
  9665. return this.__onFinishChange = e,
  9666. this
  9667. },
  9668. setValue: function(e) {
  9669. return this.object[this.property] = e,
  9670. this.__onChange && this.__onChange.call(this, e),
  9671. this.updateDisplay(),
  9672. this
  9673. },
  9674. getValue: function() {
  9675. return this.object[this.property]
  9676. },
  9677. updateDisplay: function() {
  9678. return this
  9679. },
  9680. isModified: function() {
  9681. return this.initialValue !== this.getValue()
  9682. }
  9683. }),
  9684. le),
  9685. ee.dom.dom = function(c) {
  9686. function i(e) {
  9687. if ("0" === e || c.isUndefined(e))
  9688. return 0;
  9689. var t = e.match(n);
  9690. return c.isNull(t) ? 0 : parseFloat(t[1])
  9691. }
  9692. var h = {};
  9693. c.each({
  9694. HTMLEvents: ["change"],
  9695. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9696. KeyboardEvents: ["keydown"]
  9697. }, function(e, t) {
  9698. c.each(e, function(e) {
  9699. h[e] = t
  9700. })
  9701. });
  9702. var n = /(\d+(\.\d+)?)px/
  9703. , r = {
  9704. makeSelectable: function(e, t) {
  9705. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9706. return !1
  9707. }
  9708. : function() {}
  9709. ,
  9710. e.style.MozUserSelect = t ? "auto" : "none",
  9711. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9712. e.unselectable = t ? "on" : "off")
  9713. },
  9714. makeFullscreen: function(e, t, i) {
  9715. c.isUndefined(t) && (t = !0),
  9716. c.isUndefined(i) && (i = !0),
  9717. e.style.position = "absolute",
  9718. t && (e.style.left = 0,
  9719. e.style.right = 0),
  9720. i && (e.style.top = 0,
  9721. e.style.bottom = 0)
  9722. },
  9723. fakeEvent: function(e, t, i, n) {
  9724. i = i || {};
  9725. var r = h[t];
  9726. if (!r)
  9727. throw new Error("Event type " + t + " not supported.");
  9728. var o = document.createEvent(r);
  9729. switch (r) {
  9730. case "MouseEvents":
  9731. var a = i.x || i.clientX || 0
  9732. , s = i.y || i.clientY || 0;
  9733. o.initMouseEvent(t, i.bubbles || !1, i.cancelable || !0, window, i.clickCount || 1, 0, 0, a, s, !1, !1, !1, !1, 0, null);
  9734. break;
  9735. case "KeyboardEvents":
  9736. var l = o.initKeyboardEvent || o.initKeyEvent;
  9737. c.defaults(i, {
  9738. cancelable: !0,
  9739. ctrlKey: !1,
  9740. altKey: !1,
  9741. shiftKey: !1,
  9742. metaKey: !1,
  9743. keyCode: void 0,
  9744. charCode: void 0
  9745. }),
  9746. l(t, i.bubbles || !1, i.cancelable, window, i.ctrlKey, i.altKey, i.shiftKey, i.metaKey, i.keyCode, i.charCode);
  9747. break;
  9748. default:
  9749. o.initEvent(t, i.bubbles || !1, i.cancelable || !0)
  9750. }
  9751. c.defaults(o, n),
  9752. e.dispatchEvent(o)
  9753. },
  9754. bind: function(e, t, i, n) {
  9755. return n = n || !1,
  9756. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9757. r
  9758. },
  9759. unbind: function(e, t, i, n) {
  9760. return n = n || !1,
  9761. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9762. r
  9763. },
  9764. addClass: function(e, t) {
  9765. if (void 0 === e.className)
  9766. e.className = t;
  9767. else if (e.className !== t) {
  9768. var i = e.className.split(/ +/);
  9769. -1 == i.indexOf(t) && (i.push(t),
  9770. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9771. }
  9772. return r
  9773. },
  9774. removeClass: function(e, t) {
  9775. if (t)
  9776. if (void 0 === e.className)
  9777. ;
  9778. else if (e.className === t)
  9779. e.removeAttribute("class");
  9780. else {
  9781. var i = e.className.split(/ +/)
  9782. , n = i.indexOf(t);
  9783. -1 != n && (i.splice(n, 1),
  9784. e.className = i.join(" "))
  9785. }
  9786. else
  9787. e.className = void 0;
  9788. return r
  9789. },
  9790. hasClass: function(e, t) {
  9791. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9792. },
  9793. getWidth: function(e) {
  9794. var t = getComputedStyle(e);
  9795. return i(t["border-left-width"]) + i(t["border-right-width"]) + i(t["padding-left"]) + i(t["padding-right"]) + i(t.width)
  9796. },
  9797. getHeight: function(e) {
  9798. var t = getComputedStyle(e);
  9799. return i(t["border-top-width"]) + i(t["border-bottom-width"]) + i(t["padding-top"]) + i(t["padding-bottom"]) + i(t.height)
  9800. },
  9801. getOffset: function(e) {
  9802. var t = {
  9803. left: 0,
  9804. top: 0
  9805. };
  9806. if (e.offsetParent)
  9807. for (; t.left += e.offsetLeft,
  9808. t.top += e.offsetTop,
  9809. e = e.offsetParent; )
  9810. ;
  9811. return t
  9812. },
  9813. isActive: function(e) {
  9814. return e === document.activeElement && (e.type || e.href)
  9815. }
  9816. };
  9817. return r
  9818. }(ee.utils.common),
  9819. ee.controllers.OptionController = (q = ee.controllers.Controller,
  9820. X = ee.dom.dom,
  9821. Z = ee.utils.common,
  9822. (K = function(e, t, i) {
  9823. K.superclass.call(this, e, t);
  9824. var n = this;
  9825. if (this.__select = document.createElement("select"),
  9826. Z.isArray(i)) {
  9827. var r = {};
  9828. Z.each(i, function(e) {
  9829. r[e] = e
  9830. }),
  9831. i = r
  9832. }
  9833. Z.each(i, function(e, t) {
  9834. var i = document.createElement("option");
  9835. i.innerHTML = t,
  9836. i.setAttribute("value", e),
  9837. n.__select.appendChild(i)
  9838. }),
  9839. this.updateDisplay(),
  9840. X.bind(this.__select, "change", function() {
  9841. var e = this.options[this.selectedIndex].value;
  9842. n.setValue(e)
  9843. }),
  9844. this.domElement.appendChild(this.__select)
  9845. }
  9846. ).superclass = q,
  9847. Z.extend(K.prototype, q.prototype, {
  9848. setValue: function(e) {
  9849. var t = K.superclass.prototype.setValue.call(this, e);
  9850. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9851. t
  9852. },
  9853. updateDisplay: function() {
  9854. return this.__select.value = this.getValue(),
  9855. K.superclass.prototype.updateDisplay.call(this)
  9856. }
  9857. }),
  9858. K),
  9859. ee.controllers.NumberController = (W = ee.controllers.Controller,
  9860. j = ee.utils.common,
  9861. (Y = function(e, t, i) {
  9862. Y.superclass.call(this, e, t),
  9863. i = i || {},
  9864. this.__min = i.min,
  9865. this.__max = i.max,
  9866. this.__step = i.step,
  9867. j.isUndefined(this.__step) ? 0 == this.initialValue ? this.__impliedStep = 1 : this.__impliedStep = Math.pow(10, Math.floor(Math.log(this.initialValue) / Math.LN10)) / 10 : this.__impliedStep = this.__step,
  9868. this.__precision = se(this.__impliedStep)
  9869. }
  9870. ).superclass = W,
  9871. j.extend(Y.prototype, W.prototype, {
  9872. setValue: function(e) {
  9873. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9874. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9875. Y.superclass.prototype.setValue.call(this, e)
  9876. },
  9877. min: function(e) {
  9878. return this.__min = e,
  9879. this
  9880. },
  9881. max: function(e) {
  9882. return this.__max = e,
  9883. this
  9884. },
  9885. step: function(e) {
  9886. return this.__step = e,
  9887. this.__impliedStep = e,
  9888. this.__precision = se(e),
  9889. this
  9890. }
  9891. }),
  9892. Y),
  9893. ee.controllers.NumberControllerBox = (U = ee.controllers.NumberController,
  9894. H = ee.dom.dom,
  9895. z = ee.utils.common,
  9896. (G = function(e, t, i) {
  9897. function n() {
  9898. var e = parseFloat(s.__input.value);
  9899. z.isNaN(e) || s.setValue(e)
  9900. }
  9901. function r(e) {
  9902. var t = a - e.clientY;
  9903. s.setValue(s.getValue() + t * s.__impliedStep),
  9904. a = e.clientY
  9905. }
  9906. function o() {
  9907. H.unbind(window, "mousemove", r),
  9908. H.unbind(window, "mouseup", o)
  9909. }
  9910. this.__truncationSuspended = !1,
  9911. G.superclass.call(this, e, t, i);
  9912. var a, s = this;
  9913. this.__input = document.createElement("input"),
  9914. this.__input.setAttribute("type", "text"),
  9915. H.bind(this.__input, "change", n),
  9916. H.bind(this.__input, "blur", function() {
  9917. n(),
  9918. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9919. }),
  9920. H.bind(this.__input, "mousedown", function(e) {
  9921. H.bind(window, "mousemove", r),
  9922. H.bind(window, "mouseup", o),
  9923. a = e.clientY
  9924. }),
  9925. H.bind(this.__input, "keydown", function(e) {
  9926. 13 === e.keyCode && (s.__truncationSuspended = !0,
  9927. this.blur(),
  9928. s.__truncationSuspended = !1)
  9929. }),
  9930. this.updateDisplay(),
  9931. this.domElement.appendChild(this.__input)
  9932. }
  9933. ).superclass = U,
  9934. z.extend(G.prototype, U.prototype, {
  9935. updateDisplay: function() {
  9936. return this.__input.value = this.__truncationSuspended ? this.getValue() : function(e, t) {
  9937. var i = Math.pow(10, t);
  9938. return Math.round(e * i) / i
  9939. }(this.getValue(), this.__precision),
  9940. G.superclass.prototype.updateDisplay.call(this)
  9941. }
  9942. }),
  9943. G),
  9944. ee.controllers.NumberControllerSlider = (N = ee.controllers.NumberController,
  9945. F = ee.dom.dom,
  9946. B = ee.utils.css,
  9947. V = ee.utils.common,
  9948. (k = function(e, t, i, n, r) {
  9949. function o(e) {
  9950. e.preventDefault();
  9951. var t = F.getOffset(s.__background)
  9952. , i = F.getWidth(s.__background);
  9953. return s.setValue(function(e, t, i, n, r) {
  9954. return n + (e - t) / (i - t) * (r - n)
  9955. }(e.clientX, t.left, t.left + i, s.__min, s.__max)),
  9956. !1
  9957. }
  9958. function a() {
  9959. F.unbind(window, "mousemove", o),
  9960. F.unbind(window, "mouseup", a),
  9961. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9962. }
  9963. k.superclass.call(this, e, t, {
  9964. min: i,
  9965. max: n,
  9966. step: r
  9967. });
  9968. var s = this;
  9969. this.__background = document.createElement("div"),
  9970. this.__foreground = document.createElement("div"),
  9971. F.bind(this.__background, "mousedown", function(e) {
  9972. F.bind(window, "mousemove", o),
  9973. F.bind(window, "mouseup", a),
  9974. o(e)
  9975. }),
  9976. F.addClass(this.__background, "slider"),
  9977. F.addClass(this.__foreground, "slider-fg"),
  9978. this.updateDisplay(),
  9979. this.__background.appendChild(this.__foreground),
  9980. this.domElement.appendChild(this.__background)
  9981. }
  9982. ).superclass = N,
  9983. k.useDefaultStyles = function() {
  9984. B.inject("/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n.slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: '';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}")
  9985. }
  9986. ,
  9987. V.extend(k.prototype, N.prototype, {
  9988. updateDisplay: function() {
  9989. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  9990. return this.__foreground.style.width = 100 * e + "%",
  9991. k.superclass.prototype.updateDisplay.call(this)
  9992. }
  9993. }),
  9994. k),
  9995. ee.controllers.FunctionController = (P = ee.controllers.Controller,
  9996. O = ee.dom.dom,
  9997. L = ee.utils.common,
  9998. (D = function(e, t, i) {
  9999. D.superclass.call(this, e, t);
  10000. var n = this;
  10001. this.__button = document.createElement("div"),
  10002. this.__button.innerHTML = void 0 === i ? "Fire" : i,
  10003. O.bind(this.__button, "click", function(e) {
  10004. return e.preventDefault(),
  10005. n.fire(),
  10006. !1
  10007. }),
  10008. O.addClass(this.__button, "button"),
  10009. this.domElement.appendChild(this.__button)
  10010. }
  10011. ).superclass = P,
  10012. L.extend(D.prototype, P.prototype, {
  10013. fire: function() {
  10014. this.__onChange && this.__onChange.call(this),
  10015. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10016. this.getValue().call(this.object)
  10017. }
  10018. }),
  10019. D),
  10020. ee.controllers.BooleanController = (x = ee.controllers.Controller,
  10021. S = ee.dom.dom,
  10022. M = ee.utils.common,
  10023. (R = function(e, t) {
  10024. R.superclass.call(this, e, t);
  10025. var i = this;
  10026. this.__prev = this.getValue(),
  10027. this.__checkbox = document.createElement("input"),
  10028. this.__checkbox.setAttribute("type", "checkbox"),
  10029. S.bind(this.__checkbox, "change", function() {
  10030. i.setValue(!i.__prev)
  10031. }, !1),
  10032. this.domElement.appendChild(this.__checkbox),
  10033. this.updateDisplay()
  10034. }
  10035. ).superclass = x,
  10036. M.extend(R.prototype, x.prototype, {
  10037. setValue: function(e) {
  10038. var t = R.superclass.prototype.setValue.call(this, e);
  10039. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10040. this.__prev = this.getValue(),
  10041. t
  10042. },
  10043. updateDisplay: function() {
  10044. return !0 === this.getValue() ? (this.__checkbox.setAttribute("checked", "checked"),
  10045. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  10046. R.superclass.prototype.updateDisplay.call(this)
  10047. }
  10048. }),
  10049. R),
  10050. ee.color.toString = (T = ee.utils.common,
  10051. function(e) {
  10052. if (1 == e.a || T.isUndefined(e.a)) {
  10053. for (var t = e.hex.toString(16); t.length < 6; )
  10054. t = "0" + t;
  10055. return "#" + t
  10056. }
  10057. return "rgba(" + Math.round(e.r) + "," + Math.round(e.g) + "," + Math.round(e.b) + "," + e.a + ")"
  10058. }
  10059. ),
  10060. ee.color.interpret = (I = ee.color.toString,
  10061. E = ee.utils.common,
  10062. w = [{
  10063. litmus: E.isString,
  10064. conversions: {
  10065. THREE_CHAR_HEX: {
  10066. read: function(e) {
  10067. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10068. return null !== t && {
  10069. space: "HEX",
  10070. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10071. }
  10072. },
  10073. write: I
  10074. },
  10075. SIX_CHAR_HEX: {
  10076. read: function(e) {
  10077. var t = e.match(/^#([A-F0-9]{6})$/i);
  10078. return null !== t && {
  10079. space: "HEX",
  10080. hex: parseInt("0x" + t[1].toString())
  10081. }
  10082. },
  10083. write: I
  10084. },
  10085. CSS_RGB: {
  10086. read: function(e) {
  10087. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10088. return null !== t && {
  10089. space: "RGB",
  10090. r: parseFloat(t[1]),
  10091. g: parseFloat(t[2]),
  10092. b: parseFloat(t[3])
  10093. }
  10094. },
  10095. write: I
  10096. },
  10097. CSS_RGBA: {
  10098. read: function(e) {
  10099. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10100. return null !== t && {
  10101. space: "RGB",
  10102. r: parseFloat(t[1]),
  10103. g: parseFloat(t[2]),
  10104. b: parseFloat(t[3]),
  10105. a: parseFloat(t[4])
  10106. }
  10107. },
  10108. write: I
  10109. }
  10110. }
  10111. }, {
  10112. litmus: E.isNumber,
  10113. conversions: {
  10114. HEX: {
  10115. read: function(e) {
  10116. return {
  10117. space: "HEX",
  10118. hex: e,
  10119. conversionName: "HEX"
  10120. }
  10121. },
  10122. write: function(e) {
  10123. return e.hex
  10124. }
  10125. }
  10126. }
  10127. }, {
  10128. litmus: E.isArray,
  10129. conversions: {
  10130. RGB_ARRAY: {
  10131. read: function(e) {
  10132. return 3 == e.length && {
  10133. space: "RGB",
  10134. r: e[0],
  10135. g: e[1],
  10136. b: e[2]
  10137. }
  10138. },
  10139. write: function(e) {
  10140. return [e.r, e.g, e.b]
  10141. }
  10142. },
  10143. RGBA_ARRAY: {
  10144. read: function(e) {
  10145. return 4 == e.length && {
  10146. space: "RGB",
  10147. r: e[0],
  10148. g: e[1],
  10149. b: e[2],
  10150. a: e[3]
  10151. }
  10152. },
  10153. write: function(e) {
  10154. return [e.r, e.g, e.b, e.a]
  10155. }
  10156. }
  10157. }
  10158. }, {
  10159. litmus: E.isObject,
  10160. conversions: {
  10161. RGBA_OBJ: {
  10162. read: function(e) {
  10163. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b) && E.isNumber(e.a)) && {
  10164. space: "RGB",
  10165. r: e.r,
  10166. g: e.g,
  10167. b: e.b,
  10168. a: e.a
  10169. }
  10170. },
  10171. write: function(e) {
  10172. return {
  10173. r: e.r,
  10174. g: e.g,
  10175. b: e.b,
  10176. a: e.a
  10177. }
  10178. }
  10179. },
  10180. RGB_OBJ: {
  10181. read: function(e) {
  10182. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b)) && {
  10183. space: "RGB",
  10184. r: e.r,
  10185. g: e.g,
  10186. b: e.b
  10187. }
  10188. },
  10189. write: function(e) {
  10190. return {
  10191. r: e.r,
  10192. g: e.g,
  10193. b: e.b
  10194. }
  10195. }
  10196. },
  10197. HSVA_OBJ: {
  10198. read: function(e) {
  10199. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v) && E.isNumber(e.a)) && {
  10200. space: "HSV",
  10201. h: e.h,
  10202. s: e.s,
  10203. v: e.v,
  10204. a: e.a
  10205. }
  10206. },
  10207. write: function(e) {
  10208. return {
  10209. h: e.h,
  10210. s: e.s,
  10211. v: e.v,
  10212. a: e.a
  10213. }
  10214. }
  10215. },
  10216. HSV_OBJ: {
  10217. read: function(e) {
  10218. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v)) && {
  10219. space: "HSV",
  10220. h: e.h,
  10221. s: e.s,
  10222. v: e.v
  10223. }
  10224. },
  10225. write: function(e) {
  10226. return {
  10227. h: e.h,
  10228. s: e.s,
  10229. v: e.v
  10230. }
  10231. }
  10232. }
  10233. }
  10234. }],
  10235. function() {
  10236. b = !1;
  10237. var i = 1 < arguments.length ? E.toArray(arguments) : arguments[0];
  10238. return E.each(w, function(e) {
  10239. if (e.litmus(i))
  10240. return E.each(e.conversions, function(e, t) {
  10241. if (_ = e.read(i),
  10242. !1 === b && !1 !== _)
  10243. return (b = _).conversionName = t,
  10244. _.conversion = e,
  10245. E.BREAK
  10246. }),
  10247. E.BREAK
  10248. }),
  10249. b
  10250. }
  10251. ),
  10252. ee.GUI = ee.gui.GUI = function(e, t, i, c, h, u, d, p, f, n, g, r, o, m, v) {
  10253. function y(e, t, i, n) {
  10254. if (void 0 === t[i])
  10255. throw new Error("Object " + t + ' has no property "' + i + '"');
  10256. var r;
  10257. if (n.color)
  10258. r = new g(t,i);
  10259. else {
  10260. var o = [t, i].concat(n.factoryArgs);
  10261. r = c.apply(e, o)
  10262. }
  10263. n.before instanceof h && (n.before = n.before.__li),
  10264. C(e, r),
  10265. m.addClass(r.domElement, "c");
  10266. var a = document.createElement("span");
  10267. m.addClass(a, "property-name"),
  10268. a.innerHTML = r.property;
  10269. var s = document.createElement("div");
  10270. s.appendChild(a),
  10271. s.appendChild(r.domElement);
  10272. var l = A(e, s, n.before);
  10273. return m.addClass(l, R.CLASS_CONTROLLER_ROW),
  10274. m.addClass(l, typeof r.getValue()),
  10275. function(t, i, n) {
  10276. if (n.__li = i,
  10277. n.__gui = t,
  10278. v.extend(n, {
  10279. options: function(e) {
  10280. return 1 < arguments.length ? (n.remove(),
  10281. y(t, n.object, n.property, {
  10282. before: n.__li.nextElementSibling,
  10283. factoryArgs: [v.toArray(arguments)]
  10284. })) : v.isArray(e) || v.isObject(e) ? (n.remove(),
  10285. y(t, n.object, n.property, {
  10286. before: n.__li.nextElementSibling,
  10287. factoryArgs: [e]
  10288. })) : void 0
  10289. },
  10290. name: function(e) {
  10291. return n.__li.firstElementChild.firstElementChild.innerHTML = e,
  10292. n
  10293. },
  10294. listen: function() {
  10295. return n.__gui.listen(n),
  10296. n
  10297. },
  10298. remove: function() {
  10299. return n.__gui.remove(n),
  10300. n
  10301. }
  10302. }),
  10303. n instanceof f) {
  10304. var r = new p(n.object,n.property,{
  10305. min: n.__min,
  10306. max: n.__max,
  10307. step: n.__step
  10308. });
  10309. v.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10310. var t = n[e]
  10311. , i = r[e];
  10312. n[e] = r[e] = function() {
  10313. var e = Array.prototype.slice.call(arguments);
  10314. return t.apply(n, e),
  10315. i.apply(r, e)
  10316. }
  10317. }),
  10318. m.addClass(i, "has-slider"),
  10319. n.domElement.insertBefore(r.domElement, n.domElement.firstElementChild)
  10320. } else if (n instanceof p) {
  10321. var e = function(e) {
  10322. return v.isNumber(n.__min) && v.isNumber(n.__max) ? (n.remove(),
  10323. y(t, n.object, n.property, {
  10324. before: n.__li.nextElementSibling,
  10325. factoryArgs: [n.__min, n.__max, n.__step]
  10326. })) : e
  10327. };
  10328. n.min = v.compose(e, n.min),
  10329. n.max = v.compose(e, n.max)
  10330. } else
  10331. n instanceof u ? (m.bind(i, "click", function() {
  10332. m.fakeEvent(n.__checkbox, "click")
  10333. }),
  10334. m.bind(n.__checkbox, "click", function(e) {
  10335. e.stopPropagation()
  10336. })) : n instanceof d ? (m.bind(i, "click", function() {
  10337. m.fakeEvent(n.__button, "click")
  10338. }),
  10339. m.bind(i, "mouseover", function() {
  10340. m.addClass(n.__button, "hover")
  10341. }),
  10342. m.bind(i, "mouseout", function() {
  10343. m.removeClass(n.__button, "hover")
  10344. })) : n instanceof g && (m.addClass(i, "color"),
  10345. n.updateDisplay = v.compose(function(e) {
  10346. return i.style.borderLeftColor = n.__color.toString(),
  10347. e
  10348. }, n.updateDisplay),
  10349. n.updateDisplay());
  10350. n.setValue = v.compose(function(e) {
  10351. return t.getRoot().__preset_select && n.isModified() && _(t.getRoot(), !0),
  10352. e
  10353. }, n.setValue)
  10354. }(e, l, r),
  10355. e.__controllers.push(r),
  10356. r
  10357. }
  10358. function A(e, t, i) {
  10359. var n = document.createElement("li");
  10360. return t && n.appendChild(t),
  10361. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10362. e.onResize(),
  10363. n
  10364. }
  10365. function C(e, t) {
  10366. var i = e.getRoot()
  10367. , n = i.__rememberedObjects.indexOf(t.object);
  10368. if (-1 != n) {
  10369. var r = i.__rememberedObjectIndecesToControllers[n];
  10370. if (void 0 === r && (r = {},
  10371. i.__rememberedObjectIndecesToControllers[n] = r),
  10372. r[t.property] = t,
  10373. i.load && i.load.remembered) {
  10374. var o, a = i.load.remembered;
  10375. if (a[e.preset])
  10376. o = a[e.preset];
  10377. else {
  10378. if (!a[T])
  10379. return;
  10380. o = a[T]
  10381. }
  10382. if (o[n] && void 0 !== o[n][t.property]) {
  10383. var s = o[n][t.property];
  10384. t.initialValue = s,
  10385. t.setValue(s)
  10386. }
  10387. }
  10388. }
  10389. }
  10390. function I(e, t) {
  10391. return document.location.href + "." + t
  10392. }
  10393. function l(e, t) {
  10394. e.domElement.style.width = t + "px",
  10395. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10396. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10397. }
  10398. function a(r, o) {
  10399. var a = {};
  10400. return v.each(r.__rememberedObjects, function(e, t) {
  10401. var i = {}
  10402. , n = r.__rememberedObjectIndecesToControllers[t];
  10403. v.each(n, function(e, t) {
  10404. i[t] = o ? e.initialValue : e.getValue()
  10405. }),
  10406. a[t] = i
  10407. }),
  10408. a
  10409. }
  10410. function E(e, t, i) {
  10411. var n = document.createElement("option");
  10412. n.innerHTML = t,
  10413. n.value = t,
  10414. e.__preset_select.appendChild(n),
  10415. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10416. }
  10417. function _(e, t) {
  10418. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10419. i.innerHTML = t ? i.value + "*" : i.value
  10420. }
  10421. e.inject(".dg {\n /** Clear list styles */\n /* Auto-place container */\n /* Auto-placed GUI's */\n /* Line items that don't contain folders. */\n /** Folder names */\n /** Hides closed items */\n /** Controller row */\n /** Name-half (left) */\n /** Controller-half (right) */\n /** Controller placement */\n /** Shorter number boxes when slider is present. */\n /** Ensure the entire boolean and function row shows a hand */ }\n .dg ul {\n list-style: none;\n margin: 0;\n padding: 0;\n width: 100%;\n clear: both; }\n .dg.ac {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 0;\n z-index: 0; }\n .dg:not(.ac) .main {\n /** Exclude mains in ac so that we don't hide close button */\n overflow: hidden; }\n .dg.main {\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear; }\n .dg.main.taller-than-window {\n overflow-y: auto; }\n .dg.main.taller-than-window .close-button {\n opacity: 1;\n /* TODO, these are style notes */\n margin-top: -1px;\n border-top: 1px solid #2c2c2c; }\n .dg.main ul.closed .close-button {\n opacity: 1 !important; }\n .dg.main:hover .close-button,\n .dg.main .close-button.drag {\n opacity: 1; }\n .dg.main .close-button {\n /*opacity: 0;*/\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear;\n border: 0;\n position: absolute;\n line-height: 19px;\n height: 20px;\n /* TODO, these are style notes */\n cursor: pointer;\n text-align: center;\n background-color: #000; }\n .dg.main .close-button:hover {\n background-color: #111; }\n .dg.a {\n float: right;\n margin-right: 15px;\n overflow-x: hidden; }\n .dg.a.has-save > ul {\n margin-top: 27px; }\n .dg.a.has-save > ul.closed {\n margin-top: 0; }\n .dg.a .save-row {\n position: fixed;\n top: 0;\n z-index: 1002; }\n .dg li {\n -webkit-transition: height 0.1s ease-out;\n -o-transition: height 0.1s ease-out;\n -moz-transition: height 0.1s ease-out;\n transition: height 0.1s ease-out; }\n .dg li:not(.folder) {\n cursor: auto;\n height: 27px;\n line-height: 27px;\n overflow: hidden;\n padding: 0 4px 0 5px; }\n .dg li.folder {\n padding: 0;\n border-left: 4px solid rgba(0, 0, 0, 0); }\n .dg li.title {\n cursor: pointer;\n margin-left: -4px; }\n .dg .closed li:not(.title),\n .dg .closed ul li,\n .dg .closed ul li > * {\n height: 0;\n overflow: hidden;\n border: 0; }\n .dg .cr {\n clear: both;\n padding-left: 3px;\n height: 27px; }\n .dg .property-name {\n cursor: default;\n float: left;\n clear: left;\n width: 40%;\n overflow: hidden;\n text-overflow: ellipsis; }\n .dg .c {\n float: left;\n width: 60%; }\n .dg .c input[type=text] {\n border: 0;\n margin-top: 4px;\n padding: 3px;\n width: 100%;\n float: right; }\n .dg .has-slider input[type=text] {\n width: 30%;\n /*display: none;*/\n margin-left: 0; }\n .dg .slider {\n float: left;\n width: 66%;\n margin-left: -5px;\n margin-right: 0;\n height: 19px;\n margin-top: 4px; }\n .dg .slider-fg {\n height: 100%; }\n .dg .c input[type=checkbox] {\n margin-top: 9px; }\n .dg .c select {\n margin-top: 5px; }\n .dg .cr.function,\n .dg .cr.function .property-name,\n .dg .cr.function *,\n .dg .cr.boolean,\n .dg .cr.boolean * {\n cursor: pointer; }\n .dg .selector {\n display: none;\n position: absolute;\n margin-left: -9px;\n margin-top: 23px;\n z-index: 10; }\n .dg .c:hover .selector,\n .dg .selector.drag {\n display: block; }\n .dg li.save-row {\n padding: 0; }\n .dg li.save-row .button {\n display: inline-block;\n padding: 0px 6px; }\n .dg.dialogue {\n background-color: #222;\n width: 460px;\n padding: 15px;\n font-size: 13px;\n line-height: 15px; }\n\n/* TODO Separate style and structure */\n#dg-new-constructor {\n padding: 10px;\n color: #222;\n font-family: Monaco, monospace;\n font-size: 10px;\n border: 0;\n resize: none;\n box-shadow: inset 1px 1px 1px #888;\n word-wrap: break-word;\n margin: 12px 0;\n display: block;\n width: 440px;\n overflow-y: scroll;\n height: 100px;\n position: relative; }\n\n#dg-local-explain {\n display: none;\n font-size: 11px;\n line-height: 17px;\n border-radius: 3px;\n background-color: #333;\n padding: 8px;\n margin-top: 10px; }\n #dg-local-explain code {\n font-size: 10px; }\n\n#dat-gui-save-locally {\n display: none; }\n\n/** Main type */\n.dg {\n color: #eee;\n font: 11px 'Lucida Grande', sans-serif;\n text-shadow: 0 -1px 0 #111;\n /** Auto place */\n /* Controller row, <li> */\n /** Controllers */ }\n .dg.main {\n /** Scrollbar */ }\n .dg.main::-webkit-scrollbar {\n width: 5px;\n background: #1a1a1a; }\n .dg.main::-webkit-scrollbar-corner {\n height: 0;\n display: none; }\n .dg.main::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: #676767; }\n .dg li:not(.folder) {\n background: #1a1a1a;\n border-bottom: 1px solid #2c2c2c; }\n .dg li.save-row {\n line-height: 25px;\n background: #dad5cb;\n border: 0; }\n .dg li.save-row select {\n margin-left: 5px;\n width: 108px; }\n .dg li.save-row .button {\n margin-left: 5px;\n margin-top: 1px;\n border-radius: 2px;\n font-size: 9px;\n line-height: 7px;\n padding: 4px 4px 5px 4px;\n background: #c5bdad;\n color: #fff;\n text-shadow: 0 1px 0 #b0a58f;\n box-shadow: 0 -1px 0 #b0a58f;\n cursor: pointer; }\n .dg li.save-row .button.gears {\n background: #c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;\n height: 7px;\n width: 8px; }\n .dg li.save-row .button:hover {\n background-color: #bab19e;\n box-shadow: 0 -1px 0 #b0a58f; }\n .dg li.folder {\n border-bottom: 0; }\n .dg li.title {\n padding-left: 16px;\n background: black url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;\n cursor: pointer;\n border-bottom: 1px solid rgba(255, 255, 255, 0.2); }\n .dg .closed li.title {\n background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==); }\n .dg .cr.boolean {\n border-left: 3px solid #806787; }\n .dg .cr.function {\n border-left: 3px solid #e61d5f; }\n .dg .cr.number {\n border-left: 3px solid #2fa1d6; }\n .dg .cr.number input[type=text] {\n color: #2fa1d6; }\n .dg .cr.string {\n border-left: 3px solid #1ed36f; }\n .dg .cr.string input[type=text] {\n color: #1ed36f; }\n .dg .cr.function:hover, .dg .cr.boolean:hover {\n background: #111; }\n .dg .c input[type=text] {\n background: #303030;\n outline: none; }\n .dg .c input[type=text]:hover {\n background: #3c3c3c; }\n .dg .c input[type=text]:focus {\n background: #494949;\n color: #fff; }\n .dg .c .slider {\n background: #303030;\n cursor: ew-resize; }\n .dg .c .slider-fg {\n background: #2fa1d6; }\n .dg .c .slider:hover {\n background: #3c3c3c; }\n .dg .c .slider:hover .slider-fg {\n background: #44abda; }\n");
  10422. var b, w, T = "Default", x = function() {
  10423. try {
  10424. return "localStorage"in window && null !== window.localStorage
  10425. } catch (e) {
  10426. return !1
  10427. }
  10428. }(), S = !0, s = !1, M = [], R = function(t) {
  10429. var i = this;
  10430. this.domElement = document.createElement("div"),
  10431. this.__ul = document.createElement("ul"),
  10432. this.domElement.appendChild(this.__ul),
  10433. m.addClass(this.domElement, "dg"),
  10434. this.__folders = {},
  10435. this.__controllers = [],
  10436. this.__rememberedObjects = [],
  10437. this.__rememberedObjectIndecesToControllers = [],
  10438. this.__listening = [],
  10439. t = t || {},
  10440. t = v.defaults(t, {
  10441. autoPlace: !0,
  10442. width: R.DEFAULT_WIDTH
  10443. }),
  10444. t = v.defaults(t, {
  10445. resizable: t.autoPlace,
  10446. hideable: t.autoPlace
  10447. }),
  10448. v.isUndefined(t.load) ? t.load = {
  10449. preset: T
  10450. } : t.preset && (t.load.preset = t.preset),
  10451. v.isUndefined(t.parent) && t.hideable && M.push(this),
  10452. t.resizable = v.isUndefined(t.parent) && t.resizable,
  10453. t.autoPlace && v.isUndefined(t.scrollable) && (t.scrollable = !0);
  10454. var n, e, r = x && "true" === localStorage.getItem(I(0, "isLocal"));
  10455. if (Object.defineProperties(this, {
  10456. parent: {
  10457. get: function() {
  10458. return t.parent
  10459. }
  10460. },
  10461. scrollable: {
  10462. get: function() {
  10463. return t.scrollable
  10464. }
  10465. },
  10466. autoPlace: {
  10467. get: function() {
  10468. return t.autoPlace
  10469. }
  10470. },
  10471. preset: {
  10472. get: function() {
  10473. return i.parent ? i.getRoot().preset : t.load.preset
  10474. },
  10475. set: function(e) {
  10476. i.parent ? i.getRoot().preset = e : t.load.preset = e,
  10477. function(e) {
  10478. for (var t = 0; t < e.__preset_select.length; t++)
  10479. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10480. }(this),
  10481. i.revert()
  10482. }
  10483. },
  10484. width: {
  10485. get: function() {
  10486. return t.width
  10487. },
  10488. set: function(e) {
  10489. t.width = e,
  10490. l(i, e)
  10491. }
  10492. },
  10493. name: {
  10494. get: function() {
  10495. return t.name
  10496. },
  10497. set: function(e) {
  10498. t.name = e,
  10499. a && (a.innerHTML = t.name)
  10500. }
  10501. },
  10502. closed: {
  10503. get: function() {
  10504. return t.closed
  10505. },
  10506. set: function(e) {
  10507. t.closed = e,
  10508. t.closed ? m.addClass(i.__ul, R.CLASS_CLOSED) : m.removeClass(i.__ul, R.CLASS_CLOSED),
  10509. this.onResize(),
  10510. i.__closeButton && (i.__closeButton.innerHTML = e ? R.TEXT_OPEN : R.TEXT_CLOSED)
  10511. }
  10512. },
  10513. load: {
  10514. get: function() {
  10515. return t.load
  10516. }
  10517. },
  10518. useLocalStorage: {
  10519. get: function() {
  10520. return r
  10521. },
  10522. set: function(e) {
  10523. x && ((r = e) ? m.bind(window, "unload", n) : m.unbind(window, "unload", n),
  10524. localStorage.setItem(I(0, "isLocal"), e))
  10525. }
  10526. }
  10527. }),
  10528. v.isUndefined(t.parent)) {
  10529. if (t.closed = !1,
  10530. m.addClass(this.domElement, R.CLASS_MAIN),
  10531. m.makeSelectable(this.domElement, !1),
  10532. x && r) {
  10533. i.useLocalStorage = !0;
  10534. var o = localStorage.getItem(I(0, "gui"));
  10535. o && (t.load = JSON.parse(o))
  10536. }
  10537. this.__closeButton = document.createElement("div"),
  10538. this.__closeButton.innerHTML = R.TEXT_CLOSED,
  10539. m.addClass(this.__closeButton, R.CLASS_CLOSE_BUTTON),
  10540. this.domElement.appendChild(this.__closeButton),
  10541. m.bind(this.__closeButton, "click", function() {
  10542. i.closed = !i.closed
  10543. })
  10544. } else {
  10545. void 0 === t.closed && (t.closed = !0);
  10546. var a = document.createTextNode(t.name);
  10547. m.addClass(a, "controller-name");
  10548. var s = A(i, a);
  10549. m.addClass(this.__ul, R.CLASS_CLOSED),
  10550. m.addClass(s, "title"),
  10551. m.bind(s, "click", function(e) {
  10552. return e.preventDefault(),
  10553. i.closed = !i.closed,
  10554. !1
  10555. }),
  10556. t.closed || (this.closed = !1)
  10557. }
  10558. t.autoPlace && (v.isUndefined(t.parent) && (S && (w = document.createElement("div"),
  10559. m.addClass(w, "dg"),
  10560. m.addClass(w, R.CLASS_AUTO_PLACE_CONTAINER),
  10561. document.body.appendChild(w),
  10562. S = !1),
  10563. w.appendChild(this.domElement),
  10564. m.addClass(this.domElement, R.CLASS_AUTO_PLACE)),
  10565. this.parent || l(i, t.width)),
  10566. m.bind(window, "resize", function() {
  10567. i.onResize()
  10568. }),
  10569. m.bind(this.__ul, "webkitTransitionEnd", function() {
  10570. i.onResize()
  10571. }),
  10572. m.bind(this.__ul, "transitionend", function() {
  10573. i.onResize()
  10574. }),
  10575. m.bind(this.__ul, "oTransitionEnd", function() {
  10576. i.onResize()
  10577. }),
  10578. this.onResize(),
  10579. t.resizable && function(t) {
  10580. function e(e) {
  10581. return e.preventDefault(),
  10582. r = e.clientX,
  10583. m.addClass(t.__closeButton, R.CLASS_DRAG),
  10584. m.bind(window, "mousemove", i),
  10585. m.bind(window, "mouseup", n),
  10586. !1
  10587. }
  10588. function i(e) {
  10589. return e.preventDefault(),
  10590. t.width += r - e.clientX,
  10591. t.onResize(),
  10592. r = e.clientX,
  10593. !1
  10594. }
  10595. function n() {
  10596. m.removeClass(t.__closeButton, R.CLASS_DRAG),
  10597. m.unbind(window, "mousemove", i),
  10598. m.unbind(window, "mouseup", n)
  10599. }
  10600. var r;
  10601. t.__resize_handle = document.createElement("div"),
  10602. v.extend(t.__resize_handle.style, {
  10603. width: "6px",
  10604. marginLeft: "-3px",
  10605. height: "200px",
  10606. cursor: "ew-resize",
  10607. position: "absolute"
  10608. }),
  10609. m.bind(t.__resize_handle, "mousedown", e),
  10610. m.bind(t.__closeButton, "mousedown", e),
  10611. t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild)
  10612. }(this),
  10613. n = function() {
  10614. x && "true" === localStorage.getItem(I(0, "isLocal")) && localStorage.setItem(I(0, "gui"), JSON.stringify(i.getSaveObject()))
  10615. }
  10616. ,
  10617. this.saveToLocalStorageIfPossible = n,
  10618. i.getRoot(),
  10619. t.parent || ((e = i.getRoot()).width += 1,
  10620. v.defer(function() {
  10621. e.width -= 1
  10622. }))
  10623. };
  10624. return R.toggleHide = function() {
  10625. s = !s,
  10626. v.each(M, function(e) {
  10627. e.domElement.style.zIndex = s ? -999 : 999,
  10628. e.domElement.style.opacity = s ? 0 : 1
  10629. })
  10630. }
  10631. ,
  10632. R.CLASS_AUTO_PLACE = "a",
  10633. R.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10634. R.CLASS_MAIN = "main",
  10635. R.CLASS_CONTROLLER_ROW = "cr",
  10636. R.CLASS_TOO_TALL = "taller-than-window",
  10637. R.CLASS_CLOSED = "closed",
  10638. R.CLASS_CLOSE_BUTTON = "close-button",
  10639. R.CLASS_DRAG = "drag",
  10640. R.DEFAULT_WIDTH = 245,
  10641. R.TEXT_CLOSED = "Close Controls",
  10642. R.TEXT_OPEN = "Open Controls",
  10643. m.bind(window, "keydown", function(e) {
  10644. "text" === document.activeElement.type || 72 !== e.which && 72 != e.keyCode || R.toggleHide()
  10645. }, !1),
  10646. v.extend(R.prototype, {
  10647. add: function(e, t) {
  10648. return y(this, e, t, {
  10649. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10650. })
  10651. },
  10652. addColor: function(e, t) {
  10653. return y(this, e, t, {
  10654. color: !0
  10655. })
  10656. },
  10657. remove: function(e) {
  10658. this.__ul.removeChild(e.__li),
  10659. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10660. var t = this;
  10661. v.defer(function() {
  10662. t.onResize()
  10663. })
  10664. },
  10665. destroy: function() {
  10666. this.autoPlace && w.removeChild(this.domElement)
  10667. },
  10668. addFolder: function(e) {
  10669. if (void 0 !== this.__folders[e])
  10670. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10671. var t = {
  10672. name: e,
  10673. parent: this
  10674. };
  10675. t.autoPlace = this.autoPlace,
  10676. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10677. t.load = this.load.folders[e]);
  10678. var i = new R(t);
  10679. this.__folders[e] = i;
  10680. var n = A(this, i.domElement);
  10681. return m.addClass(n, "folder"),
  10682. i
  10683. },
  10684. open: function() {
  10685. this.closed = !1
  10686. },
  10687. close: function() {
  10688. this.closed = !0
  10689. },
  10690. onResize: function() {
  10691. var t = this.getRoot();
  10692. if (t.scrollable) {
  10693. var e = m.getOffset(t.__ul).top
  10694. , i = 0;
  10695. v.each(t.__ul.childNodes, function(e) {
  10696. t.autoPlace && e === t.__save_row || (i += m.getHeight(e))
  10697. }),
  10698. $("#player").height() - e - 20 < i ? (m.addClass(t.domElement, R.CLASS_TOO_TALL),
  10699. t.__ul.style.height = $("#player").height() - e - 20 + "px") : (m.removeClass(t.domElement, R.CLASS_TOO_TALL),
  10700. t.__ul.style.height = "auto")
  10701. }
  10702. t.__resize_handle && v.defer(function() {
  10703. t.__resize_handle.style.height = t.__ul.offsetHeight + "px"
  10704. }),
  10705. t.__closeButton && (t.__closeButton.style.width = t.width + "px")
  10706. },
  10707. remember: function() {
  10708. if (v.isUndefined(b) && ((b = new o).domElement.innerHTML = '<div id="dg-save" class="dg dialogue">\n\n Here\'s the new load parameter for your <code>GUI</code>\'s constructor:\n\n <textarea id="dg-new-constructor"></textarea>\n\n <div id="dg-save-locally">\n\n <input id="dg-local-storage" type="checkbox"/> Automatically save\n values to <code>localStorage</code> on exit.\n\n <div id="dg-local-explain">The values saved to <code>localStorage</code> will\n override those passed to <code>dat.GUI</code>\'s constructor. This makes it\n easier to work incrementally, but <code>localStorage</code> is fragile,\n and your friends may not see the same values you do.\n \n </div>\n \n </div>\n\n</div>'),
  10709. this.parent)
  10710. throw new Error("You can only call remember on a top level GUI.");
  10711. var t = this;
  10712. v.each(Array.prototype.slice.call(arguments), function(e) {
  10713. 0 == t.__rememberedObjects.length && function(i) {
  10714. var e = i.__save_row = document.createElement("li");
  10715. m.addClass(i.domElement, "has-save"),
  10716. i.__ul.insertBefore(e, i.__ul.firstChild),
  10717. m.addClass(e, "save-row");
  10718. var t = document.createElement("span");
  10719. t.innerHTML = "&nbsp;",
  10720. m.addClass(t, "button gears");
  10721. var n = document.createElement("span");
  10722. n.innerHTML = "Save",
  10723. m.addClass(n, "button"),
  10724. m.addClass(n, "save");
  10725. var r = document.createElement("span");
  10726. r.innerHTML = "New",
  10727. m.addClass(r, "button"),
  10728. m.addClass(r, "save-as");
  10729. var o = document.createElement("span");
  10730. o.innerHTML = "Revert",
  10731. m.addClass(o, "button"),
  10732. m.addClass(o, "revert");
  10733. var a = i.__preset_select = document.createElement("select");
  10734. if (i.load && i.load.remembered ? v.each(i.load.remembered, function(e, t) {
  10735. E(i, t, t == i.preset)
  10736. }) : E(i, T, !1),
  10737. m.bind(a, "change", function() {
  10738. for (var e = 0; e < i.__preset_select.length; e++)
  10739. i.__preset_select[e].innerHTML = i.__preset_select[e].value;
  10740. i.preset = this.value
  10741. }),
  10742. e.appendChild(a),
  10743. e.appendChild(t),
  10744. e.appendChild(n),
  10745. e.appendChild(r),
  10746. e.appendChild(o),
  10747. x) {
  10748. var s = document.getElementById("dg-save-locally")
  10749. , l = document.getElementById("dg-local-explain");
  10750. s.style.display = "block";
  10751. var c = document.getElementById("dg-local-storage");
  10752. "true" === localStorage.getItem(I(0, "isLocal")) && c.setAttribute("checked", "checked");
  10753. var h = function() {
  10754. l.style.display = i.useLocalStorage ? "block" : "none"
  10755. };
  10756. h(),
  10757. m.bind(c, "change", function() {
  10758. i.useLocalStorage = !i.useLocalStorage,
  10759. h()
  10760. })
  10761. }
  10762. var u = document.getElementById("dg-new-constructor");
  10763. m.bind(u, "keydown", function(e) {
  10764. !e.metaKey || 67 !== e.which && 67 != e.keyCode || b.hide()
  10765. }),
  10766. m.bind(t, "click", function() {
  10767. u.innerHTML = JSON.stringify(i.getSaveObject(), void 0, 2),
  10768. b.show(),
  10769. u.focus(),
  10770. u.select()
  10771. }),
  10772. m.bind(n, "click", function() {
  10773. i.save()
  10774. }),
  10775. m.bind(r, "click", function() {
  10776. var e = prompt("Enter a new preset name.");
  10777. e && i.saveAs(e)
  10778. }),
  10779. m.bind(o, "click", function() {
  10780. i.revert()
  10781. })
  10782. }(t),
  10783. -1 == t.__rememberedObjects.indexOf(e) && t.__rememberedObjects.push(e)
  10784. }),
  10785. this.autoPlace && l(this, this.width)
  10786. },
  10787. getRoot: function() {
  10788. for (var e = this; e.parent; )
  10789. e = e.parent;
  10790. return e
  10791. },
  10792. getSaveObject: function() {
  10793. var i = this.load;
  10794. return i.closed = this.closed,
  10795. 0 < this.__rememberedObjects.length && (i.preset = this.preset,
  10796. i.remembered || (i.remembered = {}),
  10797. i.remembered[this.preset] = a(this)),
  10798. i.folders = {},
  10799. v.each(this.__folders, function(e, t) {
  10800. i.folders[t] = e.getSaveObject()
  10801. }),
  10802. i
  10803. },
  10804. save: function() {
  10805. this.load.remembered || (this.load.remembered = {}),
  10806. this.load.remembered[this.preset] = a(this),
  10807. _(this, !1),
  10808. this.saveToLocalStorageIfPossible()
  10809. },
  10810. saveAs: function(e) {
  10811. this.load.remembered || (this.load.remembered = {},
  10812. this.load.remembered[T] = a(this, !0)),
  10813. this.load.remembered[e] = a(this),
  10814. this.preset = e,
  10815. E(this, e, !0),
  10816. this.saveToLocalStorageIfPossible()
  10817. },
  10818. revert: function(t) {
  10819. v.each(this.__controllers, function(e) {
  10820. this.getRoot().load.remembered ? C(t || this.getRoot(), e) : e.setValue(e.initialValue)
  10821. }, this),
  10822. v.each(this.__folders, function(e) {
  10823. e.revert(e)
  10824. }),
  10825. t || _(this.getRoot(), !1)
  10826. },
  10827. listen: function(e) {
  10828. var t = 0 == this.__listening.length;
  10829. this.__listening.push(e),
  10830. t && function e(t) {
  10831. 0 != t.length && r(function() {
  10832. e(t)
  10833. }),
  10834. v.each(t, function(e) {
  10835. e.updateDisplay()
  10836. })
  10837. }(this.__listening)
  10838. }
  10839. }),
  10840. R
  10841. }(ee.utils.css, 0, 0, ee.controllers.factory = (h = ee.controllers.OptionController,
  10842. u = ee.controllers.NumberControllerBox,
  10843. d = ee.controllers.NumberControllerSlider,
  10844. p = ee.controllers.StringController = (v = ee.controllers.Controller,
  10845. y = ee.dom.dom,
  10846. A = ee.utils.common,
  10847. (C = function(e, t) {
  10848. function i() {
  10849. n.setValue(n.__input.value)
  10850. }
  10851. C.superclass.call(this, e, t);
  10852. var n = this;
  10853. this.__input = document.createElement("input"),
  10854. this.__input.setAttribute("type", "text"),
  10855. y.bind(this.__input, "keyup", i),
  10856. y.bind(this.__input, "change", i),
  10857. y.bind(this.__input, "blur", function() {
  10858. n.__onFinishChange && n.__onFinishChange.call(n, n.getValue())
  10859. }),
  10860. y.bind(this.__input, "keydown", function(e) {
  10861. 13 === e.keyCode && this.blur()
  10862. }),
  10863. this.updateDisplay(),
  10864. this.domElement.appendChild(this.__input)
  10865. }
  10866. ).superclass = v,
  10867. A.extend(C.prototype, v.prototype, {
  10868. updateDisplay: function() {
  10869. return y.isActive(this.__input) || (this.__input.value = this.getValue()),
  10870. C.superclass.prototype.updateDisplay.call(this)
  10871. }
  10872. }),
  10873. C),
  10874. f = ee.controllers.FunctionController,
  10875. g = ee.controllers.BooleanController,
  10876. m = ee.utils.common,
  10877. function(e, t) {
  10878. var i = e[t];
  10879. return m.isArray(arguments[2]) || m.isObject(arguments[2]) ? new h(e,t,arguments[2]) : m.isNumber(i) ? m.isNumber(arguments[2]) && m.isNumber(arguments[3]) ? new d(e,t,arguments[2],arguments[3]) : new u(e,t,{
  10880. min: arguments[2],
  10881. max: arguments[3]
  10882. }) : m.isString(i) ? new p(e,t) : m.isFunction(i) ? new f(e,t,"") : m.isBoolean(i) ? new g(e,t) : void 0
  10883. }
  10884. ), ee.controllers.Controller, ee.controllers.BooleanController, ee.controllers.FunctionController, ee.controllers.NumberControllerBox, ee.controllers.NumberControllerSlider, ee.controllers.OptionController, ee.controllers.ColorController = function(e, h, u, d, p) {
  10885. function f(t, i, n, r) {
  10886. t.style.background = "",
  10887. p.each(o, function(e) {
  10888. t.style.cssText += "background: " + e + "linear-gradient(" + i + ", " + n + " 0%, " + r + " 100%); "
  10889. })
  10890. }
  10891. var g = function(e, t) {
  10892. function i(e) {
  10893. a(e),
  10894. h.bind(window, "mousemove", a),
  10895. h.bind(window, "mouseup", n)
  10896. }
  10897. function n() {
  10898. h.unbind(window, "mousemove", a),
  10899. h.unbind(window, "mouseup", n)
  10900. }
  10901. function r() {
  10902. var e = d(this.value);
  10903. !1 !== e ? (l.__color.__state = e,
  10904. l.setValue(l.__color.toOriginal())) : this.value = l.__color.toString()
  10905. }
  10906. function o() {
  10907. h.unbind(window, "mousemove", s),
  10908. h.unbind(window, "mouseup", o)
  10909. }
  10910. function a(e) {
  10911. e.preventDefault();
  10912. var t = h.getWidth(l.__saturation_field)
  10913. , i = h.getOffset(l.__saturation_field)
  10914. , n = (e.clientX - i.left + document.body.scrollLeft) / t
  10915. , r = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10916. return 1 < r ? r = 1 : r < 0 && (r = 0),
  10917. 1 < n ? n = 1 : n < 0 && (n = 0),
  10918. l.__color.v = r,
  10919. l.__color.s = n,
  10920. l.setValue(l.__color.toOriginal()),
  10921. !1
  10922. }
  10923. function s(e) {
  10924. e.preventDefault();
  10925. var t = h.getHeight(l.__hue_field)
  10926. , i = h.getOffset(l.__hue_field)
  10927. , n = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10928. return 1 < n ? n = 1 : n < 0 && (n = 0),
  10929. l.__color.h = 360 * n,
  10930. l.setValue(l.__color.toOriginal()),
  10931. !1
  10932. }
  10933. g.superclass.call(this, e, t),
  10934. this.__color = new u(this.getValue()),
  10935. this.__temp = new u(0);
  10936. var l = this;
  10937. this.domElement = document.createElement("div"),
  10938. h.makeSelectable(this.domElement, !1),
  10939. this.__selector = document.createElement("div"),
  10940. this.__selector.className = "selector",
  10941. this.__saturation_field = document.createElement("div"),
  10942. this.__saturation_field.className = "saturation-field",
  10943. this.__field_knob = document.createElement("div"),
  10944. this.__field_knob.className = "field-knob",
  10945. this.__field_knob_border = "2px solid ",
  10946. this.__hue_knob = document.createElement("div"),
  10947. this.__hue_knob.className = "hue-knob",
  10948. this.__hue_field = document.createElement("div"),
  10949. this.__hue_field.className = "hue-field",
  10950. this.__input = document.createElement("input"),
  10951. this.__input.type = "text",
  10952. this.__input_textShadow = "0 1px 1px ",
  10953. h.bind(this.__input, "keydown", function(e) {
  10954. 13 === e.keyCode && r.call(this)
  10955. }),
  10956. h.bind(this.__input, "blur", r),
  10957. h.bind(this.__selector, "mousedown", function(e) {
  10958. h.addClass(this, "drag").bind(window, "mouseup", function(e) {
  10959. h.removeClass(l.__selector, "drag")
  10960. })
  10961. });
  10962. var c = document.createElement("div");
  10963. p.extend(this.__selector.style, {
  10964. width: "122px",
  10965. height: "102px",
  10966. padding: "3px",
  10967. backgroundColor: "#222",
  10968. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  10969. }),
  10970. p.extend(this.__field_knob.style, {
  10971. position: "absolute",
  10972. width: "12px",
  10973. height: "12px",
  10974. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  10975. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  10976. borderRadius: "12px",
  10977. zIndex: 1
  10978. }),
  10979. p.extend(this.__hue_knob.style, {
  10980. position: "absolute",
  10981. width: "15px",
  10982. height: "2px",
  10983. borderRight: "4px solid #fff",
  10984. zIndex: 1
  10985. }),
  10986. p.extend(this.__saturation_field.style, {
  10987. width: "100px",
  10988. height: "100px",
  10989. border: "1px solid #555",
  10990. marginRight: "3px",
  10991. display: "inline-block",
  10992. cursor: "pointer"
  10993. }),
  10994. p.extend(c.style, {
  10995. width: "100%",
  10996. height: "100%",
  10997. background: "none"
  10998. }),
  10999. f(c, "top", "rgba(0,0,0,0)", "#000"),
  11000. p.extend(this.__hue_field.style, {
  11001. width: "15px",
  11002. height: "100px",
  11003. display: "inline-block",
  11004. border: "1px solid #555",
  11005. cursor: "ns-resize"
  11006. }),
  11007. function(e) {
  11008. e.style.background = "",
  11009. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  11010. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11011. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11012. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11013. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  11014. }(this.__hue_field),
  11015. p.extend(this.__input.style, {
  11016. outline: "none",
  11017. textAlign: "center",
  11018. color: "#fff",
  11019. border: 0,
  11020. fontWeight: "bold",
  11021. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  11022. }),
  11023. h.bind(this.__saturation_field, "mousedown", i),
  11024. h.bind(this.__field_knob, "mousedown", i),
  11025. h.bind(this.__hue_field, "mousedown", function(e) {
  11026. s(e),
  11027. h.bind(window, "mousemove", s),
  11028. h.bind(window, "mouseup", o)
  11029. }),
  11030. this.__saturation_field.appendChild(c),
  11031. this.__selector.appendChild(this.__field_knob),
  11032. this.__selector.appendChild(this.__saturation_field),
  11033. this.__selector.appendChild(this.__hue_field),
  11034. this.__hue_field.appendChild(this.__hue_knob),
  11035. this.domElement.appendChild(this.__input),
  11036. this.domElement.appendChild(this.__selector),
  11037. this.updateDisplay()
  11038. };
  11039. g.superclass = e,
  11040. p.extend(g.prototype, e.prototype, {
  11041. updateDisplay: function() {
  11042. var t = d(this.getValue());
  11043. if (!1 !== t) {
  11044. var i = !1;
  11045. p.each(u.COMPONENTS, function(e) {
  11046. if (!p.isUndefined(t[e]) && !p.isUndefined(this.__color.__state[e]) && t[e] !== this.__color.__state[e])
  11047. return i = !0,
  11048. {}
  11049. }, this),
  11050. i && p.extend(this.__color.__state, t)
  11051. }
  11052. p.extend(this.__temp.__state, this.__color.__state),
  11053. this.__temp.a = 1;
  11054. var e = this.__color.v < .5 || .5 < this.__color.s ? 255 : 0
  11055. , n = 255 - e;
  11056. p.extend(this.__field_knob.style, {
  11057. marginLeft: 100 * this.__color.s - 7 + "px",
  11058. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11059. backgroundColor: this.__temp.toString(),
  11060. border: this.__field_knob_border + "rgb(" + e + "," + e + "," + e + ")"
  11061. }),
  11062. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11063. this.__temp.s = 1,
  11064. this.__temp.v = 1,
  11065. f(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11066. p.extend(this.__input.style, {
  11067. backgroundColor: this.__input.value = this.__color.toString(),
  11068. color: "rgb(" + e + "," + e + "," + e + ")",
  11069. textShadow: this.__input_textShadow + "rgba(" + n + "," + n + "," + n + ",.7)"
  11070. })
  11071. }
  11072. });
  11073. var o = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11074. return g
  11075. }(ee.controllers.Controller, ee.dom.dom, ee.color.Color = (o = ee.color.interpret,
  11076. a = ee.color.math = {
  11077. hsv_to_rgb: function(e, t, i) {
  11078. var n = Math.floor(e / 60) % 6
  11079. , r = e / 60 - Math.floor(e / 60)
  11080. , o = i * (1 - t)
  11081. , a = i * (1 - r * t)
  11082. , s = i * (1 - (1 - r) * t)
  11083. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11084. return {
  11085. r: 255 * l[0],
  11086. g: 255 * l[1],
  11087. b: 255 * l[2]
  11088. }
  11089. },
  11090. rgb_to_hsv: function(e, t, i) {
  11091. var n, r = Math.min(e, t, i), o = Math.max(e, t, i), a = o - r;
  11092. return 0 == o ? {
  11093. h: NaN,
  11094. s: 0,
  11095. v: 0
  11096. } : (n = e == o ? (t - i) / a : t == o ? 2 + (i - e) / a : 4 + (e - t) / a,
  11097. (n /= 6) < 0 && (n += 1),
  11098. {
  11099. h: 360 * n,
  11100. s: a / o,
  11101. v: o / 255
  11102. })
  11103. },
  11104. rgb_to_hex: function(e, t, i) {
  11105. var n = this.hex_with_component(0, 2, e);
  11106. return n = this.hex_with_component(n, 1, t),
  11107. this.hex_with_component(n, 0, i)
  11108. },
  11109. component_from_hex: function(e, t) {
  11110. return e >> 8 * t & 255
  11111. },
  11112. hex_with_component: function(e, t, i) {
  11113. return i << (c = 8 * t) | e & ~(255 << c)
  11114. }
  11115. },
  11116. s = ee.color.toString,
  11117. l = ee.utils.common,
  11118. ae.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11119. l.extend(ae.prototype, {
  11120. toString: function() {
  11121. return s(this)
  11122. },
  11123. toOriginal: function() {
  11124. return this.__state.conversion.write(this)
  11125. }
  11126. }),
  11127. ie(ae.prototype, "r", 2),
  11128. ie(ae.prototype, "g", 1),
  11129. ie(ae.prototype, "b", 0),
  11130. ne(ae.prototype, "h"),
  11131. ne(ae.prototype, "s"),
  11132. ne(ae.prototype, "v"),
  11133. Object.defineProperty(ae.prototype, "a", {
  11134. get: function() {
  11135. return this.__state.a
  11136. },
  11137. set: function(e) {
  11138. this.__state.a = e
  11139. }
  11140. }),
  11141. Object.defineProperty(ae.prototype, "hex", {
  11142. get: function() {
  11143. return "HEX" !== !this.__state.space && (this.__state.hex = a.rgb_to_hex(this.r, this.g, this.b)),
  11144. this.__state.hex
  11145. },
  11146. set: function(e) {
  11147. this.__state.space = "HEX",
  11148. this.__state.hex = e
  11149. }
  11150. }),
  11151. ae), ee.color.interpret, ee.utils.common), ee.utils.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11152. window.setTimeout(e, 1e3 / 60)
  11153. }
  11154. , ee.dom.CenteredDiv = (n = ee.dom.dom,
  11155. r = ee.utils.common,
  11156. te.prototype.show = function() {
  11157. var e = this;
  11158. this.backgroundElement.style.display = "block",
  11159. this.domElement.style.display = "block",
  11160. this.domElement.style.opacity = 0,
  11161. this.domElement.style.webkitTransform = "scale(1.1)",
  11162. this.layout(),
  11163. r.defer(function() {
  11164. e.backgroundElement.style.opacity = 1,
  11165. e.domElement.style.opacity = 1,
  11166. e.domElement.style.webkitTransform = "scale(1)"
  11167. })
  11168. }
  11169. ,
  11170. te.prototype.hide = function() {
  11171. var e = this
  11172. , t = function() {
  11173. e.domElement.style.display = "none",
  11174. e.backgroundElement.style.display = "none",
  11175. n.unbind(e.domElement, "webkitTransitionEnd", t),
  11176. n.unbind(e.domElement, "transitionend", t),
  11177. n.unbind(e.domElement, "oTransitionEnd", t)
  11178. };
  11179. n.bind(this.domElement, "webkitTransitionEnd", t),
  11180. n.bind(this.domElement, "transitionend", t),
  11181. n.bind(this.domElement, "oTransitionEnd", t),
  11182. this.backgroundElement.style.opacity = 0,
  11183. this.domElement.style.opacity = 0,
  11184. this.domElement.style.webkitTransform = "scale(1.1)"
  11185. }
  11186. ,
  11187. te.prototype.layout = function() {
  11188. this.domElement.style.left = $("#player").width() / 2 - n.getWidth(this.domElement) / 2 + "px",
  11189. this.domElement.style.top = $("#player").height() / 2 - n.getHeight(this.domElement) / 2 + "px"
  11190. }
  11191. ,
  11192. te), ee.dom.dom, ee.utils.common)
  11193. }
  11194. , {}],
  11195. 94: [function(e, t, i) {
  11196. (function(J) {
  11197. "use strict";
  11198. function i(e) {
  11199. function t(e, t) {
  11200. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11201. for (var a = 1; a <= e[o]; a++)
  11202. r[t[n]] = [],
  11203. r[t[n]][0] = i,
  11204. r[t[n]][1] = o,
  11205. n++,
  11206. i++;
  11207. i *= 2
  11208. }
  11209. return r
  11210. }
  11211. function _(e) {
  11212. for (var t = e[0], i = e[1] - 1; 0 <= i; )
  11213. t & 1 << i && (B |= 1 << V),
  11214. i--,
  11215. --V < 0 && (255 == B ? (b(255),
  11216. b(0)) : b(B),
  11217. V = 7,
  11218. B = 0)
  11219. }
  11220. function b(e) {
  11221. F.push(e)
  11222. }
  11223. function w(e) {
  11224. b(e >> 8 & 255),
  11225. b(255 & e)
  11226. }
  11227. function T(e, t, i, n, r) {
  11228. for (var o, a = r[0], s = r[240], l = function(e, t) {
  11229. var i, n, r, o, a, s, l, c, h, u, d = 0;
  11230. for (h = 0; h < 8; ++h) {
  11231. i = e[d],
  11232. n = e[d + 1],
  11233. r = e[d + 2],
  11234. o = e[d + 3],
  11235. a = e[d + 4],
  11236. s = e[d + 5],
  11237. l = e[d + 6];
  11238. var p = i + (c = e[d + 7])
  11239. , f = i - c
  11240. , g = n + l
  11241. , m = n - l
  11242. , v = r + s
  11243. , y = r - s
  11244. , A = o + a
  11245. , C = o - a
  11246. , I = p + A
  11247. , E = p - A
  11248. , _ = g + v
  11249. , b = g - v;
  11250. e[d] = I + _,
  11251. e[d + 4] = I - _;
  11252. var w = .707106781 * (b + E);
  11253. e[d + 2] = E + w,
  11254. e[d + 6] = E - w;
  11255. var T = .382683433 * ((I = C + y) - (b = m + f))
  11256. , x = .5411961 * I + T
  11257. , S = 1.306562965 * b + T
  11258. , M = .707106781 * (_ = y + m)
  11259. , R = f + M
  11260. , P = f - M;
  11261. e[d + 5] = P + x,
  11262. e[d + 3] = P - x,
  11263. e[d + 1] = R + S,
  11264. e[d + 7] = R - S,
  11265. d += 8
  11266. }
  11267. for (h = d = 0; h < 8; ++h) {
  11268. i = e[d],
  11269. n = e[d + 8],
  11270. r = e[d + 16],
  11271. o = e[d + 24],
  11272. a = e[d + 32],
  11273. s = e[d + 40],
  11274. l = e[d + 48];
  11275. var O = i + (c = e[d + 56])
  11276. , L = i - c
  11277. , D = n + l
  11278. , N = n - l
  11279. , F = r + s
  11280. , B = r - s
  11281. , V = o + a
  11282. , k = o - a
  11283. , U = O + V
  11284. , H = O - V
  11285. , z = D + F
  11286. , G = D - F;
  11287. e[d] = U + z,
  11288. e[d + 32] = U - z;
  11289. var W = .707106781 * (G + H);
  11290. e[d + 16] = H + W,
  11291. e[d + 48] = H - W;
  11292. var j = .382683433 * ((U = k + B) - (G = N + L))
  11293. , Y = .5411961 * U + j
  11294. , q = 1.306562965 * G + j
  11295. , X = .707106781 * (z = B + N)
  11296. , Z = L + X
  11297. , K = L - X;
  11298. e[d + 40] = K + Y,
  11299. e[d + 24] = K - Y,
  11300. e[d + 8] = Z + q,
  11301. e[d + 56] = Z - q,
  11302. d++
  11303. }
  11304. for (h = 0; h < 64; ++h)
  11305. u = e[h] * t[h],
  11306. Q[h] = 0 < u ? .5 + u | 0 : u - .5 | 0;
  11307. return Q
  11308. }(e, t), c = 0; c < 64; ++c)
  11309. A[C[c]] = l[c];
  11310. var h = A[0] - i;
  11311. i = A[0],
  11312. 0 == h ? _(n[0]) : (_(n[y[o = 32767 + h]]),
  11313. _(v[o]));
  11314. for (var u = 63; 0 < u && 0 == A[u]; u--)
  11315. ;
  11316. if (0 == u)
  11317. return _(a),
  11318. i;
  11319. for (var d, p = 1; p <= u; ) {
  11320. for (var f = p; 0 == A[p] && p <= u; ++p)
  11321. ;
  11322. var g = p - f;
  11323. if (16 <= g) {
  11324. d = g >> 4;
  11325. for (var m = 1; m <= d; ++m)
  11326. _(s);
  11327. g &= 15
  11328. }
  11329. o = 32767 + A[p],
  11330. _(r[(g << 4) + y[o]]),
  11331. _(v[o]),
  11332. p++
  11333. }
  11334. return 63 != u && _(a),
  11335. i
  11336. }
  11337. function x(e) {
  11338. if (e <= 0 && (e = 1),
  11339. 100 < e && (e = 100),
  11340. i != e) {
  11341. (function(e) {
  11342. 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++) {
  11343. var n = u((t[i] * e + 50) / 100);
  11344. n < 1 ? n = 1 : 255 < n && (n = 255),
  11345. O[C[i]] = n
  11346. }
  11347. 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++) {
  11348. var a = u((r[o] * e + 50) / 100);
  11349. a < 1 ? a = 1 : 255 < a && (a = 255),
  11350. L[C[o]] = a
  11351. }
  11352. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11353. for (var h = 0; h < 8; h++)
  11354. D[l] = 1 / (O[C[l]] * s[c] * s[h] * 8),
  11355. N[l] = 1 / (L[C[l]] * s[c] * s[h] * 8),
  11356. l++
  11357. }
  11358. )(e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)),
  11359. i = e
  11360. }
  11361. }
  11362. var S, M, R, P, i, u = (Math.round,
  11363. Math.floor), O = new Array(64), L = new Array(64), D = new Array(64), N = new Array(64), v = new Array(65535), y = new Array(65535), Q = new Array(64), A = new Array(64), F = [], B = 0, V = 7, k = new Array(64), U = new Array(64), H = new Array(64), n = new Array(256), z = new Array(2048), C = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63], G = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], W = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], j = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125], Y = [1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250], q = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], X = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], Z = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119], K = [0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250];
  11364. this.encode = function(e, t) {
  11365. var i = ((new Date).getTime(),
  11366. t.quality);
  11367. i && x(i),
  11368. F = new Array,
  11369. B = 0,
  11370. V = 7,
  11371. w(65496),
  11372. w(65504),
  11373. w(16),
  11374. b(74),
  11375. b(70),
  11376. b(73),
  11377. b(70),
  11378. b(0),
  11379. b(1),
  11380. b(1),
  11381. b(0),
  11382. w(1),
  11383. w(1),
  11384. b(0),
  11385. b(0),
  11386. function() {
  11387. w(65499),
  11388. w(132),
  11389. b(0);
  11390. for (var e = 0; e < 64; e++)
  11391. b(O[e]);
  11392. b(1);
  11393. for (var t = 0; t < 64; t++)
  11394. b(L[t])
  11395. }(),
  11396. function(e, t) {
  11397. w(65472),
  11398. w(17),
  11399. b(8),
  11400. w(t),
  11401. w(e),
  11402. b(3),
  11403. b(1),
  11404. b(17),
  11405. b(0),
  11406. b(2),
  11407. b(17),
  11408. b(1),
  11409. b(3),
  11410. b(17),
  11411. b(1)
  11412. }(e.width, e.height),
  11413. function() {
  11414. w(65476),
  11415. w(418),
  11416. b(0);
  11417. for (var e = 0; e < 16; e++)
  11418. b(G[e + 1]);
  11419. for (var t = 0; t <= 11; t++)
  11420. b(W[t]);
  11421. b(16);
  11422. for (var i = 0; i < 16; i++)
  11423. b(j[i + 1]);
  11424. for (var n = 0; n <= 161; n++)
  11425. b(Y[n]);
  11426. b(1);
  11427. for (var r = 0; r < 16; r++)
  11428. b(q[r + 1]);
  11429. for (var o = 0; o <= 11; o++)
  11430. b(X[o]);
  11431. b(17);
  11432. for (var a = 0; a < 16; a++)
  11433. b(Z[a + 1]);
  11434. for (var s = 0; s <= 161; s++)
  11435. b(K[s])
  11436. }(),
  11437. w(65498),
  11438. w(12),
  11439. b(3),
  11440. b(1),
  11441. b(0),
  11442. b(2),
  11443. b(17),
  11444. b(3),
  11445. b(17),
  11446. b(0),
  11447. b(63),
  11448. b(0);
  11449. var n = 0
  11450. , r = 0
  11451. , o = 0;
  11452. B = 0,
  11453. V = 7,
  11454. this.encode.displayName = "_encode_";
  11455. for (var a, s, l, c, h, u, d, p, f, g = e.data, m = e.width, v = e.height, y = t.flipY, A = 4 * m, C = y ? v : 0, I = y ? -8 : 8; y && 0 < C || !y && C < v; ) {
  11456. for (a = 0; a < A; ) {
  11457. for (u = h = A * C + a,
  11458. d = -1,
  11459. f = p = 0; f < 64; f++)
  11460. u = h + (p = (y ? 63 - f : f) >> 3) * A + (d = 4 * (7 & f)),
  11461. v <= C + p && (u -= A * (C + 1 + p - v)),
  11462. A <= a + d && (u -= a + d - A + 4),
  11463. s = g[u++],
  11464. l = g[u++],
  11465. c = g[u++],
  11466. k[f] = (z[s] + z[l + 256 >> 0] + z[c + 512 >> 0] >> 16) - 128,
  11467. U[f] = (z[s + 768 >> 0] + z[l + 1024 >> 0] + z[c + 1280 >> 0] >> 16) - 128,
  11468. H[f] = (z[s + 1280 >> 0] + z[l + 1536 >> 0] + z[c + 1792 >> 0] >> 16) - 128;
  11469. n = T(k, D, n, S, R),
  11470. r = T(U, N, r, M, P),
  11471. o = T(H, N, o, M, P),
  11472. a += 32
  11473. }
  11474. C += I
  11475. }
  11476. if (0 <= V) {
  11477. var E = [];
  11478. E[1] = V + 1,
  11479. E[0] = (1 << V + 1) - 1,
  11480. _(E)
  11481. }
  11482. return w(65497),
  11483. new J(F)
  11484. }
  11485. ,
  11486. (new Date).getTime(),
  11487. e = e || 50,
  11488. function() {
  11489. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11490. n[t] = e(t)
  11491. }(),
  11492. S = t(G, W),
  11493. M = t(q, X),
  11494. R = t(j, Y),
  11495. P = t(Z, K),
  11496. function() {
  11497. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11498. for (var n = e; n < t; n++)
  11499. y[32767 + n] = i,
  11500. v[32767 + n] = [],
  11501. v[32767 + n][1] = i,
  11502. v[32767 + n][0] = n;
  11503. for (var r = -(t - 1); r <= -e; r++)
  11504. y[32767 + r] = i,
  11505. v[32767 + r] = [],
  11506. v[32767 + r][1] = i,
  11507. v[32767 + r][0] = t - 1 + r;
  11508. e <<= 1,
  11509. t <<= 1
  11510. }
  11511. }(),
  11512. function() {
  11513. for (var e = 0; e < 256; e++)
  11514. z[e] = 19595 * e,
  11515. z[e + 256 >> 0] = 38470 * e,
  11516. z[e + 512 >> 0] = 7471 * e + 32768,
  11517. z[e + 768 >> 0] = -11059 * e,
  11518. z[e + 1024 >> 0] = -21709 * e,
  11519. z[e + 1280 >> 0] = 32768 * e + 8421375,
  11520. z[e + 1536 >> 0] = -27439 * e,
  11521. z[e + 1792 >> 0] = -5329 * e
  11522. }(),
  11523. x(e),
  11524. (new Date).getTime()
  11525. }
  11526. t.exports.encode = function(e, t) {
  11527. return (t = t || {}).quality = t.quality || 50,
  11528. {
  11529. data: new i(t.quality).encode(e, t),
  11530. width: e.width,
  11531. height: e.height
  11532. }
  11533. }
  11534. }
  11535. ).call(this, e("buffer").Buffer)
  11536. }
  11537. , {
  11538. buffer: 198
  11539. }],
  11540. 95: [function(e, t, i) {
  11541. "use strict";
  11542. !function() {
  11543. if ("performance"in window == 0 && (window.performance = {}),
  11544. Date.now = Date.now || function() {
  11545. return (new Date).getTime()
  11546. }
  11547. ,
  11548. "now"in window.performance == 0) {
  11549. var e = Date.now();
  11550. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11551. window.performance.now = function() {
  11552. return Date.now() - e
  11553. }
  11554. }
  11555. }()
  11556. }
  11557. , {}],
  11558. 96: [function(e, t, i) {
  11559. "use strict";
  11560. var a = e("three");
  11561. a.EffectComposer = function(e, t) {
  11562. if (this.renderer = e,
  11563. void 0 === t) {
  11564. var i = {
  11565. minFilter: a.LinearFilter,
  11566. magFilter: a.LinearFilter,
  11567. format: a.RGBAFormat,
  11568. stencilBuffer: !1
  11569. }
  11570. , n = e.getSize();
  11571. t = new a.WebGLRenderTarget(n.width,n.height,i)
  11572. }
  11573. this.renderTarget1 = t,
  11574. this.renderTarget2 = t.clone(),
  11575. this.writeBuffer = this.renderTarget1,
  11576. this.readBuffer = this.renderTarget2,
  11577. this.passes = [],
  11578. void 0 === a.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11579. this.copyPass = new a.ShaderPass(a.CopyShader)
  11580. }
  11581. ,
  11582. a.EffectComposer.prototype = {
  11583. swapBuffers: function() {
  11584. var e = this.readBuffer;
  11585. this.readBuffer = this.writeBuffer,
  11586. this.writeBuffer = e
  11587. },
  11588. addPass: function(e) {
  11589. this.passes.push(e)
  11590. },
  11591. insertPass: function(e, t) {
  11592. this.passes.splice(t, 0, e)
  11593. },
  11594. render: function(e) {
  11595. this.writeBuffer = this.renderTarget1,
  11596. this.readBuffer = this.renderTarget2;
  11597. var t, i, n = !1, r = this.passes.length;
  11598. for (i = 0; i < r; i++)
  11599. if ((t = this.passes[i]).enabled) {
  11600. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, n),
  11601. t.needsSwap) {
  11602. if (n) {
  11603. var o = this.renderer.context;
  11604. o.stencilFunc(o.NOTEQUAL, 1, 4294967295),
  11605. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11606. o.stencilFunc(o.EQUAL, 1, 4294967295)
  11607. }
  11608. this.swapBuffers()
  11609. }
  11610. t instanceof a.MaskPass ? n = !0 : t instanceof a.ClearMaskPass && (n = !1)
  11611. }
  11612. },
  11613. reset: function(e) {
  11614. if (void 0 === e) {
  11615. var t = this.renderer.getSize();
  11616. (e = this.renderTarget1.clone()).setSize(t.width, t.height)
  11617. }
  11618. this.renderTarget1.dispose(),
  11619. this.renderTarget2.dispose(),
  11620. this.renderTarget1 = e,
  11621. this.renderTarget2 = e.clone(),
  11622. this.writeBuffer = this.renderTarget1,
  11623. this.readBuffer = this.renderTarget2
  11624. },
  11625. setSize: function(e, t) {
  11626. this.renderTarget1.setSize(e, t),
  11627. this.renderTarget2.setSize(e, t)
  11628. this.passes.forEach(a=>{//add for TransitionPass
  11629. a.setSize && a.setSize(e, t)
  11630. })
  11631. }
  11632. }
  11633. }
  11634. , {
  11635. three: 217
  11636. }],
  11637. 97: [function(e, t, i) {
  11638. "use strict";
  11639. var n = e("three");
  11640. n.MaskPass = function(e, t) {
  11641. this.scene = e,
  11642. this.camera = t,
  11643. this.enabled = !0,
  11644. this.clear = !0,
  11645. this.needsSwap = !1,
  11646. this.inverse = !1
  11647. }
  11648. ,
  11649. n.MaskPass.prototype = {
  11650. render: function(e, t, i, n) {
  11651. var r, o, a = e.context;
  11652. a.colorMask(!1, !1, !1, !1),
  11653. a.depthMask(!1),
  11654. o = this.inverse ? (r = 0,
  11655. 1) : (r = 1,
  11656. 0),
  11657. a.enable(a.STENCIL_TEST),
  11658. a.stencilOp(a.REPLACE, a.REPLACE, a.REPLACE),
  11659. a.stencilFunc(a.ALWAYS, r, 4294967295),
  11660. a.clearStencil(o),
  11661. e.render(this.scene, this.camera, i, this.clear),
  11662. e.render(this.scene, this.camera, t, this.clear),
  11663. a.colorMask(!0, !0, !0, !0),
  11664. a.depthMask(!0),
  11665. a.stencilFunc(a.EQUAL, 1, 4294967295),
  11666. a.stencilOp(a.KEEP, a.KEEP, a.KEEP)
  11667. }
  11668. },
  11669. n.ClearMaskPass = function() {
  11670. this.enabled = !0
  11671. }
  11672. ,
  11673. n.ClearMaskPass.prototype = {
  11674. render: function(e, t, i, n) {
  11675. var r = e.context;
  11676. r.disable(r.STENCIL_TEST)
  11677. }
  11678. }
  11679. }
  11680. , {
  11681. three: 217
  11682. }],
  11683. 98: [function(e, t, i) {
  11684. "use strict";
  11685. var o = e("three");
  11686. o.RenderPass = function(e, t, i, n, r) {
  11687. this.scene = e,
  11688. this.camera = t,
  11689. this.overrideMaterial = i,
  11690. this.clearColor = n,
  11691. this.clearAlpha = void 0 !== r ? r : 1,
  11692. this.oldClearColor = new o.Color,
  11693. this.oldClearAlpha = 1,
  11694. this.enabled = !0,
  11695. this.clear = !0,
  11696. this.needsSwap = !1
  11697. }
  11698. ,
  11699. o.RenderPass.prototype = {
  11700. render: function(e, t, i, n) {
  11701. this.scene.overrideMaterial = this.overrideMaterial,
  11702. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11703. this.oldClearAlpha = e.getClearAlpha(),
  11704. e.setClearColor(this.clearColor, this.clearAlpha)),
  11705. e.render(this.scene, this.camera, i, this.clear),
  11706. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11707. this.scene.overrideMaterial = null
  11708. }
  11709. }
  11710. }
  11711. , {
  11712. three: 217
  11713. }],
  11714. 99: [function(e, t, i) {
  11715. "use strict";
  11716. var n = e("three");
  11717. n.ShaderPass = function(e, t) {
  11718. this.textureID = void 0 !== t ? t : "tDiffuse",
  11719. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11720. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11721. this.material = new n.ShaderMaterial({
  11722. defines: e.defines || {},
  11723. uniforms: this.uniforms,
  11724. vertexShader: e.vertexShader,
  11725. fragmentShader: e.fragmentShader
  11726. })),
  11727. this.renderToScreen = !1,
  11728. this.enabled = !0,
  11729. this.needsSwap = !0,
  11730. this.clear = !1,
  11731. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11732. this.scene = new n.Scene,
  11733. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11734. this.scene.add(this.quad)
  11735. }
  11736. ,
  11737. n.ShaderPass.prototype = {
  11738. render: function(e, t, i, n) {
  11739. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11740. this.quad.material = this.material,
  11741. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11742. }
  11743. }
  11744. }
  11745. , {
  11746. three: 217
  11747. }],
  11748. 100: [function(e, t, i) {
  11749. "use strict";
  11750. e("three").CopyShader = {
  11751. uniforms: {
  11752. tDiffuse: {
  11753. type: "t",
  11754. value: null
  11755. },
  11756. opacity: {
  11757. type: "f",
  11758. value: 1
  11759. }
  11760. },
  11761. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11762. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11763. }
  11764. }
  11765. , {
  11766. three: 217
  11767. }],
  11768. 101: [function(e, t, i) {
  11769. "use strict";
  11770. e("three").HorizontalBlurShader = {
  11771. uniforms: {
  11772. tDiffuse: {
  11773. type: "t",
  11774. value: null
  11775. },
  11776. h: {
  11777. type: "f",
  11778. value: 1 / 512
  11779. }
  11780. },
  11781. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11782. 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")
  11783. }
  11784. }
  11785. , {
  11786. three: 217
  11787. }],
  11788. 102: [function(e, t, i) {
  11789. "use strict";
  11790. e("three").VerticalBlurShader = {
  11791. uniforms: {
  11792. tDiffuse: {
  11793. type: "t",
  11794. value: null
  11795. },
  11796. v: {
  11797. type: "f",
  11798. value: 1 / 512
  11799. }
  11800. },
  11801. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11802. 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")
  11803. }
  11804. }
  11805. , {
  11806. three: 217
  11807. }],
  11808. 103: [function(e, t, i) {
  11809. "use strict";
  11810. var z = e("three");
  11811. !function() {
  11812. if ("performance"in window == 0 && (window.performance = {}),
  11813. "now"in window.performance == 0) {
  11814. var e = Date.now();
  11815. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11816. window.performance.now = function() {
  11817. return Date.now() - e
  11818. }
  11819. }
  11820. }(),
  11821. z.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11822. var t, i = this.extensions, n = this.context;
  11823. if (e === z.RepeatWrapping)
  11824. return n.REPEAT;
  11825. if (e === z.ClampToEdgeWrapping)
  11826. return n.CLAMP_TO_EDGE;
  11827. if (e === z.MirroredRepeatWrapping)
  11828. return n.MIRRORED_REPEAT;
  11829. if (e === z.NearestFilter)
  11830. return n.NEAREST;
  11831. if (e === z.NearestMipMapNearestFilter)
  11832. return n.NEAREST_MIPMAP_NEAREST;
  11833. if (e === z.NearestMipMapLinearFilter)
  11834. return n.NEAREST_MIPMAP_LINEAR;
  11835. if (e === z.LinearFilter)
  11836. return n.LINEAR;
  11837. if (e === z.LinearMipMapNearestFilter)
  11838. return n.LINEAR_MIPMAP_NEAREST;
  11839. if (e === z.LinearMipMapLinearFilter)
  11840. return n.LINEAR_MIPMAP_LINEAR;
  11841. if (e === z.UnsignedByteType)
  11842. return n.UNSIGNED_BYTE;
  11843. if (e === z.UnsignedShort4444Type)
  11844. return n.UNSIGNED_SHORT_4_4_4_4;
  11845. if (e === z.UnsignedShort5551Type)
  11846. return n.UNSIGNED_SHORT_5_5_5_1;
  11847. if (e === z.UnsignedShort565Type)
  11848. return n.UNSIGNED_SHORT_5_6_5;
  11849. if (e === z.ByteType)
  11850. return n.BYTE;
  11851. if (e === z.ShortType)
  11852. return n.SHORT;
  11853. if (e === z.UnsignedShortType)
  11854. return n.UNSIGNED_SHORT;
  11855. if (e === z.IntType)
  11856. return n.INT;
  11857. if (e === z.UnsignedIntType)
  11858. return n.UNSIGNED_INT;
  11859. if (e === z.FloatType)
  11860. return n.FLOAT;
  11861. if (null !== (t = i.get("OES_texture_half_float")) && e === z.HalfFloatType)
  11862. return t.HALF_FLOAT_OES;
  11863. if (e === z.AlphaFormat)
  11864. return n.ALPHA;
  11865. if (e === z.RGBFormat)
  11866. return n.RGB;
  11867. if (e === z.RGBAFormat)
  11868. return n.RGBA;
  11869. if (e === z.LuminanceFormat)
  11870. return n.LUMINANCE;
  11871. if (e === z.LuminanceAlphaFormat)
  11872. return n.LUMINANCE_ALPHA;
  11873. if (e === z.AddEquation)
  11874. return n.FUNC_ADD;
  11875. if (e === z.SubtractEquation)
  11876. return n.FUNC_SUBTRACT;
  11877. if (e === z.ReverseSubtractEquation)
  11878. return n.FUNC_REVERSE_SUBTRACT;
  11879. if (e === z.ZeroFactor)
  11880. return n.ZERO;
  11881. if (e === z.OneFactor)
  11882. return n.ONE;
  11883. if (e === z.SrcColorFactor)
  11884. return n.SRC_COLOR;
  11885. if (e === z.OneMinusSrcColorFactor)
  11886. return n.ONE_MINUS_SRC_COLOR;
  11887. if (e === z.SrcAlphaFactor)
  11888. return n.SRC_ALPHA;
  11889. if (e === z.OneMinusSrcAlphaFactor)
  11890. return n.ONE_MINUS_SRC_ALPHA;
  11891. if (e === z.DstAlphaFactor)
  11892. return n.DST_ALPHA;
  11893. if (e === z.OneMinusDstAlphaFactor)
  11894. return n.ONE_MINUS_DST_ALPHA;
  11895. if (e === z.DstColorFactor)
  11896. return n.DST_COLOR;
  11897. if (e === z.OneMinusDstColorFactor)
  11898. return n.ONE_MINUS_DST_COLOR;
  11899. if (e === z.SrcAlphaSaturateFactor)
  11900. return n.SRC_ALPHA_SATURATE;
  11901. if (null !== (t = i.get("WEBGL_compressed_texture_s3tc"))) {
  11902. if (e === z.RGB_S3TC_DXT1_Format)
  11903. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  11904. if (e === z.RGBA_S3TC_DXT1_Format)
  11905. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  11906. if (e === z.RGBA_S3TC_DXT3_Format)
  11907. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  11908. if (e === z.RGBA_S3TC_DXT5_Format)
  11909. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  11910. }
  11911. if (null !== (t = i.get("WEBGL_compressed_texture_pvrtc"))) {
  11912. if (e === z.RGB_PVRTC_4BPPV1_Format)
  11913. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  11914. if (e === z.RGB_PVRTC_2BPPV1_Format)
  11915. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  11916. if (e === z.RGBA_PVRTC_4BPPV1_Format)
  11917. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  11918. if (e === z.RGBA_PVRTC_2BPPV1_Format)
  11919. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  11920. }
  11921. if (null !== (t = i.get("WEBGL_compressed_texture_etc1")) && e === z.RGB_ETC1_Format)
  11922. return t.COMPRESSED_RGB_ETC1_WEBGL;
  11923. if (null !== (t = i.get("EXT_blend_minmax"))) {
  11924. if (e === z.MinEquation)
  11925. return t.MIN_EXT;
  11926. if (e === z.MaxEquation)
  11927. return t.MAX_EXT
  11928. }
  11929. return 0
  11930. }
  11931. ,
  11932. z.WebGLState = function(l, i, c) {
  11933. var n = this
  11934. , r = new z.Vector4
  11935. , e = l.getParameter(l.MAX_VERTEX_ATTRIBS)
  11936. , o = new Uint8Array(e)
  11937. , a = new Uint8Array(e)
  11938. , s = new Uint8Array(e)
  11939. , t = {}
  11940. , h = null
  11941. , u = null
  11942. , d = null
  11943. , p = null
  11944. , f = null
  11945. , g = null
  11946. , m = null
  11947. , v = null
  11948. , y = !1
  11949. , A = null
  11950. , C = null
  11951. , I = null
  11952. , E = null
  11953. , _ = null
  11954. , b = null
  11955. , w = null
  11956. , T = null
  11957. , x = null
  11958. , S = null
  11959. , M = null
  11960. , R = null
  11961. , P = null
  11962. , O = null
  11963. , L = null
  11964. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  11965. , N = void 0
  11966. , F = {}
  11967. , B = new z.Vector4
  11968. , V = null
  11969. , k = null
  11970. , U = new z.Vector4
  11971. , H = new z.Vector4;
  11972. this.init = function() {
  11973. this.clearColor(0, 0, 0, 1),
  11974. this.clearDepth(1),
  11975. this.clearStencil(0),
  11976. this.enable(l.DEPTH_TEST),
  11977. l.depthFunc(l.LEQUAL),
  11978. l.frontFace(l.CCW),
  11979. l.cullFace(l.BACK),
  11980. this.enable(l.CULL_FACE),
  11981. this.enable(l.BLEND),
  11982. l.blendEquation(l.FUNC_ADD),
  11983. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  11984. }
  11985. ,
  11986. this.initAttributes = function() {
  11987. for (var e = 0, t = o.length; e < t; e++)
  11988. o[e] = 0
  11989. }
  11990. ,
  11991. this.enableAttribute = function(e) {
  11992. o[e] = 1,
  11993. 0 === a[e] && (l.enableVertexAttribArray(e),
  11994. a[e] = 1),
  11995. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  11996. s[e] = 0)
  11997. }
  11998. ,
  11999. this.enableAttributeAndDivisor = function(e, t, i) {
  12000. o[e] = 1,
  12001. 0 === a[e] && (l.enableVertexAttribArray(e),
  12002. a[e] = 1),
  12003. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  12004. s[e] = t)
  12005. }
  12006. ,
  12007. this.disableUnusedAttributes = function() {
  12008. for (var e = 0, t = a.length; e < t; e++)
  12009. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  12010. a[e] = 0)
  12011. }
  12012. ,
  12013. this.enable = function(e) {
  12014. !0 !== t[e] && (l.enable(e),
  12015. t[e] = !0)
  12016. }
  12017. ,
  12018. this.disable = function(e) {
  12019. !1 !== t[e] && (l.disable(e),
  12020. t[e] = !1)
  12021. }
  12022. ,
  12023. this.getCompressedTextureFormats = function() {
  12024. if (null === h && (h = [],
  12025. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  12026. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  12027. h.push(e[t]);
  12028. return h
  12029. }
  12030. ,
  12031. this.setBlending = function(e, t, i, n, r, o, a, s) {
  12032. e === z.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  12033. e === u && s === y || (e === z.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12034. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  12035. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === z.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12036. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  12037. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === z.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12038. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  12039. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12040. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12041. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  12042. u = e,
  12043. y = s),
  12044. e === z.CustomBlending ? (r = r || t,
  12045. o = o || i,
  12046. a = a || n,
  12047. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  12048. d = t,
  12049. g = r),
  12050. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  12051. p = i,
  12052. f = n,
  12053. m = o,
  12054. v = a)) : v = m = g = f = p = d = null
  12055. }
  12056. ,
  12057. this.setDepthFunc = function(e) {
  12058. if (A !== e) {
  12059. if (e)
  12060. switch (e) {
  12061. case z.NeverDepth:
  12062. l.depthFunc(l.NEVER);
  12063. break;
  12064. case z.AlwaysDepth:
  12065. l.depthFunc(l.ALWAYS);
  12066. break;
  12067. case z.LessDepth:
  12068. l.depthFunc(l.LESS);
  12069. break;
  12070. case z.LessEqualDepth:
  12071. l.depthFunc(l.LEQUAL);
  12072. break;
  12073. case z.EqualDepth:
  12074. l.depthFunc(l.EQUAL);
  12075. break;
  12076. case z.GreaterEqualDepth:
  12077. l.depthFunc(l.GEQUAL);
  12078. break;
  12079. case z.GreaterDepth:
  12080. l.depthFunc(l.GREATER);
  12081. break;
  12082. case z.NotEqualDepth:
  12083. l.depthFunc(l.NOTEQUAL);
  12084. break;
  12085. default:
  12086. l.depthFunc(l.LEQUAL)
  12087. }
  12088. else
  12089. l.depthFunc(l.LEQUAL);
  12090. A = e
  12091. }
  12092. }
  12093. ,
  12094. this.setDepthTest = function(e) {
  12095. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  12096. }
  12097. ,
  12098. this.setDepthWrite = function(e) {
  12099. C !== e && (l.depthMask(e),
  12100. C = e)
  12101. }
  12102. ,
  12103. this.setColorWrite = function(e) {
  12104. I !== e && (l.colorMask(e, e, e, e),
  12105. I = e)
  12106. }
  12107. ,
  12108. this.setStencilFunc = function(e, t, i) {
  12109. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  12110. _ = e,
  12111. b = t,
  12112. w = i)
  12113. }
  12114. ,
  12115. this.setStencilOp = function(e, t, i) {
  12116. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  12117. T = e,
  12118. x = t,
  12119. S = i)
  12120. }
  12121. ,
  12122. this.setStencilTest = function(e) {
  12123. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  12124. }
  12125. ,
  12126. this.setStencilWrite = function(e) {
  12127. E !== e && (l.stencilMask(e),
  12128. E = e)
  12129. }
  12130. ,
  12131. this.setFlipSided = function(e) {
  12132. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  12133. M = e)
  12134. }
  12135. ,
  12136. this.setLineWidth = function(e) {
  12137. e !== R && (l.lineWidth(e),
  12138. R = e)
  12139. }
  12140. ,
  12141. this.setPolygonOffset = function(e, t, i) {
  12142. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  12143. !e || P === t && O === i || (l.polygonOffset(t, i),
  12144. P = t,
  12145. O = i)
  12146. }
  12147. ,
  12148. this.getScissorTest = function() {
  12149. return L
  12150. }
  12151. ,
  12152. this.setScissorTest = function(e) {
  12153. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  12154. }
  12155. ,
  12156. this.activeTexture = function(e) {
  12157. void 0 === e && (e = l.TEXTURE0 + D - 1),
  12158. N !== e && (l.activeTexture(e),
  12159. N = e)
  12160. }
  12161. ,
  12162. this.bindTexture = function(e, t) {
  12163. void 0 === N && n.activeTexture();
  12164. var i = F[N];
  12165. void 0 === i && (i = {
  12166. type: void 0,
  12167. texture: void 0
  12168. },
  12169. F[N] = i),
  12170. i.type === e && i.texture === t || (l.bindTexture(e, t),
  12171. i.type = e,
  12172. i.texture = t)
  12173. }
  12174. ,
  12175. this.compressedTexImage2D = function() {
  12176. try {
  12177. l.compressedTexImage2D.apply(l, arguments)
  12178. } catch (e) {
  12179. console.error(e)
  12180. }
  12181. }
  12182. ,
  12183. this.texImage2D = function() {
  12184. try {
  12185. l.texImage2D.apply(l, arguments)
  12186. } catch (e) {
  12187. console.error(e)
  12188. }
  12189. }
  12190. ,
  12191. this.clearColor = function(e, t, i, n) {
  12192. r.set(e, t, i, n),
  12193. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  12194. B.copy(r))
  12195. }
  12196. ,
  12197. this.clearDepth = function(e) {
  12198. V !== e && (l.clearDepth(e),
  12199. V = e)
  12200. }
  12201. ,
  12202. this.clearStencil = function(e) {
  12203. k !== e && (l.clearStencil(e),
  12204. k = e)
  12205. }
  12206. ,
  12207. this.scissor = function(e) {
  12208. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  12209. U.copy(e))
  12210. }
  12211. ,
  12212. this.viewport = function(e) {
  12213. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  12214. H.copy(e))
  12215. }
  12216. ,
  12217. this.reset = function() {
  12218. for (var e = 0; e < a.length; e++)
  12219. 1 === a[e] && (l.disableVertexAttribArray(e),
  12220. a[e] = 0);
  12221. t = {},
  12222. N = void 0,
  12223. F = {},
  12224. M = E = C = I = u = h = null
  12225. }
  12226. }
  12227. }
  12228. , {
  12229. three: 217
  12230. }],
  12231. 104: [function(a, h, e) {
  12232. (function(i, e) {
  12233. "use strict";
  12234. function t(e) {
  12235. this.urls = e;
  12236. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12237. this.builder = n.loadProto(t),
  12238. this.decoder = this.builder.build("binary_mesh")
  12239. }
  12240. var s = a("three")
  12241. , n = a("protobufjs")
  12242. , r = a("../util/logger")
  12243. , o = (a("../util/common"),
  12244. a("../util/ajax"))
  12245. , l = a("../objects/Chunk")
  12246. , c = new r(e);
  12247. t.prototype = {
  12248. constructor: t,
  12249. load: function(t, i, n, r) {
  12250. return c.time("download"),
  12251. o.get(t, {
  12252. responseType: "arraybuffer"
  12253. }).done(function(e) {
  12254. c.timeEnd("download"),
  12255. this.parse(e, t, i, n, r)
  12256. }
  12257. .bind(this)).fail(r)
  12258. },
  12259. parse: function(e, t, i, n, r) {
  12260. var o = this.readProtobuf(e);
  12261. if (!o)
  12262. return r();
  12263. try {
  12264. c.time("convert to webgl"),
  12265. this.convertProtobufToSceneObject(o, t, i, n, r),
  12266. c.timeEnd("convert to webgl")
  12267. } catch (e) {
  12268. return c.error("failed parsing .dam"),
  12269. c.error(e.message),
  12270. r()
  12271. }
  12272. },
  12273. readProtobuf: function(e) {
  12274. var t;
  12275. try {
  12276. c.time("parse proto"),
  12277. t = this.decoder.decode(e),
  12278. c.timeEnd("parse proto")
  12279. } catch (e) {
  12280. return c.error("failed parsing proto for .dam"),
  12281. c.error(e.message),
  12282. null
  12283. }
  12284. return t
  12285. },
  12286. convertProtobufToSceneObject: function(e, i, t, n, r) {
  12287. if (0 === e.chunk.length)
  12288. return c.warn("No chunks in damfile..."),
  12289. t([]);
  12290. var o = new s.Matrix4;
  12291. o.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12292. var a = e.chunk.map(function(e) {
  12293. var t = new s.BufferGeometry;
  12294. return t.addAttribute("position", new s.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12295. 0 < e.vertices.uv.length && t.addAttribute("uv", new s.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12296. t.setIndex(new s.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12297. t.applyMatrix(o),
  12298. t.computeBoundingBox(),
  12299. new l({
  12300. geometry: t,
  12301. textureName: e.material_name,
  12302. name: e.chunk_name,
  12303. meshUrl: i
  12304. })
  12305. });
  12306. return a ? t(a) : (c.error(".dam protobuf came out with no chunks..."),
  12307. r())
  12308. }
  12309. },
  12310. h.exports = t
  12311. }
  12312. ).call(this, a("buffer").Buffer, "/js/loaders/DamLoader.js")
  12313. }
  12314. , {
  12315. "../objects/Chunk": 144,
  12316. "../util/ajax": 181,
  12317. "../util/common": 185,
  12318. "../util/logger": 189,
  12319. buffer: 198,
  12320. protobufjs: 214,
  12321. three: 217
  12322. }],
  12323. 105: [function(n, r, e) {
  12324. (function(e) {
  12325. "use strict";
  12326. var t = (n("three"),
  12327. n("../settings"),
  12328. n("../util/browser"),
  12329. n("./DamLoader"))
  12330. , i = n("../util/logger")
  12331. , u = (n("../ab"),
  12332. new i(e));
  12333. r.exports = {
  12334. getLoaders: function() {
  12335. return [["_50k", ".dam", t], ["", ".dam", t]]
  12336. },
  12337. load: function(e, t, i, n, r, o) {
  12338. var a = this.getLoaders()[o = o || 0];
  12339. if (a) {
  12340. var s = a[0]
  12341. , l = a[1]
  12342. , c = new a[2](t)
  12343. , h = t.get(e + s + l);
  12344. h ? (u.debug("Trying " + s + l),
  12345. c.load(h, i, n, function() {
  12346. this.load(e, t, i, n, r, ++o)
  12347. }
  12348. .bind(this))) : (u.debug("Skipping " + l + ", not available"),
  12349. this.load(e, t, i, n, r, ++o))
  12350. } else
  12351. r && r("No suitable model file found...")
  12352. }
  12353. }
  12354. }
  12355. ).call(this, "/js/loaders/ModelLoader.js")
  12356. }
  12357. , {
  12358. "../ab": 3,
  12359. "../settings": 166,
  12360. "../util/browser": 182,
  12361. "../util/logger": 189,
  12362. "./DamLoader": 104,
  12363. three: 217
  12364. }],
  12365. 106: [function(i, n, e) {
  12366. (function(e) {
  12367. "use strict";
  12368. var l = i("../util/common")
  12369. , c = i("../util/texture")
  12370. , h = i("../util/browser")
  12371. , t = i("../util/logger")
  12372. , u = i("../settings")
  12373. , d = new t(e);
  12374. n.exports = {
  12375. load: function(i, n) {
  12376. if (!i.chunks[0] || !i.chunks[0].meshUrl)
  12377. return $.when();
  12378. var r = l.countUnique(i.chunks.map(function(e) {
  12379. return e.textureName
  12380. }))
  12381. , e = -1 !== i.chunks[0].meshUrl.indexOf("_50k") ? "_50k" : ""
  12382. , t = "_50k" == e ? "high" : "low";
  12383. u.minimalMemoryMode && "high" === t && (h.detectSamsungS6() ? (d.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12384. t = "low") : r > u.maxMobileTextures && (d.warn("Model probably too large for mobile, turning down quality."),
  12385. t = "low"));
  12386. var o = i.data.job.uuid + e + "_texture_jpg_" + t + "/"
  12387. , a = $.Deferred()
  12388. , s = 0;
  12389. return i.chunks.forEach(function(e) {
  12390. if (!e.material.map && e.textureName) {
  12391. var t = i.urls.get(o + e.textureName);
  12392. e.setTextureMap(c.load(t, function(e, t) {
  12393. e || (n.push(t),
  12394. s++,
  12395. a.notify(s, r),
  12396. s === r && a.resolve())
  12397. }
  12398. .bind(this, c.isLoaded(t))))
  12399. }
  12400. }),
  12401. a.promise()
  12402. }
  12403. }
  12404. }
  12405. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12406. }
  12407. , {
  12408. "../settings": 166,
  12409. "../util/browser": 182,
  12410. "../util/common": 185,
  12411. "../util/logger": 189,
  12412. "../util/texture": 194
  12413. }],
  12414. 107: [function(s, l, e) {
  12415. (function(n, e) {
  12416. "use strict";
  12417. function t(e) {
  12418. this.model = e,
  12419. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12420. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12421. var t = n("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12422. , i = r.loadProto(t);
  12423. this.decoder = i.build("VisionModeldata")
  12424. }
  12425. var r = s("protobufjs")
  12426. , i = s("../util/ajax")
  12427. , o = (s("../util/common"),
  12428. s("../util/math"))
  12429. , a = new (s("../util/logger"))(e);
  12430. t.prototype.load = function() {
  12431. return this.modelDataPath ? (a.info("Using vision.modeldata"),
  12432. this.loadVisionModelData()) : this.sweepLocationsPath ? (a.warn("Using sweep_locations.csv"),
  12433. this.loadSweepLocationsCSV()) : (a.warn("No sweep file found"),
  12434. $.when([]))
  12435. }
  12436. ,
  12437. t.prototype.loadVisionModelData = function() {
  12438. return i.get(this.modelDataPath, {
  12439. responseType: "arraybuffer"
  12440. }).then(function(e) {
  12441. var t;
  12442. try {
  12443. t = this.decoder.decode(e)
  12444. } catch (e) {
  12445. return a.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12446. this.loadSweepLocationsCSV()
  12447. }
  12448. var i = t.sweepLocations.map(function(e) {
  12449. return {
  12450. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12451. position: {
  12452. x: e.pose.translation.x,
  12453. y: e.pose.translation.y,
  12454. z: e.pose.translation.z
  12455. },
  12456. quaternion: {
  12457. x: e.pose.rotation.x,
  12458. y: e.pose.rotation.y,
  12459. z: e.pose.rotation.z,
  12460. w: e.pose.rotation.w
  12461. },
  12462. puck: {
  12463. x: e.puck.x,
  12464. y: e.puck.y,
  12465. z: e.puck.z
  12466. },
  12467. floor: window.sceneFrom == 'kankan' ? e.subgroup : e.group,
  12468. neighbours: e.visibles,
  12469. alignmentType: e.alignment_type
  12470. }
  12471. }).map(function(e) {
  12472. return e.position = o.convertVisionVector(e.position),
  12473. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12474. e.puck = o.convertVisionVector(e.puck),
  12475. e
  12476. });
  12477. return i.forEach(function(e) {
  12478. /* if(e.neighbours.find(a=>a==-1)){
  12479. console.log('%c neighbours 存在-1 ' +e.uuid ,"color:#f00")
  12480. } */
  12481. e.neighbours = e.neighbours.filter(e=>i[e])
  12482. e.neighbours = e.neighbours.map(function(e) {
  12483. return i[e].uuid
  12484. })
  12485. }),
  12486. i
  12487. }
  12488. .bind(this), function() {
  12489. return a.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12490. this.loadSweepLocationsCSV()
  12491. }
  12492. .bind(this))
  12493. }
  12494. ,
  12495. t.prototype.loadSweepLocationsCSV = function() {
  12496. return i.get(this.sweepLocationsPath).then(function(e) {
  12497. return e.split("\n").map(function(e) {
  12498. return e.split(", ")
  12499. }).filter(function(e) {
  12500. return 1 < e.length
  12501. }).map(function(e) {
  12502. return {
  12503. uuid: e[0],
  12504. position: {
  12505. x: parseFloat(e[1]),
  12506. y: parseFloat(e[2]),
  12507. z: parseFloat(e[3])
  12508. },
  12509. quaternion: {
  12510. x: parseFloat(e[4]),
  12511. y: parseFloat(e[5]),
  12512. z: parseFloat(e[6]),
  12513. w: parseFloat(e[7])
  12514. }
  12515. }
  12516. }).map(function(e) {
  12517. return e.position = o.convertVisionVector(e.position),
  12518. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12519. e
  12520. })
  12521. }).fail(function() {
  12522. a.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12523. })
  12524. }
  12525. ,
  12526. l.exports = t
  12527. }
  12528. ).call(this, s("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12529. }
  12530. , {
  12531. "../util/ajax": 181,
  12532. "../util/common": 185,
  12533. "../util/logger": 189,
  12534. "../util/math": 190,
  12535. buffer: 198,
  12536. protobufjs: 214
  12537. }],
  12538. 108: [function(s, l, e) {
  12539. (function(e) {
  12540. "use strict";
  12541. function t() {
  12542. this.locale = null
  12543. }
  12544. var i = s("../settings")
  12545. , n = s("../util/common")
  12546. , r = s("../util/logger")
  12547. , o = s("../enum/Locale")
  12548. , a = new r(e);
  12549. t.prototype.init = function() {
  12550. var e;
  12551. switch (i.languageTag) {
  12552. case null:
  12553. case "en":
  12554. case o.EN_US:
  12555. this.locale = o.EN_US,
  12556. e = s("./strings-en-US");
  12557. break;
  12558. case "es":
  12559. case o.ES_MX:
  12560. this.locale = o.ES_MX,
  12561. e = s("./strings-es-MX");
  12562. break;
  12563. case "fr":
  12564. case o.FR_FR:
  12565. this.locale = o.FR_FR,
  12566. e = s("./strings-fr-FR");
  12567. break;
  12568. case "de":
  12569. case o.DE_DE:
  12570. this.locale = o.DE_DE,
  12571. e = s("./strings-de-DE");
  12572. break;
  12573. case "ru":
  12574. case o.RU_RU:
  12575. this.locale = o.RU_RU,
  12576. e = s("./strings-ru-RU");
  12577. break;
  12578. case "cn":
  12579. case o.CN_CN:
  12580. this.locale = o.CN_CN,
  12581. e = s("./strings-cn-CN");
  12582. break;
  12583. case "jp":
  12584. case o.JP_JP:
  12585. this.locale = o.JP_JP,
  12586. e = s("./strings-jp-JP");
  12587. break;
  12588. default:
  12589. a.info("Unsupported language tag, defaulting to 'en-US'"),
  12590. this.locale = o.EN_US,
  12591. e = s("./strings-en-US")
  12592. }
  12593. a.info("Using locale '" + this.locale + "'"),
  12594. n.extendObject(this, e)
  12595. }
  12596. ,
  12597. t.prototype.localizeGUI = function() {
  12598. var e = document.querySelector("#gui-parent");
  12599. this.localizeTree(e),
  12600. this.localizeLoadingText()
  12601. }
  12602. ,
  12603. t.prototype.localizeLoadingText = function() {
  12604. document.querySelector("#help-dialog").classList.add(this.locale),
  12605. document.querySelector("#interaction-modal").classList.add(this.locale),
  12606. document.querySelector("#gui").classList.add(this.locale)
  12607. }
  12608. ,
  12609. t.prototype.localizeTree = function(e) {
  12610. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12611. if (e.nodeType === Node.TEXT_NODE)
  12612. (t = e.data.match(n)) && (i = t[1],
  12613. e.data = this.localizeText(i) || i);
  12614. else if (e.nodeType === Node.ELEMENT_NODE) {
  12615. var r = e.getAttribute("title");
  12616. r && ((t = r.match(n)) && (i = t[1],
  12617. e.setAttribute("title", this.localizeText(i) || i)))
  12618. }
  12619. for (e = e.firstChild; e; )
  12620. this.localizeTree(e),
  12621. e = e.nextSibling
  12622. }
  12623. ,
  12624. t.prototype.localizeText = function(e) {
  12625. var t = this[e];
  12626. return t || this.locale === o.EN_US || (a.warn("Localization key '" + e + "' not available for locale '" + this.locale + "', defaulting to English."),
  12627. t = s("./strings-en-US")[e]),
  12628. t || a.warn("Localization key '" + e + "' not available for locale 'en-US'"),
  12629. t
  12630. }
  12631. ,
  12632. l.exports = new t
  12633. }
  12634. ).call(this, "/js/localization/localize.js")
  12635. }
  12636. , {
  12637. "../enum/Locale": 31,
  12638. "../settings": 166,
  12639. "../util/common": 185,
  12640. "../util/logger": 189,
  12641. "./strings-cn-CN": 109,
  12642. "./strings-de-DE": 110,
  12643. "./strings-en-US": 111,
  12644. "./strings-es-MX": 112,
  12645. "./strings-fr-FR": 113,
  12646. "./strings-jp-JP": 114,
  12647. "./strings-ru-RU": 115
  12648. }],
  12649. 109: [function(e, t, i) {
  12650. "use strict";
  12651. t.exports = {
  12652. PAGE_TITLE: "",
  12653. LOADING: "正在加载",
  12654. PRESENTED_BY_CAPS: "呈现者:",
  12655. POWERED_BY: "技术支持:",
  12656. POWERED_BY_CAPS: "技术支持:",
  12657. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12658. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12659. PRESENTED_BY: "呈现者:",
  12660. MORE: "更多 ",
  12661. LESS: "更少 ",
  12662. TAG_CONTENT: "tag™ 内容",
  12663. SHOW: "显示",
  12664. HIDE: "隐藏",
  12665. DOLLHOUSE: "场景屋",
  12666. FLOOR_PLAN: "楼层平面图",
  12667. OPEN_HIGHLIGHTS: "打开精彩片段",
  12668. CLOSE_HIGHLIGHTS: "关闭",
  12669. PREVIOUS: "上一个",
  12670. PLAY: "播放",
  12671. PAUSE: "暂停",
  12672. NEXT: "下一个",
  12673. EXPLORE_3D_SPACE: "探索 3D 空间",
  12674. VIEW_DOLLHOUSE: "观看场景屋",
  12675. SOCIAL_SHARING: "分享这个空间",
  12676. VIEW_IN_VR: "以 VR 观看",
  12677. VIEW_FULLSCREEN: "全屏观看",
  12678. EXIT_FULLSCREEN: " 退出全屏",
  12679. ZOOM_IN: "放大",
  12680. ZOOM_OUT: "缩小",
  12681. FLOOR_NAME: "楼层",
  12682. FLOOR_ALL: "ALL",
  12683. FLOOR_Lang: ["Floor", ""],
  12684. TERMS: "条款",
  12685. PORT_TERMS: "port 条款",
  12686. TERMS_OF_USE: "使用条款",
  12687. CLOSE_TERMS: "关闭",
  12688. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12689. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12690. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12691. WEBVR_ENTER_WEBVR: "进入 VR",
  12692. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12693. WEBVR_LEARN_MORE: "了解更多",
  12694. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12695. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12696. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12697. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12698. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12699. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12700. VR_LEARN_MORE_CAPS: "了解更多",
  12701. VR_PREVIOUS_CAPS: "上一个’,",
  12702. VR_NEXT_CAPS: "下一个",
  12703. VR_GOT_IT_CAPS: "明白了",
  12704. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12705. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12706. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12707. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12708. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12709. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12710. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12711. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12712. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12713. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12714. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12715. VR_APP: "port VR 应用程序",
  12716. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12717. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12718. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12719. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12720. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12721. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12722. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12723. VR_ANDROID_DVICES: "Android 设备",
  12724. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12725. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12726. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12727. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12728. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12729. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12730. VR_DOWNLOAD_HERE: "在此下载",
  12731. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12732. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12733. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12734. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12735. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12736. SHARE_TO: "分享到",
  12737. SHARE_LINK: "直接链接",
  12738. SHARE_EXPLORE: "探索",
  12739. SHARE_AT: "在",
  12740. SHARE_WITH: "使用",
  12741. SHARE_3D: "以 3D",
  12742. SHARE_COPIED: "已复制!",
  12743. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12744. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12745. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12746. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12747. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12748. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12749. ERROR_GENERIC_ACTIONS_3: " 或",
  12750. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12751. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12752. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12753. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12754. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12755. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12756. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12757. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12758. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12759. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12760. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12761. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12762. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12763. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12764. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12765. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12766. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12767. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12768. LINK_TO_LOCATION: "地点链接",
  12769. MENU_COPY: "复制",
  12770. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12771. ROTATE: "旋转",
  12772. MOVE: "移动",
  12773. INSIDE: "内部",
  12774. ZOOM: "缩放",
  12775. HELP: "小帮手",
  12776. HELP_NAVIGATION_TAB: "导航",
  12777. HELP_MORE_HELP_TAB: "更多帮助",
  12778. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12779. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12780. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12781. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12782. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12783. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12784. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12785. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12786. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12787. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12788. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12789. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12790. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12791. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12792. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12793. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12794. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12795. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12796. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12797. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12798. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12799. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12800. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12801. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12802. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12803. HELP_MORE_HLR_A: "精彩片段集锦",
  12804. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12805. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12806. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12807. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12808. HELP_MORE_FLOORS_A: "楼层选择器",
  12809. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12810. HELP_MORE_TAG_A: "tag™ 贴文",
  12811. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12812. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12813. HELP_MORE_ZOOM_A: "缩放控件",
  12814. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12815. HELP_MORE_TOUR_A: "导览控件",
  12816. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12817. HELP_MORE_INSIDE_A: "内部视图",
  12818. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12819. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12820. HELP_MORE_VR_A: "VR 模式",
  12821. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12822. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12823. HELP_MORE_360_A: "360° 视图",
  12824. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12825. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12826. HELP_MORE_FULLSCREEN_A: "全屏",
  12827. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12828. CLOSE: "关闭"
  12829. }
  12830. }
  12831. , {}],
  12832. 110: [function(e, t, i) {
  12833. "use strict";
  12834. t.exports = {
  12835. PAGE_TITLE: "",
  12836. LOADING: "Lädt",
  12837. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  12838. POWERED_BY: "Angetrieben von",
  12839. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  12840. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12841. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12842. PRESENTED_BY: "Präsentiert von ",
  12843. MORE: "Mehr ",
  12844. LESS: "Weniger ",
  12845. TAG_CONTENT: "tag™ Inhalt",
  12846. SHOW: "Anzeigen",
  12847. HIDE: "Verbergen",
  12848. DOLLHOUSE: "Puppenhaus",
  12849. FLOOR_PLAN: "Grundriss",
  12850. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  12851. CLOSE_HIGHLIGHTS: "Schließen",
  12852. PREVIOUS: "Vorheriges",
  12853. PLAY: "Abspielen",
  12854. PAUSE: "Pausieren",
  12855. NEXT: "Nächstes",
  12856. EXPLORE_3D_SPACE: "Innenraum betreten",
  12857. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  12858. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  12859. VIEW_IN_VR: "In VR ansehen",
  12860. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  12861. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  12862. ZOOM_IN: "Vergrößern",
  12863. ZOOM_OUT: "Verkleinern",
  12864. FLOOR_NAME: "Etage ",
  12865. FLOOR_ALL: "Alle",
  12866. TERMS: "Bedingungen",
  12867. PORT_TERMS: "port Bedingungen",
  12868. TERMS_OF_USE: "Nutzungsbedingungen",
  12869. TERMS_TEXT_FILE: "terms-de-DE.html",
  12870. CLOSE_TERMS: "Schließen",
  12871. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  12872. HELP: "Hilfe",
  12873. HELP_NAVIGATION_TAB: "Navigation",
  12874. HELP_MORE_HELP_TAB: "Hilfe-Details",
  12875. CLOSE: "Schließen",
  12876. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  12877. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  12878. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12879. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  12880. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  12881. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  12882. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  12883. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  12884. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  12885. 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.",
  12886. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12887. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  12888. 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.",
  12889. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  12890. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12891. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  12892. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  12893. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  12894. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  12895. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  12896. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  12897. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  12898. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  12899. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  12900. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  12901. HELP_MORE_HLR_A: "Liste das Highlight",
  12902. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  12903. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  12904. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12905. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12906. HELP_MORE_FLOORS_A: "Etage auswählen",
  12907. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  12908. HELP_MORE_TAG_A: "tag™ Posts",
  12909. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  12910. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  12911. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  12912. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  12913. HELP_MORE_TOUR_A: "Tour Steuerung",
  12914. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  12915. HELP_MORE_INSIDE_A: "Innenansicht",
  12916. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  12917. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  12918. HELP_MORE_VR_A: "VR Modus",
  12919. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  12920. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  12921. HELP_MORE_360_A: "360° Views Ansicht ",
  12922. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12923. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12924. HELP_MORE_FULLSCREEN_A: "Vollbild",
  12925. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  12926. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  12927. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  12928. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  12929. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  12930. WEBVR_LEARN_MORE: "Mehr Infos",
  12931. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12932. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12933. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12934. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  12935. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  12936. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12937. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12938. VR_APP: "port VR App",
  12939. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  12940. 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",
  12941. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  12942. VR_APP_FOR_ANDROID: "port VR app für Android",
  12943. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  12944. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12945. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  12946. VR_PREVIOUS_CAPS: "ZURÜCK",
  12947. VR_NEXT_CAPS: "WEITER",
  12948. VR_GOT_IT_CAPS: "VERSTANDEN",
  12949. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  12950. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  12951. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  12952. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  12953. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  12954. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  12955. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12956. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12957. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12958. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  12959. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  12960. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  12961. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  12962. VR_ANDROID_DVICES: "Android Geräte",
  12963. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  12964. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  12965. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  12966. VR_DOWNLOAD_HERE: "Hier runterladen",
  12967. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  12968. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  12969. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  12970. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  12971. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  12972. SHARE_TO: "Teilen auf",
  12973. SHARE_LINK: "Direkter Link",
  12974. SHARE_EXPLORE: "Umsehen",
  12975. SHARE_AT: "auf",
  12976. SHARE_WITH: "mit",
  12977. SHARE_3D: "in 3D",
  12978. SHARE_COPIED: "Kopiert!",
  12979. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  12980. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  12981. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  12982. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  12983. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12984. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  12985. ERROR_GENERIC_ACTIONS_3: " oder ",
  12986. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12987. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  12988. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  12989. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  12990. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  12991. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  12992. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  12993. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  12994. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  12995. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  12996. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  12997. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  12998. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  12999. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13000. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13001. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13002. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13003. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13004. LINK_TO_LOCATION: "Link zu",
  13005. MENU_COPY: "Kopieren",
  13006. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13007. ROTATE: "Drehen",
  13008. INSIDE: "Drinnen",
  13009. MOVE: "Bewegen",
  13010. ZOOM: "Vergrößern"
  13011. }
  13012. }
  13013. , {}],
  13014. 111: [function(e, t, i) {
  13015. "use strict";
  13016. t.exports = {
  13017. PAGE_TITLE: "",
  13018. LOADING: "Loading",
  13019. PRESENTED_BY_CAPS: "PRESENTED BY",
  13020. POWERED_BY: "powered by ",
  13021. POWERED_BY_CAPS: "POWERED BY",
  13022. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13023. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13024. PRESENTED_BY: "Presented by ",
  13025. MORE: "More ",
  13026. LESS: "Less ",
  13027. TAG_CONTENT: "tag™ Content",
  13028. SHOW: "Show",
  13029. HIDE: "Hide",
  13030. DOLLHOUSE: "Dollhouse",
  13031. FLOOR_PLAN: "Floor plan",
  13032. OPEN_HIGHLIGHTS: "Open Highlights",
  13033. CLOSE_HIGHLIGHTS: "Close",
  13034. PREVIOUS: "Previous",
  13035. PLAY: "Play",
  13036. PAUSE: "Pause",
  13037. NEXT: "Next",
  13038. EXPLORE_3D_SPACE: "Explore 3D Space",
  13039. VIEW_DOLLHOUSE: "View dollhouse",
  13040. SOCIAL_SHARING: "Share this Space",
  13041. VIEW_IN_VR: "View in VR",
  13042. VIEW_FULLSCREEN: "全屏",
  13043. EXIT_FULLSCREEN: "退出全屏",
  13044. ZOOM_IN: "Zoom in",
  13045. ZOOM_OUT: "Zoom out",
  13046. FLOOR_NAME: "Floor ",
  13047. FLOOR_ALL: "全部",
  13048. TERMS: "Terms",
  13049. PORT_TERMS: "port terms",
  13050. TERMS_OF_USE: "Terms of Use",
  13051. TERMS_TEXT_FILE: "terms-en-US.html",
  13052. CLOSE_TERMS: "Close",
  13053. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13054. HELP: "Help",
  13055. HELP_NAVIGATION_TAB: "Navigation",
  13056. HELP_MORE_HELP_TAB: "More Help",
  13057. CLOSE: "Close",
  13058. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13059. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13060. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13061. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13062. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13063. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13064. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13065. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13066. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13067. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13068. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13069. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13070. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13071. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13072. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13073. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13074. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13075. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13076. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13077. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13078. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13079. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13080. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13081. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13082. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13083. HELP_MORE_HLR_A: "Highlight Reel",
  13084. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13085. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13086. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13087. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13088. HELP_MORE_FLOORS_A: "Floor Selector",
  13089. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13090. HELP_MORE_TAG_A: "tag™ Posts",
  13091. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13092. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13093. HELP_MORE_ZOOM_A: "Zoom Controls",
  13094. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13095. HELP_MORE_TOUR_A: "Tour Controls",
  13096. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13097. HELP_MORE_INSIDE_A: "Inside View",
  13098. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13099. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13100. HELP_MORE_VR_A: "VR Mode",
  13101. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13102. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13103. HELP_MORE_360_A: "360° Views",
  13104. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13105. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13106. HELP_MORE_FULLSCREEN_A: "Full screen",
  13107. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13108. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13109. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13110. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13111. WEBVR_ENTER_WEBVR: "ENTER VR",
  13112. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13113. WEBVR_LEARN_MORE: "Learn more",
  13114. WEBVR_VIEW_SPACE: "View Space in VR",
  13115. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13116. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13117. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13118. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13119. VR_PREVIOUS_CAPS: "PREVIOUS",
  13120. VR_NEXT_CAPS: "NEXT",
  13121. VR_GOT_IT_CAPS: "GOT IT",
  13122. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13123. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13124. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13125. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13126. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13127. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13128. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13129. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13130. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13131. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13132. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13133. VR_APP: "port VR App",
  13134. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13135. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13136. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13137. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13138. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13139. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13140. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13141. VR_ANDROID_DVICES: "Android Devices",
  13142. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13143. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13144. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13145. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13146. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13147. VR_APP_OPEN: "Open with the port VR app instead",
  13148. VR_DOWNLOAD_HERE: "Download here",
  13149. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13150. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13151. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13152. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13153. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13154. SHARE_TO: "Share to",
  13155. SHARE_LINK: "Direct Link",
  13156. SHARE_EXPLORE: "Explore ",
  13157. SHARE_AT: "at",
  13158. SHARE_WITH: "with",
  13159. SHARE_3D: " in 3D",
  13160. SHARE_COPIED: "Copied!",
  13161. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13162. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13163. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13164. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13165. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13166. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13167. ERROR_GENERIC_ACTIONS_3: " or ",
  13168. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13169. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13170. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13171. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13172. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13173. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13174. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13175. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13176. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13177. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13178. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13179. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13180. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13181. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13182. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13183. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13184. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13185. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13186. LINK_TO_LOCATION: "Link to location",
  13187. MENU_COPY: "Copy",
  13188. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13189. ROTATE: "Rotate",
  13190. INSIDE: "Inside",
  13191. MOVE: "Move",
  13192. ZOOM: "Zoom"
  13193. }
  13194. }
  13195. , {}],
  13196. 112: [function(e, t, i) {
  13197. "use strict";
  13198. t.exports = {
  13199. PAGE_TITLE: "",
  13200. LOADING: "Cargando",
  13201. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13202. POWERED_BY: "potenciando por ",
  13203. POWERED_BY_CAPS: "POTENCIADO POR ",
  13204. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13205. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13206. PRESENTED_BY: "Presentado por ",
  13207. MORE: "Más ",
  13208. LESS: "Menos ",
  13209. TAG_CONTENT: "Contenido de tag™",
  13210. SHOW: "Mostrar",
  13211. HIDE: "Ocultar",
  13212. DOLLHOUSE: "Dollhouse",
  13213. FLOOR_PLAN: "Planos",
  13214. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13215. CLOSE_HIGHLIGHTS: "Cerrar",
  13216. PREVIOUS: "Anterior",
  13217. PLAY: "Play",
  13218. PAUSE: "Pausa",
  13219. NEXT: "Siguiente",
  13220. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13221. VIEW_DOLLHOUSE: "Ver dollhouse",
  13222. SOCIAL_SHARING: "Compartir este espacio",
  13223. VIEW_IN_VR: "Ver en realidad virtual",
  13224. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13225. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13226. ZOOM_IN: "Acercar",
  13227. ZOOM_OUT: "Alejar",
  13228. FLOOR_NAME: "Piso ",
  13229. FLOOR_ALL: "Todas",
  13230. TERMS: "Condiciones",
  13231. PORT_TERMS: "port términos de uso",
  13232. TERMS_OF_USE: "Términos de uso",
  13233. TERMS_TEXT_FILE: "terms-es-MX.html",
  13234. CLOSE_TERMS: "Cerrar",
  13235. 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.",
  13236. HELP: "Ayuda",
  13237. HELP_NAVIGATION_TAB: "Navegación",
  13238. HELP_MORE_HELP_TAB: "Más Ayuda",
  13239. CLOSE: "Cerrar",
  13240. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13241. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13242. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13243. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13244. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13245. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13246. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13247. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13248. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13249. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13250. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13251. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13252. 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.",
  13253. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13254. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13255. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13256. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13257. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13258. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13259. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13260. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13261. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13262. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13263. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13264. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13265. HELP_MORE_HLR_A: "Galería destacada",
  13266. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13267. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13268. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13269. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13270. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13271. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13272. HELP_MORE_TAG_A: "tag™ Posts",
  13273. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13274. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13275. HELP_MORE_ZOOM_A: "Controles de zoom",
  13276. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13277. HELP_MORE_TOUR_A: "Controles de recorrido",
  13278. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13279. HELP_MORE_INSIDE_A: "Vista interior",
  13280. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13281. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13282. HELP_MORE_VR_A: "Modo de realidad virtual",
  13283. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13284. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13285. HELP_MORE_360_A: "360° Views",
  13286. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13287. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13288. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13289. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13290. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13291. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13292. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13293. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13294. WEBVR_LEARN_MORE: "Más información",
  13295. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13296. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13297. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13298. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13299. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13300. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13301. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13302. VR_APP: "port VR App",
  13303. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13304. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13305. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13306. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13307. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13308. VR_PREVIOUS_CAPS: "ANTERIOR",
  13309. VR_NEXT_CAPS: "SIGUIENTE",
  13310. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13311. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13312. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13313. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13314. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13315. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13316. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13317. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13318. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13319. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13320. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13321. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13322. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13323. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13324. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13325. VR_ANDROID_DVICES: "Dispositivos Android",
  13326. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13327. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13328. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13329. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13330. VR_DOWNLOAD_HERE: "Descargar aquí",
  13331. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13332. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13333. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13334. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13335. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13336. SHARE_TO: "Compartir en",
  13337. SHARE_LINK: "Enlace directo",
  13338. SHARE_EXPLORE: "Explorar ",
  13339. SHARE_AT: "en",
  13340. SHARE_WITH: "con",
  13341. SHARE_3D: " en 3D",
  13342. SHARE_COPIED: "¡Copiado!",
  13343. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13344. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13345. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13346. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13347. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13348. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13349. ERROR_GENERIC_ACTIONS_3: " o ",
  13350. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13351. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13352. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13353. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13354. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13355. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13356. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13357. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13358. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13359. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13360. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13361. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13362. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13363. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13364. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13365. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13366. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13367. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13368. LINK_TO_LOCATION: "Enlace a la ubicación",
  13369. MENU_COPY: "Copiar",
  13370. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13371. ROTATE: "Girar",
  13372. INSIDE: "Interior",
  13373. MOVE: "Moverse",
  13374. ZOOM: "Acercar o alejar"
  13375. }
  13376. }
  13377. , {}],
  13378. 113: [function(e, t, i) {
  13379. "use strict";
  13380. t.exports = {
  13381. PAGE_TITLE: "",
  13382. LOADING: "Chargement",
  13383. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13384. POWERED_BY: "alimenté par ",
  13385. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13386. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13387. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13388. PRESENTED_BY: "Présenté par ",
  13389. MORE: "Plus ",
  13390. LESS: "Moins ",
  13391. TAG_CONTENT: "Contenu tag™",
  13392. SHOW: "Montrer",
  13393. HIDE: "Cacher",
  13394. DOLLHOUSE: "Dollhouse",
  13395. FLOOR_PLAN: "Plan de sol",
  13396. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13397. CLOSE_HIGHLIGHTS: "Fermer",
  13398. PREVIOUS: "Précédent",
  13399. PLAY: "Lecture",
  13400. PAUSE: "Pause",
  13401. NEXT: "Suivant",
  13402. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13403. VIEW_DOLLHOUSE: "Voir dollhouse",
  13404. SOCIAL_SHARING: "Partager cet espace",
  13405. VIEW_IN_VR: "Voir en VR",
  13406. VIEW_FULLSCREEN: "Plein écran",
  13407. EXIT_FULLSCREEN: "Fermer plein écran",
  13408. ZOOM_IN: "Zoom avant",
  13409. ZOOM_OUT: "Zoom arrière",
  13410. FLOOR_NAME: "Étage ",
  13411. FLOOR_ALL: "Tous",
  13412. TERMS: "Mentions légales",
  13413. PORT_TERMS: "port mentions légales",
  13414. TERMS_OF_USE: "Conditions d'utilisation",
  13415. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13416. CLOSE_TERMS: "Fermer",
  13417. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13418. HELP: "Aide",
  13419. HELP_NAVIGATION_TAB: "Navigation",
  13420. HELP_MORE_HELP_TAB: "Aide",
  13421. CLOSE: "Fermer",
  13422. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13423. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13424. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13425. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13426. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13427. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13428. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13429. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13430. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13431. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13432. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13433. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13434. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13435. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13436. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13437. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13438. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13439. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13440. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13441. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13442. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13443. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13444. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13445. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13446. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13447. HELP_MORE_HLR_A: "Carrousel",
  13448. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13449. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13450. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13451. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13452. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13453. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13454. HELP_MORE_TAG_A: "tag™ Posts",
  13455. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13456. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13457. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13458. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13459. HELP_MORE_TOUR_A: "Commandes de la visite",
  13460. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13461. HELP_MORE_INSIDE_A: "Vue intérieure",
  13462. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13463. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13464. HELP_MORE_VR_A: "Mode RV",
  13465. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13466. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13467. HELP_MORE_360_A: "Vues 360°",
  13468. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13469. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13470. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13471. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13472. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13473. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13474. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13475. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13476. WEBVR_LEARN_MORE: "En savoir plus",
  13477. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13478. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13479. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13480. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13481. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13482. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13483. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13484. VR_NEXT_CAPS: "SUIVANT",
  13485. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13486. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13487. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13488. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13489. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13490. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13491. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13492. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13493. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13494. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13495. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13496. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13497. VR_APP: "port VR App",
  13498. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13499. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13500. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13501. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13502. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13503. 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",
  13504. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13505. VR_ANDROID_DVICES: "Appareils Android",
  13506. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13507. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13508. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13509. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13510. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13511. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13512. VR_DOWNLOAD_HERE: "Télécharger ici",
  13513. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13514. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13515. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13516. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13517. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13518. SHARE_TO: "Partager sur",
  13519. SHARE_LINK: "Lien direct",
  13520. SHARE_EXPLORE: "Explorer ",
  13521. SHARE_AT: "à",
  13522. SHARE_WITH: "avec",
  13523. SHARE_3D: " en 3D",
  13524. SHARE_COPIED: "Copié!",
  13525. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13526. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13527. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13528. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13529. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13530. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13531. ERROR_GENERIC_ACTIONS_3: " ou ",
  13532. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13533. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13534. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13535. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13536. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13537. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13538. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13539. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13540. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13541. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13542. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13543. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13544. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13545. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13546. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13547. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13548. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13549. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13550. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13551. MENU_COPY: "Copie",
  13552. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13553. ROTATE: "Faire pivoter",
  13554. INSIDE: "Intérieure",
  13555. MOVE: "Se déplacer",
  13556. ZOOM: "Zoom"
  13557. }
  13558. }
  13559. , {}],
  13560. 114: [function(e, t, i) {
  13561. "use strict";
  13562. t.exports = {
  13563. PAGE_TITLE: "",
  13564. LOADING: "読み込み中",
  13565. PRESENTED_BY_CAPS: "PRESENTED BY",
  13566. POWERED_BY: "powered by",
  13567. POWERED_BY_CAPS: "POWERED BY",
  13568. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13569. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13570. PRESENTED_BY: "Presented by ",
  13571. MORE: "全て表示 ",
  13572. LESS: "閉じる ",
  13573. TAG_CONTENT: "tag™コンテンツ ",
  13574. SHOW: "表示",
  13575. HIDE: "非表示",
  13576. DOLLHOUSE: "ドールハウス",
  13577. FLOOR_PLAN: "フロアプラン",
  13578. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13579. CLOSE_HIGHLIGHTS: "閉じる",
  13580. PREVIOUS: "前へ",
  13581. PLAY: "再生",
  13582. PAUSE: "一時停止",
  13583. NEXT: "次へ",
  13584. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13585. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13586. SOCIAL_SHARING: "このSpaceを共有する",
  13587. VIEW_IN_VR: "VRで表示",
  13588. VIEW_FULLSCREEN: "フルスクリーン表示",
  13589. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13590. ZOOM_IN: "ズームイン",
  13591. ZOOM_OUT: "ズームアウト",
  13592. FLOOR_NAME: "フロア ",
  13593. FLOOR_ALL: "すべて",
  13594. TERMS: "規約",
  13595. PORT_TERMS: "port規約",
  13596. TERMS_OF_USE: "利用規約",
  13597. CLOSE_TERMS: "閉じる",
  13598. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13599. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13600. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13601. WEBVR_ENTER_WEBVR: "VRに入る",
  13602. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13603. WEBVR_LEARN_MORE: "もっと詳しく",
  13604. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13605. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13606. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13607. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13608. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13609. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13610. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13611. VR_PREVIOUS_CAPS: "前へ",
  13612. VR_NEXT_CAPS: "次へ",
  13613. VR_GOT_IT_CAPS: "了解",
  13614. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13615. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13616. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13617. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13618. VR_WHAT_YOU_NEED: "必要なもの",
  13619. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13620. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13621. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13622. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13623. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13624. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13625. VR_APP: "port VRアプリ",
  13626. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13627. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13628. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13629. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13630. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13631. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13632. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13633. VR_ANDROID_DVICES: "Androidデバイス",
  13634. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13635. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13636. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13637. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13638. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13639. VR_APP_OPEN: "port VRアプリで開く",
  13640. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13641. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13642. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13643. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13644. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13645. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13646. SHARE_TO: "共有先",
  13647. SHARE_LINK: "ダイレクトリンク",
  13648. SHARE_EXPLORE: "探索",
  13649. SHARE_AT: "場所",
  13650. SHARE_WITH: "使用アプリ",
  13651. SHARE_3D: "3Dで",
  13652. SHARE_COPIED: "コピーされました!",
  13653. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13654. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13655. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13656. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13657. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13658. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13659. ERROR_GENERIC_ACTIONS_3: "または",
  13660. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13661. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13662. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13663. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13664. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13665. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13666. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13667. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13668. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13669. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13670. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13671. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13672. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13673. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13674. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13675. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13676. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13677. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13678. LINK_TO_LOCATION: "ロケーションへのリンク",
  13679. MENU_COPY: "コピー",
  13680. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13681. ROTATE: "回転",
  13682. MOVE: "移動",
  13683. INSIDE: "内側",
  13684. ZOOM: "ズーム",
  13685. HELP: "ヘルプ",
  13686. HELP_NAVIGATION_TAB: "ナビゲーション",
  13687. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13688. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13689. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13690. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13691. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13692. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13693. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13694. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13695. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13696. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13697. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13698. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13699. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13700. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13701. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13702. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13703. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13704. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13705. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13706. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13707. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13708. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13709. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13710. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13711. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13712. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13713. HELP_MORE_HLR_A: "ハイライト",
  13714. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13715. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13716. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13717. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13718. HELP_MORE_FLOORS_A: "フロアセレクター",
  13719. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13720. HELP_MORE_TAG_A: "tag™ Posts",
  13721. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13722. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13723. HELP_MORE_ZOOM_A: "ズームコントロール",
  13724. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13725. HELP_MORE_TOUR_A: "ツアーコントロール",
  13726. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13727. HELP_MORE_INSIDE_A: "内側ビュー",
  13728. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13729. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13730. HELP_MORE_VR_A: "VRモード",
  13731. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13732. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13733. HELP_MORE_360_A: "360° Views",
  13734. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13735. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13736. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13737. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13738. CLOSE: "閉じる"
  13739. }
  13740. }
  13741. , {}],
  13742. 115: [function(e, t, i) {
  13743. "use strict";
  13744. t.exports = {
  13745. PAGE_TITLE: "",
  13746. LOADING: "Загрузка",
  13747. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13748. POWERED_BY: "разработано на платформе ",
  13749. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13750. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13751. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13752. PRESENTED_BY: "Представлено ",
  13753. MORE: "Больше ",
  13754. LESS: "Меньше ",
  13755. TAG_CONTENT: "tag™ Контент",
  13756. SHOW: "Показать",
  13757. HIDE: "Скрыть",
  13758. DOLLHOUSE: "Dollhouse",
  13759. FLOOR_PLAN: "Планировка",
  13760. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13761. CLOSE_HIGHLIGHTS: "Закрыть",
  13762. PREVIOUS: "Предыдущий",
  13763. PLAY: "Воспроизвести",
  13764. PAUSE: "Пауза",
  13765. NEXT: "Следующий",
  13766. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13767. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13768. SOCIAL_SHARING: "Поделиться этой моделью",
  13769. VIEW_IN_VR: "Посмотреть в VR",
  13770. VIEW_FULLSCREEN: "Полный экран",
  13771. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13772. ZOOM_IN: "Увеличить",
  13773. ZOOM_OUT: "Уменьшить",
  13774. FLOOR_NAME: "Этаж ",
  13775. FLOOR_ALL: "Все",
  13776. TERMS: "Условия",
  13777. PORT_TERMS: "Правила пользования",
  13778. TERMS_OF_USE: "Условия использования",
  13779. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13780. CLOSE_TERMS: "Закрыть",
  13781. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13782. HELP: "Помощь",
  13783. HELP_NAVIGATION_TAB: "Навигация",
  13784. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13785. CLOSE: "Закрыть",
  13786. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13787. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13788. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13789. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13790. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13791. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13792. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13793. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13794. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13795. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13796. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13797. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13798. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13799. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13800. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13801. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13802. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13803. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13804. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13805. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13806. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13807. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13808. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13809. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13810. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13811. HELP_MORE_HLR_A: "Фотоколлаж",
  13812. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13813. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13814. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13815. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13816. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13817. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13818. HELP_MORE_TAG_A: "tag™ Posts",
  13819. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13820. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13821. HELP_MORE_ZOOM_A: "Масштаб",
  13822. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13823. HELP_MORE_TOUR_A: "Управление Туром",
  13824. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13825. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13826. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13827. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13828. HELP_MORE_VR_A: "Режим VR",
  13829. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13830. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13831. HELP_MORE_360_A: "360° Views",
  13832. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13833. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13834. HELP_MORE_FULLSCREEN_A: "Полный экран",
  13835. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  13836. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  13837. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  13838. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  13839. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  13840. WEBVR_LEARN_MORE: "Узнать больше",
  13841. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  13842. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  13843. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13844. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  13845. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  13846. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13847. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13848. VR_APP: "port VR App",
  13849. VR_APP_OPEN: "Или открыть через приложение port VR",
  13850. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  13851. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  13852. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  13853. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  13854. VR_VIEW_SPACE: "Запустить модель в VR",
  13855. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  13856. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  13857. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  13858. VR_GOT_IT_CAPS: "ЯСНО",
  13859. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  13860. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  13861. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  13862. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  13863. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  13864. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  13865. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13866. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13867. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13868. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  13869. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  13870. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  13871. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  13872. VR_ANDROID_DVICES: "Android устройства",
  13873. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  13874. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  13875. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  13876. VR_DOWNLOAD_HERE: "Скачать здесь",
  13877. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  13878. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  13879. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  13880. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  13881. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  13882. SHARE_TO: "Поделиться",
  13883. SHARE_LINK: "Прямая ссылка",
  13884. SHARE_EXPLORE: "просмотреть",
  13885. SHARE_AT: "на",
  13886. SHARE_WITH: "с",
  13887. SHARE_3D: "в 3D",
  13888. SHARE_COPIED: "Скопировано!",
  13889. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  13890. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  13891. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  13892. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  13893. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  13894. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  13895. ERROR_GENERIC_ACTIONS_3: " или ",
  13896. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  13897. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  13898. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  13899. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  13900. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  13901. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  13902. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  13903. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  13904. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  13905. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  13906. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  13907. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  13908. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  13909. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  13910. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  13911. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  13912. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  13913. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  13914. LINK_TO_LOCATION: "Ссылка на местоположение",
  13915. MENU_COPY: "Копировать",
  13916. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  13917. ROTATE: "Вращать",
  13918. MOVE: "Передвигаться",
  13919. INSIDE: "Вид изнутри",
  13920. ZOOM: "Масштаб"
  13921. }
  13922. }
  13923. , {}],
  13924. 116: [function(r, e, t) {
  13925. (function(i) {
  13926. "use strict";
  13927. function re(e) {
  13928. console.log("e1:" + e),
  13929. e = Math.round(.4 * e * 100),
  13930. console.log("e2:" + e);
  13931. var t = $(".progressbar");
  13932. t.find(".bar").css("width", e + "%"),
  13933. t.find(".label").css("left", t.width() * e / 100 - 15 + "px"),
  13934. t.find(".perc").text(e + "%")
  13935. }
  13936. $("#gui-loading").fadeIn(200),
  13937. re(.1);
  13938. var e = g_version ? "modeldata.js" : "someData.json";
  13939. $.ajax(g_Prefix + "data/" + window.number + "/" + e + "?" + randomTime().getTime(), {
  13940. dataType: "json"
  13941. }).done(function(e) {
  13942. var t = matcher(e);
  13943. t.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}", window.number),
  13944. t.user = {
  13945. is_authenticated: !1,
  13946. 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"]
  13947. }
  13948. try{//处理一下导览数据
  13949. t.model.images = t.model.images.filter(e=>{
  13950. if(!e.locations && !e.thumbnail_signed_src)return; //旧的曾有导览数据是错误的,将它删除
  13951. if(e.locations)e.locations = e.locations.filter(e=>e)
  13952. if(e.locations && e.locations.length == 0)return;
  13953. return e
  13954. })
  13955. }catch(e){console.log(e) }
  13956. window.editTool = new EditTools()
  13957. t.hotIconScale = parseFloat(t.hotIconScale || 1)
  13958. window.DATA = t
  13959. settings.playTourNearBy = !DATA.tourFromStart
  13960. t.model.summary = t.summary
  13961. t.model.name = t.name
  13962. for(let i in t){
  13963. t[i] == "false" && (t[i] = false)
  13964. }
  13965. re(.7),
  13966. function() {
  13967. function y(e) {
  13968. t.update(e)
  13969. }
  13970. function A(e, t) {
  13971. ne.error(t),
  13972. n.error(t),
  13973. N.report(e, "error-" + t)
  13974. }
  13975. function C(e, t, i) {
  13976. try {
  13977. e.start(t)
  13978. } catch (e) {
  13979. throw ne.warn(e.message),
  13980. function(e) {
  13981. var t = O.details();
  13982. t && "Safari" === t.name && 500 < t.version && t.version < 600 ? (n.error("webgl-safari"),
  13983. N.report(e, "error-webgl-safari")) : (n.error("webgl-generic"),
  13984. N.report(e, "error-webgl-generic"))
  13985. }(i.sid),
  13986. e
  13987. }
  13988. }
  13989. function I(e) {
  13990. e.stopPropagation(),
  13991. e.preventDefault()
  13992. }
  13993. window.DATA.hoticon && (g_HotImage = {
  13994. point: window.DATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  13995. point2: window.DATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  13996. });
  13997. if (window.DATA.backgroundMusic && window.isLocal) {
  13998. window.DATA.backgroundMusic = manage.dealURL(window.DATA.backgroundMusic)
  13999. }else if (g_version === "one"){
  14000. window.DATA.backgroundMusic = manage.dealURL( g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3")
  14001. }
  14002. if (window.DATA.backgroundMusic) {
  14003. SoundManager.setSrc('bgm', window.DATA.backgroundMusic )
  14004. $("#volume").show();
  14005. }
  14006. //隐藏公司logo
  14007. window.DATA.loadlogo && showLogo();
  14008. // 隐藏顶部介绍
  14009. window.DATA.topText && topTextHide();
  14010. r("./lib/three75-shim"),
  14011. r("./lib/array-polyfill"),
  14012. r("./lib/performance-polyfill"),
  14013. r("./lib/shaders/CopyShader.js"),
  14014. r("./lib/shaders/HorizontalBlurShader.js"),
  14015. r("./lib/shaders/VerticalBlurShader.js"),
  14016. r("./lib/postprocessing/EffectComposer.js"),
  14017. r("./lib/postprocessing/RenderPass.js"),
  14018. r("./lib/postprocessing/MaskPass.js"),
  14019. r("./lib/postprocessing/ShaderPass.js"),
  14020. window.Promise || (window.Promise = r("promise-polyfill"));
  14021. var E = r("three")
  14022. , _ = r("three")
  14023. , b = (r("./util/sentry"),
  14024. r("./player"))
  14025. , w = r("./director")
  14026. , T = r("./controls/CameraControls")
  14027. , x = r("./model/ModelManager")
  14028. , S = r("./DisplayController")
  14029. , M = r("./label/LabelDisplayController")
  14030. , R = r("./enum/Viewmode")
  14031. , e = r("./util/logger")
  14032. , P = r("./showcase")
  14033. , O = r("./util/browser")
  14034. , L = r("./settings")
  14035. , D = r("./gui/gui")
  14036. , n = r("./gui/error")
  14037. , N = r("./analytics")
  14038. , F = r("./util/transitions")
  14039. , B = r("./effects")
  14040. , V = r("./objects/Skybox")
  14041. , k = (r("./util/common"),
  14042. r("./util/PanoramaCollection"),
  14043. r("./util/math"),
  14044. r("./util/showcase"))
  14045. , U = r("./util/camera")
  14046. , H = (r("./objects/Panorama"),
  14047. r("./cameras/PanoramaCamera"),
  14048. r("./preloaders"))
  14049. , z = r("events").EventEmitter
  14050. , G = r("./featureflags")
  14051. , W = (r("./util/lerp"),
  14052. r("./util/ajax"),
  14053. r("./ab"))
  14054. , j = r("./sdk/automation.js")
  14055. , Y = r("./scene/SceneRenderer")
  14056. , q = r("./scene/QuickstartManager")
  14057. , X = r("./tile/QualityManager.js")
  14058. , Z = r("./localization/localize")
  14059. , K = r("./tag/tagManager")
  14060. , Q = r("./tile/TileDownloader")
  14061. , J = r("./tile/PanoRenderer")
  14062. , ee = (r("./enum/PanoSizeClass"),
  14063. r("./enum/PanoramaEvents"),
  14064. r("./enum/SceneRendererEvents"))
  14065. , t = r("./gui/memoryUsage")
  14066. , te = r("./enum/RenderLayers")
  14067. , ie = r("./TimingData")
  14068. , ne = new e(i);
  14069. e.level = L.logLevel,
  14070. e.consoleEnabled = L.console,
  14071. function() {
  14072. var e = window.number//k.getModelIDFromQueryString();
  14073. if (!e)
  14074. return A(null, "loading-failed");
  14075. var t = k.parseSidUrl(e)
  14076. , i = O.valueFromHash("play", !1) ? "autoplay" : O.inIframe() ? "click" : "fullpage"
  14077. , n = {
  14078. panoElementsToLoad: 6,
  14079. modelElementsToLoad: 0,
  14080. totalElementsLoaded: 0,
  14081. totalElementsToLoad: 0,
  14082. totalPercentageLoaded: 0,
  14083. progressCallback: null
  14084. }
  14085. , r = document.getElementById("player")
  14086. , o = L.quickstart.enabled
  14087. , a = null
  14088. , s = null
  14089. , l = null
  14090. , c = null
  14091. , h = null
  14092. , u = null
  14093. , d = null
  14094. , p = null
  14095. , f = null
  14096. , g = null
  14097. , m = null
  14098. , v = new ie;
  14099. !function(e) {
  14100. ne.info("Version", "2.25.6-0-gd87e5b1"),
  14101. z.defaultMaxListeners = 1e3,
  14102. function(e) {
  14103. e.addEventListener("dragenter", I, !1),
  14104. e.addEventListener("dragover", I, !1)
  14105. }(e),
  14106. O.valueFromHash("title", !0) || $(document).ready(function() {
  14107. $(".model-title").hide()
  14108. })
  14109. }(r),
  14110. function(e) {
  14111. return G.loadFeatureFlags(e).done(function(e) {
  14112. G.updateDependentSettings(e, L)
  14113. })
  14114. }({
  14115. urlBase: t.urlBase
  14116. }).then(function() {
  14117. return Z.init(),
  14118. function(e, t) {
  14119. var i = P.getModel({
  14120. url: t,
  14121. floors: O.valueFromHash("f", !0),
  14122. autoload: !1
  14123. });
  14124. return $.when(i, y).then(null, function(e) {
  14125. return this
  14126. })
  14127. }(0, e)
  14128. }).then(function(e) {
  14129. return re(.9),
  14130. function(e, t, i, n, r) {
  14131. ne.info("Model data loaded"),
  14132. ne.debug("UUID: " + e.data.job.uuid),
  14133. W.init(G.getFlags()),
  14134. i && N.initKeen({
  14135. token: i,
  14136. appId: n
  14137. }),
  14138. N.initSegment({
  14139. model: e.sid,
  14140. version: "2.25.6-0-gd87e5b1",
  14141. startSource: r.startSource,
  14142. token: t,
  14143. autoplay: r.autoplay,
  14144. quickstart: r.quickstart
  14145. })
  14146. }(g = e, L.appConfig.segment_key, L.appConfig.keen_write_key, L.appConfig.keen_project_id, {
  14147. startSource: i,
  14148. autoplay: L.autoplay,
  14149. quickstart: o
  14150. }),
  14151. g.urls.init()
  14152. }).then(function() {
  14153. return g.loadPanos()
  14154. }).then(function() {
  14155. s = U.getStartCameraOptions(g, g.panos);
  14156. //初始画面
  14157. window.DATA.camera_start && window.DATA.camera_start.thumbImg && function(e) {
  14158. $("<img/>").attr("src", e).on("load", function() {
  14159. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  14160. $(this).remove()
  14161. $(".screen .shotImg.innerBtn").removeClass('blank').css("background-image", "url(" + e + ")")
  14162. })
  14163. }(window.DATA.camera_start.thumbImg);
  14164. {//初始化导览时间
  14165. if(DATA.tourBlackSpeed == void 0)DATA.tourBlackSpeed = 100
  14166. window._settings.warp.teleportTime = settings.teleportTime / DATA.tourBlackSpeed * 100;
  14167. if(DATA.tourWalkSpeed == void 0)DATA.tourWalkSpeed = 100
  14168. /* if(DATA.tourWalkSpeed!=void 0){
  14169. let r = 100 / DATA.tourWalkSpeed;
  14170. window._settings.warp.flytimeDistanceMultiplier = settings.flytimeDistanceMultiplier * r
  14171. window._settings.warp.flyTime = settings.flyTime * r
  14172. }else{
  14173. window._settings.warp.flyTime = settings.flyTime
  14174. } */
  14175. if(DATA.tourRotTime == '' || DATA.tourRotTime == void 0){
  14176. DATA.tourRotTime = settings.tourRotTime; //默认停留2秒
  14177. }
  14178. }
  14179. {//其他
  14180. _settings.floorPlanAngle = DATA.floorPlanAngle || 0
  14181. _settings.angleShift2d = DATA.angleShift2d || 0
  14182. if(DATA.insideLookLimit){
  14183. _settings.insideLookLimitDown = DATA.insideLookLimit[0]
  14184. _settings.insideLookLimitUp = DATA.insideLookLimit[1]
  14185. }
  14186. }
  14187. d = function(e) {
  14188. var t = new E.PerspectiveCamera;
  14189. t.layers.enable(te.PANOMARKERS),
  14190. t.layers.enable(te.RETICULE),
  14191. t.layers.enable(te.TAG);
  14192. var o = new E.Scene
  14193. , i = new E.AmbientLight(16777215);
  14194. return o.add(i),
  14195. o.skybox = new V,
  14196. o.add(o.skybox),
  14197. o.plane = new E.Mesh(new E.PlaneBufferGeometry(1e5,1e5),new E.RawShaderMaterial({
  14198. side: E.DoubleSide
  14199. })),
  14200. o.plane.position.y = 0,
  14201. o.plane.rotateX(-Math.PI / 2),
  14202. o.plane.material.visible = !1,
  14203. o.add(o.plane),
  14204. o.updateMatrixWorld(),
  14205. L.showScreenshotLocations && e.data.images.forEach(function(e) {
  14206. if (e.metadata && e.metadata.camera_position) {
  14207. var t = e.metadata.camera_position
  14208. , i = new E.Mesh(new E.BoxGeometry(.3,.3,.3));
  14209. i.position = t.clone(),
  14210. o.add(i);
  14211. var n = e.metadata.camera_quaternion
  14212. , r = new E.Vector3(0,0,-1).applyQuaternion(n);
  14213. o.add(new E.ArrowHelper(r,t.clone(),1,16711680))
  14214. }
  14215. }),
  14216. L.showAxis && (o.add(new E.ArrowHelper(new E.Vector3(0,1,0),new E.Vector3(0,0,0),1,255)),
  14217. o.add(new E.ArrowHelper(new E.Vector3(0,0,1),new E.Vector3(0,0,0),1,16711680)),
  14218. o.add(new E.ArrowHelper(new E.Vector3(1,0,0),new E.Vector3(0,0,0),1,65280))),
  14219. new Y(o,t,B)
  14220. }(g),
  14221. m = function(e, t) {
  14222. var i = e ? 1 : 1e3
  14223. , n = W.tilegen || W.imgopt ? 6 : 2;
  14224. n = O.valueFromHash("tileconc", n);
  14225. var r = new X
  14226. , o = new Q({
  14227. concurrentDownloads: n
  14228. })
  14229. , a = new J
  14230. , s = new x
  14231. , l = new w
  14232. , c = new b(t)
  14233. , h = new T
  14234. , u = new S(i)
  14235. , d = new M
  14236. , p = new K;
  14237. return {
  14238. qualityManager: r,
  14239. panoRenderer: a,
  14240. tileDownloader: o,
  14241. player: c,
  14242. director: l,
  14243. modelManager: s,
  14244. tagManager: p,
  14245. displayController: u,
  14246. labelDisplayController: d,
  14247. controls: h
  14248. }
  14249. }(o, s.mode),
  14250. l = m.controls,
  14251. c = m.player,
  14252. h = m.director,
  14253. u = m.tagManager,
  14254. p = m.tileDownloader,
  14255. f = m.qualityManager,
  14256. m.panoRenderer,
  14257. function(e, t, i, n) {
  14258. var r = i.controls
  14259. , o = i.qualityManager
  14260. , a = i.panoRenderer
  14261. , s = i.tileDownloader
  14262. , l = i.modelManager;
  14263. r.init(n, l),
  14264. j.init(i.director, r, i.player, l, t),
  14265. o.init(l),
  14266. s.init(o),
  14267. a.init(t, s, o),
  14268. l.init(s, a, o),
  14269. l.addModel(e),
  14270. t.addComponent(F)
  14271. }(g, d, m, r),
  14272. c.director = h,
  14273. g.supportsTiles && p.start(),
  14274. !o || s.mode === R.PANORAMA && s.pano || (ne.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14275. o = !1);
  14276. var e = null;
  14277. if (o) {
  14278. ne.warn("Quickstart engaged. Hold on to your knickers.");
  14279. var t = l.controls[R.PANORAMA];
  14280. a = new q(f,d.scene,d.camera,t,r),
  14281. C(d, r, g),
  14282. e = a.load(s).then(function() {
  14283. d.addComponent(a),
  14284. d.once(ee.AfterRender, function() {
  14285. ne.warn("First render after quickstart load finished.")
  14286. })
  14287. })
  14288. }
  14289. return window.flyToFirst = function() {
  14290. var e = c.model.panos.get("8d778e19657f433fb9cf8947d823bb70")
  14291. , t = new _.Quaternion(.7099827027821568,-.07708150183830938,.6958985789714591,.07555241737970636)
  14292. , i = new _.Vector3(0,0,-1).applyQuaternion(t).add(e.position);
  14293. c.flyToPano({
  14294. pano: e,
  14295. lookAtPoint: i
  14296. })
  14297. }
  14298. ,
  14299. $.when(e, D.startLoading(g, c, h, L.autoplay, o, v))
  14300. }).then(function() {
  14301. return function(e, t, i, n, r) {
  14302. return r.progressCallback = t,
  14303. N.sessionStart(),
  14304. e.load(n).progress(function(e, t) {
  14305. e.modelElementsToLoad = t[1],
  14306. function(e) {
  14307. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14308. }(e),
  14309. function(e) {
  14310. e.totalElementsLoaded++,
  14311. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14312. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0),
  14313. e.totalPercentageLoaded = .4 + .6 * e.totalPercentageLoaded,
  14314. console.log("pro:" + e.totalPercentageLoaded),
  14315. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14316. }(e)
  14317. }
  14318. .bind(this, r))
  14319. }(g, D.onProgress, 0, !o, n)
  14320. }).then(function() {
  14321. s.quickstart = o,
  14322. function(e, t, i, n) {
  14323. var r = i.qualityManager
  14324. , o = i.panoRenderer
  14325. , a = i.tileDownloader
  14326. , s = i.modelManager
  14327. , l = i.player
  14328. , c = i.director
  14329. , h = i.tagManager
  14330. , u = i.displayController
  14331. , d = i.labelDisplayController
  14332. , p = i.controls;
  14333. t.scene.add(e),
  14334. t.qualityManager = r;
  14335. var f = {
  14336. camera: t.camera,
  14337. director: c,
  14338. modelManager: s,
  14339. tileDownloader: a,
  14340. panoRenderer: o,
  14341. qualityManager: r,
  14342. tagManager: h,
  14343. container: n,
  14344. controls: p
  14345. };
  14346. l.init(f),
  14347. l.setScene(t.scene),
  14348. h.init(s, l),
  14349. c.init(l, s),
  14350. u.init(c, l, s, h, n),
  14351. d.init(l, s, n),
  14352. B.bindEvents(l),
  14353. t.addComponent(h),
  14354. t.addComponent(l),
  14355. t.addComponent(o),
  14356. l.sceneRenderer = t
  14357. }(g, d, m, r),
  14358. d.started || C(d, r, g),
  14359. N.modelLoaded(g, c, l, L.autoplay),
  14360. function(e, t, i, n) {
  14361. return ne.info("Starting player in " + i.mode),
  14362. N.report(t.sid, "started-playing", n, i.quickstart),
  14363. e.start(i)
  14364. }(c, g, s, L.autoplay).done(function() {
  14365. h.autoTour()
  14366. }),
  14367. g.supportsTiles || new H(g,c).start();
  14368. o && (d.removeComponent(a),
  14369. a.destroy(),
  14370. s.pano.enter()),
  14371. D.init(g, h, c, l, d, s, N.getSessionId()),
  14372. D.endLoading(g, h, u),
  14373. d.once(ee.AfterRender, function() {
  14374. v.setAppReadyTime();
  14375. var e = v.calcFullLoadingTime();
  14376. ne.warn("Total load time: " + e / 1e3),
  14377. N.loadComplete(e),
  14378. ne.warn("First render after model load finished.");
  14379. editTool.loadDone('data', window.DATA)
  14380. }),
  14381. d.on(ee.MemoryUsageUpdated, y)
  14382. }).fail(A.bind(this, e))
  14383. }()
  14384. }()
  14385. }).fail(e=>{
  14386. alert("缺少someData文件,请检查场景码是否正确。")
  14387. })
  14388. }
  14389. ).call(this, "/js/main.js")
  14390. }
  14391. , {
  14392. "./DisplayController": 1,
  14393. "./TimingData": 2,
  14394. "./ab": 3,
  14395. "./analytics": 4,
  14396. "./cameras/PanoramaCamera": 7,
  14397. "./controls/CameraControls": 9,
  14398. "./director": 15,
  14399. "./effects": 16,
  14400. "./enum/PanoSizeClass": 36,
  14401. "./enum/PanoramaEvents": 37,
  14402. "./enum/RenderLayers": 41,
  14403. "./enum/SceneRendererEvents": 43,
  14404. "./enum/Viewmode": 51,
  14405. "./featureflags": 59,
  14406. "./gui/error": 64,
  14407. "./gui/gui": 65,
  14408. "./gui/memoryUsage": 73,
  14409. "./label/LabelDisplayController": 91,
  14410. "./lib/array-polyfill": 92,
  14411. "./lib/performance-polyfill": 95,
  14412. "./lib/postprocessing/EffectComposer.js": 96,
  14413. "./lib/postprocessing/MaskPass.js": 97,
  14414. "./lib/postprocessing/RenderPass.js": 98,
  14415. "./lib/postprocessing/ShaderPass.js": 99,
  14416. "./lib/shaders/CopyShader.js": 100,
  14417. "./lib/shaders/HorizontalBlurShader.js": 101,
  14418. "./lib/shaders/VerticalBlurShader.js": 102,
  14419. "./lib/three75-shim": 103,
  14420. "./localization/localize": 108,
  14421. "./tag/tagManager": 124,
  14422. "./model/ModelManager": 140,
  14423. "./objects/Panorama": 148,
  14424. "./objects/Skybox": 152,
  14425. "./player": 155,
  14426. "./preloaders": 156,
  14427. "./scene/QuickstartManager": 157,
  14428. "./scene/SceneRenderer": 158,
  14429. "./sdk/automation.js": 164,
  14430. "./settings": 166,
  14431. "./showcase": 168,
  14432. "./tile/PanoRenderer": 169,
  14433. "./tile/QualityManager.js": 170,
  14434. "./tile/TileDownloader": 171,
  14435. "./util/PanoramaCollection": 178,
  14436. "./util/ajax": 181,
  14437. "./util/browser": 182,
  14438. "./util/camera": 183,
  14439. "./util/common": 185,
  14440. "./util/lerp": 188,
  14441. "./util/logger": 189,
  14442. "./util/math": 190,
  14443. "./util/sentry": 192,
  14444. "./util/showcase": 193,
  14445. "./util/transitions": 195,
  14446. events: 202,
  14447. "promise-polyfill": 213,
  14448. three: 217
  14449. }],
  14450. 117: [function(e, t, i) {
  14451. "use strict";
  14452. function n(e) {
  14453. e = e || {},
  14454. r.RawShaderMaterial.call(this, a.extendObject({
  14455. fragmentShader: o.cube.fragmentShader,
  14456. vertexShader: o.cube.vertexShader,
  14457. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14458. name: "CubemapMaterial"
  14459. }, e))
  14460. }
  14461. var r = e("three")
  14462. , o = e("../shaders")
  14463. , a = e("../util/common");
  14464. (n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n,
  14465. t.exports = n
  14466. }
  14467. , {
  14468. "../shaders": 167,
  14469. "../util/common": 185,
  14470. three: 217
  14471. }],
  14472. 118: [function(e, t, i) {
  14473. "use strict";
  14474. function n(e) {
  14475. e = e || {},
  14476. r.RawShaderMaterial.call(this, a.extendObject({
  14477. fragmentShader: o.model.fragmentShader,
  14478. vertexShader: o.model.vertexShader,
  14479. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14480. name: "ModelTextureMaterial"
  14481. }, e))
  14482. }
  14483. var r = e("three")
  14484. , o = e("../shaders")
  14485. , a = e("../util/common");
  14486. ((n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n).prototype.setProjectedPanos = function(e, t, i) {
  14487. i && (this.uniforms.progress.value = 0),
  14488. e.ensureSkyboxReadyForRender(),
  14489. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14490. this.uniforms.pano0Position.value.copy(e.position),
  14491. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14492. t.ensureSkyboxReadyForRender(),
  14493. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14494. this.uniforms.pano1Position.value.copy(t.position),
  14495. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14496. }
  14497. ,
  14498. t.exports = n
  14499. }
  14500. , {
  14501. "../shaders": 167,
  14502. "../util/common": 185,
  14503. three: 217
  14504. }],
  14505. 119: [function(m, v, e) {
  14506. (function(e) {
  14507. "use strict";
  14508. function t(e, t, i, n) {
  14509. this.div = null,
  14510. this.body = null,
  14511. this.label = e,
  14512. this.description = t,
  14513. this.parsedDescription = [],
  14514. this.media = i || {
  14515. type: null
  14516. },
  14517. this.loadingSpinner = null,
  14518. this.parser = new r({
  14519. supportLinks: !c.valueFromHash("mls"),
  14520. keepLinkLabels: !0
  14521. }),
  14522. this.state = g.CLOSED,
  14523. this.orientation = "",
  14524. this.initialTransform = "",
  14525. this.hovering = !1,
  14526. this.openTransition = null,
  14527. this.closeTransition = null,
  14528. this.openPromise = null,
  14529. this.closePromise = null,
  14530. this.animationTransition = null,
  14531. this.animationScale = 0
  14532. }
  14533. var r = m("../Parser/DescriptionParser")
  14534. , i = m("../Media/Link")
  14535. , n = m("../Media/Image")
  14536. , o = m("../Media/EmbedlyPlayer")
  14537. , a = m("../Media/EmbedlyEmbed")
  14538. , s = m("../../util/transitions")
  14539. , l = m("../../util/lerp")
  14540. , c = m("../../util/browser")
  14541. , b = m("./BillboardEvent")
  14542. , w = m("../Media/MediaEvent")
  14543. , h = m("../Parser/DescriptionChunkType")
  14544. , u = m("events").EventEmitter
  14545. , d = m("./billboardSettings")
  14546. , T = m("./overlaySettings")
  14547. , p = new (m("../../util/logger"))(e)
  14548. , f = document.getElementById("tag-billboards");
  14549. f.addEventListener("touchend", function(e) {
  14550. f.style.pointerEvents = "none"
  14551. }),
  14552. f.addEventListener("touchcancel", function(e) {
  14553. f.style.pointerEvents = "none"
  14554. });
  14555. var g = {
  14556. CLOSED: "closed",
  14557. OPENING: "opening",
  14558. OPEN: "open",
  14559. CLOSING: "closing",
  14560. ACTIVE: "active"
  14561. };
  14562. (t.prototype = Object.create(u.prototype)).build = function(e) {
  14563. this.parsedDescription = this.parser.parse(this.description);
  14564. var t = document.createElement("div");
  14565. t.className = "tag-container has-hotzone",
  14566. this.div = t,
  14567. this.body = document.createElement("div"),
  14568. this.body.className = "tag-body";
  14569. var i = document.createElement("div");
  14570. i.classList.add("tag-content");
  14571. var n = document.createElement("div");
  14572. n.classList.add("tag-text-content");
  14573. var r = document.createElement("div");
  14574. r.className = "tag-label",
  14575. r.textContent = this.label,
  14576. n.appendChild(r);
  14577. var o = document.createElement("div");
  14578. o.className = "tag-desc",
  14579. n.appendChild(o),
  14580. i.appendChild(n),
  14581. this.body.appendChild(i),
  14582. this.appendDescriptionElements(this.parsedDescription, o),
  14583. this.appendMedia(),
  14584. t.appendChild(this.body),
  14585. f.appendChild(t),
  14586. this.bindEvents(t, this.body)
  14587. }
  14588. ,
  14589. t.prototype.bindEvents = function(i, e) {
  14590. function t(n) {
  14591. return function(e) {
  14592. if (!this.div.classList.contains("overlay")) {
  14593. var t, i = document.getElementById("player");
  14594. try {
  14595. t = new MouseEvent(n,e)
  14596. } catch (i) {
  14597. (t = document.createEvent("MouseEvents")).initMouseEvent(n, e.bubbles, e.cancelable, e.view, e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget)
  14598. }
  14599. i.dispatchEvent(t)
  14600. }
  14601. }
  14602. }
  14603. e.addEventListener("mousedown", function(e) {
  14604. e.stopPropagation()
  14605. }),
  14606. e.addEventListener("mouseup", function(e) {
  14607. e.stopPropagation()
  14608. }),
  14609. i.addEventListener("touchstart", function(e) {
  14610. f.style.pointerEvents = "auto"
  14611. }),
  14612. i.addEventListener("mousedown", t("mousedown").bind(this)),
  14613. i.addEventListener("mouseup", t("mouseup").bind(this)),
  14614. e.addEventListener("mouseover", function(e) {
  14615. this.state === g.OPEN && i.classList.remove("has-hotzone")
  14616. }
  14617. .bind(this)),
  14618. i.addEventListener("mouseenter", function(e) {
  14619. this.state !== g.CLOSING && (this.hovering = !0,
  14620. this.emit(b.ENTER))
  14621. }
  14622. .bind(this)),
  14623. i.addEventListener("mouseleave", function(e) {
  14624. this.hovering = !1,
  14625. this.emit(b.LEAVE)
  14626. }
  14627. .bind(this)),
  14628. i.addEventListener("gesturestart", function(e) {
  14629. e.preventDefault()
  14630. });
  14631. var n = i.querySelector(".tag-text-content")
  14632. , r = 0;
  14633. n.addEventListener("touchstart", function(e) {
  14634. r = e.changedTouches[0].clientY
  14635. }),
  14636. n.addEventListener("touchmove", function(t) {
  14637. function e(e) {
  14638. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight == 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14639. }
  14640. return i.classList.contains("overlay") ? e(this.querySelector(".tag-desc")) : void e(this)
  14641. }),
  14642. i.addEventListener("touchmove", function(e) {
  14643. 0 == (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14644. })
  14645. }
  14646. ,
  14647. t.prototype.appendDescriptionElements = function(e, i) {
  14648. 0 < e.length && this.div.classList.add("has-text"),
  14649. e.forEach(function(e, t) {
  14650. switch (e.type) {
  14651. case h.TEXT:
  14652. i.appendChild(this.createTextElement(e.text));
  14653. break;
  14654. case h.LINK:
  14655. i.appendChild(this.createLinkElement(e.link))
  14656. }
  14657. }
  14658. .bind(this))
  14659. }
  14660. ,
  14661. t.prototype.appendLoadingSpinner = function() {
  14662. this.loadingSpinner = document.createElement("div"),
  14663. this.loadingSpinner.classList.add("loading-spinner");
  14664. var e = document.createElement("div");
  14665. e.classList.add("gui-spinner-icon"),
  14666. this.loadingSpinner.appendChild(e),
  14667. this.body.appendChild(this.loadingSpinner)
  14668. }
  14669. ,
  14670. t.prototype.onMediaLoadFinished = function() {
  14671. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14672. this.applyOrientation(this.orientation),
  14673. this.loadingSpinner = null)
  14674. }
  14675. ,
  14676. t.prototype.appendMedia = function() {
  14677. if (this.media && this.media.type && "error" !== this.media.type && (!c.valueFromHash("mls", 0) || this.media.type === h.IMAGE)) {
  14678. this.appendLoadingSpinner();
  14679. var e = document.createElement("div");
  14680. e.classList.add("tag-media-content");
  14681. var t = document.createElement("i");
  14682. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14683. t.classList.add(e)
  14684. }),
  14685. this.body.appendChild(t),
  14686. this.body.appendChild(e),
  14687. this.media.type) {
  14688. case h.IMAGE:
  14689. e.appendChild(this.createImageElement(this.media, this.body));
  14690. break;
  14691. case h.VIDEO:
  14692. e.appendChild(this.createVideoElement(this.media, this.body));
  14693. break;
  14694. case h.RICH:
  14695. e.appendChild(this.createEmbedElement(this.media, this.body))
  14696. }
  14697. }
  14698. }
  14699. ,
  14700. t.prototype.createTextElement = function(e) {
  14701. var t = document.createElement("span");
  14702. return t.textContent = e,
  14703. t
  14704. }
  14705. ,
  14706. t.prototype.createLinkElement = function(e) {
  14707. var t = new i(e);
  14708. return t.on(w.LINK_CLICK, this.emit.bind(this, w.LINK_CLICK)),
  14709. t.createDomElement()
  14710. }
  14711. ,
  14712. t.prototype.createImageElement = function(t, C) {
  14713. function e() {
  14714. function e() {
  14715. p || (E.classList.remove("view-image"),
  14716. a.classList.add("overlay"),
  14717. t(),
  14718. window.addEventListener("resize", A),
  14719. a.addEventListener("click", i),
  14720. c.addEventListener("click", r),
  14721. o.addEventListener("click", n),
  14722. p = !0,
  14723. _.emit(w.IMAGE_OPENED))
  14724. }
  14725. function t() {
  14726. C.classList.add("show-info"),
  14727. s.classList.remove("collapsible"),
  14728. s.style.height = "";
  14729. var e = parseFloat(getComputedStyle(v).lineHeight)
  14730. , t = g + e
  14731. , i = a.clientWidth - 2 * T.boundaryWidth - m
  14732. , n = a.clientHeight - 2 * T.boundaryHeight - m - t
  14733. , r = n
  14734. , o = r * I.aspect;
  14735. i < o && (r = (o = i) / I.aspect),
  14736. n < r && (o = (r = n) * I.aspect),
  14737. o += m,
  14738. r += m + t,
  14739. C.style.width = o + "px",
  14740. C.style.height = r + "px",
  14741. l.style.paddingTop = e + m + "px",
  14742. 0 < _.description.length && (s.classList.add("collapsible"),
  14743. s.style.height = s.clientHeight + 12 + "px",
  14744. y.style.height = "calc(100% - " + v.clientHeight + "px)")
  14745. }
  14746. function i(e) {
  14747. e.target === a && n()
  14748. }
  14749. function n() {
  14750. p && (p = !1,
  14751. E.classList.add("view-image"),
  14752. a.classList.remove("overlay"),
  14753. s.style.height = "",
  14754. l.style.paddingTop = "",
  14755. C.style.width = "",
  14756. C.style.height = "",
  14757. window.removeEventListener("resize", A),
  14758. a.removeEventListener("click", i),
  14759. c.removeEventListener("click", r),
  14760. o.removeEventListener("click", n),
  14761. _.emit(w.IMAGE_CLOSED),
  14762. _.close(!0))
  14763. }
  14764. function r(e) {
  14765. C.classList.toggle("show-info")
  14766. }
  14767. var a = _.div
  14768. , s = a.getElementsByClassName("tag-content")[0]
  14769. , l = a.getElementsByClassName("tag-media-content")[0]
  14770. , o = C.getElementsByClassName("close")[0]
  14771. , c = s.getElementsByClassName("tag-label")[0];
  14772. a.classList.add("has-image"),
  14773. E.classList.add("view-image"),
  14774. a.classList.add(1 <= I.aspect ? "image-landscape" : "image-portrait"),
  14775. _.applyOrientation(_.orientation);
  14776. var h, u, d, p = !1, f = getComputedStyle(s), g = parseFloat(f.paddingTop) + parseFloat(f.paddingBottom), m = 2 * parseFloat(getComputedStyle(l).paddingLeft), v = s.querySelector(".tag-label"), y = s.querySelector(".tag-desc"), A = (d = 0,
  14777. function() {
  14778. clearInterval(h),
  14779. clearTimeout(u),
  14780. h = setInterval(function() {
  14781. var e = a.clientHeight;
  14782. d !== e && (t(),
  14783. d = e)
  14784. }, 100),
  14785. u = setTimeout(clearInterval.bind(this, h), 1e3)
  14786. }
  14787. );
  14788. I.on(w.IMAGE_OPENING, e),
  14789. _.on(b.ACTIVATE, e),
  14790. _.on(w.IMAGE_CLOSED, I.onClosed.bind(I)),
  14791. _.on(b.CLOSING, n)
  14792. }
  14793. var I = new n
  14794. , E = I.createDomElement();
  14795. this.once(b.OPENED, function() {
  14796. I.load(t.src).then(e).catch(function(e) {
  14797. p.warn("Failed to load image:", t.src),
  14798. p.warn("with error:", e)
  14799. }).then(this.onMediaLoadFinished.bind(this))
  14800. });
  14801. var _ = this;
  14802. return E
  14803. }
  14804. ,
  14805. t.prototype.createVideoElement = function(t, e) {
  14806. var i = new o({
  14807. autoPlay: !0,
  14808. autoResume: !0,
  14809. startMuted: !1,
  14810. loop: !1
  14811. })
  14812. , n = i.createDomElement();
  14813. return this.once(b.OPENED, function() {
  14814. i.load(t.src).then(function() {
  14815. this.div.classList.add("has-video"),
  14816. this.state !== g.OPEN && this.state !== g.ACTIVE || (i.show(),
  14817. i.play()),
  14818. this.on(b.OPENING, i.show.bind(i)),
  14819. this.on(b.OPENED, i.play.bind(i)),
  14820. this.on(b.CLOSING, i.pause.bind(i)),
  14821. this.on(b.CLOSED, i.hide.bind(i))
  14822. }
  14823. .bind(this)).catch(function(e) {
  14824. p.warn("Failed to embed video:", t.src),
  14825. p.warn("with error:", e)
  14826. }).then(this.onMediaLoadFinished.bind(this))
  14827. }
  14828. .bind(this)),
  14829. n
  14830. }
  14831. ,
  14832. t.prototype.createEmbedElement = function(t, e) {
  14833. var i = new a
  14834. , n = i.createDomElement();
  14835. return this.once(b.OPENED, function() {
  14836. i.load(t.src).then(function() {
  14837. this.div.classList.add("has-embed"),
  14838. this.state !== g.OPEN && this.state !== g.ACTIVE || i.show(),
  14839. this.applyOrientation(this.orientation),
  14840. this.on(b.OPENING, i.show.bind(i)),
  14841. this.on(b.CLOSED, i.hide.bind(i))
  14842. }
  14843. .bind(this)).catch(function(e) {
  14844. p.warn("Failed to embed:", t.src),
  14845. p.warn("with error:", e)
  14846. }).then(this.onMediaLoadFinished.bind(this))
  14847. }
  14848. .bind(this)),
  14849. n
  14850. }
  14851. ,
  14852. t.prototype.open = function(e) {
  14853. return this.openPromise = $.Deferred(),
  14854. this.state === g.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  14855. this.openTransition ? e && this.setActiveState() : this.openTransition = s.setTimeout(function() {
  14856. this.state !== g.OPEN && (this.emit(b.OPENING),
  14857. e && this.emit(b.ACTIVATING),
  14858. this.state = g.OPENING,
  14859. this.animateOpen(function() {
  14860. e && this.setActiveState(),
  14861. this.openPromise.resolve()
  14862. }
  14863. .bind(this)))
  14864. }
  14865. .bind(this), d.animation.openDelay),
  14866. s.cancel(this.closeTransition),
  14867. this.closePromise && this.closePromise.reject(),
  14868. this.closeTransition = void 0,
  14869. this.openPromise.promise())
  14870. }
  14871. ,
  14872. t.prototype.close = function(e) {
  14873. return this.closePromise = $.Deferred(),
  14874. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = s.setTimeout(function() {
  14875. this.state !== g.CLOSED && (this.emit(b.CLOSING),
  14876. this.state = g.CLOSING,
  14877. this.animateClose())
  14878. }
  14879. .bind(this), d.animation.closeDelay)),
  14880. s.cancel(this.openTransition),
  14881. this.openPromise && this.openPromise.reject(),
  14882. this.openTransition = void 0,
  14883. this.closePromise.resolve(),
  14884. this.closePromise.promise())
  14885. }
  14886. ,
  14887. t.prototype.setActiveState = function() {
  14888. this.state !== g.CLOSED && (this.state = g.ACTIVE,
  14889. this.emit(b.ACTIVATE),
  14890. this.div.classList.remove("has-hotzone"))
  14891. }
  14892. ,
  14893. t.prototype.animateOpen = function(e) {
  14894. if (this.state === g.OPENING) {
  14895. if (s.cancel(this.animationTransition),
  14896. c.detectSamsungNative())
  14897. return this.boardOrientation = null,
  14898. this.div.style.visibility = "visible",
  14899. this.emit(b.OPENED),
  14900. this.state = g.OPEN,
  14901. void (e && e());
  14902. this.div.style.webkitTransform = "scale(0)",
  14903. this.div.style.transform = "scale(0)",
  14904. this.div.style.visibility = "visible",
  14905. this.animationTransition = s.start(l.property(this, "animationScale", 1), d.animation.openDuration, function() {
  14906. this.emit(b.OPENED),
  14907. this.state = g.OPEN,
  14908. e && e()
  14909. }
  14910. .bind(this))
  14911. }
  14912. }
  14913. ,
  14914. t.prototype.animateClose = function(e) {
  14915. this.state === g.CLOSING && (s.cancel(this.animationTransition),
  14916. this.animationTransition = s.start(l.property(this, "animationScale", 0), d.animation.closeDuration, function() {
  14917. this.emit(b.CLOSED),
  14918. this.state = g.CLOSED,
  14919. this.div.style.visibility = "hidden",
  14920. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  14921. e && e()
  14922. }
  14923. .bind(this)))
  14924. }
  14925. ,
  14926. t.prototype.needsUpdate = function() {
  14927. return this.state !== g.CLOSED
  14928. }
  14929. ,
  14930. t.prototype.update = function(e, t) {
  14931. if (this.needsUpdate()) {
  14932. var i = (this.updateOrientation(e),
  14933. this.calcScale(t))
  14934. , n = {
  14935. x: (e.x + 1) * $("#player").width() / 2,
  14936. y: (e.y + 1) * $("#player").height() / 2
  14937. };
  14938. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  14939. this.div.style.webkitTransform = this.div.screenTransform,
  14940. this.div.style.transform = this.div.screenTransform
  14941. }
  14942. }
  14943. ,
  14944. t.prototype.getDimensions = function() {
  14945. return this.div.getBoundingClientRect()
  14946. }
  14947. ,
  14948. t.prototype.calcScale = function(e) {
  14949. return Math.sqrt(e / 40) * d.boardToDiscRatio
  14950. }
  14951. ,
  14952. t.prototype.updateOrientation = function(e) {
  14953. if (this.state !== g.ACTIVE) {
  14954. var t = e.y < -1 / 3 ? 0 : e.y < 1 / 3 ? 1 : 2
  14955. , i = e.x < -1 / 3 ? 0 : e.x < 1 / 3 ? 1 : 2
  14956. , n = "";
  14957. n += 0 == i ? "right" : 2 == i ? "left" : "",
  14958. n += 0 == t ? "-down" : 2 == t ? "-up" : "",
  14959. 1 == i && (n = 0 == t ? "bottom" : 2 == t ? "top" : "",
  14960. 1 == t && (n = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  14961. 1 == i && 1 == t && n === this.orientation || this.applyOrientation(n)
  14962. }
  14963. }
  14964. ,
  14965. t.prototype.applyOrientation = function(e) {
  14966. this.div.style.transform = this.div.style.webkitTransform = "",
  14967. this.div.classList.remove("tag-container-" + this.orientation),
  14968. this.div.classList.add("tag-container-" + e);
  14969. var t = window.getComputedStyle(this.div);
  14970. this.initialTransform = t.transform || t.webkitTransform,
  14971. "none" === this.initialTransform && (this.initialTransform = "");
  14972. var i = t.transform.slice(7, -1).split(",")
  14973. , n = -i[4]
  14974. , r = -i[5];
  14975. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  14976. this.div.style.transformOrigin = n + "px " + r + "px",
  14977. this.orientation = e
  14978. }
  14979. ,
  14980. v.exports = t
  14981. }
  14982. ).call(this, "/js/tag/Billboard/Billboard.js")
  14983. }
  14984. , {
  14985. "../../util/browser": 182,
  14986. "../../util/lerp": 188,
  14987. "../../util/logger": 189,
  14988. "../../util/transitions": 195,
  14989. "../Media/EmbedlyEmbed": 125,
  14990. "../Media/EmbedlyPlayer": 126,
  14991. "../Media/Image": 128,
  14992. "../Media/Link": 129,
  14993. "../Media/MediaEvent": 131,
  14994. "../Parser/DescriptionChunkType": 133,
  14995. "../Parser/DescriptionParser": 134,
  14996. "./BillboardEvent": 120,
  14997. "./billboardSettings": 121,
  14998. "./overlaySettings": 122,
  14999. events: 202
  15000. }],
  15001. 120: [function(e, t, i) {
  15002. "use strict";
  15003. t.exports = Object.freeze({
  15004. ENTER: "billboard.enter",
  15005. LEAVE: "billboard.leave",
  15006. OPENING: "billboard.opening",
  15007. OPENED: "billboard.open",
  15008. CLOSING: "billboard.closing",
  15009. CLOSED: "billboard.closed",
  15010. ACTIVATING: "billboard.activating",
  15011. ACTIVATE: "billboard.activate"
  15012. })
  15013. }
  15014. , {}],
  15015. 121: [function(e, t, i) {
  15016. "use strict";
  15017. t.exports = Object.freeze({
  15018. animation: Object.freeze({
  15019. hoverOnClosing: !1,
  15020. openDelay: 100,
  15021. closeDelay: 50,
  15022. openDuration: 200,
  15023. closeDuration: 100
  15024. }),
  15025. boardToDiscRatio: 1.2
  15026. })
  15027. }
  15028. , {}],
  15029. 122: [function(e, t, i) {
  15030. "use strict";
  15031. t.exports = Object.freeze({
  15032. boundaryWidth: 30,
  15033. boundaryHeight: 0
  15034. })
  15035. }
  15036. , {}],
  15037. 123: [function(M, R, e) {
  15038. (function(e) {
  15039. "use strict";
  15040. function d(e, t, i) {
  15041. var n = i.version || "0";
  15042. "0" !== n && w.info("tag defined using version " + n),
  15043. this.model = e,
  15044. this.sid = t,
  15045. this.color = (new f.Color).set(i.color || o.tagDefault),
  15046. this.hoverColor = o._darken(this.color, .2),
  15047. this.floor = null,
  15048. this.floorIndex = i.floor,
  15049. this.mode = m.PANORAMA,
  15050. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15051. this.obj3d = null,
  15052. this.disc = null,
  15053. this.materials = {
  15054. disc: null,
  15055. pole: null
  15056. },
  15057. this.position = (new f.Vector3).copy(i.position),
  15058. this.discPosition = (new f.Vector3).copy(i.stem.direction),
  15059. this.discWorldPosition = null,
  15060. this.discScale = .05,
  15061. this.poleEnabled = i.stem.enabled,
  15062. this.billboard = new r(i.label,i.description,i.media,this),
  15063. this.visibleTransition = null,
  15064. this.hoveringDisc = !1
  15065. }
  15066. var i, l, c, h, u, p, n, f = M("three"), r = M("./Billboard/Billboard"), g = M("../settings"), m = M("../enum/Viewmode"), o = M("../enum/Colors"), a = M("../enum/RenderLayers"), s = M("../enum/RenderOrder"), v = (M("../util/common"),
  15067. M("../util/math")), t = M("../util/texture"), y = M("../objects/Panorama"), A = M("../shaders"), C = M("../util/transitions"), I = M("../util/lerp"), E = M("../util/easing"), _ = M("./Billboard/BillboardEvent"), b = M("events").EventEmitter, w = new (M("../util/logger"))(e), T = t.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFigDGhCnowAABQFJREFUeNrtXTtyFEEMHXX5FK7iAiYFQ+KAiMyZCQnxRXwVFwkngSKD2BQXEYlNLXaZnZ7RX0/xbrek96RW9/RnWSCthSoaxcys4iwiAgGagN2FFATQe5OBAHpvMhBA700GAvC9iUBVgZd2dmTd9siIAvxOB9/RI9GI3kftf3a0t0YG2OOEaOk0qy2UyWFZKutMthGc09tWiuyQKkuvke2miE6ouOYe1QcE4HsTgSIY2gX4iP4ZHcFn5kt+KpfmFfhK2zXXDMgR/FdE9D3ivNyaqMz8YlmW3x46kIfjNQyxXlnzskG6X8psQJjlVGObJPtLqXj1DSGWvhyZFI70EUVTv3tf3VkEAWmDLwV8xmmehe17+6DIymFHkL6fKaJS2BFk5+8RzUlVwY9qG0ViY2XwLfyzpV2KoEQX4C18NdsmAfzeJBiRDekg3ruGhpCi7wC+eXH4XqI9kc+Rs4wE+DZ+XNPeiKY0MoHtUHCyU6nTLOBnISoz84yuRETP6bqmLdrjiMhOjXw0zJKsx9oaxcC/1j4atizLdaah4GidYEEAbfC9NpVGsmsrVgTwe5PgZEkqUbaSP+iRds9CxuiPeo4ggr2z2A1Efg/dNs0CokV/Bgd7b3mf7X9EWQCpFF2ZhqiZDHDqFf0p79/zXYhajRWt7cgr/Wc/OOrli7U4DmllAb6eDRr4jKhAVDoyHtl/otNAfOrNt9YwIoJX8lr2QDYdYh1xIehN4QB+G46YUtW/2GHF4tfFWPvpGK7RMsCvBsP4F2SAptHv4atVGQDVe9/ZxLEh4AOiP+aMYMLnH48OAUj/fYeBsUBaCwgAAtQYEzvWAcgAEBAA4kwArCHknkkgAyADQEAACAgAAQEgIMC8dH3vJ4JI+B4ZABkAAgI4S8fFpCg2IwMgA0BAgOfT1BVclH6o+S+GR++3wbawmOO/BC5/t4RhLt93DWFUiwxU/ygCIZIEsH4FnJk/FY5+Edsk6zJa82McEI2V/qUKwH8yQNTz6wBfrwAUrwEwm7AFz6wI9GBvpSwQ2X9Dml3RbsWqBL4GPjOvhp2hHsihOzO/1FgH+Dnx2/PuJFDQecanP1ZnhBnlcVl0Dttn8Btahnnfmg3w5YcAzKcLDlVp3wyKNhxkfC1kWRK/GfRgbPVHo7RlbGGedy3wWBdmvnEA/qb0s3GSw4BlpFgQLqIdKgTISgINIrR8OnZFxxeRa4RDsf6/oZ27MCBthlUrmipFv8g6gMeb9wBfLphEnoxh5luQwBz8W4n2TNMNhgMb3820J7YUvAVMZAL/wBHvHJnAF/zZNkkj2rdGdhciaPlnS7ubUzBIkB980RpAaoGicl2wA3y1U9q0E2TWBLNKNtD2w572h6Zh96uoF3vaz5wR9urPzBfaQSZ1no8NouD1sixfk2B/TkTfovtUjACWCkceGiztk+rL/JNpxYMj1jZJ9ueyc7fCjmEvG1zOBko75r44vJXu91C0CjqN9pn51itw1Cps64slJHSLpIuVbmoLQTOXGFjvLKJnxBj4iwhBQlEY7hWBHhLJJ9TRaADvQIAtlXoVIkS2m6I7IzMRMthqfjh0S8F1sDv7LAHoZ1u2knt990h7rq7S4VBPWyi787ycWOVy7DCvh0t8M38kV4JgX0meFIr0mTtkcVV1W1jEYjZ0dY0dQc0JkJkMWaaubebXAL0QASKRIftqJa5lbwQ2BPJE/gA4gL5xbiNHuQAAAABJRU5ErkJggg=="), x = t.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFgoIKnA4CwAAAkVJREFUeNrt3Uluw0AMRFHTvv+NrSibBAgyILGjodn16gbS/yxyYUOXi0SnZnyodV3XXV5WVREgBHaKFAV6tgwFerYMBXq2DAV8tggFfLYIBXy2CAV8tggFfrYEBXy2CAV+tgQFfrYEBXy2CAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgRXry5cHNOf3QIFfrYEBX62BG4AN4DpT26BAj9bAivACjD9yS2gATSA6U9uAQ2gAUx/cgtoAA1g+pNbQAOEhwBWgPpPXgMawAoQK0D9x64BDWAFiBWg/mPXgAawAoQAQgAJPgIdgLmHoAawAoQAQgAhgBBACCAEEAIIAYQAQgAhgBBACCAEEAIIAYQAQgAhgEwQfw1LBe+vYUIAIQAB3rIsy4vXEXwEOgTzDkArQAhgBXyKNZBT/xpACGAFfBNrIKP+NYAQwAr4IdbA/PWvAcR3A5OnXwOIbwcnT78GkN8bQAvMO/1/bgA/FglvAC0w5/Q/JAAJ5oPvCJTHGkALzDX9TwlAgnngPy0ACeaA7waQ5xtAC/Sf/n8LQILe8DcRgAR94W8mAAl6wt9UABL0g7+5ACToBX8XAUjQB/5uApCgB/xdBSDB+PB3F4AEY8M/RAAijAn+cAFIMB78wwUgwVjwTxGACGOAf8/1zAf2a+Nz4Z/aANrgXPBDCZAmwgjghxRgdhFGAj+0ALOJMCL4FgJ0lmFk6C0F6CBDF+jtBfiY+/2+3G63K+ihAhzZEN1hi3zJK04kLKvtOfg1AAAAAElFTkSuQmCC"), S = new f.PlaneBufferGeometry(1,1);
  15068. d.prototype = Object.create(b.prototype),
  15069. d.raycaster = new f.Raycaster,
  15070. d.prototype.bindEvents = function() {
  15071. this.billboard.on(_.ENTER, this.setHoverState.bind(this)),
  15072. this.billboard.on(_.LEAVE, this.setFreeState.bind(this))
  15073. }
  15074. ,
  15075. d.prototype.build = function() {
  15076. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15077. this.floor && (this.billboard.build(this.model.sid),
  15078. this.obj3d = this.buildObject3D(),
  15079. this.floor.add(this.obj3d)),
  15080. this
  15081. }
  15082. ,
  15083. d.prototype.buildObject3D = function() {
  15084. var e = new f.Object3D;
  15085. e.position.copy(this.position);
  15086. var t = f.UniformsUtils.clone(A.tagDisc.uniforms);
  15087. t.bg.value = x,
  15088. t.mask.value = T,
  15089. t.color.value.copy(this.color),
  15090. this.materials.disc = new f.RawShaderMaterial({
  15091. transparent: !0,
  15092. vertexShader: A.tagDisc.vertexShader,
  15093. fragmentShader: A.tagDisc.fragmentShader,
  15094. uniforms: t
  15095. }),
  15096. this.disc = new f.Mesh(S,this.materials.disc),
  15097. this.disc.layers.set(a.TAG),
  15098. this.disc.position.copy(this.discPosition),
  15099. this.disc.renderOrder = s.tagDisc;
  15100. var i = (this.disc.tag = this).buildPole();
  15101. return i.layers.set(a.TAG),
  15102. i.renderOrder = s.tagStem,
  15103. e.add(i),
  15104. e.layers.set(a.TAG),
  15105. e.add(this.disc)
  15106. }
  15107. ,
  15108. d.prototype.buildPole = function() {
  15109. var e = new f.BufferGeometry
  15110. , t = new Float32Array(6);
  15111. return t[0] = t[1] = t[2] = 0,
  15112. t[3] = this.discPosition.x,
  15113. t[4] = this.discPosition.y,
  15114. t[5] = this.discPosition.z,
  15115. e.addAttribute("position", new f.BufferAttribute(t,3)),
  15116. this.materials.pole = new f.LineBasicMaterial({
  15117. linewidth: g.tags.pole.width,
  15118. color: g.tags.pole.color,
  15119. opacity: 0,
  15120. visible: this.poleEnabled,
  15121. transparent: !0,
  15122. depthWrite: !1
  15123. }),
  15124. new f.Line(e,this.materials.pole)
  15125. }
  15126. ,
  15127. d.prototype.setFreeState = function(e) {
  15128. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15129. this.materials.disc.uniforms.color.value = this.color
  15130. }
  15131. .bind(this))
  15132. }
  15133. ,
  15134. d.prototype.setHoverState = function(e) {
  15135. this.billboard.open(e),
  15136. this.materials.disc.uniforms.color.value = this.hoverColor
  15137. }
  15138. ,
  15139. d.prototype.hide = function(e, t) {
  15140. var i = $.Deferred();
  15141. if (0 === this.materials.disc.uniforms.opacity.value && !C.isRunning(this.visibleTransition))
  15142. return i.resolve().promise();
  15143. e = e || 0,
  15144. t = t || 0,
  15145. C.cancel(this.visibleTransition);
  15146. var n, r, o, a = this.materials.disc.uniforms.opacity.value / g.tags.disc.opacity, s = t + e, l = t / s;
  15147. return this.visibleTransition = C.start((n = this,
  15148. r = I.property(n.materials.disc.uniforms.opacity, "value", 0),
  15149. o = I.property(n.materials.pole, "opacity", 0),
  15150. function(e) {
  15151. r(e),
  15152. n.materials.pole && o(e)
  15153. }
  15154. ), s * a, function() {
  15155. i.resolve()
  15156. }, l, E[g.warp.blendEasing]),
  15157. i.promise()
  15158. }
  15159. ,
  15160. d.prototype.show = function(e, t) {
  15161. var i = $.Deferred();
  15162. if (this.materials.disc.uniforms.opacity.value === g.tags.disc.opacity && !C.isRunning(this.visibleTransition))
  15163. return i.resolve().promise();
  15164. e = e || 0,
  15165. t = t || 0,
  15166. C.cancel(this.visibleTransition);
  15167. var n, r, o, a = (g.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / g.tags.disc.opacity, s = t + e, l = t / s;
  15168. return this.visibleTransition = C.start((n = this,
  15169. r = I.property(n.materials.disc.uniforms.opacity, "value", g.tags.disc.opacity),
  15170. o = I.property(n.materials.pole, "opacity", g.tags.pole.opacity),
  15171. function(e) {
  15172. r(e),
  15173. n.materials.pole && o(e)
  15174. }
  15175. ), s * a, function() {
  15176. i.resolve()
  15177. }, l, E[g.warp.blendEasing]),
  15178. i.promise()
  15179. }
  15180. ,
  15181. d.prototype.closestPanoTowardTag = function(e, t) {
  15182. var i = []
  15183. , n = []
  15184. , r = this.disc.getWorldPosition();
  15185. if (e === m.PANORAMA) {
  15186. var o = t.position.clone().sub(r).normalize();
  15187. i.push(y.filters.isPanoAligned()),
  15188. i.push(y.filters.isNeighbourPanoTo(t)),
  15189. i.push(y.filters.inPanoDirection(r, o, .5)),
  15190. n.push(y.scoreFunctions.direction(r, o))
  15191. }
  15192. var a = new f.Vector3;
  15193. i.push(function(e) {
  15194. return Math.abs(e.position.x - r.x) > g.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > g.tags.visibility.cameraClearance
  15195. }, function(e) {
  15196. a.copy(r).sub(e.position);
  15197. var t = -f.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15198. , i = g.tags.navigate.tiltTolerance;
  15199. return g.insideLookLimitDown - i < t && t < g.insideLookLimitUp + i
  15200. }),
  15201. n.push(y.scoreFunctions.distanceSquared(this, -2));
  15202. var s = this.model.panos.sortByScore(i, n);
  15203. if (g.tags.navigate.lineOfSight) {
  15204. for (var l = 0; l < s.length; l++) {
  15205. var c = s[l].item
  15206. , h = c.position.distanceTo(r);
  15207. if (!g.tags.visibility.anyDistance && h > g.tags.visibility.visibleDistance)
  15208. return null;
  15209. d.raycaster.set(c.position, r.clone().sub(c.position).normalize());
  15210. var u = d.raycaster.intersectObjects(this.model.colliders);
  15211. if (0 === u.length || u[0].distance > h)
  15212. return c
  15213. }
  15214. return null
  15215. }
  15216. return 0 < s.length && s[0].pano
  15217. }
  15218. ,
  15219. d.prototype.examine = function(i) {
  15220. if(!player.currentPano)return;
  15221. var e = i.mode
  15222. , n = g.tags.navigate.nearestPano && this.closestPanoTowardTag(e, i.currentPano) || i.currentPano
  15223. , t = this.disc.getWorldPosition();
  15224. this.billboard.setActiveState();
  15225. var r = function() {
  15226. var e = this.billboard.getDimensions()
  15227. , t = new f.Vector3;
  15228. v.convertScreenPositionToNDC(e.left + e.width / 2, e.top + e.height / 2, t),
  15229. t.unproject(i.camera),
  15230. i.flyToPano({
  15231. pano: n,
  15232. lookAtPoint: t
  15233. })
  15234. }
  15235. .bind(this);
  15236. if (e === m.PANORAMA)
  15237. if (n !== i.currentPano) {
  15238. var o = {
  15239. pano: n,
  15240. lookAtPoint: t,
  15241. duration: null,
  15242. maxDistanceOverride: null,
  15243. skipWarpingCheck: !1
  15244. };
  15245. i.flyToPano(o, r)
  15246. } else
  15247. setTimeout(function() {
  15248. this.billboard.open().then(function() {
  15249. r()
  15250. })
  15251. }
  15252. .bind(this), 0);
  15253. else {
  15254. var a = {
  15255. pano: n
  15256. };
  15257. if (t) {
  15258. var s = (new f.Matrix4).lookAt(n.position, t, new f.Vector3(0,1,0));
  15259. a.quaternion = (new f.Quaternion).setFromRotationMatrix(s)
  15260. }
  15261. a.callback = r,
  15262. a.duration = 1500,
  15263. a.mode = m.PANORAMA,
  15264. i.flyToNewMode(a)
  15265. }
  15266. }
  15267. ,
  15268. d.prototype.update = (n = new f.Vector3,
  15269. function(e, t) {
  15270. this.discWorldPosition = this.disc.getWorldPosition(),
  15271. this.updateDisc(e, t),
  15272. this.billboard.needsUpdate() && (n.copy(this.discWorldPosition).project(t),
  15273. n.z < 1 && (n.y *= -1,
  15274. this.billboard.update(n, this.getDiscRadius(n, t))))
  15275. }
  15276. ),
  15277. d.prototype.updateDisc = (l = new f.Vector3,
  15278. c = new f.Vector3,
  15279. h = new f.Vector3,
  15280. u = new f.Vector3,
  15281. p = new f.Vector3,
  15282. function(e, t) {
  15283. var i = g.tags.visibility
  15284. , n = g.tags.disc.scale
  15285. , r = e === m.DOLLHOUSE || e === m.FLOORPLAN ? g.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15286. if (this.obj3d.visible = 0 !== this.disc.material.opacity && (i.anyDistance || r <= i.visibleDistance || e === m.TRANSITIONING) && (!i.hideViaFloor || this.tagVisibleOnCurrentFloor(e)) && (!i.hideOffScreenDisc || !this.offScreen(this.disc, t)) && (!i.hideOffScreenObject || !this.offScreen(this.obj3d, t)),
  15287. this.obj3d.visible) {
  15288. this.disc.quaternion.copy(t.quaternion);
  15289. var o = n.maxSize - (n.maxSize - n.minSize) * f.Math.smoothstep(r, n.nearBound, n.farBound);
  15290. l.copy(this.discWorldPosition).project(t),
  15291. c.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(l),
  15292. h.set(o / 2, 0, 0).add(c),
  15293. u.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(h),
  15294. p.copy(u).unproject(t);
  15295. var a = p.distanceTo(this.discWorldPosition)
  15296. , s = 1 + g.tags.disc.scale.responsiveness / 100 * (d.viewportScale() - 1);
  15297. this.discScale = a * s,
  15298. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15299. }
  15300. }
  15301. ),
  15302. d.prototype.getDiscRadius = (i = new f.Vector3,
  15303. function(e, t) {
  15304. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15305. Math.abs(e.x - i.x) * $("#player").width()
  15306. }
  15307. ),
  15308. d.prototype.tagVisibleOnCurrentFloor = function(e) {
  15309. return !(e === m.DOLLHOUSE || e === m.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15310. }
  15311. ,
  15312. d.prototype.offScreen = function(e, t) {
  15313. var i = e.getWorldPosition().project(t);
  15314. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15315. }
  15316. ,
  15317. d.viewportScale = function() {
  15318. return d.viewportWidth === $("#player").width() && d.viewportHeight === $("#player").height() || (d.viewportWidth = $("#player").width(),
  15319. d.viewportHeight = $("#player").height(),
  15320. d.currentViewportScale = Math.sqrt(Math.min(d.viewportWidth, d.viewportHeight) / g.tags.disc.scale.baseViewportSize)),
  15321. d.currentViewportScale
  15322. }
  15323. ,
  15324. R.exports = d
  15325. }
  15326. ).call(this, "/js/tag/tag.js")
  15327. }
  15328. , {
  15329. "../enum/Colors": 19,
  15330. "../enum/RenderLayers": 41,
  15331. "../enum/RenderOrder": 42,
  15332. "../enum/Viewmode": 51,
  15333. "../objects/Panorama": 148,
  15334. "../settings": 166,
  15335. "../shaders": 167,
  15336. "../util/common": 185,
  15337. "../util/easing": 186,
  15338. "../util/lerp": 188,
  15339. "../util/logger": 189,
  15340. "../util/math": 190,
  15341. "../util/texture": 194,
  15342. "../util/transitions": 195,
  15343. "./Billboard/Billboard": 119,
  15344. "./Billboard/BillboardEvent": 120,
  15345. events: 202,
  15346. three: 217
  15347. }],
  15348. 124: [function(M, R, e) {
  15349. (function(e) {
  15350. "use strict";
  15351. function t() {
  15352. this.tagState = T.IDLE,
  15353. this.intersectTag = null,
  15354. this.hoveredTag = null,
  15355. this.activeTag = null,
  15356. this.tagDiscs = [],
  15357. this.raycaster = new i.Raycaster,
  15358. this.modelManager = null,
  15359. this.player = null,
  15360. this.totaltags = 0,
  15361. this.navigatingViaTag = !1,
  15362. this.enabled = !1
  15363. }
  15364. var o, h, u, d, p, f, s, l, c, i = M("three"), n = M("../util/logger"), r = M("../util/common"), a = M("../controls/serializer"), g = M("../objects/Snapshot"), m = M("../settings"), v = M("./Billboard/BillboardEvent"), y = M("./Media/MediaEvent"), A = M("./Media/LinkType"), C = M("../enum/Viewmode"), I = M("../enum/WarpStyle"), E = M("../enum/BlackoutStyle"), _ = M("../enum/ModelManagerEvents"), b = M("../enum/tagEvents"), w = M("../enum/PlayerEvents"), T = (M("../util/lerp"),
  15365. M("../enum/TagStates")), x = M("events").EventEmitter, S = new n(e);
  15366. r.extend(t, x),
  15367. t.prototype.init = function(e, t) {
  15368. this.modelManager = e,
  15369. this.player = t,
  15370. this.updateModel(),
  15371. this.bindEvents()
  15372. }
  15373. ,
  15374. t.prototype.update = function(e) {
  15375. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15376. }
  15377. ,
  15378. t.prototype.updateTags = function(e, t, i, n) {
  15379. for (var r in this.model.tags)
  15380. this.model.tags[r].update(e, t, i, n)
  15381. }
  15382. ,
  15383. t.prototype.updateModel = function() {
  15384. this.model = this.modelManager.getActiveModel(),
  15385. this.gettagsFromModel(),
  15386. this.totaltags = Object.keys(this.model.tags).length
  15387. }
  15388. ,
  15389. t.prototype.gettagsFromModel = function() {
  15390. for (var e in this.tagDiscs = [],
  15391. this.model.tags) {
  15392. var t = this.model.tags[e].disc;
  15393. t && this.tagDiscs.push(t)
  15394. }
  15395. }
  15396. ,
  15397. t.prototype.bindEvents = function() {
  15398. function e() {
  15399. Object.keys(this.model.tags).forEach(function(e) {
  15400. var t = this.model.tags[e];
  15401. t.bindEvents(),
  15402. t.billboard.on(y.LINK_CLICK, function(e) {
  15403. e.type === A.NAVIGATION && this.navigateViaLink(e.url)
  15404. }
  15405. .bind(this)),
  15406. t.billboard.on(y.IMAGE_OPENED, function() {
  15407. this.tagState = T.EXAMINE,
  15408. this.emit(y.IMAGE_OPENED)
  15409. }
  15410. .bind(this)),
  15411. t.billboard.on(v.CLOSING, this.dismissExaminedTag.bind(this))
  15412. }
  15413. .bind(this))
  15414. }
  15415. this.modelManager.on(_.ActiveModelChanged, this.updateModel.bind(this)),
  15416. this.modelManager.on(_.ActiveModelChanged, e.bind(this)),
  15417. this.player.on(w.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15418. this.player.on(w.PanoChosen, this.onPanoChange.bind(this)),
  15419. this.player.on(w.Ready, this.onPlayerReady.bind(this)),
  15420. this.player.on(w.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15421. this.player.on(w.WarpStarted, this.handleWarpStart.bind(this)),
  15422. this.player.on(w.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15423. e.call(this)
  15424. }
  15425. ,
  15426. t.prototype.navigateViaLink = function(e) {
  15427. var t = a.deserialize(e);
  15428. if (t)
  15429. if (t.mode === C.PANORAMA) {
  15430. try {
  15431. this.player.model.panos.get(t.panoId)
  15432. } catch (e) {
  15433. return void S.warn("Unable to find panorama location", t.panoId)
  15434. }
  15435. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, I.BLACK)
  15436. } else {
  15437. var i = {
  15438. cameraMode: t.mode,
  15439. position: t.position,
  15440. quaternion: t.quaternion,
  15441. scanId: t.panoId,
  15442. orthoZoom: t.zoom,
  15443. floorVisibility: t.floorVisibility,
  15444. thumbUrl: null,
  15445. name: null
  15446. };
  15447. this.player.flyToNewMode({
  15448. mode: t.mode,
  15449. duration: m.warp.outsideTime,
  15450. warpDest: new g(i),
  15451. force: !0
  15452. })
  15453. }
  15454. }
  15455. ,
  15456. t.prototype.handleWarpStart = function(e, t, i, n) {
  15457. this.dismissExaminedTag(),
  15458. t === I.BLACK && (null != n || (n = m.warp.teleportTime),
  15459. e && (i = E.END),
  15460. this.hideShowTagsForBlackoutStyle(i, n))
  15461. }
  15462. ,
  15463. t.prototype.handleWarpInterruption = function(e, t, i) {
  15464. null != i || (i = m.warp.teleportTime),
  15465. this.hideShowTagsForBlackoutStyle(t, i)
  15466. }
  15467. ,
  15468. t.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15469. var i = 0
  15470. , n = 0
  15471. , r = t / 2;
  15472. switch (null != e || (e = E.MIDDLE),
  15473. e) {
  15474. case E.END:
  15475. this.hideAlltags(r);
  15476. break;
  15477. case E.BEGINNING:
  15478. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15479. break;
  15480. case E.NONE:
  15481. break;
  15482. case E.MIDDLE:
  15483. n = i = r,
  15484. this.hideAlltags(n),
  15485. setTimeout(function() {
  15486. this.showAlltags(i)
  15487. }
  15488. .bind(this), n);
  15489. break;
  15490. case E.FADEIN:
  15491. setTimeout(function() {
  15492. this.showAlltags(r)
  15493. }
  15494. .bind(this), r)
  15495. }
  15496. }
  15497. ,
  15498. t.prototype.onPlayerModeChanging = function(e, t) {
  15499. t !== C.PANORAMA && this.dismissExaminedTag(),
  15500. t === C.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = C.OUTDOOR);
  15501. var i = t !== C.OUTDOOR;
  15502. i !== this.model.tagsShown && (i ? this.showAlltags(m.tags.startup.fadeInDuration) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15503. }
  15504. ,
  15505. t.prototype.onPanoChange = function(e, t) {
  15506. var i = this.navigatingViaTag;
  15507. if (this.navigatingViaTag = !1,
  15508. !i) {
  15509. this.dismissExaminedTag();
  15510. var n = e && !e.isAligned() ? C.OUTDOOR : C.PANORAMA
  15511. , r = t && !t.isAligned() ? C.OUTDOOR : C.PANORAMA;
  15512. n !== r && (r === C.PANORAMA ? this.showAlltags(m.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15513. }
  15514. }
  15515. ,
  15516. t.prototype.onPlayerReady = function(e, t, i) {
  15517. this.startAlltags(e, t ? i : null)
  15518. }
  15519. ,
  15520. t.prototype.onPlayerFlyingEnded = function(e, t) {
  15521. this.updateClosestTags(e)
  15522. }
  15523. ,
  15524. t.prototype.dismissExaminedTag = function() {
  15525. this.activeTag && this.tagState === T.EXAMINE && this.dismissActiveTag(),
  15526. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15527. this.hoveredTag = null)
  15528. }
  15529. ,
  15530. t.prototype.startAlltags = function(e, t) {
  15531. this.model.shouldShowtags = m.tags.enabled,
  15532. this.enabled = !0,
  15533. e || (this.showAlltags(m.tags.startup.fadeInDuration, m.tags.startup.fadeInDelay),
  15534. t && setTimeout(function() {
  15535. this.activateTag(this.model.getTagBySid(t))
  15536. }
  15537. .bind(this), m.tags.startup.fadeInDuration / 2))
  15538. }
  15539. ,
  15540. t.prototype.showAlltags = function(e, t, i) {
  15541. function n() {
  15542. ++o === this.totaltags && (this.model.tagsShown = !0,
  15543. r.resolve())
  15544. }
  15545. var r = $.Deferred();
  15546. if (!i && this.player.mode === C.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  15547. return r.resolve().promise();
  15548. var o = 0;
  15549. for (var a in this.model.tags) {
  15550. this.model.tags[a].show(e, t).done(n.bind(this))
  15551. }
  15552. return r.promise()
  15553. }
  15554. ,
  15555. t.prototype.hideAlltags = function(e, t) {
  15556. function i() {
  15557. ++r === this.totaltags && (this.model.tagsShown = !1,
  15558. n.resolve())
  15559. }
  15560. var n = $.Deferred()
  15561. , r = 0;
  15562. for (var o in this.model.tags) {
  15563. var a = this.model.tags[o];
  15564. a.hide(e, t).done(i.bind(this)),
  15565. a === this.activeTag && this.dismissActiveTag()
  15566. }
  15567. return n.promise()
  15568. }
  15569. ,
  15570. t.prototype.enableHovering = function() {
  15571. this.enabled = !0
  15572. }
  15573. ,
  15574. t.prototype.disableHovering = function() {
  15575. this.enabled = !1
  15576. }
  15577. ,
  15578. t.prototype.activateTag = function(e, t) {
  15579. t = t || T.EXAMINE,
  15580. this.activeTag = e,
  15581. this.activeTag.hoveringDisc = !0,
  15582. this.activeTag.setHoverState(t === T.EXAMINE),
  15583. this.tagState = t,
  15584. this.emit(b.TagActivated, e)
  15585. }
  15586. ,
  15587. t.prototype.dismissActiveTag = function() {
  15588. this.activeTag.hoveringDisc = !1,
  15589. this.activeTag.setFreeState(!0);
  15590. var e = this.activeTag;
  15591. this.activeTag = null,
  15592. this.tagState = T.IDLE,
  15593. this.emit(b.TagDismissed, e)
  15594. }
  15595. ,
  15596. t.prototype.clickedOnTag = function(e) {
  15597. var t = function() {
  15598. this.navigatingViaTag = !0,
  15599. this.activeTag.examine(this.player),
  15600. this.emit(b.TagNavigation, this.activeTag)
  15601. }
  15602. .bind(this);
  15603. return this.tagState !== T.EXAMINE ? (this.activateTag(this.intersectTag, T.EXAMINE),
  15604. this.activeTag = this.intersectTag,
  15605. t(),
  15606. !0) : (this.dismissActiveTag(),
  15607. !1)
  15608. }
  15609. ,
  15610. t.prototype.intersecttag = (s = new i.Vector3,
  15611. l = new i.Vector3,
  15612. c = new i.Vector3,
  15613. function(e, t, i) {
  15614. if (!this.enabled)
  15615. return null;
  15616. var n = null
  15617. , r = this.tagDiscs.filter(function(e) {
  15618. return e.parent.visible
  15619. });
  15620. if (0 < r.length) {
  15621. var o = this.model.floors.reduce(function(e, t) {
  15622. return t.hidden ? e : e.concat(t.collider.children)
  15623. }, r);
  15624. s.set(e.x, e.y, -1).unproject(i),
  15625. l.set(e.x, e.y, 1).unproject(i),
  15626. c.copy(l).sub(s).normalize(),
  15627. this.raycaster.set(s, c);
  15628. var a = this.raycaster.intersectObjects(o);
  15629. 0 < a.length && -1 !== r.indexOf(a[0].object) && (n = a[0].object.tag)
  15630. }
  15631. return this.intersectTag = n,
  15632. t && (this.activeTag && n !== this.activeTag && (this.tagState === T.BROWSE || this.tagState === T.EXAMINE && n) && this.dismissActiveTag(),
  15633. n && n !== this.activeTag && (n.listeners(v.ENTER).length < 1 && (n.billboard.on(v.ENTER, function() {
  15634. this.hoveredTag = n
  15635. }
  15636. .bind(this)),
  15637. n.billboard.on(v.LEAVE, function() {
  15638. this.hoveredTag = null
  15639. }
  15640. .bind(this))),
  15641. this.activateTag(n, T.BROWSE))),
  15642. n
  15643. }
  15644. ),
  15645. t.prototype.rankedtagInDirection = (h = [],
  15646. u = [],
  15647. d = new i.Vector3,
  15648. p = new i.Vector3,
  15649. f = new i.Vector3,
  15650. function(e, t, i, n) {
  15651. for (var r = 0, o = u.length = 0; o < this.closesttags.length; o++) {
  15652. var a = this.closesttags[o];
  15653. p.copy(a.position),
  15654. p.add(a.discPosition),
  15655. d.copy(t),
  15656. d.sub(p).negate(),
  15657. d.normalize();
  15658. var s = d.dot(n);
  15659. if (0 <= s && (f.copy(p),
  15660. f.project(i),
  15661. this.intersecttag(f, !1, i))) {
  15662. if (r >= h.length)
  15663. for (var l = 0; l < 64; l++)
  15664. h.push({
  15665. tag: a,
  15666. dot: s
  15667. });
  15668. var c = h[r];
  15669. c.tag = a,
  15670. c.dot = s,
  15671. c.position = math.projectPositionToCanvas(p, i),
  15672. u.push(c),
  15673. r++
  15674. }
  15675. }
  15676. return u.sort(function(e, t) {
  15677. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  15678. }),
  15679. e < u.length ? u[e].tag : null
  15680. }
  15681. ),
  15682. t.prototype.updateClosestTags = (o = new i.Vector3,
  15683. function(e) {
  15684. this.closesttags || (this.closesttags = []),
  15685. this.closesttags.length = 0;
  15686. var t = this.model.tags;
  15687. if (t)
  15688. for (var i in t)
  15689. if (t.hasOwnProperty(i)) {
  15690. var n = t[i]
  15691. , r = n.position;
  15692. o.copy(e),
  15693. o.sub(r).negate(),
  15694. o.lengthSq() < 30 && this.closesttags.push(n)
  15695. }
  15696. }
  15697. ),
  15698. R.exports = t
  15699. }
  15700. ).call(this, "/js/tag/tagManager.js")
  15701. }
  15702. , {
  15703. "../controls/serializer": 14,
  15704. "../enum/BlackoutStyle": 18,
  15705. "../enum/tagEvents": 32,
  15706. "../enum/ModelManagerEvents": 33,
  15707. "../enum/PlayerEvents": 40,
  15708. "../enum/TagStates": 44,
  15709. "../enum/Viewmode": 51,
  15710. "../enum/WarpStyle": 52,
  15711. "../objects/Snapshot": 153,
  15712. "../settings": 166,
  15713. "../util/common": 185,
  15714. "../util/lerp": 188,
  15715. "../util/logger": 189,
  15716. "./Billboard/BillboardEvent": 120,
  15717. "./Media/LinkType": 130,
  15718. "./Media/MediaEvent": 131,
  15719. events: 202,
  15720. three: 217
  15721. }],
  15722. 125: [function(r, o, e) {
  15723. (function(e) {
  15724. "use strict";
  15725. function t() {
  15726. this.embedWrapper = null,
  15727. this.embedElement = null
  15728. }
  15729. var i = r("../../util/ajax")
  15730. , a = r("./mediaSettings")
  15731. , n = r("../../settings")
  15732. , s = new (r("../../util/logger"))(e);
  15733. t.prototype.createDomElement = function() {
  15734. return this.embedWrapper = document.createElement("div"),
  15735. this.embedWrapper.classList.add("tag-embed"),
  15736. this.embedWrapper.classList.add("hidden"),
  15737. this.embedWrapper
  15738. }
  15739. ,
  15740. t.prototype.load = function(e) {
  15741. var t = "https://api.embedly.com/1/oembed?key=" + n.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + a.maxEmbedWidth;
  15742. return new Promise(function(r, o) {
  15743. i.get(t).then(function(e) {
  15744. if ((e = JSON.parse(e)).html && -1 === e.html.indexOf("<script")) {
  15745. this.embedWrapper.innerHTML = e.html;
  15746. var t = Math.min(e.width, a.maxEmbedWidth) || a.maxEmbedWidth;
  15747. if (this.embedWrapper.style.width = t + "px",
  15748. e.height) {
  15749. var i = e.height / e.width;
  15750. this.embedWrapper.style.height = t * i + "px"
  15751. }
  15752. this.embedElement = this.embedWrapper.firstChild;
  15753. var n = [];
  15754. try {
  15755. n = [].slice.call(this.embedElement.querySelectorAll("a"))
  15756. } catch (e) {
  15757. s.debug("Error getting `a` elements for embed; was it an iframe?")
  15758. }
  15759. n.forEach(function(e) {
  15760. e.setAttribute("target", "_blank")
  15761. }),
  15762. this.embedElement.classList.add("hidden"),
  15763. this.embedWrapper.classList.remove("hidden"),
  15764. r()
  15765. } else
  15766. o("Not a valid embed")
  15767. }
  15768. .bind(this), function(e) {
  15769. o(e.response)
  15770. })
  15771. }
  15772. .bind(this))
  15773. }
  15774. ,
  15775. t.prototype.show = function() {
  15776. this.embedElement && this.embedElement.classList.remove("hidden")
  15777. }
  15778. ,
  15779. t.prototype.hide = function() {
  15780. this.embedElement && this.embedElement.classList.add("hidden")
  15781. }
  15782. ,
  15783. o.exports = t
  15784. }
  15785. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  15786. }
  15787. , {
  15788. "../../settings": 166,
  15789. "../../util/ajax": 181,
  15790. "../../util/logger": 189,
  15791. "./mediaSettings": 132
  15792. }],
  15793. 126: [function(a, s, e) {
  15794. (function(e) {
  15795. "use strict";
  15796. function t(e) {
  15797. r.call(this),
  15798. this.options = e,
  15799. this.playerControls = null,
  15800. this.state = o.NOT_READY
  15801. }
  15802. var i, n = a("../../util/browser"), r = a("./EmbedlyEmbed"), o = (new (a("../../util/logger"))(e),
  15803. Object.freeze({
  15804. NOT_READY: "player.not.ready",
  15805. CUED: "player.cued",
  15806. PLAYING: "player.playing",
  15807. PAUSED: "player.paused"
  15808. }));
  15809. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15810. return this.embedWrapper = document.createElement("div"),
  15811. this.embedWrapper.classList.add("tag-video"),
  15812. this.embedWrapper.classList.add("hidden"),
  15813. this.embedWrapper
  15814. }
  15815. ,
  15816. t.prototype.load = function(e) {
  15817. var t = function() {
  15818. function e(e) {
  15819. this.playerState = e
  15820. }
  15821. this.playerControls = new playerjs.Player(this.embedElement),
  15822. this.playerControls.on("ready", function(e) {
  15823. this.playerState = o.CUED,
  15824. this.options.startMuted && this.playerControls.mute()
  15825. }
  15826. .bind(this)),
  15827. this.playerControls.on("play", e.bind(this, o.PLAYING)),
  15828. this.playerControls.on("pause", e.bind(this, o.PAUSED)),
  15829. this.playerControls.on("ended", function(e) {
  15830. this.playerControls.setCurrentTime(0),
  15831. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  15832. }
  15833. .bind(this))
  15834. }
  15835. .bind(this);
  15836. return r.prototype.load.call(this, e).then(t.bind(this))
  15837. }
  15838. ,
  15839. t.prototype.play = (i = n.isMobile(),
  15840. function() {
  15841. this.playerState !== o.NOT_READY && this.playerControls && !i && (this.state === o.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  15842. }
  15843. ),
  15844. t.prototype.pause = function() {
  15845. this.playerState !== o.NOT_READY && this.playerControls && this.playerControls.pause()
  15846. }
  15847. ,
  15848. s.exports = t
  15849. }
  15850. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  15851. }
  15852. , {
  15853. "../../util/browser": 182,
  15854. "../../util/logger": 189,
  15855. "./EmbedlyEmbed": 125
  15856. }],
  15857. 127: [function(t, i, e) {
  15858. (function(e) {
  15859. "use strict";
  15860. var r = t("../../util/ajax")
  15861. , o = new (t("./mediaSettings"),
  15862. t("../../util/logger"))(e)
  15863. , a = Promise.resolve();
  15864. i.exports.enqueue = function(i) {
  15865. function n() {}
  15866. return a = new Promise(function(e, t) {
  15867. a.catch(n).then(function() {
  15868. (o.debug("requesting file from embedly:", i.href),
  15869. r.get(i.href, {
  15870. responseType: i.responseType
  15871. }).then(function(e) {
  15872. return o.debug("requesting file finished:", i.href),
  15873. e
  15874. })).then(e, t)
  15875. })
  15876. }
  15877. )
  15878. }
  15879. }
  15880. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  15881. }
  15882. , {
  15883. "../../util/ajax": 181,
  15884. "../../util/logger": 189,
  15885. "./mediaSettings": 132
  15886. }],
  15887. 128: [function(s, l, e) {
  15888. (function(e) {
  15889. "use strict";
  15890. function t() {
  15891. this.imageWrapper = null,
  15892. this.width = 0,
  15893. this.height = 0,
  15894. this.aspect = 1
  15895. }
  15896. var i = s("./MediaEvent")
  15897. , n = s("./EmbedlyQueue")
  15898. , r = s("events").EventEmitter
  15899. , o = s("../../util/logger")
  15900. , a = s("../../settings");
  15901. new o(e),
  15902. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15903. return this.imageWrapper = document.createElement("div"),
  15904. this.imageWrapper.classList.add("tag-image"),
  15905. this.imageWrapper.classList.add("hidden"),
  15906. this.imageWrapper.addEventListener("click", function(e) {
  15907. e.stopPropagation(),
  15908. this.emit(i.IMAGE_OPENING),
  15909. this.imageWrapper.style.pointerEvents = "none"
  15910. }
  15911. .bind(this)),
  15912. this.imageWrapper
  15913. }
  15914. ,
  15915. t.prototype.onClosed = function() {
  15916. this.imageWrapper.style.pointerEvents = "auto"
  15917. }
  15918. ,
  15919. t.prototype.load = function(e) {
  15920. var t = Math.max(window.screen.height, window.screen.width)
  15921. , i = "https://i.embed.ly/1/display/resize?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  15922. return new Promise(function(o, e) {
  15923. n.enqueue({
  15924. href: i,
  15925. responseType: "arraybuffer"
  15926. }).then(function(e) {
  15927. var t = new Uint8Array(e)
  15928. , i = new Blob([t])
  15929. , n = new window.Image;
  15930. n.addEventListener("load", function(e) {
  15931. var t = e.target;
  15932. this.width = t.naturalWidth,
  15933. this.height = t.naturalHeight,
  15934. this.aspect = this.width / this.height;
  15935. var i = e.target.src;
  15936. this.imageWrapper.style.backgroundImage = 'url("' + i + '")',
  15937. this.imageWrapper.style.width = this.width + "px",
  15938. this.imageWrapper.style.height = this.height + "px",
  15939. this.imageWrapper.classList.remove("hidden"),
  15940. o()
  15941. }
  15942. .bind(this));
  15943. var r = URL.createObjectURL(i);
  15944. n.src = r
  15945. }
  15946. .bind(this), e)
  15947. }
  15948. .bind(this))
  15949. }
  15950. ,
  15951. l.exports = t
  15952. }
  15953. ).call(this, "/js/tag/Media/Image.js")
  15954. }
  15955. , {
  15956. "../../settings": 166,
  15957. "../../util/logger": 189,
  15958. "./EmbedlyQueue": 127,
  15959. "./MediaEvent": 131,
  15960. events: 202
  15961. }],
  15962. 129: [function(e, t, i) {
  15963. "use strict";
  15964. function n(e) {
  15965. this.label = e.label,
  15966. this.href = e.url,
  15967. this.type = this.updateLinkForType(),
  15968. this.domElement = null,
  15969. this.id = c++
  15970. }
  15971. var r = e("./LinkType")
  15972. , o = e("./MediaEvent")
  15973. , a = e("../../util/browser")
  15974. , s = e("../../analytics")
  15975. , l = e("events").EventEmitter
  15976. , c = 0;
  15977. (n.prototype = Object.create(l.prototype)).updateLinkForType = function() {
  15978. var e, t = a.valueFromHash("m") || a.valueFromHash("model");
  15979. return -1 !== this.href.indexOf("port.com/show") || -1 !== this.href.indexOf(window.location.host + "/show") ? -1 !== this.href.indexOf(t) && -1 !== this.href.indexOf("start=") ? (this.href = (e = this.href,
  15980. new RegExp("[#&?]start=([^#&?]*)").exec(e)[1]),
  15981. r.NAVIGATION) : (this.href = this.href + "&play=1",
  15982. r.MODEL) : r.EXT_LINK
  15983. }
  15984. ;
  15985. var h = {};
  15986. n.prototype.createDomElement = function() {
  15987. if (this.domElement = document.createElement("a"),
  15988. this.domElement.classList.add("tag-link"),
  15989. this.domElement.textContent = this.label,
  15990. this.type === r.EXT_LINK) {
  15991. this.domElement.textContent += " ";
  15992. var e = document.createElement("i");
  15993. e.classList.add("icon-ext-link"),
  15994. e.title = "Link to external web site",
  15995. this.domElement.appendChild(e)
  15996. }
  15997. return this.domElement.addEventListener("click", function(e) {
  15998. switch (e.stopPropagation(),
  15999. h[this.id] = !0,
  16000. s.trackAlways("click_tag_link", {
  16001. link_type: this.type,
  16002. link_count: c,
  16003. links_clicked: Object.keys(h).length
  16004. }),
  16005. this.type) {
  16006. case r.MODEL:
  16007. window.location.replace(this.href);
  16008. break;
  16009. case r.EXT_LINK:
  16010. window.open(this.href, "_blank")
  16011. }
  16012. this.emit(o.LINK_CLICK, {
  16013. type: this.type,
  16014. url: this.href
  16015. })
  16016. }
  16017. .bind(this)),
  16018. this.domElement
  16019. }
  16020. ,
  16021. t.exports = n
  16022. }
  16023. , {
  16024. "../../analytics": 4,
  16025. "../../util/browser": 182,
  16026. "./LinkType": 130,
  16027. "./MediaEvent": 131,
  16028. events: 202
  16029. }],
  16030. 130: [function(e, t, i) {
  16031. "use strict";
  16032. t.exports = {
  16033. NAVIGATION: "navigation",
  16034. MODEL: "model",
  16035. EXT_LINK: "ext-link"
  16036. }
  16037. }
  16038. , {}],
  16039. 131: [function(e, t, i) {
  16040. "use strict";
  16041. t.exports = Object.freeze({
  16042. LINK_CLICK: "mtmedia.link",
  16043. IMAGE_LOADED: "mtmedia.image.loaded",
  16044. IMAGE_OPENING: "mtmedia.image.opening",
  16045. IMAGE_OPENED: "mtmedia.image.opened",
  16046. IMAGE_CLOSING: "mtmedia.image.closing",
  16047. IMAGE_CLOSED: "mtmedia.image.closed",
  16048. VIDEO_START: "mtmedia.video.start",
  16049. VIDEO_PAUSE: "mtmedia.video.pause",
  16050. VIDEO_ENDED: "mtmedia.video.end"
  16051. })
  16052. }
  16053. , {}],
  16054. 132: [function(e, t, i) {
  16055. "use strict";
  16056. t.exports = Object.freeze({
  16057. maxEmbedWidth: 350,
  16058. defaultAspectRatio: .75
  16059. })
  16060. }
  16061. , {}],
  16062. 133: [function(e, t, i) {
  16063. "use strict";
  16064. t.exports = Object.freeze({
  16065. TEXT: "text",
  16066. LINK: "link",
  16067. IMAGE: "photo",
  16068. VIDEO: "video",
  16069. RICH: "rich"
  16070. })
  16071. }
  16072. , {}],
  16073. 134: [function(e, t, i) {
  16074. "use strict";
  16075. function n(e) {
  16076. this.capabilities = {
  16077. links: {
  16078. enable: e.supportLinks,
  16079. keepLabels: e.keepLinkLabels
  16080. }
  16081. }
  16082. }
  16083. var r = e("./DescriptionChunkType");
  16084. n.prototype.parse = function(e, i) {
  16085. var n = [];
  16086. return e.split("[").map(function(e, t) {
  16087. return 0 === t ? e : "[" + e
  16088. }).forEach(function(e) {
  16089. var t = this.findMarkdown(e);
  16090. if (t) {
  16091. if (-1 !== t.url.indexOf("javascript:"))
  16092. return;
  16093. this.addLinkChunk(n, t, i),
  16094. this.addTextChunk(n, e.slice(t.markdown.length))
  16095. } else
  16096. this.addTextChunk(n, e)
  16097. }
  16098. .bind(this)),
  16099. n
  16100. }
  16101. ,
  16102. n.prototype.findMarkdown = function(e) {
  16103. var t = e.match(/\[([^\]]*)\]\((.*)\)/);
  16104. if (t) {
  16105. for (var i = t[2], n = 1, r = 0; r < i.length && ("(" === i[r] ? n++ : ")" === i[r] && n--,
  16106. 0 !== n); )
  16107. r++;
  16108. var o = i.length - r;
  16109. return {
  16110. markdown: t[0].substring(0, t[0].length - o),
  16111. label: t[1],
  16112. url: t[2].substring(0, r)
  16113. }
  16114. }
  16115. }
  16116. ,
  16117. n.prototype.addTextChunk = function(e, t) {
  16118. 0 !== t.length && e.push({
  16119. type: r.TEXT,
  16120. text: t
  16121. })
  16122. }
  16123. ,
  16124. n.prototype.addLinkChunk = function(e, t) {
  16125. if (this.capabilities.links.enable) {
  16126. var i = {
  16127. label: t.label,
  16128. url: t.url
  16129. };
  16130. -1 === i.url.indexOf("://") && (i.url = "http://" + i.url),
  16131. e.push({
  16132. type: r.LINK,
  16133. link: i
  16134. })
  16135. } else
  16136. this.capabilities.links.keepLabels && this.addTextChunk(e, t.label)
  16137. }
  16138. ,
  16139. t.exports = n
  16140. }
  16141. , {
  16142. "./DescriptionChunkType": 133
  16143. }],
  16144. 135: [function(t, r, e) {
  16145. (function(e) {
  16146. "use strict";
  16147. var i = new (t("../util/logger"))(e)
  16148. , n = {
  16149. parseIdsFromChunkName: function(e, t) {
  16150. t.floorId = n.parseFloor(e),
  16151. t.roomId = n.parseRoom(e)
  16152. },
  16153. parseFloor: function(e) {
  16154. var t = e.match(/_group([0-9]+)/);
  16155. if (!t)
  16156. return 0;
  16157. try {
  16158. return parseInt(t[1], 10)
  16159. } catch (e) {
  16160. return i.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16161. 0
  16162. }
  16163. },
  16164. parseRoom: function(e) {
  16165. var t = e.match(/_sub([0-9]+)/);
  16166. if (!t)
  16167. return -1;
  16168. try {
  16169. return parseInt(t[1], 10)
  16170. } catch (e) {
  16171. return i.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16172. 0
  16173. }
  16174. }
  16175. };
  16176. r.exports = n
  16177. }
  16178. ).call(this, "/js/model/Chunks.js")
  16179. }
  16180. , {
  16181. "../util/logger": 189
  16182. }],
  16183. 136: [function(a, c, e) {
  16184. (function(e) {
  16185. "use strict";
  16186. function t(e) {
  16187. r.call(this),
  16188. this.model = e,
  16189. this.exploded = !1
  16190. }
  16191. var i = a("../objects/Floor")
  16192. , n = (a("../settings"),
  16193. a("../util/logger"))
  16194. , s = a("../util/transitions")
  16195. , r = a("../util/IndexedCollection")
  16196. , o = a("../util/common")
  16197. , l = a("../util/easing");
  16198. new n(e),
  16199. o.inherit(t, r),
  16200. t.prototype.add = function(e) {
  16201. r.prototype.add.call(this, e),
  16202. this.model.add(e)
  16203. }
  16204. ,
  16205. t.prototype.getIndex = function(e) {
  16206. return e.floorIndex
  16207. }
  16208. ,
  16209. t.prototype.build = function() {
  16210. this.list.forEach(function(e) {
  16211. e.build()
  16212. })
  16213. }
  16214. ,
  16215. t.prototype.size = function() {
  16216. return this.length
  16217. }
  16218. ,
  16219. t.prototype.sort = function() {
  16220. r.prototype.sort.call(this, function(e, t) {
  16221. return e.floorIndex - t.floorIndex
  16222. })
  16223. }
  16224. ,
  16225. t.prototype.nextFloor = function(e, t) {
  16226. return this.index[e.floorIndex + t] || null
  16227. }
  16228. ,
  16229. t.prototype.getFloorAtPoint = function(e) {
  16230. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16231. var r = this.list[n]
  16232. , o = r.distanceToPoint(e);
  16233. (!t || o < i) && (i = o,
  16234. t = r)
  16235. }
  16236. return t
  16237. }
  16238. ,
  16239. t.prototype.getOrMakeFloor = function(e) {
  16240. var t = this.index[e];
  16241. return t || (t = new i(this.model,e),
  16242. this.add(t)),
  16243. t
  16244. }
  16245. ,
  16246. t.prototype.hide = function() {
  16247. this.list.forEach(function(e) {
  16248. e.hide()
  16249. })
  16250. }
  16251. ,
  16252. t.prototype.show = function() {
  16253. this.list.forEach(function(e) {
  16254. e.show()
  16255. })
  16256. }
  16257. ,
  16258. t.prototype.names = function() {
  16259. return this.list.reduce(function(e, t) {
  16260. return e.concat(t.name)
  16261. }, [])
  16262. }
  16263. ,
  16264. t.prototype.toggleExplodeHorizontal = function() {
  16265. function i(e, t) {
  16266. a.copy(e.position),
  16267. e.position.x = r[e.floorIndex] * t,
  16268. e.position.y = 1 * e.floorIndex * t,
  16269. a.sub(e.position).multiplyScalar(-1),
  16270. e.panos.forEach(function(e) {
  16271. e.translate(a)
  16272. })
  16273. }
  16274. var n, r = [], o = 0;
  16275. this.list.forEach(function(e, t, i) {
  16276. n = 0 < t ? Math.max(i[t - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16277. o += n,
  16278. r[t] = o
  16279. }),
  16280. r = r.map(function(e) {
  16281. return e - o / 2
  16282. });
  16283. var a = this.list[0].position.clone();
  16284. this.exploded ? this.list.forEach(function(t) {
  16285. s.start(function(e) {
  16286. i(t, 1 - e)
  16287. }, 1500, null, 0, l.easeOutExpo)
  16288. }) : this.list.forEach(function(t) {
  16289. s.start(function(e) {
  16290. i(t, e)
  16291. }, 1500, null, 0, l.easeOutExpo)
  16292. }),
  16293. this.exploded = !this.exploded
  16294. }
  16295. ,
  16296. t.prototype.toggleExplodeVertical = function() {
  16297. function i(e, t) {
  16298. var i = i.copy(e.position);
  16299. e.position.y = (5 * e.floorIndex - n.y / 2) * t,
  16300. i.sub(e.position).multiplyScalar(-1),
  16301. e.panos.forEach(function(e) {
  16302. e.translate(i)
  16303. })
  16304. }
  16305. var n = this.model.size;
  16306. this.list[0].position.clone(),
  16307. this.exploded ? this.list.forEach(function(t) {
  16308. s.start(function(e) {
  16309. i(t, 1 - e)
  16310. }, 1500, null, 0, l.easeOutExpo)
  16311. }) : this.list.forEach(function(t) {
  16312. s.start(function(e) {
  16313. i(t, e)
  16314. }, 1500, null, 0, l.easeOutExpo)
  16315. }),
  16316. this.exploded = !this.exploded
  16317. }
  16318. ,
  16319. c.exports = t
  16320. }
  16321. ).call(this, "/js/model/FloorCollection.js")
  16322. }
  16323. , {
  16324. "../objects/Floor": 146,
  16325. "../settings": 166,
  16326. "../util/IndexedCollection": 175,
  16327. "../util/common": 185,
  16328. "../util/easing": 186,
  16329. "../util/logger": 189,
  16330. "../util/transitions": 195
  16331. }],
  16332. 137: [function(r, o, e) {
  16333. (function(e) {
  16334. "use strict";
  16335. function h() {
  16336. n.call(this)
  16337. }
  16338. var u = r("../settings")
  16339. , t = r("../util/logger")
  16340. , d = r("../enum/Viewmode")
  16341. , p = r("../objects/Snapshot")
  16342. , i = (r("../util/math"),
  16343. r("../util/common"))
  16344. , n = r("../util/IndexedCollection")
  16345. , l = new t(e);
  16346. i.inherit(h, n),
  16347. h.prototype.getImage = function(e) {
  16348. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16349. }
  16350. ,
  16351. h.prototype.filterByModesAndReel = function(e, t) {
  16352. for (var i = [], n = 0; n < t.length; n += 1) {
  16353. var r = t[n]
  16354. , o = this.index[r.sid];
  16355. o && i.push(o)
  16356. }
  16357. var a = e[d.DOLLHOUSE]
  16358. , s = e[d.FLOORPLAN];
  16359. (i = i.filter(function(e) {
  16360. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16361. return !0;
  16362. var t;
  16363. try {
  16364. t = d.convertWorkshopModeInt(e.metadata.camera_mode)
  16365. } catch (e) {
  16366. return l.debug(e.message),
  16367. !1
  16368. }
  16369. return t === d.PANORAMA || t === d.FLOORPLAN && s || t === d.DOLLHOUSE && a
  16370. })).length !== this.list.length && l.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16371. this.list = i,
  16372. this.reIndex()
  16373. }
  16374. ,
  16375. h.prototype.getHeroLocations = function(panos) {//改 增加二级location
  16376. if (0 === this.list.length)
  16377. return [];
  16378. var locations = [];
  16379. var deal = (n, container)=>{
  16380. var r = n.thumbnail_signed_src,
  16381. o = n.name || "";
  16382. if (n.metadata && void 0 !== n.metadata.camera_quaternion) {
  16383. if (!u.show360Views.enabled && n.metadata.scan_id) {
  16384. var a = panos.get(n.metadata.scan_id);
  16385. if (a && !a.isAligned()) return
  16386. }
  16387. var s = d.convertWorkshopModeInt(n.metadata.camera_mode);
  16388. if (s === d.MESH) return
  16389. if(window.isLocal)var src = manage.dealURL(r)
  16390. else var src = "one" === g_version ? g_Prefix + r + "?" + randomTime().getTime() : r + "?" + randomTime().getTime()
  16391. var l = {
  16392. cameraMode: s,
  16393. position: n.metadata.camera_position,
  16394. quaternion: n.metadata.camera_quaternion,
  16395. zoom: n.metadata.zoom,
  16396. panoId: n.metadata.scan_id,
  16397. orthoZoom: n.metadata.ortho_zoom,
  16398. floorVisibility: void 0 !== n.metadata.floor_visibility ? n.metadata.floor_visibility.slice(0) : [],
  16399. thumbUrl: src,
  16400. name: h.filterImageName(o),
  16401. sid: n.sid
  16402. }
  16403. var item = new p(l);
  16404. item.momentTour = n.momentTour
  16405. item.dontRot = n.dontRot
  16406. item.rotTime = n.rotTime
  16407. container.push(item)
  16408. return item
  16409. }
  16410. }
  16411. this.list.forEach(image=>{
  16412. if(image.images){
  16413. var folder = $.extend({}, image )
  16414. folder.heroLocations = [];
  16415. image.images.list.forEach(child=>{
  16416. deal(child, folder.heroLocations);
  16417. })
  16418. folder.musicInfo = folder.musicInfo || {}
  16419. locations.push(folder)
  16420. delete folder.images;
  16421. delete folder.locations;
  16422. }else{
  16423. var item = deal(image, locations);
  16424. item.musicInfo = image.musicInfo || g_data2.tourAudio[item.sid] || {}//新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  16425. }
  16426. })
  16427. return locations
  16428. }
  16429. ,
  16430. h.prototype.getIndex = function(e) {
  16431. return e.sid
  16432. }
  16433. ,
  16434. h.filterImageName = function(e) {
  16435. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16436. }
  16437. ,
  16438. o.exports = h
  16439. }
  16440. ).call(this, "/js/model/ImageCollection.js")
  16441. }
  16442. , {
  16443. "../enum/Viewmode": 51,
  16444. "../objects/Snapshot": 153,
  16445. "../settings": 166,
  16446. "../util/IndexedCollection": 175,
  16447. "../util/common": 185,
  16448. "../util/logger": 189,
  16449. "../util/math": 190
  16450. }],
  16451. 138: [function(h, u, e) {
  16452. (function(e) {
  16453. "use strict";
  16454. function n() {
  16455. c.call(this)
  16456. }
  16457. var r = h("../label/Label")
  16458. , i = h("../settings")
  16459. , t = h("../util/logger")
  16460. , o = h("../util/math")
  16461. , a = h("../util/ajax")
  16462. , s = h("./RoomCollection")
  16463. , l = h("../util/common")
  16464. , c = h("../util/IndexedCollection");
  16465. new t(e),
  16466. l.inherit(n, c),
  16467. n.prototype.getIndex = function(e) {
  16468. return e.labelId
  16469. }
  16470. ,
  16471. n.prototype.associateWithRooms = function(e) {
  16472. this.forEach(function(t) {
  16473. e.forEach(function(e) {
  16474. e.roomId === t.roomId && (t.room = e)
  16475. })
  16476. })
  16477. }
  16478. ,
  16479. n.prototype.createFromLabelData = function(e) {
  16480. e.forEach(function(e) {
  16481. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16482. t = s.generateRoomId(e.floorId, t);
  16483. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16484. i.position = o.convertWorkshopVector(i.position),
  16485. this.add(i),
  16486. i.build()
  16487. }
  16488. .bind(this))
  16489. }
  16490. ,
  16491. n.prototype.load = function(e, t) {
  16492. return a.get(e, {
  16493. responseType: "json",
  16494. auth: t ? i.authorizationHeader : null
  16495. }).done(function(e) {
  16496. var t = [];
  16497. for (var i in e) {
  16498. var n = e[i];
  16499. t.push(n)
  16500. }
  16501. this.createFromLabelData(t)
  16502. }
  16503. .bind(this))
  16504. }
  16505. ,
  16506. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  16507. var t = -1;
  16508. if (e) {
  16509. if(typeof e == 'number'){
  16510. t = parseInt(e)
  16511. }else{
  16512. var i = e.split("_");
  16513. t = parseInt(i[0])
  16514. }
  16515. }
  16516. return t
  16517. }
  16518. ,
  16519. u.exports = n
  16520. }
  16521. ).call(this, "/js/model/LabelCollection.js")
  16522. }
  16523. , {
  16524. "../label/Label": 90,
  16525. "../settings": 166,
  16526. "../util/IndexedCollection": 175,
  16527. "../util/ajax": 181,
  16528. "../util/common": 185,
  16529. "../util/logger": 189,
  16530. "../util/math": 190,
  16531. "./RoomCollection": 141
  16532. }],
  16533. 139: [function(P, O, e) {
  16534. (function(e) {
  16535. "use strict";
  16536. function t(e, t) {
  16537. o.Object3D.call(this),
  16538. this.sid = window.number;//t.sid,
  16539. this.data = t,
  16540. this.options = e,
  16541. this.urls = new i(e.urlFiles),
  16542. this.isPublic = void 0 !== t.is_public && t.is_public,
  16543. //创建heroLocations
  16544. this.images = new E(this),
  16545. this.images.extend(t.images),
  16546. this.images.forEach((info)=>{
  16547. if(info.locations){
  16548. info.images = new E(this);
  16549. info.images.extend(info.locations)
  16550. }
  16551. })
  16552. this.heroLocations = []
  16553. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  16554. this.outdoorPanoLocations = [],
  16555. this.floors = new c(this),
  16556. this.floorsEnabled = void 0 === e.floors || e.floors,
  16557. this.changingFloor = !1,
  16558. this.chunks = [],
  16559. this.panos = new g,
  16560. this.colliders = [],
  16561. this.loadPanosPromise = null,
  16562. this.loadMeshTexturesPromise = null,
  16563. this.auxDataPromise = null,
  16564. this.meshTexturesLoaded = !1,
  16565. this.meshTextures = [],
  16566. this.tags = {},
  16567. this.tagsShown = !1,
  16568. this.shouldShowtags = !1,
  16569. this.has360Views = !1,
  16570. this.showingLabels = u.labels.enabled && t.player_options.labels,
  16571. this.supportedModes = {},
  16572. this.supportedModes[s.PANORAMA] = !0,
  16573. this.supportedModes[s.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && I.valueFromHash("dh", 1),
  16574. this.supportedModes[s.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && I.valueFromHash("dh", 1),
  16575. this.supportedModes[s.TRANSITIONING] = !0,
  16576. this.supportsTiles = this.configureTiling(),
  16577. this.supportsVR = window.DATA.supportsVR || false//!0,
  16578. this.mode = s.DOLLHOUSE,
  16579. this.size = null,
  16580. this.center = null,
  16581. this.boundingBox = new o.Box3,
  16582. this.currentFloor = null,
  16583. this.allFloorsVisible = !0,
  16584. this.projectedPano0 = null,
  16585. this.projectedPano1 = null,
  16586. this.floorsEnabled && t.floors && -1 !== t.floors.indexOf(",") && t.floors.split(",").forEach(function(e, t) {
  16587. this.addFloor(new r(this,t,e.trim()))
  16588. }
  16589. .bind(this)),
  16590. this.waitQueue = [],
  16591. this.on("load", function(e) {
  16592. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  16593. return !e.isLoadedCallback()
  16594. }),
  16595. 0 === this.waitQueue.length && this.emit("waiting-done"))
  16596. }
  16597. .bind(this)),
  16598. this.setupCustomProperties(),
  16599. this.hots = {}
  16600. }
  16601. var o = P("three")
  16602. , a = P("../util/ajax")
  16603. , i = P("../util/ModelUrls")
  16604. , n = P("../objects/BoundingTextureSkybox")
  16605. , s = P("../enum/Viewmode")
  16606. , l = P("../enum/RenderOrder")
  16607. , r = (P("../enum/AlignmentType"),
  16608. P("../objects/Floor"))
  16609. , c = P("./FloorCollection")
  16610. , h = P("../objects/Chunk")
  16611. , u = (P("../objects/Room"),
  16612. P("../objects/Snapshot"),
  16613. P("../label/Label"),
  16614. P("../util/math"),
  16615. P("../settings"))
  16616. , d = P("../shaders")
  16617. , p = P("../util/logger")
  16618. , f = (P("../tag/tag"),
  16619. P("../tag/tagManager"),
  16620. P("../objects/Panorama"))
  16621. , g = P("../util/PanoramaCollection")
  16622. , m = P("../loaders/ModelLoader")
  16623. , v = P("../loaders/ModelTextureLoader")
  16624. , y = P("../loaders/SweepDataLoader")
  16625. , A = P("../util/transitions")
  16626. , C = (P("../util/easing"),
  16627. P("../util/lerp"),
  16628. P("../util/common"))
  16629. , I = (P("../util/texture"),
  16630. P("./../util/browser"))
  16631. , E = P("./ImageCollection")
  16632. , _ = P("./RoomCollection")
  16633. , b = P("./LabelCollection")
  16634. , w = P("./Chunks")
  16635. , T = P("./../util/showcase")
  16636. , x = P("../exception/BasicException")
  16637. , S = (P("../constants"),
  16638. P("events").EventEmitter)
  16639. // , M = P("hot")
  16640. , R = new p(e);
  16641. t.prototype = Object.create(o.Object3D.prototype),
  16642. C.extend(t, S),
  16643. t.prototype.setupCustomProperties = function() {
  16644. var t = u.modelAlpha;
  16645. Object.defineProperty(this, "alpha", {
  16646. get: function() {
  16647. return t
  16648. },
  16649. set: function(e) {
  16650. t = e,
  16651. this.chunks.forEach(function(e) {
  16652. e.material && e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = t)
  16653. })
  16654. }
  16655. })
  16656. }
  16657. ,
  16658. t.prototype.configureTiling = function() {
  16659. var e = function() {
  16660. try {
  16661. var e = document.createElement("canvas")
  16662. , t = e.getContext("webgl");
  16663. return (t = t || e.getContext("experimental-webgl")).getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  16664. } catch (e) {
  16665. return 0
  16666. }
  16667. }();
  16668. if (e < 2048)
  16669. return !1;
  16670. R.warn("Max cube texture size: " + e);
  16671. for (var t = 0; t < u.tiling.tilingFlagNames.length; t++) {
  16672. var i = u.tiling.tilingFlagNames[t];
  16673. if ("1" === I.valueFromHash(i, null))
  16674. return !0;
  16675. if ("0" === I.valueFromHash(i, null))
  16676. return !1
  16677. }
  16678. return !!T.modelDataPromisesTiles(this.data)
  16679. }
  16680. ,
  16681. t.prototype.toggleAlpha = function() {
  16682. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  16683. }
  16684. ,
  16685. t.prototype.load = function(e) {
  16686. var t = this.urls.init().then(function() {
  16687. return $.when(this.loadPanos(), this.loadMesh())
  16688. }
  16689. .bind(this));
  16690. return e ? t = t.then(this.loadMeshTextures.bind(this)) : t.then(this.loadMeshTextures.bind(this)),
  16691. this.auxDataPromise = $.when(this.loadhots(), this.loadLabels()),
  16692. $.when(t, this.auxDataPromise).done(this.build.bind(this))
  16693. }
  16694. ,
  16695. t.prototype.loadMesh = function() {
  16696. var n = $.Deferred()
  16697. , r = this;
  16698. return m.load(r.data.job.uuid, r.urls, function(e, t) {
  16699. if (0 === e.length) {
  16700. R.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  16701. r.supportedModes[s.DOLLHOUSE] = !1,
  16702. r.supportedModes[s.FLOORPLAN] = !1;
  16703. var i = new h({
  16704. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  16705. });
  16706. i.material.visible = !1,
  16707. i.rotateX(-Math.PI / 2),
  16708. i.geometry.computeBoundingBox(),
  16709. e = [i]
  16710. }
  16711. e.forEach(function(e) {
  16712. var t = r.floorsEnabled ? w.parseFloor(e.name) : 0;
  16713. r.addChunk(t, e)
  16714. }),
  16715. r.floors.sort(),
  16716. n.resolve(r)
  16717. }, function(e, t) {
  16718. n.notify(e, t)
  16719. }, function(e) {
  16720. R.error(e),
  16721. n.reject("loading-failed")
  16722. }),
  16723. n.promise()
  16724. }
  16725. ,
  16726. t.prototype.loadMeshTextures = function() {
  16727. return this.loadTexturesPromise || (this.loadTexturesPromise = v.load(this, this.meshTextures).then(function() {
  16728. this.meshTexturesLoaded = !0
  16729. }
  16730. .bind(this))),
  16731. this.loadTexturesPromise
  16732. }
  16733. ,
  16734. t.prototype.loadhots = function() {
  16735. initHot(this)
  16736. var r = $.Deferred()
  16737. , e = g_Prefix + "data/" + this.sid + "/data2.js?" + randomTime().getTime();
  16738. return a.get(e, {
  16739. responseType: "json",
  16740. auth: this.isPublic ? null : u.authorizationHeader
  16741. }).done(function(e) {
  16742. window.data2 = e;
  16743. this.roomLabels = []
  16744. if(!e){
  16745. console.error("data2 is null")
  16746. }else{
  16747. g_data2 = hotMatcher(e)
  16748. this.hotsCount = 0;
  16749. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  16750. let create = ()=>{
  16751. //alertInfo('开始计算',{dontAutoClose:true, hideCloseBtn:true, name:'getPanoVisibles'}); //暂时没找到很多热点要计算的场景
  16752. if(e.hots){
  16753. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  16754. sids.forEach((sid)=>{
  16755. e.hots[sid].sid = sid
  16756. if(e.hots[sid].texType == 'photo' && !e.hots[sid].texSrc)return console.error('有photo热点无texSrc',e.hots[sid])
  16757. new Hot(e.hots[sid], e.hots[sid].version != 'multi' && "byHot" )
  16758. })
  16759. }
  16760. if(e.overlays){
  16761. e.overlays.forEach((info)=>{
  16762. new Hot(info, 'byOverlay')
  16763. })
  16764. }
  16765. Hot.createHotList();
  16766. if(DATA.roomLabels){
  16767. DATA.roomLabels.forEach((data)=>{
  16768. this.roomLabels.push(new RoomLabel(data))
  16769. })
  16770. }
  16771. //alertClose('getPanoVisibles');
  16772. Hot.startLoad()
  16773. editTool.loadDone('data2', e)
  16774. }
  16775. if(player.currentPano){
  16776. create()
  16777. }else{
  16778. let f = ()=>{
  16779. window.bus.removeEventListener('playerAndModelReady',f)
  16780. create()
  16781. }
  16782. window.bus.addEventListener('playerAndModelReady',f)
  16783. }
  16784. e.weixinDesc && (g_weixinObj.desc = e.weixinDesc)
  16785. }
  16786. r.resolve()
  16787. }
  16788. .bind(this)).fail(function() {
  16789. console.log("没有热点"),
  16790. editTool.loadDone('data2', null)
  16791. r.resolve()
  16792. }),
  16793. r
  16794. }
  16795. ,
  16796. t.prototype.loadPanos = function() {
  16797. if (this.loadPanosPromise)
  16798. return this.loadPanosPromise;
  16799. var e = new y(this);
  16800. return this.loadPanosPromise = e.load().then(function(e) {
  16801. window.panoListOriData = e.map(a=>a.uuid) //包括!enabled的点
  16802. return this.data.sweeps && 0 < Object.keys(this.data.sweeps).length && (e = e.filter(function(e) {
  16803. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  16804. else console.log(e.uuid)
  16805. //return this.data.sototype.loadOverlaysweeps[e.uuid].enabled
  16806. }
  16807. .bind(this))),
  16808. this.panos.extend(e.map(function(e) {
  16809. return new f(this,e.uuid,e,this.supportsTiles)
  16810. }
  16811. .bind(this))),
  16812. this.panos.forEach(function(i) {
  16813. i.neighbourUUIDs && (i.neighbourUUIDs.forEach(function(e) {
  16814. var t = this.panos.get(e);
  16815. t && this.panos.setNeighbour(i, t, !0)
  16816. }
  16817. .bind(this)),
  16818. i.neighbourPanos = this.panos.getNeighbours(i) || this.panos.setNeighbour(i, i, !0))
  16819. }
  16820. .bind(this)),
  16821. 0 === this.panos.length && (R.warn("Model has no panos, turning off inside mode"),
  16822. this.supportedModes[s.PANORAMA] = !1),
  16823. $.when(this)
  16824. }
  16825. .bind(this)),
  16826. this.loadPanosPromise
  16827. }
  16828. ,
  16829. t.prototype.loadHighlightReel = function() {
  16830. var t = $.Deferred()
  16831. , e = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  16832. return a.get(e, {
  16833. responseType: "json",
  16834. auth: this.isPublic ? null : u.authorizationHeader
  16835. }).done(function(e) {
  16836. e.reel ? (R.info("Got highlight reel with " + e.reel.length + " items"),
  16837. this.images.filterByModesAndReel(this.supportedModes, e.reel)) : R.info("No highlight reel found"),
  16838. t.resolve()
  16839. }
  16840. .bind(this)).fail(function() {
  16841. R.warn("Getting highlight reel failed, no highlights available"),
  16842. t.resolve()
  16843. }),
  16844. t
  16845. }
  16846. ,
  16847. t.prototype.waitForLoad = function(e, t) {
  16848. t() || (this.waitQueue.push({
  16849. object: e,
  16850. isLoadedCallback: t
  16851. }),
  16852. 1 === this.waitQueue.length && this.emit("waiting"))
  16853. }
  16854. ,
  16855. t.prototype.hide = function() {
  16856. this.floors.hide()
  16857. }
  16858. ,
  16859. t.prototype.show = function() {
  16860. this.floors.show()
  16861. }
  16862. ,
  16863. t.prototype.floorNames = function() {
  16864. return this.floors.names()
  16865. }
  16866. ,
  16867. t.prototype.warpDestFloors = function(e, t) {
  16868. if (e && this.floors.length === e.length) {
  16869. var i = e.findIndex(function(e) {
  16870. return e
  16871. }
  16872. .bind(this));
  16873. -1 !== i && this.setFloor(this.floors.list[i], null, t)
  16874. } else
  16875. this.toggleAllFloors(!0)
  16876. }
  16877. ,
  16878. t.prototype.setFloor = function(e, t, i) {
  16879. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  16880. this.allFloorsVisible = !1,
  16881. this._setFloor(e, t, i)
  16882. }
  16883. ,
  16884. t.prototype.toggleAllFloors = function(e) {
  16885. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  16886. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  16887. this._setFloor(this.currentFloor)
  16888. }
  16889. ,
  16890. t.prototype._setFloor = function(e, t, i) {
  16891. var n;
  16892. if (t = t || this.mode,
  16893. this.emit("floor.changed", e, t, this.currentFloor),
  16894. this.currentFloor = e,
  16895. t === s.PANORAMA) {
  16896. if (this.show(),
  16897. this.shouldShowtags && this.tagsShown)
  16898. for (n in this.tags)
  16899. this.tags[n].show(u.showFloorDuration)
  16900. } else if ((t === s.FLOORPLAN || t === s.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  16901. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  16902. }
  16903. .bind(this)),
  16904. this.shouldShowtags && this.tagsShown))
  16905. for (n in this.tags) {
  16906. var r = this.tags[n];
  16907. this.allFloorsVisible ? r.show(u.showFloorDuration) : r.floor === this.currentFloor ? r.show(u.showFloorDuration, u.showFloorDelay) : r.hide(u.hideFloorDuration, u.hideFloorDelay)
  16908. }
  16909. var o = this
  16910. , a = e;
  16911. A.start(function() {}, u.showFloorDelay, function() {
  16912. o.floors.forEach(function(t) {
  16913. t.chunks.forEach(function(e) {
  16914. e.renderOrder = t === a ? l.visibleFloor : l.ghostFloor
  16915. })
  16916. })
  16917. }
  16918. .bind(this))
  16919. }
  16920. ,
  16921. t.prototype.toggleExplode = function() {
  16922. this.floors.toggleExplodeHorizontal()
  16923. }
  16924. ,
  16925. t.prototype.toggleExplodeUp = function() {
  16926. this.floors.toggleExplodeVertical()
  16927. }
  16928. ,
  16929. t.prototype.nextFloor = function(e) {
  16930. return this.floors.nextFloor(this.currentFloor, e)
  16931. }
  16932. ,
  16933. t.prototype.addFloor = function(e) {
  16934. this.floors.add(e)
  16935. }
  16936. ,
  16937. t.prototype.getFloorAtPoint = function(e) {
  16938. return this.floors.getFloorAtPoint(e)
  16939. }
  16940. ,
  16941. t.prototype.getTagBySid = function(e) {
  16942. return this.tags[e]
  16943. }
  16944. ,
  16945. t.prototype.addChunk = function(e, t) {
  16946. this.floors.getOrMakeFloor(e).addChunk(t),
  16947. this.chunks.push(t)
  16948. }
  16949. ,
  16950. t.prototype.setMode = function(t) {
  16951. if (!this.supportedModes[t])
  16952. throw new x("Mode not supported for this model: " + t);
  16953. this.mode = t
  16954. this.skybox.material.transparent = t == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  16955. this.chunks.forEach(function(e) {
  16956. e.setMode(t)
  16957. })
  16958. }
  16959. ,
  16960. t.prototype.build = function() {
  16961. this.heroLocations = this.images.getHeroLocations(this.panos);
  16962. var e = function() {
  16963. 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()
  16964. }
  16965. .bind(this)();
  16966. this.has360Views = u.show360Views.enabled && this.heroLocations.some(function(e) {
  16967. return e.cameraMode === s.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  16968. }
  16969. .bind(this)) || e,
  16970. null === this.heroImage && R.warn("No hero image defined."),
  16971. this.currentFloor = this.floors.last(),
  16972. this.floors.build(),
  16973. this.colliders = this.floors.reduce(function(e, t) {
  16974. return e.concat(t.collider.children)
  16975. }, []),
  16976. this.panos.forEach(function(e) {
  16977. e.build1(),
  16978. e.on("enter", function() {
  16979. e.floor !== this.currentFloor && this.setFloor(e.floor)
  16980. }
  16981. .bind(this))
  16982. }
  16983. .bind(this))
  16984. let downVec = new THREE.Vector3(0,-1,0)
  16985. this.panos.forEach((pano)=>{
  16986. player.raycaster.set(pano.position, downVec);
  16987. let collider = pano.floor.collider.children
  16988. let n = player.raycaster.intersectObjects(collider , true );//add true
  16989. if(n && n[0]){
  16990. if(n[0].point.y - pano.floorPosition.y > 0.03){
  16991. //console.error(`${pano.id}, 探测高度${n[0].point.y.toPrecision(5)} 原高度 ${pano.floorPosition.y.toPrecision(5)}, 相差 ${(n[0].point.y - pano.floorPosition.y).toPrecision(5)}`)
  16992. pano.originFloorY = pano.floorPosition.y
  16993. pano.floorPosition.y = n[0].point.y
  16994. }
  16995. }
  16996. //是否需要排除一下相差过高的?因为可能探测到的是长椅这样的
  16997. })
  16998. this.panos.forEach(function(e) {
  16999. e.build2()
  17000. }),
  17001. this.floors.forEach(function(e) {
  17002. this.boundingBox.union(e.boundingBox)
  17003. }
  17004. .bind(this)),
  17005. this.size = this.boundingBox.size(),
  17006. this.center = this.boundingBox.center(),
  17007. this.floors.forEach(function(e) {
  17008. R.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17009. }
  17010. .bind(this)),
  17011. this.panos.populate_path_graph(),
  17012. this.skybox = new n(this.boundingBox),
  17013. this.skybox.matrixWorldNeedsUpdate = !0,
  17014. this.add(this.skybox)
  17015. //因为一部分漫游点在模型外
  17016. {
  17017. let bounding = new THREE.Box3 //不包含pano的bound
  17018. this.floors.list.forEach(floor=>{
  17019. bounding.union(floor.conservativeBoundingBox)
  17020. })
  17021. this.boundWithoutPanos = bounding
  17022. this.sizeWithoutPanos = bounding.size()
  17023. this.centerWithoutPanos = bounding.center()
  17024. /* 如果想居中模型, bound不加pano:
  17025. this.boundingBox = bounding
  17026. this.size = bounding.size()
  17027. this.center = bounding.center() */
  17028. }
  17029. return R.debug("Done building model"),
  17030. 0 < f.raycastsDone && (R.warn("raycasts: " + f.raycastsDone),
  17031. R.warn("raycasts skipped: " + f.raycastsSkipped)),
  17032. this.buildRooms(),
  17033. this.labels.associateWithRooms(this.rooms),
  17034. $.when(this)
  17035. }
  17036. ,
  17037. t.prototype.loadLabels = function() {
  17038. this.labels = new b(this);
  17039. var e = $.Deferred();
  17040. window.DATA.showingLabels ? this.showingLabels = true : '';
  17041. if (!this.showingLabels)
  17042. return e.resolve();
  17043. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  17044. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  17045. R.warn("Getting labels failed, not displaying labels."),
  17046. e.resolve()
  17047. }),
  17048. e
  17049. }
  17050. ,
  17051. t.prototype.buildRooms = function() {
  17052. this.rooms = new _(this),
  17053. this.rooms.createFromChunks(this.chunks),
  17054. this.rooms.calcRoomBoundaries()
  17055. }
  17056. ,
  17057. t.prototype.updateProjectedPanos = function() {
  17058. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17059. }
  17060. ,
  17061. t.prototype.setProjectedPanos = function(t, i, n) {
  17062. null != n || (n = !0),
  17063. n = !!n,
  17064. this.projectedPano0 = t,
  17065. this.projectedPano1 = i,
  17066. this.skybox.material.setProjectedPanos(t, i, n),
  17067. this.chunks.forEach(function(e) {
  17068. e.materialInside.setProjectedPanos(t, i, n)
  17069. })
  17070. }
  17071. ,
  17072. t.prototype.setSide = function(t) {
  17073. this.floors.forEach(function(e) {
  17074. e.collider.material.side = t
  17075. })
  17076. }
  17077. ,
  17078. t.prototype.heroCount = function() {
  17079. return this.heroLocations ? this.heroLocations.length : 0
  17080. }
  17081. ,
  17082. t.prototype.getHeroDescriptorByIndex = function(e=[]) {//改 因增加了二级目录
  17083. if (e[0] < 0)
  17084. return R.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17085. null;
  17086. if (this.heroCount() < 1)
  17087. return R.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17088. null;
  17089. var t = this.heroLocations[e[0]];
  17090. if(t.heroLocations && e[1]!=void 0){
  17091. t = t.heroLocations[e[1]];
  17092. }
  17093. return void 0 === t ? (R.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17094. null) : t
  17095. }
  17096. ,
  17097. t.prototype.findPanoramicHero = function() {
  17098. for (var e in this.heroLocations)
  17099. if (this.heroLocations[e].cameraMode === s.PANORAMA)
  17100. return this.heroLocations[e];
  17101. return null
  17102. }
  17103. ,
  17104. t.prototype.listImagePanos = function() {
  17105. var i = []
  17106. , n = this;
  17107. return this.images.forEach(function(e) {
  17108. if (e.metadata && e.metadata.scan_id) {
  17109. var t = n.panos.get(e.metadata.scan_id);
  17110. t && (n.supportsTiles || t.isLoaded("high") || i.push(t))
  17111. }
  17112. }),
  17113. i
  17114. }
  17115. ,
  17116. t.prototype.fadePanoMarkers = function(/* e, t */opacity, dur, o = {}) {//改
  17117. if(window.DATA.hideFloorMarker)return
  17118. var currentPano = player.currentPano
  17119. opacity = void 0 == opacity ? _settings.panorama.markerOpacity : opacity //不传opacity代表显示
  17120. var hideWhenFlyOut = () => {
  17121. var shows = [],
  17122. hides = []
  17123. player.model.panos.forEach(pano => {
  17124. hides.push(pano)
  17125. })
  17126. this.panos.fadeMarkerOpacity(0, dur, [{ toOp: 0, member: hides }])
  17127. }
  17128. if (opacity == 0) {
  17129. hideWhenFlyOut()
  17130. } else {
  17131. if (player.mode == 'panorama' && currentPano) {
  17132. var shows = [], hides = []
  17133. player.model.panos.forEach(pano => { //是邻近点就显示否则隐藏
  17134. if (currentPano.neighbourPanos[pano.id]) {
  17135. shows.push(pano)
  17136. } else {
  17137. hides.push(pano)
  17138. }
  17139. })
  17140. this.panos.fadeMarkerOpacity(opacity, dur, [
  17141. { toOp: opacity, member: shows },
  17142. { toOp: 0, member: hides },
  17143. ])
  17144. } else if (player.modeTran.split('-')[1] != 'panorama') {
  17145. //飞出后marker隐藏
  17146. hideWhenFlyOut()
  17147. }
  17148. }
  17149. }
  17150. ,
  17151. t.prototype.setSweepVisibility = function(t) {
  17152. this.panos.forEach(function(e) {
  17153. e.marker && (e.marker.visible = t)
  17154. })
  17155. }
  17156. ,
  17157. t.prototype.outsideAllowed = function() {
  17158. return this.supportedModes[s.DOLLHOUSE] && this.supportedModes[s.FLOORPLAN]
  17159. }
  17160. ,
  17161. O.exports = t
  17162. }
  17163. ).call(this, "/js/model/Model.js")
  17164. }
  17165. , {
  17166. "../constants": 8,
  17167. "../enum/AlignmentType": 17,
  17168. "../enum/RenderOrder": 42,
  17169. "../enum/Viewmode": 51,
  17170. "../exception/BasicException": 55,
  17171. "../label/Label": 90,
  17172. "../loaders/ModelLoader": 105,
  17173. "../loaders/ModelTextureLoader": 106,
  17174. "../loaders/SweepDataLoader": 107,
  17175. "../tag/tag": 123,
  17176. "../tag/tagManager": 124,
  17177. "../objects/BoundingTextureSkybox": 143,
  17178. "../objects/Chunk": 144,
  17179. "../objects/Floor": 146,
  17180. "../objects/Panorama": 148,
  17181. "../objects/Room": 150,
  17182. "../objects/Snapshot": 153,
  17183. "../settings": 166,
  17184. "../shaders": 167,
  17185. "../util/ModelUrls": 177,
  17186. "../util/PanoramaCollection": 178,
  17187. "../util/ajax": 181,
  17188. "../util/common": 185,
  17189. "../util/easing": 186,
  17190. "../util/lerp": 188,
  17191. "../util/logger": 189,
  17192. "../util/math": 190,
  17193. "../util/texture": 194,
  17194. "../util/transitions": 195,
  17195. "./../util/browser": 182,
  17196. "./../util/showcase": 193,
  17197. "./Chunks": 135,
  17198. "./FloorCollection": 136,
  17199. "./ImageCollection": 137,
  17200. "./LabelCollection": 138,
  17201. "./RoomCollection": 141,
  17202. events: 202,
  17203. three: 217,
  17204. //hot: "hot"
  17205. }],
  17206. 140: [function(e, t, i) {
  17207. "use strict";
  17208. function n() {
  17209. this.modelMap = {},
  17210. this.activeModel = null,
  17211. this.modelCount = 0,
  17212. this.tileDownloader = null,
  17213. this.panoRenderer = null
  17214. }
  17215. var r = (e("three"),
  17216. e("../util/common"))
  17217. , o = e("../exception/BasicException")
  17218. , a = e("../enum/ModelManagerEvents")
  17219. , s = e("../enum/PanoRendererEvents")
  17220. , l = e("events").EventEmitter;
  17221. n.prototype.init = function(e, t, i) {
  17222. this.tileDownloader = e,
  17223. this.panoRenderer = t,
  17224. this.qualityManager = i,
  17225. this.bindEvents()
  17226. }
  17227. ,
  17228. n.prototype.bindEvents = function() {
  17229. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17230. }
  17231. ,
  17232. n.prototype.onTileRendered = function(e, t, i, n) {}
  17233. ,
  17234. n.prototype.addModel = function(e) {
  17235. this.modelMap[e.sid] = e,
  17236. 0 === this.modelCount && this.activateModel(e.sid),
  17237. this.modelCount++,
  17238. this.emit(a.ModelAdded)
  17239. }
  17240. ,
  17241. n.prototype.getModel = function(e) {
  17242. return this.modelMap[e]
  17243. }
  17244. ,
  17245. n.prototype.activateModel = function(e) {
  17246. var t = this.modelMap[e];
  17247. if (!t)
  17248. throw new o("Tried to activate invalid model!");
  17249. var i = this.activeModel;
  17250. this.activeModel = t,
  17251. this.tileDownloader.setpanoData(t.panos, t.listImagePanos(), t.sid),
  17252. this.tileDownloader.setUrls(t.urls),
  17253. t.panos.forEach(function(e) {
  17254. e.attachToPanoRenderer(this.panoRenderer),
  17255. e.tileDownloader = this.tileDownloader,
  17256. e.qualityManager = this.qualityManager
  17257. }
  17258. .bind(this)),
  17259. this.emit(a.ActiveModelChanged, {
  17260. oldModel: i,
  17261. model: t
  17262. })
  17263. }
  17264. ,
  17265. n.prototype.getActiveModel = function() {
  17266. return this.activeModel
  17267. }
  17268. ,
  17269. r.extend(n, l),
  17270. t.exports = n
  17271. }
  17272. , {
  17273. "../enum/ModelManagerEvents": 33,
  17274. "../enum/PanoRendererEvents": 35,
  17275. "../exception/BasicException": 55,
  17276. "../util/common": 185,
  17277. events: 202,
  17278. three: 217
  17279. }],
  17280. 141: [function(r, l, e) {
  17281. (function(e) {
  17282. "use strict";
  17283. function o() {
  17284. n.call(this)
  17285. }
  17286. var a = r("../objects/Room")
  17287. , t = (r("../settings"),
  17288. r("../util/logger"))
  17289. , i = (r("../util/transitions"),
  17290. r("../util/easing"),
  17291. r("../util/common"))
  17292. , n = r("../util/IndexedCollection")
  17293. , s = r("./Chunks");
  17294. new t(e),
  17295. i.inherit(o, n),
  17296. o.prototype.getIndex = function(e) {
  17297. return e.roomId
  17298. }
  17299. ,
  17300. o.prototype.calcRoomBoundaries = function() {
  17301. this.forEach(function(e) {
  17302. e.calcBoundaries()
  17303. })
  17304. }
  17305. ,
  17306. o.prototype.createFromChunks = function(e) {
  17307. var n = {
  17308. floorId: -1,
  17309. roomId: -1
  17310. }
  17311. , r = {};
  17312. e.forEach(function(e) {
  17313. s.parseIdsFromChunkName(e.name, n);
  17314. var t = r[n.roomId];
  17315. if (!t) {
  17316. var i = o.generateRoomId(n.floorId, n.roomId);
  17317. t = new a(n.floorId,i),
  17318. this.add(t),
  17319. r[n.roomId] = t
  17320. }
  17321. t.addChunk(e)
  17322. }
  17323. .bind(this)),
  17324. this.calcRoomBoundaries()
  17325. }
  17326. ,
  17327. o.generateRoomId = function(e, t) {
  17328. return e + "_" + t
  17329. }
  17330. ,
  17331. l.exports = o
  17332. }
  17333. ).call(this, "/js/model/RoomCollection.js")
  17334. }
  17335. , {
  17336. "../objects/Room": 150,
  17337. "../settings": 166,
  17338. "../util/IndexedCollection": 175,
  17339. "../util/common": 185,
  17340. "../util/easing": 186,
  17341. "../util/logger": 189,
  17342. "../util/transitions": 195,
  17343. "./Chunks": 135
  17344. }],
  17345. 142: [function(e, t, i) {
  17346. "use strict";
  17347. function n(e, t, i) {
  17348. var n = (e = e.clone().expandByScalar(0.01)).size()
  17349. , r = new o.BoxGeometry(n.x,n.y,n.z);
  17350. r.boundingBox = e,
  17351. o.Mesh.call(this, r, t),
  17352. this.position.copy(e.center()),
  17353. this.frustumCulled = !1,
  17354. i && this.add(new o.WireframeHelper(this))
  17355. }
  17356. var o = e("three");
  17357. (n.prototype = Object.create(o.Mesh.prototype)).constructor = n,
  17358. t.exports = n
  17359. }
  17360. , {
  17361. three: 217
  17362. }],
  17363. 143: [function(l, c, e) {
  17364. (function(e) {
  17365. "use strict";
  17366. function t(e) {
  17367. s.time("Computing a nice bounding cubemap");
  17368. var t = new r({
  17369. side: i.BackSide,
  17370. transparent: !0
  17371. });
  17372. t.uniforms.modelAlpha.value = 0,
  17373. t.uniforms.opacity.value = 1 - o.modelAlpha,
  17374. this.renderOrder = a.boundingSkybox,
  17375. n.call(this, e, t),
  17376. s.timeEnd("Computing a nice bounding cubemap")
  17377. }
  17378. var i = l("three")
  17379. , n = (l("../enum/Viewmode"),
  17380. l("../shaders"),
  17381. l("./BoundingMesh"))
  17382. , r = l("../materials/ModelTextureMaterial")
  17383. , o = l("../settings")
  17384. , a = l("../enum/RenderOrder")
  17385. , s = new (l("../util/logger"))(e);
  17386. (t.prototype = Object.create(n.prototype)).constructor = t,
  17387. c.exports = t
  17388. }
  17389. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17390. }
  17391. , {
  17392. "../enum/RenderOrder": 42,
  17393. "../enum/Viewmode": 51,
  17394. "../materials/ModelTextureMaterial": 118,
  17395. "../settings": 166,
  17396. "../shaders": 167,
  17397. "../util/logger": 189,
  17398. "./BoundingMesh": 142,
  17399. three: 217
  17400. }],
  17401. 144: [function(e, t, i) {
  17402. "use strict";
  17403. function n(e) {
  17404. this.materialInside = new s({
  17405. side: r.DoubleSide
  17406. });
  17407. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17408. this.materialOutside = new r.RawShaderMaterial({
  17409. fragmentShader: o.modelOutside.fragmentShader,
  17410. vertexShader: o.modelOutside.vertexShader,
  17411. uniforms: t,
  17412. side: r.FrontSide,
  17413. name: "chunkOut"
  17414. }),
  17415. r.Mesh.call(this, e.geometry, this.materialInside),
  17416. this.name = e.name || "",
  17417. this.textureName = e.textureName,
  17418. this.meshUrl = e.meshUrl
  17419. }
  17420. var r = e("three")
  17421. , o = e("../shaders")
  17422. , a = e("../enum/Viewmode")
  17423. , s = e("../materials/ModelTextureMaterial");
  17424. (n.prototype = Object.create(r.Mesh.prototype)).setTextureMap = function(e) {
  17425. this.materialInside.uniforms.map.value = e,
  17426. this.materialOutside.uniforms.map.value = e
  17427. }
  17428. ,
  17429. n.prototype.setMode = function(e) {
  17430. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17431. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17432. t.transparent = this.material.transparent,
  17433. t.uniforms.opacity.value = this.material.uniforms.opacity.value;
  17434. this.material = t
  17435. }
  17436. ,
  17437. t.exports = n
  17438. }
  17439. , {
  17440. "../enum/Viewmode": 51,
  17441. "../materials/ModelTextureMaterial": 118,
  17442. "../shaders": 167,
  17443. three: 217
  17444. }],
  17445. 145: [function(e, t, i) {
  17446. "use strict";
  17447. function n(e) {
  17448. this.chunksize = e || 10,
  17449. this.chunks = {},
  17450. this.boundingBoxes = {},
  17451. this.children = [],
  17452. this.offset = new m.Vector3(0,.5,0),
  17453. this.material = new m.MeshBasicMaterial({
  17454. color: 16777215 * Math.random(),
  17455. side: m.DoubleSide
  17456. })
  17457. }
  17458. var m = e("three");
  17459. e("../enum/Viewmode"),
  17460. n.prototype.add = function(e) {
  17461. var t, i, n, r, o, a, s, l, c, h, u = e.attributes;
  17462. u ? (t = u.position.array,
  17463. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  17464. e.faces);
  17465. var d = new m.Vector3;
  17466. if (i)
  17467. for (n = 0,
  17468. r = i.length; n < r; n += 3) {
  17469. var p = 3 * i[n]
  17470. , f = 3 * i[n + 1]
  17471. , g = 3 * i[n + 2];
  17472. o = (t[p] + t[f] + t[g]) / 3,
  17473. a = (t[1 + p] + t[1 + f] + t[1 + g]) / 3,
  17474. s = (t[2 + p] + t[2 + f] + t[2 + g]) / 3,
  17475. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17476. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17477. this.boundingBoxes[l] = new m.Box3),
  17478. h.push(t[p], t[1 + p], t[2 + p], t[f], t[1 + f], t[2 + f], t[g], t[1 + g], t[2 + g]),
  17479. c.expandByPoint(d.set(t[p], t[1 + p], t[2 + p])),
  17480. c.expandByPoint(d.set(t[f], t[1 + f], t[2 + f])),
  17481. c.expandByPoint(d.set(t[g], t[1 + g], t[2 + g]))
  17482. }
  17483. else
  17484. for (n = 0,
  17485. r = t.length; n < r; n += 9)
  17486. o = (t[n] + t[n + 3] + t[n + 6]) / 3,
  17487. a = (t[n + 1] + t[n + 4] + t[n + 7]) / 3,
  17488. s = (t[n + 2] + t[n + 5] + t[n + 8]) / 3,
  17489. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17490. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17491. this.boundingBoxes[l] = new m.Box3),
  17492. h.push(t[n], t[n + 1], t[n + 2], t[n + 3], t[n + 4], t[n + 5], t[n + 6], t[n + 7], t[n + 8]),
  17493. c.expandByPoint(d.set(t[n], t[n + 1], t[n + 2])),
  17494. c.expandByPoint(d.set(t[n + 3], t[n + 4], t[n + 5])),
  17495. c.expandByPoint(d.set(t[n + 6], t[n + 7], t[n + 8]))
  17496. }
  17497. ,
  17498. n.prototype.build = function() {
  17499. var e = new m.Object3D;
  17500. for (var t in e.material = this.material,
  17501. this.chunks) {
  17502. var i = this.chunks[t]
  17503. , n = new m.BufferGeometry;
  17504. n.addAttribute("position", new m.BufferAttribute(new Float32Array(i),3)),
  17505. n.boundingBox = this.boundingBoxes[t];
  17506. var r = new m.Mesh(n,this.material);
  17507. r.material.visible = !1,
  17508. e.add(r),
  17509. this.chunks[t] = []
  17510. }
  17511. return e
  17512. }
  17513. ,
  17514. t.exports = n
  17515. }
  17516. , {
  17517. "../enum/Viewmode": 51,
  17518. three: 217
  17519. }],
  17520. 146: [function(e, t, i) {
  17521. "use strict";
  17522. var n = e("three")
  17523. , r = e("../settings")
  17524. , o = e("../util/common")
  17525. , a = e("../util/lerp")
  17526. , s = e("./ChunkedCollider")
  17527. , l = e("../util/transitions")
  17528. , c = e("../util/easing")
  17529. , h = (e("../objects/Panorama"),
  17530. e("../enum/RenderOrder"));
  17531. e("../localization/localize");
  17532. function u(e, t, i) {
  17533. n.Object3D.call(this),
  17534. this.model = e,
  17535. this.floorIndex = t,
  17536. this.lang = r.languageTag,
  17537. this.name = i || "cn" === r.languageTag ? "Floor " + (t + 1) : "第" + (t + 1) + "层",
  17538. this.panos = [],
  17539. this.chunks = [],
  17540. this.colliderBuilder = new s(3),
  17541. this.collider = null,
  17542. this.center = null,
  17543. this.boundingBox = new n.Box3,
  17544. this.size = null,
  17545. this.hidden = !1,
  17546. this.conservativeBoundingBox = new n.Box3,
  17547. this.debugColor = 16777215 * Math.random(),
  17548. this.transition = null
  17549. }
  17550. (u.prototype = Object.create(n.Object3D.prototype)).enter = function(e) {
  17551. this.model.setFloor(this, e)
  17552. }
  17553. ,
  17554. u.prototype.hide = function(e) {
  17555. if (!this.hidden || this.transition) {
  17556. this.chunks.forEach(function(e) {
  17557. e.material.transparent = !0
  17558. }),
  17559. l.cancel(this.transition);
  17560. var t = e ? 0 : r.hideFloorDuration + r.hideFloorDelay
  17561. , i = e ? 0 : r.hideFloorDelay / t;
  17562. this.transition = l.start(a.allUniforms(this.chunks, "opacity", .08), t, function() {
  17563. this.hidden = !0
  17564. }
  17565. .bind(this), i, c.easeInOutQuad)
  17566. }
  17567. }
  17568. ,
  17569. u.prototype.show = function(e) {
  17570. if (this.hidden || this.transition) {
  17571. this.hidden = !1,
  17572. l.cancel(this.transition);
  17573. var t = e ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay
  17574. , i = e ? 0 : r.showFloorDelay / t;
  17575. this.transition = l.start(a.allUniforms(this.chunks, "opacity", 1), t, function() {
  17576. this.hidden || this.chunks.forEach(function(e) {
  17577. e.material.transparent = !1
  17578. })
  17579. }
  17580. .bind(this), i, c.easeInOutQuad)
  17581. }
  17582. }
  17583. ,
  17584. u.prototype.toggle = function(e, t) {
  17585. (e = void 0 === e ? this.hidden : e) ? this.show(t) : this.hide(t)
  17586. }
  17587. ,
  17588. u.prototype.containsPoint = function(t) {
  17589. return this.collider.children.some(function(e) {
  17590. return e.geometry.boundingBox || e.geometry.computeBoundingBox(),
  17591. e.geometry.boundingBox.containsPoint(t)
  17592. })
  17593. }
  17594. ,
  17595. u.prototype.distanceToPoint = function(i) {
  17596. var n = null
  17597. , r = 1 / 0;
  17598. return this.collider.children.forEach(function(e) {
  17599. e.geometry.boundingBox || e.geometry.computeBoundingBox();
  17600. var t = e.geometry.boundingBox.distanceToPoint(i);
  17601. (!n || t < r) && (r = t,
  17602. n = e)
  17603. }),
  17604. r
  17605. }
  17606. ,
  17607. u.prototype.addChunk = function(e) {
  17608. e.renderOrder = h.ghostFloor,
  17609. this.add(e),
  17610. this.chunks.push(e),
  17611. this.boundingBox.union(e.geometry.boundingBox),
  17612. this.size = this.boundingBox.size(),
  17613. this.colliderBuilder.add(e.geometry)
  17614. }
  17615. ,
  17616. u.prototype.addPano = function(e) {
  17617. this.panos.push(e),
  17618. this.add(e.skyboxMesh),
  17619. e.marker && this.add(e.marker);
  17620. if(e.neighbourUUIDs && e.neighbourUUIDs.length){//add 有相邻点才算入bound 因为拍摄有bug,会出现floorPosition为000,且position位置很偏的点,它们一般都是不可见点。
  17621. var t = new n.Vector3(1,1,1)
  17622. , i = (new n.Box3).setFromCenterAndSize(e.position, t);
  17623. this.boundingBox.union(i)
  17624. }
  17625. }
  17626. ,
  17627. u.prototype.build = function() {
  17628. this.collider = this.colliderBuilder.build(!0),
  17629. this.add(this.collider),
  17630. this.center = this.boundingBox.center(),
  17631. this.conservativeBoundingBox.copy(this.boundingBox),
  17632. this.conservativeBoundingBox.min.y = o.lowerMedian(this.collider.children.map(function(e) {
  17633. return e.geometry.boundingBox.min.y
  17634. }), 5),
  17635. this.conservativeBoundingBox.max.y = o.lowerMedian(this.collider.children.map(function(e) {
  17636. return e.geometry.boundingBox.max.y
  17637. }), 5),
  17638. this.colliderBuilder = null
  17639. }
  17640. ,
  17641. u.prototype.toShortString = function() {
  17642. return o.nth(this.floorIndex + 1)
  17643. }
  17644. ,
  17645. u.prototype.toString = function() {
  17646. return this.name
  17647. }
  17648. ,
  17649. t.exports = u
  17650. }
  17651. , {
  17652. "../enum/RenderOrder": 42,
  17653. "../localization/localize": 108,
  17654. "./strings-cn-CN": 109,
  17655. "../objects/Panorama": 148,
  17656. "../settings": 166,
  17657. "../util/common": 185,
  17658. "../util/easing": 186,
  17659. "../util/lerp": 188,
  17660. "../util/transitions": 195,
  17661. "./ChunkedCollider": 145,
  17662. three: 217
  17663. }],
  17664. 147: [function(e, t, i) {
  17665. "use strict";
  17666. function n(e) {
  17667. this.player = e,
  17668. this.obj3d = null,
  17669. this.UP = new u.Vector3(0,1,0)
  17670. }
  17671. var u = e("three")
  17672. , d = e("../settings");
  17673. n.prototype.prefs = {
  17674. linewidth: 3,
  17675. height: .07,
  17676. opacity: .45,
  17677. endScale: .05
  17678. },
  17679. n.prototype.discard = function() {
  17680. if (this.obj3d) {
  17681. var e = this.obj3d.parent;
  17682. e && e.remove(this.obj3d)
  17683. }
  17684. this.obj3d = null
  17685. }
  17686. ,
  17687. n.prototype.draw = function() {
  17688. if (this.discard(),
  17689. d.showNeighbors) {
  17690. var e = this.player.currentPano.floor;
  17691. this.obj3d = new u.Object3D;
  17692. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  17693. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  17694. i.y += this.prefs.height;
  17695. var n = .1525
  17696. , r = new u.Matrix4;
  17697. for (var o in t)
  17698. if (t[o]) {
  17699. var a = this.player.model.panos.get(o)
  17700. , s = (a.position.clone().sub(this.player.model.position),
  17701. a.position.clone().sub(a.floorPosition))
  17702. , l = a.floorPosition.clone().sub(this.player.model.position);
  17703. l.y += this.prefs.height;
  17704. var c = new u.Geometry;
  17705. c.vertices.push(new u.Vector3(0,-.0127,0), new u.Vector3(-.0127,0,0), new u.Vector3(0,.0127,0), new u.Vector3(.0127,0,0), new u.Vector3(0,-.0127,0)),
  17706. c.vertices.push(new u.Vector3(0,-.255,0), new u.Vector3(.255,-.255,0), new u.Vector3(.255,n,0), new u.Vector3(-n,n,0), new u.Vector3(-n,.127,0), new u.Vector3(-.19,.1,0), new u.Vector3(-.19,-.2032,0), new u.Vector3(-n,-.2286,0), new u.Vector3(-n,-.255,0), new u.Vector3(0,-.255,0)),
  17707. r.identity().setPosition(s),
  17708. c.applyMatrix(r),
  17709. c.vertices.push(new u.Vector3(0,-this.prefs.endScale,0)),
  17710. c.vertices.push(new u.Vector3(-this.prefs.endScale,-this.prefs.endScale,0), new u.Vector3(-this.prefs.endScale,this.prefs.endScale,0), new u.Vector3(this.prefs.endScale,this.prefs.endScale,0), new u.Vector3(this.prefs.endScale,-this.prefs.endScale,0)),
  17711. r.lookAt(l, i, this.UP).setPosition(l),
  17712. c.applyMatrix(r),
  17713. c.vertices.push(l, i);
  17714. var h = new u.Line(c,new u.LineBasicMaterial({
  17715. color: a.debugColor.getHex(),
  17716. transparent: !0,
  17717. opacity: this.prefs.opacity,
  17718. depthWrite: !1,
  17719. name: "sLine" + o,
  17720. linewidth: this.prefs.linewidth
  17721. }));
  17722. this.obj3d.add(h)
  17723. }
  17724. e.add(this.obj3d)
  17725. }
  17726. }
  17727. ,
  17728. n.prototype.update = function() {
  17729. d.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  17730. }
  17731. ,
  17732. t.exports = n
  17733. }
  17734. , {
  17735. "../settings": 166,
  17736. three: 217
  17737. }],
  17738. 148: [function(S, M, e) {
  17739. (function(e) {
  17740. "use strict";
  17741. function r(e, t, i, n) {
  17742. this.model = e,
  17743. this.id = t,
  17744. this.alignmentType = i.alignmentType || c.ALIGNED,
  17745. this.neighbourUUIDs = i.neighbours,
  17746. this.neighbourPanos = null,
  17747. this.floor = null,
  17748. this.floorIndex = i.floor,
  17749. this.failedLoadingAt = 0,
  17750. this.maxLoadRetries = 4,
  17751. this.origin = i.position.clone(),
  17752. this.position = this.alignmentType === c.UNALIGNED ? new s.Vector3(0,-5,0) : i.position.clone(),
  17753. this.quaternion = i.quaternion.clone(),
  17754. this.skyboxMesh = new s.Mesh(E),
  17755. this.skyboxMesh.position.copy(this.position),
  17756. this.skyboxMesh.quaternion.copy(this.quaternion),
  17757. this.skyboxMesh.name = "skybox",
  17758. this.skyboxMesh.visible = !1,
  17759. this.skyboxMesh.updateMatrix(),
  17760. this.skyboxMesh.updateMatrixWorld(),
  17761. this.marker = null,
  17762. this.showFloorMarker = this.showFloorMarker = !window.DATA.hideFloorMarker
  17763. if(this.isAligned() ){
  17764. this.marker = new s.Mesh(_,new s.MeshBasicMaterial({
  17765. map: b,
  17766. side: s.DoubleSide,
  17767. opacity: 0,
  17768. transparent: !0,
  17769. depthWrite: !1
  17770. })),
  17771. this.marker.visible = false //改:先不显示,之后根据opacity显示
  17772. this.marker.renderOrder = l.panoMarker,
  17773. this.marker.name = "marker",
  17774. (this.marker.pano = this).marker.layers.set(v.PANOMARKERS),
  17775. this.marker.updateMatrixWorld()
  17776. if(!window.DATA.hideFloorMarker){//xzw
  17777. let opa = this.marker.material.opacity
  17778. Object.defineProperty(this.marker.material, 'opacity', {
  17779. get: function () {
  17780. return opa
  17781. },
  17782. set: (o)=>{
  17783. opa = o
  17784. //if(o>0)console.log('o>0',this.pano.id)
  17785. convertTool.updateVisible(this.marker, 'hideWhenZeroOpa', o != 0)
  17786. },
  17787. })
  17788. }
  17789. a.colorMarkerOnLoad && this.on("load", function() {
  17790. this.marker.material.color.set(65280)
  17791. })
  17792. }
  17793. this.debugColor = (new s.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  17794. this.floorPosition = i.puck ? i.puck.clone() : null,
  17795. this.tiled = n,
  17796. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new s.Texture([null, null, null, null, null, null]),
  17797. this.solidSkybox.flipY = !1,
  17798. a.minimalMemoryMode && (this.solidSkybox.minFilter = s.LinearFilter,
  17799. this.solidSkybox.magFilter = s.LinearFilter,
  17800. this.solidSkybox.generateMipmaps = !1)),
  17801. this.zoomed = !1,
  17802. this.panoRenderer = null,
  17803. this.qualityManager = null,
  17804. this.tileDownloader = null,
  17805. this.tiledPanoRenderTarget = null,
  17806. this.minimumTiledPanoLoaded = !1,
  17807. this.highestPartialTileRenderOpCompleted = 0,
  17808. this.highestFullTileRenderOpCompleted = 0,
  17809. this.shouldRedrawOnBaseLoaded = !1,
  17810. this.lockUntilRenderingComplete = !1,
  17811. a.colorMarkerOnLoad && this.on("load", function() {
  17812. this.marker.material.color.set(65280)
  17813. }),
  17814. (e = new s.TextureLoader).setCrossOrigin(!0);
  17815. var r = e.load("images/texture.jpg");
  17816. if (this.vrMarker = new s.Mesh(new s.OctahedronGeometry(.1,0),new s.MeshLambertMaterial({
  17817. color: 16777215,
  17818. transparent: !0,
  17819. opacity: .75,
  17820. map: r
  17821. })),
  17822. this.vrMarker.boluoType = "vr",
  17823. this.vrMarker.position.z = 1,
  17824. this.vrMarker.enabled = !0,
  17825. this.vrMarker.visible = !1,
  17826. window.vrMarkers = window.vrMarkers || [],
  17827. window.vrMarkers.push(this.vrMarker),
  17828. this.marker && this.marker.add(this.vrMarker),
  17829. a.showAxis && (this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,1,0),new s.Vector3(0,0,0),1,255)),
  17830. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,0,1),new s.Vector3(0,0,0),1,16711680)),
  17831. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(1,0,0),new s.Vector3(0,0,0),1,65280))),
  17832. this.adjustAngleEnable) {
  17833. (i = new s.Quaternion).setFromAxisAngle(new s.Vector3(1,0,0), this.adjustAngleX),
  17834. this.skyboxMesh.quaternion.multiply(i);
  17835. var o = new s.Quaternion;
  17836. o.setFromAxisAngle(new s.Vector3(0,1,0), this.adjustAngleY),
  17837. this.skyboxMesh.quaternion.multiply(o),
  17838. (n = new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1), this.adjustAngleZ),
  17839. this.skyboxMesh.quaternion.multiply(n),
  17840. this.skyboxMesh.updateMatrix(),
  17841. this.skyboxMesh.updateMatrixWorld(),
  17842. this.model.updateProjectedPanos()
  17843. }
  17844. }
  17845. var i, t, s = S("three"), n = S("../util/logger"), a = S("../settings"), l = (S("../enum/Viewmode"),
  17846. S("../enum/RenderOrder")), c = S("../enum/AlignmentType"), o = (S("../util/common"),
  17847. S("../util/transitions")), h = S("../util/lerp"), u = S("../util/ajax"), d = S("../util/texture"), p = S("../util/panorama"), f = (S("../enum/TileDownloaderEvents"),
  17848. S("../enum/PanoramaEvents")), g = S("../enum/PanoRendererEvents"), m = S("../enum/PanoSizeClass"), v = S("../enum/RenderLayers"), y = (S("../scene/SceneRenderer"),
  17849. S("../enum/GLCubeFaces"),
  17850. S("../exception/BasicException")), A = S("../tile/TileUtils"), C = S("events").EventEmitter, I = new n(e), E = new s.SphereBufferGeometry(.1), _ = new s.PlaneBufferGeometry(.35,.35,1,1), b = d.load("images/marker.png");
  17851. b.anisotropy = 4; //add
  17852. (r.prototype = Object.create(C.prototype)).enter = (t = null,
  17853. function() {
  17854. this.setZoomed(!1),
  17855. this.emit("enter", {
  17856. oldPano: t,
  17857. newPano: this
  17858. }),
  17859. t = this
  17860. }
  17861. ),
  17862. r.prototype.exit = function() {
  17863. this.tiled ? (this.clearWaitDeferreds(),
  17864. this.minimumTiledPanoLoaded = !1,
  17865. this.tiledPanoRenderTarget = null,
  17866. this.setZoomed(!1),
  17867. this.panoRenderer.deactivateTiledPano(this),
  17868. this.highestPartialTileRenderOpCompleted = 0,
  17869. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  17870. this.solidSkybox.loaded = !1,
  17871. this.solidSkybox.version = 0),
  17872. this.emit("exit")
  17873. }
  17874. ,
  17875. r.prototype.hoverOn = function(e) {
  17876. this.marker && (o.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  17877. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  17878. }
  17879. ,
  17880. r.prototype.hoverOff = function(e) {
  17881. this.marker && o.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  17882. }
  17883. ,
  17884. r.prototype.build1 = function() {
  17885. this.floor = this.floor || this.model.floors.get(this.floorIndex) || (this.model.floors.list.length == 1 ? this.model.floors.list[0] : this.raycastToFindFloor()) || this.model.getFloorAtPoint(this.position), //改
  17886. this.floor.addPano(this)
  17887. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  17888. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  17889. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  17890. this.neighbourUUIDs = this.neighbourUUIDs || [] //add
  17891. }
  17892. ,
  17893. r.prototype.build2 = function() {
  17894. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  17895. this.height = this.position.distanceTo(this.floorPosition),
  17896. this.placeMarker()
  17897. }
  17898. ,
  17899. r.prototype.interpolateFloorPosition = function() {
  17900. var e = this.model.panos.filter(r.filters.isNeighbourPanoTo(this)).filter(function(e) {
  17901. return !!e.floorPosition
  17902. }).sort(function(e, t) {
  17903. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  17904. }
  17905. .bind(this))
  17906. , t = this.position.clone();
  17907. return 2 <= e.length ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  17908. t
  17909. }
  17910. ,
  17911. r.prototype.raycastFloorPosition = function() {
  17912. I.warn("Performance warning: Raycasting to find floor position");
  17913. var e = new s.Raycaster(this.position,new s.Vector3(0,-1,0)).intersectObjects(this.model.colliders);
  17914. return e.length ? e[0].point : null
  17915. }
  17916. ,
  17917. r.prototype.raycastToFindFloor = (i = [new s.Vector3(0,-1,0), new s.Vector3(1,-1,0), new s.Vector3(0,-1,1), new s.Vector3(-1,-1,0), new s.Vector3(0,-1,-1), new s.Vector3(1,0,0), new s.Vector3(0,0,1), new s.Vector3(-1,0,0), new s.Vector3(0,0,-1)],
  17918. function() {
  17919. I.warn("Performance warning: Raycasting to find floor index");
  17920. for (var e = 0; e < i.length; e++) {
  17921. var t = new s.Raycaster(this.position.clone(),i[e].clone()).intersectObjects(this.model.colliders);
  17922. if (t.length)
  17923. return t[0].object.parent.parent
  17924. }
  17925. return null
  17926. }
  17927. ),
  17928. r.prototype.placeMarker = function() {
  17929. this.marker && (this.marker.position.copy(this.floorPosition),
  17930. this.marker.position.y += .1, //经常有marker比地面低,所以多往上调5cm
  17931. this.marker.lookAt(new s.Vector3(0,1,0).add(this.marker.position)))
  17932. }
  17933. ,
  17934. r.prototype.translate = function(e) {
  17935. this.position.add(e),
  17936. this.floorPosition.add(e)
  17937. }
  17938. ,
  17939. r.prototype.findClosestMidtpointPanoTo = function(e) {
  17940. return (new s.Vector3).addVectors(this.position, e.position).divideScalar(2),
  17941. this.model.panos.find([r.filters.notIn([this, e])], [r.sortFunctions.distanceToPoint(point)])
  17942. }
  17943. ,
  17944. r.prototype.attachToPanoRenderer = function(e) {
  17945. this.panoRenderer = e,
  17946. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  17947. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  17948. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  17949. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  17950. }
  17951. ;
  17952. var w, T, x = {};
  17953. r.prototype.getWaitDeferred = function(e) {
  17954. var t = x[this.id];
  17955. t || (t = {},
  17956. x[this.id] = t);
  17957. var i = t[e];
  17958. return i || (i = {
  17959. deferred: $.Deferred(),
  17960. active: !1
  17961. },
  17962. t[e] = i),
  17963. i
  17964. }
  17965. ,
  17966. r.prototype.resetWaitDeferred = function(e) {
  17967. var t = this.getWaitDeferred(e);
  17968. t.active = !1,
  17969. t.deferred = $.Deferred()
  17970. }
  17971. ,
  17972. r.prototype.clearWaitDeferreds = function() {
  17973. var e = x[this.id];
  17974. for (var t in e || (e = {},
  17975. x[this.id] = e),
  17976. e)
  17977. if (e.hasOwnProperty(t)) {
  17978. var i = e[t];
  17979. i.active = !1,
  17980. i.deferred = $.Deferred()
  17981. }
  17982. }
  17983. ,
  17984. r.prototype.loadTiledPano = (new s.Vector3,
  17985. w = [],
  17986. T = [],
  17987. function(e, t, i, n, r, o) {
  17988. null != n || (n = !0),
  17989. null != r || (r = !0);
  17990. var a = this.getWaitDeferred(e)
  17991. , s = a.deferred
  17992. , l = null
  17993. , c = null;
  17994. if (i && ("number" == typeof i ? l = i : (l = i.hFov,
  17995. c = i.vFov)),
  17996. !this.isLoaded(e)) {
  17997. if (!a.active) {
  17998. if (a.active = !0,
  17999. i) {
  18000. var h = A.matchingTilesInDirection(this, e, t, l, c);
  18001. w[this.id + ":" + e] = {
  18002. tileCount: 0,
  18003. targetTileCount: h
  18004. },
  18005. I.info("Loading partial pano: " + this.id + " with " + h + " tiles")
  18006. }
  18007. T[this.id] || (T[this.id] = !0,
  18008. this.on(f.LoadComplete, function(e, t) {
  18009. var i = this.getWaitDeferred(e).deferred;
  18010. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  18011. this.resetWaitDeferred(e))
  18012. }
  18013. .bind(this)),
  18014. this.on(f.LoadFailed, function(e) {
  18015. var t = this.getWaitDeferred(e).deferred;
  18016. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  18017. this.resetWaitDeferred(e))
  18018. }
  18019. .bind(this)),
  18020. this.on(f.TileLoaded, function(e, t, i) {
  18021. var n = this.getWaitDeferred(e).deferred;
  18022. if (n && "pending" === n.state()) {
  18023. n.notify(e, t, i);
  18024. var r = w[this.id + ":" + e];
  18025. r && (r.tileCount++,
  18026. r.tileCount === r.targetTileCount && (this.onPanoRendered(this.id, e, i, !0),
  18027. n.resolve(e, i),
  18028. this.resetWaitDeferred(e)))
  18029. }
  18030. }
  18031. .bind(this)))
  18032. }
  18033. this.tileDownloader.clearForceQueue(),
  18034. this.tileDownloader.forceQueueTilesForPano(this, e, t, l, c, o),
  18035. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), n),
  18036. this.panoRenderer.renderPanoTiles(this.id, t, r)
  18037. }
  18038. return s.promise()
  18039. }
  18040. ),
  18041. r.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  18042. e === this.id && t === this.qualityManager.getPanoSize(m.BASE) && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  18043. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  18044. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  18045. }
  18046. ,
  18047. r.prototype.onTileRendered = function(e, t, i, n) {
  18048. e === this.id && this.emit(f.TileLoaded, t, i, n)
  18049. }
  18050. ,
  18051. r.prototype.onPanoRendered = function(e, t, i, n) {
  18052. e === this.id && (this.minimumTiledPanoLoaded = !0,
  18053. this.updateSkyboxForZoomLevel(),
  18054. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  18055. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  18056. this.emit("load", t),
  18057. this.model.emit("load", this),
  18058. this.emit(f.LoadComplete, t, i))
  18059. }
  18060. ,
  18061. r.prototype.setZoomed = function(e) {
  18062. this.zoomed = e,
  18063. this.updateSkyboxForZoomLevel()
  18064. }
  18065. ,
  18066. r.prototype.ensureSkyboxReadyForRender = function() {
  18067. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  18068. this.solidSkybox.loaded = !0)
  18069. }
  18070. ,
  18071. r.prototype.updateSkyboxForZoomLevel = function() {
  18072. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  18073. }
  18074. ,
  18075. r.prototype.getSkyboxTexture = function() {
  18076. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  18077. }
  18078. ,
  18079. r.prototype.onTileRenderFail = function(e, t, i) {
  18080. e === this.id && this.emit(f.LoadFailed, t)
  18081. }
  18082. ,
  18083. r.prototype.isLoaded = function(e) {
  18084. if (this.tiled) {
  18085. if (e && "string" == typeof e)
  18086. throw new y("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  18087. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  18088. }
  18089. if (e && "number" == typeof e)
  18090. throw new y("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  18091. return !!this.solidSkybox.high || e in this.solidSkybox
  18092. }
  18093. ,
  18094. r.prototype.loadCube = function(a) {
  18095. if (this.isLoaded(a))
  18096. return I.info("Skipping load of pano, already loaded"),
  18097. $.when();
  18098. this.emit("loading", a),
  18099. this.model.emit("loading", this);
  18100. var n = p.getCubemapUrls(this.model.urls, this.id, a)
  18101. , e = n.filter(function(e) {
  18102. return !e
  18103. });
  18104. "low" === a && 0 < e.length && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  18105. a = "high",
  18106. n = p.getCubemapUrls(this.model.urls, this.id, a));
  18107. var t = 0
  18108. , i = [0, 1, 2, 3, 4, 5].map(function(e, t, i) {
  18109. return u.getImage(n[t])
  18110. }
  18111. .bind(this));
  18112. return $.when(i[0], i[1], i[2], i[3], i[4], i[5]).then(function(e, t, i, n, r, o) {
  18113. return this.solidSkybox[a] = [e, t, i, n, r, o],
  18114. "high" !== a && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[a],
  18115. this.solidSkybox.low = null),
  18116. this.solidSkybox.needsUpdate = !0,
  18117. this.emit("load", a),
  18118. this.model.emit("load", this),
  18119. this
  18120. }
  18121. .bind(this), function() {
  18122. I.error("Downloading cubemap for pano", this.id, "failed"),
  18123. this.failedLoadingAt = Date.now()
  18124. }
  18125. .bind(this), function() {
  18126. return $.when(++t, 6)
  18127. })
  18128. }
  18129. ,
  18130. r.raycastsSkipped = 0,
  18131. r.raycastsDone = 0,
  18132. r.prototype.findNeighourPanos = function() {
  18133. return this.model.panos.setNeighbour(this.id, this.id, !1),
  18134. this.model.panos.forEach(function(e) {
  18135. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18136. var t = this.position.distanceTo(e.position);
  18137. if (t > a.panoramaNeighbourMaxDistance)
  18138. return this.model.panos.setNeighbour(this, e, !1),
  18139. void r.raycastsSkipped++;
  18140. var i = e.position.clone().sub(this.position).normalize()
  18141. , n = new s.Raycaster(this.position,i.clone(),0,t).intersectObjects(this.model.colliders);
  18142. r.raycastsDone++,
  18143. this.model.panos.setNeighbour(this, e, 0 === n.length),
  18144. a.showNeighbourRaycasts && (n.length ? this.floor.model.add(new s.ArrowHelper(i,this.position,n[0].distance,16711680)) : this.floor.model.add(new s.ArrowHelper(i,this.position,t,16777215,0,0)))
  18145. }
  18146. }
  18147. .bind(this)),
  18148. this.model.panos.neighbourMap[this.id]
  18149. }
  18150. ,
  18151. r.prototype.worldPosition = function() {
  18152. return this.position
  18153. }
  18154. ,
  18155. /*r.prototype.addTextSprite = function(text, color, parent, scale=1) {
  18156. this.removeTextSprite();
  18157. var ratio = 16;
  18158. var i = document.createElement("canvas")
  18159. , n = i.getContext("2d");
  18160. i.width = 1024,
  18161. i.height = i.width / ratio;
  18162. n.font = " 30px Arial",
  18163. n.fillStyle = "white";
  18164. var r = n.measureText(e).width;
  18165. n.fillText(e, (i.width - r) / 2, (i.height + 60) / 2);
  18166. var o = new s.Texture(i);
  18167. o.needsUpdate = !0;
  18168. var a = new s.SpriteMaterial({
  18169. map: o,
  18170. color: color || 16428055,
  18171. depthTest:false
  18172. });
  18173. this.text3d = new s.Sprite(a)
  18174. if(parent){
  18175. parent.add(this.text3d)
  18176. }else{
  18177. this.text3d.position.copy(this.skyboxMesh.position)
  18178. this.floor.add(this.text3d)
  18179. }
  18180. this.text3d.scale.y = scale/ratio
  18181. this.text3d.scale.x = scale
  18182. }
  18183. r.prototype.removeTextSprite = function() {
  18184. this.text3d && (this.text3d.parent.remove(this.text3d),
  18185. this.text3d.material.map.dispose(),
  18186. this.text3d = null)
  18187. } */
  18188. r.prototype.addTextSprite = function(text = this.id, color, parent, scale=1) {
  18189. this.removeTextSprite()
  18190. this.label = new TextSprite({
  18191. /* sizeInfo: {
  18192. minSize: 50,
  18193. maxSize: 300,
  18194. nearBound: 0.2,
  18195. farBound: Math.max(20, this.model.size.length() / 3),
  18196. farBoundPlan: 250,
  18197. }, */
  18198. renderOrder: 8,
  18199. backgroundColor:{r: 255, g: 255, b: 255, a: 0 },
  18200. textColor: { r: 255, g: 255, b: 255, a: 1 },
  18201. textshadowColor: '#888',
  18202. text,
  18203. fontsize: 20*scale,
  18204. })
  18205. if(color){
  18206. this.label.children[0].material.color.set(color)
  18207. }
  18208. if(parent){
  18209. parent.add(this.label)
  18210. this.label.position.z = 0.1
  18211. }else{
  18212. let position = this.floorPosition.clone()
  18213. position.y += 0.4
  18214. this.label.position.copy(position)
  18215. this.floor.add(this.label2)
  18216. }
  18217. }
  18218. ,
  18219. r.prototype.removeTextSprite = function() {
  18220. this.label && this.label.dispose()
  18221. }
  18222. ,
  18223. r.prototype.isAligned = function() {
  18224. return this.alignmentType === c.ALIGNED
  18225. }
  18226. ,
  18227. r.filters = {
  18228. inDirection: function(t, i, n) {
  18229. return function(e) {
  18230. return e.position.clone().sub(t).normalize().dot(i) > n
  18231. }
  18232. },
  18233. inFloorDirection: function(t, i, n) {
  18234. return function(e) {
  18235. return e.floorPosition.clone().sub(t).normalize().dot(i) > n
  18236. }
  18237. },
  18238. inPanoDirection: function(n, r, o) {
  18239. return o = a.navigation.panoScores ? a.navigation.filterStrictness : o,
  18240. function(e) {
  18241. var t = e.floorPosition.clone().sub(n).normalize()
  18242. , i = e.position.clone().sub(n).normalize();
  18243. return t.dot(r) > o || i.dot(r) > o
  18244. }
  18245. },
  18246. atFloor: function(t) {
  18247. return function(e) {
  18248. return !t || e.floor === t
  18249. }
  18250. },
  18251. not: function(t) {
  18252. return function(e) {
  18253. return e !== t
  18254. }
  18255. },
  18256. notIn: function(t) {
  18257. return function(e) {
  18258. return -1 === t.indexOf(e)
  18259. }
  18260. },
  18261. isLoaded: function() {
  18262. return function(e) {
  18263. return e.isLoaded()
  18264. }
  18265. },
  18266. isNotLoaded: function() {
  18267. return function(e) {
  18268. return !e.isLoaded()
  18269. }
  18270. },
  18271. isCloseEnoughTo: function(t, i) {
  18272. return function(e) {
  18273. return t.distanceTo(e.floorPosition) < i
  18274. }
  18275. },
  18276. hasMinimumHeightDifferenceTo: function(t, i) {
  18277. return function(e) {
  18278. return Math.abs(e.position.y - t.y) > i
  18279. }
  18280. },
  18281. isNotBehindNormal: function(t, i) {
  18282. var n = new s.Vector3;
  18283. return i = i.clone(),
  18284. function(e) {
  18285. return 0 < n.copy(e.position).sub(t).normalize().dot(i)
  18286. }
  18287. },
  18288. isNeighbourPanoTo: function(t) {
  18289. return function(e) {
  18290. return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id]
  18291. }
  18292. },
  18293. isNeighbourOfNeighbourTo: function(n) {
  18294. return function(i) {
  18295. return !!n.neighbourPanos[i.id] || n.neighbourUUIDs.some(function(e) {
  18296. var t = n.model.panos.get(e);
  18297. return !!t && t.neighbourPanos[i.id]
  18298. })
  18299. }
  18300. },
  18301. isNotRecentlyFailed: function(t) {
  18302. return function(e) {
  18303. return Date.now() - e.failedLoadingAt > t
  18304. }
  18305. },
  18306. isOnVisibleFloor: function() {
  18307. return function(e) {
  18308. return !e.floor.hidden
  18309. }
  18310. },
  18311. isPanoAligned: function() {
  18312. return function(e) {
  18313. return e.isAligned()
  18314. }
  18315. }
  18316. },
  18317. r.sortFunctions = {
  18318. distanceToPoint: function(i) {
  18319. return function(e, t) {
  18320. return e.position.distanceTo(i) - t.position.distanceTo(i)
  18321. }
  18322. },
  18323. floorDistanceToPoint: function(i) {
  18324. return function(e, t) {
  18325. return e.floorPosition.distanceTo(i) - t.floorPosition.distanceTo(i)
  18326. }
  18327. },
  18328. choose: function(i) {
  18329. return function(e, t) {
  18330. return i.id === e.id ? -1 : i.id === t.id ? 1 : 0
  18331. }
  18332. }
  18333. },
  18334. r.scoreFunctions = {
  18335. distance: function(t, i) {
  18336. return i = i || a.navigation.distanceFactor,
  18337. function(e) {
  18338. return t ? t.position.distanceTo(e.position) * i : 0
  18339. }
  18340. },
  18341. distanceSquared: function(t, i) {
  18342. return i = i || a.navigation.distanceFactor,
  18343. function(e) {
  18344. return t ? t.position.distanceToSquared(e.position) * i : 0
  18345. }
  18346. },
  18347. direction: function(t, i) {
  18348. return function(e) {
  18349. return e.position.clone().sub(t).normalize().dot(i) * a.navigation.directionFactor
  18350. }
  18351. },
  18352. angle: function(t, i) {
  18353. return function(e) {
  18354. return e.position.clone().sub(t).normalize().angleTo(i) * a.navigation.angleFactor
  18355. }
  18356. },
  18357. inFieldOfView: function(t, i) {
  18358. return function(e) {
  18359. return .75 < e.position.clone().sub(t).normalize().dot(i) ? 10 : -1
  18360. }
  18361. },
  18362. optionality: function(t) {
  18363. return function(e) {
  18364. return e.neighbourUUIDs.filter(function(e) {
  18365. return !(e in t.neighbourUUIDs) && e !== t.id
  18366. }).length * a.navigation.optionalityFactor
  18367. }
  18368. },
  18369. penalizeHeightDifferenceUnder: function(t, i) {
  18370. return function(e) {
  18371. return t.y - e.position.y < i ? -20 : 0
  18372. }
  18373. }
  18374. },
  18375. M.exports = r
  18376. }
  18377. ).call(this, "/js/objects/Panorama.js")
  18378. }
  18379. , {
  18380. "../enum/AlignmentType": 17,
  18381. "../enum/GLCubeFaces": 25,
  18382. "../enum/PanoRendererEvents": 35,
  18383. "../enum/PanoSizeClass": 36,
  18384. "../enum/PanoramaEvents": 37,
  18385. "../enum/RenderLayers": 41,
  18386. "../enum/RenderOrder": 42,
  18387. "../enum/TileDownloaderEvents": 45,
  18388. "../enum/Viewmode": 51,
  18389. "../exception/BasicException": 55,
  18390. "../scene/SceneRenderer": 158,
  18391. "../settings": 166,
  18392. "../tile/TileUtils": 174,
  18393. "../util/ajax": 181,
  18394. "../util/common": 185,
  18395. "../util/lerp": 188,
  18396. "../util/logger": 189,
  18397. "../util/panorama": 191,
  18398. "../util/texture": 194,
  18399. "../util/transitions": 195,
  18400. events: 202,
  18401. three: 217
  18402. }],
  18403. 149: [function(e, t, i) {
  18404. "use strict";
  18405. function n(e) {
  18406. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18407. t.map.value = d,
  18408. t.opacity.value = 0,
  18409. t.color.value.set(o.reticuleColor),
  18410. t.showMouseMarker = !window.DATA.hideMouseMarker;
  18411. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18412. side: r.DoubleSide,
  18413. depthWrite: !1,
  18414. depthTest: !1,
  18415. transparent: !0,
  18416. vertexShader: c.waypoint.vertexShader,
  18417. fragmentShader: c.waypoint.fragmentShader,
  18418. uniforms: t,
  18419. name: "waypoint",
  18420. opacity: 0,
  18421. visible: t.showMouseMarker
  18422. })),
  18423. this.layers.set(h.RETICULE),
  18424. this.renderOrder = u.reticule,
  18425. this.player = e,
  18426. this.direction = new r.Vector3,
  18427. this.hidden = !0,
  18428. this.mouseLastMoveTime = Date.now()
  18429. }
  18430. var r = e("three")
  18431. , o = e("../settings")
  18432. , a = e("../util/transitions")
  18433. , s = e("../util/texture")
  18434. , l = e("../util/lerp")
  18435. , c = e("../shaders")
  18436. , h = e("../enum/RenderLayers")
  18437. , u = e("../enum/RenderOrder")
  18438. , d = s.load("images/reticule.png");
  18439. d.anisotropy = 4; //各向异性
  18440. (n.prototype = Object.create(r.Mesh.prototype)).move = function(e, t, i) {
  18441. this.hidden = i,
  18442. this.mouseLastMoveTime = Date.now()
  18443. }
  18444. ,
  18445. n.prototype.hide = function() {
  18446. this.hidden || (this.hidden = !0,
  18447. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18448. }
  18449. ,
  18450. n.prototype.show = function() {
  18451. this.hidden = !1,
  18452. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18453. }
  18454. ,
  18455. n.prototype.update = function() {
  18456. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18457. }
  18458. ,
  18459. n.prototype.updatePosition = function(e, t) {
  18460. if (!this.hidden) {
  18461. if (!t)
  18462. return this.hide();
  18463. var i = t.point
  18464. , n = e.distanceTo(i)
  18465. , r = 1 + .01 * n;
  18466. n < 1 && (r -= 1 - n),
  18467. this.show(),
  18468. this.scale.set(r, r, r),
  18469. this.direction = this.direction.multiplyScalar(.8),
  18470. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  18471. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  18472. this.lookAt(this.position.clone().add(this.direction))
  18473. }
  18474. }
  18475. ,
  18476. n.prototype.writeAstag = function() {
  18477. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  18478. , t = new Date;
  18479. this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1;
  18480. var i = {
  18481. enabled: !0,
  18482. version: "0",
  18483. created: t.toISOString(),
  18484. created_by: "APITest",
  18485. position: this.position.clone(),
  18486. stem: {
  18487. enabled: o.tags.pole.enabled,
  18488. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18489. },
  18490. label: "tag " + this.tagCount,
  18491. description: "Description " + e,
  18492. floor: function(e) {
  18493. if (e.currentFloor) {
  18494. var t = e.floors.indexOf(e.currentFloor);
  18495. return -1 < t ? t : void 0
  18496. }
  18497. }(this.player.model),
  18498. type: "info",
  18499. metadata: {
  18500. preferred_camera: {
  18501. mode: this.player.mode
  18502. }
  18503. }
  18504. };
  18505. console.log("--------------------------"),
  18506. console.log(JSON.stringify(i));
  18507. var n = this.player.model.addtag(e, i).build();
  18508. n && (n.disc && this.player.tagDiscs.push(n.disc),
  18509. n.visible || n.show(o.tags.startup.fadeInDuration))
  18510. }
  18511. ,
  18512. t.exports = n
  18513. }
  18514. , {
  18515. "../enum/RenderLayers": 41,
  18516. "../enum/RenderOrder": 42,
  18517. "../settings": 166,
  18518. "../shaders": 167,
  18519. "../util/lerp": 188,
  18520. "../util/texture": 194,
  18521. "../util/transitions": 195,
  18522. three: 217
  18523. }],
  18524. 150: [function(e, t, i) {
  18525. "use strict";
  18526. function n(e, t) {
  18527. this.chunks = [],
  18528. this.floorId = e,
  18529. this.roomId = t,
  18530. this.position = new l.Vector3
  18531. }
  18532. var l = e("three");
  18533. n.prototype.addChunk = function(e) {
  18534. this.chunks.push(e)
  18535. }
  18536. ,
  18537. n.prototype.calcBoundaries = function() {
  18538. for (var e = new l.Vector3, t = new l.Vector3(0,0,0), i = new l.Vector3(0,0,0), n = new l.Vector3(0,0,0), r = 0, o = 0; o < this.chunks.length; o++) {
  18539. var a = this.chunks[o].geometry.attributes.position;
  18540. if (a)
  18541. for (var s = 0; s < a.array.length; s += 3)
  18542. e.set(a.array[s], a.array[s + 1], a.array[s + 2]),
  18543. t.add(e),
  18544. 0 === s ? (i.copy(e),
  18545. n.copy(e)) : (i.max(e),
  18546. n.min(e)),
  18547. r++
  18548. }
  18549. 0 < r ? (t.multiplyScalar(1 / r),
  18550. this.average = t) : this.average = null,
  18551. this.boundsMax = i,
  18552. this.boundsMin = n,
  18553. this.center = new l.Vector3,
  18554. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  18555. }
  18556. ,
  18557. t.exports = n
  18558. }
  18559. , {
  18560. three: 217
  18561. }],
  18562. 151: [function(o, v, e) {
  18563. (function(e) {
  18564. "use strict";
  18565. function t(e, t, i) {
  18566. this.obj3d = null,
  18567. this.nodes = [],
  18568. this.colorHull = [],
  18569. this.shortPaths = {},
  18570. this.floorHull = null,
  18571. this.cameraHull = null,
  18572. this.floorPathDistance = 0,
  18573. this.floorCurvePoints = null,
  18574. this.floorCurveColors = null,
  18575. this.camCurvePoints = null,
  18576. this.warpDestHeroLoc = null,
  18577. this.warpDestPano = null,
  18578. this.warpPathPoints = null,
  18579. this.warpPathLengths = [0],
  18580. this.warpLength = 0,
  18581. this.closeWarpDistance = 4,
  18582. this.UP = U.UP.clone(),
  18583. this.longestStep = 0,
  18584. this.upcomingTransType = null,
  18585. this.burnsDir = 1,
  18586. this.prevNextDist = 0,
  18587. this.nextI = 0,
  18588. this.activeTransType = null,
  18589. this.lastTransType = null,
  18590. this.bunnyObj = null,
  18591. this.director = e,
  18592. this.player = t,
  18593. this.playerControls = i,
  18594. this.modelManager = t.modelManager,
  18595. this.updateModel(),
  18596. this.updateDefaultsFromModelData(),
  18597. this.bindEvents(),
  18598. this.warping = !1,
  18599. this.waitingToWarp = !1,
  18600. this.warpInterrupted = !1,
  18601. this.warpInterruptionBlackoutStyle = null,
  18602. this.warpInterruptionTravelTime = null
  18603. }
  18604. var c, h, u, d, p, f, a, s, P = o("three"), i = o("../util/logger"), O = o("../enum/Viewmode"), A = o("../enum/RenderOrder"), L = o("../enum/WarpStyle"), D = o("../settings"), N = o("../util/math"), F = o("../util/lerp"), B = o("../util/easing"), V = o("../util/transitions"), l = o("../objects/Snapshot"), k = o("../effects"), C = o("../shaders"), n = (o("../gui/gui"),
  18605. o("../util/texture")), U = o("../enum/Vectors"), H = (o("../model/ModelManager"),
  18606. new i(e)), g = o("../enum/PlayerEvents"), z = o("../enum/BlackoutStyle"), r = o("../enum/ModelManagerEvents"), m = o("../constants"), I = {
  18607. path: n.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAAAgCAYAAADaInAlAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKxGlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjarZZnUFP5Gsbfc046CS0hAlJCb4IU6dJrAAXpYCMkIQmEEFJQsKEiruBaEBHBsqIrIAquBZC1IBZsi2DvC7IoqOtiwYbK/cAS7r1z74c7c9+ZM/ObZ97/c57/OV8eAOogRyoVo5oA2RKFLDYskJWcksoi/g54oIEmUMCUw5VLA2JiouA/DwLw4Q4gAAA37TlSqRj+t9Hi8eVcACQGANJ5cm42AHIMAOniSmUKAKwIAMwWKaQKAKwOABiy5JRUAOwkADAE49wNAIz0cf4DABiy+NggAOwTAInK4cgEAFQcALDyuAIFANUcABwlPJEEgBoPAL5cIYcHQC0HgGnZ2Tk8AGo7AFin/5OP4F8801WeHI5AxeN3AQAAUrBILhVz8uH/Pdli5cQ7TAGAKpSFxwKAJQBSl5UTqWJJ+uzoCRbxACZYqAxPmGCuPCh1gnmc4MgJVmYlBEwwRzZ5VqRgx0+wLCdW5c+Xh8Sp/PnsKFUG8WwVZ4hC2RNcIIxPmuA8UeLsCZZnxUVO7gSpdJkyVpU5QxaqumO2fDIblzOZQSGMD5/MlqzKwOMHh6h0SYJqX6oIVHlKxTGqfb44TKXL8+JUZxWyeJWeyYmImfSJUX0fiAchKEECPOCDDNIhB8SgABYEgwjkIAUxcCAfQMFfrAAACMqR5stEAqGCFSCVivkstoTrMI3l7OjkCpCcksoa/+XvmIAAAMK8MqnltgN4lgAggkmNYwZw4hkA/cOkZvYWgLoJ4FQ3VynLG9dwAAB4oIAGMEAPjMAMrMEenMENvMEfQiACoiEeUmABcEEI2SCDRbAUVkIxlMIm2ApVsBv2Qh0cgiPQAifhLFyEq9ANt+Eh9MIAvIRh+ACjCIIQERpCR/QQY8QCsUOcEQ/EFwlBopBYJAVJQwSIBFEiS5HVSClShlQhe5B65BfkBHIWuYz0IPeRPmQIeYt8QTGUijJQQ9QSnY56oAFoJBqPzkcFaC5agBahG9BKtAY9iDajZ9Gr6G20F32JjmCAqWFMzASzxzywICwaS8UyMBm2HCvBKrAarBFrwzqxm1gv9gr7jCPg6DgWzh7njQvHJeC4uFzcctx6XBWuDteMO4+7ievDDeO+42l4A7wd3gvPxifjBfhF+GJ8BX4//jj+Av42fgD/gUAgMAlWBHdCOCGFkElYQlhP2EloIrQTegj9hBEikahHtCP6EKOJHKKCWEzcTjxIPEO8QRwgfiKpkYxJzqRQUipJQlpFqiAdIJ0m3SA9J42SNckWZC9yNJlHzidvJO8jt5GvkwfIoxQtihXFhxJPyaSspFRSGikXKI8o79TU1EzVPNXmqInUCtUq1Q6rXVLrU/tM1abaUoOo86hK6gZqLbWdep/6jkajWdL8aak0BW0DrZ52jvaE9kmdru6gzlbnqa9Qr1ZvVr+h/lqDrGGhEaCxQKNAo0LjqMZ1jVeaZE1LzSBNjuZyzWrNE5p3NUe06FpOWtFa2VrrtQ5oXdYa1CZqW2qHaPO0i7T3ap/T7qdjdDN6EJ1LX03fR79AH2AQGFYMNiOTUco4xOhiDOto68zQSdRZrFOtc0qnl4kxLZlsppi5kXmEeYf5ZYrhlIAp/CnrpjROuTHlo+5UXX9dvm6JbpPubd0veiy9EL0svc16LXqP9XH6tvpz9Bfp79K/oP9qKmOq91Tu1JKpR6Y+MEANbA1iDZYY7DW4ZjBiaGQYZig13G54zvCVEdPI3yjTqNzotNGQMd3Y11hkXG58xvgFS4cVwBKzKlnnWcMmBibhJkqTPSZdJqOmVqYJpqtMm0wfm1HMPMwyzMrNOsyGzY3NZ5kvNW8wf2BBtvCwEFpss+i0+GhpZZlkudayxXLQSteKbVVg1WD1yJpm7Weda11jfcuGYONhk2Wz06bbFrV1tRXaVttet0Pt3OxEdjvteqbhp3lOk0yrmXbXnmofYJ9n32Df58B0iHJY5dDi8Hq6+fTU6Zund07/7ujqKHbc5/jQSdspwmmVU5vTW2dbZ65ztfMtF5pLqMsKl1aXNzPsZvBn7Jpxz5XuOst1rWuH6zc3dzeZW6PbkLu5e5r7Dve7HgyPGI/1Hpc88Z6Bnis8T3p+9nLzUngd8frL2947y/uA9+BMq5n8mftm9vuY+nB89vj0+rJ803x/8u31M/Hj+NX4PfU38+f57/d/HmATkBlwMOB1oGOgLPB44Mcgr6BlQe3BWHBYcElwV4h2SEJIVciTUNNQQWhD6HCYa9iSsPZwfHhk+Obwu2xDNpddzx6OcI9YFnE+khoZF1kV+TTKNkoW1TYLnRUxa8usR7MtZktmt0RDNDt6S/TjGKuY3Jhf5xDmxMypnvMs1il2aWxnHD1uYdyBuA/xgfEb4x8mWCcoEzoSNRLnJdYnfkwKTipL6k2enrws+WqKfooopTWVmJqYuj91ZG7I3K1zB+a5ziued2e+1fzF8y8v0F8gXnBqocZCzsKjafi0pLQDaV850Zwazkg6O31H+jA3iLuN+5LnzyvnDfF9+GX85xk+GWUZgwIfwRbBkNBPWCF8JQoSVYneZIZn7s78mBWdVZs1Jk4SN2WTstOyT0i0JVmS8zlGOYtzeqR20mJpb65X7tbcYVmkbL8ckc+XtyoYCqnimtJauUbZl+ebV533aVHioqOLtRZLFl/Lt81fl/+8ILTg5yW4JdwlHUtNlq5c2rcsYNme5cjy9OUdK8xWFK0YKAwrrFtJWZm18rdVjqvKVr1fnbS6rciwqLCof03YmoZi9WJZ8d213mt3/4D7QfRD1zqXddvXfS/hlVwpdSytKP26nrv+yo9OP1b+OLYhY0PXRreNuzYRNkk23dnst7muTKusoKx/y6wtzeWs8pLy91sXbr1cMaNi9zbKNuW23sqoytbt5ts3bf9aJay6XR1Y3bTDYMe6HR938nbe2OW/q3G34e7S3V9+Ev10b0/YnuYay5qKvYS9eXuf7Uvc1/mzx8/1+/X3l+7/Viup7a2LrTtf715ff8DgwMYGtEHZMHRw3sHuQ8GHWhvtG/c0MZtKD8Nh5eEXv6T9cudI5JGOox5HG49ZHNtxnH68pBlpzm8ebhG29LamtPaciDjR0ebddvxXh19rT5qcrD6lc2rjacrpotNjZwrOjLRL21+dFZzt71jY8fBc8rlb5+ec77oQeeHSxdCL5zoDOs9c8rl08rLX5RNXPK60XHW72nzN9drx31x/O97l1tV83f16a7dnd1vPzJ7TN/xunL0ZfPPiLfatq7dn3+65k3Dn3t15d3vv8e4N3hfff/Mg78How8JH+EcljzUfVzwxeFLzu83vTb1uvaf6gvuuPY17+rCf2//yD/kfXweKntGeVTw3fl4/6Dx4cih0qPvF3BcDL6UvR18V/6n1547X1q+P/eX/17Xh5OGBN7I3Y2/Xv9N7V/t+xvuOkZiRJx+yP4x+LPmk96nus8fnzi9JX56PLvpK/Fr5zeZb2/fI74/GssfGpBwZBwAAMABAMzIA3tYC0FIA6N0AFPXxzvx310cmW/9/4/FeDQAAbgC1/gAJhQBR7QC72gEsCse7dQwAxPsD6uKiev4eeYaL87gXVQaA/zQ29s4QgNgG8E02Nja6c2zs2z4A7D5Ae+54VwcAIGgClFnpWusMd8e8L/z3zvwPWFMLsyHkoksAAD+UaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/Pgo8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjYtYzA2NyA3OS4xNTc3NDcsIDIwMTUvMDMvMzAtMjM6NDA6NDIgICAgICAgICI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIKICAgICAgICAgICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICAgICAgICAgICB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIKICAgICAgICAgICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgICAgICAgICAgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiCiAgICAgICAgICAgIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwveG1wOkNyZWF0b3JUb29sPgogICAgICAgICA8eG1wOkNyZWF0ZURhdGU+MjAxNS0wNy0yMVQxODoyMDo1My0wNzowMDwveG1wOkNyZWF0ZURhdGU+CiAgICAgICAgIDx4bXA6TWV0YWRhdGFEYXRlPjIwMTUtMDctMjFUMTg6MjE6MzgtMDc6MDA8L3htcDpNZXRhZGF0YURhdGU+CiAgICAgICAgIDx4bXA6TW9kaWZ5RGF0ZT4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC94bXA6TW9kaWZ5RGF0ZT4KICAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9wbmc8L2RjOmZvcm1hdD4KICAgICAgICAgPHhtcE1NOkluc3RhbmNlSUQ+eG1wLmlpZDoyYWI5MzcwNS0xYjZjLTQ1ZGMtYTQyNy1jYWQzOGNiZTUxYjM8L3htcE1NOkluc3RhbmNlSUQ+CiAgICAgICAgIDx4bXBNTTpEb2N1bWVudElEPmFkb2JlOmRvY2lkOnBob3Rvc2hvcDpjYjc1NjFhOC03MDlhLTExNzgtOTQ1Zi1kNDlkZmJlYjBjMWE8L3htcE1NOkRvY3VtZW50SUQ+CiAgICAgICAgIDx4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3htcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPHhtcE1NOkhpc3Rvcnk+CiAgICAgICAgICAgIDxyZGY6U2VxPgogICAgICAgICAgICAgICA8cmRmOmxpIHJkZjpwYXJzZVR5cGU9IlJlc291cmNlIj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmFjdGlvbj5jcmVhdGVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6Y2Y4NGFiMzItZTUwNi00ZGM1LThlMWQtNTI4MTI4YTdjZTljPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIwOjUzLTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MWIzNzcxZGMtZGU3Ni00YTQ4LTkzNjEtMGQ4NzdkOWY0ODkwPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPmNvbnZlcnRlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5mcm9tIGFwcGxpY2F0aW9uL3ZuZC5hZG9iZS5waG90b3Nob3AgdG8gaW1hZ2UvcG5nPC9zdEV2dDpwYXJhbWV0ZXJzPgogICAgICAgICAgICAgICA8L3JkZjpsaT4KICAgICAgICAgICAgICAgPHJkZjpsaSByZGY6cGFyc2VUeXBlPSJSZXNvdXJjZSI+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDphY3Rpb24+ZGVyaXZlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5jb252ZXJ0ZWQgZnJvbSBhcHBsaWNhdGlvbi92bmQuYWRvYmUucGhvdG9zaG9wIHRvIGltYWdlL3BuZzwvc3RFdnQ6cGFyYW1ldGVycz4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MmFiOTM3MDUtMWI2Yy00NWRjLWE0MjctY2FkMzhjYmU1MWIzPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgIDwvcmRmOlNlcT4KICAgICAgICAgPC94bXBNTTpIaXN0b3J5PgogICAgICAgICA8eG1wTU06RGVyaXZlZEZyb20gcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICA8c3RSZWY6aW5zdGFuY2VJRD54bXAuaWlkOjFiMzc3MWRjLWRlNzYtNGE0OC05MzYxLTBkODc3ZDlmNDg5MDwvc3RSZWY6aW5zdGFuY2VJRD4KICAgICAgICAgICAgPHN0UmVmOmRvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3N0UmVmOmRvY3VtZW50SUQ+CiAgICAgICAgICAgIDxzdFJlZjpvcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3N0UmVmOm9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPC94bXBNTTpEZXJpdmVkRnJvbT4KICAgICAgICAgPHBob3Rvc2hvcDpDb2xvck1vZGU+MzwvcGhvdG9zaG9wOkNvbG9yTW9kZT4KICAgICAgICAgPHBob3Rvc2hvcDpJQ0NQcm9maWxlPkRpc3BsYXk8L3Bob3Rvc2hvcDpJQ0NQcm9maWxlPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICAgICA8dGlmZjpYUmVzb2x1dGlvbj43MjAwMDAvMTAwMDA8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDx0aWZmOllSZXNvbHV0aW9uPjcyMDAwMC8xMDAwMDwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgICAgPHRpZmY6UmVzb2x1dGlvblVuaXQ+MjwvdGlmZjpSZXNvbHV0aW9uVW5pdD4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT42NTUzNTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+MTI4PC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxZRGltZW5zaW9uPjMyPC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz6SKsKfAAAAIGNIUk0AAG11AABzoAAA/N0AAINkAABw6AAA7GgAADA+AAAQkOTsmeoAAAOCSURBVHja7FtRi9ZADJxETzkQRf3/P9FTREQ9bXwpUvYyk+x3PiawtPS6/UozmUyyexYROO0OwItzOICX57g7j68u4/U57pfzewDvAXxcjh8AvAPwFsCb83ljuf0G8A3A13N8AvAZwMN5/gDgC4DvAH4s4+d5fATw6xyPAP5cjtfx6JcfjuRl7Lxu5GXjcp8lc7Nnx/hY2rGcW/JNlU+c+Mmyb+/EYdlEBpDKjABkjH8vFWxVAAW5toIgGFquL2FLlDNErUyRzTnGt20LcW7NAFTs/G+uF2hhP+KCKa7zjuQ5wwR7LGDi75mTbbkWimFcUHYkkRwLSNRLZekjRgO0GSAKBr4y7yGeIwOuKwI7uSrIvLhBNwwD8MCCCFBbwGCVCPeGas9yfZYmgoDGyH1jmgGy75h9a1tYg6Vny0Dhzei2BTSWRPmKNicIHOs5nwWlCjQIFo+MNZQIZKVHCJa4vtQxOf9Z9B8b6ZcBKEQpHkwDmEgHVb8gA5VNBXAzC1jBBkyrHYSln1Rj3mwmdOlGiZVhg9t6AJ0G3CHmKuBQAFTlBFP4saA3EqEyVqcAE9VUFdVW9A7QqQKqvn6QFzVRekxLuA+AaDR/lJ+iUVmEEoHsWizAMdK06LDHWG4H8kWfTipQ5XkKHm+gMaOnIDUmGtXD2F4TKDYYuttClhrARPSuVBJCcIAgeVLAfi+ARXrcEHBWlYEg9T2aFAQiTGJRrGO6CjiEAOyIvRDs0C4DoxB1IdgkCmCM5eaLg00wg9Jrnvgy1kDsVgHMwUaYIjufdYB9HRBLjW8bDBJFKvEqBWTNhm6f2gn9T/T3HFh1ZdVyPBORqU7zotbPqAmiCcQ0wUT/bTqAAcFEeraiX1NWAQwMCkms73y93wcEWzoA4Ov+rETMloplC943Kagj8kB+eNLAXjMoim+WNdiOokfwBAzVaiCr7x29JUlLxOCwQC0A15EtrWe7fzos29IAlbiIhgaYrWDPF4HVPUpzKT+VKSCj8o6g6+wDHCDsCUGgXvQxUSGorfo0BWRUrh6OQm3OruD9FACiqyqwOPQ+AroaaM2HZ6jKjtYUk2M5vXvh8Crdtpp83U2h1b8lOZ5uCwv09reN1WW4LeLbGvpKtfFlCsjyjxGVupYfFVCGBfZKwayFfv3G3mQUxhyt/QBRqFRD/m9hPj78byxggnUrMW7Kn38HAONAllI0EmS1AAAAAElFTkSuQmCC"),
  18608. pathEnd: n.load("images/End.png"),
  18609. pathStart: n.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAM6VJREFUeAHtfQl0HNWZ7r3VXd2SLLEa2xgc2ySGxwOMiSRsC2IsG1vbMCGGsCYsWcibGSAhEEJeFkyIhyRAkknmvXOGJBMggQAhDAlIsjFY4NjCtqSwH55xDjYDAWN2JGvp6q77vr/UMpLcS3V3Lbeqbx3L3V1177989///uvvlTF2BRmBx96uVNbFpsyMiMpcx83Cu8UOh0FQm6FMcyuk7YwcLxivwGWOcxXEvxgSLW7/xH64E7o8I+hRshH5zJobx+R7uvc0Yf4dx8Q5+vy1M+tTeSPHUzv7EnleebJg1hPvqCigCsAV1yY7A0q6uaGVlw9EiwuZzTTueC34UnBsOz+dwzmb4Kb8QbDdk2QVZdgouXham+TxPsWeHhrpferyxMemnbIp3fgRUAMiPkacplnbtrKioObIOBbOQMz4fzjWfcX4sftMbOzAXag4jTIgXERieFUzgj20d7n+t9/HGuVSzUJckCKgA4HNBtGzsP4xVVZ4CRz9F4wyfvBYixXwWyy32CejZZwq2GXpuZoNDmzuX1LzlFjNFNz8CKgDkx8jRFLW9vfoMduKpqDq3oPregrf78Y4yCBoxIZ4HFp3AonM3e2ZTX12dETQVgiyvCgAelN6KTXtn6nH9DDg7nJ4vB8tqD9gGkcWAEOIxNB06jRHjofWnTnk9iEoESWYVAFwqreVbBqbH9djZ6LA7V3B+KoBWWBeANfoM0KcoNuG/e0eMxP2PLap+s4DsKqlNBJRR2gTKTrKm7g8OieiVn8Wb/ly86U9DHs1OPpUmLwImagZPoGZwb8oY+sO6hgPfzZtDJbCFgAoAtmDKnai5x1iqcf5lpFqFtiyNt6vLJQTQX0CjCA8gIvxybb3+uEtsyoasCgBFFvXKzf3TIrGKSzSNfQm1+3lFklHZSkJA7DBN9qtUYvj2R06p2VMSqTLNrAJAgQXftDVxYiSqXY0Zc+fhba8XmF0ldwEB1AoM9LDck0qat65bGHvGBRahJakCgM2ibe4zmiKMXYO3/ek2s6hkviAgHk0xdsvaWn2dL+wDxlQFgFwFdt99kZa5Z16IDr1r8HdCrqTqmVwIoNPwOfzd0rnzwbvYOecgJqgrEwIqAGRCZfVqrbXtW+cyrq2G4x+dKYm6FwwEEAReYsJc3dF+071s9WozGFJ7J6UKABOx5q09SfTkixswlHfcxEfqV6AREOIFIfj1HfXRB6AHphmoixBQASBtB609xgqg8WO88Rco0wgvAqgRPA33v7ajXl8fXi3ta1b2AWDFluF5uh65FSvvzrAPm0oZdASwQvEhw0hdvX5RxY6g61KK/GUbAFq2vHMAix7wXUzguRIAhnX1XSm2UQ55E5hQ9HOW/PDGzkWHflgOCk/WsSwDQOu2xKUsov0Qyk+bDIj6XX4IoENgD0uZ13WcHPtNuWlfVgGgqXv4E5FY5Da08xvLraCVvvkRQP9AVyqRumxdQ8Xf8qcOR4qyCADWllrVp34d1f3V6OirDEfRKS1cQUCwITQLVg8NbPpJOWxpFvoA0NKTOAlv/F/j7yRXDEYRDSUCqA08hb8vdtbHngqlgmmlQr1ctaUv8TXOta3K+cNswu7oRjZDtkM25A4HOaiGsgbQ9pf3DxaVU36DQvy0HDArKYKMAGoCf+JDey9t/9RB7wVZj0yyhy4AtPYmFmIK771QbHYmhdU9hUAxCGCk4BVMKT63oy62tZj8suYJVROgtdf4Ojbh+YtyflnNLbhyjdqU9pdRGwuuHpMlD0UNwNqKK151u5rNN7l41W83EKBZhKmRwUvCsDVZ4ANA81ZjcSTC78Hw3sfcKGxFUyGQEQHB/juVEuetXag/mfF5QG4GuQnAW/uMb2gRvlE5f0CsLUxi4oVDtkc2CLUC+yINpOB0fFbVAUfehSr/qjDZlNIlmAigSfDA4IevXRjEY88CFwBO7333wBiv+TOcf0kwzUVJHUYEEAQ2JkT/Pz5ad8gHQdIvUAGgqXfv4REeWwvnx6GZ6lIIyIUAgsCzKZFoXlc35Q25JMsuTWACwOi6/egjEHhOdnXUE4WAvwhgvsAuw0iuDMo+A4EIAK1bE3UsqnVA2MP8LV7FXSGQHwEEgbdY0mztWBjrzZ/a3xTSjwK09Rin86jWpZzfX0NR3O0jQLZKNku2az+XPymlDgDNPSPnMY23Axp1mq4/9qG4Fo9ANdmuZcPF03A9p7QBoK03cYWmRe4GAmq7LtfNQDFwCYEY2TDZskv0SyYrZR8AJldcj57+1SVrV2YE0PbcixN0X8IqyO3Y1OIljYm3hckGBNf6hSb6IymGT7PfNMx+QzP6d7/yaj9BNGP2rBrd1Gs0XavhplaTijB88houzBqusWqT8anYTOVorIo7BtulHw2jmVJm0JasLkYIVnfU6jeUTMhhAtIFACtacu3nDusZNnKvw9Gfg8Nv50xsT5l8OzeN7Z2Lql7zQtGWLYNHCk0/JqKJYwTjx8CIKDDQyUkzveAfWB7CvLK9LvYLmeSXKgBQe4mqTBBKKrn8LjCrV1mwLixH3WCkzA2yDjFZQ7URbRmWY+OPNaIQ1ajNOONBOQrTTF2wtj5+z7jbvn6VxtGsHtPRDj/V5mfsfVS3n4C9bMBfV0dd/HlYCewnUBdv7R05HrG8EX/L0Cw5DdIfFCgN3BE2wUzR1l6vP+oO+cKoShEAaJyfhk0gevn29gu0zzm73zTFnWvb12wM3Tl2OG+xue3bSzSNX8QFOxs1hJrCTDVUqQdE0myUYZ6A7wEgPcNvMwQpv+qiYCnBxXpmmne+Z+x58MmGWUOhMvMsyizufrXyYH3amUzTEAw4HcmGk9fL60J17i3MGDzF7+acrwFgdG5/vBtCzCmz4n9GCHYnM0fu7ji5end56T5R29ZtAzOYFr+Ac3YRmgonTnwa7l8IArtSYqTBz7UDvgWA9Kq+jWW0sMdEz/0DjIsfttfG+sJt2sVp19aXqGWCX4cRBVrmLe0cleK0y5yLFhBhFeESv1YR+hIA0uv515XDkl686ZOo4v6eJ1I3tS+Ov5jZDNTd8Qi0PTlyrIhFvoVuz/NRM4iOfxbG7wgCG7GfQJMf+wn4EQB4W6/xR0T5z4SxMMfplMD3242k8cNHFlbuHHdffbWJwMqtQ3P1qH4dkl+Cv1CPDiEIPICJQmdDT7QMvLs8DwAtPca16An+kXcqesxJsEFU9W8bMoxbNjRU/d1j7qFkt6x78IhKXb8GL43LUJuqCqWSUApB4FoEgZu91M/TAEAbeNI+aqGt1gn2h6FE4irl+O6YsBUIYrGfIgh81h0O/lKl5qKZEku83GjUswBAW3dHY1OeQuGFcPdescMU7PLOOv0Rf02oPLi39BorNc7+HaMG80KnMXYbTib2nuTVluNe9bTyCPbtD53zj54k+z3zzV0nKOf3zhUJa8IcC56+h3pzuOZO4AVp+YpHcHpSA0DEvhqryW7xSCdP2GCqbnsylbxCdfB5AndWJtRRGI1Ef4Gpxm1ZEwXwAYLbNQh0t7otuusBAKerLuJCo3a/7rYyntAX7E201b7SUR/9kyf8FBNbCLT2JD8NG/sP1DKn28ogeSLYmCG4uaSzNrbFTVFdDQDWKb1V1U+ByWw3lfCKNt76XZi9d0G5z97zCu9C+aRnFd6N2kBjoXllTI/xwFf44MBJbp5K7GofgHVEdzic3xSmuKHj4TWnK+eX0VVGZaKyoTKissIdU15J7UlGL07yIXupi0sFHu5crT2Jq7im/cQd6t5RRVVsNxbsXNhZq2NprrqCgkBLn7EMC43uQrNgRlBkzianycyr0BT4Wbbnpdx3JQA09SY+GWHaluC3+8Vjw8bIhY8tqn6zFJBVXn8QWL5lYHqFHr8Lw4XL/ZHAGa5Wf4AwF3bWx55yhuJHVBxvAizt6opGGP9VkJ0fbS9MyhLXtz+0ZqVy/o+MJWjfqOyoDKksrTINmgJpecmX0K/xa/Itp1VwvAYQ9Km+FG1NkbpIpm2bnC70cqRnbTfHI3cG+cWEzWK+2Vmv/9jJ8nM0ADR1D38iGos+i6GYSieF9JDWADqQVnXU6+s95KlYeYRAa4+xgmv8AbAL5s5TmPSUTCTnr2uo+JtTkDnaBIjEIrcF1flRRXzL2qZJOb9TtiUdHQrsVMZU1tIJZ0cgvFgtH7OT1mYaxwJAS0/iC0Edf4VB7GLJ5Kky7NFms9xUsiIRsMoYZW2VeZE0/MxGPta6LXGpUzI40gRo2fLOAVw/cAeITXNKMK/oYHLPcymWaPJzWyavdFV8PkLA2o6OxdbBoeg8g0BdCF57hPHBvM5Fh35YquDO1ACiB3w3kM7PRPdg/8AS5fylmlHw8lOZU9ljuKc7aNJbvgafc0LukmsAtKtvTI/SvvWB2rGF3vxkAI83Hvy+E0AqGsFEYGnXewdV1VRjrUrgagKJhJE8vtRdhUuuAeh6hFYsBcv5aTdWVPuV8wfTaZ2UmmyAbCGAfQKxtO+VBEdJNYD0sEqgNsFAQb812uFX8VJJyKnMoUKgdevw0Swa3QSHCNT5FBi2XlnKsHUpNQBs6sscnZTggUUNYNOl1o6Fyvk9wDpQLCybgG1A6IFACT7qg0W/yIsOAFh/vQrtpgVBAcuaT02TfBbGeoMis5LTWwTINmgiGNmKt5yL50Y+SL5YLIXiAgDOeePcWnJZLF9P86Haj3JNXVRKVclTgRUz3xAgGyFbIZvxTYgCGVu+CJ8sMJuVvKiqQ2vPyPkcx3gXw9CPPLR3HLZXutEP3opnMBHA2RXfwzbkNwRFeoFjxzvq478vVN7Co8Z992Gxn7a6UEb+pRePdT68Zo1//BXnICLQ/vCaH6AS8FhgZCefJN8s8Cq4BoApvxdpmnZHgXx8SY623O6R5PACtaQ3M/y0XyM9cXvfuczc5b9L+wnEoxVPYwVhIDYVMU3zYuwZcGchyBZcA0Dj/xuFMPAxrUk7+Sjnz14CGtO+Sn/ZU5T3E7IdsiGgEIjtxdAheE2hJVZQAGjuM5rQLjq+UCZ+pEev341qG6/syK/YtHcmakhn0R99z56yvJ+QDZEtBQEFms1o+WgBwhYUANDAKDjCFCCLY0lp996O9jXfd4xgCAnF4rF/Gd1phun0PYQqOqYS2ZK1I7RjFN0jVKiP2u4DaNqaODEa1Z52T3SHKNO+/ebwArV7b3Y86Xj2KTWzXsVErqlWKsHe3tv/6iw/jqfOLqVcT2jLca5VPA3MpD93IJk0F6xbGHvGDoK2awCRqHa1HYJ+p0GV9ivK+XOXwpTqIy7c5/yUFIHAupc7W1k/JZsi2woCCIX4qq0AQL2hmBZxnuzKo5r2sDqxJ38pCY1fOTlVpnuT05T7b7It2Fi79DjAVy2ftSGorQAQi8Qvln4zRdovLZXcz7BtYFBWSTDBpRGLOOZPVpru0bPJ99XviQjQeZCyH0hKvko+O1HyzL9sBQBNY1/KnF2eu9jY4V/VQZ35ywPzW7MO++V6lp9yeaQgGzOZuEl2be36bN4A0NxjLJX/HHaxQ+zZdbPsheK3fHSSLoaKzsgmBz2jNNmeq/tpBPbswipYsUNuPPi8Ud/NLWXeAICJP1/OTcL/p6Zgl3e2zhvxXxK5JYhGo1dAwlxlrqXTyK2Iz9KRrZHN+SxGXvZ2fDfnMGBT9weHROJTXkeieF5ufiUQ7A/tddFz/GIfFL5Lu/ZUV9Uc8hrahwfmkhk93R8M9r975OON04K1Lj6XUi49a+tN3ocRlM+6RL5ksijL4VRi7xHrGg58NxuxXG8DFolVniO58w8OJRJXZVNO3f8Igcrqgy7J5/yUmtJQ2o9yqm/ZELBsT7DBbM/9vo+yrCAfziVHzgAAc8iZORdhT54JcduGhqq/e8Ir2EzQvOdU/bd1pdPmrB3aIhTyRJbtwQblVjO3D2cNANbMJ85Pk1i5xJBh3CKxfNKI1tyTbIFTH21XIEpLeeymL+d0aRtMyIoByvI08uVs8mUNAKj/n4VM2Z9no+jRfQxZ/Ua9/e2BrXGRdegvG4Vi8mSjFeb7ZINkixLrqKV9OaOIWR2cC35uxhwS3ETnRjKZNH4kgSjSi7Cyd+R/oGG/omBBkcfKW3DG8stAtkg2KavmuXw5YwCwlopyfqqsCqHn9fdq0o+90omyyFfRmC+4PU95KK89LuWdyrJF2KSsKAj4crYl3xkDgB7XzyjGaDwCwOSJlPQzsTzCIicbOvUGrv/5nIlyPURei0auNOqZhUDaJqXcOIR8mXw6U1FlDACoMsrbASTEA+2L4y9mUkbdm4hA1QHVX0bhT5l41/4vyks07Oco35SWTcI2pUUgi0/vFwBqe3t19Bwul1WRZADmYUuBnbVBJHdgow/QKGKzSSkw8FoILn7oNUu7/Minybcnp98vAMxgJ1Lbv3pyQjl+i2fW1cX+KocsckvROnfVmXiDzy5VSqJBtEqlUw7522tjfVgjYGsjDh/wqE779gTW+wUA9GZKW/2HbHdOkF79yIoADotwrAPPSVpZBQ7JA5ltNJNv7xcAMH1QzgAgWIqZI4E5jMRPe27dlliAfpxPOSYDaFk0HSMYYkJko2SrEl6ZfHtCAGjZ2H8YDEfKXX+xPfN6tdWXPavimvY1eyntp3KDpn3uwUlpbR0GW5VSYvi25ePjhJsQAFhV5Snjnsn11TRV9d9Giazc3D9NcOe3byOaRNuGCCqJzLY6yccnBgAm5AwAgvW/Z+x5UFlWfgT0eMX/Qsed48u3iSbRzi+BSmHZKmxWTiQm+viEAKBxJmUAwNvn/icbZg3JCag8UtEwj2DcNScl2pmGkuRBQA5JyFbJZuWQZqIUk318XwCgveIxYah2YnI5fpmmUNV/G0UxwzzhXHT0HG4jaVFJiDbxKCpzmWWS12Z57aivjxbIvgBQUXNkHW7FJCyn99e2r9kooVzSiSQi2pVuC+UFD7d18IJ+2mbf94JXgTxiaV+3su0LAGjjLSyQkCfJsQ/7E2z1ainnWHsCgE0mbduMBmztXW8zedHJiAfxKppAuWSEzVq2K6G+4319XADYf694OWQXG+SQQ24pcLCHYxN/8mnqJa98ssj9XE7bHX8uxL4AgCmM82UEMynkBFEmrFq2DB4JeVZ5KNOqNE8PWQaPlby2+5GvWwFgaVdXFBOAjpUNYuy08tYj9fEXZJNLNnl4VKeTfqNeyUW8iKdX/ILKh2yXbFg6+eHrls9DMCsAVFY2HO3G2HHJigvWBRrAUF3ZEFjc/WolqnSeL9klnsQ7m1zqvoUADqyybFgqOMjXyedJKCsAiAiTsvrPhKna/3lM56D49M9h049D8yRz/jF4WrydpxwuipLa8JjPWwEA87ylnP9vpFQAyOcNmtj/pN98eZx67idvp3Rwm46sNjzm81YA0Bj/uNtAFEH/9fWLKnYUka9ssjRvM5b7ungLi0ssGcoG8cIVTdvw64XndDcHNgo9ijiMNgGEmOMuuyKoC/FcEbnKKosWyX7Sr1dAyCCDV7oWzUdKWxZzSR8rAGAK8Bx8l+pCz992qQSSTJiW3uGPoyOuzW+xSAaSxW85ZOYvpy3zOYSZZvUic5b15BBK5MfFmVABIAfwnEXynfSbI7ejj7C+xJLFUaJhIiajLWModwb5vlYTmzZbRrBTJlcBIEvBnLLprRrU2i7N8tiH2/zSUZl8YB0AlrLaMvm+FhERqy0gG47cNFQAyFIoB1YceCki+AFZHnt+m2QhmTxnHBCGstoy+T76AMzDZcMRbaa9nYuqXpNNLknkwQ7P/HJJZNknRlomvu+G+rIPAbJlsul9N6T5Yh6ucY17P4kkDwBcqPZ/Noha+5Lo+OPzsj337z6fNyqbfxJIzVmIl2STj3yfRgGmyiYYdp5R1f8shYIOJc9W/WURIettmWXLKrRnD/j/84yVfUZTNSbkqwEwCaOlfUzdS9myZeR/4u1/unscSqXMTx+VsVQ64cuPRQHyTWqD76MGIKSrAeAginfCZwKla6Tp8p/WGwQZSy+JwingTft24bncziGmYgzXh4UkefTChor9eZKU3eOm7g8Owcqyz0mvOGS0ZJVeUG8FlNGmyfexnoMd4i0UNriZmgoAk2CKxqq+jFV/VZNuy/cTMlqyyieZvxLJadMHUx+A43vIl4o0TgFSAWA8iDidFx2jgdmAw5JVnSg8vgThZvLZNMqpgkYB5AsAKdUEGG89bUetWoXJNrPG35P5O8lKMssso9eyCTltOo6VwPJtBa5FzAGvC0hmfuhBlnboLxtuQZQ5my5O3JfSpuH71Ako3VkApmGqJkDa6tr6ErWYZSfliU25HINkJtlzpSmnZzLaNPk++gDkawIYmqECQNo7BNMC9/Yfc+wgyz6mg1OfUto0fJ/6AKSrAex+5VUVAFAwy7cMTEeUDuxRXCQ76eCUEwWZjqQ2jRqAuqRFIB6J/xOEky5AFwBYLK1DAVlUUi8RoACQ8JKhHV4zZs/Cevfyvo6774UY2tGunfTrFbqkA+niFT9Z+Uhq0wkaBRiRDTTd1Ms+AHxs7rzzUDbBrz5DB0sX2YzMY3mktGn4voZ1ytLVADRdK/sAoGn+bffttG+ESZdisZHRpsn3aRRAuhoAN8s7ADT3Gqdi1V+IhtB47ahOxbpP8PNJadPwfSn7AFIRVtY1gAjzf7tvp10ujDoVgpGkNp3ARCAxXIgiXqTlJi/bALBy2yCm/PLPeIGztzz4Z0Z185arLNxktGnyfaoBvCcLSGNycGGWbQCIRvTL0fmHF2bILuhk6RYyteyqI6lNv0edgO/YVcKrdFxj1V7xkolPbe/rVVg29iWZZHJUFuhm6ego0WAQk9Gm4ftvowbApdupxGRcul2KvDCz6WLq57GSTr79GRxSnnQjHR0iFygycto0fwfzAOTbfkvj/OhAla5TwoZo6C8rJOWgYwblpbRp+D71AUhXAxBCHJMBw1Dfau0xVuCcPWz6Ge6LdCRdw63l/tpJatNva8KUrwaAI6/LrwbAwzf0t78bpO+Uk65jIEho0+T7qAFob4zJKMsnVpFNadkyeKQs8rgtR1P38CcQ9Frd5iMNfehq6SyNQO4KQrZMNu0ul2Koa29oKZ7aWUxWt/MITS+bZoAWi14JA8G/8rhIV9K5PLTFxvuS2jL5vtaf2POKjAUR0cqjH6BlyzsHoBp2iYxl4KZMpDPp7iYPWWjLasvk+9qTDbOGhGC7ZQFrTA7sWFoeNQC95gt495ffxCfSmXQvg0tGWyafJ99HIKZL7LI+JPoP1cTwB4DVqzUutMslgt1TUSzdgYGnTH1gJqctj/p8GnwuXz8A5yf4UFaesmxu+84/YHLMxz1lKhEz0p0wkEgkd0SR0pZHfd4KADi04GV3NC+J6swVW4YlPAa7JJ0mZMbrP7Abfk5QpIQfYccgbcMzS4DIlaxjPj8aAEzzeVe4lEhUj2jLSiQhbfaVPSPHY7us0OpnF3jCgLCwmz5o6WS1YZH2eSsA8BR7VkpgeXgDQJTLf9KvVzYRaiwkteExn7cCwNBQ90tYGSTdzkDoHW+EEaIPJVzX8q0fHgqlLgyXVsVrQ1gQJsVTkDYnZj5bNiyVgOTr5PMklBUAHm9sTDIhXpRKSggDwzgM1cPjZJOrVHnikcrLoFxlqXRCkx9YWJiERqFRRVp70cyDDUunFnzd8nkIZgWAUQG5lM2AaMjayUu7uqIIbf8snVH4LhD/51FsfBfEQQF4o4PEHCT1ka/vCwA4zFHKAABnWeag5r6TqpzScBaGv8pmnYNdwAkTwsZu+mCkk9N2x/v6uADAtsoIKnqJT2MhmiyiRYJ71p/b9hEqbGiSF9muhBf6APb5+r4AMNz/Wi9kle6MAMh0UHPbt5dIiGPBIjVvS9SjRrO44Ixlk4EvHsUo+AqnbfYgCTVJpH3dEm1fAHi8cS52BxZ9EgrMcLDERTLKVahMEU29/fNhFhaM5LVZ0Tfq66MlsS8A0E9TsM35CsiP51ywsxd3vxroXvOm3r2Ho+p1jh/4BYknYURYBUnmybKSrZLNTr4vw+/JPj4hAKB6KmUAwJBZzcH6tDNlALBYGaIs9k/o6NKLzV8u+QgjwirI+lq2Sqsdpbwm+vjEADA4JGcAICA1LbDNgJaOHXHB+VektAcJhSKsCDMJRbMnksy2OsnHJwSAziU1b2FCkJTrArjgK1q3DcywVwJypeLTZ5+PCSHT5JJKXmkIK8JMXgmzS0Y2SraaPYWPT+Dblo+PE2FCAKD72Cigc9xzeb7SaTla/AJ5BCpAEsHLftVfAWiNJg0qZmSjkp7slMm39wsAaIPJGQBgFpAtcM2A1m3GEowHLyjYAco8A2FG2AUNBpltNJNv7xcAdrNnNgH0ATmB5ye29SWCdWx2pIy2+3baaAKG3aht8hOdhsEhegNp355Abr8A0FdXZ+AQg8cmpJLph+DXySROLllaNw/NRnvw07nSqGfZESDsCMPsKSR7IrFtkk+Tb09GbL8AYCUQQtpmANoBq9qeHDl2siIy/hbxaDhP+vUKbLSlLQy94lcCH8smYZslkHA3axafzhgAjBHjIUzIwD8pL03EIt+SUrJxQq1ct3sKJoPLfdIvjfhIOuozBiVhSFiO/Zb1M22TGf3Jb5nJl8mnM8mRUeD1p055nQtBfQFyXoKdv3Lr0Fw5hRuVKnLoIdRhKd1ccPQEv4u//5tKmSe31+kn0B99p3v0TEJMD0pjKaFooyJZtgiblFVA8mXy6UzyZQwAlBCbBt6bKYMM99CbGdWjusx9ATgOnktz8g0cmzZ86UCd7pxXXt5+eEdd9F/WnhzrGStL+k736BmlobRWnrEEPn+mscT0ADkvskWySTmly+3LWUFdvmVgeoVeQVEja5DwWeHE0EjiqA0NVX/3WY792Df3GU0Rxtfu98DrG6jeC87uZKmR33acXF3Q4S/WpKtI/POY034R+l1837QzxUTz2lp9ndcQ5uO3rHvwiMp47GWki+VL69Nzc9gYnvnYouo3M/HP6tyUAT2HT2TKJMm9WKWuXyOJLBPEAKj+TfwR7B1hsv8jkmY9Ve87avWbC3V+UobyUF6iQbSIJmoH70xQ1MMfvmKaQ8+0Dcrq/KjMiSeyOT+plTUAWDoLeZsBlnycX0YR2PouyX+tW4ePxpSlZi/Foeo6CrrdNNlnd728fWZHffTyjoUx2t/BkYtoEU2iTTyIl/dNBN48iq0jKjlCxLI92KAjxNwikseHc7ZbUsbQHyKxKT9D+6bCLflKostZVWUs9lPQkGeZrebhSb+jPfh3jCRHfpsrypeE8bjML5xzXOIFxu7HrfutJmI0/nl8v9iLJgLaqjhJzDpR+PJxIvn61bI92KCvQuRgjiA9TD6cIwltvJv7au1N3oUAIPUcfFOIps46/ZHcmrj/9PTedw+M8wNeA6dq17hRNZyz32P3htvba2NSbOAyOgNOuwRNhPMhm5vbew+MiA+PfLTukA9cw9cm4ZZeYyWGKKXrkxgvPgLA3ejczbn9fO4mAKjBuX45nqiM3zXO/l2G5aMxVvNF4OO486er+A+jHX42VcPba6NXyOL8ZA8kC8lEspGMaCI87FIToTqNsa9mSLZGNuerEDaY2/HdvDUA4tPWZ7yEGtg8Gzx9SwJlv4dawI2+CYBNINv+4Tt/wxtwrlMywJGewySOOxLJkd95UcV3Sm6iQ02EWDT+ORjYxVjYc4JjtAXb2f7wDz6BjWJNx2gWSAhv/+/i7f/9ArN5nFzsaK/V0R+V+7IVAFp6jGuxx9mPcpPy+algQ0bKOO6RhZU7/ZCkpTd5Jt4K/1Uyb1TxYdl3m6jir6uL/bVkehIQaOpNfFJj2iWobtJS2ZKbCNjW6jOdddEH/VCNJv3oEf0F6FHpB3+7PE1TfLOzXv9xvvR5mwBEIJUYvh1Vuv0WEuQj7ulzFEg0Ev2FpzzHMdNY8Sf9WlV8Jh5iKXYWVaNh3FeGxfkJItKFdCLdSEfsS/9QKU2EUrAeV2RFfbVsTHLnJ18ln7WjoK0aABFq7UveicTU6yv1hTbomRiy+pOXQjZvGZkf0SPPFMrTOqBBsDuSI8O/e+SUmj2F5g9y+pWb+6dF4xWfw5v0YhygN79QXVJG6sS1i+KeHmbjWC2vUGULTI9m4287aqM0FT3vZTsANG1NnBiNak/npeh3AsHeFObwgmImvxQreltf8tfI+wVb+QV7G45/N9r3t3fWx56ylSfkiVp6Eiehn+ASBAJqIky1qe5/ouOROl09uaytvrSKpyHfdE8YlsAkmTQXrFsYs/VCstUEIFlGCYpHS5DLm6xUQFr8bq9OE1ra++FUVLlyDpOOVnfFn1OMrdrNnp7ZUad/VTn/R+ZAWBAmhA1hhNnrf87XRCDMCfuPqLj4jU6mIpsKgPMDu0ftOj8hZrsGQImlmeNOwuS5hClu6KjXV+dJVvLjth7j20zjP8hMSDwDOe4QQyO/m7wZY+b06u4YAi0b+w/jlRhF0PjFMNMTx+5P+DTFd9rr9TUT7rnwo7XHWA05rneBtOMkC10zUVAAIGlbe41nHR3WcRyCfQQxa1Ws6KzVN+y74/CX2t5efQZfsAtkZ+4jPVrFvwsTKG7vODkmf5Npn+DyfmndlliAIHsJmggX4pU1/q3/+m7x9JxMO904pU1Ln7EMqxHXg57t2rJTvAulQ8PGqEkV1J9SsFJgckuhgvmUXsOWUnfReLRb/KeLE84G7ZmojtI2an+i4al0Ff9ryvmdQ52whGF/jbAljAlrwpywT5eBc8zGUSLbIRvCrYL9ZBwZ774KcXOhzApWrHPng3ehADAxSP4LU5hnVOjxu1zrD9Aip2G8/ioxOHQEDPRMGpt2820kP+LuSkjYEsaENWFO2DOUgStc0e4n2yEbcoW+w0TJJzt2Pnh3oWQLbgIQg9aekfO5FimYWaHCOZZeiOuxrPX7jtFThEKPQFuv8T0scrohKIoKM3VBR30ca0QKuwquARD5jvab7sVCYywMC8aFo6ZWN/eMnBcMaZWUfiNAtkI247cctvnDFy2ftJ3ho4RF1QAoe2tP8izse3X/R6Tk/ma1GYVow8gAdeioSyGQEQH0+K/Am78dVX89YwIJb9ICLEx++2MxohUdAMCMY0TgrxgRWFAMY5/yDGB3m0YnN8vwSQ/F1gUEWrcm6nhU6wJpx1d0uiCuRRJtf+og/SR+iGJ4FNUESDPChDZ2bTFMfcxTzaJah2w7y/iIh2KdRsCyCdgGfgbG+S3RR32wKOen/KUEAEbVaVrYYQkSkP9Q5TmMRaPrmnr3Hh4QkZWYLiNg2QJswrINl3k5SZ58r9QmbUkBgJQxjNTV+Eg4qZjbtFDQcyIstm5p13sHuc1L0ZcbAbIBsgWyCbkl3U+6RNr39ntQyI2SA8D6RRU7sBnHzwthKkNams1YdUB1uwoCMpSGPzJQ2ZMNBGRm6wSQyOfI9ybcLOJHyQHA4pn88EY0QgK3nBVTSxuqaqo3quZAEZYT8CxU5lT2ZANBU8XyNficE3I7EgA6Fx36IUuZMp/UkxUriv4RHu9WHYNZIQrdAyprKvMgvvmtwoCvWT7nQMmg6ePchWHBDQC10TmK3lFCVH2LJc1WNUToHeZ+cKKhPhoJguEf5gf/Unli2K8Lw37LSqUzlt+RGsAYsVQidRmGBofGfgfpkwyCxoCtiSBBElzJahsBKlsq46A6P/mW5WO2Nc6f0NEAsK6h4m/onFidn620KappFpiaNixt+RQtmFWmKFsQCNY4/ziNybfIx8bdKvmrowGApBka2PQTVFMCu9UVTQHVsNDJWgxCO8GoK9gI0HbtWNhDZRqk6b2TQSefIt+afL/U36gNOX+N7vGmbQ0y4KOoiMeGjZELg7Ynv/MlGkyK1vFltByc8eXB1CBthdZ+E+ZCN7aRc+UNR4IKbgZtmnAGG+HL49GKp2lXmAwP1S2JEaAyo7ILuvMTxORLbjg/0XYlABDhztrYz1Bt8XR7buLr9IVazAzaEor2hXNtYxGnhS5neqjyU1lRmVHZBR0K8iHyJbf0cKUJMCZs21/eP1hUVT8FJrPH7gX5E4XRxcyRC7zccjzIeHktO23dTbv3BnUoejJeGJp+hQ8OnNT+qYPem/zMqd+uBgASsrU3sRAVjb8Evz8gDTmdOyDYV7w+fMSpAg8rHexP8WnY2H9g01DX9oD0ErvRPQ/NT3XUxba6ydf1AEDCY4LQ1xGVb3VTEa9pozbQnkwlr/DrLEKv9ZWVH53VR8d1wb7aZJWxGLlgX1djwo/jvf6TZfEkABDT1j7jz5h3fcZkAQL9GxMzsCTzX8WeXTd3ts4bCbQuAROejujm0+Z8Azb1v/HWl/qgzkKhtZb51ur/WGi+YtK71gk4WZjUyOAlmMn035PvB/o3DA9vnhu16XOew5HRKwOtS4CEJ6wJc8I+bM5PPmL5ikfl4VkNgPRp3mos1iJ8I9pqUY/085aNYH8YSiSu2tBQ9XdvGZcHt2Xdg0dUxmI/hdN/Nowao92fNFNiydqF+pNe6edpACCl0BSgalvec8u9AsBxPoINYsfk24YM4xYVCJxB13J8Xb8G07Qvg/NXOUNVPiqo+l/bUasXfLhHKZp4HgAgLEcQuB9BAIdAhvpKYBjnN8mk8SPVUVhcOVMHnx7VaZn5JfiLFUclGLng/A/A+emkKZiNd5cfAYAt7dpZUXXAkdiGiS/xTlV/OFG1Dm+t3/NE6qb2xfEX/ZEiWFzbnhw5VsQi34IrnB/a5uK4IoHzbxz88LWmxxvnDo+77clXXwIAaXZ677sHxngN7chS0GGGnqDiDhOcVSoeYFz8sL021ucOi2BTbetL1GLe63Wo6lPt0LMOaj9Rg/M/mxD9Sx6tO+QDP+TwLQCQsrQtk7UzC2Nz/FDeP544NlywOzGr8O5yn1WYnr13Ad70F6F1mPkYcP8KylXOqOvvSomRhnV1U95wlVEO4r4GAJJrxZbheboe3QxBArlDSw5s8z8SLCW4WM9M8873jD0PPtkwK5CbqeRXdGKKxd2vVh6sTzuTadpFOH0XJ/GwyMQU4f8F53/LMJKnOLGxZylo+R4ASPggnshSCugZ8wrWLzi73zTFnWvb12zEwiMzY7qg3sQinea2by/RNA6nZ2fD6WuCqooDcktzQpUUAYAAbesxTmeatWNLqHt7bRrP+5gK+gQ6hDckhdjwSH38BeTztHfYppy5kvGVPSPHRTlfhqr9MkzaOQ2J1TkMdIaGKdra6/VHc4Hn1TNpAgApTNs2WTu3wGK8AiAIfKi6CPfvYsLcYKTMDX5XG7NhZjXnItoyxumPNaIQy69Zlw0c3Ec5ChPHeK+tj9+TI5mnj6RztLbexBUwoMAdNOJpqTH2OkYUnoNBbedMbE+ZfDs3je2di6pe80KOli2DRwpNPyaiiWME48fAiI5Bz/0J4D3TC/6B5SHMK9vrYr+QSX7pAgCBg4lC12N4cLVMQAVBFgSEvVyI7XBK/IkdGhNvo1+hn5ka+hdEv0ixfi1iDpiG2W9oRv/uV17tJ71mzJ5Vo5t6jaZrNWZKq+YRVoPOuRqmmfhkNSbjU1Ee8xBsjhHccvgpQcBDKhmFuL69Tv++VDJBGCkDAIFENQHBtX+DgNLKKFthKnnkQ4Cq/VyYX5XtzT+GlNTORX0CES1yB4RVHYNjJaY+g4RAImWmLpapzT8ZPKkDAAmbHh34L3wN7H7uk0FXv8sCgQH09n9Glt7+bIhLHwBI8KAf55QNfHU/nAig2h+YY+YCEQDITNIzBh+BwHPCaTZKqzAgAOffhRl+K2Udqp2McWAWXBCgNG+aFk9MVkL9VgjIgADZJtloUJyfMAtMACBhadEErZwC0Bvpt7oUArIgQDZJtunnwp5isAhUACAFadkkrZ0G4A8Uo7DKoxBwGgGyRbJJv5b0lqJPYPoAMijJW3qwvRjna8ph04gM+qtbPiNAm71gzca3O+utbbzQ/A/eFeQAYKFNG41GIvweTBf6WPDgVxIHFgHavTclzvNyA083sApcE2AyCFQAycTek1ANe2jyM/VbIeAGAmRrZHNBd37CJvA1gHEFzLFf/NcxZ/0mNAn0cffVV4WAIwigym/A+b/VOXpiTyCr/JOBCFMAsHSzziLk2r1QbPZkZdVvhUCxCMDbX8Fi3nPdPquvWPmKzRf4JsBkxamA6ERVdM4E/mjyybqp3/4gQLZENhU25yc0Q1cDGG8irT2Jq7C3wI9Uk2A8Kuq7XQSoyo+3/jc76nEaUUivUAcAKrOWnsRJGCr8Nf5OCmkZKrVcQABv/afw98XO+thTLpCXhmTomgCTkaUCHOzfdDI22/wm9mQqi113J2OgfheAAGyEbIVsJuzOT6iEvgYwvuibuoc/EYlFbkNtoHH8ffVdIUAI4I3flUqkLlvXUPG3ckGkrALAWKGiWfAFrmk3QflpY/fUZ/kigB7+PSxlXtdxcuw35YZC6JsAmQoUVbv/FMYH80whbsHzRKY06l5ZIJAgGyBbKEfnpxIuyxrAeNMe3WcgcismEJ0x/r76Hm4EaDafYaSuDtLSXTdKpOwDwBiorT0GHVH1Y/QPLBi7pz7DhwDa+U+jM/jajnp9ffi0K1wjFQAmYsZbe5KrOBc3YJ/74yY+Ur8CjYAQLwjBr++oj9IycjT71UUIlGUfQI6iFzCQP7Y/vGa+wAkueFu8lCOtehQABKgMqSypTKlsIbJy/nHlpmoA48DY7+t990Va5p55ocb5N1AjOH6/5+qGvAgI8Tw6+G7u3PngXeycc1LyCuqvZCoA2MS/uc9owhnW16Df9HSbWVQyXxAQj8Lbb1lbq6/zhX3AmKoAUGCBNW1NnBiJalejInmeWmNQIHguJbfm7HN2Typp3rpuYewZl9iEkqwKAEUW6/ItA9NjkfjFmsa+hFrBvCLJqGwlISB2mCb7VSI1csdji6rfLIlUmWZWAcCBgm/uMZain+DLGEY8C4DGHSCpSGRBAD14I6h9/RHt+1+urdcfz5JM3baJgAoANoGyk6yp+4NDIrHKc1AjOAfzCU5DHjXKYge4/Gng7+IJdODfl0oM3beu4cB382dRKewgoAKAHZSKSNO6bWAGi8TOwjHb5+JI7VMBtMK6ABzxpsepumIT/ruXpRJ/7Di5encB2VVSmwgoo7QJVCnJVmzaO1OP62dgKLEFNYPloKUOOs0M6ADe9I9hWV6nMWI8tP7UKa9nTqbuOoWACgBOIWmTznH3vRCbc9TRp6DnGsGAtZT9/AKM1wOLTmDRuZs9s6mvrs6wCaVK5gACKgA4AGIpJFo29h/GqipPQY33FI0zfPJa0IuVQlPivFh5KfpMwTZDz81scGhz55KatySWN/SiqQAgWREv7dpZUVFzZB0KZiFWKM6Hw8xHLeFY/A7U6MJob714EY7+LFbe4Y9tHe5/rffxxrnDkkFe1uKoABCA4l/a1RWtrGw4WkTYfGxkcjw6Fo9CYJgL55qDqvMMP1VA9R2dc2IXZNmJDruXhWk+z1Ps2aGh7pceb2xM+imb4p0fARUA8mMkdYrF3a9W1sSmzY6ICAKCeTjX+KEQeCr60PEppqKA6ffBgvEKfMYxFhHDvRjG0qlGMdbUSOD+CN7SCdynDVJGOBP0pn4P996Bc7/NuMAne1uY9Km9keKpnf2JPa882TBL7bMIYIJ6/X8QmpCW0hsGOwAAAABJRU5ErkJggg==")
  18610. };
  18611. t.prototype.setScene = function(e) {
  18612. this.createCpm(e),
  18613. this.createBunnyObj(e)
  18614. }
  18615. ,
  18616. t.prototype.updateModel = function() {
  18617. this.model = this.modelManager.getActiveModel()
  18618. }
  18619. ,
  18620. t.prototype.bindEvents = function() {
  18621. this.modelManager.on(r.ActiveModelChanged, this.updateModel.bind(this))
  18622. }
  18623. ,
  18624. t.prototype.updateDefaultsFromModelData = function() {
  18625. this.model.data
  18626. }
  18627. ,
  18628. t.prototype.pointPathDistance = function(e) {
  18629. for (var t = 0, i = 1; i < e.length; i += 1)
  18630. t += e[i - 1].distanceTo(e[i]);
  18631. return t
  18632. }
  18633. ,
  18634. t.prototype.pointPathLengths = function(e) {
  18635. for (var t = [0], i = 1; i < e.length; i += 1)
  18636. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  18637. return t
  18638. }
  18639. ,
  18640. t.prototype.interpAlongPath = function(e, t, i) {
  18641. var n, r = new P.Vector3, o = t[t.length - 1];
  18642. if (i < 1) {
  18643. n = i * o;
  18644. for (var a = 1; a < t.length; a += 1)
  18645. if (t[a] > n) {
  18646. var s = (n - t[a - 1]) / (t[a] - t[a - 1]);
  18647. return r.copy(e[a]),
  18648. r.sub(e[a - 1]),
  18649. r.multiplyScalar(s),
  18650. r.add(e[a - 1]),
  18651. r
  18652. }
  18653. } else
  18654. r.copy(e[e.length - 1]);
  18655. return r
  18656. }
  18657. ,
  18658. t.prototype.pathHeight = function() {
  18659. return this.player.mode !== O.FLOORPLAN ? D.path.height : D.path.outsideHeight
  18660. }
  18661. ,
  18662. t.prototype.createBunnyObj = function(e) {
  18663. this.bunnyObj || (this.bunnyObj = new P.AxisHelper(.1),
  18664. this.bunnyObj.visible = D.warp.showBunny),
  18665. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  18666. e.add(this.bunnyObj)
  18667. }
  18668. ,
  18669. t.prototype.createCpm = function(e) {
  18670. if (!this.currentPanoMarker) {
  18671. var t = this.makeWaypointObj(I.pathEnd, "Current");
  18672. t.material.uniforms.opacity.value = 0,
  18673. this.currentPanoMarker = {
  18674. mesh: t,
  18675. placed: !1
  18676. }
  18677. }
  18678. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18679. this.placeCpm(),
  18680. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  18681. }
  18682. ,
  18683. t.prototype.placeCpm = function() {
  18684. if (D.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  18685. var e = this.player.currentPano.floor;
  18686. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18687. e.add(this.currentPanoMarker.mesh)),
  18688. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  18689. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  18690. this.currentPanoMarker.placed = !0
  18691. } else
  18692. this.popOutCpm()
  18693. }
  18694. ,
  18695. t.prototype.fadeInCpm = function(e) {
  18696. this.player.mode === O.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || D.path.mapGuides && this.currentPanoMarker.placed && V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 1), e)
  18697. }
  18698. ,
  18699. t.prototype.fadeOutCpm = function(e) {
  18700. V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  18701. }
  18702. ,
  18703. t.prototype.popInCpm = function() {
  18704. D.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  18705. }
  18706. ,
  18707. t.prototype.popOutCpm = function() {
  18708. this.fadeOutCpm(2)
  18709. }
  18710. ,
  18711. t.prototype.brushPrefs = {
  18712. linewidth: 7,
  18713. strokeWidth: 15,
  18714. cvSegments: 48,
  18715. paveStep: .1,
  18716. paveWidth: .2,
  18717. lookBlendDist: 3,
  18718. maxTurn: P.Math.degToRad(2)
  18719. },
  18720. t.prototype.panoPathDistance = function(e) {
  18721. var t = this.model.panos;
  18722. if (!e || e.length < 2)
  18723. return 0;
  18724. for (var i = [], n = 0; n < e.length; n += 1)
  18725. i.push(t.get(e[n]).floorPosition);
  18726. return this.pointPathDistance(i)
  18727. }
  18728. ,
  18729. t.prototype.loadTileTexture = function(t) {
  18730. var e = n.load(t, function(e) {
  18731. e.wrapS = P.RepeatWrapping,
  18732. e.wrapT = P.RepeatWrapping,
  18733. e.needsUpdate = !0,
  18734. H.debug('path texture "' + t + '" is ready')
  18735. }, function() {
  18736. H.error('path texture "' + t + '" failed')
  18737. });
  18738. return e.mapping = P.UVMapping,
  18739. e
  18740. }
  18741. ,
  18742. t.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  18743. return new l({
  18744. cameraMode: n,
  18745. position: e,
  18746. quaternion: t,
  18747. panoId: i,
  18748. orthoZoom: o,
  18749. floorVisibility: r,
  18750. thumbUrl: null,
  18751. name: null
  18752. })
  18753. }
  18754. ,
  18755. t.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  18756. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  18757. }
  18758. ,
  18759. t.prototype.setWarpDestination = function(e) {
  18760. this.warpDestHeroLoc = e
  18761. }
  18762. ,
  18763. t.prototype.setWarpDestinationByHeroIndex = function(e) {
  18764. var t = this.getHeroDescriptorByHeroIndex(e);
  18765. return null !== t && (this.setWarpDestination(t),
  18766. !0)
  18767. }
  18768. ,
  18769. t.prototype.setWarpDestinationByPano = function(e, t) {
  18770. return !!this.model.panos.get(e.id) && this.setWarpDestinationByPanoId(e.id, t)
  18771. }
  18772. ,
  18773. t.prototype.setWarpDestinationByPanoId = function(e, t) {
  18774. var i = this.model.panos.get(e);
  18775. if (i) {
  18776. t = t || new P.Quaternion;
  18777. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  18778. return this.setWarpDestination(n),
  18779. !0
  18780. }
  18781. return !1
  18782. }
  18783. ,
  18784. t.prototype.getHeroDescriptorByHeroIndex = function(e) {
  18785. var t = this.model.heroCount();
  18786. if (null !== this.warpDestHeroLoc && t < 1)
  18787. return H.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  18788. this.model.getHeroDescriptorByIndex(0);
  18789. var i = this.model.getHeroDescriptorByIndex(e);
  18790. if (i) {
  18791. var n = i.isPano() ? i.panoId : i.cameraMode;
  18792. H.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  18793. }
  18794. return i
  18795. }
  18796. ,
  18797. t.prototype.getHeroDescriptorByPano = function(e) {
  18798. return this.model.panos.get(e.id) ? this.getHeroDescriptorByPanoId(e.id) : null
  18799. }
  18800. ,
  18801. t.prototype.getHeroDescriptorByPanoId = function(e) {
  18802. var t = this.getHeroIndexFromPanoId(e);
  18803. return this.getHeroDescriptorByHeroIndex(t)
  18804. }
  18805. ,
  18806. t.prototype.getHeroIndexFromPanoId = function(e) {
  18807. for (var t = 0; t < this.model.heroLocations.length; t++) {
  18808. var i = this.model.heroLocations[t]
  18809. , n = this.getHeroId(i);
  18810. if (n && n === e)
  18811. return t
  18812. }
  18813. return -1
  18814. }
  18815. ,
  18816. t.prototype.getHeroPano = function(e) {
  18817. if (null === e)
  18818. return H.warn("getHeroPano(): no destination"),
  18819. null;
  18820. var t = this.getHeroId(e)
  18821. , i = this.model.panos.get(t);
  18822. return void 0 === i && (i = null,
  18823. "" !== t && H.debug('unable to find pano "' + t + '"')),
  18824. i
  18825. }
  18826. ,
  18827. t.prototype.getHeroId = function(e) {
  18828. return e.panoId
  18829. }
  18830. ,
  18831. t.prototype.setWarpDestPano = function() {
  18832. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  18833. this.warpDestPano
  18834. }
  18835. ,
  18836. t.prototype.brushToWarpPano = function(e, t) {
  18837. if (this.discardPathObject(),
  18838. !this.setWarpDestPano())
  18839. return !1;
  18840. if (this.warpDestHeroLoc.cameraMode !== O.PANORAMA && H.warn("Can only brush from pano to pano"),
  18841. !this.warpDestPano)
  18842. return H.info("No brush"),
  18843. !1;
  18844. if (!this.player.currentPano)
  18845. return H.debug("No current pano, visibility undefined"),
  18846. !1;
  18847. if (!this.warpDestPano)
  18848. return H.info("No wPano, visibility undefined"),
  18849. !1;
  18850. if (!this.warpDestPano.isAligned())
  18851. return H.debug("Cannot brush to unaligned pano"),
  18852. !1;
  18853. var i = (e === L.STD || e === L.WALK) && D.path.mapGuides
  18854. , n = !0;
  18855. if (this.player.currentPano.id === this.warpDestPano.id)
  18856. H.debug("Already at destination pano");
  18857. else {
  18858. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18859. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  18860. this.obj3d = new P.Object3D,
  18861. H.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  18862. n ? (H.info('No "walkable" route, using fall-back warp style transition'),
  18863. e = t) : (this.setPathHulls(this.nodes),
  18864. this.setFloorCurves(),
  18865. i && ("chevron" === D.path.style ? this.obj3d.add(this.drawPathPavement(this.floorCurvePoints)) : "ribbon" === D.path.style && this.obj3d.add(this.drawPathRibbon(this.floorCurvePoints, this.floorCurveColors)))),
  18866. this.player.currentPano.floor.add(this.obj3d);
  18867. var r = this.player.mode === O.DOLLHOUSE || this.player.mode === O.FLOORPLAN
  18868. , o = e === L.STD;
  18869. if (!n && (i || o)) {
  18870. if (r) {
  18871. var a = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  18872. this.obj3d.add(a)
  18873. }
  18874. var s = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  18875. this.obj3d.add(s)
  18876. }
  18877. this.appearSlow()
  18878. }
  18879. return this.upcomingTransType = e,
  18880. !n
  18881. }
  18882. ,
  18883. t.prototype.findShortestPath = function(e, t) {
  18884. if (!e || !t)
  18885. return null;
  18886. var i = D.warp.walkExtraPanosDistance
  18887. , n = e.id + ":" + t.id + ":" + i;
  18888. if (this.shortPaths.hasOwnProperty(n))
  18889. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  18890. var r = t.id + ":" + e.id + ":" + i;
  18891. if (this.shortPaths.hasOwnProperty(r))
  18892. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  18893. var o = this.model.panos.aStarSearch(e, t);
  18894. return this.model.panos.includeNodesNearPath(o, i),
  18895. this.shortPaths[n] = o ? o.slice() : null,
  18896. o
  18897. }
  18898. ,
  18899. t.prototype.makePathHulls = function(e) {
  18900. var t, i, n, r, o, a = 0, s = [], l = [], c = [], h = this.model.panos;
  18901. r = (t = h.get(e[0])).floor.floorIndex;
  18902. for (var u = 0; u < e.length; u += 1)
  18903. (i = (t = h.get(e[u])).floorPosition.clone().sub(this.model.position)).y += this.pathHeight(),
  18904. s.push(i),
  18905. l.push(t.position.clone()),
  18906. n = t.floor.floorIndex,
  18907. c.push(r < n ? D.path.colorUp : n < r ? D.path.colorDown : D.path.color),
  18908. 0 < u && (a < (o = l[u].distanceTo(l[u - 1])) && (a = o));
  18909. return a > this.longestStep && (this.longestStep = a,
  18910. H.debug("path contains " + a + " meter segment")),
  18911. {
  18912. floor: s,
  18913. camera: l,
  18914. color: c
  18915. }
  18916. }
  18917. ,
  18918. t.prototype.makeFloorCurves = function(e, t, i) {
  18919. var n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  18920. , r = this.pointPathDistance(e) - 2 * n
  18921. , o = e.slice(0)
  18922. , a = o[1].clone().sub(o[0]);
  18923. a.y = 0,
  18924. a.normalize().multiplyScalar(n),
  18925. o[0] = (new P.Vector3).copy(o[0]).add(a),
  18926. (a = o[o.length - 2].clone().sub(o[o.length - 1])).y = 0,
  18927. a.normalize().multiplyScalar(n),
  18928. o[o.length - 1] = (new P.Vector3).copy(o[o.length - 1]).add(a);
  18929. var s = new P.CatmullRomCurve3(o)
  18930. , l = Math.floor(r / i);
  18931. l = 4 * Math.floor(l / 4),
  18932. l = Math.max(4, l);
  18933. for (var c, h, u = s.getSpacedPoints(l), d = [], p = new P.Vector3, f = 0; f < u.length; f += 1) {
  18934. h = 0,
  18935. c = u[f].distanceTo(e[0]);
  18936. for (var g = 1; g < e.length; g += 1)
  18937. p.copy(u[f]).sub(e[g]),
  18938. p.y *= 4,
  18939. p.length() < c && (h = g);
  18940. d.push(t[h])
  18941. }
  18942. return {
  18943. distance: r,
  18944. points: u,
  18945. colors: d
  18946. }
  18947. }
  18948. ,
  18949. t.prototype.makeCameraCurvePoints = function(e, t) {
  18950. var i = this.pointPathDistance(e);
  18951. return new P.CatmullRomCurve3(e).getSpacedPoints(Math.max(2, Math.floor(i / t)))
  18952. }
  18953. ,
  18954. t.prototype.makeCameraCurveTangents = function(e, t) {
  18955. var i = this.pointPathDistance(e)
  18956. , n = new P.CatmullRomCurve3(e)
  18957. , r = Math.max(2, Math.floor(i / t));
  18958. r = r || 5;
  18959. for (var o = [], a = 0; a <= r; a++)
  18960. o.push(n.getTangentAt(a / r));
  18961. return o
  18962. }
  18963. ,
  18964. t.prototype.setPathHulls = function(e) {
  18965. var t = this.makePathHulls(e);
  18966. this.floorHull = t.floor,
  18967. this.cameraHull = t.camera,
  18968. this.colorHull = t.color
  18969. }
  18970. ,
  18971. t.prototype.setFloorCurves = function() {
  18972. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  18973. this.floorPathDistance = e.distance,
  18974. this.floorCurvePoints = e.points,
  18975. this.floorCurveColors = e.colors
  18976. }
  18977. ,
  18978. t.prototype.setCameraCurvePoints = function() {
  18979. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, D.warp.stepFactor * this.brushPrefs.paveStep)
  18980. }
  18981. ,
  18982. t.prototype.chooseWarpPath = function(e) {
  18983. var t, i, n, r = this.playerControls.cameras[O.PANORAMA];
  18984. if (this.player.currentPano === this.warpDestPano || !e)
  18985. return this.warpPathPoints = null,
  18986. this.warpLength = 0,
  18987. !1;
  18988. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18989. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (H.debug("warp path to unreachable node"),
  18990. i = (t = this.warpDestPano.position.clone().sub(r.position)).clone().negate(),
  18991. t.multiplyScalar(.15).add(r.position),
  18992. i.multiplyScalar(.15).add(this.warpDestPano.position),
  18993. t.y = r.position.y,
  18994. i.y = this.warpDestPano.position.y,
  18995. n = new P.CubicBezierCurve3(r.position.clone(),t,i,this.warpDestPano.position.clone()),
  18996. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (H.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  18997. this.setCameraCurvePoints(),
  18998. this.warpPathPoints = this.camCurvePoints.slice(0)),
  18999. this.warpLength = 0,
  19000. this.warpPathLengths = [0];
  19001. for (var o = new P.Vector3, a = new P.Vector3, s = Math.cos(P.Math.degToRad(D.warp.minBrakeAngle)), l = Math.cos(P.Math.degToRad(D.warp.maxBrakeAngle)), c = 1; c < this.warpPathPoints.length; c += 1) {
  19002. o.copy(this.warpPathPoints[c - 1]).sub(this.warpPathPoints[c]);
  19003. var h = o.length();
  19004. o.y *= D.warp.climbEffort;
  19005. var u = o.length() / h;
  19006. if (1 < c) {
  19007. o.setY(0).normalize(),
  19008. a.copy(this.warpPathPoints[c - 2]).sub(this.warpPathPoints[c - 1]).setY(0).normalize();
  19009. var d = Math.min(1, o.dot(a))
  19010. , p = 1 + (D.warp.brakeStrength - 1) * (1 - P.Math.smoothstep(d, l, s));
  19011. u = Math.max(p, u)
  19012. }
  19013. this.warpLength += h * u,
  19014. this.warpPathLengths[c] = this.warpLength
  19015. }
  19016. return !0
  19017. }
  19018. ,
  19019. t.prototype.drawPathRibbon = function(e, t) {
  19020. /* let map = Texture.load('images/arrow.png')
  19021. map.anisotropy = 4
  19022. map.repeat.set(1, 6)
  19023. map.wrapS = THREE.RepeatWrapping
  19024. map.wrapT = THREE.RepeatWrapping
  19025. map.needsUpdate = true
  19026. */
  19027. this.bunnyObj.visible = D.warp.showBunny;
  19028. for (var i = .6 * D.path.ribbonWidth * .5, n = new P.Vector3, r = new P.Vector3(0,this.pathHeight(),0), o = new P.Geometry, a = new P.Vector3, s = 0; s < e.length; s += 1) {
  19029. a.copy(e[s]),
  19030. 0 === s ? a.sub(e[s + 1]) : a.sub(e[s - 1]).negate(),
  19031. a.normalize(),
  19032. n.crossVectors(a, U.UP),
  19033. n.multiplyScalar(i);
  19034. var l = (new P.Vector3).copy(e[s]).add(r);
  19035. l.sub(n),
  19036. o.vertices.push(l),
  19037. (l = (new P.Vector3).copy(e[s]).add(r)).add(n),
  19038. o.vertices.push(l)
  19039. }
  19040. var c, h, u, d = 0;
  19041. for (s = 0; s < e.length - 1; s += 1) {
  19042. var p = 2 * s
  19043. , f = d
  19044. , g = d += e[s + 1].distanceTo(e[s])
  19045. , m = t[s]
  19046. , v = t[s + 1];
  19047. (c = new P.Face3(p,1 + p,2 + p)).vertexColors = [new P.Color(m), new P.Color(m), new P.Color(v)],
  19048. o.faces.push(c),
  19049. o.faceVertexUvs[0].push([new P.Vector2(0,f), new P.Vector2(1,f), new P.Vector2(0,g)]),
  19050. (c = new P.Face3(2 + p,1 + p,3 + p)).vertexColors = [new P.Color(v), new P.Color(m), new P.Color(v)],
  19051. o.faces.push(c),
  19052. o.faceVertexUvs[0].push([new P.Vector2(0,g), new P.Vector2(1,f), new P.Vector2(1,g)])
  19053. }
  19054. o.computeFaceNormals(),
  19055. o.computeVertexNormals(),
  19056. h = this.player.mode === O.PANORAMA ? ((u = P.UniformsUtils.clone(C.ribbon.uniforms)).map.value = I.path,
  19057. u.opacity.value = 0,
  19058. u.color.value.set(D.path.color),
  19059. new P.RawShaderMaterial({
  19060. side: P.DoubleSide,
  19061. depthWrite: !1,
  19062. transparent: !0,
  19063. vertexShader: C.ribbon.vertexShader,
  19064. fragmentShader: C.ribbon.fragmentShader,
  19065. uniforms: u,
  19066. name: "ribbonT",
  19067. opacity: 0
  19068. })) : new P.MeshBasicMaterial({
  19069. color: 16777215,
  19070. side: P.DoubleSide,
  19071. name: "ribbonOut",
  19072. vertexColors: P.VertexColors,
  19073. /* transparent:true,
  19074. map */
  19075. });
  19076. var y = new P.Mesh(o,h);
  19077. return y.name = "ribbon",
  19078. this.player.mode === O.PANORAMA && (y.renderOrder = A.ribbon),
  19079. y
  19080. }
  19081. ,
  19082. t.prototype.drawPathPavement = function(e) {
  19083. for (var t, i = new P.Vector3, n = new P.Geometry, r = new P.Vector3, o = 0; o < e.length; o += 1)
  19084. r.copy(e[o]),
  19085. 0 === o ? r.sub(e[o + 1]).negate() : r.sub(e[o - 1]),
  19086. r.normalize(),
  19087. i.crossVectors(r, U.UP),
  19088. i.multiplyScalar(this.brushPrefs.paveWidth),
  19089. (t = (new P.Vector3).copy(e[o])).sub(i),
  19090. n.vertices.push(t),
  19091. n.vertices.push((new P.Vector3).copy(e[o])),
  19092. (t = (new P.Vector3).copy(e[o])).add(i),
  19093. n.vertices.push(t);
  19094. var a, s, l;
  19095. for (o = 0; o < e.length - 1; o += 1)
  19096. a = 3 * o + 1,
  19097. l = .25 + (s = .25 * o),
  19098. n.faces.push(new P.Face3(a - 1,a,3 + a)),
  19099. n.faceVertexUvs[0].push([new P.Vector2(0,s), new P.Vector2(.5,s), new P.Vector2(.5,l)]),
  19100. n.faces.push(new P.Face3(3 + a,2 + a,a - 1)),
  19101. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(0,l), new P.Vector2(0,s)]),
  19102. n.faces.push(new P.Face3(3 + a,a,1 + a)),
  19103. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(.5,s), new P.Vector2(1,s)]),
  19104. n.faces.push(new P.Face3(3 + a,1 + a,4 + a)),
  19105. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(1,s), new P.Vector2(1,l)]);
  19106. var c = this.player.mode === O.PANORAMA ? new P.MeshBasicMaterial({
  19107. color: D.path.color,
  19108. side: P.DoubleSide,
  19109. transparent: !0,
  19110. depthWrite: !1,
  19111. opacity: 0,
  19112. name: "paveT",
  19113. map: I.path
  19114. }) : new P.MeshBasicMaterial({
  19115. color: D.path.color,
  19116. side: P.DoubleSide,
  19117. transparent: !0,
  19118. depthWrite: !1,
  19119. opacity: 1,
  19120. name: "paveO",
  19121. map: I.path
  19122. });
  19123. return new P.Mesh(n,c)
  19124. }
  19125. ,
  19126. t.prototype.hintPrefs = {
  19127. rad: .18,
  19128. width: .0125,
  19129. depth: .0625,
  19130. setBack: -.04,
  19131. markRad: .25,
  19132. markInnerRad: .16
  19133. },
  19134. t.prototype.makeWaypointObj = function(e, t) {
  19135. var i = new P.Geometry
  19136. , n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  19137. , r = this.pathHeight();
  19138. i.vertices.push(new P.Vector3(-n,r,n), new P.Vector3(-n,r,-n), new P.Vector3(n,r,-n), new P.Vector3(n,r,n)),
  19139. i.faces.push(new P.Face3(0,1,2), new P.Face3(2,3,0)),
  19140. i.faceVertexUvs[0].push([new P.Vector2(0,0), new P.Vector2(1,0), new P.Vector2(1,1)]),
  19141. i.faceVertexUvs[0].push([new P.Vector2(1,1), new P.Vector2(0,1), new P.Vector2(0,0)]);
  19142. var o = P.UniformsUtils.clone(C.waypoint.uniforms);
  19143. o.map.value = e,
  19144. o.opacity.value = 0,
  19145. o.color.value.set(D.path.color);
  19146. var a = {
  19147. side: P.DoubleSide,
  19148. depthWrite: !1,
  19149. transparent: !0,
  19150. vertexShader: C.waypoint.vertexShader,
  19151. fragmentShader: C.waypoint.fragmentShader,
  19152. uniforms: o,
  19153. name: "waypoint",
  19154. opacity: 0
  19155. };
  19156. this.player.mode !== O.PANORAMA && (a.depthTest = !1,
  19157. a.name = "wayPtOut");
  19158. var s = new P.RawShaderMaterial(a)
  19159. , l = new P.Mesh(i,s);
  19160. return l.name = t,
  19161. l
  19162. }
  19163. ,
  19164. t.prototype.makeStartMarker = function(e, t) {
  19165. var i = (new P.Vector3).copy(t[1]).sub(t[0]);
  19166. i.y = 0,
  19167. i.normalize();
  19168. var n = Math.acos(i.x)
  19169. , r = this.makeWaypointObj(I.pathStart, "Start");
  19170. return r.rotateOnAxis(new P.Vector3(0,1,0), n),
  19171. r.position.copy(e),
  19172. r
  19173. }
  19174. ,
  19175. t.prototype.makeEndMarker = function(e) {
  19176. var t = this.makeWaypointObj(I.pathEnd, "End")
  19177. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  19178. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  19179. return i < n ? t.material.uniforms.color.value.set(D.path.colorUp) : n < i && t.material.uniforms.color.value.set(D.path.colorDown),
  19180. t.position.copy(e),
  19181. t
  19182. }
  19183. ,
  19184. t.prototype.pathClean = function(e) {
  19185. if (e) {
  19186. for (var t in e.children)
  19187. this.pathClean(e.children[t]);
  19188. e.geometry && e.geometry.dispose(),
  19189. e.material && e.material.dispose()
  19190. }
  19191. }
  19192. ,
  19193. t.prototype.discardPathObject = function() {
  19194. if (this.obj3d) {
  19195. var e = this.obj3d.parent;
  19196. e && e.remove(this.obj3d),
  19197. this.pathClean(this.obj3d)
  19198. }
  19199. this.obj3d = null,
  19200. this.popInCpm()
  19201. }
  19202. ,
  19203. t.prototype.discardSlow = function() {
  19204. if (this.obj3d) {
  19205. if (this.player.mode !== O.PANORAMA)
  19206. return void this.discardPathObject();
  19207. for (var e, t = 0, i = function() {
  19208. this.discardPathObject()
  19209. }
  19210. .bind(this), n = 0; n < this.obj3d.children.length; n += 1)
  19211. void 0 !== (e = this.obj3d.children[n]).material && !0 === e.material.transparent && (void 0 !== e.material.uniforms ? V.start(F.property(e.material.uniforms.opacity, "value", 0), D.path.fadeOutTime, i, 0, B[D.warp.blendEasing]) : V.start(F.property(e.material, "opacity", 0), D.path.fadeOutTime, i, 0, B[D.warp.blendEasing]),
  19212. t += 1,
  19213. i = null);
  19214. 0 === t && this.discardPathObject(),
  19215. this.player.mode !== O.PANORAMA && this.fadeInCpm(D.path.fadeInTime - 3)
  19216. }
  19217. }
  19218. ,
  19219. t.prototype.appearSlow = function() {
  19220. var e;
  19221. this.fadeOutCpm(D.path.fadeInTime);
  19222. for (var t = this.player.mode === O.PANORAMA ? D.path.opacity : 1, i = 0; i < this.obj3d.children.length; i += 1)
  19223. void 0 !== (e = this.obj3d.children[i]).material && !0 === e.material.transparent && (void 0 !== e.material.uniforms ? V.start(F.property(e.material.uniforms.opacity, "value", t), D.path.fadeInTime, null, 0, B[D.warp.blendEasing]) : V.start(F.property(e.material, "opacity", t), D.path.fadeInTime, null, 0, B[D.warp.blendEasing]))
  19224. }
  19225. ,
  19226. t.prototype.update = function() {
  19227. this.obj3d && this.obj3d.updateMatrixWorld()
  19228. }
  19229. ,
  19230. t.prototype.calcBurnsAmount = function(e) {
  19231. var n = P.Math.degToRad(D.warp.burnsAngle);
  19232. if (this.player.mode !== O.PANORAMA)
  19233. return this.player.mode === O.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir;
  19234. var t = this.burnsDir * n;
  19235. if (this.upcomingTransType === L.BLACK)
  19236. return t;
  19237. var i = e;
  19238. if (null === i)
  19239. return H.warn("Transition request for non-highlight"),
  19240. t;
  19241. var r = this.getHeroDescriptorByHeroIndex(i);
  19242. if (null === r)
  19243. return t;
  19244. if (!r.isPano())
  19245. return t;
  19246. function o(e) {
  19247. var t = Math.acos(Math.min(1, e.dot(l)))
  19248. , i = (new P.Vector3).crossVectors(l, e);
  19249. return Math.max(c, Math.min(Math.abs(t), n)) * Math.sign(i.y)
  19250. }
  19251. var a = this.getHeroPano(r)
  19252. , s = this.playerControls.cameras[O.PANORAMA]
  19253. , l = U.FORWARD.clone().applyQuaternion(s.quaternion).setY(0).normalize()
  19254. , c = Math.min(P.Math.degToRad(D.warp.minBurnsAngle), n);
  19255. if (a === this.player.currentPano)
  19256. return o(U.FORWARD.clone().applyQuaternion(r.quaternion).setY(0).normalize());
  19257. var h = this.findShortestPath(this.player.currentPano, a);
  19258. if (null == h || h.length < 1)
  19259. return H.debug("Empty path ahead..."),
  19260. t;
  19261. var u = this.makePathHulls(h)
  19262. , d = new P.CatmullRomCurve3(u.camera)
  19263. , p = Math.min(.1, D.warp.lookAheadDist / d.getLength());
  19264. return o(d.getPointAt(p).clone().sub(s.position).setY(0).normalize())
  19265. }
  19266. ,
  19267. t.prototype.waitNextStep = function(e, t, i) {
  19268. var o = null == i ? D.warp.tourStepDelay : i;
  19269. o = o != void 0? o: (this.lastTransType === L.BLACK ? m.tourStepDelaySlideShow : m.tourStepDelayDefault);
  19270. var a = new P.Euler
  19271. , s = new P.Vector3;
  19272. H.debug("Starting wait: " + (void 0 !== t));
  19273. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem)//this.model.heroLocations[this.director.currentItem[0]]
  19274. var l = currentLocation.dontRot || this.calcBurnsAmount(e)
  19275. , c = function() {
  19276. this.endWarpState(),
  19277. this.player.mode === O.DOLLHOUSE && (this.playerControls.cameras[O.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19278. t && t()
  19279. }
  19280. .bind(this)
  19281. , n = function(e, t) {
  19282. if (this.warpInterrupted)
  19283. return c(),
  19284. !0;
  19285. var i = t || 1e3 / 60;
  19286. if (D.warp.doBurns && !currentLocation.dontRot )
  19287. if (this.player.mode === O.PANORAMA) {
  19288. var n = this.playerControls.cameras[O.PANORAMA];
  19289. a.setFromQuaternion(n.quaternion, D.warp.eOrder);
  19290. var r = o == 0 ? l : i * l / o;
  19291. r = Math.sign(r) * Math.max(r, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  19292. a.y += r,
  19293. s.set(0, 0, -1),
  19294. s.applyEuler(a),
  19295. s.add(n.position),
  19296. n.controls.lookAt(s),
  19297. n.controls.lookVector.copy(s),
  19298. n.lookAt(s)
  19299. } else
  19300. this.player.mode === O.DOLLHOUSE ? this.playerControls.controls[O.DOLLHOUSE].rotationAcceleration.x = l : this.playerControls.controls[O.FLOORPLAN].absoluteScale *= .9996
  19301. }
  19302. .bind(this);
  19303. this.startWarpState(),
  19304. V.start(n, o, c, 0, B.easeInOutQuad, "wait");
  19305. }
  19306. ,
  19307. t.prototype.warpToNonPano = function(e) {
  19308. if (this.discardPathObject(),
  19309. this.warpDestHeroLoc.cameraMode === O.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === O.FLOORPLAN) {
  19310. var t = function() {
  19311. e && e()
  19312. }
  19313. .bind(this);
  19314. this.player.flyToNewMode({
  19315. mode: this.warpDestHeroLoc.cameraMode,
  19316. duration: D.warp.outsideTime,
  19317. warpDest: this.warpDestHeroLoc,
  19318. callback: t,
  19319. force: !0
  19320. })
  19321. } else
  19322. H.warn("no warp destination!!!"),
  19323. e && e()
  19324. }
  19325. ,
  19326. t.prototype._resetWarpShaderParams = function(e) {
  19327. this.player.mode === O.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  19328. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19329. }
  19330. ,
  19331. t.prototype._clearWarpShading = function() {
  19332. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  19333. this._resetWarpShaderParams(e[t]),
  19334. e[t].visible = !0;
  19335. this._resetWarpShaderParams(this.model.skybox)
  19336. }
  19337. ,
  19338. t.prototype._warpStopFlying = function() {
  19339. this.activeTransType = null,
  19340. this.placeCpm()
  19341. }
  19342. ,
  19343. t.prototype._wrapupTravelOnlyBits = function() {
  19344. this._warpStopFlying(),
  19345. this.warpPathPoints && (this.player.currentPano.exit(),
  19346. this.warpDestPano.enter(),
  19347. this.player.currentPano = this.warpDestPano),
  19348. this.player.spider.draw(),
  19349. this.placeCpm()
  19350. }
  19351. ,
  19352. t.prototype._wrapupTravel = function(e) {
  19353. this._wrapupTravelOnlyBits(),
  19354. this.warpCameraAim(e)
  19355. }
  19356. ,
  19357. t.prototype._wrapupWarpShading = function(e) {
  19358. this._clearWarpShading(),
  19359. this._wrapupTravel(e)
  19360. }
  19361. ,
  19362. t.prototype.wrapupWarpShadingOnly = function(e, t) {
  19363. t !== z.END && this._clearWarpShading(),
  19364. this._wrapupTravelOnlyBits(),
  19365. this.upcomingTransType = null,
  19366. e && e()
  19367. }
  19368. ,
  19369. t.prototype._warpCameraAim = function(e, t) {
  19370. var i = this.warpDestHeroLoc.quaternion
  19371. , n = this.playerControls.cameras[O.PANORAMA]
  19372. , r = new P.Vector3(0,0,1).applyQuaternion(i).normalize()
  19373. , o = new P.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize().dot(r)
  19374. , a = P.Math.radToDeg(Math.acos(o))
  19375. , s = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(i, D.warp.eOrder)
  19376. , l = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19377. , c = new P.Euler(s.x - l.x,s.y - l.y,s.z - l.z,D.warp.eOrder);
  19378. c.y = N.constrainedTurn(c.y),
  19379. this.burnsDir = Math.sign(c.y);
  19380. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19381. , u = new P.Vector3
  19382. , d = function(e, t) {
  19383. return !!this.warpInterrupted || (h.x = l.x + e * c.x,
  19384. h.y = l.y + e * c.y,
  19385. h.z = l.z + e * c.z,
  19386. u.set(0, 0, -1),
  19387. u.applyEuler(h),
  19388. u.add(n.position),
  19389. n.controls.lookAt(u),
  19390. n.controls.lookVector.copy(u),
  19391. void n.lookAt(u))
  19392. }
  19393. .bind(this);
  19394. /* return a > D.warp.minRotation ? (V.start(d, e, t, 0, B[D.warp.movementEasing])
  19395. , (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  19396. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  19397. )
  19398. : (H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim"),
  19399. void (t && t())) */
  19400. (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  19401. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  19402. return a > D.warp.minRotation ? V.start(d, e, t, 0, B[D.warp.movementEasing])
  19403. : (/* H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim") ,*/
  19404. void (t && t()))
  19405. }
  19406. ,
  19407. t.prototype._warpBendAim = function(e, t, i, n) {
  19408. var r = n || 0
  19409. , o = this.playerControls.cameras[O.PANORAMA]
  19410. , a = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19411. , s = (new P.Euler).setFromQuaternion(o.quaternion, D.warp.eOrder)
  19412. , l = new P.Euler(a.x - s.x,a.y - s.y,a.z - s.z,D.warp.eOrder);
  19413. l.y = N.constrainedTurn(l.y);
  19414. var c = Math.min(P.Math.degToRad(D.warp.softBendTilt), Math.abs(l.x));
  19415. l.x = c * Math.sign(l.x),
  19416. c = Math.min(P.Math.degToRad(Math.max(0, D.warp.softBendAngle)), c),
  19417. this.burnsDir = Math.sign(l.y),
  19418. c *= Math.sign(l.y),
  19419. l.y = c;
  19420. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19421. , u = new P.Vector3
  19422. , d = function(e, t) {
  19423. if (e < .5)
  19424. h.x = s.x + e * l.x,
  19425. h.y = s.y + e * l.y,
  19426. h.z = s.z + e * l.z;
  19427. else {
  19428. var i = (1 - e) * D.warp.softBendEnd;
  19429. h.x = a.x - i * l.x,
  19430. h.y = a.y - i * l.y,
  19431. h.z = a.z - i * l.z
  19432. }
  19433. u.set(0, 0, -1),
  19434. u.applyEuler(h),
  19435. u.add(o.position),
  19436. o.controls.lookAt(u),
  19437. o.controls.lookVector.copy(u),
  19438. o.lookAt(u)
  19439. }
  19440. .bind(this);
  19441. if(window.DATA.momentTourBlackNewType){
  19442. d(1)
  19443. }else return V.start(d, t, i, r, B[D.warp.movementEasing])
  19444. }
  19445. ,
  19446. t.prototype._warpStepCameraAim = function(e, t, i) {
  19447. var n = this.playerControls.cameras[O.PANORAMA]
  19448. , r = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19449. , o = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19450. , a = new P.Euler(r.x - o.x,r.y - o.y,r.z - o.z,D.warp.eOrder);
  19451. a.y = N.constrainedTurn(a.y),
  19452. this.burnsDir = Math.sign(a.y);
  19453. var s = new P.Euler(0,0,0,D.warp.eOrder)
  19454. , l = new P.Vector3
  19455. , c = function(e, t) {
  19456. e < .5 ? s.copy(o) : s.copy(r),
  19457. l.set(0, 0, -1),
  19458. l.applyEuler(s),
  19459. l.add(n.position),
  19460. n.controls.lookAt(l),
  19461. n.controls.lookVector.copy(l),
  19462. n.lookAt(l)
  19463. }
  19464. .bind(this);
  19465. return V.start(c, t, i, 0, B[D.warp.movementEasing])
  19466. }
  19467. ,
  19468. t.prototype.setBurnsDir = function() {
  19469. var e = this.playerControls.cameras[O.PANORAMA]
  19470. , t = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19471. , i = (new P.Euler).setFromQuaternion(e.quaternion, D.warp.eOrder)
  19472. , n = new P.Euler(t.x - i.x,t.y - i.y,t.z - i.z,D.warp.eOrder);
  19473. n.y = N.constrainedTurn(n.y),
  19474. this.burnsDir = Math.sign(n.y)
  19475. }
  19476. ,
  19477. t.prototype.stepWarpPath = function(firstPos, e ) {
  19478. var i = this.playerControls.cameras[O.PANORAMA];
  19479. var n = this.warpPathPoints ? this.warpPathPoints[0] : firstPos
  19480. if (!n){
  19481. return i.position.copy(this.warpDestPano.position),
  19482. !0;
  19483. }
  19484. /* if (!this.warpPathPoints)
  19485. return i.position.copy(this.warpDestPano.position),
  19486. !0;
  19487. var n = this.warpPathPoints[0] */
  19488. var r = this.warpDestPano.position;
  19489. if (null !== this.nodes && this.cameraHull && this.cameraHull.length > 1) {
  19490. var o = new P.Vector3;
  19491. e < .5 ? o.copy(this.cameraHull[1]).sub(n).normalize().multiplyScalar(D.warp.softPushDist * e).add(n) : o.copy(this.cameraHull[this.cameraHull.length - 2]).sub(r).normalize().multiplyScalar(D.warp.softPushDist * D.warp.softPushEnd * (1 - e)).add(r),
  19492. i.position.copy(o)
  19493. } else
  19494. e < .5 ? i.position.copy(n) : i.position.copy(r)
  19495. }
  19496. ,
  19497. t.prototype.interruptAndFastForward = function(e, t) {
  19498. this.warping && (this.warpInterrupted = !0,
  19499. this.warpInterruptionBlackoutStyle = e,
  19500. this.warpInterruptionTravelTime = t,
  19501. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = z.MIDDLE),
  19502. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = D.minWarpTime))
  19503. }
  19504. ,
  19505. t.prototype.warpCameraAim = function(e) {
  19506. var t = D.warp.minWarpTime;
  19507. if (this.upcomingTransType === L.BLACK)
  19508. t = D.warp.teleportTime;
  19509. else {
  19510. var i = this.playerControls.cameras[O.PANORAMA]
  19511. , n = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19512. , r = (new P.Euler).setFromQuaternion(i.quaternion, D.warp.eOrder)
  19513. , o = new P.Euler(n.x - r.x,n.y - r.y,n.z - r.z,D.warp.eOrder);
  19514. o.y = N.constrainedTurn(o.y);
  19515. var a = 1e3 * Math.abs(o.y) / P.Math.degToRad(D.warp.maxAimPerSec);
  19516. t = Math.max(t, a)
  19517. }
  19518. var s = function() {
  19519. this._warpStopFlying(),
  19520. this.discardSlow(),
  19521. e && e()
  19522. }
  19523. .bind(this);
  19524. this._warpCameraAim(t, s)
  19525. }
  19526. ,
  19527. t.prototype.warpCommonParameters = function(e, t, i, n) {
  19528. this.model.skybox.material.uniforms.blackout.value = n;
  19529. var r = F.uniform(this.model.skybox, "progress", 1)
  19530. , o = F.allUniforms(this.model.chunks, "progress", 1)
  19531. , a = !1
  19532. , s = function() {
  19533. if (this.warpInterrupted)
  19534. return a = !0
  19535. }
  19536. .bind(this)
  19537. , l = function(e, t) {
  19538. return i && a ? !(this.model.skybox.material.uniforms.progress.value = 0) : void r(e, t)
  19539. }
  19540. .bind(this)
  19541. , c = function(e, t) {
  19542. return i && a ? (o(0),
  19543. !0) : void o(e, t)
  19544. }
  19545. .bind(this);
  19546. V.start(s, e, null, t, null, "safeHaltWatch"),
  19547. V.start(l, e, null, t, B[D.warp.blendEasing], "skyboxProgress"),
  19548. V.start(c, e, null, t, B[D.warp.blendEasing], "chunkProgress")
  19549. }
  19550. ,
  19551. t.prototype.warpTravel_STD = function(e) {
  19552. var l, c = Math.min(D.warp.lookAheadMax, D.warp.lookAheadDist / this.warpLength), h = this.playerControls.cameras[O.PANORAMA], i = (Math.min(.25, 3 / this.warpLength),
  19553. Math.min(.35, 7 / this.warpLength)), u = new P.Euler(0,0,0,D.warp.eOrder), d = new P.Vector3, p = (new P.Euler).setFromQuaternion(h.quaternion, D.warp.eOrder), f = (new P.Euler).copy(p), g = h.position.clone(), m = new P.Matrix4, v = new P.Euler, t = D.warp.minWarpTime;
  19554. t += this.warpLength * D.warp.timePerMeter,
  19555. .01 < D.warp.flySpeed && (t = 1e3 * this.warpLength / D.warp.flySpeed);
  19556. function n(e) {
  19557. var t = i;
  19558. return P.Math.smoothstep(e, 0, t) * (1 - P.Math.smoothstep(e, 1 - t, 1))
  19559. }
  19560. var y = !1
  19561. , r = this.warpDestHeroLoc.quaternion
  19562. , o = new P.Vector3(0,0,-1).applyQuaternion(r).normalize()
  19563. , A = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  19564. , a = A.dot(o)
  19565. , C = P.Math.radToDeg(Math.acos(a))
  19566. , s = function() {
  19567. return m.lookAt(g, l, U.UP),
  19568. u.setFromRotationMatrix(m, D.warp.eOrder),
  19569. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19570. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19571. N.constrainedTurn(v.y)
  19572. }
  19573. .bind(this)
  19574. , I = function(e, t) {
  19575. if (this.warpInterrupted)
  19576. return y = !0
  19577. }
  19578. .bind(this)
  19579. , E = function(e, t) {
  19580. return y || !this.warpPathPoints ? (k.blur(0),
  19581. !0) : void k.blur(e)
  19582. }
  19583. .bind(this)
  19584. , _ = F.allUniforms(this.model.chunks, "modelAlpha", 1)
  19585. , b = function(e, t) {
  19586. return y || !this.warpPathPoints ? (_(0),
  19587. !0) : void _(e, t)
  19588. }
  19589. .bind(this)
  19590. , w = function(e, t) {
  19591. if (!this.warpPathPoints)
  19592. return h.position.copy(this.warpDestPano.position),
  19593. !0;
  19594. if (y)
  19595. return !0;
  19596. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  19597. h.position.copy(i),
  19598. g = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  19599. }
  19600. .bind(this)
  19601. , T = function(e, t) {
  19602. return this.warpPathPoints ? !!y || void (l = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + c, 1))) : (H.debug("Lost bunny."),
  19603. !0)
  19604. }
  19605. .bind(this)
  19606. , x = function(e, t) {
  19607. if (y)
  19608. return H.debug(">>>> Walkthrough interupted at t=" + e),
  19609. !0;
  19610. if (!this.warpPathPoints)
  19611. return !0;
  19612. var i = this.warpLength * e
  19613. , n = P.Math.smoothstep(i, 0, this.brushPrefs.lookBlendDist)
  19614. , r = P.Math.smoothstep(i, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  19615. D.warp.matchCam && (n *= 1 - r),
  19616. m.lookAt(g, l, U.UP),
  19617. u.setFromRotationMatrix(m, D.warp.eOrder),
  19618. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19619. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19620. v.y = N.constrainedTurn(v.y),
  19621. u.x = p.x + n * v.x,
  19622. u.y = p.y + n * v.y,
  19623. u.z = p.z + n * v.z,
  19624. v.set(u.x - f.x, u.y - f.y, u.z - f.z, D.warp.eOrder),
  19625. v.y = N.constrainedTurn(v.y);
  19626. var o = P.Math.degToRad(D.warp.maxTurnPerSec) * t / 1e3;
  19627. v.y = Math.sign(v.y) * Math.min(o, Math.abs(v.y)),
  19628. f.x = f.x + v.x * D.warp.turnFriction,
  19629. f.y = f.y + v.y * D.warp.turnFriction,
  19630. f.z = f.z + v.z * D.warp.turnFriction,
  19631. f.x = Math.max(P.Math.degToRad(D.warp.minDownAngle), f.x);
  19632. var a = l.clone().sub(g).normalize();
  19633. if (C < D.warp.maxAimRotation && 0 < r) {
  19634. var s = 1 - r;
  19635. a.x = a.x * s + r * A.x,
  19636. a.y = a.y * s + r * A.y,
  19637. a.z = a.z * s + r * A.z,
  19638. a.normalize()
  19639. }
  19640. this.bunnyObj.position.copy(h.position).add(a),
  19641. d.set(0, 0, -1).applyEuler(f).normalize(),
  19642. d.multiplyScalar(8),
  19643. d.add(h.position),
  19644. 1 - c < e && D.warp.matchCam || (h.controls.lookAt(d),
  19645. h.controls.lookVector.copy(d),
  19646. h.lookAt(d))
  19647. }
  19648. .bind(this)
  19649. , S = function() {
  19650. y ? (this.discardSlow(),
  19651. this.upcomingTransType = L.BLACK,
  19652. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, z.BEGINNING, e)) : this._wrapupWarpShading(e)
  19653. }
  19654. .bind(this);
  19655. T(0);
  19656. var M = D.warp.motionLeadTime + 1e3 * Math.abs(s()) / P.Math.degToRad(D.warp.maxTurnPerSec)
  19657. , R = M / (t += M);
  19658. this.warpCommonParameters(t, R, !0, z.NONE),
  19659. V.start(I, t, null, 0, null, "_haltWatcher"),
  19660. 0 < D.warp.blur && (k.blurStrength = D.warp.blur,
  19661. V.start(E, t, null, R, n, "blurring")),
  19662. V.start(b, t, null, R, n, "modelAlpha"),
  19663. V.start(w, t, null, R, B[D.warp.blendEasing], "followPath"),
  19664. V.start(T, t, null, R, B[D.warp.blendEasing], "goBunny"),
  19665. V.start(x, t, S, 0, B[D.warp.blendEasing], "lookAtBunny")
  19666. }
  19667. ,
  19668. t.prototype.warpTravel_BLACK = function(e, t, i, n) {
  19669. var r = e || 0;
  19670. null !=
  19671. t || (t = D.warp.teleportTime)
  19672. //add
  19673. player.model.hotGroup.visible = false
  19674. let oldPano = this.player.currentPano
  19675. let toPano = this.player.model.panos.get(this.warpDestHeroLoc.panoId)
  19676. this.player.emit("pano.chosen", oldPano, toPano)
  19677. var done = ()=>{
  19678. this.player.transitionPos({type:"beforeFlytopano", pano:this.player.currentPano, dur:0, callback:()=>{
  19679. player.model.hotGroup.visible = true
  19680. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  19681. }})
  19682. this.player.emit("flying.ended",toPano.position, oldPano.position,toPano, oldPano)
  19683. }
  19684. if(window.DATA.momentTourBlackNewType){
  19685. player.sceneRenderer.effects.fastTranMaskPass.start(player.sceneRenderer)
  19686. var camera = this.playerControls.cameras['panorama'];
  19687. var end = this.warpDestHeroLoc.position
  19688. camera.position.copy(end)
  19689. setTimeout(()=>{
  19690. player.sceneRenderer.effects.fastTranMaskPass.stop()
  19691. this.wrapupWarpShadingOnly(n, i);
  19692. done()
  19693. },t)
  19694. }else{
  19695. var o = function() {
  19696. this.wrapupWarpShadingOnly(n, i);
  19697. done()
  19698. }
  19699. .bind(this);
  19700. var firstPos = this.player.position.clone()//add
  19701. V.start(this.stepWarpPath.bind(this, firstPos), t, o, r, B[D.warp.blendEasing], "stepMotion")
  19702. }
  19703. this.warpCommonParameters(t, r, !1, i)
  19704. this.model.chunks.concat(this.model.skybox).forEach(function(e) {// 改
  19705. if(window.DATA.momentTourBlackNewType){
  19706. e.material.uniforms.blackout.value = 5//i 改
  19707. //e.material.defines.newBlack = ''
  19708. //e.material.needsUpdate = true
  19709. }else{
  19710. e.material.uniforms.blackout.value = i
  19711. }
  19712. }),
  19713. this._warpBendAim(null, t, null, r);
  19714. /* this.warpCommonParameters(t, r, !1, i)
  19715. this.model.chunks.forEach(function(e) {
  19716. e.material.uniforms.blackout.value = i
  19717. }),
  19718. this._warpBendAim(null, t, null, r);
  19719. //add
  19720. var done = ()=>{
  19721. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  19722. this.player.transitionPos({type:"beforeFlytopano", pano:this.player.currentPano, dur:100})//add
  19723. }
  19724. var o = function() {
  19725. this.wrapupWarpShadingOnly(n, i)
  19726. done()
  19727. }
  19728. .bind(this);
  19729. var firstPos = this.player.position.clone()//add
  19730. V.start(this.stepWarpPath.bind(this, firstPos), t, o, r, B[D.warp.blendEasing], "stepMotion")
  19731. */
  19732. }
  19733. ,
  19734. t.prototype.flightStepWalk = (a = new P.Vector3,
  19735. s = new P.Vector3,
  19736. function(e, t, i) {
  19737. if (this.warpInterrupted)
  19738. i && i();
  19739. else if (this.activeTransType !== L.WALK)
  19740. this._clearWarpShading(),
  19741. this._warpStopFlying(),
  19742. this.player.spider.draw(),
  19743. this.placeCpm(),
  19744. i && i();
  19745. else if (this.player.currentPano !== e) {
  19746. var n = {
  19747. pano: e,
  19748. lookAtPoint: t,
  19749. duration: null,
  19750. maxDistanceOverride: D.warp.walkMaxDist,
  19751. skipWarpingCheck: !1,
  19752. constantMoveSpeed: !0
  19753. };
  19754. if(e == this.warpDestPano){//到达终点前,放大到终点的zoom
  19755. n.zoomLevel = this.warpDestHeroLoc.zoom
  19756. }
  19757. n.duration = function(e, t) {
  19758. var i = Math.min(this.player.position.distanceTo(e.position), D.transition.flytimeMaxDistanceThreshold) * D.transition.flytimeDistanceMultiplier + D.transition.flyTime;
  19759. s.copy(U.FORWARD),
  19760. this.player.getDirection(s),
  19761. a.copy(t).sub(e.position).normalize();
  19762. var n = a.dot(s)
  19763. , r = Math.acos(n)
  19764. , o = r / i;
  19765. .001 < o && (i *= o / .001, //-----这是什么????
  19766. r < 1 && (i *= 1.2))
  19767. return i / DATA.tourWalkSpeed * 100
  19768. }
  19769. .call(this, e, t),
  19770. this.player.nonInterruptingFlyToPano(n, i)
  19771. } else
  19772. i && i()
  19773. }
  19774. ),
  19775. t.prototype.makeWalkFlightFunc = function(e, t, i) {
  19776. return this.flightStepWalk.bind(this, e, t, i)
  19777. }
  19778. ,
  19779. t.prototype.warpTravel_WALK = (f = [],
  19780. function(e) {
  19781. for (var t = this.player.model.panos, i = null, n = !1, r = f.length = 0; r < this.nodes.length; r++) {
  19782. var o = this.nodes[r]
  19783. , a = t.get(o);
  19784. this.nodes.length,
  19785. n = i && a.position.distanceTo(i.position) < D.warp.walkMinDist,
  19786. i && n || (f.push(o),
  19787. i = a)
  19788. }
  19789. n && 1 < this.nodes.length && (f[f.length - 1] = this.nodes[this.nodes.length - 1]);
  19790. var s = f.length
  19791. , l = t.get(f[s - 1])
  19792. , c = new Array(s + 1);
  19793. c[c.length - 1] = function() {
  19794. e && e()
  19795. }
  19796. .bind(this);
  19797. for (var h = s - 1, u = c.length - 1; 0 < u; u -= 1) {
  19798. var d = f[h];
  19799. l = t.get(d);
  19800. var p = new P.Vector3;
  19801. this.getLookAtForWalkingTourNode(f, h, p),
  19802. c[u - 1] = this.makeWalkFlightFunc(l, p, c[u]),
  19803. h--
  19804. }
  19805. c[0]()
  19806. }
  19807. ),
  19808. t.prototype.getLookAtForWalkingTourNode = (c = new P.Vector3,
  19809. h = new P.Vector3,
  19810. u = new P.Vector3,
  19811. d = new P.Vector3,
  19812. p = new P.Vector3,
  19813. function(e, t, i) {
  19814. var n = e.length;
  19815. if (n <= t)
  19816. return !1;
  19817. var r = 1
  19818. , o = 1;
  19819. h.set(0, 0, 0),
  19820. p.set(0, 0, 0);
  19821. for (var a = null, s = t; s < t + 3 && !(n <= s); s++) {
  19822. if (a = this.player.model.panos.get(e[s]),
  19823. this.getOrientationForWalkingTourNode(e, s, u),
  19824. s === t && c.copy(u),
  19825. d.copy(u),
  19826. t < s) {
  19827. var l = d.dot(c) < .65;
  19828. r *= l ? .2 : .75,
  19829. o *= l ? .2 : .4
  19830. }
  19831. u.multiplyScalar(r),
  19832. h.add(u),
  19833. p.lerp(a.position, o)
  19834. }
  19835. return h.normalize(),
  19836. i.copy(p),
  19837. i.add(h),
  19838. !0
  19839. }
  19840. ),
  19841. t.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  19842. var n = e.length;
  19843. if (n <= t)
  19844. return !1;
  19845. if (t === n - 1)
  19846. i.copy(U.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  19847. else {
  19848. var r = this.player.model.panos.get(e[t])
  19849. , o = this.player.model.panos.get(e[t + 1]);
  19850. i.copy(o.position).sub(r.position)
  19851. }
  19852. return i.normalize(),
  19853. !0
  19854. }
  19855. ,
  19856. t.prototype.warpCameraTravel = function(e, t, i, n) {
  19857. if (this.activeTransType = this.upcomingTransType,
  19858. this.lastTransType = this.activeTransType,
  19859. this.upcomingTransType = null,
  19860. e)
  19861. this.activeTransType === L.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === L.WALK ? this.warpTravel_WALK(function() {
  19862. this._clearWarpShading(),
  19863. this._warpStopFlying(),
  19864. this.player.spider.draw(),
  19865. this.placeCpm(),
  19866. n && n()
  19867. }
  19868. .bind(this)) : this.warpTravel_STD(n);
  19869. else {
  19870. var r = function() {
  19871. this._wrapupTravel(n)
  19872. }
  19873. .bind(this)
  19874. , o = {
  19875. pano: this.warpDestPano,
  19876. lookAtPoint: null,
  19877. duration: null,
  19878. maxDistanceOverride: null,
  19879. skipWarpingCheck: !1
  19880. };
  19881. this.player.flyToPano(o, r)
  19882. }
  19883. }
  19884. ,
  19885. t.prototype.startWarpState = function() {
  19886. this.warping = !0,
  19887. this.warpInterrupted = !1,
  19888. this.warpInterruptionBlackoutStyle = null,
  19889. this.warpInterruptionTravelTime = null
  19890. }
  19891. ,
  19892. t.prototype.endWarpState = function() {
  19893. this.warping = !1
  19894. }
  19895. ,
  19896. t.prototype.warpToPano = function(e, t, i, n) {
  19897. if (this.warping)
  19898. H.warn("Cannot warp when already warping");
  19899. else {
  19900. if (this.upcomingTransType = e,
  19901. this.activeTransType = null,
  19902. !this.setWarpDestPano())
  19903. return this.upcomingTransType = null,
  19904. void this.warpToNonPano(n);
  19905. if (this.player.mode !== O.PANORAMA)
  19906. return this.upcomingTransType = null,
  19907. this.discardSlow(),
  19908. void this.player.flyToNewMode({
  19909. mode: O.PANORAMA,
  19910. pano: this.warpDestPano,
  19911. duration: D.warp.outsideTime,
  19912. warpDest: this.warpDestHeroLoc,
  19913. callback: n,
  19914. force: !0
  19915. });
  19916. if (!this.warpDestPano)
  19917. return H.warn("no warp destination, callback dropped"),
  19918. void (this.upcomingTransType = null);
  19919. var r = !(this.model.panos.isNeighbour(this.player.currentPano, this.warpDestPano) && this.warpDestPano !== this.player.currentPano && this.warpDestPano.position.distanceTo(this.player.currentPano.position) < D.warp.nearPanoDist)
  19920. , o = this.chooseWarpPath(r);
  19921. if (o && this.upcomingTransType !== L.WALK) {
  19922. var a = function() {
  19923. this.waitingToWarp = !1,
  19924. this.warpToPano(e, t, i, n)
  19925. }
  19926. .bind(this);
  19927. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, a))
  19928. return void (this.waitingToWarp = !0)
  19929. }
  19930. this.player.currentPano || (H.warn("Arrived at a very strange spot!"),
  19931. this.player.currentPano = this.warpDestPano,
  19932. this.placeCpm(),
  19933. this.fadeOutCpm(D.path.fadeOutTime),
  19934. this.player.spider.draw()),
  19935. H.debug("Warping to pano ", this.warpDestPano.position),
  19936. this.upcomingTransType !== L.WALK && this.player.emit(g.PanoChosen, this.player.currentPano, this.warpDestPano),
  19937. this.startWarpState();
  19938. var s = function() {
  19939. this.endWarpState(),
  19940. n && n()
  19941. }
  19942. .bind(this);
  19943. o ? this.warpCameraTravel(r, t, i, s) : this.warpCameraAim(s)
  19944. }
  19945. }
  19946. ,
  19947. v.exports = t
  19948. }
  19949. ).call(this, "/js/objects/ShowPath.js")
  19950. }
  19951. , {
  19952. "../constants": 8,
  19953. "../effects": 16,
  19954. "../enum/BlackoutStyle": 18,
  19955. "../enum/ModelManagerEvents": 33,
  19956. "../enum/PlayerEvents": 40,
  19957. "../enum/RenderOrder": 42,
  19958. "../enum/Vectors": 50,
  19959. "../enum/Viewmode": 51,
  19960. "../enum/WarpStyle": 52,
  19961. "../gui/gui": 65,
  19962. "../model/ModelManager": 140,
  19963. "../objects/Snapshot": 153,
  19964. "../settings": 166,
  19965. "../shaders": 167,
  19966. "../util/easing": 186,
  19967. "../util/lerp": 188,
  19968. "../util/logger": 189,
  19969. "../util/math": 190,
  19970. "../util/texture": 194,
  19971. "../util/transitions": 195,
  19972. three: 217
  19973. }],
  19974. 152: [function(e, t, i) {
  19975. "use strict";
  19976. function n() {
  19977. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  19978. , t = new r.RawShaderMaterial({
  19979. fragmentShader: o.skysphere.fragmentShader,
  19980. vertexShader: o.skysphere.vertexShader,
  19981. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  19982. side: r.BackSide,
  19983. name: "skysphere"
  19984. });
  19985. t.uniforms.radius.value = e.parameters.radius,
  19986. r.Mesh.call(this, e, t)
  19987. }
  19988. var r = e("three")
  19989. , o = e("../shaders")
  19990. , a = e("../settings");
  19991. (n.prototype = Object.create(r.Mesh.prototype)).constructor = n,
  19992. t.exports = n
  19993. }
  19994. , {
  19995. "../settings": 166,
  19996. "../shaders": 167,
  19997. three: 217
  19998. }],
  19999. 153: [function(r, o, e) {
  20000. (function(e) {
  20001. "use strict";
  20002. function t(e) {
  20003. n.call(this, e),
  20004. this.sid = e.sid,
  20005. this.panoId = e.panoId,
  20006. this.orthoZoom = e.orthoZoom,
  20007. this.floorVisibility = e.floorVisibility,
  20008. this.thumbUrl = e.thumbUrl,
  20009. this.name = e.name,
  20010. this.zoom = e.zoom
  20011. }
  20012. var i = (r("three"),
  20013. r("../util/logger"))
  20014. , n = (r("../settings"),
  20015. r("../enum/Viewmode"),
  20016. r("../util/common"),
  20017. r("../util/transitions"),
  20018. r("../util/lerp"),
  20019. r("../util/ajax"),
  20020. r("../util/texture"),
  20021. r("./View"));
  20022. r("events").EventEmitter,
  20023. new i(e),
  20024. (t.prototype = Object.create(n.prototype)).isPano = function() {
  20025. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  20026. }
  20027. ,
  20028. o.exports = t
  20029. }
  20030. ).call(this, "/js/objects/Snapshot.js")
  20031. }
  20032. , {
  20033. "../enum/Viewmode": 51,
  20034. "../settings": 166,
  20035. "../util/ajax": 181,
  20036. "../util/common": 185,
  20037. "../util/lerp": 188,
  20038. "../util/logger": 189,
  20039. "../util/texture": 194,
  20040. "../util/transitions": 195,
  20041. "./View": 154,
  20042. events: 202,
  20043. three: 217
  20044. }],
  20045. 154: [function(o, a, e) {
  20046. (function(e) {
  20047. "use strict";
  20048. function t(e) {
  20049. e = e || {},
  20050. this.position = new i.Vector3,
  20051. this.quaternion = new i.Quaternion,
  20052. this.update(e)
  20053. }
  20054. var i = o("three")
  20055. , n = o("../util/logger")
  20056. , r = (o("../settings"),
  20057. o("../enum/Viewmode"),
  20058. o("../util/common"),
  20059. o("../util/transitions"),
  20060. o("../util/lerp"),
  20061. o("../util/ajax"),
  20062. o("../util/texture"),
  20063. o("events").EventEmitter);
  20064. new n(e),
  20065. (t.prototype = Object.create(r.prototype)).isValid = function() {
  20066. return !!this.cameraMode
  20067. }
  20068. ,
  20069. t.prototype.update = function(e) {
  20070. return this.cameraMode = e.cameraMode || this.cameraMode,
  20071. this.pano = e.pano || this.pano,
  20072. e.position && this.position.copy(e.position),
  20073. e.quaternion && this.quaternion.copy(e.quaternion),
  20074. this
  20075. }
  20076. ,
  20077. a.exports = t
  20078. }
  20079. ).call(this, "/js/objects/View.js")
  20080. }
  20081. , {
  20082. "../enum/Viewmode": 51,
  20083. "../settings": 166,
  20084. "../util/ajax": 181,
  20085. "../util/common": 185,
  20086. "../util/lerp": 188,
  20087. "../util/logger": 189,
  20088. "../util/texture": 194,
  20089. "../util/transitions": 195,
  20090. events: 202,
  20091. three: 217
  20092. }],
  20093. 155: [function(J, ee, e) {
  20094. (function(e) {
  20095. "use strict";
  20096. function t(e) {
  20097. this.currentPano = null,
  20098. this.nextPano = null,
  20099. this.camera = null,
  20100. this.paused = !1,
  20101. this.flying = !1,
  20102. this.sceneIntersectionPlane = null,
  20103. this.target = new B.Vector3,
  20104. this.mouse = new B.Vector3(1.1,1.1,.5),
  20105. this.mouseAtMouseDown = new B.Vector2,
  20106. this.mouseCouldBeClickToMove = !1,
  20107. this.mouseLastMoveTime = Date.now(),
  20108. this.mouseDown = !1,
  20109. this.mouseDownTimer = null,
  20110. this.couldBeLongTap = !1,
  20111. this.containsMouse = !0,
  20112. this.isTouchEvent = !1,
  20113. this.isPanoHover = !1,
  20114. this.reticule = new n(this),
  20115. this.panoMarkers = [],
  20116. this.spider = new s(this),
  20117. this.quaternion = new B.Quaternion,
  20118. this.position = new B.Vector3(15,10,15),
  20119. this.previousState = null,
  20120. this.lastInsideView = new o,
  20121. this.last360View = new o,
  20122. this.raycaster = new B.Raycaster,
  20123. this.intersect = null,
  20124. this.lastChangeTime = Date.now(),
  20125. this.history = new h,
  20126. this.cameraControls = null,
  20127. this.path = null,
  20128. this.model = null,
  20129. this.domElement = null,
  20130. this.cachedPanoCandidates = null,
  20131. this.basePanoSize = 0,
  20132. this.standardPanoSize = 0,
  20133. this.highPanoSize = 0,
  20134. this.ultraHighPanoSize = 0,
  20135. this.zoomLevel = 1,
  20136. this.zooming = 0,
  20137. this.zoomSpeed = .5,
  20138. this.scrollZoomSpeed = .06,
  20139. this.zoomSpeedAdjust = .05,
  20140. this.defaultZoomIncrement = .2,
  20141. this.baseFov = k.insideFOV,
  20142. this.zoomFov = this.baseFov,
  20143. this.zoomEnabled = !0,
  20144. this.preRenderingEnabled = !1,
  20145. this.setupCustomProperties(e),
  20146. this.zoomStats = new v,
  20147. this.modeTran = ''//'dollhouse-panorama'
  20148. this.currentCursor = '';
  20149. window.player = this
  20150. }
  20151. var B = J("three")
  20152. , i = J("./util/logger")
  20153. , n = J("./objects/Reticule")
  20154. , a = J("./objects/Panorama")
  20155. , r = J("./objects/ShowPath")
  20156. , o = J("./objects/View")
  20157. , s = (J("./objects/Snapshot"),
  20158. J("./objects/NSpider"))
  20159. , V = J("./enum/Viewmode")
  20160. , T = (J("./enum/TagStates"),
  20161. J("./enum/Vectors"))
  20162. , l = J("./enum/Keys")
  20163. , k = (J("./enum/AlignmentType"),
  20164. J("./settings"))
  20165. , x = J("./util/common")
  20166. , U = (J("./util/browser"),
  20167. J("./util/math"))
  20168. , H = J("./util/lerp")
  20169. , z = J("./util/easing")
  20170. , G = J("./util/transitions")
  20171. , c = J("events").EventEmitter
  20172. , h = (J("./shaders"),
  20173. J("./util/history"))
  20174. , S = (J("./util/camera"),
  20175. J("./model/ModelManager"),
  20176. J("./enum/PathDiscardMode"))
  20177. , M = J("./enum/PathDisplayMode")
  20178. , W = J("./enum/PlayerEvents")
  20179. , u = J("./enum/ControlEvents")
  20180. , d = J("./enum/ModelManagerEvents")
  20181. , R = J("./enum/WarpStyle")
  20182. , P = J("./enum/BlackoutStyle")
  20183. , p = J("./exception/BasicException")
  20184. , f = J("./enum/PanoSizeClass")
  20185. , g = (J("./tile/TileDownloader"),
  20186. J("./tile/TilePrioritizer"))
  20187. , m = (J("./enum/PanoramaEvents"),
  20188. J("./enum/ZoomEvents"))
  20189. , v = J("./util/ZoomStats")
  20190. , y = J("./constants")
  20191. , j = J("./util/common")
  20192. , A = J("./util/cameraLight")
  20193. //, C = J("hot")
  20194. , Y = new i(e)
  20195. , q = Object.freeze({
  20196. FlyToPano: G.getUniqueId(),
  20197. FlyToNewMode: G.getUniqueId(),
  20198. FlyToSameMode: G.getUniqueId(),
  20199. FlyToViewFloor: G.getUniqueId(),
  20200. LookTransition: G.getUniqueId(),
  20201. ZoomTransition: G.getUniqueId()
  20202. });
  20203. function I(e) {
  20204. for (var t = e.split(","), i = t[0].match(/:(.*?);/)[1], n = atob(t[1]), r = n.length, o = new Uint8Array(r); r--; )
  20205. o[r] = n.charCodeAt(r);
  20206. return new Blob([o],{
  20207. type: i
  20208. })
  20209. }
  20210. (t.prototype = Object.create(c.prototype)).init = function(e) {
  20211. this.modelManager = e.modelManager,
  20212. this.tileDownloader = e.tileDownloader,
  20213. this.panoRenderer = e.panoRenderer,
  20214. this.qualityManager = e.qualityManager,
  20215. this.domElement = e.container,
  20216. this.camera = e.camera,
  20217. this.tagManager = e.tagManager,
  20218. this.cameraControls = e.controls,
  20219. this.path = new r(e.director,this,e.controls),
  20220. this.basePanoSize = this.qualityManager.getPanoSize(f.BASE),
  20221. this.standardPanoSize = this.qualityManager.getPanoSize(f.STANDARD),
  20222. this.highPanoSize = this.qualityManager.getPanoSize(f.HIGH),
  20223. this.ultraHighPanoSize = this.qualityManager.getPanoSize(f.ULTRAHIGH),
  20224. this.tileDownloader.processPriorityQueue = !1,
  20225. this.tileDownloader.tilePrioritizer = new g(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  20226. this.bindEvents(e.container),
  20227. this.updateModel()
  20228. //add
  20229. this.raycaster.linePrecision = 0.1
  20230. }
  20231. ,
  20232. t.prototype.screenShot = function(i) {
  20233. if (!this.flying && !this.flyingToTag) {
  20234. var n = this.sceneRenderer;
  20235. n.updateScreenSize(i)
  20236. this.model.panos.forEach(e=>{
  20237. if(e.marker){
  20238. e.marker.forceHide = e.marker.visible
  20239. e.marker.visible = !1;
  20240. }
  20241. })
  20242. /* for (var e in this.model.hots)
  20243. this.model.hots[e].mesh.visible = !1; */
  20244. player.model.hotGroup.visible = false
  20245. this.reticule.visible = !1,
  20246. this.reticule.forceUnvisible = !0,
  20247. this.path.currentPanoMarker.mesh.visible = !1,
  20248. setTimeout(function() {
  20249. n.renderer.clear(!0, !0, !0),
  20250. n.renderer.render(n.scene, n.camera);
  20251. var e = n.renderer.domElement.toDataURL(i.type, .9);
  20252. i.f && i.f(e)
  20253. n.updateScreenSize({
  20254. resize: !0
  20255. })
  20256. this.reticule.visible = !0
  20257. player.model.hotGroup.visible = true
  20258. this.model.panos.forEach(e=>{
  20259. e.marker && (e.marker.visible = e.marker.forceHide);
  20260. })
  20261. this.path.currentPanoMarker.mesh.visible = !0,
  20262. n.renderer.render(n.scene, n.camera)
  20263. }
  20264. .bind(this), 30)
  20265. }
  20266. }
  20267. ;
  20268. var E, _, b, w, O, L, D, N, F, X, Z, K, Q = J("scaleImg");
  20269. t.prototype.getWrapShot = function() {
  20270. var i = this.getSnapAngleInfo()
  20271. , n = ",{\r\t" + i
  20272. , r = arguments[0];
  20273. this.screenShot({
  20274. width: g_snapShotWidth,
  20275. height: g_snapShotHeight,
  20276. type: "image/jpeg",
  20277. f: function(e) {
  20278. if (r && r.__callback)
  20279. return r.__callback(e, i);
  20280. var t = new Image;
  20281. t.src = e,
  20282. t.onload = function() {
  20283. var e = function(r, i) {
  20284. function n(e, t) {
  20285. var i = o || r
  20286. , n = document.createElement("canvas");
  20287. n.width = i.width,
  20288. n.height = i.height,
  20289. n.getContext("2d").drawImage(i, 0, 0, i.width, i.height),
  20290. o = Q(e, n, t)
  20291. }
  20292. function e() {
  20293. var e = o || r
  20294. , t = I(e.src);
  20295. i.maxWeight && t.size > i.maxWeight && (n(i.maxWeight / t.size, "jpeg"),
  20296. t = I(e.src)),
  20297. (o = o || new Image).base64Src = e.src,
  20298. o.src = window.URL.createObjectURL(t)
  20299. }
  20300. var o, t = Math.max(r.width, r.height);
  20301. return "png" != i.toType && ("jpeg" == i.oldType ? (t > i.maxSize && n(i.maxSize / t, "jpeg"),
  20302. e()) : "png" == i.oldType && i.maxWeight && i.weight > i.maxWeight && (n(t > i.maxSize ? i.maxSize / t : 1, "jpeg"),
  20303. e())),
  20304. o || r
  20305. }(this, {
  20306. maxSize: g_snapShotWidth,
  20307. oldType: "jpeg"
  20308. });
  20309. e.src.replace(function(e) {
  20310. return "image/" + (e = e.toLowerCase().replace(/jpg/i, "jpeg")).match(/png|jpeg|bmp|gif/)[0]
  20311. }("image/jpeg"), "image/octet-stream");
  20312. var t = "snap" + (new Date).getTime();
  20313. !function(e, t) {
  20314. var i = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
  20315. i.href = e,
  20316. i.download = t;
  20317. var n = document.createEvent("MouseEvents");
  20318. n.initMouseEvent("click", !0, !1, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null),
  20319. i.dispatchEvent(n)
  20320. }(e.src, t + ".jpg"),
  20321. n += ',\r\t"thumbnail_signed_src":"' + t + '.jpg",',
  20322. n += '\r\t"sid":"' + t + '",',
  20323. n += '\r\t"name":"' + t + '"\r}',
  20324. logData(n)
  20325. }
  20326. }
  20327. })
  20328. }
  20329. /* ,
  20330. t.prototype.getSnapAngleInfo = function() {
  20331. var e = {}
  20332. , t = '"metadata":{'
  20333. , i = this.camera.quaternion.clone();
  20334. switch (this.mode) {
  20335. case "panorama":
  20336. e.scan_id = this.currentPano.id,
  20337. t += '"scan_id":"' + this.currentPano.id + '",';
  20338. break;
  20339. case "floorplan":
  20340. e.camera_mode = 1,
  20341. (i = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))).multiply(this.camera.quaternion),
  20342. t += '"camera_mode":1,',
  20343. t += '"ortho_zoom":' + U.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ",";
  20344. break;
  20345. case "dollhouse":
  20346. e.camera_mode = 2,
  20347. t += '"camera_mode":2,'
  20348. }
  20349. var n = new B.Quaternion(i.x,i.y,i.z,i.w);
  20350. return n.multiply(new B.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0).conjugate()),
  20351. n.x *= -1,
  20352. n.w *= -1,
  20353. e.camera_position = U.toPrecision(this.camera.position.toArray(), 4),
  20354. e.camera_quaternion = U.toPrecision(n.toArray(), 4),
  20355. e.zoom = this.zoomLevel,
  20356. t += '"camera_position":[' + e.camera_position + '],"camera_quaternion":[' + e.camera_quaternion + '], "zoom":' + e.zoom + "}"
  20357. }
  20358. , */
  20359. t.prototype.getSnapAngleInfo = function(){
  20360. var info = {};
  20361. var str = '"metadata":{';
  20362. var q = this.camera.quaternion.clone();
  20363. switch (this.mode) {
  20364. case "panorama":
  20365. info.scan_id = this.currentPano.id;
  20366. str += ('"scan_id":"'+this.currentPano.id+'",');
  20367. break;
  20368. case "floorplan":
  20369. info.camera_mode = 1;
  20370. q = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))
  20371. q.multiply(this.camera.quaternion);
  20372. str += ('"camera_mode":1,');
  20373. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  20374. str += ('"ortho_zoom":'+ U.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  20375. break;
  20376. case "dollhouse":
  20377. info.camera_mode = 2;
  20378. str += ('"camera_mode":2,');
  20379. break;
  20380. }
  20381. info.camera_position = U.toPrecision(this.camera.position.toArray(),4);
  20382. //console.log(info.camera_position)
  20383. info.camera_quaternion = U.toPrecision(q.toArray(),4);
  20384. /* if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的 fyz 对相机截屏的角度进行校对
  20385. var out = new B.Quaternion(q.x, q.y, q.z, q.w)
  20386. out.multiply(new B.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  20387. out.x *= -1;
  20388. out.w *= -1;
  20389. info.camera_quaternion = U.toPrecision(out.toArray(),4);
  20390. }else{
  20391. info.camera_quaternion = U.toPrecision(q.toArray(),4);;
  20392. } */
  20393. info.zoom = this.zoomLevel;
  20394. //console.log(info.camera_quaternion)
  20395. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  20396. // fyz 扩展编辑页面, 加上导览点缩放值
  20397. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  20398. console.log(str)
  20399. return str;
  20400. }
  20401. //------end
  20402. ,
  20403. t.prototype.setupCustomProperties = function(e) {
  20404. var i = e || V.PANORAMA;
  20405. Object.defineProperty(this, "mode", {
  20406. get: function() {
  20407. return i
  20408. },
  20409. set: function(e) {
  20410. var t = i;
  20411. i = e,
  20412. this.onModeUpdated(t, i)
  20413. }
  20414. })
  20415. }
  20416. ,
  20417. t.prototype.isInMode = function() {
  20418. for (var e = 0; e < arguments.length; e++)
  20419. if (this.mode === arguments[e])
  20420. return !0;
  20421. return !1
  20422. }
  20423. ,
  20424. t.prototype.isOutsideMode = function(e) {
  20425. return (e = e || this.mode) === V.DOLLHOUSE || e === V.FLOORPLAN
  20426. }
  20427. ,
  20428. t.prototype.is360View = function(e, t) {
  20429. return e === V.PANORAMA && t && !t.isAligned()
  20430. }
  20431. ,
  20432. t.prototype.setScene = function(e) {
  20433. this.sceneIntersectionPlane = e.plane,
  20434. this.path.setScene(e),
  20435. this.moveReticuleToScene(e)
  20436. }
  20437. ,
  20438. t.prototype.moveReticuleToScene = function(e) {
  20439. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20440. e.add(this.reticule)
  20441. }
  20442. ,
  20443. t.prototype.updateModel = function() {
  20444. function n(e) {
  20445. var t = this.cameraControls.cameras[V.DOLLHOUSE]
  20446. , i = this.cameraControls.controls[V.DOLLHOUSE]
  20447. , n = t.position.y + (e - i.target.y)
  20448. , r = k.showFloorDuration + k.showFloorDelay;
  20449. G.start(H.property(i.target, "y", e), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor),
  20450. G.start(H.property(t.position, "y", n), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor)
  20451. }
  20452. this.model = this.modelManager.getActiveModel(),
  20453. this.model.on("floor.changed", function(e, t, i) {
  20454. this.mode === V.DOLLHOUSE && e !== i && n.call(this, e.center.y)
  20455. }
  20456. .bind(this)),
  20457. this.model.on("allfloors.toggled", function(e, t) {
  20458. if (this.mode === V.DOLLHOUSE) {
  20459. var i = e ? this.model.center.y : i = t.center.y;
  20460. n.call(this, i)
  20461. }
  20462. }
  20463. .bind(this)),
  20464. this.on(W.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  20465. var t = this;
  20466. this.model.panos.list.forEach(function(e) {
  20467. e.vrMarker.addEventListener("click", function() {
  20468. t.flyToPano({
  20469. pano: e
  20470. })
  20471. })
  20472. })
  20473. }
  20474. ,
  20475. t.prototype.updateModelDependentData = function() {
  20476. this.cameraControls.setModelForControls(this.model),
  20477. this.getPanoMarkersFromModel(this.model)
  20478. }
  20479. ,
  20480. t.prototype.onModelChanged = function() {
  20481. this.updateModel(),
  20482. this.updateModelDependentData()
  20483. }
  20484. ,
  20485. t.prototype.getPanoMarkersFromModel = function(e) {
  20486. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  20487. return t.marker ? e.concat(t.marker) : e
  20488. }, [])
  20489. }
  20490. ,
  20491. t.prototype.handleControlMove = function(e) {
  20492. this.emit(W.Move, e)
  20493. }
  20494. ,
  20495. t.prototype.handleControlInputStart = function(e) {
  20496. this.emit(W.InputStart, e)
  20497. }
  20498. ,
  20499. t.prototype.onModeUpdated = function(e, t) {
  20500. this.cameraControls.activateControls(t),
  20501. this.emit(W.ModeChanged, e, t)
  20502. }
  20503. ,
  20504. t.prototype.isWarping = function() {
  20505. return this.path.warping
  20506. }
  20507. ,
  20508. t.prototype.isWaitingToWarp = function() {
  20509. return this.path.waitingToWarp
  20510. }
  20511. ,
  20512. t.prototype.getLabelScaleFactor = function() {
  20513. if (this.isOutsideMode()) {
  20514. return Math.sqrt(this.cameraControls.controls[V.FLOORPLAN].currentScale / 10)
  20515. }
  20516. return .5
  20517. }
  20518. ,
  20519. t.prototype.bindEvents = function(e) {
  20520. e !== document && e.setAttribute("tabindex", -1),
  20521. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  20522. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  20523. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  20524. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  20525. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  20526. this.modelManager.on(d.ActiveModelChanged, this.onModelChanged.bind(this)),
  20527. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  20528. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  20529. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  20530. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  20531. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  20532. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  20533. document.addEventListener("pointerup", ()=>{//add
  20534. window.transformControls && transformControls.onPointerUp()
  20535. }),
  20536. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  20537. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  20538. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  20539. this.cameraControls.on(u.Move, this.handleControlMove.bind(this)),
  20540. this.cameraControls.on(u.InputStart, this.handleControlInputStart.bind(this)),
  20541. this.cameraControls.on(u.Pinch, this.handleControlPinch.bind(this)),
  20542. this.cameraControls.on(u.Scroll, this.handleControlScroll.bind(this)),
  20543. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),
  20544. //window.addEventListener("tourAudioEnded", this.changeMusic.bind(this)),
  20545. window.getSeft && getSeft(this)
  20546. }
  20547. ,
  20548. t.prototype.onMouseDown = function(e) {
  20549. e.currentTarget !== document && e.currentTarget.focus(),
  20550. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  20551. this.updateIntersect())
  20552. }
  20553. ,
  20554. t.prototype.onMouseMove = function(e) {
  20555. this.isTouchEvent = !1,
  20556. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20557. }
  20558. ,
  20559. t.prototype.onMouseOver = function(e) {
  20560. this.containsMouse = !0,
  20561. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  20562. }
  20563. ,
  20564. t.prototype.onMouseOut = function(e) {
  20565. this.containsMouse = !1
  20566. }
  20567. ,
  20568. t.prototype.onMouseUp = function(e) {
  20569. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  20570. }
  20571. ,
  20572. t.prototype.onTouchStart = function(e) {
  20573. if (e.currentTarget !== document && e.currentTarget.focus(),
  20574. !this.mouseDown) {
  20575. this.couldBeLongTap = !0;
  20576. var t = x.average(e.changedTouches, "clientX")
  20577. , i = x.average(e.changedTouches, "clientY");
  20578. this.handleInputStart.call(this, t, i, !0),
  20579. this.mouseDownTimer = setTimeout(function() {
  20580. this.updateIntersect(),
  20581. this.handleInputEnd.call(this, t, i, !0)
  20582. }
  20583. .bind(this), k.input.longTapThreshold)
  20584. }
  20585. }
  20586. ,
  20587. t.prototype.onTouchMove = function(e) {
  20588. var t = x.average(e.changedTouches, "clientX")
  20589. , i = x.average(e.changedTouches, "clientY");
  20590. this.handleInputMove.call(this, t, i, !0)
  20591. }
  20592. ,
  20593. t.prototype.onTouchEnd = function(e) {
  20594. if (clearTimeout(this.mouseDownTimer),
  20595. this.mouseDown) {
  20596. this.couldBeLongTap = !1,
  20597. this.updateIntersect();
  20598. var t = x.average(e.changedTouches, "clientX")
  20599. , i = x.average(e.changedTouches, "clientY");
  20600. this.handleInputEnd.call(this, t, i, !0)
  20601. }
  20602. }
  20603. ,
  20604. t.prototype.onPointerDown = function(e) {
  20605. return e.currentTarget !== document && e.currentTarget.focus(),
  20606. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  20607. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20608. void (this.mouseDownTimer = setTimeout(function() {
  20609. this.updateIntersect(),
  20610. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20611. }
  20612. .bind(this), k.input.longTapThreshold)))
  20613. }
  20614. ,
  20615. t.prototype.onPointerMove = function(e) {
  20616. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  20617. }
  20618. ,
  20619. t.prototype.onPointerUp = function(e) {
  20620. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  20621. this.couldBeLongTap = !1,
  20622. this.updateIntersect(),
  20623. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  20624. }
  20625. ,
  20626. t.prototype.onPointerOut = function(e) {
  20627. this.mouseDown = !1
  20628. }
  20629. ,
  20630. t.prototype.onPointerCancel = function(e) {
  20631. this.mouseDown = !1
  20632. }
  20633. ,
  20634. t.prototype.onKeyDown = function(e) {
  20635. var t = function() {
  20636. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, "key")
  20637. }
  20638. .bind(this)
  20639. , i = e.which;
  20640. switch (i) {
  20641. case l.F:
  20642. t(),
  20643. this.changeFloor(-1);
  20644. break;
  20645. case l.R:
  20646. t(),
  20647. this.changeFloor(1)
  20648. }
  20649. if (this.mode === V.PANORAMA)
  20650. switch (i) {
  20651. case l.UPARROW:
  20652. case l.W:
  20653. this.flyLocalDirection(T.FORWARD.clone());
  20654. break;
  20655. case l.DOWNARROW:
  20656. case l.S:
  20657. this.flyLocalDirection(T.BACK.clone());
  20658. break;
  20659. case l.A:
  20660. this.flyLocalDirection(T.LEFT.clone());
  20661. break;
  20662. case l.D:
  20663. this.flyLocalDirection(T.RIGHT.clone())
  20664. }
  20665. }
  20666. ,
  20667. t.prototype.handleScrollPinchZoom = function(e) {
  20668. var t = e
  20669. , i = this.zoomLevel;
  20670. this.zoomBy(t),
  20671. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  20672. }
  20673. ,
  20674. t.prototype.handleControlPinch = function(e) {
  20675. k.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new B.Vector3(0,0,e).normalize())
  20676. }
  20677. ,
  20678. t.prototype.handleControlScroll = function(e) {
  20679. k.zoom.enabled ? (0 < e ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  20680. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new B.Vector3(0,0,-e).normalize())
  20681. }
  20682. ,
  20683. t.prototype.handleInputStart = function(e, t, i) {
  20684. var n = this.handelPadding(e, t);
  20685. e = n.x,
  20686. t = n.y,
  20687. this.isTouchEvent = i,
  20688. U.convertScreenPositionToNDC(e, t, this.mouse),
  20689. U.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  20690. this.mouseCouldBeClickToMove = !0,
  20691. this.mouseDown = !0
  20692. //this.mouseCouldBeClickToMove && window.Hotpoint && (new Hotpoint).state(this, C)
  20693. this.mouseCouldBeClickToMove && editTool.hotpoint.addHot()
  20694. window.transformControls && transformControls.onPointerDown()
  20695. }
  20696. ,
  20697. t.prototype.handelPadding = function(e, t) {
  20698. return this.pad || (this.pad = {
  20699. x: dom.getOffset("left", $("#player")[0]),
  20700. y: dom.getOffset("top", $("#player")[0])
  20701. }),
  20702. {
  20703. x: e - this.pad.x,
  20704. y: t - this.pad.y
  20705. }
  20706. }
  20707. ,
  20708. t.prototype.handleInputMove = function(e, t, i) {
  20709. var n = this.handelPadding(e, t);
  20710. e = n.x,
  20711. t = n.y,
  20712. this.isTouchEvent = i,
  20713. U.convertScreenPositionToNDC(e, t, this.mouse);
  20714. var moveToleranceNDC = (window.transformControls && transformControls.visible) ? 0.0000001 : k.input.moveToleranceNDC
  20715. this.mouseAtMouseDown.distanceTo(this.mouse) > moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  20716. this.couldBeLongTap = !1,
  20717. clearTimeout(this.mouseDownTimer)),
  20718. this.mouseLastMoveTime = Date.now(),
  20719. this.reticule.move(e, t, i)
  20720. window.transformControls && transformControls.onPointerMove()
  20721. }
  20722. ,
  20723. t.prototype.handleInputEnd = function(e, t, i) {
  20724. if (this.isTouchEvent = i,
  20725. this.mouseDown = !1,
  20726. this.cameraControls.controls[V.PANORAMA].emit("interaction.direct"),
  20727. !i && this.couldBeLongTap)
  20728. return !0;
  20729. if (this.handleLongTap())
  20730. return !0;
  20731. window.transformControls && transformControls.onPointerUp()
  20732. if (this.mouseCouldBeClickToMove) {
  20733. if (this.flying)
  20734. return this.path.activeTransType === R.WALK && this.emit(W.WarpInterruptedWithFlyTo, this.path.activeTransType),
  20735. !0;
  20736. //add----
  20737. if (this.checkHotClick())
  20738. return !0;
  20739. if (window.VisiSet && VisiSet.setPanoVisible) {//正在设置漫游可行
  20740. this.intersect && this.intersect.object.visible && VisiSet.dealPanoVisible(this.intersect.object.name);
  20741. return;
  20742. }
  20743. if (window.VisiSet && VisiSet.setTagVisible ) {
  20744. VisiSet.tagVsetting && this.intersect && this.intersect.object.visible && VisiSet.dealTagVisible(this.intersect.object.name);
  20745. return;
  20746. }
  20747. if (window.VisiSet && VisiSet.setPanoLog ) {
  20748. this.intersect && this.intersect.object.visible && VisiSet.dealPanoLogClick( this.intersect.object);
  20749. return;
  20750. }
  20751. if (window.VisiSet && VisiSet.setRoute) {
  20752. this.intersect && this.intersect.object.visible && VisiSet.dealRouteClick(this.intersect.object);
  20753. return;
  20754. }
  20755. if (window.VisiSet && VisiSet.setPanoArea ) {
  20756. this.intersect && this.intersect.object.visible && VisiSet.dealPanoAreaClick( this.intersect.object);
  20757. return;
  20758. }
  20759. if(this.hoveringPlane){
  20760. this.clickOverlay(this.hoveringPlane)
  20761. return;
  20762. }
  20763. if(window.EditOverlay && EditOverlay.objCursorType == "overlay"){
  20764. return EditOverlay.addPlane({intersect:this.intersect});
  20765. }
  20766. /* if(objects.mainDesign && objects.mainDesign.editing && objects.mainDesign.handleClickEnd(this)){//许钟文加
  20767. if(objects.mainDesign.editType == "wallDesign" && this.mode == "panorama") return !0;
  20768. else if(objects.mainDesign.editType == "addOverlay")return !0;
  20769. } */
  20770. //----------
  20771. if(this.intersect){// for cad add door etc.
  20772. let result = {}
  20773. this.emit('getIntersect', this.intersect, (state)=>{//consume
  20774. result.consume = true
  20775. })
  20776. if(result.consume)return; //有效使用了,就return
  20777. }
  20778. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, this.isTouchEvent ? "touch" : "mouse"),
  20779. this.history.invalidate(),
  20780. this.intersect)
  20781. return this.flyToPanoClosestToMouse();
  20782. if (this.mode === V.PANORAMA) {
  20783. var n = this.closestPanoInDirection(this.getMouseDirection());
  20784. return n ? this.flyToPano({
  20785. pano: n
  20786. }) : this.bump(this.getMouseDirection())
  20787. }
  20788. }
  20789. //this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  20790. }
  20791. ,
  20792. t.prototype.handleLongTap = function() {
  20793. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== V.PANORAMA))
  20794. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.LongTap, "touch"),
  20795. !0
  20796. }
  20797. ,
  20798. t.prototype.checktagClick = function() {
  20799. if (this.tagManager.intersectTag) {
  20800. var e = this.isTouchEvent
  20801. , t = this.tagManager.clickedOnTag(e, this);
  20802. return e || t || G.cancelById(q.LookTransition),
  20803. !0
  20804. }
  20805. if (this.tagManager.activeTag)
  20806. return this.tagManager.dismissActiveTag(),
  20807. !1
  20808. }
  20809. ,
  20810. t.prototype.rankedtagInDirection = function(e, t) {
  20811. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  20812. }
  20813. ,
  20814. t.prototype.start = function(e) {
  20815. $(".toolLeft").removeClass("unable");
  20816. $(".toolTop").removeClass("unable");
  20817. //-------------------
  20818. window.initTransformCtl(B)
  20819. //this.model.loadOverlays()
  20820. //window.EditOverlay && window.EditOverlay.init(B);
  20821. window.VisiSet && VisiSet.init()
  20822. //-------------------
  20823. var t = e.mode
  20824. , i = e.pano
  20825. , n = e.position
  20826. , r = e.quaternion
  20827. , o = e.tag
  20828. , a = e.quickstart
  20829. , s = $.Deferred();
  20830. this.updateModelDependentData(),
  20831. this.updateFromControls(),
  20832. this.findDefaultViews();
  20833. var l = this.is360View(t, i);
  20834. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  20835. s.done(function(e) {
  20836. this.emit(W.Ready, l, e, o)
  20837. }
  20838. .bind(this)),
  20839. s.promise()
  20840. }
  20841. ,
  20842. t.prototype.startOutside = function(e, t) {
  20843. var i = e.mode
  20844. , n = e.pano
  20845. , r = e.position
  20846. , o = e.quaternion
  20847. , a = e.zoom
  20848. , s = e.floorVisibility
  20849. , l = e.tag;
  20850. this.emit(W.StartOutside, k[i].transitionTime),
  20851. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  20852. G.cancelById(q.FlyToViewFloor),
  20853. i === V.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  20854. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  20855. }
  20856. ,
  20857. t.prototype.startInside = function(e, t, i, n, r) {
  20858. r = r || $.Deferred();
  20859. var o = (this.currentPano = e) && !e.isAligned();
  20860. window.bus.dispatchEvent({type:'playerAndModelReady'})
  20861. this.ready = true
  20862. if (t = o ? e.position : t || e.position,
  20863. i = i || e.quaternion,
  20864. e) {
  20865. var a = this.startInside.bind(this, e, t, i, n, r);
  20866. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  20867. return
  20868. }
  20869. //add
  20870. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  20871. //this.updateHotVisible()
  20872. //EditOverlay.updatePano()
  20873. editTool.hotpoint.updatePano()
  20874. Hot.updateVisibles([this.currentPano])
  20875. return this.mode = V.PANORAMA,
  20876. e.floor.enter(this.mode),
  20877. this.emit(W.PanoChosen, this.currentPano, this.currentPano),
  20878. this.switchCameraMode(this.mode, i),
  20879. this.emit(W.StartInside, o),
  20880. r.resolve(!0),
  20881. r
  20882. }
  20883. ,
  20884. t.prototype.startInsideWithFlyin = function(i, e, n, t, r) {
  20885. if (r = r || $.Deferred(),
  20886. this.dollhouseMode(),
  20887. !i)
  20888. return Y.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  20889. r.resolve(!1),
  20890. r;
  20891. e = e || i.position;
  20892. var o = n || this.cameraControls.activeControl.camera.quaternion
  20893. , a = i.position;
  20894. return this.fitDollhouse(a, e, o),
  20895. setTimeout(function(e) {
  20896. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = e);
  20897. var t = {
  20898. mode: V.PANORAMA,
  20899. pano: i,
  20900. quaternion: n,
  20901. callback: function() {
  20902. this.emit(W.FlyinFinished),
  20903. r.resolve(!0)
  20904. }
  20905. .bind(this)
  20906. };
  20907. this.flyToNewMode(t)
  20908. }
  20909. .bind(this, this.cameraControls.activeControl.maxDistance), k.startupFlyinDelay),
  20910. r
  20911. }
  20912. ,
  20913. t.prototype.checkAndWaitForPanoLoad = (Z = {},
  20914. K = {},
  20915. function(t, e, i, n, r, o, a, s, l, c) {
  20916. if (function() {
  20917. for (var e in Z)
  20918. if (Z.hasOwnProperty(e) && Z[e] && performance.now() - K[e] < 5e3)
  20919. return !0;
  20920. return !1
  20921. }())
  20922. return !0;
  20923. var h = function(e, t, i) {
  20924. j.delayOneFrame(function() {
  20925. Z[e] = !1,
  20926. r && r(t, i)
  20927. }
  20928. .bind(this))
  20929. }
  20930. .bind(this, t.id)
  20931. , u = function(e, t) {
  20932. j.delayOneFrame(function() {
  20933. Z[e] = !1,
  20934. o && o(t)
  20935. }
  20936. .bind(this))
  20937. }
  20938. .bind(this, t.id);
  20939. try {
  20940. return null != s || (s = !0),
  20941. this.model.supportsTiles ? Z[t.id] = this.checkAndWaitForTiledPanoLoad(t, n, h, u, a, s, l, c) : Z[t.id] = this.checkAndWaitForWholePanoLoad(t, e, i, h, s),
  20942. Z[t.id] && (K[t.id] = performance.now()),
  20943. Z[t.id]
  20944. } catch (e) {
  20945. throw Z[t.id] = !1,
  20946. K[t.id] = performance.now() - 5e3,
  20947. e
  20948. }
  20949. }
  20950. ),
  20951. t.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  20952. if (!e)
  20953. throw new p("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  20954. return r && this.model.waitForLoad(e, function() {
  20955. return e.isLoaded(i)
  20956. }),
  20957. !e.isLoaded(t) && (e.loadCube(t).done(n),
  20958. !0)
  20959. }
  20960. ,
  20961. t.prototype.checkAndWaitForTiledPanoLoad = (X = new B.Vector3,
  20962. function(e, t, i, n, r, o, a, s) {
  20963. if (!e)
  20964. throw new p("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  20965. return X.copy(T.FORWARD),
  20966. this.getDirection(X),
  20967. !e.isLoaded(t) && (o && this.model.waitForLoad(e, function() {
  20968. return e.isLoaded(t)
  20969. }),
  20970. e.loadTiledPano(t, X, null, a, s).done(function(e, t) {
  20971. i && i(e, t)
  20972. }
  20973. .bind(this)).fail(function(e) {
  20974. n && n(e)
  20975. }
  20976. .bind(this)).progress(function(e, t, i) {
  20977. r && r(e, t, i)
  20978. }
  20979. .bind(this)),
  20980. !0)
  20981. }
  20982. ),
  20983. t.prototype.switchCameraMode = function(mode, quaternion, target, position, {currentScale, fitBoundSize}={}) {
  20984. var control = this.cameraControls.controls[mode]
  20985. , camera = control.camera;
  20986. if(mode == V.PANORAMA){
  20987. camera.position.copy(this.currentPano.position);
  20988. var r = quaternion ? T.FORWARD.clone().applyQuaternion(quaternion) : this.getDirection().setY(0).normalize();
  20989. control.lookAt(r.add(camera.position));
  20990. }else{
  20991. if (target) {
  20992. control.target.copy(target)
  20993. }
  20994. if (position) {
  20995. camera.position.copy(position)
  20996. }
  20997. if(mode == V.DOLLHOUSE){
  20998. var pos = this.position.clone();
  20999. if(this.mode === V.PANORAMA){
  21000. let vec = new B.Vector3(0,6,0).add(this.getDirection().multiplyScalar(-10))
  21001. if(target)vec.multiplyScalar(0.15) //编辑热点时飞出不要飞太远,只是飞出来就近观察一下热点
  21002. pos.add(vec)
  21003. }else{
  21004. pos.add(T.DOWN.clone().applyQuaternion(this.quaternion).multiplyScalar(6)).setY(6)
  21005. }
  21006. camera.position.copy(pos)
  21007. if(!target) target = this.target.clone().setY(this.model.center.y)
  21008. control.target.copy(target);
  21009. //for多楼层 且 让模型刚好适应屏幕
  21010. /* var box = this.model.boundingBox.clone();
  21011. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  21012. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  21013. var fov = A.getHFOVFromVFOV(k.insideFOV, camera.aspect, 1); //获得在当前窗口的横向的fov
  21014. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  21015. console.log(boxSize.x,distance, boxSize.length() / 2)
  21016. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  21017. if(this.mode === V.PANORAMA){
  21018. control.target.copy(this.model.center);
  21019. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  21020. }else{
  21021. control.target.copy(this.target.clone().setY(this.model.center.y))
  21022. var vec = T.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  21023. }
  21024. vec.multiplyScalar(distance )
  21025. camera.position.copy(control.target.clone().add(vec)) */
  21026. }if(mode == V.FLOORPLAN){
  21027. if(!target){
  21028. control.target.copy(this.model.center).setY(0)
  21029. }
  21030. if(!position){
  21031. camera.position.copy(control.target).setY(k.floorplan.cameraHeight),
  21032. control.rotateToView(this.model.size, this.getDirection())
  21033. }
  21034. if(currentScale){
  21035. control.currentScale = control.absoluteScale = currentScale
  21036. }else if (fitBoundSize) {
  21037. control.zoomToContain(fitBoundSize)
  21038. }else{
  21039. control.zoomToContain(this.model.size)
  21040. }
  21041. }
  21042. }
  21043. control.update(0)
  21044. }
  21045. ,
  21046. t.prototype.update = (new B.Vector3,
  21047. N = {},
  21048. F = [],
  21049. function(e) {
  21050. this.updatePersistentZooming(e),
  21051. this.updateFromControls(e),
  21052. this.getCurrentNodePanos(F)
  21053. if(this.hasChanged(N)){
  21054. this.lastChangeTime = Date.now(),
  21055. !this.mouseDown && this.containsMouse && this.updateIntersect()
  21056. this.emit(W.ViewChanged, N)
  21057. //add:
  21058. if(N.cameraChanged){
  21059. Hot.updateHots()
  21060. this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z },this.cameraControls.controls.panorama.lon);
  21061. }
  21062. }
  21063. this.model.supportsTiles && (this.updateTileDownloader(F),
  21064. this.updatePanoRenderer(F)),
  21065. this.updatePreRendering(F),
  21066. this.reticule.update(),
  21067. this.path.update(),
  21068. this.spider.update(),
  21069. this.cachedPanoCandidates && k.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  21070. this.updateControlLocks(),
  21071. this.model.supportsTiles && this.updateZoomPano()
  21072. }
  21073. ),
  21074. t.prototype.updatePersistentZooming = function(e) {
  21075. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : -1 === this.zooming && this.zoomBy(1 - this.zoomSpeed * e)
  21076. }
  21077. ,
  21078. t.prototype.updateControlLocks = function() {
  21079. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[V.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  21080. }
  21081. ,
  21082. t.prototype.updatePanoRenderer = (D = new B.Vector3,
  21083. function(e) {
  21084. var t = this.nextPano || this.currentPano;
  21085. this.panoRenderer.hasQueuedTiles() && t && (D.copy(T.FORWARD),
  21086. this.getDirection(D),
  21087. this.panoRenderer.updateDirection(D))
  21088. }
  21089. ),
  21090. t.prototype.cleanupInactivePanos = (O = [],
  21091. L = [],
  21092. function() {
  21093. O.length = 0,
  21094. O.push(this.currentPano),
  21095. this.nextPano && O.push(this.nextPano);
  21096. for (var e = L.length = 0; e < this.panoRenderer.activePanos.length; e++)
  21097. L.push(this.panoRenderer.activePanos[e]);
  21098. for (var t = 0; t < L.length; t++) {
  21099. for (var i = L[t], n = !0, r = 0; r < O.length; r++)
  21100. i.id === O[r].id && (n = !1);
  21101. n && i.exit()
  21102. }
  21103. }
  21104. ),
  21105. t.prototype.updatePreRendering = (w = {},
  21106. function(e) {
  21107. if (1 === k.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  21108. var t = this.nextPano || this.currentPano;
  21109. if (t && e && 1 < e.length) {
  21110. var i = e.findIndex(function(e) {
  21111. if (e.id === t.id)
  21112. return !0
  21113. });
  21114. if (0 <= i && i + 1 < e.length) {
  21115. var n = e[i + 1];
  21116. n.isLoaded(this.basePanoSize) || w[n.id] || (window.setTimeout(function(e) {
  21117. this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  21118. window.setTimeout(function(e) {
  21119. w[e.id] = !1
  21120. }
  21121. .bind(this, e), k.tiling.panoPreRenderRepeatDelay)
  21122. }
  21123. .bind(this, n), k.tiling.panoPreRenderDelay),
  21124. w[n.id] = !0)
  21125. }
  21126. }
  21127. }
  21128. }
  21129. ),
  21130. t.prototype.enablePreRendering = function() {
  21131. this.preRenderingEnabled = !0
  21132. }
  21133. ,
  21134. t.prototype.disablePreRendering = function() {
  21135. this.preRenderingEnabled = !1,
  21136. this.cleanupInactivePanos()
  21137. }
  21138. ,
  21139. t.prototype.updateTileDownloader = (b = new B.Vector3,
  21140. function(e) {
  21141. var t = this.nextPano || this.currentPano;
  21142. t && (b.copy(T.FORWARD),
  21143. this.getDirection(b),
  21144. this.tileDownloader.tilePrioritizer.updateCriteria(t, this.position, b, 0 < e.length ? e : null),
  21145. this.tileDownloader.processPriorityQueue = !0)
  21146. }
  21147. ),
  21148. t.prototype.updateFromControls = function(e) {
  21149. null != e || (e = 0),
  21150. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  21151. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  21152. this.position.copy(this.cameraControls.activeControl.camera.position),
  21153. this.target.copy(this.cameraControls.activeControl.target),
  21154. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  21155. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  21156. this.camera.position.copy(this.position),
  21157. this.camera.quaternion.copy(this.quaternion),
  21158. this.camera.updateMatrix(),
  21159. this.camera.updateMatrixWorld()
  21160. }
  21161. ,
  21162. t.prototype.hasChanged = function(e) {
  21163. if (!this.previousState){
  21164. e.cameraChanged = true
  21165. return this.previousState = {
  21166. allFloorsVisible: this.model.allFloorsVisible,
  21167. position: this.position.clone(),
  21168. quaternion: this.quaternion.clone(),
  21169. mouse: this.mouse.clone(),
  21170. labelScaleFactor: this.getLabelScaleFactor(),
  21171. currentFloor: this.model.currentFloor,
  21172. projectionMatrix: this.camera.projectionMatrix.clone(),
  21173. worldMatrix: this.camera.matrixWorld.clone(),
  21174. mode: this.mode,
  21175. modelPosition: this.model.position.clone(),
  21176. modelCenter: this.model.center.clone(),
  21177. zoomLevel: this.zoomLevel
  21178. },
  21179. !0;
  21180. }
  21181. //许钟文改 分成相机是否改变cameraChanged 和其他
  21182. 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)
  21183. 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 ;
  21184. e.cameraChanged = !a;
  21185. //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;
  21186. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  21187. e.moved = !this.position.equals(this.previousState.position),
  21188. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  21189. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  21190. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  21191. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  21192. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  21193. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  21194. e.modeChanged = this.mode !== this.previousState.mode,
  21195. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  21196. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  21197. e.nextPanoActive = null !== this.nextPano,
  21198. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  21199. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  21200. this.previousState.position.copy(this.position),
  21201. this.previousState.quaternion.copy(this.quaternion),
  21202. this.previousState.mouse.copy(this.mouse),
  21203. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  21204. this.previousState.currentFloor = this.model.currentFloor,
  21205. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21206. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21207. this.previousState.mode = this.mode,
  21208. this.previousState.modelPosition.copy(this.model.position),
  21209. this.previousState.modelCenter.copy(this.model.center),
  21210. this.previousState.zoomLevel = this.zoomLevel,
  21211. !t
  21212. }
  21213. ,
  21214. t.prototype.updateIntersect = function() {
  21215. var e = this.flying || this.isWarping()
  21216. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  21217. , i = G.getById(q.LookTransition);
  21218. e || t || this.isTouchEvent || i.length && i[0].running;
  21219. {//clear:
  21220. //if(this.intersectHot) this.intersectHot.hideTitle()
  21221. if(this.intersectHot) this.intersectHot.setHoverState(false)
  21222. this.intersectHot = null
  21223. //$("#player").css("cursor", "")
  21224. CursorDeal.remove('hoverFootIcon' )
  21225. CursorDeal.remove('hoverRouteLine' )
  21226. CursorDeal.remove('hoverHot' )
  21227. $(".toolRight .spotList ul li").removeClass("active")
  21228. }
  21229. var deal = ()=>{
  21230. if(this.intersect && this.intersect.object.visible ){
  21231. if("hotSprite" == this.intersect.object.type){
  21232. this.intersectHot = this.intersect.object
  21233. while(!(this.intersectHot instanceof Hot)){
  21234. this.intersectHot = this.intersectHot.parent
  21235. }
  21236. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active")
  21237. this.intersectHot.setHoverState(true)
  21238. }
  21239. }
  21240. }
  21241. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog || VisiSet.setPanoArea && VisiSet.editPanoArea || VisiSet.setRoute )) {
  21242. let meshes = this.model.hotGroup.children.slice()
  21243. if(VisiSet.routeInfo?.operation == 'removeLink'){
  21244. meshes.push(...VisiSet.meshGroup.children.filter(e=>e.name.includes('routeLine:')))
  21245. }else{
  21246. VisiSet.footIcons && meshes.push(...VisiSet.footIcons)
  21247. }
  21248. this.intersect = this.getMouseIntersect(null, meshes );
  21249. deal()
  21250. if(this.intersect){
  21251. if(VisiSet.routeInfo?.operation == 'removeLink'){
  21252. CursorDeal.add('hoverRouteLine' )
  21253. }else{
  21254. CursorDeal.add('hoverFootIcon' ) //$("#player").css("cursor", "pointer");
  21255. }
  21256. }
  21257. if(this.intersectHot){
  21258. this.intersect = null
  21259. }
  21260. return
  21261. }else if (g_HotStatus) {//加热点
  21262. this.intersect = this.getMouseIntersect(null, this.model.colliders.concat(this.model.skybox));
  21263. if(this.intersect){
  21264. //$("#player").css("cursor", "cell")
  21265. CursorDeal.remove('noIntersect' )
  21266. }else{
  21267. //$("#player").css("cursor", "not-allowed")
  21268. CursorDeal.add('noIntersect' )
  21269. }
  21270. return;
  21271. }else{
  21272. if(this.model.hotGroup){
  21273. if(editTool.atPanel == 'hotpoint'){
  21274. var hots = this.model.hotGroup.children
  21275. }else{
  21276. var hots = this.model.hotGroup.children.filter(e=> e.info.actionType.examine || e.info.actionType.fastTran || e.info.actionType.openHot || e.info.actionType.playAndPause)
  21277. }
  21278. let colliders = this.model.floors.reduce(function(e, t) {
  21279. return t.hidden ? e : e.concat(t.collider.children)
  21280. }, this.mode === 'panorama' ? this.panoMarkers : []);
  21281. this.intersect = this.getMouseIntersect(null, hots.concat(colliders));
  21282. if(this.intersect){
  21283. deal()
  21284. this.intersectHot && CursorDeal.add('hoverHot' ) //$("#player").css("cursor", "pointer");
  21285. if(this.intersect){
  21286. deal()
  21287. let intersect = this.intersect
  21288. if(this.intersectHot){
  21289. this.intersect = null
  21290. $("#player").css("cursor", "pointer");
  21291. }else{
  21292. if(intersect.object.parent.parent.hidden ){//楼层已隐藏
  21293. this.intersect = null
  21294. }
  21295. }
  21296. }
  21297. }
  21298. }else{
  21299. this.intersect = this.getMouseIntersect()
  21300. }
  21301. }
  21302. this.intersect && this.updateClosestPano(this.intersect),
  21303. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  21304. k.navigation.panoScores && !k.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  21305. }
  21306. ,
  21307. t.prototype.checkHotClick = function() {
  21308. if (this.intersectHot){
  21309. if (window.VisiSet && VisiSet.setTagVisible ) {
  21310. VisiSet.SetOneTagVisible(this.intersectHot); //设置这个热点的可见性
  21311. return;
  21312. }else if(editTool.atPanel == 'hotpoint'){
  21313. let f = ()=>{editTool.hotpoint.editHot(this.intersectHot)}
  21314. if(editTool.hotpoint.editSpot && this.intersectHot != editTool.hotpoint.editSpot){
  21315. editTool.hotpoint.unsaveWarn(f)
  21316. }else{
  21317. f()
  21318. }
  21319. }else{
  21320. if(this.intersectHot.texType == "video" && this.intersectHot.info.actionType.playAndPause){
  21321. this.intersectHot.switchPlay(!!this.intersectHot.pausedByUser)
  21322. }
  21323. this.intersectHot.examine()
  21324. }
  21325. return !0
  21326. }
  21327. }
  21328. ,
  21329. t.prototype.getMouseDirection = function(e) {
  21330. e = e || this.mouse;
  21331. var t = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21332. return new B.Vector3(e.x,e.y,1).unproject(this.camera).sub(t).normalize()
  21333. }
  21334. ,
  21335. /* t.prototype.hoverOverlay = function(mesh){
  21336. if(!mesh){
  21337. this.hoveringPlane = null;
  21338. $("#player").css("cursor",this.currentCursor || "" );
  21339. }else{
  21340. var overlay = mesh.parent;
  21341. $("#player").css("cursor","pointer");
  21342. this.hoveringPlane = overlay;
  21343. return true;
  21344. }
  21345. }, */
  21346. t.prototype.clickOverlay = function(overlay){
  21347. if(this.openOverlay && !overlay)return;
  21348. var plane = overlay.plane;
  21349. if(overlay.texType == "video"){
  21350. overlay.switchPlay(!!overlay.pausedByUser)
  21351. }
  21352. if(window.EditOverlay && EditOverlay.editing){
  21353. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane){
  21354. var sure = confirm("是否保存当前展览?")
  21355. if(sure){
  21356. $("#overlayProp button.submit").click()
  21357. }else{
  21358. EditOverlay.closeOverlayPanel('cancel')
  21359. }
  21360. }
  21361. EditOverlay.beginEdit(overlay);
  21362. return;
  21363. }
  21364. },
  21365. t.prototype.getMouseIntersect = function(e, t1) {
  21366. e = e || this.mouse.clone()
  21367. var t = t1 || this.model.floors.reduce(function(e, t) {
  21368. return t.hidden ? e : e.concat(t.collider.children)
  21369. }, this.mode === V.PANORAMA ? this.panoMarkers : []),
  21370. t = t.slice(0)
  21371. i = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21372. this.raycaster.set(i, this.getMouseDirection(e));
  21373. var n = this.raycaster.intersectObjects(t , true );//add true
  21374. var o = n[0];
  21375. if(o){
  21376. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  21377. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  21378. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  21379. o.horizontal = .8 < o.normal.y);
  21380. return o
  21381. }
  21382. }
  21383. ,
  21384. t.prototype.updateClosestPano = function(e) {
  21385. var t = [a.filters.isPanoAligned()];
  21386. if (this.mode === V.PANORAMA) {
  21387. if (!this.currentPano)
  21388. return;
  21389. t.push(a.filters.not(this.currentPano)),
  21390. t.push(a.filters.isNeighbourPanoTo(this.currentPano)),
  21391. t.push(a.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  21392. t.push(a.filters.isCloseEnoughTo(e.point, k.panoFloorClickRadius)),
  21393. t.push(a.filters.isNotBehindNormal(e.point, e.normal))
  21394. } else{
  21395. t.push(a.filters.isOnVisibleFloor()),
  21396. t.push(this.checkHasNeighbor)//add
  21397. this.mode !== V.FLOORPLAN && t.push(a.filters.inDirection(this.position, this.getDirection(), .25));
  21398. }
  21399. var i = this.model.panos.find(t, [a.sortFunctions.floorDistanceToPoint(e.point)]);
  21400. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  21401. this.emit(W.ClosestPanoChanging, this.closestPano, i, this.mode),
  21402. this.closestPano = i,
  21403. this.closestPano && this.mode == 'panorama'? (CursorDeal.add('hoverPano' )/*, this.reticule.visible = false */)
  21404. : (CursorDeal.remove('hoverPano' )/*, this.reticule.visible = true */)
  21405. ) : this.isPanoHover = !1
  21406. }
  21407. ,
  21408. t.prototype.dollhouseMode = function(e, t) {
  21409. this.emit(W.ModeChanging, this.mode, V.DOLLHOUSE),
  21410. this.mode = V.DOLLHOUSE,
  21411. this.cameraControls.controls[V.DOLLHOUSE].reset();
  21412. var i = new B.Vector3(this.model.center.x,0,this.model.center.z)
  21413. , n = new B.Vector3(15,10,15);
  21414. if (e && t) {
  21415. var r = T.FORWARD.clone().applyQuaternion(t)
  21416. , o = this.model.center.clone().sub(e).dot(r);
  21417. 0 < o ? (i = r.clone().multiplyScalar(o).add(e),
  21418. n.copy(e)) : Y.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  21419. }
  21420. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(0, !0),
  21421. this.cameraControls.controls[V.DOLLHOUSE].target.copy(i),
  21422. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(n),
  21423. this.updateFromControls(),
  21424. this.model.alpha = 1,
  21425. this.model.skybox.material.uniforms.opacity.value = 0
  21426. }
  21427. ,
  21428. t.prototype.insideMode = function(e, t) {
  21429. var i = $.Deferred()
  21430. , n = t || null;
  21431. if (this.mode !== V.PANORAMA && this.mode !== V.TRANSITIONING) {
  21432. var r = [a.filters.isPanoAligned()];
  21433. this.model.currentFloor && r.push(a.filters.atFloor(this.model.currentFloor)),
  21434. e = e || this.currentPano || this.model.panos.find(r, [a.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  21435. this.flyToNewMode({
  21436. mode: V.PANORAMA,
  21437. pano: e,
  21438. callback: n
  21439. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  21440. } else {
  21441. var o = this.mode === V.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  21442. i.reject(o)
  21443. }
  21444. return i.promise()
  21445. }
  21446. ,
  21447. t.prototype.fitDollhouse = function(e, t, i) {
  21448. var maxY = this.model.boundingBox.max.y;//add
  21449. var n = T.FORWARD.clone().applyQuaternion(i);
  21450. i = n.clone().add(e);
  21451. this.cameraControls.activeControl.target.copy(i),
  21452. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  21453. }
  21454. ,
  21455. t.prototype.floorplanMode = function(e, t, i) {
  21456. this.mode = V.FLOORPLAN;
  21457. var n = this.cameraControls.controls[V.FLOORPLAN];
  21458. n.reset();
  21459. var r = e || this.model.center;
  21460. if (n.target.copy(r).setY(0),
  21461. n.camera.position.copy(r).setY(k.floorplan.cameraHeight),
  21462. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  21463. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  21464. t) {
  21465. var o = T.LEFT.clone().applyQuaternion(t);
  21466. n.rotateLeft(-Math.atan2(o.x, o.z))
  21467. } else
  21468. n.rotateToView(this.model.size, this.getDirection());
  21469. n.update(0)
  21470. }
  21471. ,
  21472. t.prototype.nonInterruptingFlyToPano = function(e, t) {
  21473. return e.skipWarpingCheck = !0,
  21474. this.flyToPano(e, t)
  21475. }
  21476. ,
  21477. t.prototype.updateMarkerVisi = function() {//加
  21478. if(this.mode != "panorama")return;
  21479. this.model.panos.list.forEach((pano)=>{
  21480. if(!pano.marker)return;
  21481. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  21482. })
  21483. }
  21484. ,
  21485. /* t.prototype.updateHotVisible = function(pano){
  21486. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setPanoLog))return
  21487. var hots = this.model.hots;
  21488. pano = pano || this.currentPano;
  21489. for (var index in hots){
  21490. var visible;
  21491. if(this.mode != "panorama"){
  21492. visible = true;
  21493. }else{
  21494. //hots[index].mesh.material.depthTest = false;
  21495. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  21496. }
  21497. hots[index].mesh.visible = visible;
  21498. }
  21499. }
  21500. */
  21501. t.prototype.flyToPano = function(e, t) {
  21502. var i, n = e.pano, aim = e.lookAtPoint, aimQua = e.quaternion,//ADD
  21503. o = e.duration, a = e.aimDuration, s = e.maxDistanceOverride,
  21504. l = e.skipWarpingCheck, c = e.constantMoveSpeed, h = null, u = null
  21505. if (aim){
  21506. var m = (new B.Matrix4).lookAt(n.position, aim, T.UP)
  21507. aimQua = (new B.Quaternion).setFromRotationMatrix(m)
  21508. }
  21509. else aimQua = aimQua
  21510. var zoomLevel = e.zoomLevel || 1 //add
  21511. if(this.flying) return t && t(e)
  21512. if (window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(n),
  21513. this.isWarping() && !l && (this.path.activeTransType === R.BLACK || this.path.activeTransType === R.STD))
  21514. return Y.warn("Player.flyToPano() -> Cannot fly when warping"),
  21515. t && t(),
  21516. !1;
  21517. this.updateLastView()
  21518. if (this.mode !== V.PANORAMA)
  21519. return void this.flyToNewMode({
  21520. mode: V.PANORAMA,
  21521. pano: n,
  21522. duration: o,
  21523. quaternion: aimQua,
  21524. callback: t
  21525. });
  21526. if (!n || (h = x.deepExtend(e), u = function() {
  21527. j.delayOneFrame(function() {
  21528. this.flyToPano(h, t)
  21529. }.bind(this))
  21530. }.bind(this),
  21531. !this.checkAndWaitForPanoLoad(n, "high", "low", this.basePanoSize, u))) {
  21532. var d = function(e) {
  21533. t && t(e)
  21534. }
  21535. .bind(this);
  21536. this.currentPano || (this.currentPano = n,
  21537. this.path.placeCpm(),
  21538. this.path.fadeOutCpm(k.path.fadeOutTime),
  21539. this.spider.draw());
  21540. var p = o;
  21541. if ("number" != typeof o) {
  21542. var f = s || k.transition.flytimeMaxDistanceThreshold;
  21543. p = Math.min(this.currentPano.position.distanceTo(n.position), f) * k.transition.flytimeDistanceMultiplier + k.transition.flyTime
  21544. }
  21545. if (.01 < k.transition.flySpeed && (p = 1e3 * this.currentPano.position.distanceTo(n.position) / k.transition.flySpeed),
  21546. zoomLevel !== this.zoomLevel)
  21547. switch (k.zoom.transitionStyle) {
  21548. case 1:
  21549. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? p / 2 : p); //改
  21550. break;
  21551. case 2:
  21552. return h = x.deepExtend(e),
  21553. u = this.flyToPano.bind(this, h, t),
  21554. void this.smoothZoomFovTo(null, zoomLevel, k.zoom.restoreTime * (this.zoomLevel - 1), u)
  21555. }
  21556. if (aimQua) {
  21557. G.cancelById(q.LookTransition),
  21558. p *= k.transition.aimSlowFactor;
  21559. var g = this.cameraControls.activeControl.camera.quaternion.clone()
  21560. , y = g.clone()
  21561. , A = new B.Vector3;
  21562. if (n === this.currentPano) {
  21563. var C = T.FORWARD.clone().applyQuaternion(g)
  21564. , I = T.FORWARD.clone().applyQuaternion(aimQua)
  21565. , E = C.angleTo(I);
  21566. return null != a || (a = 1 * Math.sqrt(E) / k.tags.navigate.rotateSpeedFactor * 1e3),
  21567. void G.start(function(e) {
  21568. y.copy(g),
  21569. H.quaternion(y, aimQua)(e),
  21570. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21571. this.cameraControls.activeControl.lookAt(A)
  21572. }
  21573. .bind(this), a, d, 0, z[k.transition.movementEasing], null, q.LookTransition)
  21574. }
  21575. }
  21576. if (n === this.currentPano )
  21577. return void d();
  21578. this.flying = !0;
  21579. var _ = this.position.clone()
  21580. , b = this.currentPano;
  21581. Y.debug("Flying to pano ", n.position);
  21582. this.emit(W.PanoChosen, this.currentPano, n);
  21583. this.emit(W.FlyingStarted, n.position, _, n, b);
  21584. this.transitionPos({type:"beforeFlytopano", pano:n, dur:p})//add
  21585. Hot.updateVisibles([this.currentPano, n],'every')
  21586. aimQua && G.start(function(e) {
  21587. y.copy(g),
  21588. H.quaternion(y, aimQua)(e),
  21589. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21590. this.cameraControls.activeControl.lookAt(A)
  21591. }
  21592. .bind(this), p, null, 0, z[k.transition.movementEasing], null, q.LookTransition);
  21593. var w = c ? null : z[k.transition.movementEasing];
  21594. this.nextPano = n;
  21595. G.start(H.uniform(this.model.skybox, "progress", 1), p, null, 0, z[k.transition.blendEasing], "skyFly", q.FlyToPano),
  21596. G.start(H.allUniforms(this.model.chunks, "progress", 1), p, null, 0, z[k.transition.blendEasing], "chunkFly", q.FlyToPano),
  21597. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, n.position), p, function(e) {
  21598. this.flying = !1,
  21599. this.currentPano !== n && this.currentPano.exit(),
  21600. n.enter(),
  21601. this.currentPano = n,
  21602. this.nextPano = null,
  21603. this.path.placeCpm(),
  21604. this.path.fadeOutCpm(k.path.fadeOutTime),
  21605. this.spider.draw(),
  21606. this.emit(W.FlyingEnded, n.position, _, n, b),
  21607. this.updateMarkerVisi();//add
  21608. d(e)
  21609. if(this.mode == "panorama" ){
  21610. //EditOverlay.updatePano()
  21611. editTool.hotpoint.updatePano()
  21612. Hot.updateVisibles([this.currentPano])
  21613. this.model.fadePanoMarkers()//add
  21614. }
  21615. }
  21616. .bind(this), 0, w, "camFly", q.FlyToPano)
  21617. }
  21618. }
  21619. ,
  21620. t.prototype.blackToPano = function(o={}) {//add 瞬间过渡
  21621. if(this.flying || this.isWarping() )return;
  21622. let pano = o.pano || this.model.panos.index[o.panoId]
  21623. if(this.mode != 'panorama'){
  21624. return this.flyToNewMode({
  21625. mode : 'panorama',
  21626. pano,
  21627. quaternion: o.quaternion
  21628. })
  21629. }
  21630. let oldPos = this.position.clone();
  21631. let oldPano = this.currentPano
  21632. this.path.warpDestPano = pano
  21633. var retry = ()=>{
  21634. this.waitingToWarp = !1,
  21635. this.blackToPano(o)
  21636. }
  21637. if (this.checkAndWaitForPanoLoad(pano, "high", "low", this.basePanoSize, retry))
  21638. return void (this.waitingToWarp = !0)
  21639. console.log('blackToPano')
  21640. this.flying = true
  21641. this.nextPano = pano //提前加载高清图片
  21642. this.path.warpDestHeroLoc = {
  21643. panoId : o.panoId,
  21644. position: pano.position,
  21645. quaternion: o.quaternion || this.quaternion.clone()
  21646. }
  21647. this.path.warpTravel_BLACK(null, 1500,1, ()=>{
  21648. pano != this.currentPano && this.currentPano.exit()
  21649. pano.enter()
  21650. this.currentPano = pano
  21651. this.flying = false
  21652. this.nextPano = null
  21653. this.updateMarkerVisi();//add
  21654. console.log('blackToPano end')
  21655. } )
  21656. }
  21657. window._transitionPosId = 9999
  21658. t.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  21659. G.cancelById(_transitionPosId)
  21660. var begin = function(object, pos, qua, scale){
  21661. if(pos){
  21662. if(!same(object.position, pos, 0.01)){
  21663. G.start(H.vector(object.position, pos), o.dur, (e)=>{
  21664. object.updateScale()
  21665. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21666. }
  21667. if(qua && !same(object.quaternion, qua, 1e-6)){
  21668. G.start(H.quaternion(object.quaternion, qua), o.dur, (e)=>{
  21669. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21670. }
  21671. if(scale && !same(object.scale, scale, 0.001)){
  21672. G.start(H.vector(object.scale, scale), o.dur, (e)=>{
  21673. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21674. }
  21675. }
  21676. }
  21677. var same = function(vec1, vec2, diff){
  21678. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  21679. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  21680. return s
  21681. }
  21682. var sid = o.pano != void 0 ? o.pano.id : "outside";
  21683. for(let i in this.model.hots){//是否判断visible?
  21684. var hot = this.model.hots[i];
  21685. var panoData = hot.info.transformAtPanos[sid];
  21686. var useCustom = !panoData
  21687. //if(hot.usingTransformData || !useCustom){
  21688. var pos = useCustom ? hot.info.position : panoData.pos;
  21689. var qua = hot.isSprite ? null : (useCustom ? hot.info.quaternion : panoData.qua);
  21690. var scale = useCustom ? hot.info.scale : panoData.scale;
  21691. begin(hot, pos , qua, scale )
  21692. //}
  21693. //hot.usingTransformData = !useCustom;
  21694. }
  21695. if(o.callback){
  21696. setTimeout(()=>{
  21697. o.callback()
  21698. },o.dur + 16) ;//姑且这么写
  21699. }
  21700. }
  21701. window._tranOutsideFocus = 4399
  21702. t.prototype.focusPoint = function(o={}){//当在外时,聚焦相机到这一点
  21703. //console.log("focusPoint")
  21704. if(this.mode == "floorplan"){
  21705. var control = player.cameraControls.controls.floorplan;
  21706. var currentTarget = control.target.clone()
  21707. if(!o.dontChangeScale){
  21708. var modelSize = o.modelSize || new THREE.Vector3(8,8,8);//可视范围
  21709. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  21710. var currentScale = control.absoluteScale;
  21711. }
  21712. G.cancelById(window._tranOutsideFocus, true);
  21713. G.start(function(progress){
  21714. o.dontChangeScale || (control.absoluteScale = absoluteScale*progress + currentScale*(1-progress))
  21715. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  21716. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  21717. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, z[k.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  21718. }else if(player.mode == "dollhouse"){
  21719. var control = player.cameraControls.controls.dollhouse;
  21720. var radius = o.radius || 8;
  21721. var currentTarget = control.target.clone()
  21722. var dir = control.offset.clone().normalize()
  21723. var currentRadius = control.offset.length();
  21724. G.cancelById(window._tranOutsideFocus, true);
  21725. G.start(function(progress){
  21726. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  21727. let radius_ = radius*progress+currentRadius*(1-progress)
  21728. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  21729. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, z[k.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  21730. }else if(this.mode == 'panorama'){
  21731. this.flyToPano({
  21732. lookAtPoint: o.aim.clone() ,
  21733. pano: this.currentPano,
  21734. aimDuration: o.dur || 600
  21735. })
  21736. }
  21737. }
  21738. t.prototype.fastForwardActivePanoFlight = function(e) {
  21739. e = e || k.transition.fastForwardFactor / 10 * 4 + 1,
  21740. G.adjustSpeed(q.FlyToPano, e),
  21741. G.adjustSpeed(q.LookTransition, e)
  21742. }
  21743. ,
  21744. t.prototype.flyToPanoClosestToMouse = function() {
  21745. if (50 < Date.now() - this.mouseLastMoveTime && (this.intersect = this.getMouseIntersect(),
  21746. this.intersect && this.updateClosestPano(this.intersect)),
  21747. this.closestPano)
  21748. return this.flyToPano({
  21749. pano: this.closestPano
  21750. });
  21751. var e = this.getMouseDirection();
  21752. this.flyDirection(e) || this.flyToPano({
  21753. pano: this.currentPano
  21754. })
  21755. }
  21756. ,
  21757. t.prototype.flyLocalDirection = function(e) {
  21758. var t = this.getDirection(e)
  21759. , i = 1 === e.z ? .4 : .75
  21760. , n = 1 === Math.abs(e.x);
  21761. return this.flyDirection(t, i, n)
  21762. }
  21763. ,
  21764. t.prototype.flyDirection = function(e, t, i) {
  21765. Hot.closePopup();//xzw add
  21766. var n = $.Deferred();
  21767. this.history.invalidate();
  21768. var r = this.closestPanoInDirection(e, t, i);
  21769. return r ? this.flyToPano({
  21770. pano: r
  21771. }, n.resolve.bind(n, !0)) : (this.bump(e),
  21772. n.resolve(!1)),
  21773. n.promise()
  21774. }
  21775. ,
  21776. t.prototype.closestPanoInDirection = function(e, t, i) {
  21777. return this.rankedPanoInDirection(0, e, t, i)
  21778. }
  21779. ,
  21780. t.prototype.rankedPanoInDirection = (_ = {
  21781. pano: null,
  21782. candidates: []
  21783. },
  21784. function(e, t, i, n) {
  21785. e = e || 0,
  21786. i = void 0 !== i ? i : .75;
  21787. var r = n ? "angle" : "direction";
  21788. return this.model.panos.findRankedByScore(e,
  21789. [a.filters.isPanoAligned(),
  21790. a.filters.not(this.currentPano),
  21791. a.filters.isNeighbourPanoTo(this.currentPano),
  21792. a.filters.inPanoDirection(this.position, t, i)
  21793. ],
  21794. [a.scoreFunctions.distanceSquared(this.currentPano), a.scoreFunctions[r](this.position, t)], _),
  21795. this.cachedPanoCandidates = _.candidates,
  21796. _.pano
  21797. }
  21798. ),
  21799. t.prototype.bump = function(e) {
  21800. if (this.mode === V.PANORAMA && !this.flying && !this.isWarping()) {
  21801. var t, i, n, r = k.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e);
  21802. if (.5 < Math.abs(a))
  21803. t = function() {
  21804. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 0 < a ? 1.04 : .96), o, i, 0, z.easeInOutSine, "bumpZStart")
  21805. }
  21806. .bind(this),
  21807. i = function() {
  21808. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 1), 5 * o, n, 0, z.easeInOutSine, "bumpZRelax")
  21809. }
  21810. .bind(this);
  21811. else {
  21812. var s = this.camera.position.clone()
  21813. , l = e.clone();
  21814. this.raycaster.set(s, l);
  21815. var c = this.model.floors.reduce(function(e, t) {
  21816. return e.concat(t.collider.children)
  21817. }, [])
  21818. , h = this.raycaster.intersectObjects(c)
  21819. , u = 0 < h.length ? h[0].distance / 25 : .04
  21820. , d = s.clone().add(l.multiplyScalar(u));
  21821. t = function() {
  21822. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, d), o, i, 0, z.easeInOutSine, "bumpTStart")
  21823. }
  21824. .bind(this),
  21825. i = function() {
  21826. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, s), 5 * o, n, 0, z.easeInOutSine, "bumpTRelax")
  21827. }
  21828. .bind(this)
  21829. }
  21830. n = function() {
  21831. this.flying = !1
  21832. }
  21833. .bind(this),
  21834. this.flying = !0,
  21835. t()
  21836. }
  21837. }
  21838. ,
  21839. t.prototype.changeFloor = function(e) {
  21840. if (!this.is360View(this.mode, this.currentPano))
  21841. if (this.mode === V.PANORAMA) {
  21842. var t = this.history.reversePano(e);
  21843. t && t.isAligned() ? this.flyToPano({
  21844. pano: t
  21845. }) : this.changeFloorByScore(e)
  21846. } else
  21847. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  21848. }
  21849. ,
  21850. t.prototype.changeFloorByScore = (E = {
  21851. pano: null,
  21852. candidates: []
  21853. },
  21854. function(e) {
  21855. var t = this.model.nextFloor(e);
  21856. return t ? (this.model.panos.lowestByScore([a.filters.atFloor(t), a.filters.isPanoAligned()], [a.scoreFunctions.distance(this.currentPano), a.scoreFunctions.direction(this.position, new B.Vector3(0,e,0)), a.scoreFunctions.penalizeHeightDifferenceUnder(this.position, .5)], E),
  21857. void (E.pano ? (this.cachedPanoCandidates = E.candidates,
  21858. this.history.push(e, this.currentPano),
  21859. this.flyToPano({
  21860. pano: E.pano
  21861. })) : Y.warn("No pano found on selected floor, not moving there."))) : void Y.debug("player.changeFloor(" + e + "): no such floor")
  21862. }
  21863. ),
  21864. t.prototype.gotoFloor = function(e) {
  21865. var t = e - this.model.currentFloor.floorIndex;
  21866. this.changeFloor(t)
  21867. }
  21868. ,
  21869. t.prototype.getDirection = function(e) {
  21870. return (e = e || (new B.Vector3).copy(T.FORWARD)).applyQuaternion(this.camera.quaternion)
  21871. }
  21872. ,
  21873. t.prototype.flyToSameMode = function(e, t, i, n, r) {
  21874. if (r = r || $.Deferred(),
  21875. this.mode === V.TRANSITIONING)
  21876. return Y.warn("should not be transitioning here"),
  21877. n && n(!1),
  21878. r.reject().promise();
  21879. var o = i || !1
  21880. , a = i ? i.position : this.position
  21881. , s = this.position.clone()
  21882. , l = this.currentPano;
  21883. if (Y.debug("New pose in mode " + this.mode),
  21884. !e || (retryCallback = function() {
  21885. j.delayOneFrame(function() {
  21886. this.flyToSameMode(e, t, i, n, r)
  21887. }
  21888. .bind(this))
  21889. }
  21890. .bind(this),
  21891. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  21892. var c = function() {
  21893. this.emit(W.FlyingEnded, a, s, e, l),
  21894. n && n(!0)
  21895. }
  21896. .bind(this)
  21897. , h = k[this.mode]
  21898. , u = void 0 !== t ? t : h.transitionTime
  21899. , d = new B.Vector3
  21900. , p = new B.Vector3;
  21901. if (this.emit(W.FlyingStarted, a, s, e, l),
  21902. this.mode === V.PANORAMA)
  21903. Y.warn("we should not be here for panorama views");
  21904. else if (this.mode === V.DOLLHOUSE)
  21905. if (o) {
  21906. var f = new B.Vector3(0,1,0);
  21907. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21908. this.model.warpDestFloors(i.floorVisibility),
  21909. p.copy(i.position);
  21910. var g = new B.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  21911. , m = new B.Raycaster(p.clone(),g.clone(),0,1 / 0).intersectObjects(this.model.colliders)
  21912. , v = 3;
  21913. m.length ? (d.copy(m[0].point),
  21914. v = .75 * p.distanceTo(d)) : (d.copy(g).multiplyScalar(3).add(p),
  21915. Y.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  21916. var y = (new B.Matrix4).lookAt(p, d, f)
  21917. , A = (new B.Euler).setFromRotationMatrix(y, k.warp.eOrder)
  21918. , C = d.distanceTo(p)
  21919. , I = (new B.Matrix4).lookAt(this.cameraControls.cameras[V.DOLLHOUSE].position, this.cameraControls.controls[V.DOLLHOUSE].target, f)
  21920. , E = (new B.Euler).setFromRotationMatrix(I, k.warp.eOrder)
  21921. , _ = this.cameraControls.cameras[V.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[V.DOLLHOUSE].target);
  21922. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(Math.min(_, v), !0);
  21923. var b = new B.Euler(A.x - E.x,A.y - E.y,A.z - E.z,k.warp.eOrder);
  21924. b.y = b.y > Math.PI ? b.y -= 2 * Math.PI : b.y < -Math.PI ? b.y += 2 * Math.PI : b.y,
  21925. this.path.burnsDir = Math.sign(b.y);
  21926. var w = new B.Euler(0,0,0,k.warp.eOrder)
  21927. , T = new B.Vector3;
  21928. G.start(H.vector(this.cameraControls.controls[V.DOLLHOUSE].target, d), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21929. G.start(function(e, t) {
  21930. w.x = E.x + e * b.x,
  21931. w.y = E.y + e * b.y,
  21932. w.z = E.z + e * b.z;
  21933. var i = _ + e * (C - _);
  21934. T.set(0, 0, i).applyEuler(w).add(this.cameraControls.controls[V.DOLLHOUSE].target),
  21935. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(T).add(this.model.position)
  21936. }
  21937. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21938. G.start(function(e, t) {
  21939. this.cameraControls.controls[V.DOLLHOUSE].update(),
  21940. this.quaternion.copy(this.cameraControls.cameras[V.DOLLHOUSE].quaternion),
  21941. this.position.copy(this.cameraControls.cameras[V.DOLLHOUSE].position)
  21942. }
  21943. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21944. } else
  21945. Y.warn("invalid warp destination in flyToSameMode()? ignore it then");
  21946. else if (this.path.placeCpm(),
  21947. this.path.fadeInCpm(k.path.fadeInTime),
  21948. i) {
  21949. this.model.warpDestFloors(i.floorVisibility);
  21950. var x = this.cameraControls.cameras[V.FLOORPLAN]
  21951. , S = this.cameraControls.controls[V.FLOORPLAN]
  21952. , M = S.target.clone()
  21953. , R = i.position.clone().sub(M)
  21954. , P = x.position.clone().sub(S.target).length()
  21955. , O = new B.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  21956. , L = Math.atan2(S.offset.x, S.offset.z)
  21957. , D = Math.atan2(O.x, O.z)
  21958. , N = S.absoluteScale
  21959. , F = U.convertWorkshopOrthoZoom(i.orthoZoom);
  21960. G.start(function(e, t) {
  21961. S.target.copy(R).multiplyScalar(e).add(M);
  21962. var i = L + (D - L) * e;
  21963. S.offset.x = P * Math.sin(i),
  21964. S.offset.z = P * Math.cos(i),
  21965. x.position.copy(S.target).add(S.offset),
  21966. S.absoluteScale = N + e * (F - N),
  21967. S.update(),
  21968. this.quaternion.copy(x.quaternion),
  21969. this.position.copy(x.position),
  21970. this.target.copy(S.target),
  21971. this.camera.projectionMatrix.copy(x.projectionMatrix)
  21972. }
  21973. .bind(this), u, null, 0, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21974. } else
  21975. Y.info("flyToSameMode() funny floorplan view? skipping");
  21976. return G.setTimeout(function(e) {
  21977. this.mode = e,
  21978. c(),
  21979. r.resolve(!0)
  21980. }
  21981. .bind(this, this.mode), u, q.FlyToSameMode),
  21982. this.mode = V.TRANSITIONING,
  21983. r.promise()
  21984. }
  21985. }
  21986. ,
  21987. t.prototype.flyToNewMode = function(e, t) {
  21988. Hot.closePopup();//xzw add
  21989. var i = (e = e || {}).mode
  21990. , n = e.pano
  21991. , r = e.duration
  21992. , o = e.warpDest
  21993. , a = e.callback
  21994. , s = e.force
  21995. , l = e.quaternion;
  21996. if (t = t || $.Deferred(),
  21997. this.isWarping())
  21998. return Y.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  21999. a && a(!1),
  22000. t.reject("Cannot change mode during tour transition").promise();
  22001. if (this.mode === V.TRANSITIONING)
  22002. return a && a(!1),
  22003. t.reject("Cannot change mode during mode transition").promise();
  22004. if (i === this.mode)
  22005. return s ? (this.flyToSameMode(n, r, o, a).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  22006. t.promise()) : (a && a(!1),
  22007. t.reject("Already in " + i + " mode").promise());
  22008. var c = o || !1;
  22009. Y.debug("Switching mode to " + i);
  22010. var h = function() {
  22011. j.delayOneFrame(function() {
  22012. this.flyToNewMode(e, t)
  22013. }
  22014. .bind(this))
  22015. }
  22016. .bind(this);
  22017. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, h))
  22018. return t.promise();
  22019. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i)){
  22020. return Y.info("Waiting for model textures to be loaded before going out to dollhouse"),
  22021. this.model.waitForLoad(this.model, function() {
  22022. return this.model.meshTexturesLoaded
  22023. }
  22024. .bind(this)),
  22025. this.model.loadMeshTextures().done(h),
  22026. t.promise();
  22027. }
  22028. this.history.invalidate()
  22029. this.updateLastView();
  22030. var u = this.mode
  22031. , d = this.cameraControls.cameras[i];
  22032. e = x.deepExtend({}, k[i], k[u + "-" + i]);
  22033. var p = void 0 !== r ? r : e.transitionTime;
  22034. this.emit(W.ModeChanging, u, i, n, p)
  22035. n && (this.currentPano = n)
  22036. //----------改----------
  22037. let target,position,currentScale,fitBoundSize
  22038. if(editTool.hotpoint.editSpot){//focus
  22039. target = editTool.hotpoint.editSpot.position.clone()
  22040. let bound = editTool.hotpoint.editSpot.info.modelBound?.bound
  22041. if(bound){
  22042. bound = new THREE.Box3().copy(bound).applyMatrix4(editTool.hotpoint.editSpot.children[0].matrixWorld)
  22043. fitBoundSize = bound.size()
  22044. }else{
  22045. fitBoundSize = new THREE.Vector3(5,5,5)
  22046. }
  22047. }
  22048. this.switchCameraMode(i, l, target, position, {currentScale, fitBoundSize})
  22049. //----------------------
  22050. G.cancelById(q.LookTransition);
  22051. var f = (new B.Vector3).copy(this.position);
  22052. this.modeTran = this.mode + "-" + i;
  22053. /* if(editTool.atPanel == "screen"){
  22054. if(this.mode == "panorama") $(".confirmSnap").addClass("unable")
  22055. else if(i == "panorama") $(".confirmSnap").removeClass("unable")
  22056. } */
  22057. if(i == "panorama"){
  22058. this.transitionPos({type:"beforeFlyIn", pano:n, dur:p})//add
  22059. }else{
  22060. this.transitionPos({type:"beforeFlyOut", dur:p/2})//add
  22061. }
  22062. window.bus.dispatchEvent({type:'playerAndModelReady'})
  22063. this.ready = true
  22064. if (i === V.PANORAMA)
  22065. this.emit(W.PanoChosen, n, n),
  22066. setTimeout(function() {
  22067. n.floor.enter(i)
  22068. }
  22069. .bind(this), p / 2),
  22070. this.path.fadeOutCpm(k.path.fadeOutTime);
  22071. else if (i === V.DOLLHOUSE) {
  22072. if (c && (this.model.stayPut = !0),
  22073. o ? (this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  22074. this.model.warpDestFloors(o.floorVisibility)) : this.model.toggleAllFloors(!0),
  22075. this.path.placeCpm(),
  22076. this.path.fadeInCpm(k.path.fadeInTime),
  22077. c) {
  22078. var g = new B.Vector3(this.model.center.x,0,this.model.center.z);
  22079. f.set(15, 10, 15);
  22080. var m = new B.Vector3(0,0,-1).applyQuaternion(o.quaternion)
  22081. , v = new B.Raycaster(o.position.clone(),m.clone(),0,1 / 0).intersectObjects([this.sceneIntersectionPlane]);
  22082. v.length ? (g.copy(v[0].point),
  22083. f.copy(o.position),
  22084. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(.75 * f.distanceTo(g), !0)) : (Y.warn("Tried to restore dollhouse mode that did not intersect...", o.position, o.quaternion),
  22085. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(3, !0)),
  22086. this.cameraControls.controls[V.DOLLHOUSE].target.copy(g),
  22087. f.add(this.model.position),
  22088. d.position.copy(f),
  22089. this.cameraControls.controls[V.DOLLHOUSE].update()
  22090. }
  22091. } else if (this.path.placeCpm(),
  22092. this.path.fadeInCpm(k.path.fadeInTime),
  22093. o) {
  22094. this.model.warpDestFloors(o.floorVisibility);
  22095. var y = this.cameraControls.cameras[V.FLOORPLAN]
  22096. , A = this.cameraControls.controls[V.FLOORPLAN]
  22097. , C = y.position.clone().sub(A.target)
  22098. , I = new B.Vector3(-1,0,0).applyQuaternion(o.quaternion).normalize()
  22099. , E = Math.atan2(I.x, I.z);
  22100. A.target.copy(o.position);
  22101. var _ = C.length();
  22102. A.offset.x = _ * Math.sin(E),
  22103. A.offset.y = 0,
  22104. A.offset.z = _ * Math.cos(E),
  22105. y.position.copy(A.target).add(A.offset),
  22106. A.target.clone().sub(d.position),
  22107. d.quaternion.copy(o.quaternion),
  22108. A.currentScale = U.convertWorkshopOrthoZoom(o.orthoZoom),
  22109. A.absoluteScale = A.currentScale,
  22110. A.update()
  22111. } else
  22112. this.model.currentFloor.enter(i);
  22113. var b = this.currentPano
  22114. , w = this.position.clone();
  22115. return this.emit(W.FlyingStarted, f, w, n, this.currentPano),
  22116. this.flying = !0,
  22117. this.isOutsideMode(i) && this.is360View(u, b) ? (c || i !== V.DOLLHOUSE || (d.position.set(15, 10, 15),
  22118. d.controls.target.set(this.model.center.x, 0, this.model.center.z),
  22119. d.controls.update()),
  22120. e.blackoutStyle = P.FADEIN,
  22121. p = k.show360Views.transitionTime,
  22122. this.fade360View(p, d, e)) : this.isOutsideMode(u) && this.is360View(i, n) ? (c && this.switchCameraMode(i, c.quaternion),
  22123. this.mode = i,
  22124. this.path && this.path.popOutCpm(),
  22125. e.blackoutStyle = P.END,
  22126. p = k.show360Views.transitionTime,
  22127. this.fade360View(p, d, e)) : (G.start(H.property(this.model, "alpha", e.modelAlpha, null), p * e.modelAlphaLength, null, e.modelAlphaDelay, null, q.FlyToNewMode),
  22128. G.start(H.vector(this.position, d.position), p, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToNewMode),
  22129. G.start(H.quaternion(this.quaternion, d.quaternion), p * e.rotationDuration, null, e.rotationDelay, z[k.flydown.rotationEasing], null, q.FlyToNewMode),
  22130. G.start(H.matrix4(this.camera.projectionMatrix, d.projectionMatrix), p * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, q.FlyToNewMode),
  22131. G.start(H.uniform(this.model.skybox, "opacity", e.skyboxOpacity), p * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, q.FlyToNewMode),
  22132. G.start(H.property(this.reticule.material.uniforms.opacity, "value", 0), p, null, q.FlyToNewMode)),
  22133. G.setTimeout(function() {
  22134. this.flying = !1,
  22135. u === V.PANORAMA && i !== V.PANORAMA ? this.currentPano.exit() : u !== V.PANORAMA && i === V.PANORAMA && (this.currentPano !== b && b.exit(),
  22136. this.currentPano.enter(),
  22137. this.path.placeCpm(),
  22138. this.path.fadeOutCpm(k.path.fadeOutTime),
  22139. this.spider.draw()),
  22140. u === V.DOLLHOUSE && this.cameraControls.controls[V.DOLLHOUSE].resetRanges(),
  22141. this.mode = i,
  22142. this.emit(W.FlyingEnded, f, w, this.currentPano, b)
  22143. if (this.afterCModeFuc) {
  22144. //手动加的函数
  22145. var cf = this.afterCModeFuc;
  22146. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  22147. cf();
  22148. }
  22149. this.updateMarkerVisi();//add
  22150. //(this.mode == u.PANORAMA) && this.updateHotVisible()//add
  22151. if(this.mode == V.PANORAMA){
  22152. //EditOverlay.updatePano()
  22153. editTool.hotpoint.updatePano()
  22154. this.model.fadePanoMarkers()
  22155. Hot.updateVisibles([this.currentPano])
  22156. }else{
  22157. Hot.updateVisibles(true)
  22158. this.model.hotGroup.children.forEach(overlay=>{
  22159. if(overlay.animateInfo){
  22160. GifTexDeal.start(overlay.animation)
  22161. }
  22162. })
  22163. }
  22164. c && u !== V.PANORAMA && i === V.PANORAMA ? this.startWarp(M.Retain, S.Retain, R.BLACK, null, null, a) : (a && a(),
  22165. t.resolve())
  22166. }
  22167. .bind(this), p, q.FlyToNewMode),
  22168. this.mode = V.TRANSITIONING,
  22169. //EditOverlay.updatePano(),//add
  22170. editTool.hotpoint.updatePano(),//add
  22171. //u == "panorama" && this.updateHotVisible(),
  22172. t.promise()
  22173. }
  22174. ,
  22175. t.prototype.fade360View = function(e, t, i) {
  22176. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  22177. $(this.domElement).fadeOut(.5 * e, function() {
  22178. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  22179. this.model.alpha = i.modelAlpha,
  22180. this.position.copy(t.position),
  22181. this.quaternion.copy(t.quaternion),
  22182. this.camera.projectionMatrix.copy(t.projectionMatrix),
  22183. $(this.domElement).fadeIn(.5 * e)
  22184. }
  22185. .bind(this))
  22186. }
  22187. ,
  22188. t.prototype.findDefaultViews = function() {
  22189. this.findDefaultView(this.lastInsideView, !0),
  22190. this.findDefaultView(this.last360View, !1)
  22191. }
  22192. ,
  22193. t.prototype.findDefaultView = function(e, i) {
  22194. var t, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  22195. if (e.cameraMode !== V.PANORAMA)
  22196. return !1;
  22197. var t = r.get(e.panoId);
  22198. return t && t.isAligned() === i
  22199. });
  22200. 0 <= o ? (t = r.get(n[o].panoId),
  22201. e.update({
  22202. cameraMode: V.PANORAMA,
  22203. pano: t,
  22204. position: n[o].position,
  22205. quaternion: n[o].quaternion
  22206. })) : 0 <= (o = r.list.findIndex(function(e) {
  22207. return e.isAligned() === i
  22208. })) ? (t = r.list[o],
  22209. e.update({
  22210. cameraMode: V.PANORAMA,
  22211. pano: t,
  22212. position: t.position
  22213. })) : Y.warn("There are no", i ? "inside" : "360º", "views in this model")
  22214. }
  22215. ,
  22216. t.prototype.updateLastView = function() {
  22217. this.mode === V.PANORAMA && (this.currentPano.isAligned() ? this.lastInsideView : this.last360View).update({
  22218. pano: this.currentPano,
  22219. position: this.position,
  22220. quaternion: this.quaternion
  22221. })
  22222. }
  22223. ,
  22224. t.prototype.goToLastView = function(e, t) {
  22225. var i = $.Deferred()
  22226. , n = i.resolve.bind(i)
  22227. , r = i.reject.bind(i)
  22228. , o = e ? this.lastInsideView : this.last360View;
  22229. return this.isInMode(V.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  22230. this.isInMode(V.PANORAMA) ? (this.path && this.path.popOutCpm(),
  22231. this.fadeToView(e, o, k.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  22232. mode: o.cameraMode,
  22233. pano: o.pano,
  22234. quaternion: o.quaternion,
  22235. callback: t
  22236. }).done(n).fail(r),
  22237. i.promise()
  22238. }
  22239. ,
  22240. t.prototype.fadeToView = function(e, t, i, n) {
  22241. var r = $.Deferred()
  22242. , o = r.resolve.bind(r)
  22243. , a = r.reject.bind(r);
  22244. if (!t.isValid() || t.cameraMode === V.PANORAMA && !t.pano)
  22245. return Y.warn("Tried to fade to an illegal view", t.cameraMode),
  22246. a("Cannot go to illegal view"),
  22247. r.promise();
  22248. var s = (k[t.cameraMode],
  22249. function() {
  22250. $(this.domElement).fadeIn(.5 * i),
  22251. n && n(),
  22252. o()
  22253. }
  22254. .bind(this))
  22255. , l = e ? P.FADEIN : P.END;
  22256. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  22257. $(this.domElement).fadeOut(.5 * i, function() {
  22258. this.model.fadePanoMarkers(e ? k.panorama.markerOpacity : 0),
  22259. t.cameraMode === V.PANORAMA ? this.flyToPano({
  22260. pano: t.pano,
  22261. lookAtPoint: T.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  22262. duration: 0
  22263. }, s) : this.flyToNewMode({
  22264. mode: t.cameraMode,
  22265. quaternion: t.quaternion,
  22266. duration: 0,
  22267. callback: s
  22268. })
  22269. }
  22270. .bind(this)),
  22271. r.promise()
  22272. }
  22273. ,
  22274. t.prototype.startWarp = function(e, t, i, n, r, o) {
  22275. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  22276. this.flying)
  22277. return Y.warn("Player.startWarp() -> Cannot warp when flying"),
  22278. o && o(),
  22279. !1;
  22280. null != e || (e = M.Show),
  22281. this.history.invalidate(),
  22282. e !== M.Retain ? this.path.brushToWarpPano(i, R.BLACK) || (i = R.BLACK) : i = this.path.upcomingTransType;
  22283. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  22284. return this.emit(W.WarpStarted, a, i, n, r),
  22285. n = n || P.MIDDLE,
  22286. this.path.warpToPano(i, n, r, function() {
  22287. t === S.Slow ? this.path.discardSlow() : t === S.Standard && this.path.discardPathObject(),
  22288. this.emit(W.WarpEnded, i),
  22289. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  22290. o && o()
  22291. }
  22292. .bind(this)),
  22293. e === M.Hide && this.path.discardPathObject(),
  22294. !0
  22295. }
  22296. ,
  22297. t.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  22298. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (Y.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  22299. s && s(),
  22300. !1)
  22301. }
  22302. ,
  22303. t.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  22304. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (Y.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22305. a && a(),
  22306. !1)
  22307. }
  22308. ,
  22309. t.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  22310. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  22311. }
  22312. ,
  22313. t.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  22314. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  22315. !0) : (Y.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22316. t && t(),
  22317. !1)
  22318. }
  22319. ,
  22320. t.prototype.aimTourCamera = function(e, t, i, n) {
  22321. return Y.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  22322. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  22323. }
  22324. ,
  22325. t.prototype.showPathToHeroLocation = function(e) {
  22326. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(R.STD, R.BLACK)
  22327. }
  22328. ,
  22329. t.prototype.tourInterlude = function(e, t) {
  22330. this.history.invalidate(),
  22331. this.path.discardSlow();
  22332. var defaultRotTime = DATA.tourRotTime * 1000
  22333. var timeEachItem = 2e3 / (DATA.tourWalkSpeed + DATA.tourBlackSpeed) * 200 //预估时间假设每个item飞的时间(如果距离远就少了)
  22334. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem)
  22335. var currentLocation0 = this.model.heroLocations[this.director.currentItem[0]]
  22336. var rotTime
  22337. if(currentLocation.rotTime == void 0 || currentLocation.rotTime == ''){
  22338. var restChildCount = currentLocation0.heroLocations ? (currentLocation0.heroLocations.length-this.director.currentItem[1]-1) : 0
  22339. var hasMusic = currentLocation0.musicInfo && currentLocation0.musicInfo.music
  22340. if(hasMusic){
  22341. var audioObj = SoundManager.list.find(e=>e.name == 'tour')
  22342. var current = audioObj.audio.currentTime * 1e3 // || 0 //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  22343. rotTime = currentLocation0.musicInfo.time - current
  22344. if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
  22345. rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
  22346. }
  22347. }else{
  22348. rotTime = defaultRotTime
  22349. }
  22350. rotTime = Math.max(0, rotTime)
  22351. //console.log("rotTime "+rotTime +" at item "+this.director.currentItem + (hasMusic ? (",musicCurrentTime:"+current+'音乐总长:'+currentLocation0.musicInfo.time) : ''))
  22352. }else{
  22353. rotTime = currentLocation.rotTime * 1000
  22354. //console.log("rotTime "+rotTime +" at item "+this.director.currentItem)
  22355. }
  22356. this.path.waitNextStep(e, function() {//等待音乐播放一段时间再下一步,此时镜头会缓慢旋转
  22357. t && t()
  22358. }
  22359. .bind(this), rotTime)
  22360. }
  22361. ,
  22362. t.prototype.stopInterlude = function() {
  22363. this.interruptAndFastForward(null, 0)
  22364. }
  22365. ,
  22366. t.prototype.interruptAndFastForward = function(e, t) {
  22367. this.isWarping() && this.emit(W.WarpInterrupted, this.path.activeTransType, e, t),
  22368. this.flying && this.emit(W.FlyingInterrupted),
  22369. this.path.interruptAndFastForward(e, t)
  22370. }
  22371. ,
  22372. t.prototype.setSize = function(e, t) {
  22373. var i = e / t;
  22374. this.baseFov = A.clampVFOV(k.insideFOV, k.insideFOVMax, e, t);
  22375. var n = A.getHFOVFromVFOV(k.insideFOV, e, t);
  22376. for (var r in n > k.insideFOVMax ? this.baseFov = A.getVFOVFromHFOV(k.insideFOVMax, e, t) : this.baseFov = k.insideFOV,
  22377. this.cameraControls.cameras) {
  22378. var o = this.cameraControls.cameras[r];
  22379. o.fov = this.baseFov * (1 / this.zoomLevel),
  22380. o.updateAspect(i)
  22381. }
  22382. }
  22383. ,
  22384. t.prototype.toJSON = function() {
  22385. var e = {};
  22386. return this.cameraControls.activeControl && ((e = this.cameraControls.activeControl.toJSON()).camera_mode = V.toInt(this.mode),
  22387. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  22388. return e.hidden ? 0 : 1
  22389. }) : V.PANORAMA && (e.scan_id = this.currentPano.id)),
  22390. e
  22391. }
  22392. ,
  22393. t.prototype.getCurrentNodePanos = function(e) {
  22394. if (this.model.panos.map, e.length = 0, this.path.nodes)
  22395. for (var t = 0; t < this.path.nodes.length; t++) {
  22396. var i = this.path.nodes[t];
  22397. e.push(this.model.panos.get(i))
  22398. }
  22399. }
  22400. ,
  22401. t.prototype.zoomIncrementally = function(e) {
  22402. var t = this.zoomLevel;
  22403. this.zoomTo(this.zoomLevel + e),
  22404. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  22405. }
  22406. ,
  22407. t.prototype.zoomInIncrementally = function(e) {
  22408. e = e || this.defaultZoomIncrement,
  22409. this.zoomIncrementally(e)
  22410. }
  22411. ,
  22412. t.prototype.zoomOutIncrementally = function(e) {
  22413. e = e || -this.defaultZoomIncrement,
  22414. this.zoomIncrementally(e)
  22415. }
  22416. ,
  22417. t.prototype.zoomBy = function(e) {
  22418. this.zoomTo(this.zoomLevel * e)
  22419. }
  22420. ,
  22421. t.prototype.zoomIn = function() {
  22422. this.zoomBy(1 + this.zoomSpeed)
  22423. }
  22424. ,
  22425. t.prototype.zoomOut = function() {
  22426. this.zoomBy(1 - this.zoomSpeed)
  22427. }
  22428. ,
  22429. t.prototype.zoomTo = function(e, t) {
  22430. if ((t || k.zoom.enabled && this.mode === V.PANORAMA && this.zoomEnabled) && (e < k.zoom.min && (e = k.zoom.min),
  22431. e > k.zoom.max && (e = k.zoom.max),
  22432. e > this.zoomLevel ? (this.emit(m.ZoomIn),
  22433. e === k.zoom.max && this.emit(m.ZoomMax)) : e < this.zoomLevel && (this.emit(m.ZoomOut),
  22434. e === k.zoom.min && this.emit(m.ZoomMin)),
  22435. this.cameraControls.activeControl)) {
  22436. var i = this.cameraControls.activeControl.camera;
  22437. this.zoomLevel = e,
  22438. i.fov = this.baseFov * (1 / this.zoomLevel),
  22439. i.updateProjectionMatrix(),
  22440. this.zoomFov = i.fov
  22441. }
  22442. }
  22443. ,
  22444. t.prototype.increaseZoomSpeed = function() {
  22445. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  22446. }
  22447. ,
  22448. t.prototype.decreaseZoomSpeed = function() {
  22449. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  22450. }
  22451. ,
  22452. t.prototype.clampZoomSpeed = function(e) {
  22453. return e < 0 ? 0 : e
  22454. }
  22455. ,
  22456. t.prototype.activatePersistentZooming = function(e) {
  22457. this.zooming = e ? 1 : -1
  22458. }
  22459. ,
  22460. t.prototype.deactivatePersistentZooming = function() {
  22461. this.zooming = 0
  22462. }
  22463. ,
  22464. t.prototype.zoomDefault = function() {
  22465. this.zoomTo(1, !0)
  22466. }
  22467. window.fovTranId = 333;//add
  22468. t.prototype.smoothZoomToDefault = function(e, t) {
  22469. G.cancelById(window.fovTranId)
  22470. var i, n = this.zoomLevel, r = function(e) {
  22471. 1 < e && (e = 1),
  22472. i = n * (1 - e) + e,
  22473. this.zoomTo(i, !0)
  22474. }
  22475. .bind(this), o = function() {
  22476. this.zoomDefault(),
  22477. t && window.setTimeout(t, 50)
  22478. }
  22479. .bind(this);
  22480. G.start(r, e, o, null, 0, z[k.transition.blendEasing], null, window.fovTranId)
  22481. }
  22482. ,
  22483. t.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {//add
  22484. G.cancelById(window.fovTranId)
  22485. var i,
  22486. n = this.zoomLevel,
  22487. aimLevel = zoomLevel || this.baseFov / fov
  22488. if (n == aimLevel) return
  22489. var fun = function (e) {
  22490. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel), this.zoomTo(i, !0)
  22491. }.bind(this)
  22492. G.start(fun, dur, callback, null, 0, z[k.transition.easeInCubic], null, window.fovTranId)
  22493. }
  22494. ,
  22495. t.prototype.updateZoomPano = function() {
  22496. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === V.PANORAMA) {
  22497. var e = this.currentPano;
  22498. if (e) {
  22499. var t = this.zoomLevel > k.zoom.activationThreshold
  22500. , i = (this.flying && this.nextPano && this.nextPano !== this.currentPano || this.isWarping(),
  22501. t);
  22502. this.tileDownloader.tilePrioritizer.setZoomingActive(i),
  22503. this.panoRenderer.setZoomingActive(i, e, !0);
  22504. var n = function(e, t) {
  22505. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  22506. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  22507. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  22508. e.setZoomed(t)
  22509. }
  22510. .bind(this);
  22511. i && !e.zoomed ? (n(e, !0),
  22512. this.panoRenderer.enableUltraHighQualityMode(function() {
  22513. this.qualityManager.useUltraHighResolutionPanos && !k.zoom.overridemax && (k.zoom.max = y.ultraHighQualityMaxZoom),
  22514. i && n(e, !0)
  22515. }
  22516. .bind(this))) : !t && e.zoomed && n(e, !1)
  22517. }
  22518. }
  22519. },
  22520. //--------
  22521. t.prototype.flyToMode = function(mode, f1){ //飞到某个模式后再执行f1函数
  22522. var f2;
  22523. if (this.mode == mode) {
  22524. f1 && f1()
  22525. } else {
  22526. f2 = f1;
  22527. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  22528. this.afterCModeFuc = function() {
  22529. this.afterCModeFuc = f2
  22530. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano });
  22531. }.bind(this)
  22532. } else {
  22533. this.afterCModeFuc = f2;//飞入后执行
  22534. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  22535. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano});
  22536. }catch(e){}
  22537. }
  22538. }
  22539. }
  22540. ,
  22541. t.prototype.checkHasNeighbor = function(pano){//add
  22542. for(var i in pano.neighbourPanos ){
  22543. if(i == pano.id)continue;
  22544. if(pano.neighbourPanos[i]){
  22545. return true;
  22546. }
  22547. }
  22548. }
  22549. ,
  22550. ee.exports = t
  22551. }
  22552. ).call(this, "/js/player.js")
  22553. }
  22554. , {
  22555. "./constants": 8,
  22556. "./enum/AlignmentType": 17,
  22557. "./enum/BlackoutStyle": 18,
  22558. "./enum/ControlEvents": 21,
  22559. "./enum/Keys": 30,
  22560. "./enum/ModelManagerEvents": 33,
  22561. "./enum/PanoSizeClass": 36,
  22562. "./enum/PanoramaEvents": 37,
  22563. "./enum/PathDiscardMode": 38,
  22564. "./enum/PathDisplayMode": 39,
  22565. "./enum/PlayerEvents": 40,
  22566. "./enum/TagStates": 44,
  22567. "./enum/Vectors": 50,
  22568. "./enum/Viewmode": 51,
  22569. "./enum/WarpStyle": 52,
  22570. "./enum/ZoomEvents": 53,
  22571. "./exception/BasicException": 55,
  22572. "./model/ModelManager": 140,
  22573. "./objects/NSpider": 147,
  22574. "./objects/Panorama": 148,
  22575. "./objects/Reticule": 149,
  22576. "./objects/ShowPath": 151,
  22577. "./objects/Snapshot": 153,
  22578. "./objects/View": 154,
  22579. "./settings": 166,
  22580. "./shaders": 167,
  22581. "./tile/TileDownloader": 171,
  22582. "./tile/TilePrioritizer": 172,
  22583. "./util/ZoomStats": 179,
  22584. "./util/browser": 182,
  22585. "./util/camera": 183,
  22586. "./util/cameraLight": 184,
  22587. "./util/common": 185,
  22588. "./util/easing": 186,
  22589. "./util/history": 187,
  22590. "./util/lerp": 188,
  22591. "./util/logger": 189,
  22592. "./util/math": 190,
  22593. "./util/transitions": 195,
  22594. // hot: "hot",
  22595. scaleImg: "scaleImg",
  22596. events: 202,
  22597. three: 217
  22598. }],
  22599. scaleImg: [function(e, t) {
  22600. var i = t;
  22601. (function() {
  22602. function e(e, t, i, n) {
  22603. function r() {
  22604. (U = "object" == typeof i ? i : t.src || n ? s : document.createElement("canvas")).width = d,
  22605. U.height = p,
  22606. H = U.getContext("2d")
  22607. }
  22608. function o(e) {
  22609. if (e) {
  22610. var t, i = H.getImageData(0, 0, d, p), n = i.data;
  22611. for (t = 0; t < ie; t += 4)
  22612. n[t] = e[t] * ne | 0,
  22613. n[t + 1] = e[t + 1] * ne | 0,
  22614. n[t + 2] = e[t + 2] * ne | 0,
  22615. n[t + 3] = e[t + 3] * ne | 0;
  22616. return delete e,
  22617. i
  22618. }
  22619. return H.getImageData(0, 0, d, p)
  22620. }
  22621. function a(e, t, i, n, r) {
  22622. return .5 * (n - t + (2 * t - 5 * i + 4 * n - r + (3 * (i - n) + r - t) * e) * e) * e + i
  22623. }
  22624. var s, l;
  22625. if (t || (t = e.input,
  22626. i = e.output,
  22627. n = e.inputRemovable,
  22628. e.scale && (e = e.scale)),
  22629. t.src)
  22630. if (s = document.createElement("canvas"),
  22631. null != t.naturalWidth)
  22632. s.width = t.naturalWidth,
  22633. s.height = t.naturalHeight;
  22634. else if (null != t.runtimeStyle) {
  22635. var c = t.runtimeStyle
  22636. , h = c.width
  22637. , u = c.height;
  22638. c.width = "auto",
  22639. c.height = "auto",
  22640. s.width = t.width,
  22641. s.height = t.height,
  22642. c.width = h,
  22643. c.height = u
  22644. } else {
  22645. h = t.width,
  22646. u = t.height;
  22647. t.removeAttribute && (t.removeAttribute("width"),
  22648. t.removeAttribute("height")),
  22649. s.width = t.width,
  22650. s.height = t.height,
  22651. t.width = h,
  22652. t.height = u
  22653. }
  22654. else
  22655. s = t;
  22656. l = s.getContext("2d"),
  22657. t.src && l.drawImage(t, 0, 0);
  22658. var d, p, f = s.width, g = s.height, m = l.getImageData(0, 0, f, g).data;
  22659. if (!f || !g)
  22660. return !1;
  22661. (t.src || n) && s.clearRect(0, 0, f, g),
  22662. p = "object" == typeof e ? e.width ? (d = e.width + .5 | 0,
  22663. e.height + .5 | 0) : (d = f * e.scaleX + .5 | 0,
  22664. g * e.scaleY + .5 | 0) : (d = e * f + .5 | 0,
  22665. e * g + .5 | 0);
  22666. var v, y, A, C, I, E, _, b, w, T, x, S, M, R, P, O, L, D, N, F, B, V, k, U, H, z, G, W, j, Y, q, X, Z, K, Q, J = d << 2, $ = f << 2, ee = 0, te = 0, ie = J * p, ne = 255.99 / 255, re = d / f, oe = p / g, ae = re * oe;
  22667. if (1 < re || 1 < oe)
  22668. for (r(),
  22669. G = (z = o()).data,
  22670. C = 0; C < p; C++)
  22671. for (V = (y = C / oe) - (w = 0 | y),
  22672. j = w * $,
  22673. W = w < 1 ? j : j - $,
  22674. w < g - 2 ? (Y = j + $,
  22675. q = (2 + w) * $) : Y = q = g - 2 < w ? j : j + $,
  22676. A = 0; A < d; A++,
  22677. te += 4)
  22678. Z = (b = 0 | (v = A / re)) << 2,
  22679. b < f - 2 ? (K = Z + 4,
  22680. Q = Z + 8) : K = Q = f - 2 < b ? Z : Z + 4,
  22681. D = a(V, a(k = v - b, m[W + (X = b < 1 ? Z : Z - 4)], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0,
  22682. ++Z,
  22683. ++K,
  22684. ++Q,
  22685. F = a(V, a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0,
  22686. ++Z,
  22687. ++K,
  22688. ++Q,
  22689. B = a(V, a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0,
  22690. ++Z,
  22691. ++K,
  22692. ++Q,
  22693. N = a(V, a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0,
  22694. G[te] = 0 <= D ? D < 256 ? D : 255 : 0,
  22695. G[te + 1] = 0 <= F ? F < 256 ? F : 255 : 0,
  22696. G[te + 2] = 0 <= B ? B < 256 ? B : 255 : 0,
  22697. G[te + 3] = 0 <= N ? N < 256 ? N : 255 : 0;
  22698. else {
  22699. if (le.Float32Array)
  22700. L = new Float32Array(ie);
  22701. else
  22702. for (L = [],
  22703. te = 0; te < ie; ++te)
  22704. L[te] = 0;
  22705. for (y = 0; y < g; y++)
  22706. for (I = (_ = 0 | (C = y * oe)) * J,
  22707. (O = !!((_ - (C + oe | 0)) * (g - 1 - y)) << 1) && (M = 1 + _ - C,
  22708. R = C + oe - _ - 1),
  22709. v = 0; v < f; v++,
  22710. ee += 4)
  22711. switch (A = v * re,
  22712. E = 0 | A,
  22713. te = I + (E << 2),
  22714. P = !!((E - (A + re | 0)) * (f - 1 - v)),
  22715. P && (x = 1 + E - A,
  22716. S = A + re - E - 1),
  22717. D = m[ee],
  22718. F = m[ee + 1],
  22719. B = m[ee + 2],
  22720. N = m[ee + 3],
  22721. P + O) {
  22722. case 0:
  22723. L[te] += D * ae,
  22724. L[te + 1] += F * ae,
  22725. L[te + 2] += B * ae,
  22726. L[te + 3] += N * ae;
  22727. break;
  22728. case 1:
  22729. T = x * oe,
  22730. L[te] += D * T,
  22731. L[te + 1] += F * T,
  22732. L[te + 2] += B * T,
  22733. L[te + 3] += N * T,
  22734. T = S * oe,
  22735. L[te + 4] += D * T,
  22736. L[te + 5] += F * T,
  22737. L[te + 6] += B * T,
  22738. L[te + 7] += N * T;
  22739. break;
  22740. case 2:
  22741. T = re * M,
  22742. L[te] += D * T,
  22743. L[te + 1] += F * T,
  22744. L[te + 2] += B * T,
  22745. L[te + 3] += N * T,
  22746. T = re * R,
  22747. L[te += J] += D * T,
  22748. L[te + 1] += F * T,
  22749. L[te + 2] += B * T,
  22750. L[te + 3] += N * T;
  22751. break;
  22752. default:
  22753. T = x * M,
  22754. L[te] += D * T,
  22755. L[te + 1] += F * T,
  22756. L[te + 2] += B * T,
  22757. L[te + 3] += N * T,
  22758. T = S * M,
  22759. L[te + 4] += D * T,
  22760. L[te + 5] += F * T,
  22761. L[te + 6] += B * T,
  22762. L[te + 7] += N * T,
  22763. T = x * R,
  22764. L[te += J] += D * T,
  22765. L[te + 1] += F * T,
  22766. L[te + 2] += B * T,
  22767. L[te + 3] += N * T,
  22768. T = S * R,
  22769. L[te + 4] += D * T,
  22770. L[te + 5] += F * T,
  22771. L[te + 6] += B * T,
  22772. L[te + 7] += N * T
  22773. }
  22774. delete m,
  22775. r(),
  22776. z = o(L)
  22777. }
  22778. if (H.putImageData(z, 0, 0),
  22779. "string" == typeof i) {
  22780. var se;
  22781. if ("png" === i || "jpeg" === i)
  22782. return (se = n && t.src ? t : new Image).width = d,
  22783. se.height = p,
  22784. se.src = U.toDataURL("image/" + i, .85),
  22785. se;
  22786. if ("png-src" === i || "jpeg-src" === i)
  22787. return U.toDataURL("image/" + i.split("-")[0], .85)
  22788. }
  22789. return U
  22790. }
  22791. var le = this;
  22792. "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = e),
  22793. exports.scale = e) : c = e
  22794. }
  22795. ).call(this),
  22796. i.exports = c
  22797. }
  22798. , {}],
  22799. 156: [function(i, n, e) {
  22800. (function(e) {
  22801. "use strict";
  22802. function t(e, t) {
  22803. this.model = e,
  22804. this.panos = e.panos,
  22805. this.player = t,
  22806. this.imagePanos = this.listImagePanos(),
  22807. this.retryMinimumTime = 1e4
  22808. }
  22809. var r = (i("three"),
  22810. i("./enum/Viewmode"))
  22811. , o = (i("./settings"),
  22812. i("./objects/Panorama"))
  22813. , a = new (i("./util/logger"))(e);
  22814. t.prototype.start = function() {
  22815. this.loadNextPano(function(e) {
  22816. e ? this.start() : (a.debug("No suitable pano loaded, waiting a little while before looking again"),
  22817. setTimeout(function() {
  22818. this.start()
  22819. }
  22820. .bind(this), 1e3))
  22821. }
  22822. .bind(this))
  22823. }
  22824. ,
  22825. t.prototype.validLoadTarget = function(e) {
  22826. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  22827. }
  22828. ,
  22829. t.prototype.listImagePanos = function() {
  22830. var i = []
  22831. , n = this;
  22832. return this.model.images.forEach(function(e) {
  22833. if (e.metadata && e.metadata.scan_id) {
  22834. var t = n.model.panos.get(e.metadata.scan_id);
  22835. t && !t.isLoaded("high") && i.push(t)
  22836. }
  22837. }),
  22838. i
  22839. }
  22840. ,
  22841. t.prototype.nextNotLoadedImage = function() {
  22842. for (; 0 < this.imagePanos.length; ) {
  22843. var e = this.imagePanos[0];
  22844. if (!e.isLoaded("high"))
  22845. return e;
  22846. this.imagePanos.shift()
  22847. }
  22848. return null
  22849. }
  22850. ,
  22851. t.prototype.loadNextPano = function(e) {
  22852. var t, i, n = this.model.waitQueue.filter(function(e) {
  22853. return e.object instanceof o
  22854. });
  22855. 0 < n.length ? (t = n[0].object,
  22856. a.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  22857. a.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  22858. a.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  22859. t = this.imagePanos[0],
  22860. a.debug("Overrode pano selection: Highlight image " + t.id)) : this.player.mode !== r.PANORAMA || (t = this.panos.lowestByScore([this.validLoadTarget.bind(this), o.filters.isNeighbourPanoTo(this.player.currentPano)], [o.scoreFunctions.distance(this.player.currentPano), o.scoreFunctions.direction(this.player.position, this.player.getDirection()), o.scoreFunctions.inFieldOfView(this.player.position, this.player.getDirection())])) && a.debug("Normal pano selection: neighbor " + t.id),
  22861. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  22862. a.debug("Preloading " + i + "-res pano " + t.id),
  22863. t.loadCube(i).done(e).fail(function() {
  22864. a.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  22865. e()
  22866. })) : e && e(null)
  22867. }
  22868. ,
  22869. n.exports = t
  22870. }
  22871. ).call(this, "/js/preloaders.js")
  22872. }
  22873. , {
  22874. "./enum/Viewmode": 51,
  22875. "./objects/Panorama": 148,
  22876. "./settings": 166,
  22877. "./util/logger": 189,
  22878. three: 217
  22879. }],
  22880. 157: [function(a, s, e) {
  22881. (function(e) {
  22882. "use strict";
  22883. function t(e, t, i, n, r) {
  22884. this.qualityManager = e,
  22885. this.scene = t,
  22886. this.camera = i,
  22887. this.container = r,
  22888. this.controls = n,
  22889. this.controls.enabled = !0,
  22890. this.controls.locked = !0,
  22891. this.quickstartCamera = n.camera,
  22892. this.quickstartCamera.fov = d.clampVFOV(o.insideFOV, o.insideFOVMax, $("#player").width(), $("#player").height()),
  22893. this.skybox = null
  22894. }
  22895. var i = a("three")
  22896. , n = a("../util/logger")
  22897. , o = a("../constants")
  22898. , h = (a("../util/transitions"),
  22899. a("../util/lerp"),
  22900. a("../util/easing"),
  22901. a("../enum/Vectors"))
  22902. , u = a("../enum/PanoSizeClass")
  22903. , r = (a("../materials/ModelTextureMaterial"),
  22904. a("../materials/CubemapMaterial"))
  22905. , d = (a("../cameras/PanoramaCamera"),
  22906. a("../controls/PanoramaControls"),
  22907. a("../tile/TileUtils"),
  22908. a("../util/camera"),
  22909. a("../util/cameraLight"))
  22910. , p = (a("../util/browser"),
  22911. a("../settings"),
  22912. a("../gui/helpManager"),
  22913. new n(e));
  22914. t.prototype.load = function(e) {
  22915. e.pano.shouldRedrawOnBaseLoaded = !0;
  22916. var t, i, n = this, r = h.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  22917. this.controls.lookAt(r.add(this.quickstartCamera.position));
  22918. var a = this.qualityManager.getPanoSize(u.BASE)
  22919. , s = this.qualityManager.getPanoSize(u.STANDARD);
  22920. if (e.pano.tiled) {
  22921. p.warn("Loading startPano, TILED", e.pano.id);
  22922. var l = d.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  22923. , c = this.quickstartCamera.fov;
  22924. p.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + l + ", vertical FOV: " + c + "]"),
  22925. t = e.pano.loadTiledPano(s, r, {
  22926. hFov: l,
  22927. vFov: c
  22928. }, !1, !1, !0),
  22929. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  22930. } else
  22931. p.warn("Loading startPano", e.pano.id),
  22932. t = e.pano.loadCube("high");
  22933. return $.when(t).then(function() {
  22934. n.init(e.pano, e.quaternion),
  22935. e.pano.tiled ? i.done(function() {
  22936. e.pano.lockUntilRenderingComplete = !1,
  22937. this.controls.locked = !1
  22938. }
  22939. .bind(this)) : this.controls.locked = !1
  22940. }
  22941. .bind(this))
  22942. }
  22943. ,
  22944. t.prototype.init = function(e, t) {
  22945. p.info("Quickstart done loading, adding scene objects"),
  22946. e.lockUntilRenderingComplete = !0,
  22947. this.skybox = new i.Mesh(new i.CubeGeometry(1,1,1),new r({
  22948. side: i.BackSide
  22949. })),
  22950. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  22951. this.skybox.quaternion.copy(e.quaternion),
  22952. this.scene.add(this.skybox),
  22953. $(this.container).show()
  22954. }
  22955. ,
  22956. t.prototype.update = function(e) {
  22957. this.controls.update(e),
  22958. this.camera.copy(this.quickstartCamera)
  22959. }
  22960. ,
  22961. t.prototype.setSize = function(e, t) {
  22962. this.quickstartCamera.updateAspect(e / t)
  22963. }
  22964. ,
  22965. t.prototype.destroy = function() {
  22966. this.scene.remove(this.skybox)
  22967. }
  22968. ,
  22969. s.exports = t
  22970. }
  22971. ).call(this, "/js/scene/QuickstartManager.js")
  22972. }
  22973. , {
  22974. "../cameras/PanoramaCamera": 7,
  22975. "../constants": 8,
  22976. "../controls/PanoramaControls": 13,
  22977. "../enum/PanoSizeClass": 36,
  22978. "../enum/Vectors": 50,
  22979. "../gui/helpManager": 68,
  22980. "../materials/CubemapMaterial": 117,
  22981. "../materials/ModelTextureMaterial": 118,
  22982. "../settings": 166,
  22983. "../tile/TileUtils": 174,
  22984. "../util/browser": 182,
  22985. "../util/camera": 183,
  22986. "../util/cameraLight": 184,
  22987. "../util/easing": 186,
  22988. "../util/lerp": 188,
  22989. "../util/logger": 189,
  22990. "../util/transitions": 195,
  22991. three: 217
  22992. }],
  22993. 158: [function(e, t, i) {
  22994. "use strict";
  22995. function h(e, t, i) {
  22996. this.scene = e,
  22997. this.camera = t,
  22998. this.renderer = null,
  22999. this.effects = i,
  23000. this.animateCallback = null,
  23001. this.composer = null,
  23002. this.qualityManager = null,
  23003. e.renderWidth = 0,
  23004. e.renderHeight = 0,
  23005. this.updateClock = new M.Clock,
  23006. this.components = [],
  23007. this.updateListeners = [],
  23008. this.resizeListeners = [],
  23009. this.forceUpdateSize = !1,
  23010. this.started = !1,
  23011. this.textures = {},
  23012. this.suspendedObjects = []
  23013. }
  23014. var o, a, n, M = e("three"), R = e("../shaders"), r = e("../enum/SceneRendererEvents"), f = e("../enum/GLTextureType"), s = e("../enum/GLCubeFaces"), l = e("../exception/BasicException"), c = e("../exception/RendererCreationException"), u = e("../util/browser"), d = e("../settings"), p = e("events").EventEmitter;
  23015. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  23016. (h.prototype = Object.create(p.prototype)).addComponent = function(e) {
  23017. this.components.push(e),
  23018. e.update && this.updateListeners.push(e),
  23019. e.setSize && (this.resizeListeners.push(e),
  23020. this.forceUpdateSize = !0)
  23021. }
  23022. ,
  23023. h.prototype.removeComponent = function(t) {
  23024. function e(e) {
  23025. return e !== t
  23026. }
  23027. this.components = this.components.filter(e),
  23028. this.updateListeners = this.updateListeners.filter(e),
  23029. this.resizeListeners = this.resizeListeners.filter(e)
  23030. }
  23031. ,
  23032. h.prototype.start = function(e) {
  23033. if (this.started)
  23034. throw new l("Can't start SceneRenderer, already started");
  23035. this.createContext(e),
  23036. //u.isMobile() && this.boluoVrInit(),
  23037. this.initComposer(),
  23038. this.started = !0,
  23039. (b = b.bind(this))()
  23040. }
  23041. ,
  23042. h.prototype.createContext = function(e) {
  23043. try {
  23044. this.renderer = new M.WebGLRenderer({antialias: !u.isMobile()}),
  23045. this.renderer.autoClear = !0,
  23046. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  23047. this.renderer.setSize($("#player").width(), $("#player").height(), !1),
  23048. this.emit(r.ContextCreated)
  23049. } catch (e) {
  23050. throw new c("Unable to create a WebGL rendering context")
  23051. }
  23052. d.profiling.enabled && this.overrideTextures(),
  23053. e.appendChild(this.renderer.domElement)
  23054. }
  23055. ,
  23056. h.prototype.overrideTextures = function() {
  23057. var d = this.renderer.context
  23058. , t = 0
  23059. , i = d.createTexture;
  23060. d.createTexture = function() {
  23061. var e = i.call(d);
  23062. return e.id = t++,
  23063. this.textures[e.id] = e
  23064. }
  23065. .bind(this);
  23066. var p = d.texImage2D;
  23067. d.texImage2D = function(e, t, i, n, r, o, a, s, l) {
  23068. var c, h = this.getTextureTypeFromTarget(d, e);
  23069. c = h === f.TextureCube ? d.getParameter(d.TEXTURE_BINDING_CUBE_MAP) : d.getParameter(d.TEXTURE_BINDING_2D),
  23070. void 0 !== a ? p.call(d, e, t, i, n, r, o, a, s, l) : (a = n,
  23071. s = r,
  23072. n = (l = o).naturalWidth,
  23073. r = l.naturalHeight,
  23074. p.call(d, e, t, i, a, s, l));
  23075. var u = this.textures[c.id];
  23076. u.width = h === f.TextureCube ? 6 * n : n,
  23077. u.height = r
  23078. }
  23079. .bind(this);
  23080. var n = d.deleteTexture;
  23081. d.deleteTexture = function(e) {
  23082. delete this.textures[e.id],
  23083. n.call(d, e)
  23084. }
  23085. .bind(this)
  23086. }
  23087. ,
  23088. h.prototype.updateTextureMemory = (n = null,
  23089. function() {
  23090. var e = 0;
  23091. for (var t in this.textures) {
  23092. var i = this.textures[t];
  23093. i.width && i.height && (e += i.width * i.height * 4)
  23094. }
  23095. e !== n && this.emit(r.MemoryUsageUpdated, e),
  23096. n = e
  23097. }
  23098. ),
  23099. h.prototype.getTextureTypeFromTarget = function(e, t) {
  23100. switch (t) {
  23101. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  23102. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  23103. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  23104. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23105. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  23106. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23107. return f.TextureCube;
  23108. case e.TEXTURE_2D:
  23109. return f.Texture2D;
  23110. default:
  23111. return null
  23112. }
  23113. }
  23114. ,
  23115. h.prototype.initComposer = function() {
  23116. this.composer = new M.EffectComposer(this.renderer),
  23117. this.composer.addPass(new M.RenderPass(this.scene,this.camera)),
  23118. /* this.composer.addPass(this.effects.hblurPass),
  23119. this.composer.addPass(this.effects.vblurPass) */
  23120. this.composer.addPass(this.effects.fastTranMaskPass)//add
  23121. }
  23122. ,
  23123. h.prototype.setSize = function(e, t, i) {
  23124. this.renderWidth = e,
  23125. this.renderHeight = t,
  23126. this.effects.aspect = e / t,
  23127. this.renderer.setSize(e, t, !1, i),
  23128. this.composer.setSize(e, t);
  23129. for (var n = 0; n < this.resizeListeners.length; n++)
  23130. this.resizeListeners[n].setSize(e, t)
  23131. }
  23132. ,
  23133. h.prototype.render = function() {
  23134. this.effects.fastTranMaskPass.enabled ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  23135. }
  23136. ,
  23137. h.prototype.boluoVrInit = function() {
  23138. console.log("boluoVrInit"),
  23139. this.isHuawei5X = u.detectHUAWEI5X(),
  23140. this.oldRenderer = this.renderer,
  23141. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera),
  23142. window.panoCamera = this.camera;
  23143. var i = this;
  23144. window._vrEnabled = !1,
  23145. Object.defineProperty(window, "vrEnabled", {
  23146. get: function() {
  23147. return window._vrEnabled
  23148. },
  23149. set: function(e) {
  23150. (e = !!e) ? (i.renderer = i.newRenderer,
  23151. window.vrMarkers.forEach(function(e) {
  23152. e.visible = !0
  23153. })) : (i.renderer = i.oldRenderer,
  23154. window.vrMarkers.forEach(function(e) {
  23155. e.visible = !1
  23156. })),
  23157. i.cursor.visible = e,
  23158. i.setSize($("#player").width(), $("#player").height()),
  23159. window._vrEnabled = e,
  23160. setTimeout(function() {
  23161. console.log(player.cameraControls.activeControl.camera.fov)
  23162. }, 500)
  23163. }
  23164. }),
  23165. this.createCursor(.5, !1, 1, 16777215, 0);
  23166. var e = {
  23167. setSize: function(e, t) {
  23168. i.camera.aspect = e / t
  23169. }
  23170. };
  23171. this.resizeListeners.push(e),
  23172. this.vrLoadingInit()
  23173. }
  23174. ,
  23175. h.prototype.vrLoadingInit = function() {
  23176. var e = new (e = function(camera) {
  23177. var t = this
  23178. , e = new M.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  23179. , i = new M.MeshBasicMaterial({
  23180. color: 4967932,
  23181. side: M.DoubleSide
  23182. })
  23183. , n = new M.Mesh(e,i);
  23184. (this.mesh = n).position.z = -2,
  23185. n.scale.set(.08, .08, .08),
  23186. n.visible = !1,
  23187. //window.player.camera.add(n),
  23188. camera.add(n),
  23189. t.enabled = !1,
  23190. this.update = function(e) {
  23191. 1 == t.enabled && (n.rotation.z += 15 * e)
  23192. }
  23193. }
  23194. )(this.camera);
  23195. window.Loading = e,
  23196. this.updateListeners.push(e)
  23197. }
  23198. ,
  23199. h.prototype.createCursor = function(e, t, i, n, r) {
  23200. var o, a = new M.SpriteMaterial({
  23201. opacity: i,
  23202. color: n,
  23203. transparent: t,
  23204. map: this.boluoGetTexture("images/cursor.png"),
  23205. needsUpdate: !0,
  23206. side: M.DoubleSide
  23207. });
  23208. a.map.offset = new M.Vector2(1 / 17 * r,0),
  23209. a.map.repeat = new M.Vector2(1 / 17,1),
  23210. a.depthTest = !1,
  23211. a.blending = M.AdditiveBlending,
  23212. (o = new M.Sprite(a)).scale.set(.3, .3, .3),
  23213. o.position.z = -2,
  23214. o.visible = !1,
  23215. o.name = "cursor",
  23216. this.camera.add(o),
  23217. this.scene.add(this.camera),
  23218. this.cursor = o;
  23219. var s = new this.CursorAnimation(this.scene,o,this.camera);
  23220. this.cursor.triggerTargetEvent = s.triggerTargetEvent,
  23221. this.updateListeners.push(s)
  23222. }
  23223. ,
  23224. h.prototype.CursorAnimation = function(e, t, o) {
  23225. this.cursor = t,
  23226. this.raycaster = new M.Raycaster,
  23227. this.targetEventObj = {},
  23228. this.type = 1,
  23229. this.tweenFlag = !0;
  23230. var s = this;
  23231. this.target = o,
  23232. console.log(o.uuid),
  23233. this.euler = new M.Euler,
  23234. this.q0 = new M.Quaternion,
  23235. this.q1 = new M.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  23236. this.zee = new M.Vector3(0,0,1),
  23237. this.alpha = -1e3,
  23238. this.beta = -1e3,
  23239. this.gamma = -1e3,
  23240. this.orient = M.Math.degToRad(window.orientation || 0),
  23241. window.addEventListener("orientationchange", function() {
  23242. s.orient = M.Math.degToRad(window.orientation || 0)
  23243. }),
  23244. window.addEventListener("deviceorientation", function(e) {
  23245. var t = M.Math.degToRad(e.alpha)
  23246. , i = M.Math.degToRad(e.beta)
  23247. , n = M.Math.degToRad(e.gamma);
  23248. if (this.isHuawei5X ? (-1e3 === s.alpha && (s.alpha = t),
  23249. -1e3 === s.beta && (s.beta = i),
  23250. -1e3 === s.gamma && (s.gamma = n),
  23251. .06 < Math.abs(t - s.alpha) && (s.alpha = t),
  23252. .006 < Math.abs(i - s.beta) && (s.beta = i),
  23253. .006 < Math.abs(n - s.gamma) && (s.gamma = n)) : (s.alpha = t,
  23254. s.beta = i,
  23255. s.gamma = n),
  23256. h.vrDebug) {
  23257. $("#info-device-orientation").css("display", "block");
  23258. var r = "";
  23259. r += "alpha=(" + s.alpha + ")<BR/>",
  23260. r += "beta=(" + s.beta + ")<BR/>",
  23261. r += "gamma=" + s.gamma + "<BR/>",
  23262. document.getElementById("info-device-orientation").innerHTML = r
  23263. }
  23264. }),
  23265. this.setObjectQuaternion = function(e, t, i, n, r) {
  23266. s.euler.set(i, t, -n, "YXZ"),
  23267. e.setFromEuler(s.euler),
  23268. e.multiply(s.q1),
  23269. e.multiply(s.q0.setFromAxisAngle(s.zee, -r)),
  23270. o.updateMatrixWorld()
  23271. }
  23272. ,
  23273. parent !== window && window.addEventListener("message", function(e) {
  23274. var t, i, n, r, o = JSON.parse(e.data), a = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  23275. o && o.alpha && o.beta && o.gamma && (t = a,
  23276. i = M.Math.degToRad(o.alpha),
  23277. n = M.Math.degToRad(o.beta),
  23278. r = M.Math.degToRad(o.gamma),
  23279. t ? (-1e3 === s.alpha && (s.alpha = i),
  23280. -1e3 === s.beta && (s.beta = n),
  23281. -1e3 === s.gamma && (s.gamma = r),
  23282. .06 < Math.abs(i - s.alpha) && (s.alpha = i),
  23283. .006 < Math.abs(n - s.beta) && (s.beta = n),
  23284. .006 < Math.abs(r - s.gamma) && (s.gamma = r)) : (s.alpha = i,
  23285. s.beta = n,
  23286. s.gamma = r))
  23287. }),
  23288. this.update = function(e) {
  23289. TWEEN.update(),
  23290. window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient),
  23291. this.triggerTargetEvent())
  23292. }
  23293. ,
  23294. this.triggerTargetEvent = function() {
  23295. var e = this.choseObj()
  23296. , t = e ? e.object : void 0;
  23297. (this.targetEventObj.currentObj = t) !== this.targetEventObj.lastObj && (t && this.autoCursorPosition(e),
  23298. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  23299. t && t.enabled && this.startAnimate(function() {
  23300. this.clickCallback(t)
  23301. }
  23302. .bind(this))) : this.type,
  23303. this.targetEventObj.lastObj = t)
  23304. }
  23305. ,
  23306. this.choseObj = function() {
  23307. this.raycaster.setFromCamera({
  23308. x: 0,
  23309. y: 0
  23310. }, o);
  23311. var e = (this.raycaster.ray,
  23312. window.vrMarkers)
  23313. , t = this.raycaster.intersectObjects(e);
  23314. if (0 < t.length)
  23315. return t[0]
  23316. }
  23317. ,
  23318. this.clickCallback = function(e) {
  23319. this.runTHREEAction(e, "onclick")
  23320. }
  23321. ,
  23322. this.runTHREEAction = function(e, t) {
  23323. switch (t) {
  23324. case "onclick":
  23325. e._listeners && e._listeners.click && e._listeners.click.forEach(function(e) {
  23326. e()
  23327. });
  23328. break;
  23329. case "onhover":
  23330. e._listeners && e._listeners.hover && e._listeners.hover.forEach(function(e) {
  23331. e()
  23332. });
  23333. break;
  23334. case "onout":
  23335. e._listeners && e._listeners.out && e._listeners.out.forEach(function(e) {
  23336. e()
  23337. })
  23338. }
  23339. }
  23340. ,
  23341. this.startAnimate = function(e) {
  23342. this.tweenFlag && this.initAnimation(e)
  23343. }
  23344. ,
  23345. this.initAnimation = function(e) {
  23346. var t = this
  23347. , i = this.cursor.material.map.offset;
  23348. t.tweenFlag = !1,
  23349. this.cursorAnimate = new TWEEN.Tween(i).to({
  23350. x: 1
  23351. }, 1e3).onStart(function() {
  23352. t.tweenFlag = !1
  23353. }).onStop(function() {
  23354. t.tweenFlag = !0,
  23355. this.x = 0,
  23356. i.x = 0
  23357. }).onUpdate(function() {}).onComplete(function() {
  23358. e(),
  23359. i.x = 0,
  23360. setTimeout(function() {
  23361. t.tweenFlag = !0
  23362. }, 1500)
  23363. }),
  23364. this.cursorAnimate.easing(function(e) {
  23365. return Math.floor(17 * e) / 17
  23366. }),
  23367. this.cursorAnimate.start()
  23368. }
  23369. ,
  23370. this.autoCursorPosition = function(e) {
  23371. this.cursor.scale.set(.3, .3, .3)
  23372. }
  23373. }
  23374. ,
  23375. h.prototype.vrRenderer = function(a, i, e) {
  23376. var s = new i.vrCamera(e);
  23377. s.bananaAspect = .8,
  23378. this.width,
  23379. this.height;
  23380. i = this;
  23381. this.setSize = function(e, t) {
  23382. a.setSize.call(this, e, t),
  23383. i.width = e,
  23384. i.height = t
  23385. }
  23386. ,
  23387. this.render = function(e, t, i, n) {
  23388. var r, o;
  23389. if (window.cameraQua = t.quaternion.clone(),
  23390. t.__RESS__SKIP__STEREO__)
  23391. return a.render(e, t, i, n);
  23392. if ("PerspectiveCamera" === t.type)
  23393. r = s.cameraL,
  23394. o = s.cameraR,
  23395. e.updateMatrixWorld(),
  23396. null === t.parent && t.updateMatrixWorld(),
  23397. s.vrCameraUpdate(t);
  23398. else {
  23399. if ("OrthographicCamera" !== t.type)
  23400. return DEBUG && console.error("Unsupported renderer: ", t.type);
  23401. r = o = t
  23402. }
  23403. a.setScissorTest(!0),
  23404. a.setScissor(0, 0, this.width / 2, this.height),
  23405. a.setViewport(0, 0, this.width / 2, this.height),
  23406. a.render.call(this, e, r, i, n),
  23407. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  23408. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  23409. a.render.call(this, e, o, i, n),
  23410. a.setScissorTest(!1)
  23411. }
  23412. ,
  23413. this.__proto__ = {
  23414. __proto__: a
  23415. }
  23416. }
  23417. ,
  23418. h.prototype.vrCamera = function(e) {
  23419. this.type = "StereoCamera",
  23420. this._aspect = 1,
  23421. this._overlap = .064,
  23422. this.cameraL = new M.PerspectiveCamera,
  23423. this.cameraL.layers.enable(1),
  23424. this.cameraL.matrixAutoUpdate = !1,
  23425. this.cameraR = new M.PerspectiveCamera,
  23426. this.cameraR.layers.enable(2),
  23427. this.cameraR.matrixAutoUpdate = !1,
  23428. this.eyeRight = new M.Matrix4,
  23429. this.eyeLeft = new M.Matrix4,
  23430. this.vrCameraNeedsUpdate = !0,
  23431. window.vrCameraL = this.cameraL,
  23432. Object.defineProperty(this, "bananaAspect", {
  23433. get: function() {
  23434. return this._aspect
  23435. },
  23436. set: function(e) {
  23437. this._aspect !== e && (this.vrCameraNeedsUpdate = !0),
  23438. this._aspect = e
  23439. }
  23440. }),
  23441. Object.defineProperty(this, "overlap", {
  23442. get: function() {
  23443. return this._overlap
  23444. },
  23445. set: function(e) {
  23446. this._overlap !== e && (this.vrCameraNeedsUpdate = !0),
  23447. this._overlap = e
  23448. }
  23449. }),
  23450. this.vrCameraUpdate = function(e) {
  23451. if (this.vrCameraNeedsUpdate = !0,
  23452. this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== e.fov || this.bananaReal_aspect !== e.aspect * this.bananaAspect || this.bananaNear !== e.near || this.bananaFar !== e.far,
  23453. this.vrCameraNeedsUpdate) {
  23454. this.vrCameraNeedsUpdate = !1,
  23455. console.debug("vrCameraUpdate"),
  23456. this.bananaFocus = e.focus,
  23457. this.bananaFov = e.fov,
  23458. this.bananaReal_aspect = e.aspect * this.bananaAspect,
  23459. this.bananaNear = e.near,
  23460. this.bananaFar = e.far,
  23461. console.debug(e.aspect),
  23462. this.bananaFocus = 10;
  23463. var t, i, n = e.projectionMatrix.clone(), r = this.overlap / 2, o = r * this.bananaNear / this.bananaFocus, a = this.bananaNear * Math.tan(Math.PI / 180 * this.bananaFov * .5);
  23464. this.eyeLeft.elements[12] = -r,
  23465. this.eyeRight.elements[12] = r,
  23466. t = -a * this.bananaReal_aspect + o,
  23467. i = a * this.bananaReal_aspect + o,
  23468. n.elements[0] = 2 * this.bananaNear / (i - t),
  23469. n.elements[8] = (i + t) / (i - t),
  23470. this.cameraL.projectionMatrix.copy(n),
  23471. t = -a * this.bananaReal_aspect - o,
  23472. i = a * this.bananaReal_aspect - o,
  23473. n.elements[0] = 2 * this.bananaNear / (i - t),
  23474. n.elements[8] = (i + t) / (i - t),
  23475. this.cameraR.projectionMatrix.copy(n)
  23476. }
  23477. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(this.eyeLeft),
  23478. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(this.eyeRight)
  23479. }
  23480. }
  23481. ,
  23482. h.prototype.boluoGetTexture = function(e) {
  23483. var t = new M.TextureLoader;
  23484. return t.crossOrigin = "anonymous",
  23485. t.load(e)
  23486. }
  23487. ,
  23488. h.prototype.updateScreenSize = function(e) {
  23489. var t, i, n, r = !1;
  23490. e && !e.resize && null != e.width && null != e.height ? (i = e.width,
  23491. n = e.height,
  23492. r = !0,
  23493. t = 1) : (i = $("#player").width(),
  23494. n = $("#player").height(),
  23495. e && e.resize && (o = this.renderWidth,
  23496. a = this.renderHeight),
  23497. i === o && n === a && !this.forceUpdateSize || (o = i,
  23498. a = n,
  23499. r = !0,
  23500. t = window.devicePixelRatio)),
  23501. r && (this.setSize(i, n, t),
  23502. this.forceUpdateSize = !1)
  23503. }
  23504. ,
  23505. h.prototype.updateComponents = function() {
  23506. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  23507. this.updateListeners[t].update(e)
  23508. }
  23509. ,
  23510. h.prototype.suspend = function() {
  23511. this.started = !1,
  23512. this.suspendedObjects = this.scene.children.map(function(e) {
  23513. return this.scene.remove(e),
  23514. e
  23515. }
  23516. .bind(this)),
  23517. this.render()
  23518. }
  23519. ,
  23520. h.prototype.resume = function() {
  23521. this.suspendedObjects.forEach(function(e) {
  23522. this.scene.add(e)
  23523. }
  23524. .bind(this)),
  23525. this.suspendedObjects = [],
  23526. this.started = !0,
  23527. b()
  23528. }
  23529. ;
  23530. var g, m, v, y, A, C, I, P, O, L, D, N, F, E, _, b = function() {
  23531. this.started && (window.requestAnimationFrame(b),
  23532. this.updateScreenSize(),
  23533. this.updateComponents(),
  23534. this.updateTextureMemory(),
  23535. this.render(),
  23536. this.emit(r.AfterRender))
  23537. };
  23538. h.prototype.getImageData = (E = document.createElement("canvas"),
  23539. _ = E.getContext("2d"),
  23540. function(e, t, i) {
  23541. return E.width === t && E.height === i || (E.width = t,
  23542. E.height = i),
  23543. _.drawImage(e, 0, 0, t, i),
  23544. _.getImageData(0, 0, t, i)
  23545. }
  23546. ),
  23547. h.prototype.initSizedTexture2D = function(e, t, i) {
  23548. var n = this.renderer
  23549. , r = n.context
  23550. , o = n.state
  23551. , a = new M.Texture(null);
  23552. !(a.flipY = !1) !== i && (i = !1),
  23553. a.generateMipmaps = i;
  23554. var s = n.paramThreeToGL(a.format)
  23555. , l = n.paramThreeToGL(a.type)
  23556. , c = n.properties.get(a)
  23557. , h = r.createTexture();
  23558. o.bindTexture(r.TEXTURE_2D, h),
  23559. r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, a.flipY),
  23560. r.texImage2D(r.TEXTURE_2D, 0, s, e, e, 0, s, l, null),
  23561. a.wrapS = t,
  23562. a.wrapT = t;
  23563. var u = n.paramThreeToGL(t);
  23564. return r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, u),
  23565. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, u),
  23566. i ? (a.magFilter = M.LinearFilter,
  23567. a.minFilter = M.LinearMipMapLinearFilter,
  23568. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23569. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_NEAREST),
  23570. r.generateMipmap(r.TEXTURE_2D)) : (a.magFilter = M.LinearFilter,
  23571. a.minFilter = M.LinearFilter,
  23572. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23573. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR)),
  23574. o.bindTexture(r.TEXTURE_2D, null),
  23575. c.__webglTexture = h,
  23576. a
  23577. }
  23578. ,
  23579. h.prototype.initSizedCubeMap = function(e, t) {
  23580. var i = this.renderer
  23581. , n = i.context
  23582. , r = i.state
  23583. , o = new M.CubeTexture([null, null, null, null, null, null]);
  23584. o.flipY = !1,
  23585. o.generateMipmaps = t;
  23586. var a = i.paramThreeToGL(o.format)
  23587. , s = i.paramThreeToGL(o.type)
  23588. , l = i.properties.get(o)
  23589. , c = n.createTexture();
  23590. r.bindTexture(n.TEXTURE_CUBE_MAP, c),
  23591. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, o.flipY);
  23592. for (var h = 0; h < 6; h++)
  23593. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + h, 0, a, e, e, 0, a, s, null);
  23594. return t ? (o.magFilter = M.LinearFilter,
  23595. o.minFilter = M.LinearMipMapLinearFilter,
  23596. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23597. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  23598. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  23599. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (o.magFilter = M.LinearFilter,
  23600. o.minFilter = M.LinearFilter,
  23601. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23602. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  23603. r.bindTexture(n.TEXTURE_CUBE_MAP, null),
  23604. l.__image__webglTextureCube = c,
  23605. o
  23606. }
  23607. ,
  23608. h.prototype.deallocateCubeTexture = function(e) {
  23609. var t = this.renderer
  23610. , i = t.context
  23611. , n = t.properties.get(e);
  23612. i.deleteTexture(n.__image__webglTextureCube)
  23613. }
  23614. ,
  23615. h.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  23616. var a = this.renderer
  23617. , s = a.context
  23618. , l = a.state
  23619. , c = a.properties.get(t);
  23620. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  23621. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23622. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  23623. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  23624. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  23625. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  23626. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  23627. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  23628. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  23629. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  23630. l.bindTexture(s.TEXTURE_2D, null)
  23631. }
  23632. ,
  23633. h.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  23634. var s = this.renderer
  23635. , l = s.context
  23636. , c = s.state
  23637. , h = s.properties.get(t);
  23638. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  23639. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23640. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  23641. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  23642. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  23643. }
  23644. ,
  23645. h.prototype.rebuildMipMaps2D = function(e) {
  23646. var t = this.renderer
  23647. , i = t.context
  23648. , n = t.state;
  23649. t.properties.get(e),
  23650. i.generateMipmap(i.TEXTURE_2D),
  23651. n.bindTexture(i.TEXTURE_2D, null)
  23652. }
  23653. ,
  23654. h.prototype.rebuildMipMaps3D = function(e) {
  23655. var t = this.renderer
  23656. , i = t.context
  23657. , n = t.state
  23658. , r = t.properties.get(e);
  23659. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  23660. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  23661. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  23662. }
  23663. ,
  23664. h.prototype.renderToCubeMap = (P = !1,
  23665. F = N = D = L = O = null,
  23666. function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  23667. this.renderer.context,
  23668. P || ((L = new M.OrthographicCamera(-.5,.5,.5,-.5,-200,200)).position.z = 150,
  23669. (O = new M.Scene).add(L),
  23670. D = new M.ShaderMaterial({
  23671. uniforms: {
  23672. tDiffuse: {
  23673. type: "t",
  23674. value: null
  23675. },
  23676. alpha: {
  23677. type: "f",
  23678. value: 1
  23679. }
  23680. },
  23681. vertexShader: R.basicTextured.vertexShader,
  23682. fragmentShader: R.basicTextured.fragmentShader,
  23683. depthWrite: !1,
  23684. depthTest: !1,
  23685. side: M.DoubleSide
  23686. }),
  23687. N = new M.PlaneBufferGeometry(1,1),
  23688. (F = new M.Mesh(N,D)).position.z = 0,
  23689. O.add(F),
  23690. P = !0);
  23691. var m = N.getAttribute("uv");
  23692. m.setDynamic(!0),
  23693. m.needsUpdate = !0;
  23694. var v = m.array
  23695. , y = r / i
  23696. , A = o / n
  23697. , C = a / i
  23698. , I = s / n;
  23699. v[0] = y,
  23700. v[1] = A + I,
  23701. v[2] = y + C,
  23702. v[3] = A + I,
  23703. v[4] = y,
  23704. v[5] = A,
  23705. v[6] = y + C,
  23706. v[7] = A;
  23707. var E = N.getAttribute("position");
  23708. E.setDynamic(!0),
  23709. E.needsUpdate = !0;
  23710. var _ = E.array
  23711. , b = l / t.width - .5
  23712. , w = c / t.height - .5
  23713. , T = h / t.width
  23714. , x = u / t.height;
  23715. _[0] = b,
  23716. _[1] = w + x,
  23717. _[3] = b + T,
  23718. _[4] = w + x,
  23719. _[6] = b,
  23720. _[7] = w,
  23721. _[9] = b + T,
  23722. _[10] = w,
  23723. this.renderer.properties.get(e),
  23724. D.uniforms.tDiffuse.value = e,
  23725. D.blending = p || M.NoBlending,
  23726. D.transparent = !!f,
  23727. null != g || (g = 1),
  23728. D.uniforms.alpha.value = g,
  23729. D.needUpdate = !0,
  23730. t.activeCubeFace = d,
  23731. t.viewport.set(0, 0, t.width, t.height);
  23732. var S = this.renderer.autoClear;
  23733. this.renderer.autoClear = !1,
  23734. this.renderer.render(O, L, t, !1),
  23735. this.renderer.autoClear = S
  23736. }
  23737. ),
  23738. h.prototype.copyCubeMap = (g = !1,
  23739. C = A = y = v = m = null,
  23740. I = new M.Euler,
  23741. new M.Vector3,
  23742. function(e, t, i, n, r, o, a, s, l) {
  23743. this.renderer,
  23744. g || ((v = new M.OrthographicCamera(-1,1,1,-1,0,200)).position.set(0, 0, 0),
  23745. (m = new M.Scene).add(v),
  23746. y = new M.ShaderMaterial({
  23747. uniforms: {
  23748. tDiffuse: {
  23749. type: "t",
  23750. value: null
  23751. },
  23752. alpha: {
  23753. type: "f",
  23754. value: 1
  23755. }
  23756. },
  23757. vertexShader: R.copyCubeMap.vertexShader,
  23758. fragmentShader: R.copyCubeMap.fragmentShader,
  23759. depthWrite: !1,
  23760. depthTest: !1,
  23761. side: M.DoubleSide
  23762. }),
  23763. A = new M.BoxGeometry(2,2,2),
  23764. C = new M.Mesh(A,y),
  23765. m.add(C),
  23766. g = !0);
  23767. for (var c = 0; c < 6; c++)
  23768. h.getCubeOrientationForCubeFace(c, I),
  23769. C.rotation.copy(I),
  23770. C.matrixWorldNeedsUpdate = !0,
  23771. C.updateMatrixWorld(),
  23772. y.uniforms.tDiffuse.value = e,
  23773. y.blending = a || M.NoBlending,
  23774. y.transparent = !!s,
  23775. null != l || (l = 1),
  23776. y.uniforms.alpha.value = l,
  23777. y.needUpdate = !0,
  23778. t.activeCubeFace = c,
  23779. t.viewport.set(0, 0, r, o),
  23780. this.renderer.render(m, v, t, !1)
  23781. }
  23782. ),
  23783. h.getLookAtForCubeFace = function(e, t) {
  23784. switch (e) {
  23785. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23786. t.set(1, 0, 0);
  23787. break;
  23788. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23789. t.set(-1, 0, 0);
  23790. break;
  23791. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23792. t.set(0, 1, 0);
  23793. break;
  23794. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23795. t.set(0, -1, 0);
  23796. break;
  23797. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23798. t.set(0, 0, 1);
  23799. break;
  23800. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23801. t.set(0, 0, -1)
  23802. }
  23803. }
  23804. ,
  23805. h.getCubeOrientationForCubeFace = function(e, t) {
  23806. switch (e) {
  23807. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23808. t.set(0, -Math.PI / 2, 0);
  23809. break;
  23810. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23811. t.set(0, Math.PI / 2, 0);
  23812. break;
  23813. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23814. t.set(Math.PI / 2, Math.PI, 0);
  23815. break;
  23816. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23817. t.set(-Math.PI / 2, Math.PI, 0);
  23818. break;
  23819. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23820. t.set(0, -Math.PI, 0);
  23821. break;
  23822. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23823. t.set(0, 0, 0)
  23824. }
  23825. }
  23826. ,
  23827. t.exports = h
  23828. }
  23829. , {
  23830. "../enum/GLCubeFaces": 25,
  23831. "../enum/GLTextureType": 26,
  23832. "../enum/SceneRendererEvents": 43,
  23833. "../exception/BasicException": 55,
  23834. "../exception/RendererCreationException": 57,
  23835. "../settings": 166,
  23836. "../shaders": 167,
  23837. "../util/browser": 182,
  23838. events: 202,
  23839. three: 217
  23840. }],
  23841. 159: [function(e, t, i) {
  23842. "use strict";
  23843. function n(e) {
  23844. this.messenger = new a(e),
  23845. this.clientKey = null
  23846. }
  23847. var o = e("../util/ajax")
  23848. , r = e("./PostMessageType")
  23849. , a = e("./postmessage")
  23850. , s = e("./VersionInfo")
  23851. , l = e("events").EventEmitter
  23852. , c = window.location.origin + "/api/v1/user/";
  23853. (n.prototype = Object.create(l.prototype)).bindEvents = function() {
  23854. this.messenger.on(r.ACTION, this.onMessageReceived.bind(this))
  23855. }
  23856. ,
  23857. n.prototype.waitForConnection = function() {
  23858. return new Promise(function(t, i) {
  23859. this.messenger.on(r.CONNECT, function(e) {
  23860. this.onConnectionReceived(e).then(t.bind(this, e.sdkVersion), i.bind())
  23861. }
  23862. .bind(this))
  23863. }
  23864. .bind(this))
  23865. }
  23866. ,
  23867. n.prototype.onConnectionReceived = function(i) {
  23868. return this.messenger.setTarget(i.source, i.origin),
  23869. this.verifyConnection(i).then(function(e, t) {
  23870. this.messenger.send({
  23871. type: r.ACCEPT,
  23872. toId: i.fromId,
  23873. warning: t
  23874. }),
  23875. this.clientKey = e,
  23876. this.messenger.removeAllListeners(r.CONNECT),
  23877. this.bindEvents()
  23878. }
  23879. .bind(this), function(e) {
  23880. this.messenger.send({
  23881. type: r.REJECT,
  23882. toId: i.fromId,
  23883. reason: e
  23884. }),
  23885. this.messenger.setTarget()
  23886. }
  23887. .bind(this))
  23888. }
  23889. ,
  23890. n.prototype.verifyConnection = function(r) {
  23891. return new Promise(function(e, t) {
  23892. var i;
  23893. if (s.isDeprecated(r.sdkVersion))
  23894. i = "这个版本正在被弃用";
  23895. else if (!s.isSupported(r.sdkVersion))
  23896. return t("不支持此版本的SDK");
  23897. var n = {
  23898. cache: !1,
  23899. headers: {
  23900. "X-port-Application-Key": r.applicationKey,
  23901. "X-port-Referrer": r.origin
  23902. }
  23903. };
  23904. o.get(c, n).done(e.bind(this, r.applicationKey, i)).fail(t.bind(this, "key/referrer mismatch"))
  23905. }
  23906. )
  23907. }
  23908. ,
  23909. n.prototype.onMessageReceived = function(t) {
  23910. if (this.validateClientApplicationKey(t.applicationKey)) {
  23911. var i = this;
  23912. t.onDone = function(e) {
  23913. e.toId = t.fromId,
  23914. e.uid = t.uid,
  23915. e.type = r.RESPONSE,
  23916. i.messenger.send(e)
  23917. }
  23918. ,
  23919. this.emit(r.ACTION, t)
  23920. }
  23921. }
  23922. ,
  23923. n.prototype.validateClientApplicationKey = function(e) {
  23924. return this.clientKey === e
  23925. }
  23926. ,
  23927. n.prototype.sendEvent = function(e, t) {
  23928. this.messenger.send({
  23929. type: r.EVENT,
  23930. eventType: e,
  23931. eventData: t
  23932. })
  23933. }
  23934. ,
  23935. t.exports = n
  23936. }
  23937. , {
  23938. "../util/ajax": 181,
  23939. "./PostMessageType": 160,
  23940. "./VersionInfo": 163,
  23941. "./postmessage": 165,
  23942. events: 202
  23943. }],
  23944. 160: [function(e, t, i) {
  23945. "use strict";
  23946. t.exports = Object.freeze({
  23947. CONNECT: "postmessage.connect",
  23948. ACCEPT: "postmessage.accept",
  23949. REJECT: "postmessage.reject",
  23950. ACTION: "postmessage.action",
  23951. RESPONSE: "postmessage.response",
  23952. EVENT: "postmessage.event"
  23953. })
  23954. }
  23955. , {}],
  23956. 161: [function(e, t, i) {
  23957. "use strict";
  23958. t.exports = Object.freeze({
  23959. MOVE: "sdk.move",
  23960. ENTER_PANO: "sdk.enterpano",
  23961. MODEL_LOADED: "sdk.modelloaded"
  23962. })
  23963. }
  23964. , {}],
  23965. 162: [function(e, t, i) {
  23966. "use strict";
  23967. t.exports = Object.freeze({
  23968. FLY: "transition.fly",
  23969. FADEOUT: "transition.fade",
  23970. INSTANT: "transition.instant"
  23971. })
  23972. }
  23973. , {}],
  23974. 163: [function(e, t, i) {
  23975. "use strict";
  23976. t.exports = {
  23977. current: "1.0",
  23978. supported: ["1.0"],
  23979. deprecated: [],
  23980. isSupported: function(e) {
  23981. return -1 !== this.supported.indexOf(e)
  23982. },
  23983. isDeprecated: function(e) {
  23984. return -1 !== this.deprecated.indexOf(e)
  23985. },
  23986. isValid: function(e) {
  23987. return this.isSupported(e) || this.isDeprecated(e)
  23988. }
  23989. }
  23990. }
  23991. , {}],
  23992. 164: [function(q, X, e) {
  23993. (function(e) {
  23994. "use strict";
  23995. function r(e, t, i) {
  23996. e = e && e.toLowerCase().trim();
  23997. var n = new C.UP.clone
  23998. , r = Math.PI / 3
  23999. , o = Math.PI / 2;
  24000. switch (e) {
  24001. case "left":
  24002. i.copy(t),
  24003. i.applyAxisAngle(n, o);
  24004. break;
  24005. case "right":
  24006. i.copy(t),
  24007. i.applyAxisAngle(n, -o);
  24008. break;
  24009. case "forwardleft":
  24010. i.copy(t),
  24011. i.applyAxisAngle(n, r);
  24012. break;
  24013. case "forwardright":
  24014. i.copy(t),
  24015. i.applyAxisAngle(n, -r);
  24016. break;
  24017. case "forward":
  24018. default:
  24019. i.copy(t)
  24020. }
  24021. return i
  24022. }
  24023. function o(e, t) {
  24024. if (e) {
  24025. var i = {
  24026. pano: e,
  24027. lookAtPoint: null,
  24028. duration: null,
  24029. maxDistanceOverride: null,
  24030. skipWarpingCheck: !1
  24031. };
  24032. this.player.flyToPano(i, function() {
  24033. t && t({
  24034. success: !0,
  24035. message: "Transition complete."
  24036. })
  24037. })
  24038. } else
  24039. M.warn("Showcase -> clickPanoObject: Unable to find pano."),
  24040. t && t({
  24041. success: !1,
  24042. error: "Unable to find pano."
  24043. })
  24044. }
  24045. function a(e, t) {
  24046. t.copy(C.FORWARD),
  24047. e.getDirection(t)
  24048. }
  24049. function c(i) {
  24050. return {
  24051. panos: i.panos.list.map(function(e) {
  24052. var t = y.getCubemapUrls(i.urls, e.id, "high")[A.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  24053. return {
  24054. uuid: e.id,
  24055. aligned: e.alignmentType === g.ALIGNED,
  24056. neighbourUUIDs: e.neighbourUUIDs.slice(),
  24057. position: function(e) {
  24058. return e.alignmentType !== g.ALIGNED ? null : {
  24059. x: e.position.x,
  24060. y: e.position.y,
  24061. z: e.position.z
  24062. }
  24063. }(e),
  24064. rotation: function(e) {
  24065. var t = (new h.Euler).setFromQuaternion(e.quaternion, "YXZ");
  24066. return {
  24067. x: h.Math.radToDeg(t._x),
  24068. y: h.Math.radToDeg(t._y),
  24069. z: h.Math.radToDeg(t._z)
  24070. }
  24071. }(e),
  24072. thumbnail: t
  24073. }
  24074. })
  24075. }
  24076. }
  24077. var t, l, i, h = q("three"), u = q("./ApiHost"), n = q("../util/logger"), d = q("../util/common"), s = q("../util/math"), p = q("../enum/ModelManagerEvents"), f = q("./PostMessageType"), g = q("../enum/AlignmentType"), m = q("../enum/Direction"), v = q("./TransitionStyles"), y = q("../util/panorama"), A = q("../enum/GLCubeFaces"), C = q("../enum/Vectors"), I = q("../enum/Viewmode"), E = q("../enum/WarpStyle"), _ = (q("../enum/Keys"),
  24078. q("../enum/PlayerEvents")), b = q("../sdk/SdkEvents"), w = (C = q("../enum/Vectors"),
  24079. q("../enum/ControlEvents")), T = q("../enum/RenderLayers"), x = (q("../constants"),
  24080. q("../settings")), S = q("../lib/jpeg_encoder"), M = new n(e), R = (N.active = !1,
  24081. N.angle = 0,
  24082. N.angleTravelled = 0,
  24083. N.playerDirection = new h.Vector3,
  24084. N.lastFacingDirection = new h.Vector3,
  24085. N.onDone = null,
  24086. N.player = null,
  24087. N.start = function(e, t, i, n) {
  24088. N.active = !0,
  24089. e && t && (t = 0),
  24090. N.angle = e || t,
  24091. N.xAngle = e,
  24092. N.yAngle = t,
  24093. N.angleTravelled = 0,
  24094. N.playerDirection.copy(i.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24095. i.getDirection(N.playerDirection),
  24096. N.lastFacingDirection.copy(N.playerDirection),
  24097. N.projectVectors(),
  24098. N.onDone = n,
  24099. N.player = i,
  24100. N()
  24101. }
  24102. ,
  24103. N.projectVectors = function() {
  24104. N.xAngle && (N.playerDirection.projectOnPlane(C.UP),
  24105. N.lastFacingDirection.projectOnPlane(C.UP))
  24106. }
  24107. ,
  24108. N), P = (i = new h.Vector3,
  24109. function(e) {
  24110. e ? (i.copy(e.position),
  24111. i.add(e.discPosition),
  24112. s.projectPositionToCanvas(i, this.player.camera, i),
  24113. this.click(i.x, i.y)) : M.warn("Showcase -> clicktagObject: Unable to find tag.")
  24114. }
  24115. ), O = (l = new h.Vector3,
  24116. function(e) {
  24117. var t = this.player.getDirection();
  24118. l.copy(t);
  24119. var i = l.y;
  24120. l.y = 0,
  24121. l.normalize();
  24122. var n = h.Math.radToDeg(l.angleTo(t)) * (i < 0 ? -1 : 1);
  24123. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.PANORAMA)
  24124. return 0 !== e && M.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  24125. 0;
  24126. this.player.mode === I.DOLLHOUSE && (n = -n);
  24127. var r = function() {
  24128. return this.player.mode === I.PANORAMA ? x.insideLookLimitUp : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.minPolarAngle) : null
  24129. }
  24130. .call(this) - .1
  24131. , o = function() {
  24132. return this.player.mode === I.PANORAMA ? x.insideLookLimitDown : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.maxPolarAngle) : null
  24133. }
  24134. .call(this) + .1
  24135. , a = n + e;
  24136. r < a ? a = r : a < o && (a = o);
  24137. var s = a - n;
  24138. return 0 < e && s < .01 && (s = 0),
  24139. e < 0 && -.01 < s && (s = 0),
  24140. s
  24141. }
  24142. ), L = (t = new h.Euler,
  24143. function(e) {
  24144. return t.setFromQuaternion(e.quaternion, "YXZ"),
  24145. {
  24146. position: {
  24147. x: e.position.x,
  24148. y: e.position.y,
  24149. z: e.position.z
  24150. },
  24151. rotation: {
  24152. x: h.Math.radToDeg(t.x),
  24153. y: h.Math.radToDeg(t.y),
  24154. z: 0
  24155. },
  24156. pano: e.currentPano ? e.currentPano.id : null,
  24157. mode: e.mode
  24158. }
  24159. }
  24160. ), D = null;
  24161. function N() {
  24162. N.playerDirection.copy(N.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24163. N.player.getDirection(N.playerDirection),
  24164. N.projectVectors();
  24165. var e = N.playerDirection.angleTo(N.lastFacingDirection);
  24166. (N.angleTravelled += Math.abs(e)) >= Math.abs(N.angle) ? (N.active = !1,
  24167. N.onDone && (0,
  24168. N.onDone)()) : (N.lastFacingDirection.copy(N.playerDirection),
  24169. window.setTimeout(N, 4))
  24170. }
  24171. X.exports = {
  24172. init: function(e, t, i, n, r) {
  24173. Y.init(e, t, i, r),
  24174. D = new Promise(function(e, t) {
  24175. i.on(_.Ready, function() {
  24176. e()
  24177. })
  24178. }
  24179. .bind(this));
  24180. var o = new u(window)
  24181. , a = o.waitForConnection();
  24182. a.then(function(e) {
  24183. o.on(f.ACTION, Y.onMessageReceive.bind(Y))
  24184. });
  24185. var s, l = (s = Date.now(),
  24186. function() {
  24187. if (!(Date.now() - s < 100)) {
  24188. var e = L(i);
  24189. o.sendEvent(b.MOVE, {
  24190. state: e
  24191. }),
  24192. s = Date.now()
  24193. }
  24194. }
  24195. );
  24196. i.on(_.Move, l),
  24197. i.on(_.ViewChanged, l),
  24198. n.on(p.ActiveModelChanged, function(e) {
  24199. function t(e) {
  24200. var t, i = e.newPano.id;
  24201. e.oldPano && (t = e.oldPano.id),
  24202. i !== t && o.sendEvent(b.ENTER_PANO, {
  24203. oldPano: t,
  24204. newPano: i
  24205. })
  24206. }
  24207. var i = e.model
  24208. , n = e.oldModel;
  24209. Y.model = i,
  24210. a.then(function() {
  24211. o.sendEvent(b.MODEL_LOADED, {
  24212. metadata: c(i)
  24213. })
  24214. }),
  24215. n && n.panos.forEach(function(e) {
  24216. e.removeEventListener("enter", t)
  24217. }),
  24218. i.panos.forEach(function(e) {
  24219. e.on("enter", t)
  24220. })
  24221. })
  24222. }
  24223. };
  24224. var F, B, V, k, U, H, z, G, W, j, Y = {
  24225. director: null,
  24226. player: null,
  24227. controls: null,
  24228. sceneRenderer: null,
  24229. model: null,
  24230. init: function(e, t, i, n) {
  24231. this.director = e,
  24232. this.player = i,
  24233. this.controls = t,
  24234. this.sceneRenderer = n
  24235. },
  24236. handleToObject: {},
  24237. objectToHandle: {},
  24238. handleCount: 0,
  24239. onMessageReceive: function(e) {
  24240. if (e) {
  24241. var t = e.targetFunction
  24242. , i = e.params
  24243. , n = e.onDone;
  24244. t && this[t] && this[t](i, n)
  24245. }
  24246. },
  24247. waitForInit: function(e, t) {
  24248. D.then(t.bind({
  24249. success: !0,
  24250. message: "Init complete."
  24251. }))
  24252. },
  24253. moveToPano: (W = new h.Euler(0,0,0,"YXZ"),
  24254. j = new h.Quaternion,
  24255. function(e, t) {
  24256. var i = e.pano
  24257. , n = e.rotation
  24258. , r = e.transition;
  24259. if (!this.model)
  24260. return t({
  24261. success: !1,
  24262. error: "The model has not been loaded yet"
  24263. });
  24264. var o = this.model.panos.get(i);
  24265. if (!o)
  24266. return t({
  24267. success: !1,
  24268. error: i + " does not exist in this model"
  24269. });
  24270. if (!n)
  24271. return t({
  24272. sucess: !1,
  24273. erorr: n + " is not a valid rotation"
  24274. });
  24275. W.set(h.Math.degToRad(n.x || 0), h.Math.degToRad(n.y || 0), h.Math.degToRad(n.z || 0), "YXZ"),
  24276. console.log(n.z);
  24277. var a = {
  24278. success: !0,
  24279. message: i
  24280. };
  24281. if (r === v.FADEOUT)
  24282. j.setFromEuler(W),
  24283. this.player.warpToPano(o, j, null, null, E.BLACK, null, null, t.bind(this, a));
  24284. else {
  24285. var s, l;
  24286. r === v.INSTANT && (l = s = 0);
  24287. var c = C.FORWARD.clone().applyEuler(W).add(o.position);
  24288. this.player.flyToPano({
  24289. pano: o,
  24290. lookAtPoint: c,
  24291. duration: s,
  24292. aimDuration: l
  24293. }, t.bind(this, a))
  24294. }
  24295. }
  24296. ),
  24297. moveInDirection: function(e, t) {
  24298. var i = e.direction;
  24299. return void 0 === m[i] ? (M.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  24300. void (t && t({
  24301. success: !1,
  24302. error: "Invalid direction."
  24303. }))) : void this.player.flyLocalDirection(C[i].clone()).then(function(e) {
  24304. t(e ? {
  24305. success: !0,
  24306. message: "moved " + i
  24307. } : {
  24308. success: !1,
  24309. error: "Cannot move in direction: " + i
  24310. })
  24311. })
  24312. },
  24313. getPose: function(e, t) {
  24314. return this.player.camera.position,
  24315. (new h.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ"),
  24316. t({
  24317. success: !0,
  24318. message: L(this.player)
  24319. })
  24320. },
  24321. takeScreenShot: (z = new h.PerspectiveCamera,
  24322. G = new h.WebGLRenderTarget,
  24323. function(e, t) {
  24324. if (!e.resolution)
  24325. return t({
  24326. success: !1,
  24327. error: "An invalid resolution was specified"
  24328. });
  24329. if (-1 === e.resolution.width || -1 === e.resolution.height) {
  24330. var i = this.sceneRenderer.renderer.getSize();
  24331. e.resolution.width = i.width,
  24332. e.resolution.height = i.height
  24333. }
  24334. z.layers.set(T.DEFAULT),
  24335. e.visibleObjects && (e.visibleObjects.showtags && z.layers.enable(T.TAG),
  24336. e.visibleObjects.showPucks && z.layers.enable(T.PANOMARKERS),
  24337. e.visibleObjects.showReticule && z.layers.enable(T.RETICULE));
  24338. var n = e.resolution.width
  24339. , r = e.resolution.height
  24340. , o = n / r;
  24341. z.position.copy(this.sceneRenderer.camera.position),
  24342. z.quaternion.copy(this.sceneRenderer.camera.quaternion),
  24343. z.projectionMatrix.copy(this.player.camera.projectionMatrix),
  24344. z.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / o,
  24345. G.setSize(n, r),
  24346. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, z, G);
  24347. var a = new Uint8Array(n * r * 4);
  24348. this.sceneRenderer.renderer.readRenderTargetPixels(G, 0, 0, n, r, a);
  24349. var s = S.encode({
  24350. data: a,
  24351. width: n,
  24352. height: r,
  24353. heading: 180,
  24354. pitch: 0
  24355. }, {
  24356. quality: 75,
  24357. flipY: !0
  24358. });
  24359. t({
  24360. success: !0,
  24361. message: "data:image/jpg;base64," + d.uint8ToBase64(s.data)
  24362. })
  24363. }
  24364. ),
  24365. findRankedPano: (U = new h.Vector3,
  24366. H = new h.Vector3,
  24367. function(e, t) {
  24368. a(this.player, H),
  24369. r(t, H, U);
  24370. var i = this.player.rankedPanoInDirection(e, U);
  24371. if (i) {
  24372. var n = this.objectToHandle[i.id];
  24373. return n || (this.objectToHandle[i.id] = n = this.handleCount++,
  24374. this.handleToObject[n] = i),
  24375. n
  24376. }
  24377. return M.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  24378. -1
  24379. }
  24380. ),
  24381. findRankedtag: (V = new h.Vector3,
  24382. k = new h.Vector3,
  24383. function(e, t) {
  24384. a(this.player, k),
  24385. r(t, k, V);
  24386. var i = this.player.rankedtagInDirection(e, V);
  24387. if (i) {
  24388. var n = this.objectToHandle[i.sid];
  24389. return n || (this.objectToHandle[i.sid] = n = this.handleCount++,
  24390. this.handleToObject[n] = i),
  24391. n
  24392. }
  24393. return M.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  24394. -1
  24395. }
  24396. ),
  24397. clickNearesttag: function(e) {
  24398. this.clickRankedtag(0, e)
  24399. },
  24400. clickRankedtag: function(e, t) {
  24401. var i = function(e, t) {
  24402. var i = this.findRankedtag(e, t);
  24403. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  24404. null)
  24405. }
  24406. .call(this, e, t);
  24407. i && P.call(this, i)
  24408. },
  24409. clickNearestPano: function(e, t) {
  24410. this.clickRankedPano(0, e, t)
  24411. },
  24412. clickRankedPano: function(e, t, i) {
  24413. var n = function(e, t) {
  24414. var i = this.findRankedPano(e, t);
  24415. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  24416. null)
  24417. }
  24418. .call(this, e, t);
  24419. n ? o.call(this, n, i) : i(null)
  24420. },
  24421. clickPano: function(e, t) {
  24422. var i = this.handleTable[e];
  24423. i ? o.call(this, i, t) : t(null)
  24424. },
  24425. rotateDirection: function(e, t) {
  24426. var i = e.direction
  24427. , n = e.angle;
  24428. if (!R.active) {
  24429. var r = 0
  24430. , o = 0
  24431. , a = 0
  24432. , s = 0;
  24433. if (!n || isNaN(n))
  24434. return M.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  24435. void (t && t({
  24436. success: !1,
  24437. error: "Invalid rotation angle."
  24438. }));
  24439. if (this.player.mode === I.TRANSITIONING)
  24440. return M.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  24441. void (t && t({
  24442. success: !1,
  24443. error: "Cannot rotate while transitioning"
  24444. }));
  24445. if (i === m.RIGHT || i === m.LEFT)
  24446. i === m.RIGHT && (n = -n),
  24447. r = 0 < n ? -1 : 1,
  24448. a = n;
  24449. else {
  24450. if (i !== m.UP && i !== m.DOWN)
  24451. return M.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  24452. void (t && t({
  24453. success: !1,
  24454. error: "Invalid direction for rotation."
  24455. }));
  24456. if (this.player.mode === I.FLOORPLAN)
  24457. return M.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  24458. void (t && t({
  24459. success: !1,
  24460. error: "Cannot rotate " + i + " in floorplan mode"
  24461. }));
  24462. if (i === m.DOWN && (n = -n),
  24463. 0 === (n = O.call(this, n)))
  24464. return M.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  24465. void (t && t({
  24466. success: !1,
  24467. error: "Already at maximum rotation in direction: " + i
  24468. }));
  24469. o = 0 < n ? 1 : -1,
  24470. s = n
  24471. }
  24472. var l = n;
  24473. n = h.Math.degToRad(n),
  24474. a = h.Math.degToRad(a),
  24475. s = h.Math.degToRad(s);
  24476. var c = this.controls.activeControl;
  24477. c.startRotating(r, o),
  24478. R.start(a, s, this.player, function() {
  24479. c.stopRotating(!0),
  24480. t && t({
  24481. success: !0,
  24482. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  24483. })
  24484. })
  24485. }
  24486. },
  24487. rotate: (F = new h.Vector3,
  24488. B = new h.Vector3,
  24489. function(e, t) {
  24490. var i = e.xAngle
  24491. , n = e.yAngle;
  24492. if (!R.active) {
  24493. if (i = i || 0,
  24494. n = n || 0,
  24495. isNaN(i) || isNaN(n))
  24496. return M.warn("Showcase -> rotate: Invalid rotation angle."),
  24497. void (t && t({
  24498. success: !1,
  24499. error: "Invalid rotation angle."
  24500. }));
  24501. if (this.player.mode === I.TRANSITIONING)
  24502. return M.warn("Automation -> rotate: Cannot rotate while transitioning"),
  24503. void (t && t({
  24504. success: !1,
  24505. error: "Cannot rotate while transitioning"
  24506. }));
  24507. Math.abs(i) < .01 && (i = 0),
  24508. Math.abs(n) < .01 && (n = 0);
  24509. var r = n;
  24510. n = O.call(this, n);
  24511. var o = 0 < r ? "UP" : "DOWN";
  24512. if (!(i = -i) && r && !n)
  24513. return M.warn("Showcase -> rotate: Already at maximum rotation in direction: " + o),
  24514. void (t && t({
  24515. success: !1,
  24516. error: "Already at maximum rotation in direction: " + o
  24517. }));
  24518. n < r && M.warn("Showcase -> rotate: Reached maximum rotation in direction: " + o);
  24519. var a = n;
  24520. n = h.Math.degToRad(n),
  24521. i = h.Math.degToRad(i),
  24522. F.copy(this.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24523. this.player.getDirection(F),
  24524. B.copy(F).applyAxisAngle(C.UP, i),
  24525. B.applyAxisAngle(C.RIGHT, n);
  24526. var s = (F.angleTo(B),
  24527. 0 < i ? -1 : i < 0 ? 1 : 0)
  24528. , l = 0 < n ? 1 : n < 0 ? -1 : 0;
  24529. Math.abs(i) > Math.abs(n) ? l *= Math.abs(n / i) : Math.abs(n) > Math.abs(i) && (s *= Math.abs(i / n));
  24530. var c = this.controls.activeControl;
  24531. c.startRotating(s, l),
  24532. R.start(i, n, this.player, function() {
  24533. c.stopRotating(!0),
  24534. t && t({
  24535. success: !0,
  24536. message: "Rotated " + e.xAngle.toFixed(2) + "° horizontally, " + a.toFixed(2) + "° vertically"
  24537. })
  24538. })
  24539. }
  24540. }
  24541. ),
  24542. panCamera: function(e, i) {
  24543. function t(e) {
  24544. switch (r.removeAllListeners(w.AutoPanComplete),
  24545. r.removeAllListeners(w.AutoPanInterrupt),
  24546. r.removeAllListeners(w.AutoPanClamped),
  24547. e) {
  24548. case w.AutoPanInterrupt:
  24549. i({
  24550. success: !0,
  24551. message: "Camera panning interrupted."
  24552. });
  24553. break;
  24554. case w.AutoPanClamped:
  24555. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  24556. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  24557. return void i({
  24558. success: !1,
  24559. error: "Already at edge of current model bounds."
  24560. });
  24561. var t = "The view point is outside the bounds for the current model. ";
  24562. t += "The view point was clamped to " + o(r.target.x, r.target.z),
  24563. console.warn(t)
  24564. }
  24565. case w.AutoPanComplete:
  24566. i({
  24567. success: !0,
  24568. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  24569. })
  24570. }
  24571. }
  24572. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.FLOORPLAN)
  24573. return i({
  24574. success: !1,
  24575. error: "Camera panning is not available in the current mode: " + this.player.mode
  24576. });
  24577. var n = e.position
  24578. , r = this.player.control;
  24579. r.setAutoPanPosition(n.x, n.z),
  24580. r.autoPan = !0;
  24581. var o = function(e, t) {
  24582. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  24583. };
  24584. r.on(w.AutoPanComplete, t.bind(this, w.AutoPanComplete)),
  24585. r.on(w.AutoPanInterrupt, t.bind(this, w.AutoPanInterrupt)),
  24586. r.on(w.AutoPanClamped, t.bind(this, w.AutoPanClamped))
  24587. },
  24588. click: function(e, t) {
  24589. var i = e.x
  24590. , n = e.y;
  24591. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24592. n = n / 100 * $("#player").height()),
  24593. this.player.handleInputStart(i, n),
  24594. this.player.updateIntersect(),
  24595. this.player.handleInputEnd(i, n)
  24596. },
  24597. mouseOver: function(e, t) {
  24598. var i = e.x
  24599. , n = e.y;
  24600. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24601. n = n / 100 * $("#player").height()),
  24602. this.player.handleInputMove(i, n),
  24603. this.player.updateIntersect()
  24604. },
  24605. moveToMode: function(e, t) {
  24606. function i(e) {
  24607. t(e ? {
  24608. success: !1,
  24609. error: "Failed to load new mode: " + e
  24610. } : {
  24611. success: !0,
  24612. message: "Moved to new mode: " + n
  24613. })
  24614. }
  24615. var n = e.mode;
  24616. n === I.PANORAMA || n === I.DOLLHOUSE || n === I.FLOORPLAN ? this.director.changeMode(n).then(function() {
  24617. i()
  24618. }, function(e) {
  24619. i(e)
  24620. }) : t({
  24621. success: !1,
  24622. error: "Invalid mode selection"
  24623. })
  24624. }
  24625. }
  24626. }
  24627. ).call(this, "/js/sdk/automation.js")
  24628. }
  24629. , {
  24630. "../constants": 8,
  24631. "../enum/AlignmentType": 17,
  24632. "../enum/ControlEvents": 21,
  24633. "../enum/Direction": 22,
  24634. "../enum/GLCubeFaces": 25,
  24635. "../enum/Keys": 30,
  24636. "../enum/ModelManagerEvents": 33,
  24637. "../enum/PlayerEvents": 40,
  24638. "../enum/RenderLayers": 41,
  24639. "../enum/Vectors": 50,
  24640. "../enum/Viewmode": 51,
  24641. "../enum/WarpStyle": 52,
  24642. "../lib/jpeg_encoder": 94,
  24643. "../sdk/SdkEvents": 161,
  24644. "../settings": 166,
  24645. "../util/common": 185,
  24646. "../util/logger": 189,
  24647. "../util/math": 190,
  24648. "../util/panorama": 191,
  24649. "./ApiHost": 159,
  24650. "./PostMessageType": 160,
  24651. "./TransitionStyles": 162,
  24652. three: 217
  24653. }],
  24654. 165: [function(e, t, i) {
  24655. "use strict";
  24656. function n(e) {
  24657. this.sourceWindow = e,
  24658. this.targetWindow = null,
  24659. this.targetOrigin = null,
  24660. this.id = Math.floor(1e5 * Math.random()),
  24661. this.bindEvents()
  24662. }
  24663. var r = e("./PostMessageType")
  24664. , o = e("events").EventEmitter;
  24665. (n.prototype = Object.create(o.prototype)).bindEvents = function() {
  24666. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  24667. }
  24668. ,
  24669. n.prototype.setTarget = function(e, t) {
  24670. this.targetWindow = e,
  24671. this.targetOrigin = t
  24672. }
  24673. ,
  24674. n.prototype.onPostmessageReceived = function(e) {
  24675. var t = e.origin || e.originalEvent.origin
  24676. , i = e.source;
  24677. switch (e.data.type) {
  24678. case r.CONNECT:
  24679. break;
  24680. case r.RESPONSE:
  24681. if (this.id !== e.data.toId)
  24682. return;
  24683. default:
  24684. if (!this.validateMessageOrigin(t))
  24685. return
  24686. }
  24687. var n = e.data;
  24688. n.source = i,
  24689. n.origin = t,
  24690. n.timestamp = Date.now(),
  24691. this.emit(e.data.type, n)
  24692. }
  24693. ,
  24694. n.prototype.validateMessageOrigin = function(e) {
  24695. return "*" === this.targetOrigin || e === this.targetOrigin
  24696. }
  24697. ,
  24698. n.prototype.send = function(e) {
  24699. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  24700. this.targetWindow.postMessage(e, this.targetOrigin))
  24701. }
  24702. ,
  24703. t.exports = n
  24704. }
  24705. , {
  24706. "./PostMessageType": 160,
  24707. events: 202
  24708. }],
  24709. 166: [function(e, t, i) {
  24710. "use strict";
  24711. var n = e("three")
  24712. , r = e("./util/browser")
  24713. , o = e("./enum/Viewmode")
  24714. , a = e("./enum/VROption")
  24715. , s = e("./enum/Colors")
  24716. , l = e("./enum/WarpStyle")
  24717. , c = e("./util/easing")
  24718. , h = e("./util/common")
  24719. , u = e("./util/showcase")
  24720. , d = e("./constants")
  24721. , p = {
  24722. debug: !1,
  24723. version: "2.25.6-0-gd87e5b1",
  24724. languageTag: r.valueFromHash("lang", null),
  24725. pageTitle: "四维虚拟漫游",
  24726. authorizationHeader: u.getAuthorizationHeader(),
  24727. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  24728. logLevel: r.valueFromHash("log", 2),
  24729. skyboxRadius: 2500,
  24730. modelBoundsPadding: 5,
  24731. showNeighbors: !1,
  24732. brand: r.valueFromHash("brand", !0),
  24733. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  24734. startHighlights: r.valueFromHash("hl", -1),
  24735. specialEdition: r.valueFromHash("bn", 0),
  24736. useWheel: r.valueFromHash("wh", !0),
  24737. crossOrigin: "anonymous",
  24738. fancierTransition: !1,
  24739. wireframe: !1,
  24740. skyboxWireframe: !1,
  24741. modelAlpha: 1,
  24742. highlightPanoSelection: !1,
  24743. showSweeps: !0,
  24744. showSkyboxes: !1,
  24745. showMesh: !0,
  24746. showFloors: !1,
  24747. showFloorDuration: 300,
  24748. showFloorDelay: 300,
  24749. hideFloorDuration: 300,
  24750. hideFloorDelay: 0,
  24751. reticuleOpacityTransitionTime: 250,
  24752. reticuleColor: window.DATA.mouseMarkerColor || s.newBlue,
  24753. markerOpacityTransitionTime: 500,
  24754. guiAnimationSpeed: 250,
  24755. highlightAnimationDuration: 500,
  24756. modelComponentLoadSpinnerDelay: 150,
  24757. captureErrors: !1,
  24758. maxMobileTextures: 6,
  24759. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  24760. startupFlyinDelay: 3e3,
  24761. dollhouseDefault: {
  24762. minDistance: 1,//15, //编辑页面给近一些
  24763. maxDistance: 50,
  24764. minPolarAngle: n.Math.degToRad(10),
  24765. maxPolarAngle: n.Math.degToRad(90)
  24766. },
  24767. hideReticuleTimeout: 1e3,
  24768. analytics: {
  24769. inactivityThreshold: 30,
  24770. sessionTrackingRate: .15,
  24771. maxTrackedErrors: 20,
  24772. sessionDurationPingFrequency: 10,
  24773. sessionDurationTimeout: 15
  24774. },
  24775. flydown: {
  24776. movementEasing: "easeInOutQuad",
  24777. movementDelay: .001,
  24778. rotationEasing: "easeInOutQuad",
  24779. rotationDelay: .5,
  24780. modelTextureDelay: .75,
  24781. skyboxDelay: .75
  24782. },
  24783. transition: {
  24784. flySpeed: .001,
  24785. flyTime: 750,
  24786. flytimeMaxDistanceThreshold: 5,
  24787. flytimeDistanceMultiplier: 150,
  24788. aimTime: 1500,
  24789. aimSlowFactor: 1.5,
  24790. blur: .8,
  24791. movementEasing: "easeInOutQuad",
  24792. blendEasing: "easeInOutQuad",
  24793. fastForwardFactor: 4
  24794. },
  24795. show360Views: {
  24796. enabled: !0,
  24797. transitionTime: 1e3
  24798. },
  24799. quickstart: {
  24800. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  24801. animation: 1400,
  24802. showTextDelay: 500,
  24803. fadeOutDelay: 3e3,
  24804. fovChange: 10
  24805. },
  24806. appConfig: {
  24807. webvr_version: null,
  24808. segment_key: null,
  24809. embedly_key: null,
  24810. branch_key: null,
  24811. keen_write_key: null,
  24812. keen_project_id: null
  24813. },
  24814. vr: {
  24815. enabled: !0,
  24816. allowWebVR: !1,
  24817. option: r.valueFromHash("vr", a.CONTEXTUAL)
  24818. },
  24819. share: {
  24820. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  24821. },
  24822. input: {
  24823. longTapThreshold: 200,
  24824. moveToleranceNDC: 0.01,//.08,
  24825. touchMoveThreshold: 25
  24826. },
  24827. help: {
  24828. modalStayDuration: 600
  24829. },
  24830. immersive: {
  24831. timeToShowAgain: 1250,
  24832. uiStayDuration: 600
  24833. },
  24834. tourInteraction: {
  24835. disabled: "0" === r.valueFromHash("tourcta", null),
  24836. showPauseButton: 1e3,
  24837. showModal: 1500,
  24838. allowNextClick: 200,
  24839. largeModal: "1" === r.valueFromHash("tourcta", null),
  24840. smallModal: "2" === r.valueFromHash("tourcta", null)
  24841. },
  24842. labels: {
  24843. enabled: !1,
  24844. hideUntilStart: !0,
  24845. fadeInDuration: 250,
  24846. fadeInDelay: 250,
  24847. fadeOutDuration: 250,
  24848. fadeOutDelay: 0,
  24849. zoomHideThreshhold: {
  24850. mobile: r.isSmallScreen() ? .45 : .6,
  24851. desktop: 2
  24852. },
  24853. zoomTruncateThreshhold: {
  24854. mobile: r.isSmallScreen() ? .35 : .45,
  24855. desktop: .85
  24856. },
  24857. minLengthForTruncate: 16,
  24858. truncateLength: 12,
  24859. truncateSuffix: "..."
  24860. },
  24861. tags: {
  24862. enabled: r.valueFromHash("mt", 1),
  24863. startup: {
  24864. hideUntilStart: !0,
  24865. fadeInDuration: 500,
  24866. fadeInDelay: 100
  24867. },
  24868. visibility: {
  24869. anyDistance: !0,
  24870. visibleDistance: 8,
  24871. cameraClearance: .1,
  24872. alphaTestLevel: .05,
  24873. hideViaFloor: !0,
  24874. hideOffScreenDisc: !1,
  24875. hideOffScreenObject: !1
  24876. },
  24877. disc: {
  24878. opacity: 1,
  24879. disabledOpacity: .5,
  24880. scale: {
  24881. nearBound: 1.5,
  24882. farBound: 4.8,
  24883. linkFarBound: !1,
  24884. linkPercent: 40,
  24885. maxSize: 80,
  24886. minSize: 40,
  24887. baseViewportSize: 800,
  24888. responsiveness: 100
  24889. }
  24890. },
  24891. pole: {
  24892. enabled: !0,
  24893. height: .5,
  24894. width: 2,
  24895. opacity: .5,
  24896. color: "white"
  24897. },
  24898. navigate: {
  24899. nearestPano: !0,
  24900. lineOfSight: !0,
  24901. reactivate: !0,
  24902. aimAt: "disc",
  24903. tiltTolerance: 25,
  24904. rotateSpeedFactor: .6
  24905. }
  24906. },
  24907. path: {
  24908. color: window.DATA.floorMarkerColor || s.newBlue,
  24909. colorUp: s._desat(s.newBlue, .5),
  24910. colorDown: s._darken(s.newBlue, .35),
  24911. opacity: .5,
  24912. style: "ribbon",
  24913. height: .025,
  24914. ribbonWidth: .24,
  24915. outsideHeight: .5,
  24916. waypointRadius: .5,
  24917. waypointIndoorRadius: .24,
  24918. waypointPulse: 1e3,
  24919. typ: l.BLACK,
  24920. meshFree: r.valueFromHash("mf", 1),
  24921. mapGuides: r.valueFromHash("guides", !0),
  24922. fadeInTime: 400,
  24923. fadeOutTime: 300
  24924. },
  24925. warp: {
  24926. nearPanoDist: .1,
  24927. matchCam: !1,
  24928. blur: .33,
  24929. fastTime: 1500,
  24930. teleportTime: 1500,//瞬间过渡的时间
  24931. flytimeDistanceMultiplier:150,//add
  24932. flyTime:750,//add
  24933. outsideTime: 2e3,
  24934. lookAheadMax: .3,
  24935. lookAheadDist: 2.5,
  24936. softPushDist: .37,
  24937. softPushEnd: .3,
  24938. softBendAngle: 8,
  24939. softBendTilt: 4,
  24940. softBendEnd: .3,
  24941. doBurns: !0,
  24942. burnsAngle: 8,
  24943. minBurnsAngle: 35,
  24944. minDownAngle: -35,
  24945. maxTurnPerSec: 280,
  24946. maxAimPerSec: 35,
  24947. minRotation: 12,
  24948. maxAimRotation: 33.2,
  24949. turnFriction: .2,
  24950. flySpeed: .01,
  24951. minWarpTime: 1200,
  24952. warpInterruptionRedirectTime: 500,
  24953. tourStepDelay: r.valueFromHash("st", 0),
  24954. walkDelay: 0,
  24955. walkMaxDist: 50,
  24956. walkMinDist: .8,
  24957. walkSlideShowThreshhold: 3e3,
  24958. walkExtraPanosDistance: .4,
  24959. timePerMeter: 1200,
  24960. motionLeadTime: 5e3,
  24961. movementEasing: "easeInOutQuad",
  24962. blendEasing: "easeInOutQuad",
  24963. showBunny: !1,
  24964. loop: r.valueFromHash("lp", !1),
  24965. auto: r.valueFromHash("ts", -1),
  24966. eOrder: "YXZ",
  24967. stepFactor: .25,
  24968. brakeStrength: 2,
  24969. minBrakeAngle: .1,
  24970. maxBrakeAngle: 1.8,
  24971. climbEffort: 4
  24972. },
  24973. rotationFriction: .05,
  24974. rotationAccelerationInside: 4.5,
  24975. rotationAccelerationOutside: .15,
  24976. rotationAfterMoveMultiplier: 40,
  24977. rotationAfterMoveHistoryCount: 5,
  24978. panFriction: .09,
  24979. panAccelerationOutside: 60,
  24980. onload: r.valueFromHash("onload", o.PANORAMA),
  24981. zoomNearLimit: .1,
  24982. zoomFarLimit: 50,
  24983. navigation: {
  24984. panoScores: !1,
  24985. mouseDirection: !0,
  24986. filterStrictness: .75,
  24987. angleFactor: -30,
  24988. directionFactor: 10,
  24989. distanceFactor: -1,
  24990. optionalityFactor: 3
  24991. },
  24992. sdkInit: !1,
  24993. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  24994. console: r.valueFromHash("console", !1),
  24995. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  24996. panoramaNeighbourMaxDistance: 5,
  24997. panoFloorClickRadius: .35,
  24998. showScreenshotLocations: !1,
  24999. showAxis: !1,
  25000. showNeighbourRaycasts: !1,
  25001. colorMarkerOnLoad: !1,
  25002. colorMarkerByFloor: !1,
  25003. tiling: {
  25004. panoPreRenderRepeatDelay: 2500,
  25005. panoPreRenderDelay: 500,
  25006. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  25007. tilingFlagNames: ["usetiles", "tiles"],
  25008. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  25009. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  25010. overlayStyle: r.valueFromHash("tileoverlay", 0),
  25011. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  25012. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  25013. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  25014. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  25015. customCompression: r.valueFromHash("tilecustcomp", 0),
  25016. mobileHighQualityOverride: 1,
  25017. allowUltraHighResolution: !0
  25018. },
  25019. zoom: {
  25020. enabled: !0,
  25021. forceOff: r.valueFromHash("nozoom", 0),
  25022. overridemax: r.valueFromHash("maxzoom", null),
  25023. overridemin: r.valueFromHash("minzoom", null),
  25024. max: d.highQualityMaxZoom,
  25025. min: 1,
  25026. transitionStyle: r.valueFromHash("zoomtrans", 1),
  25027. activationThreshold: 1.1,
  25028. restoreTime: 500
  25029. },
  25030. profiling: {
  25031. enabled: r.valueFromHash("mem", !1)
  25032. }
  25033. };
  25034. (p = h.deepExtend(p, d, {
  25035. insideFOV: r.valueFromHash("fov", d.insideFOV),
  25036. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  25037. panorama: {
  25038. transitionTime: 1e3,
  25039. modelAlpha: 0,
  25040. modelAlphaDelay: p.flydown.modelTextureDelay,
  25041. modelAlphaLength: 1,
  25042. skyboxOpacity: 1,
  25043. skyboxOpacityDelay: p.flydown.skyboxDelay,
  25044. skyboxOpacityLength: .9,
  25045. fovLength: 1,
  25046. fovDelay: 0,
  25047. cameraMatrixDuration: .8,
  25048. cameraMatrixDelay: 0,
  25049. cameraMatrixEase: c.easeInCubic,
  25050. reticuleOpacity: 1,
  25051. markerOpacity: .3,
  25052. markerOpacityOnHover: 1
  25053. },
  25054. dollhouse: {
  25055. transitionTime: 1e3,
  25056. modelAlpha: 1,
  25057. modelAlphaDelay: 0,
  25058. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  25059. skyboxOpacity: 0,
  25060. skyboxOpacityDelay: 0,
  25061. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  25062. fovLength: 1,
  25063. fovDelay: 0,
  25064. cameraMatrixDuration: .8,
  25065. cameraMatrixDelay: .3,
  25066. cameraMatrixEase: c.easeInCubic,
  25067. reticuleOpacity: 1,
  25068. markerOpacity: 0,
  25069. markerOpacityOnHover: 0
  25070. },
  25071. floorplan: {
  25072. transitionTime: 1e3,
  25073. modelAlpha: 1,
  25074. modelAlphaDelay: 0,
  25075. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  25076. skyboxOpacity: 0,
  25077. skyboxOpacityDelay: 0,
  25078. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  25079. fovLength: 1,
  25080. fovDelay: 0,
  25081. cameraMatrixDuration: .5,
  25082. cameraMatrixDelay: 0,
  25083. cameraMatrixEase: c.easeOutCubic,
  25084. reticuleOpacity: 1,
  25085. markerOpacity: 0,
  25086. markerOpacityOnHover: 0,
  25087. cameraHeight: 50
  25088. },
  25089. transitioning: {
  25090. reticuleOpacity: 0,
  25091. markerOpacity: .3,
  25092. markerOpacityOnHover: 1
  25093. },
  25094. "floorplan-dollhouse": {
  25095. rotationDelay: 0,
  25096. rotationDuration: 1
  25097. },
  25098. "floorplan-panorama": {
  25099. rotationDelay: .5,
  25100. rotationDuration: 1
  25101. },
  25102. "dollhouse-panorama": {
  25103. rotationDelay: .5,
  25104. rotationDuration: 1
  25105. },
  25106. "dollhouse-floorplan": {
  25107. rotationDelay: 0,
  25108. rotationDuration: 1,
  25109. cameraMatrixDuration: 1.05,
  25110. cameraMatrixDelay: .5
  25111. },
  25112. "panorama-dollhouse": {
  25113. rotationDelay: 0,
  25114. rotationDuration: .5
  25115. },
  25116. "panorama-floorplan": {
  25117. transitionTime: 1500,
  25118. rotationDelay: 0,
  25119. rotationDuration: .5
  25120. }
  25121. })).path.meshFree && (p.path.typ = l.WALK),
  25122. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  25123. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  25124. window._settings = t.exports = p
  25125. }
  25126. , {
  25127. "./constants": 8,
  25128. "./enum/Colors": 19,
  25129. "./enum/VROption": 47,
  25130. "./enum/Viewmode": 51,
  25131. "./enum/WarpStyle": 52,
  25132. "./util/browser": 182,
  25133. "./util/common": 185,
  25134. "./util/easing": 186,
  25135. "./util/showcase": 193,
  25136. three: 217
  25137. }],
  25138. 167: [function(e, t, i) {
  25139. "use strict";
  25140. var n = e("three")
  25141. , r = e("./settings")
  25142. , 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"
  25143. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  25144. t.exports = {
  25145. basicTextured: {
  25146. uniforms: {
  25147. tDiffuse: {
  25148. type: "t",
  25149. value: null
  25150. },
  25151. alpha: {
  25152. type: "f",
  25153. value: 1
  25154. }
  25155. },
  25156. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25157. 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}"
  25158. },
  25159. copyCubeMap: {
  25160. uniforms: {
  25161. tDiffuse: {
  25162. type: "t",
  25163. value: null
  25164. },
  25165. alpha: {
  25166. type: "f",
  25167. value: 1
  25168. }
  25169. },
  25170. 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}",
  25171. 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}"
  25172. },
  25173. cube: {
  25174. uniforms: {
  25175. map: {
  25176. type: "t",
  25177. value: null
  25178. },
  25179. opacity: {
  25180. type: "f",
  25181. value: 1
  25182. }
  25183. },
  25184. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  25185. 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"
  25186. },
  25187. model: {
  25188. uniforms: {
  25189. map: {
  25190. type: "t",
  25191. value: null
  25192. },
  25193. modelAlpha: {
  25194. type: "f",
  25195. value: r.modelAlpha
  25196. },
  25197. opacity: {
  25198. type: "f",
  25199. value: 1
  25200. },
  25201. progress: {
  25202. type: "f",
  25203. value: 0
  25204. },
  25205. blackout: {
  25206. type: "i",
  25207. value: 0
  25208. },
  25209. pano0Map: {
  25210. type: "t",
  25211. value: null
  25212. },
  25213. pano0Position: {
  25214. type: "v3",
  25215. value: new n.Vector3
  25216. },
  25217. pano0Matrix: {
  25218. type: "m4",
  25219. value: new n.Matrix4
  25220. },
  25221. pano1Map: {
  25222. type: "t",
  25223. value: null
  25224. },
  25225. pano1Position: {
  25226. type: "v3",
  25227. value: new n.Vector3
  25228. },
  25229. pano1Matrix: {
  25230. type: "m4",
  25231. value: new n.Matrix4
  25232. }
  25233. },
  25234. /* vertexShader: o + "uniform vec3 pano0Position;\nuniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\nuniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\n\nvoid main() {\n\n vUv = uv;\n vec4 worldPosition = modelMatrix * vec4(position, 1.0);\n\n vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;\n vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;\n vWorldPosition0.x *= -1.0;\n\n vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;\n vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;\n vWorldPosition1.x *= -1.0;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25235. fragmentShader: a + "uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\nuniform float progress;\nuniform int blackout;\n\nuniform vec3 pano0Position;\nuniform samplerCube pano0Map;\n\nuniform vec3 pano1Position;\nuniform samplerCube pano1Map;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\n\nvoid main() {\n\tconst vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);\n\tconst vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);\n\n\tvec4 colorFromPanos;\n\tvec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);\n\tvec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);\n\n\tif (blackout == 0) {\n\t\tcolorFromPanos = mix(colorFromPano0, colorFromPano1, progress);\n\t} else if (blackout == 1) {\n\t\tcolorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));\n\t\tcolorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));\n\t} else if (blackout == 2) {\n\t\tcolorFromPanos = mix(colorFromPano0, BLACK, progress);\n\t} else if (blackout == 3) {\n\t\tcolorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));\n\t} \n\n\tvec4 colorFromTexture = texture2D( map, vUv );\n\tcolorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);\n\n\tfloat whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);\n\tcolorFromPanos = mix(colorFromPanos, GREY, whiteness);\n\tgl_FragColor = vec4(colorFromPanos.rgb, opacity);\n}\n"
  25236. */
  25237. vertexShader: o + `uniform vec3 pano0Position;
  25238. uniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\n
  25239. uniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\n
  25240. varying vec3 vWorldPosition0;
  25241. varying vec3 vWorldPosition1;
  25242. uniform int blackout;
  25243. void main() {
  25244. vUv = uv;
  25245. vec4 worldPosition = modelMatrix * vec4(position, 1.0);
  25246. vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;
  25247. vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;
  25248. vWorldPosition0.x *= -1.0;
  25249. vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;
  25250. vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;
  25251. vWorldPosition1.x *= -1.0;
  25252. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  25253. }`,
  25254. fragmentShader: a + `uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\n
  25255. 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
  25256. void main() {
  25257. const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);
  25258. const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);
  25259. vec4 colorFromPanos;
  25260. if (blackout == 5){//add for TransitionPass
  25261. colorFromPanos = textureCube( pano1Map, vWorldPosition1.xyz) ;
  25262. }else{
  25263. vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);
  25264. vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);
  25265. if (blackout == 0) {colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);}
  25266. else if (blackout == 1) {
  25267. colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));
  25268. colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));
  25269. }
  25270. else if (blackout == 2) {colorFromPanos = mix(colorFromPano0, BLACK, progress);}
  25271. else if (blackout == 3) {colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));}
  25272. }
  25273. vec4 colorFromTexture = texture2D( map, vUv );
  25274. colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);
  25275. float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);
  25276. colorFromPanos = mix(colorFromPanos, GREY, whiteness);
  25277. gl_FragColor = vec4(colorFromPanos.rgb, opacity);
  25278. }`
  25279. },
  25280. hot: {
  25281. uniforms: {
  25282. color: {
  25283. type: "c",
  25284. value: new n.Color(16720384)
  25285. },
  25286. opac: {
  25287. type: "f",
  25288. value: 0
  25289. },
  25290. texture1: {
  25291. type: "t",
  25292. value: null
  25293. },
  25294. texture2: {
  25295. type: "t",
  25296. value: null
  25297. }
  25298. },
  25299. vertexShader: "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25300. 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"
  25301. },
  25302. modelOutside: {
  25303. uniforms: {
  25304. map: {
  25305. type: "t",
  25306. value: null
  25307. },
  25308. opacity: {
  25309. type: "f",
  25310. value: 1
  25311. }
  25312. },
  25313. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25314. 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"
  25315. },
  25316. ribbon: {
  25317. uniforms: {
  25318. map: {
  25319. type: "t",
  25320. value: null
  25321. },
  25322. opacity: {
  25323. type: "f",
  25324. value: 1
  25325. },
  25326. color: {
  25327. type: "c",
  25328. value: new n.Color(r.path.color)
  25329. }
  25330. },
  25331. 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",
  25332. 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"
  25333. },
  25334. waypoint: {
  25335. uniforms: {
  25336. map: {
  25337. type: "t",
  25338. value: null
  25339. },
  25340. opacity: {
  25341. type: "f",
  25342. value: 1
  25343. },
  25344. pulse: {
  25345. type: "f",
  25346. value: 1
  25347. },
  25348. nearFade: {
  25349. type: "v2",
  25350. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  25351. },
  25352. color: {
  25353. type: "c",
  25354. value: new n.Color(r.reticuleColor)
  25355. }
  25356. },
  25357. 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",
  25358. 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"
  25359. },
  25360. modelDebug: {
  25361. uniforms: {
  25362. map: {
  25363. type: "t",
  25364. value: null
  25365. },
  25366. modelAlpha: {
  25367. type: "f",
  25368. value: r.modelAlpha
  25369. },
  25370. depthmapRatio: {
  25371. type: "f",
  25372. value: 0
  25373. },
  25374. opacity: {
  25375. type: "f",
  25376. value: 1
  25377. },
  25378. progress: {
  25379. type: "f",
  25380. value: 0
  25381. },
  25382. considerOcclusion: {
  25383. type: "i",
  25384. value: r.fancierTransition
  25385. },
  25386. highlightPanoSelection: {
  25387. type: "i",
  25388. value: 0
  25389. },
  25390. useThirdPano: {
  25391. type: "i",
  25392. value: r.useThirdPano
  25393. },
  25394. pano0Map: {
  25395. type: "t",
  25396. value: null
  25397. },
  25398. pano0Depth: {
  25399. type: "t",
  25400. value: null
  25401. },
  25402. pano0Position: {
  25403. type: "v3",
  25404. value: new n.Vector3
  25405. },
  25406. pano0Matrix: {
  25407. type: "m4",
  25408. value: new n.Matrix4
  25409. },
  25410. pano0Weight: {
  25411. type: "f",
  25412. value: r.transition.pano0Weight
  25413. },
  25414. pano1Map: {
  25415. type: "t",
  25416. value: null
  25417. },
  25418. pano1Depth: {
  25419. type: "t",
  25420. value: null
  25421. },
  25422. pano1Position: {
  25423. type: "v3",
  25424. value: new n.Vector3
  25425. },
  25426. pano1Matrix: {
  25427. type: "m4",
  25428. value: new n.Matrix4
  25429. },
  25430. pano1Weight: {
  25431. type: "f",
  25432. value: r.transition.pano1Weight
  25433. },
  25434. pano2Map: {
  25435. type: "t",
  25436. value: null
  25437. },
  25438. pano2Depth: {
  25439. type: "t",
  25440. value: null
  25441. },
  25442. pano2Position: {
  25443. type: "v3",
  25444. value: new n.Vector3
  25445. },
  25446. pano2Matrix: {
  25447. type: "m4",
  25448. value: new n.Matrix4
  25449. },
  25450. pano2Weight: {
  25451. type: "f",
  25452. value: r.transition.pano2Weight
  25453. }
  25454. },
  25455. 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",
  25456. 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"
  25457. },
  25458. customDepth: {
  25459. uniforms: {
  25460. panoPosition: {
  25461. type: "v3",
  25462. value: new n.Vector3
  25463. }
  25464. },
  25465. 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",
  25466. 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"
  25467. },
  25468. skysphere: {
  25469. uniforms: {
  25470. radius: {
  25471. type: "f",
  25472. value: 0
  25473. }
  25474. },
  25475. 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",
  25476. 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"
  25477. },
  25478. tagDisc: {
  25479. uniforms: {
  25480. opacity: {
  25481. type: "f",
  25482. value: 0
  25483. },
  25484. color: {
  25485. type: "c",
  25486. value: new n.Color
  25487. },
  25488. bg: {
  25489. type: "t",
  25490. value: null
  25491. },
  25492. mask: {
  25493. type: "t",
  25494. value: null
  25495. }
  25496. },
  25497. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25498. 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"
  25499. }
  25500. }
  25501. window.shaders = t.exports;
  25502. }
  25503. , {
  25504. "./settings": 166,
  25505. three: 217
  25506. }],
  25507. 168: [function(E, _, e) {
  25508. (function(e) {
  25509. "use strict";
  25510. var t = E("three")
  25511. , i = (E("url"),
  25512. E("./util/ajax"))
  25513. , n = E("./settings")
  25514. , r = E("./util/logger")
  25515. , o = E("./util/math")
  25516. , a = E("./util/showcase")
  25517. , s = E("./objects/Panorama")
  25518. , l = new r(e)
  25519. , c = E("./model/Model")
  25520. , h = E("./shaders")
  25521. , u = E("./util/transitions")
  25522. , d = E("./objects/Chunk")
  25523. , p = E("./objects/Reticule")
  25524. , f = E("./objects/Skybox")
  25525. , g = E("./objects/Floor")
  25526. , m = E("./cameras/DollhouseCamera")
  25527. , v = E("./cameras/FloorplanCamera")
  25528. , y = E("./cameras/PanoramaCamera")
  25529. , A = E("./controls/DollhouseControls")
  25530. , C = E("./controls/FloorplanControls")
  25531. , I = E("./controls/PanoramaControls");
  25532. t.ImageUtils.crossOrigin = n.crossOrigin,
  25533. _.exports = {
  25534. shaders: h,
  25535. transitions: u,
  25536. Model: c,
  25537. Chunk: d,
  25538. Floor: g,
  25539. Skybox: f,
  25540. Reticule: p,
  25541. Panorama: s,
  25542. DollhouseCamera: m,
  25543. FloorplanCamera: v,
  25544. PanoramaCamera: y,
  25545. DollhouseControls: A,
  25546. FloorplanControls: C,
  25547. PanoramaControls: I,
  25548. getModel: function(e) {
  25549. if (!e.url)
  25550. throw 'getModel(): missing parameter "url"';
  25551. e.autoload = void 0 === e.autoload || e.autoload;
  25552. var t = a.parseSidUrl(e.url);
  25553. e.urlBase = t.urlBase,
  25554. e.urlModel = /* 'data/1081/', */ t.urlModel,
  25555. e.urlFiles = t.urlFiles;
  25556. var i = this._getPlatformError();
  25557. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  25558. this._loadModel().then(this._buildModel.bind(this)))
  25559. },
  25560. _getPlatformError: function() {
  25561. 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"
  25562. },
  25563. _loadModel: function() {
  25564. return i.get(this.options.urlModel, {
  25565. responseType: "json",
  25566. prefetchFrom: "model",
  25567. auth: a.getAuthorizationHeader()
  25568. }).then(null, function() {
  25569. return l.warn("Model loading failed at initial metadata load"),
  25570. "loading-failed"
  25571. })
  25572. },
  25573. _buildModel: function(e) {
  25574. e = a.normalizeModeldata(e, o);
  25575. var t = new c(this.options,e);
  25576. return this.options.autoload ? t.load(!0) : $.when(t)
  25577. }
  25578. }
  25579. }
  25580. ).call(this, "/js/showcase.js")
  25581. }
  25582. , {
  25583. "./cameras/DollhouseCamera": 5,
  25584. "./cameras/FloorplanCamera": 6,
  25585. "./cameras/PanoramaCamera": 7,
  25586. "./controls/DollhouseControls": 10,
  25587. "./controls/FloorplanControls": 11,
  25588. "./controls/PanoramaControls": 13,
  25589. "./model/Model": 139,
  25590. "./objects/Chunk": 144,
  25591. "./objects/Floor": 146,
  25592. "./objects/Panorama": 148,
  25593. "./objects/Reticule": 149,
  25594. "./objects/Skybox": 152,
  25595. "./settings": 166,
  25596. "./shaders": 167,
  25597. "./util/ajax": 181,
  25598. "./util/logger": 189,
  25599. "./util/math": 190,
  25600. "./util/showcase": 193,
  25601. "./util/transitions": 195,
  25602. three: 217,
  25603. url: 208
  25604. }],
  25605. 169: [function(e, t, i) {
  25606. "use strict";
  25607. function l(e) {
  25608. var t = {
  25609. renderTarget: null,
  25610. inUse: !1,
  25611. size: -1,
  25612. pano: null
  25613. };
  25614. return t.inUse = !0,
  25615. t.size = e,
  25616. function(e) {
  25617. O.push(e)
  25618. }(t),
  25619. t
  25620. }
  25621. function c(e) {
  25622. for (var t = 0; t < O.length; t++) {
  25623. var i = O[t];
  25624. if (i.renderTarget === e)
  25625. return !(i.inUse = !1)
  25626. }
  25627. return !1
  25628. }
  25629. function n() {
  25630. this.tileDirectory = {},
  25631. this.activeRenderTargetDescriptors = {},
  25632. this.activePanos = [],
  25633. this.panoLODDescriptors = {},
  25634. this.panoDescriptors = {},
  25635. this.tileTrees = {},
  25636. this.sceneRenderer = null,
  25637. this.tileDownloader = null,
  25638. this.forceQueue = [],
  25639. this.uploadQueues = {},
  25640. this.uploadInterval = null,
  25641. this.uploadIntervalCancelled = !1,
  25642. this.usingTileOverlay = !1,
  25643. this.overlayTilesLoaded = !1,
  25644. this.overlayTileBase = null,
  25645. this.overlayTilesBasic = {},
  25646. this.overlayTilesEnhanced = {},
  25647. this.zoomRenderTarget = null,
  25648. this.zoomPano = null,
  25649. this.zoomingActive = !1,
  25650. this.zoomPanoId = null,
  25651. this.zoomPanoRenderingDisabled = !1,
  25652. this.direction = new _.Vector3,
  25653. this.initTime = -1,
  25654. this.maxBaseUploadsPerFrame = R,
  25655. this.maxNonBaseUploadsPerFrame = M
  25656. }
  25657. var I, E, r, o, a, h, s, _ = e("three"), u = e("../exception/BasicException"), d = e("../settings"), p = e("../enum/PanoSizeClass"), b = (e("../objects/Panorama"),
  25658. e("../enum/PanoRendererEvents")), f = e("../enum/SceneRendererEvents"), g = e("../enum/TileDownloaderEvents"), m = e("../enum/Vectors"), v = (e("../enum/GLCubeFaces"),
  25659. e("../objects/Panorama"),
  25660. e("./TileTree")), y = (e("./TileDownloader"),
  25661. e("./TilePrioritizer")), A = e("./TileUtils"), C = (p = e("../enum/PanoSizeClass"),
  25662. e("../util/browser"),
  25663. e("../util/panorama")), w = e("events").EventEmitter, T = !1, x = d.tiling.uploadIntervalDelay, S = d.tiling.initialIntervalDelay, M = d.tiling.maxNonBaseUploadsPerFrame, R = d.tiling.maxBaseUploadsPerFrame, P = {
  25664. Base: 0,
  25665. Remaining: 1
  25666. }, O = [];
  25667. function L(e) {
  25668. var t = e.shift();
  25669. return t.uploadQueued = !1,
  25670. t
  25671. }
  25672. (n.prototype = Object.create(w.prototype)).init = function(e, t, i) {
  25673. this.sceneRenderer = e,
  25674. this.tileDownloader = t,
  25675. this.qualityManager = i,
  25676. this.bindEvents(),
  25677. this.sceneRenderer.on(f.ContextCreated, this.loadOverlayTiles.bind(this)),
  25678. this.initTime = performance.now()
  25679. }
  25680. ,
  25681. n.prototype.getActivePanoTextures = function(e) {
  25682. e = e || [];
  25683. for (var t = 0; t < O.length; t++) {
  25684. var i = O[t];
  25685. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  25686. }
  25687. }
  25688. ,
  25689. n.prototype.hasQueuedTiles = function() {
  25690. var e = this.peekNextFromUploadQueue();
  25691. return null != e
  25692. }
  25693. ,
  25694. n.prototype.getActiveRenderTargetDescriptor = function(e) {
  25695. return this.activeRenderTargetDescriptors[e]
  25696. }
  25697. ,
  25698. n.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  25699. this.activeRenderTargetDescriptors[e] = t
  25700. }
  25701. ,
  25702. n.prototype.loadOverlayTiles = function() {
  25703. if (0 !== d.tiling.overlayStyle) {
  25704. var n = 0
  25705. , e = function(e, t, i) {
  25706. e = t ? e[t] = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping),
  25707. this.sceneRenderer.uploadTexture2D(i, e, 0, 0, A.TILE_SIZE, A.TILE_SIZE),
  25708. ++n === r.length && (this.overlayTilesLoaded = !0)
  25709. }
  25710. .bind(this)
  25711. , r = [["images/outlineBase.png", e.bind(this, this.overlayTileBase, null)], ["images/outlineBasic512.png", e.bind(this, this.overlayTilesBasic, 256)], ["images/outlineBasic512.png", e.bind(this, this.overlayTilesBasic, 512)], ["images/outlineBasic1024.png", e.bind(this, this.overlayTilesBasic, 1024)], ["images/outlineBasic2048.png", e.bind(this, this.overlayTilesBasic, 2048)], ["images/outlineBasic4096.png", e.bind(this, this.overlayTilesBasic, 4096)], ["images/outlineEnhanced512.png", e.bind(this, this.overlayTilesEnhanced, 256)], ["images/outlineEnhanced512.png", e.bind(this, this.overlayTilesEnhanced, 512)], ["images/outlineEnhanced1024.png", e.bind(this, this.overlayTilesEnhanced, 1024)], ["images/outlineEnhanced2048.png", e.bind(this, this.overlayTilesEnhanced, 2048)], ["images/outlineEnhanced4096.png", e.bind(this, this.overlayTilesEnhanced, 4096)]];
  25712. r.forEach(function(e) {
  25713. this.tileDownloader.loadImage(e[0], 0, e[1])
  25714. }
  25715. .bind(this)),
  25716. this.usingTileOverlay = !0
  25717. } else
  25718. this.usingTileOverlay = !1
  25719. }
  25720. ,
  25721. n.prototype.bindEvents = function() {
  25722. this.tileDownloader.on(g.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  25723. }
  25724. ,
  25725. n.prototype.setupZoomRenderTarget = function() {
  25726. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  25727. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  25728. return;
  25729. var e = this.zoomRenderTarget;
  25730. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  25731. e) {
  25732. var t = e.width
  25733. , i = this.zoomRenderTarget.width;
  25734. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  25735. e.texture.dispose(),
  25736. e.texture.loaded = !1,
  25737. e.texture.version = 0,
  25738. this.sceneRenderer.deallocateCubeTexture(e.texture),
  25739. e.texture = null
  25740. }
  25741. this.zoomPanoRenderingDisabled = !1
  25742. } else
  25743. this.zoomPanoRenderingDisabled = !0
  25744. }
  25745. ,
  25746. n.prototype.enableUltraHighQualityMode = function(t) {
  25747. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  25748. var e = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  25749. this.tileDownloader.testDownload(e, A.TILE_SIZE, function(e) {
  25750. e && (this.qualityManager.enableUltraHighQualityMode(),
  25751. this.setupZoomRenderTarget(),
  25752. t())
  25753. }
  25754. .bind(this))
  25755. }
  25756. }
  25757. ,
  25758. n.prototype.activateTiledPano = function(e, t, i) {
  25759. i && this.clearAllQueuedUploads();
  25760. for (var n = 0; n < A.FACES_PER_PANO; n++)
  25761. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  25762. this.linkAllTilesAndNodes(e);
  25763. var r = this.getActiveRenderTargetDescriptor(e.id)
  25764. , o = t;
  25765. if (o > this.qualityManager.getMaxNavPanoSize() && (o = this.qualityManager.getMaxNavPanoSize()),
  25766. !r || o !== r.size) {
  25767. if (r && c(r.renderTarget),
  25768. !(r = function(e) {
  25769. for (var t = 0; t < O.length; t++) {
  25770. var i = O[t];
  25771. if (!i.inUse && i.size === e)
  25772. return i.inUse = !0,
  25773. i
  25774. }
  25775. return null
  25776. }(o))) {
  25777. var a = this.initTiledPano(o, !1);
  25778. (r = l(a.width)).renderTarget = a
  25779. }
  25780. r.pano = e,
  25781. this.resetPanoDescriptor(e.id),
  25782. this.resetPanoLODDescriptors(e.id),
  25783. this.resetRenderStatus(e.id, !0, !0)
  25784. }
  25785. this.setActiveRenderTargetDescriptor(e.id, r);
  25786. var s = i ? 0 : 1;
  25787. return this.updateActivePanos(e, s),
  25788. r.renderTarget
  25789. }
  25790. ,
  25791. n.prototype.deactivateTiledPano = function(e) {
  25792. var t = this.getActiveRenderTargetDescriptor(e.id);
  25793. this.isRenderTargetDescriptorValid(t) && c(t.renderTarget),
  25794. this.setActiveRenderTargetDescriptor(e.id, null);
  25795. var i = this.getUploadQueueForPano(e.id);
  25796. this.clearUploadQueue(i),
  25797. this.updateActivePanos()
  25798. }
  25799. ,
  25800. n.prototype.updateActivePanos = (s = [],
  25801. function(e, t) {
  25802. for (var i = s.length = 0; i < this.activePanos.length; i++) {
  25803. e && s.length === t && s.push(e);
  25804. var n = this.activePanos[i]
  25805. , r = this.getActiveRenderTargetDescriptor(n.id);
  25806. e && n.id === e.id || !this.isRenderTargetDescriptorValid(r) || s.push(n)
  25807. }
  25808. e && t >= s.length && s.push(e),
  25809. this.activePanos.length = 0,
  25810. this.activePanos.push.apply(this.activePanos, s)
  25811. }
  25812. ),
  25813. n.prototype.getActivePanoCount = function() {
  25814. return this.activePanos.length
  25815. }
  25816. ,
  25817. n.prototype.resetRenderStatus = function(e, r, o, t) {
  25818. var i = null;
  25819. t && (i = v.getLevelCountForSize(A.TILE_SIZE, t) + 1);
  25820. for (var n = function(e, t, i, n) {
  25821. o && (t.tile.zoomUploaded = !1),
  25822. r && (t.tile.uploaded = !1)
  25823. }, a = 0; a < A.FACES_PER_PANO; a++) {
  25824. this.getTileTree(e, a).breadthFirst({
  25825. callback: n.bind(this, a),
  25826. minLevel: i
  25827. })
  25828. }
  25829. }
  25830. ,
  25831. n.prototype.copyBaseRenderStatusToZoomed = function(e) {
  25832. for (var t = v.getLevelCountForSize(A.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  25833. t.tile.zoomUploaded = t.tile.uploaded,
  25834. t.zoomCovered = t.covered
  25835. }, n = 0; n < A.FACES_PER_PANO; n++) {
  25836. this.getTileTree(e, n).breadthFirst({
  25837. callback: i.bind(this, n),
  25838. maxLevel: t
  25839. })
  25840. }
  25841. }
  25842. ,
  25843. n.prototype.renderPanoTiles = (h = [],
  25844. function(e, t, i, n) {
  25845. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  25846. t = t || this.direction || m.FORWARD;
  25847. var r = this.getActiveRenderTargetDescriptor(e);
  25848. if (!this.isRenderTargetDescriptorValid(r))
  25849. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  25850. for (var o = 0; o < A.FACES_PER_PANO; o++) {
  25851. var a = this.getTileTree(e, o);
  25852. h.length = 0,
  25853. a.breadthFirst({
  25854. saveVisited: h
  25855. });
  25856. for (var s = 0; s < h.length; s++) {
  25857. var l = h[s];
  25858. this.queueTileUpload(l.tile, !1, n || 0 === s && i)
  25859. }
  25860. }
  25861. this.updateDirection(t)
  25862. }
  25863. ),
  25864. n.prototype.isRenderTargetDescriptorValid = function(e) {
  25865. return e && e.renderTarget
  25866. }
  25867. ,
  25868. n.prototype.isPanoActive = function(e) {
  25869. var t = this.getActiveRenderTargetDescriptor(e);
  25870. return this.isRenderTargetDescriptorValid(t)
  25871. }
  25872. ,
  25873. n.prototype.isPanoZoomed = function(e) {
  25874. return this.zoomingActive && this.zoomPanoId === e
  25875. }
  25876. ,
  25877. n.prototype.initTileTree = function(e, t, i) {
  25878. var n = this.tileTrees[e];
  25879. n || (n = [],
  25880. this.tileTrees[e] = n);
  25881. var r = n[t];
  25882. if (!r) {
  25883. var o = v.getLevelCountForSize(A.TILE_SIZE, i);
  25884. r = new v(A.TILE_SIZE,o),
  25885. n[t] = r
  25886. }
  25887. }
  25888. ,
  25889. n.prototype.getTileTree = function(e, t) {
  25890. var i = this.tileTrees[e];
  25891. if (!i)
  25892. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  25893. var n = i[t];
  25894. if (!n)
  25895. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  25896. return n
  25897. }
  25898. ,
  25899. n.prototype.initTiledPano = function(e, t) {
  25900. var i = this.sceneRenderer.renderer
  25901. , n = (i.context,
  25902. new _.WebGLRenderTargetCube(e,e,{
  25903. stencilBuffer: !1
  25904. }))
  25905. , r = new _.CubeTexture([]);
  25906. (n.texture = r).image = [null, null, null, null, null, null],
  25907. r.flipY = !0,
  25908. t ? (r.generateMipmaps = !0,
  25909. r.magFilter = _.LinearFilter,
  25910. r.minFilter = _.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  25911. r.magFilter = _.LinearFilter,
  25912. r.minFilter = _.LinearFilter),
  25913. r.format = _.RGBAFormat,
  25914. i.setRenderTarget(n),
  25915. i.setRenderTarget(null);
  25916. var o = i.properties.get(r);
  25917. return o.__image__webglTextureCube = o.__webglTexture,
  25918. n
  25919. }
  25920. ,
  25921. n.prototype.getUploadQueueForPano = function(e) {
  25922. var t = this.uploadQueues[e];
  25923. return t || (t = [],
  25924. this.uploadQueues[e] = t),
  25925. t
  25926. }
  25927. ,
  25928. n.prototype.isTileUploaded = function(e) {
  25929. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  25930. }
  25931. ,
  25932. n.prototype.setUploaded = function(e, t) {
  25933. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  25934. }
  25935. ,
  25936. n.prototype.queueTileUpload = function(e, t, i) {
  25937. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  25938. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  25939. var r = this.getUploadQueueForPano(e.panoId);
  25940. 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),
  25941. e.uploadQueued = !0,
  25942. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  25943. }
  25944. }
  25945. ,
  25946. n.prototype.shoulPushToFrontOfQueue = function(e) {
  25947. return 0 === v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25948. }
  25949. ,
  25950. n.prototype.getTopUploadQueue = function() {
  25951. for (var e = null, t = null, i = P.Base; i <= P.Remaining; i++)
  25952. for (var n = 0; n < this.activePanos.length; n++)
  25953. if (e = this.activePanos[n],
  25954. 0 < (t = this.getUploadQueueForPano(e.id)).length)
  25955. switch (i) {
  25956. case P.Base:
  25957. if (0 === t[0].level)
  25958. return t;
  25959. break;
  25960. case P.Remaining:
  25961. return t
  25962. }
  25963. return null
  25964. }
  25965. ,
  25966. n.prototype.getNextFromUploadQueue = function() {
  25967. if (0 < this.forceQueue.length)
  25968. return L(this.forceQueue);
  25969. var e = this.getTopUploadQueue();
  25970. return e && 0 < e.length ? L(e) : null
  25971. }
  25972. ,
  25973. n.prototype.peekNextFromUploadQueue = function() {
  25974. if (0 < this.forceQueue.length)
  25975. return this.forceQueue[0];
  25976. var e = this.getTopUploadQueue();
  25977. return e && 0 < e.length ? e[0] : null
  25978. }
  25979. ,
  25980. n.prototype.clearAllQueuedUploads = function() {
  25981. this.clearAllUploadQueues(null, 0)
  25982. }
  25983. ,
  25984. n.prototype.clearAllQueuedUploadsForPano = function(e) {
  25985. this.clearAllUploadQueues(e, 0)
  25986. }
  25987. ,
  25988. n.prototype.clearAllUploadQueues = function(e, t) {
  25989. if (e)
  25990. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  25991. this.clearUploadQueue(this.forceQueue, t, e);
  25992. else {
  25993. for (var i = 0; i < this.activePanos.length; i++) {
  25994. var n = this.activePanos[i];
  25995. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  25996. }
  25997. this.clearUploadQueue(this.forceQueue, t)
  25998. }
  25999. }
  26000. ,
  26001. n.prototype.clearUploadQueue = function(e, t, i) {
  26002. null != t || (t = 0);
  26003. for (var n = 0; n < e.length; ) {
  26004. var r = e[n];
  26005. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  26006. e.splice(n, 1)) : n++
  26007. }
  26008. }
  26009. ,
  26010. n.prototype.refreshUploadInterval = (a = null,
  26011. function(e) {
  26012. this.uploadIntervalCancelled || (a = a || function() {
  26013. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (T = !0,
  26014. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  26015. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(x) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  26016. }
  26017. .bind(this),
  26018. null != e || (e = x),
  26019. T || (e = S),
  26020. this.uploadInterval = window.setTimeout(a, e),
  26021. this.uploadIntervalDelay = e)
  26022. }
  26023. ),
  26024. n.prototype.update = (r = performance.now(),
  26025. o = 0,
  26026. function() {
  26027. this.uploadIntervalCancelled = !0,
  26028. window.clearTimeout(this.uploadInterval),
  26029. this.uploadInterval = null;
  26030. var e = performance.now() - r;
  26031. !(x < e || 0 === o) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  26032. r = performance.now()),
  26033. o++
  26034. }
  26035. ),
  26036. n.prototype.updateUploadQueue = function(e, t) {
  26037. e = e || 1;
  26038. for (var i = 0, n = 0; !(t <= n || e <= i); ) {
  26039. var r = this.getNextFromUploadQueue();
  26040. if (!r)
  26041. break;
  26042. if (0 !== r.level ? i++ : n++,
  26043. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  26044. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  26045. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  26046. }
  26047. }
  26048. }
  26049. ,
  26050. n.prototype.updateDirection = function(e) {
  26051. if (e = e || this.direction) {
  26052. this.direction = e;
  26053. for (var t = 0; t < this.activePanos.length; t++) {
  26054. var i = this.activePanos[t]
  26055. , n = this.getUploadQueueForPano(i.id);
  26056. y.sortPanoTiles(n, i, this.direction)
  26057. }
  26058. }
  26059. }
  26060. ,
  26061. n.prototype.uploadTile = (I = {},
  26062. new _.Vector4,
  26063. E = d.tiling.overlayStyle,
  26064. function(e, t) {
  26065. var i = e.panoId
  26066. , n = e.image
  26067. , r = e.tileSize
  26068. , o = e.panoSize
  26069. , a = e.tileIndex
  26070. , s = (e.faceTileIndex,
  26071. e.totalTiles)
  26072. , l = (e.face,
  26073. e.tileX)
  26074. , c = e.tileY
  26075. , h = !0
  26076. , u = !1
  26077. , d = (this.getPanoDescriptor(i),
  26078. this.getPanoLODDescriptor(i, o))
  26079. , p = this.getActiveRenderTargetDescriptor(i)
  26080. , f = p.renderTarget
  26081. , g = p.size;
  26082. if (this.isPanoZoomed(i) && (f = this.zoomRenderTarget,
  26083. g = this.qualityManager.getMaxZoomPanoSize()),
  26084. this.isRenderTargetDescriptorValid(p) || (u = h = !1),
  26085. t || (this.anyUploaded(e.node) && (u = !(h = !1)),
  26086. this.isTileUploaded(e) && (u = h = !1)),
  26087. h) {
  26088. var m = r / o * g
  26089. , v = l * r / o * g
  26090. , y = c * r / o * g;
  26091. I[r] || (I[r] = this.sceneRenderer.initSizedTexture2D(r, _.ClampToEdgeWrapping));
  26092. var A = I[r];
  26093. if (this.sceneRenderer.uploadTexture2D(n, A, 0, 0, r, r),
  26094. 1 === E || 2 === E) {
  26095. var C = 1 === E ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  26096. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace),
  26097. this.sceneRenderer.renderToCubeMap(C[o], f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace, _.NormalBlending, !0, .5)
  26098. } else
  26099. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace);
  26100. d.uploadCount++,
  26101. this.emit(b.TileRenderSuccess, i, o, a, s),
  26102. d.uploadCount === s && this.emit(b.PanoRenderComplete, i, o, s),
  26103. this.setUploaded(e, !0),
  26104. this.addCoverageForNode(e.node)
  26105. } else
  26106. this.setUploaded(e, !1);
  26107. return e.uploadAttempted || (d.uploadAttempts++,
  26108. this.emit(b.TileUploadAttempted, i, o, a, s)),
  26109. e.uploadAttempted = !0,
  26110. d.uploadAttempts === s && this.emit(b.UploadAttemptedForAllTiles, i, o, s),
  26111. u
  26112. }
  26113. ),
  26114. n.prototype.linkTileAndNode = function(e, t) {
  26115. (t.tile = e).node = t
  26116. }
  26117. ,
  26118. n.prototype.linkAllTilesAndNodes = function(a) {
  26119. for (var e = function(e, t, i, n, r) {
  26120. var o = this.getTileDirectoryEntry(a.id, t, n, r);
  26121. this.linkTileAndNode(o, i)
  26122. }, t = 0; t < A.FACES_PER_PANO; t++) {
  26123. var i = this.getTileTree(a.id, t);
  26124. i.breadthFirst({
  26125. callback: e.bind(this, i, t)
  26126. })
  26127. }
  26128. }
  26129. ,
  26130. n.prototype.anyUploaded = function(e) {
  26131. if (!e)
  26132. return !1;
  26133. if (e.tile && this.isTileUploaded(e.tile))
  26134. return !0;
  26135. if (e.children)
  26136. for (var t = 0; t < e.children.length; t++) {
  26137. var i = e.children[t];
  26138. if (this.anyUploaded(i))
  26139. return !0
  26140. }
  26141. return !1
  26142. }
  26143. ,
  26144. n.prototype.setNodeCovered = function(e, t) {
  26145. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  26146. }
  26147. ,
  26148. n.prototype.isNodeCovered = function(e) {
  26149. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  26150. }
  26151. ,
  26152. n.prototype.addCoverageForNode = function(e) {
  26153. if (this.setNodeCovered(e, !0),
  26154. e.parent && e.covered) {
  26155. var t = e.parent;
  26156. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  26157. }
  26158. }
  26159. ,
  26160. n.prototype.calcFullCoverage = function(e) {
  26161. var t = !1;
  26162. if (e.children)
  26163. for (var i = 0; i < e.children.length; i++) {
  26164. var n = e.children[i];
  26165. t = t || this.calcFullCoverage(n)
  26166. }
  26167. e.covered = e.tile.uploaded || t
  26168. }
  26169. ,
  26170. n.prototype.nodeSubcovered = function(e) {
  26171. if (!e.children)
  26172. return !1;
  26173. for (var t = 0; t < e.children.length; t++)
  26174. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  26175. return !1;
  26176. return !0
  26177. }
  26178. ,
  26179. n.prototype.resetPanoDescriptor = function(e) {
  26180. this.getPanoDescriptor(e)
  26181. }
  26182. ,
  26183. n.prototype.getPanoDescriptor = function(e) {
  26184. var t = this.panoDescriptors[e];
  26185. return t || (t = {},
  26186. this.panoDescriptors[e] = t),
  26187. t
  26188. }
  26189. ,
  26190. n.prototype.resetPanoLODDescriptors = function(e) {
  26191. var t = this.getPanoLODDescriptors(e);
  26192. for (var i in t)
  26193. if (t.hasOwnProperty(i)) {
  26194. var n = t[i];
  26195. n.uploadCount = 0,
  26196. n.uploadAttempts = 0
  26197. }
  26198. }
  26199. ,
  26200. n.prototype.getPanoLODDescriptor = function(e, t) {
  26201. var i = this.getPanoLODDescriptors(e)
  26202. , n = i[t];
  26203. return n || (n = {
  26204. uploadCount: 0,
  26205. uploadAttempts: 0
  26206. },
  26207. i[t] = n),
  26208. n
  26209. }
  26210. ,
  26211. n.prototype.getPanoLODDescriptors = function(e) {
  26212. var t = this.panoLODDescriptors[e];
  26213. return t || (t = {},
  26214. this.panoLODDescriptors[e] = t),
  26215. t
  26216. }
  26217. ,
  26218. n.prototype.onTileDownloaded = function(e) {
  26219. var t = v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  26220. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  26221. if (i.downloaded = !0,
  26222. i.image = e.image,
  26223. i.panoSize = e.panoSize,
  26224. i.tileX = e.tileX,
  26225. i.tileY = e.tileY,
  26226. i.totalTiles = e.totalTiles,
  26227. i.tileIndex = e.tileIndex,
  26228. i.faceTileIndex = e.faceTileIndex,
  26229. i.face = e.face,
  26230. i.cubeFace = C.mapFaceToCubemapFace(e.face),
  26231. i.panoId = e.panoId,
  26232. i.tileSize = e.tileSize,
  26233. i.direction = (new _.Vector3).copy(e.direction),
  26234. i.node = null,
  26235. i.level = v.getLevelCountForSize(A.TILE_SIZE, i.panoSize),
  26236. this.isPanoActive(i.panoId)) {
  26237. var n = this.getTileTree(i.panoId, i.face).getSubNode(i.panoSize, i.tileX, i.tileY);
  26238. this.linkTileAndNode(i, n),
  26239. this.queueTileUpload(i, !0)
  26240. }
  26241. }
  26242. ,
  26243. n.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  26244. var r = this.tileDirectory[e];
  26245. r || (r = {},
  26246. this.tileDirectory[e] = r);
  26247. var o = 16384 * t + 1024 * i + n
  26248. , a = r[o];
  26249. return a || (a = {
  26250. downloaded: !1,
  26251. uploaded: !1,
  26252. zoomUploaded: !1
  26253. },
  26254. r[o] = a),
  26255. a._key = e + ":" + t + ":" + i + ":" + n,
  26256. a._tileKey = o,
  26257. a
  26258. }
  26259. ,
  26260. n.prototype.setZoomingActive = function(e, t, i) {
  26261. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  26262. this.zoomPanoId = t.id,
  26263. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  26264. }
  26265. ,
  26266. n.prototype.updateZoomedPanoFromBase = function(e) {
  26267. if (!this.zoomPanoRenderingDisabled) {
  26268. var t = this.getActiveRenderTargetDescriptor(e.id);
  26269. if (t && t.renderTarget) {
  26270. var i = this.qualityManager.getMaxZoomPanoSize()
  26271. , n = t.renderTarget
  26272. , r = t.size;
  26273. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  26274. this.copyBaseRenderStatusToZoomed(e.id)
  26275. }
  26276. }
  26277. }
  26278. ,
  26279. t.exports = n
  26280. }
  26281. , {
  26282. "../enum/GLCubeFaces": 25,
  26283. "../enum/PanoRendererEvents": 35,
  26284. "../enum/PanoSizeClass": 36,
  26285. "../enum/SceneRendererEvents": 43,
  26286. "../enum/TileDownloaderEvents": 45,
  26287. "../enum/Vectors": 50,
  26288. "../exception/BasicException": 55,
  26289. "../objects/Panorama": 148,
  26290. "../settings": 166,
  26291. "../util/browser": 182,
  26292. "../util/panorama": 191,
  26293. "./TileDownloader": 171,
  26294. "./TilePrioritizer": 172,
  26295. "./TileTree": 173,
  26296. "./TileUtils": 174,
  26297. events: 202,
  26298. three: 217
  26299. }],
  26300. 170: [function(e, t, i) {
  26301. "use strict";
  26302. function n(e, t, i) {
  26303. this.maxNavPanoSize = -1,
  26304. this.maxZoomPanoSize = -1,
  26305. this.devicePixelDensity = e,
  26306. this.deviceScreenSize = t,
  26307. this.clientBandwidth = i,
  26308. this.panoSizeClassMap = {},
  26309. this.useHighResolutionPanos = !0,
  26310. this.useUltraHighResolutionPanos = !1,
  26311. this.modelHasUltraHighPanos = !1
  26312. this.maxRenderTargetSize = Math.min( common.getMaxCubemapSize(), this.maxRenderTargetSize)//add
  26313. }
  26314. var r = e("../enum/PanoSizeClass")
  26315. , o = e("../settings")
  26316. , a = e("../util/browser")
  26317. , s = e("../constants")
  26318. , l = e("../util/showcase")
  26319. , c = e("../enum/ModelManagerEvents");
  26320. n.prototype.init = function(e) {
  26321. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  26322. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  26323. this.highSize = this.getPanoSize(r.HIGH),
  26324. this.standardSize = this.getPanoSize(r.STANDARD),
  26325. this.baseSize = this.getPanoSize(r.BASE),
  26326. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  26327. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  26328. this.updateMaximums(),
  26329. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  26330. }
  26331. ,
  26332. n.prototype.updateFromModel = function(e) {
  26333. this.updateHighResolutionSettings(e),
  26334. this.updateUltraHighResolutionSettings(e)
  26335. }
  26336. ,
  26337. n.prototype.updateHighResolutionSettings = function(e) {
  26338. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  26339. this.updateMaximums()
  26340. }
  26341. ,
  26342. n.prototype.updateUltraHighResolutionSettings = function(e) {
  26343. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  26344. this.updateMaximums()
  26345. }
  26346. ,
  26347. n.prototype.enableUltraHighQualityMode = function() {
  26348. this.modelHasUltraHighPanos = !0,
  26349. this.updateUltraHighResolutionSettings(null)
  26350. }
  26351. ,
  26352. n.prototype.ultraHighQualityModeEnabled = function() {
  26353. return this.modelHasUltraHighPanos
  26354. }
  26355. ,
  26356. n.prototype.onModelChanged = function(e) {
  26357. this.updateFromModel(e.model),
  26358. this.updateMaximums()
  26359. }
  26360. ,
  26361. n.prototype.updateMaximums = function() {
  26362. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  26363. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  26364. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  26365. }
  26366. ,
  26367. n.prototype.buildPanoSizeClassMap = function() {
  26368. this.panoSizeClassMap[r.BASE] = 512,
  26369. this.panoSizeClassMap[r.STANDARD] = 1024,
  26370. this.panoSizeClassMap[r.HIGH] = 2048,
  26371. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  26372. }
  26373. ,
  26374. n.prototype.getPanoSize = function(e) {
  26375. return this.panoSizeClassMap[e]
  26376. }
  26377. ,
  26378. n.prototype.getMaxPossiblePanoSize = function() {
  26379. return this.getPanoSize(r.ULTRAHIGH)
  26380. }
  26381. ,
  26382. n.prototype.getMaxPanoSize = function() {
  26383. return this.maxZoomPanoSize
  26384. }
  26385. ,
  26386. n.prototype.getMaxNavPanoSize = function() {
  26387. return this.maxNavPanoSize
  26388. }
  26389. ,
  26390. n.prototype.getMaxZoomPanoSize = function() {
  26391. return this.maxZoomPanoSize
  26392. }
  26393. ,
  26394. n.prototype.detectMaxNavPanoSizeClass = function() {
  26395. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  26396. }
  26397. ,
  26398. n.prototype.detectMaxNavPanoSize = function() {
  26399. var e = this.detectMaxNavPanoSizeClass();
  26400. return this.getPanoSize(e)
  26401. }
  26402. ,
  26403. n.prototype.detectMaxZoomPanoSize = function() {
  26404. 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)
  26405. }
  26406. ,
  26407. t.exports = n
  26408. }
  26409. , {
  26410. "../constants": 8,
  26411. "../enum/ModelManagerEvents": 33,
  26412. "../enum/PanoSizeClass": 36,
  26413. "../settings": 166,
  26414. "../util/browser": 182,
  26415. "../util/showcase": 193
  26416. }],
  26417. 171: [function(A, C, e) {
  26418. (function(e) {
  26419. "use strict";
  26420. function i(e) {
  26421. this.panos = null,
  26422. this.retryMinimumTime = 1e4,
  26423. this.urls = null,
  26424. this.panoLoadCallbacks = {},
  26425. this.downloadDescriptors = {},
  26426. this.priorityQueue = [],
  26427. this.forceQueue = [],
  26428. this.activeDownloads = [],
  26429. this.qualityManager = null,
  26430. this.tilePrioritizer = null,
  26431. this.refreshInterval = null,
  26432. this.processPriorityQueue = !1,
  26433. this.concurrentDownloads = e.concurrentDownloads || 1,
  26434. this.downloadTestResults = {}
  26435. }
  26436. var c, h, n, p, f, t = A("three"), u = (A("../enum/Viewmode"),
  26437. A("../settings")), r = (A("../objects/Panorama"),
  26438. A("../util/logger")), o = (A("../enum/Vectors"),
  26439. A("../enum/PanoSizeClass"),
  26440. A("../enum/TileDownloaderEvents")), g = A("./TilePrioritizer"), m = A("./TileUtils"), v = (A("../enum/GLCubeFaces"),
  26441. A("../enum/DownloadStatus")), a = A("../util/panorama"), s = A("../util/ajax"), d = A("../ab"), l = A("events").EventEmitter, y = (new r(e),
  26442. Object.freeze({
  26443. Testing: 1,
  26444. Success: 2,
  26445. Fail: 3
  26446. }));
  26447. i.prototype = Object.create(l.prototype),
  26448. i.IDLE_REFRESH_DELAY = 500,
  26449. i.ACTIVE_REFRESH_DELAY = 16,
  26450. i.DOWNLOAD_RETRIES = 4,
  26451. i.prototype.init = function(e) {
  26452. this.qualityManager = e
  26453. }
  26454. ,
  26455. i.prototype.setUrls = function(e) {
  26456. this.urls = e
  26457. }
  26458. ,
  26459. i.prototype.setpanoData = function(e, t, i) {
  26460. this.panos = e,
  26461. this.imagePanos = t,
  26462. this.panoGroupId = i
  26463. }
  26464. ,
  26465. i.prototype.start = function() {
  26466. this.refreshUpdateInterval(0)
  26467. }
  26468. ,
  26469. i.prototype.stop = function() {
  26470. window.cancel(this.refreshInterval)
  26471. }
  26472. ,
  26473. i.prototype.refreshUpdateInterval = function(e) {
  26474. e = e || 0,
  26475. this.refreshInterval = window.setTimeout(function() {
  26476. this.update() ? this.refreshUpdateInterval(i.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(i.IDLE_REFRESH_DELAY)
  26477. }
  26478. .bind(this), e)
  26479. }
  26480. ,
  26481. i.prototype.update = function() {
  26482. var e = 0 < this.forceQueue.length;
  26483. return this.processQueueForDownloading(this.forceQueue),
  26484. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  26485. 0 < this.priorityQueue.length && (e = !0),
  26486. this.processQueueForDownloading(this.priorityQueue)),
  26487. e
  26488. }
  26489. ,
  26490. i.prototype.forceQueueTilesForPano = (p = [],
  26491. f = [],
  26492. function(e, t, i, n, r, o) {
  26493. p.length = 0;
  26494. for (var a = this.getTileDownloadDescriptors(e, t), s = 0; s < a.length; s++) {
  26495. var l = a[s];
  26496. l.status !== v.None && l.status !== v.Queued || p.push(l)
  26497. }
  26498. if (i && 0 < p.length) {
  26499. g.sortPanoTiles(p, e, i),
  26500. f.length = 0,
  26501. m.matchingTilesInDirection(e, t, i, n, r, f);
  26502. for (var c = 0, h = function(e) {
  26503. return e.face === u.face && e.faceTileIndex === u.faceTileIndex
  26504. }; c < p.length; ) {
  26505. var u = p[c];
  26506. f.findIndex(h) < 0 ? p.splice(c, 1) : c++
  26507. }
  26508. }
  26509. for (var d = 0; d < p.length; d++)
  26510. this.forceQueue.push(p[d]);
  26511. this.setStatusForAllDescriptors(this.forceQueue, v.ForceQueued),
  26512. this.clearFromQueue(this.priorityQueue, v.ForceQueued, !1),
  26513. o && this.processQueueForDownloading(this.forceQueue, !0)
  26514. }
  26515. ),
  26516. i.prototype.clearForceQueue = function() {
  26517. this.clearQueue(this.forceQueue)
  26518. }
  26519. ,
  26520. i.prototype.queuePrioritizedTilesForPanos = function(e) {
  26521. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  26522. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  26523. this.clearFromQueue(this.priorityQueue, v.None, !0),
  26524. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, v.Queued))
  26525. }
  26526. ,
  26527. i.prototype.clearQueue = function(e) {
  26528. this.setStatusForAllDescriptors(e, v.None),
  26529. e.length = 0
  26530. }
  26531. ,
  26532. i.prototype.clearFromQueue = function(e, t, i) {
  26533. for (var n = 0; n < e.length; n++) {
  26534. var r = e[n];
  26535. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  26536. }
  26537. }
  26538. ,
  26539. i.prototype.setStatusForAllDescriptors = function(e, t) {
  26540. for (var i = 0; i < e.length; i++) {
  26541. var n = e[i];
  26542. n && (n.status = t)
  26543. }
  26544. }
  26545. ,
  26546. i.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  26547. for (var i = 0; i < e.length; i++) {
  26548. var n = e[i];
  26549. n && (n.status !== t ? n.status = t : e[i] = null)
  26550. }
  26551. }
  26552. ,
  26553. i.prototype.getTileDownloadDescriptors = function(e, t) {
  26554. var i = this.getAllTileDownloadDescriptorsForPano(e)
  26555. , n = i[t];
  26556. return n || (n = this.buildDownloadDescriptorArray(t),
  26557. i[t] = n,
  26558. this.initTileDownloadDescriptors(n, e, t)),
  26559. n
  26560. }
  26561. ,
  26562. i.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  26563. var t = this.downloadDescriptors[e.id];
  26564. return t || (t = {},
  26565. this.downloadDescriptors[e.id] = t),
  26566. t
  26567. }
  26568. ,
  26569. i.prototype.processQueueForDownloading = function(e, t) {
  26570. if (this.cleanupActiveDownloads(),
  26571. this.activeDownloads.length < this.concurrentDownloads || t)
  26572. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0; n < i && 0 < e.length; 0) {
  26573. var r = e.shift();
  26574. r && (this.startDownload(r),
  26575. n++)
  26576. }
  26577. }
  26578. ,
  26579. i.prototype.testDownload = function(t, e, i) {
  26580. var n = this.downloadTestResults[t];
  26581. if (n)
  26582. n === y.Success ? i(!0) : n === y.Fail && i(!1);
  26583. else {
  26584. this.downloadTestResults[t] = y.Testing;
  26585. var r = this.panos.list[0]
  26586. , o = this.getTileUrl(r.id, t, e, 0)
  26587. , a = function(e) {
  26588. this.downloadTestResults[t] = y.Success,
  26589. i(!0)
  26590. }
  26591. .bind(this)
  26592. , s = function() {
  26593. this.downloadTestResults[t] = y.Fail,
  26594. i(!1)
  26595. }
  26596. .bind(this);
  26597. this.loadImage(o, 0, a, s)
  26598. }
  26599. }
  26600. ,
  26601. i.prototype.startDownload = function(e) {
  26602. e.status = v.Downloading;
  26603. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  26604. this.activeDownloads.push(e),
  26605. this.loadImage(t, i.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  26606. }
  26607. ,
  26608. i.prototype.downloadFailed = function(e, t) {}
  26609. ,
  26610. i.prototype.downloadComplete = function(e, t) {
  26611. if (e.panoGroupId === this.panoGroupId) {
  26612. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  26613. e.status = v.Downloaded,
  26614. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  26615. var n = {
  26616. panoId: e.pano.id,
  26617. image: t,
  26618. tileSize: e.tileSize,
  26619. panoSize: e.panoSize,
  26620. tileIndex: e.tileIndex,
  26621. faceTileIndex: e.faceTileIndex,
  26622. totalTiles: e.totalTiles,
  26623. face: e.face,
  26624. tileX: e.tileX,
  26625. tileY: e.tileY,
  26626. direction: e.direction
  26627. };
  26628. e.image = t,
  26629. this.emit(o.TileDownloadSuccess, n),
  26630. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  26631. panoId: e.pano.id,
  26632. tileSize: e.tileSize,
  26633. panoSize: e.panoSize
  26634. },
  26635. this.emit(o.PanoDownloadComplete, n),
  26636. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  26637. }
  26638. }
  26639. ,
  26640. i.prototype.cleanupActiveDownloads = (n = [],
  26641. function() {
  26642. for (var e = n.length = 0; e < this.activeDownloads.length; e++) {
  26643. var t = this.activeDownloads[e];
  26644. t.status !== v.Downloaded && t.status !== v.Failed && n.push(t)
  26645. }
  26646. this.activeDownloads.length = 0,
  26647. this.activeDownloads.push.apply(this.activeDownloads, n)
  26648. }
  26649. ),
  26650. i.prototype.isPanoDownloaded = function(e, t) {
  26651. var i = this.getTileDownloadDescriptors(e, t);
  26652. if (i.length <= 0)
  26653. return !1;
  26654. for (var n = 0; n < i.length; n++) {
  26655. if (i[n].status !== v.Downloaded)
  26656. return !1
  26657. }
  26658. return !0
  26659. }
  26660. ,
  26661. i.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  26662. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  26663. this.panoLoadCallbacks[o] = {
  26664. onLoad: i,
  26665. onFail: n,
  26666. onProgress: r
  26667. }
  26668. }
  26669. ,
  26670. i.prototype.getPanoLoadCallbacks = function(e, t) {
  26671. var i = e.id + ":" + t;
  26672. return this.panoLoadCallbacks[i]
  26673. }
  26674. ,
  26675. i.prototype.buildDownloadDescriptorArray = function(e) {
  26676. for (var t = m.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  26677. var r = this.buildDownloadDescriptor();
  26678. i.push(r)
  26679. }
  26680. return i
  26681. }
  26682. ,
  26683. i.prototype.buildDownloadDescriptor = function() {
  26684. return {
  26685. panoGroupId: null,
  26686. pano: null,
  26687. panoSize: -1,
  26688. tileSize: -1,
  26689. tileIndex: -1,
  26690. totalTiles: -1,
  26691. faceTileIndex: -1,
  26692. status: v.None,
  26693. url: null,
  26694. image: null,
  26695. direction: new t.Vector3,
  26696. face: -1,
  26697. cubeFace: -1,
  26698. tileX: -1,
  26699. tileY: -1
  26700. }
  26701. }
  26702. ,
  26703. i.prototype.initTileDownloadDescriptors = function(e, t, i) {
  26704. for (var n = 0; n < e.length; n++) {
  26705. var r = e[n];
  26706. this.initTileDownloadDescriptor(r, t, i, n)
  26707. }
  26708. }
  26709. ,
  26710. i.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  26711. var r = i >= m.TILE_SIZE ? m.TILE_SIZE : i;
  26712. e.face = m.getFaceForTile(i, n),
  26713. e.cubeFace = a.mapFaceToCubemapFace(e.face),
  26714. e.panoGroupId = this.panoGroupId,
  26715. e.pano = t,
  26716. e.panoSize = i,
  26717. e.tileSize = r,
  26718. e.tileIndex = n,
  26719. e.totalTiles = m.getTileCountForSize(i),
  26720. e.status = v.None,
  26721. e.image = null,
  26722. m.getTileLocation(e.panoSize, e.tileIndex, e),
  26723. m.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, m.LocationOnTile.Center, 0, e.direction)
  26724. }
  26725. ,
  26726. i.prototype.getTileUrl = (c = {
  26727. 256: "256",
  26728. 512: "512",
  26729. 1024: "1k",
  26730. 2048: "2k",
  26731. 4096: "4k"
  26732. },
  26733. h = {
  26734. face: -1,
  26735. faceTileIndex: -1,
  26736. tileX: -1,
  26737. tileY: -1
  26738. },
  26739. function(e, t, i, n) {
  26740. m.getTileLocation(t, n, h);
  26741. var r = Math.floor(t / i)
  26742. , o = r * r
  26743. , a = Math.floor(n / o)
  26744. , s = "";
  26745. 1 === u.tiling.customCompression && (s = "_" + u.tiling["q" + c[t]]);
  26746. var l = this.urls.get("tiles/" + e + "/" + c[t] + s + "_face" + a + "_" + h.tileX + "_" + h.tileY + ".jpg");
  26747. return d.changeIfTileGenerating(l)
  26748. }
  26749. ),
  26750. i.prototype.loadImage = function(e, t, i, n) {
  26751. s.getImage(e, t).then(function(e) {
  26752. i(e)
  26753. }).fail(n)
  26754. }
  26755. ,
  26756. C.exports = i
  26757. }
  26758. ).call(this, "/js/tile/TileDownloader.js")
  26759. }
  26760. , {
  26761. "../ab": 3,
  26762. "../enum/DownloadStatus": 24,
  26763. "../enum/GLCubeFaces": 25,
  26764. "../enum/PanoSizeClass": 36,
  26765. "../enum/TileDownloaderEvents": 45,
  26766. "../enum/Vectors": 50,
  26767. "../enum/Viewmode": 51,
  26768. "../objects/Panorama": 148,
  26769. "../settings": 166,
  26770. "../util/ajax": 181,
  26771. "../util/logger": 189,
  26772. "../util/panorama": 191,
  26773. "./TilePrioritizer": 172,
  26774. "./TileUtils": 174,
  26775. events: 202,
  26776. three: 217
  26777. }],
  26778. 172: [function(n, C, e) {
  26779. (function(e) {
  26780. "use strict";
  26781. function h(e, t, i, n, r) {
  26782. this.qualityManager = e,
  26783. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26784. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  26785. this.baseSize = t,
  26786. this.standardSize = i,
  26787. this.highSize = n,
  26788. this.ultraHighSize = r,
  26789. this.priorityCriteria = new h.PriorityCriteria(null,new o.Vector3(0,0,0),new o.Vector3(0,0,-1),new o.Vector3(0,0,-1))
  26790. }
  26791. var c, s, l, d, r, u, p, f, o = n("three"), g = (n("../enum/Viewmode"),
  26792. n("../settings"),
  26793. n("../settings"),
  26794. n("../objects/Panorama")), t = n("../util/logger"), i = (n("../enum/Vectors"),
  26795. n("../enum/PanoSizeClass"),
  26796. n("../enum/ModelManagerEvents"),
  26797. n("../enum/GLCubeFaces"),
  26798. n("../enum/DownloadStatus")), m = (n("../util/browser"),
  26799. n("./TileUtils")), v = n("../util/math"), a = (n("events").EventEmitter,
  26800. new t(e),
  26801. Object.freeze({
  26802. None: 0,
  26803. DirectionalFOV: 1
  26804. }));
  26805. h.PriorityCriteria = function(e, t, i, n, r) {
  26806. this.pano = e,
  26807. this.cameraPosition = (new o.Vector3).copy(t),
  26808. this.cameraDir = (new o.Vector3).copy(i),
  26809. this.panoSpaceDir = (new o.Vector3).copy(n),
  26810. this.upcomingPanos = r,
  26811. this.copy = function(e) {
  26812. this.pano = e.pano,
  26813. this.cameraPosition.copy(e.cameraPosition),
  26814. this.cameraDir.copy(e.cameraDir),
  26815. this.panoSpaceDir.copy(e.panoSpaceDir),
  26816. this.upcomingPanos = r
  26817. }
  26818. ,
  26819. this.zoomingActive = !1
  26820. }
  26821. ,
  26822. h.DIRECTIONAL_FOV = 180,
  26823. h.DIRECTIONAL_FOV_NARROW = 120,
  26824. h.MAX_SCORED_PANOS_TOCONSIDER = 6,
  26825. h.MAX_SCORED_PANOS_TOADD = 2,
  26826. h.MAX_UPCOMING_PANOS_TOADD = 3,
  26827. h.DIRECTION_SCORE_STRICTNESS = .75,
  26828. h.appendQueue = function(e, t) {
  26829. if (e && t)
  26830. for (var i = 0; i < t.length; i++)
  26831. e.push(t[i])
  26832. }
  26833. ,
  26834. h.prototype.updateCriteria = function(e, t, i, n) {
  26835. this.priorityCriteria.pano = e,
  26836. this.priorityCriteria.cameraPosition.copy(t),
  26837. this.priorityCriteria.cameraDir.copy(i),
  26838. this.priorityCriteria.upcomingPanos = n,
  26839. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26840. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  26841. }
  26842. ,
  26843. h.prototype.filterAndPrioritize = (u = [],
  26844. p = [],
  26845. f = [],
  26846. function(e, t, i) {
  26847. this.populateNeighborPanos(this.priorityCriteria.pano, t, u),
  26848. this.populateScoredPanos(this.priorityCriteria.pano, t, p, this.priorityCriteria.cameraDir, h.MAX_SCORED_PANOS_TOCONSIDER);
  26849. var n = this.baseSize
  26850. , r = this.standardSize
  26851. , o = this.highSize
  26852. , a = this.ultraHighSize;
  26853. this.queueTilesForPano(e, i, this.priorityCriteria.pano, n),
  26854. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(e, this.priorityCriteria.upcomingPanos, i, n, h.MAX_UPCOMING_PANOS_TOADD),
  26855. f.length = 0,
  26856. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26857. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26858. h.appendQueue(e, f),
  26859. this.queueTilesForPanos(e, p, i, n, h.MAX_SCORED_PANOS_TOADD),
  26860. f.length = 0,
  26861. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26862. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26863. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26864. h.appendQueue(e, f),
  26865. f.length = 0,
  26866. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26867. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26868. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26869. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26870. h.appendQueue(e, f),
  26871. this.queueTilesForPanos(e, u, i, n)
  26872. }
  26873. ),
  26874. h.prototype.canDownloadSize = function(e) {
  26875. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  26876. }
  26877. ,
  26878. h.prototype.populateNeighborPanos = function(e, t, i) {
  26879. (i = i || []).length = 0;
  26880. var n = t.getNeighbours(e);
  26881. for (var r in n)
  26882. if (n.hasOwnProperty(r)) {
  26883. var o = t.get(r);
  26884. i.push(o)
  26885. }
  26886. return i
  26887. }
  26888. ,
  26889. h.prototype.populateScoredPanos = function(e, t, i, n, r) {
  26890. (i = i || []).length = 0;
  26891. var o = [g.filters.inPanoDirection(e.position, n, h.DIRECTION_SCORE_STRICTNESS), g.filters.not(e)]
  26892. , a = [g.scoreFunctions.distanceSquared(e), g.scoreFunctions.direction(e.position, n)]
  26893. , s = t.sortByScore(o, a);
  26894. if (s)
  26895. for (var l = 0; l < s.length && l < r; l++) {
  26896. var c = s[l].item;
  26897. i.push(c)
  26898. }
  26899. return i
  26900. }
  26901. ,
  26902. h.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  26903. for (var o = 0, a = 0; a < t.length; a++) {
  26904. var s = t[a];
  26905. if (o += 0 < this.queueTilesForPano(e, i, s, n) ? 1 : 0,
  26906. r && r <= o)
  26907. break
  26908. }
  26909. return o
  26910. }
  26911. ,
  26912. h.prototype.queueTilesForPano = (r = {
  26913. filter: a.None
  26914. },
  26915. function(e, t, i, n) {
  26916. return this.filterAndQueueTileDownloadDescriptors(e, t, i, n, r)
  26917. }
  26918. ),
  26919. h.prototype.queueTilesForPanosInDirection = (d = new o.Vector3,
  26920. function(e, t, i, n, r, o, a, s) {
  26921. for (var l = 0, c = 0; c < i.length; c++) {
  26922. var h = i[c];
  26923. d.copy(h.position),
  26924. d.sub(r),
  26925. d.normalize();
  26926. var u = Math.max(Math.min(o.dot(d), 1), -1);
  26927. if (v.getFOVDotThreshold(a) <= u && (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, r, o, a) ? 1 : 0,
  26928. s && s <= l))
  26929. break
  26930. }
  26931. return l
  26932. }
  26933. ),
  26934. h.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  26935. for (var l = 0, c = 0; c < i.length; c++) {
  26936. var h = i[c];
  26937. if (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, o, a) ? 1 : 0,
  26938. s && s <= l)
  26939. break
  26940. }
  26941. return l
  26942. }
  26943. ,
  26944. h.prototype.queueTilesInDirectionForPano = (s = {
  26945. filter: a.DirectionalFOV,
  26946. direction: new o.Vector3,
  26947. fov: 60
  26948. },
  26949. l = new o.Vector3,
  26950. function(e, t, i, n, r, o, a) {
  26951. return l.copy(o),
  26952. m.getRelativeDirection(i.quaternion, l),
  26953. s.direction.copy(l),
  26954. s.fov = a,
  26955. this.filterAndQueueTileDownloadDescriptors(e, t, i, n, s)
  26956. }
  26957. ),
  26958. h.prototype.filterAndQueueTileDownloadDescriptors = (c = [],
  26959. function(e, t, i, n, r) {
  26960. var o = t.getTileDownloadDescriptors(i, n);
  26961. c.length = 0,
  26962. this.filterTileDownloadDescriptors(i, o, c, r);
  26963. for (var a = 0, s = 0; s < c.length; s++) {
  26964. var l = c[s];
  26965. l && (e.push(l),
  26966. a++)
  26967. }
  26968. return a
  26969. }
  26970. ),
  26971. h.prototype.filterTileDownloadDescriptors = (new o.Vector3,
  26972. function(e, t, i, n) {
  26973. var r, o;
  26974. switch (n.filter) {
  26975. case a.DirectionalFOV:
  26976. for (r = 0; r < t.length; r++)
  26977. o = t[r],
  26978. m.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  26979. break;
  26980. default:
  26981. for (r = 0; r < t.length; r++)
  26982. o = t[r],
  26983. i.push(o)
  26984. }
  26985. for (r = 0; r < i.length; r++)
  26986. o = i[r],
  26987. this.canIncludeDescriptor(o) || (i[r] = null)
  26988. }
  26989. ),
  26990. h.prototype.canIncludeDescriptor = function(e) {
  26991. return e.status !== i.Downloading && e.status !== i.Downloaded
  26992. }
  26993. ,
  26994. h.prototype.canIncludePano = function(e, t) {
  26995. return !e.isLoaded(t)
  26996. }
  26997. ,
  26998. h.getFOVDotThreshold = function(e) {
  26999. return Math.cos(o.Math.degToRad(e / 2))
  27000. }
  27001. ;
  27002. var y = (A._panoSpaceDir = new o.Vector3,
  27003. A._fovThreshold = -1,
  27004. A._fovThresholdNarrow = -1,
  27005. A);
  27006. function A(e, t) {
  27007. var i = A._panoSpaceDir
  27008. , n = A._fovThreshold
  27009. , r = A._fovThresholdNarrow
  27010. , o = Math.max(Math.min(i.dot(e.direction), 1), -1)
  27011. , a = Math.max(Math.min(i.dot(t.direction), 1), -1);
  27012. return e._dot = o,
  27013. t._dot = a,
  27014. n <= o && a < n ? -1 : o < n && n <= a ? 1 : r <= o && a < r ? -1 : o < r && r <= a ? 1 : e.panoSize > t.panoSize ? 1 : t.panoSize > e.panoSize ? -1 : -(o - a)
  27015. }
  27016. h.sortPanoTiles = function(e, t, i) {
  27017. y._panoSpaceDir.copy(i),
  27018. m.getRelativeDirection(t.quaternion, y._panoSpaceDir),
  27019. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  27020. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV),
  27021. e.sort(y)
  27022. }
  27023. ,
  27024. h.insertSortedPanoTile = function(e, t, i, n) {
  27025. y._panoSpaceDir.copy(n),
  27026. m.getRelativeDirection(i.quaternion, y._panoSpaceDir),
  27027. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  27028. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV);
  27029. for (var r = -1, o = 0; o < e.length; o++) {
  27030. if (y(t, e[o]) <= 0) {
  27031. r = o;
  27032. break
  27033. }
  27034. }
  27035. if (-1 === r)
  27036. e[e.length] = t;
  27037. else {
  27038. for (var a = e.length; r < a; a--)
  27039. e[a] = e[a - 1];
  27040. e[r] = t
  27041. }
  27042. }
  27043. ,
  27044. h.prototype.setZoomingActive = function(e) {
  27045. e !== this.zoomingActive && (this.zoomingActive = e)
  27046. }
  27047. ,
  27048. C.exports = h
  27049. }
  27050. ).call(this, "/js/tile/TilePrioritizer.js")
  27051. }
  27052. , {
  27053. "../enum/DownloadStatus": 24,
  27054. "../enum/GLCubeFaces": 25,
  27055. "../enum/ModelManagerEvents": 33,
  27056. "../enum/PanoSizeClass": 36,
  27057. "../enum/Vectors": 50,
  27058. "../enum/Viewmode": 51,
  27059. "../objects/Panorama": 148,
  27060. "../settings": 166,
  27061. "../util/browser": 182,
  27062. "../util/logger": 189,
  27063. "../util/math": 190,
  27064. "./TileUtils": 174,
  27065. events: 202,
  27066. three: 217
  27067. }],
  27068. 173: [function(e, t, i) {
  27069. "use strict";
  27070. function f(e, t) {
  27071. this.levels = t,
  27072. this.tileSize = e,
  27073. this.root = null,
  27074. this.allNodes = [],
  27075. function(e) {
  27076. e.root = function e(t, i, n) {
  27077. if (n > t.levels)
  27078. return null;
  27079. var r = new a(t,i);
  27080. t.allNodes.push(r);
  27081. for (var o = 0; o < s; o++)
  27082. r.children[o] = e(t, r, n + 1);
  27083. return r
  27084. }(e, null, 0)
  27085. }(this)
  27086. }
  27087. function a(e, t) {
  27088. this.tree = e,
  27089. this.parent = t,
  27090. this.children = [],
  27091. this.id = ++n
  27092. }
  27093. var g = (e("three"),
  27094. e("./TileUtils"),
  27095. e("../objects/Panorama"),
  27096. e("../util/panorama"),
  27097. e("events").EventEmitter,
  27098. 2)
  27099. , s = g * g;
  27100. f.TraversalType = Object.freeze({
  27101. PreOrder: 0,
  27102. PostOrder: 1
  27103. });
  27104. var n = 0;
  27105. f.getLevelCountForSize = function(e, t) {
  27106. var i = 0;
  27107. for (t < e && (t = e); !((t /= g) < e); )
  27108. i++;
  27109. return i
  27110. }
  27111. ,
  27112. f.getSizeForLevel = function(e, t) {
  27113. return Math.pow(g, t) * e
  27114. }
  27115. ,
  27116. f.prototype.getSubNode = function(e, t, i) {
  27117. (!t || e < this.tileSize) && (t = 0),
  27118. (!i || e < this.tileSize) && (i = 0),
  27119. e < this.tileSize && (e = this.tileSize);
  27120. var n = f.getLevelCountForSize(this.tileSize, e);
  27121. return function e(t, i, n, r, o) {
  27122. if (!t)
  27123. return null;
  27124. if (0 === n)
  27125. return t;
  27126. if (!t.children || 0 === t.children.length)
  27127. return null;
  27128. var a = Math.pow(g, n) / g
  27129. , s = r % a
  27130. , l = o % a
  27131. , c = Math.floor(o / a)
  27132. , h = Math.floor(r / a)
  27133. , u = c * g + h;
  27134. return e(t.children[u], i + 1, n - 1, s, l)
  27135. }(this.root, 0, n, t, i)
  27136. }
  27137. ,
  27138. f.prototype.breadthFirst = function(e) {
  27139. var t = !!(e = e || {}).nullLevelEnd
  27140. , i = e.maxLevel
  27141. , n = e.minLevel
  27142. , r = e.callback
  27143. , o = e.saveVisited
  27144. , a = []
  27145. , s = {}
  27146. , l = 0;
  27147. for (a.push(this.root),
  27148. a.push(s); 0 < a.length && !(i && i < l); ) {
  27149. var c = a.shift();
  27150. if (c === s)
  27151. (!n || n <= l) && (r && t && r(null),
  27152. o && t && o.push(null)),
  27153. 0 < a.length && a.push(s),
  27154. l++,
  27155. 0;
  27156. else {
  27157. if (c.children)
  27158. for (var h = 0; h < c.children.length; h++) {
  27159. c.children[h] && a.push(c.children[h])
  27160. }
  27161. var u = this.getFaceIndexFromNode(c);
  27162. (!n || n <= l) && (r && r(c, l, u),
  27163. o && o.push(c)),
  27164. 0
  27165. }
  27166. }
  27167. }
  27168. ,
  27169. f.prototype.getFaceIndexFromNode = function(e) {
  27170. if (!e)
  27171. return -1;
  27172. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  27173. var o = i.parent;
  27174. if (!o)
  27175. break;
  27176. for (var a = -1, s = 0; s < o.children.length; s++)
  27177. o.children[s] === i && (a = s);
  27178. n = a % g * t + n,
  27179. r = Math.floor(a / g) * t + r,
  27180. t *= g,
  27181. i = o
  27182. }
  27183. return r * t + n
  27184. }
  27185. ,
  27186. f.prototype.depthFirst = function(e, t, i) {
  27187. !function e(t, i, n, r, o, a, s, l) {
  27188. if (t) {
  27189. s = s || f.TraversalType.PreOrder;
  27190. var c = r * g + n;
  27191. if (s === f.TraversalType.PreOrder && (o && o(t, i, c, n, r),
  27192. a && a.push(t)),
  27193. t.children && 0 !== t.children.length) {
  27194. for (var h = r * g, u = n * g, d = 0; d < g; d++)
  27195. for (var p = 0; p < g; p++)
  27196. e(t.children[p * g + d], i + 1, u + d, h + p, o, a, s, l);
  27197. s === f.TraversalType.PostOrder && (o && o(t, i, c, n, r),
  27198. a && a.push(t))
  27199. }
  27200. }
  27201. }(this.root, 0, 0, 0, e, t, i, this.tileSize)
  27202. }
  27203. ,
  27204. t.exports = f
  27205. }
  27206. , {
  27207. "../objects/Panorama": 148,
  27208. "../util/panorama": 191,
  27209. "./TileUtils": 174,
  27210. events: 202,
  27211. three: 217
  27212. }],
  27213. 174: [function(e, t, i) {
  27214. "use strict";
  27215. var n, a, s, p, f, g, E, l, c, h, u, d, r, o, m = e("../enum/GLCubeFaces"), _ = e("../util/MathLight"), b = {};
  27216. b.TILE_SIZE = 512,
  27217. b.FACES_PER_PANO = 6,
  27218. b.LocationOnTile = {
  27219. Center: 0,
  27220. UpperLeft: 1,
  27221. UpperRight: 2,
  27222. LowerRight: 3,
  27223. LowerLeft: 4
  27224. },
  27225. b.getTileVector = function(e, t, i, n, r, o, a, s) {
  27226. var l = e / t
  27227. , c = t / e * 2
  27228. , h = c / 2
  27229. , u = n / l * 2 - 1 + h
  27230. , d = (r = l - 1 - r) / l * 2 - 1 + h;
  27231. switch (o = o || b.LocationOnTile.Center) {
  27232. case b.LocationOnTile.UpperLeft:
  27233. u -= h,
  27234. d += h,
  27235. u += a * c;
  27236. break;
  27237. case b.LocationOnTile.UpperRight:
  27238. u += h,
  27239. d += h,
  27240. d -= a * c;
  27241. break;
  27242. case b.LocationOnTile.LowerRight:
  27243. u += h,
  27244. d -= h,
  27245. u -= a * c;
  27246. break;
  27247. case b.LocationOnTile.LowerLeft:
  27248. u -= h,
  27249. d -= h,
  27250. d += a * c;
  27251. break;
  27252. case b.LocationOnTile.Center:
  27253. }
  27254. switch (i) {
  27255. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  27256. _.setVector(s, -1, d, -u);
  27257. break;
  27258. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  27259. _.setVector(s, 1, d, u);
  27260. break;
  27261. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  27262. _.setVector(s, -u, 1, -d);
  27263. break;
  27264. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  27265. _.setVector(s, -u, -1, d);
  27266. break;
  27267. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  27268. _.setVector(s, -u, d, 1);
  27269. break;
  27270. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  27271. _.setVector(s, u, d, -1)
  27272. }
  27273. _.normalize(s)
  27274. }
  27275. ,
  27276. b.getFaceForTile = function(e, t) {
  27277. var i = b.TILE_SIZE;
  27278. e < b.TILE_SIZE && (i = e);
  27279. var n = Math.floor(e / i)
  27280. , r = n * n;
  27281. return Math.floor(t / r)
  27282. }
  27283. ,
  27284. b.getTileLocation = function(e, t, i) {
  27285. var n = b.TILE_SIZE;
  27286. e < b.TILE_SIZE && (n = e);
  27287. var r = b.getFaceForTile(e, t)
  27288. , o = Math.floor(e / n)
  27289. , a = t - r * (o * o);
  27290. i.tileX = a % o,
  27291. i.tileY = Math.floor(a / o),
  27292. i.face = r,
  27293. i.faceTileIndex = a
  27294. }
  27295. ,
  27296. b.getTileCountForSize = function(e) {
  27297. if (e <= b.TILE_SIZE)
  27298. return b.FACES_PER_PANO;
  27299. var t = Math.floor(e / b.TILE_SIZE);
  27300. return t * t * b.FACES_PER_PANO
  27301. }
  27302. ,
  27303. b.getRelativeDirection = (r = new _.Matrix4,
  27304. o = new _.Quaternion,
  27305. function(e, t) {
  27306. o.copy(e),
  27307. o.inverse(),
  27308. r.makeRotationFromQuaternion(o),
  27309. r.applyToVector3(t),
  27310. _.normalize(t)
  27311. }
  27312. ),
  27313. b.matchingTilesInDirection = (c = new _.Vector3,
  27314. h = new _.Vector3(0,0,-1),
  27315. u = new _.Quaternion,
  27316. l = {
  27317. face: -1,
  27318. faceTileIndex: -1,
  27319. tileX: -1,
  27320. tileY: -1
  27321. },
  27322. d = function(e, t, i) {
  27323. for (var n = b.getTileCountForSize(e), r = 0, o = 0; o < n; o++)
  27324. b.getTileLocation(e, o, l),
  27325. t && !t(l) || (r++,
  27326. i && (a = l,
  27327. i.push({
  27328. face: a.face,
  27329. faceTileIndex: a.faceTileIndex,
  27330. tileX: a.tileX,
  27331. tileY: a.tileY
  27332. })));
  27333. var a;
  27334. return r
  27335. }
  27336. ,
  27337. function(e, t, i, n, r, o) {
  27338. var a = t < b.TILE_SIZE ? t : b.TILE_SIZE;
  27339. if (b.getTileCountForSize(t),
  27340. !n && !r)
  27341. return d(t, null, o);
  27342. var s = !!r;
  27343. return r = r || n,
  27344. r = Math.max(0, Math.min(r, 360)),
  27345. n = Math.max(0, Math.min(n, 360)),
  27346. _.copyVector(i, c),
  27347. b.getRelativeDirection(e.quaternion, c),
  27348. s ? (u.setFromUnitVectors(c, h),
  27349. d(t, function(e) {
  27350. return b.isTileWithinFrustum(t, a, e.face, e.tileX, e.tileY, u, n, r)
  27351. }, o)) : d(t, function(e) {
  27352. return b.isTileWithinFOV(t, a, e.face, e.tileX, e.tileY, c, n)
  27353. }, o)
  27354. }
  27355. ),
  27356. b.isTileWithinFrustum = (E = new _.Vector3,
  27357. function(e, t, i, n, r, o, a, s) {
  27358. for (var l = Math.tan(.5 * s * _.RADIANS_PER_DEGREE), c = -l, h = Math.tan(.5 * a * _.RADIANS_PER_DEGREE), u = -h, d = b.mapFaceToCubemapFace(i), p = 0, f = 0, g = 0, m = 0, v = 0, y = b.LocationOnTile.Center; y <= b.LocationOnTile.LowerLeft; y++)
  27359. if (b.getTileVector(e, t, d, n, r, y, 0, E),
  27360. _.applyQuaternionToVector(o, E),
  27361. -1e-5 <= E.z)
  27362. ;
  27363. else {
  27364. var A = -1 / E.z
  27365. , C = E.x * A
  27366. , I = E.y * A;
  27367. l < I ? p++ : I < c && f++,
  27368. h < C ? g++ : C < u && m++,
  27369. v++
  27370. }
  27371. return f !== v && p !== v && g !== v && m !== v
  27372. }
  27373. ),
  27374. b.isTileWithinFOV = (p = new _.Vector3,
  27375. f = new _.Vector3(0,1,0),
  27376. g = new _.Vector3(1,0,0),
  27377. function(e, t, i, n, r, o, a) {
  27378. var s = b.mapFaceToCubemapFace(i);
  27379. if (_.cross(o, f, g),
  27380. b.getTileVector(e, t, s, n, r, b.LocationOnTile.Center, 0, p),
  27381. b.isWithinFOV(p, o, a, null))
  27382. return !0;
  27383. for (var l = a / 360, c = Math.floor(1 / l), h = 0, u = 0; u < c; u++) {
  27384. for (var d = b.LocationOnTile.UpperLeft; d <= b.LocationOnTile.LowerLeft; d++)
  27385. if (b.getTileVector(e, t, s, n, r, d, h, p),
  27386. b.isWithinFOV(p, o, a, null))
  27387. return !0;
  27388. h += l
  27389. }
  27390. return !1
  27391. }
  27392. ),
  27393. b.isWithinFOV = (a = new _.Vector3,
  27394. s = new _.Vector3,
  27395. function(e, t, i, n) {
  27396. if (_.copyVector(e, s),
  27397. n) {
  27398. _.copyVector(n, a),
  27399. _.normalize(a);
  27400. var r = _.dot(a, e);
  27401. a.x *= r,
  27402. a.y *= r,
  27403. a.z *= r,
  27404. _.subVector(s, a)
  27405. }
  27406. var o = i / 2 * _.RADIANS_PER_DEGREE;
  27407. return Math.cos(o) <= _.dot(s, t)
  27408. }
  27409. ),
  27410. b.mapFaceToCubemapFace = (n = {
  27411. 0: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  27412. 1: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  27413. 2: m.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  27414. 3: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  27415. 4: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  27416. 5: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  27417. },
  27418. function(e) {
  27419. return n[e]
  27420. }
  27421. ),
  27422. t.exports = b
  27423. }
  27424. , {
  27425. "../enum/GLCubeFaces": 25,
  27426. "../util/MathLight": 176
  27427. }],
  27428. 175: [function(i, n, e) {
  27429. (function(e) {
  27430. "use strict";
  27431. function t() {
  27432. this.list = [],
  27433. this.index = {},
  27434. Object.defineProperty(this, "length", {
  27435. get: function() {
  27436. return this.list.length
  27437. }
  27438. })
  27439. }
  27440. new (i("./common"),
  27441. i("./logger"))(e),
  27442. t.prototype.forEach = function(e) {
  27443. this.list.forEach(e)
  27444. }
  27445. ,
  27446. t.prototype.add = function(e) {
  27447. this.list.push(e),
  27448. this.index[this.getIndex(e)] = e
  27449. }
  27450. ,
  27451. t.prototype.getIndex = function(e) {
  27452. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  27453. }
  27454. ,
  27455. t.prototype.extend = function(e) {
  27456. for (var t = 0; t < e.length; t++)
  27457. this.add(e[t])
  27458. }
  27459. ,
  27460. t.prototype.get = function(e) {
  27461. return this.index[e]
  27462. }
  27463. ,
  27464. t.prototype.first = function() {
  27465. return this.list[0]
  27466. }
  27467. ,
  27468. t.prototype.last = function() {
  27469. return this.list[this.list.length - 1]
  27470. }
  27471. ,
  27472. t.prototype.reIndex = function() {
  27473. this.index = {};
  27474. var t = this;
  27475. this.forEach(function(e) {
  27476. t.index[t.getIndex(e)] = e
  27477. })
  27478. }
  27479. ,
  27480. t.prototype.filter = function(e) {
  27481. var t = this.list.filter(e);
  27482. return this.reIndex(),
  27483. t
  27484. }
  27485. ,
  27486. t.prototype.reduce = function(e, t) {
  27487. return this.list.reduce(e, t)
  27488. }
  27489. ,
  27490. t.prototype.sort = function(e) {
  27491. return this.list.sort(e)
  27492. }
  27493. ,
  27494. t.prototype.indexOf = function(e) {
  27495. for (var t = 0; t < this.list.length; ++t)
  27496. if (this.list[t] === e)
  27497. return t;
  27498. return -1
  27499. }
  27500. ,
  27501. n.exports = t
  27502. }
  27503. ).call(this, "/js/util/IndexedCollection.js")
  27504. }
  27505. , {
  27506. "./common": 185,
  27507. "./logger": 189
  27508. }],
  27509. 176: [function(e, t, i) {
  27510. "use strict";
  27511. e("../constants");
  27512. var n, r, o = {};
  27513. o.RADIANS_PER_DEGREE = Math.PI / 180,
  27514. o.DEGREES_PER_RADIAN = 180 / Math.PI,
  27515. o.Vector3 = function(e, t, i) {
  27516. this.x = e || 0,
  27517. this.y = t || 0,
  27518. this.z = i || 0
  27519. }
  27520. ,
  27521. o.Matrix4 = function() {
  27522. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  27523. 0 < arguments.length && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  27524. }
  27525. ,
  27526. o.Matrix4.prototype = {
  27527. identity: function() {
  27528. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  27529. this
  27530. },
  27531. copy: function(e) {
  27532. return this.elements.set(e.elements),
  27533. this
  27534. },
  27535. applyToVector3: function(e) {
  27536. var t = e.x
  27537. , i = e.y
  27538. , n = e.z
  27539. , r = this.elements;
  27540. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  27541. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  27542. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  27543. this
  27544. },
  27545. getInverse: function(e, t) {
  27546. var i = this.elements
  27547. , n = e.elements
  27548. , r = n[0]
  27549. , o = n[1]
  27550. , a = n[2]
  27551. , s = n[3]
  27552. , l = n[4]
  27553. , c = n[5]
  27554. , h = n[6]
  27555. , u = n[7]
  27556. , d = n[8]
  27557. , p = n[9]
  27558. , f = n[10]
  27559. , g = n[11]
  27560. , m = n[12]
  27561. , v = n[13]
  27562. , y = n[14]
  27563. , A = n[15]
  27564. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  27565. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  27566. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  27567. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  27568. , b = r * C + o * I + a * E + s * _;
  27569. if (0 == b) {
  27570. var w = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  27571. if (t)
  27572. throw new Error(w);
  27573. return console.warn(w),
  27574. this.identity()
  27575. }
  27576. var T = 1 / b;
  27577. return i[0] = C * T,
  27578. i[1] = (v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A) * T,
  27579. i[2] = (c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A) * T,
  27580. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  27581. i[4] = I * T,
  27582. i[5] = (d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A) * T,
  27583. i[6] = (m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A) * T,
  27584. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  27585. i[8] = E * T,
  27586. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A) * T,
  27587. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A) * T,
  27588. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  27589. i[12] = _ * T,
  27590. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y) * T,
  27591. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y) * T,
  27592. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  27593. this
  27594. },
  27595. makeRotationFromQuaternion: function(e) {
  27596. var t = this.elements
  27597. , i = e.x
  27598. , n = e.y
  27599. , r = e.z
  27600. , o = e.w
  27601. , a = i + i
  27602. , s = n + n
  27603. , l = r + r
  27604. , c = i * a
  27605. , h = i * s
  27606. , u = i * l
  27607. , d = n * s
  27608. , p = n * l
  27609. , f = r * l
  27610. , g = o * a
  27611. , m = o * s
  27612. , v = o * l;
  27613. return t[0] = 1 - (d + f),
  27614. t[4] = h - v,
  27615. t[8] = u + m,
  27616. t[1] = h + v,
  27617. t[5] = 1 - (c + f),
  27618. t[9] = p - g,
  27619. t[2] = u - m,
  27620. t[6] = p + g,
  27621. t[10] = 1 - (c + d),
  27622. t[3] = 0,
  27623. t[7] = 0,
  27624. t[11] = 0,
  27625. t[12] = 0,
  27626. t[13] = 0,
  27627. t[14] = 0,
  27628. t[15] = 1,
  27629. this
  27630. }
  27631. },
  27632. o.Quaternion = function(e, t, i, n) {
  27633. this._x = e || 0,
  27634. this._y = t || 0,
  27635. this._z = i || 0,
  27636. this._w = void 0 !== n ? n : 1
  27637. }
  27638. ,
  27639. o.Quaternion.prototype = {
  27640. get x() {
  27641. return this._x
  27642. },
  27643. set x(e) {
  27644. this._x = e
  27645. },
  27646. get y() {
  27647. return this._y
  27648. },
  27649. set y(e) {
  27650. this._y = e
  27651. },
  27652. get z() {
  27653. return this._z
  27654. },
  27655. set z(e) {
  27656. this._z = e
  27657. },
  27658. get w() {
  27659. return this._w
  27660. },
  27661. set w(e) {
  27662. this._w = e
  27663. },
  27664. copy: function(e) {
  27665. this._x = e.x,
  27666. this._y = e.y,
  27667. this._z = e.z,
  27668. this._w = e.w
  27669. },
  27670. inverse: function() {
  27671. return this.conjugate().normalize()
  27672. },
  27673. conjugate: function() {
  27674. return this._x *= -1,
  27675. this._y *= -1,
  27676. this._z *= -1,
  27677. this
  27678. },
  27679. length: function() {
  27680. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  27681. },
  27682. normalize: function() {
  27683. var e = this.length();
  27684. return 0 === e ? (this._x = 0,
  27685. this._y = 0,
  27686. this._z = 0,
  27687. this._w = 1) : (e = 1 / e,
  27688. this._x = this._x * e,
  27689. this._y = this._y * e,
  27690. this._z = this._z * e,
  27691. this._w = this._w * e),
  27692. this
  27693. },
  27694. setFromAxisAngle: function(e, t) {
  27695. var i = t / 2
  27696. , n = Math.sin(i);
  27697. return this._x = e.x * n,
  27698. this._y = e.y * n,
  27699. this._z = e.z * n,
  27700. this._w = Math.cos(i),
  27701. this
  27702. },
  27703. setFromUnitVectors: function(e, t) {
  27704. return void 0 === n && (n = new o.Vector3),
  27705. (r = o.dot(e, t) + 1) < 1e-6 ? (r = 0,
  27706. Math.abs(e.x) > Math.abs(e.z) ? o.setVector(n, -e.y, e.x, 0) : o.setVector(n, 0, -e.z, e.y)) : o.cross(e, t, n),
  27707. this._x = n.x,
  27708. this._y = n.y,
  27709. this._z = n.z,
  27710. this._w = r,
  27711. this.normalize()
  27712. },
  27713. multiply: function(e) {
  27714. return this.multiplyQuaternions(this, e)
  27715. },
  27716. premultiply: function(e) {
  27717. return this.multiplyQuaternions(e, this)
  27718. },
  27719. multiplyQuaternions: function(e, t) {
  27720. var i = e._x
  27721. , n = e._y
  27722. , r = e._z
  27723. , o = e._w
  27724. , a = t._x
  27725. , s = t._y
  27726. , l = t._z
  27727. , c = t._w;
  27728. return this._x = i * c + o * a + n * l - r * s,
  27729. this._y = n * c + o * s + r * a - i * l,
  27730. this._z = r * c + o * l + i * s - n * a,
  27731. this._w = o * c - i * a - n * s - r * l,
  27732. this
  27733. }
  27734. },
  27735. o.convertWorkshopVector = function(e) {
  27736. return new o.Vector3(-e.x,e.y,e.z)
  27737. }
  27738. ,
  27739. o.convertWorkshopQuaternion = function(e) {
  27740. return new o.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new o.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  27741. }
  27742. ,
  27743. o.convertWorkshopOrthoZoom = function(e) {
  27744. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  27745. }
  27746. ,
  27747. o.convertWorkshopPanoramaQuaternion = function(e) {
  27748. return new o.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new o.Quaternion).setFromAxisAngle(new o.Vector3(0,1,0), 270 * o.RADIANS_PER_DEGREE))
  27749. }
  27750. ,
  27751. o.normalize = function(e) {
  27752. var t = e.x * e.x + e.y * e.y + e.z * e.z
  27753. , i = Math.sqrt(t);
  27754. e.x /= i,
  27755. e.y /= i,
  27756. e.z /= i
  27757. }
  27758. ,
  27759. o.dot = function(e, t) {
  27760. return e.x * t.x + e.y * t.y + e.z * t.z
  27761. }
  27762. ,
  27763. o.cross = function(e, t, i) {
  27764. var n = e.x
  27765. , r = e.y
  27766. , o = e.z;
  27767. i.x = r * t.z - o * t.y,
  27768. i.y = o * t.x - n * t.z,
  27769. i.z = n * t.y - r * t.x
  27770. }
  27771. ,
  27772. o.setVector = function(e, t, i, n) {
  27773. e.x = t,
  27774. e.y = i,
  27775. e.z = n
  27776. }
  27777. ,
  27778. o.copyVector = function(e, t) {
  27779. t.x = e.x,
  27780. t.y = e.y,
  27781. t.z = e.z
  27782. }
  27783. ,
  27784. o.addVector = function(e, t) {
  27785. e.x += t.x,
  27786. e.y += t.y,
  27787. e.z += t.z
  27788. }
  27789. ,
  27790. o.subVector = function(e, t) {
  27791. e.x -= t.x,
  27792. e.y -= t.y,
  27793. e.z -= t.z
  27794. }
  27795. ,
  27796. o.applyQuaternionToVector = function(e, t) {
  27797. var i = t.x
  27798. , n = t.y
  27799. , r = t.z
  27800. , o = e.x
  27801. , a = e.y
  27802. , s = e.z
  27803. , l = e.w
  27804. , c = l * i + a * r - s * n
  27805. , h = l * n + s * i - o * r
  27806. , u = l * r + o * n - a * i
  27807. , d = -o * i - a * n - s * r;
  27808. t.x = c * l + d * -o + h * -s - u * -a,
  27809. t.y = h * l + d * -a + u * -o - c * -s,
  27810. t.z = u * l + d * -s + c * -a - h * -o
  27811. }
  27812. ,
  27813. o.angleBetweenVectors = function(e, t) {
  27814. return Math.acos(o.dot(e, t))
  27815. }
  27816. ,
  27817. t.exports = o
  27818. }
  27819. , {
  27820. "../constants": 8
  27821. }],
  27822. 177: [function(c, h, e) {
  27823. (function(e) {
  27824. "use strict";
  27825. function t(e) {
  27826. this.cache = null,
  27827. this.expires = 0
  27828. }
  27829. function i() {
  27830. this.baseUrl = null,
  27831. this.cache = null,
  27832. this.expires = 0
  27833. }
  27834. function n() {
  27835. this.baseUrl = null,
  27836. this.expires = 0
  27837. }
  27838. function r(e) {
  27839. this.initialLoadingPromise = null,
  27840. this.endpoint = e + "?type=3",
  27841. this.urlContainer = null,
  27842. this.authorizationHeader = s.getAuthorizationHeader(),
  27843. this.containerClasses = [n, i, t]
  27844. }
  27845. c("./ajax");
  27846. var o = c("./logger")
  27847. , a = c("../constants")
  27848. , s = c("./showcase")
  27849. , l = (c("../ab"),
  27850. new o(e));
  27851. t.prototype = {
  27852. version: 1,
  27853. validate: function(e) {
  27854. return "catalog.json"in e && 0 < Object.keys(e).length
  27855. },
  27856. update: function(e) {
  27857. return this.cache = e,
  27858. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27859. $.when()
  27860. },
  27861. get: function(e) {
  27862. return this.cache[e]
  27863. }
  27864. },
  27865. i.prototype = {
  27866. version: 2,
  27867. validate: function(e) {
  27868. return "catalog.json"in e && "base.url"in e && 1 < Object.keys(e).length
  27869. },
  27870. update: function(e) {
  27871. return this.baseUrl = e["base.url"],
  27872. this.cache = e,
  27873. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27874. $.when()
  27875. },
  27876. get: function(e) {
  27877. var t = this.cache[e];
  27878. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  27879. }
  27880. },
  27881. n.prototype = {
  27882. version: 3,
  27883. validate: function(e) {
  27884. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  27885. },
  27886. update: function(e) {
  27887. return this.baseUrl = e.templates[0],
  27888. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27889. $.when()
  27890. },
  27891. get: function(e) {
  27892. return this.baseUrl.replace("{{filename}}", e)
  27893. }
  27894. },
  27895. r.prototype = {
  27896. init: function() {
  27897. return this.initialLoadingPromise || (setInterval(function() {
  27898. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  27899. Date.now() + a.signedUrlRefreshBuffer > e && (l.debug("Refreshing urls..."),
  27900. this.refresh().done(function() {
  27901. l.debug("Refreshed")
  27902. }).fail(function() {
  27903. l.error("Failed url refresh, urls might go stale soon")
  27904. }))
  27905. }
  27906. .bind(this), a.signedUrlCheckInterval),
  27907. this.initialLoadingPromise = this.refresh()),
  27908. this.initialLoadingPromise
  27909. },
  27910. refresh: function(e) {
  27911. return {},
  27912. $.Deferred().resolve()
  27913. },
  27914. get: function(e) {
  27915. return window.DATA.files.templates[0].replace("{{filename}}", e)
  27916. }
  27917. },
  27918. h.exports = r
  27919. }
  27920. ).call(this, "/js/util/ModelUrls.js")
  27921. }
  27922. , {
  27923. "../ab": 3,
  27924. "../constants": 8,
  27925. "./ajax": 181,
  27926. "./logger": 189,
  27927. "./showcase": 193
  27928. }],
  27929. 178: [function(l, c, e) {
  27930. (function(e) {
  27931. "use strict";
  27932. function t() {
  27933. i.call(this),
  27934. this.neighbourMap = {},
  27935. this.map = null
  27936. }
  27937. var f, g, m, v, y, A, C, I, E, _, b, w = l("three"), n = l("./common"), a = l("../settings"), r = l("../objects/Panorama"), o = (a = l("../settings"),
  27938. l("./aStar")), T = new (l("./logger"))(e), i = l("./IndexedCollection"), s = l("./transitions");
  27939. n.inherit(t, i),
  27940. t.prototype.getIndex = function(e) {
  27941. return e.id
  27942. }
  27943. ,
  27944. t.prototype.find = function(e, t) {
  27945. var i = n.filterAll(this.list, e);
  27946. return 0 === i.length ? null : (t && t.forEach(function(e) {
  27947. i = n.stableSort(i, e)
  27948. }),
  27949. i[0])
  27950. }
  27951. ,
  27952. /* t.prototype.sortByScore = function(e, t) {
  27953. var i = n.filterAll(this.list, e);
  27954. return 0 === i.length ? null : i = i.map(function(i) {
  27955. return {
  27956. pano: i,
  27957. score: t.reduce(function(e, t) {
  27958. return e + t(i)
  27959. }, 0)
  27960. }
  27961. }).sort(function(e, t) {
  27962. return t.score - e.score
  27963. })
  27964. } */
  27965. t.prototype.sortByScore = function( request, rank){
  27966. return common.sortByScore(this.list, request, rank)
  27967. }
  27968. ,
  27969. t.prototype.lowestByScore = function(e, t, i) {
  27970. return this.findRankedByScore(0, e, t, i)
  27971. }
  27972. ,
  27973. t.prototype.findRankedByScore = function(e, t, i, n) {
  27974. n && (n.candidates = null,
  27975. n.pano = null),
  27976. e = e || 0;
  27977. var r = this.sortByScore(t, i);
  27978. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  27979. n.pano = r[e].item),
  27980. r[e].item)
  27981. }
  27982. ,
  27983. t.prototype.showPanoScores = function(e) {
  27984. this.list.forEach(function(e) {
  27985. e.removeTextSprite()
  27986. });
  27987. var t = 6344768;
  27988. e.forEach(function(e) {
  27989. e.pano.addTextSprite(e.score.toFixed(2), t),
  27990. t = 16428055
  27991. })
  27992. }
  27993. ,
  27994. t.prototype.isNeighbour = function(e, t) {
  27995. return this.neighbourMap[e.id][t.id]
  27996. }
  27997. ,
  27998. t.prototype.getNeighbours = function(e) {
  27999. return this.neighbourMap[e.id]
  28000. }
  28001. ,
  28002. t.prototype.setNeighbour = function(e, t, i) {
  28003. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  28004. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  28005. this.neighbourMap[e.id][e.id] = !0,
  28006. this.neighbourMap[t.id][t.id] = !0,
  28007. this.neighbourMap[e.id][t.id] = i,
  28008. this.neighbourMap[t.id][e.id] = i,
  28009. this.neighbourMap[e.id]
  28010. }
  28011. ,
  28012. t.prototype.findClosest = function(e, t) {
  28013. var i = [r.filters.isPanoAligned()];
  28014. return t && i.push(r.filters.inDirection(e, t, .75)),
  28015. this.find(i, [r.sortFunctions.distanceToPoint(e)])
  28016. }
  28017. ,
  28018. t.prototype.dualNeighbors = function(e, t) {
  28019. var i, n = [];
  28020. for (i in this.neighbourMap[e.id])
  28021. this.neighbourMap[t.id][i] && n.push(i);
  28022. return n
  28023. }
  28024. ,
  28025. t.prototype.populate_path_graph = function() {
  28026. var e, t, i, n, r, o, a, s, l = Date.now(), c = {}, h = 0, u = new w.Vector3(0,0,0);
  28027. for (e = 0; e < this.list.length; e += 1) {
  28028. for (t in s = !(a = {}),
  28029. i = (r = this.list[e]).neighbourPanos || r.findNeighourPanos())
  28030. if (i[t]) {
  28031. o = this.index[t],
  28032. u.copy(r.floorPosition),
  28033. u.sub(o.floorPosition);
  28034. var d = Math.sqrt(u.x * u.x + u.z * u.z)
  28035. , p = (Math.abs(u.y),
  28036. Math.max(d, .01),
  28037. Math.max(0, Math.abs(u.y) - .2));
  28038. n = 0 < p ? (1,
  28039. p = Math.pow(4 * p, 2),
  28040. d = Math.pow(d, 2),
  28041. Math.sqrt(p * p + d * d)) : (1,
  28042. u.length()),
  28043. a[o.id] = n,
  28044. s = !0
  28045. }
  28046. s ? c[r.id] = a : h += 1
  28047. }
  28048. this.map = c,
  28049. T.info("graph ready in " + (Date.now() - l) + "ms, " + h + " had no neighbors")
  28050. }
  28051. ,
  28052. t.prototype.aStarSearch = function(e, t) {
  28053. var i = Date.now()
  28054. , n = new o({
  28055. start: e,
  28056. isEnd: function(e) {
  28057. return e === t
  28058. },
  28059. neighbor: function(e) {
  28060. var t = e.neighbourPanos || e.findNeighourPanos()
  28061. , i = [];
  28062. for (var n in t)
  28063. t[n] && i.push(this.index[n]); //add: t[n] &&
  28064. return i
  28065. }
  28066. .bind(this),
  28067. distance: function(e, t) {
  28068. return this.map[e.id][t.id]
  28069. }
  28070. .bind(this),
  28071. heuristic: function(e, t) {
  28072. return 1
  28073. }
  28074. .bind(this),
  28075. hash: function(e) {
  28076. return e.id
  28077. },
  28078. timeout: 5e3
  28079. });
  28080. if (T.debug("A* search in " + (Date.now() - i) + "ms"),
  28081. "success" !== n.status)
  28082. return T.debug("Did not find A* path from " + e + " to " + t),
  28083. null;
  28084. T.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  28085. var r = [];
  28086. return n.path.forEach(function(e) {
  28087. r.push(e.id)
  28088. }),
  28089. r
  28090. }
  28091. ,
  28092. t.prototype.includeNodesNearPath = (f = new w.Vector3,
  28093. g = new w.Vector3,
  28094. m = new w.Vector3,
  28095. v = new w.Vector3,
  28096. y = new w.Vector3,
  28097. A = new w.Vector3,
  28098. C = new w.Vector3,
  28099. I = new w.Vector3,
  28100. E = [],
  28101. _ = new w.Vector3,
  28102. b = new w.Vector3,
  28103. function(e, t) {
  28104. if (e)
  28105. for (var i = function(e, t, i) {
  28106. return y.copy(t).sub(e),
  28107. y.dot(i)
  28108. }, n = function(e, t) {
  28109. return i(_, e.position, m) - i(_, t.position, m)
  28110. }, r = 0; r < e.length - 1; ) {
  28111. var o = e[r]
  28112. , a = e[r + 1]
  28113. , s = this.index[o]
  28114. , l = this.index[a];
  28115. _.copy(s.position),
  28116. b.copy(l.position),
  28117. E.length = 0,
  28118. f.copy(b).sub(_),
  28119. m.copy(f).normalize();
  28120. for (var c = 0; c < this.list.length; c++) {
  28121. var h = this.list[c];
  28122. y.copy(h.position).sub(_);
  28123. var u = y.dot(m);
  28124. 0 < u && (C.copy(m),
  28125. C.multiplyScalar(u),
  28126. A.copy(y),
  28127. A.sub(C),
  28128. A.length() < t && (g.copy(f).negate(),
  28129. v.copy(g).normalize(),
  28130. I.copy(h.position).sub(b),
  28131. 0 < I.dot(v) && E.push(h)))
  28132. }
  28133. if (0 < E.length) {
  28134. E.sort(n);
  28135. for (var d = e.length + E.length - 1; d >= r + E.length; d--)
  28136. e[d] = e[d - E.length];
  28137. for (var p = 0; p < E.length; p++)
  28138. e[p + r + 1] = E[p].id
  28139. }
  28140. r += E.length + 1
  28141. }
  28142. }
  28143. ),
  28144. /* t.prototype.fadeMarkerOpacity = function(e, t) {
  28145. var i = void 0 === e ? a.panorama.markerOpacity : e
  28146. , n = this.list.findIndex(function(e) {
  28147. return e.marker
  28148. });
  28149. if (!(n < 0)) {
  28150. var r = this.list[n].marker.material.opacity;
  28151. if (r !== e) {
  28152. var o = i - r;
  28153. s.trigger({
  28154. func: function(e, t) {
  28155. var i = r + e * o;
  28156. this.forEach(function(e) {
  28157. e.marker && (e.marker.material.opacity = i)
  28158. })
  28159. }
  28160. .bind(this),
  28161. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  28162. name: "_fpm"
  28163. })
  28164. }
  28165. }
  28166. } */
  28167. t.prototype.fadeMarkerOpacity = function(e, t, gr) {
  28168. s.cancelById('fadeMarkerOpacity')
  28169. var n = this.list.findIndex(function (e) {
  28170. //why? 难道没有marker的pano吗 findeIndex:获取数组中函数返回值不为fasle的第一个元素索引位置
  28171. return e.marker
  28172. })
  28173. if (n < 0) {
  28174. //logger.info('marker findIndex<0')
  28175. return
  28176. }
  28177. var group
  28178. var tran = function (list, index) {
  28179. list.member = list.member.filter(function (m) {
  28180. return m.marker && m.marker.material.opacity != list.toOp
  28181. })
  28182. s.trigger({
  28183. func: function (e, t) {
  28184. //e:0-1
  28185. list.member.forEach(function (m) {
  28186. var o = m.marker.oldOpacity
  28187. var i = o + e * (list.toOp - o)
  28188. m.marker && (m.marker.material.opacity = i)
  28189. })
  28190. }.bind(this),
  28191. duration: void 0 == t ? a.markerOpacityTransitionTime : t,
  28192. name: '_fpm_' + index,
  28193. id: 'fadeMarkerOpacity',
  28194. })
  28195. }
  28196. this.forEach(function (e) {
  28197. //先记录旧的opacity
  28198. e.marker && (e.marker.oldOpacity = e.marker.material.opacity)
  28199. })
  28200. group = gr
  28201. /* if (e > 0 && gr) {
  28202. group = gr
  28203. } else {
  28204. group = [
  28205. {
  28206. member: this.list,
  28207. toOp: 0,
  28208. },
  28209. ]
  28210. } */
  28211. for (var i = 0; i < group.length; i++) {
  28212. tran(group[i], i)
  28213. }
  28214. }
  28215. ,
  28216. c.exports = t
  28217. }
  28218. ).call(this, "/js/util/PanoramaCollection.js")
  28219. }
  28220. , {
  28221. "../objects/Panorama": 148,
  28222. "../settings": 166,
  28223. "./IndexedCollection": 175,
  28224. "./aStar": 180,
  28225. "./common": 185,
  28226. "./logger": 189,
  28227. "./transitions": 195,
  28228. three: 217
  28229. }],
  28230. 179: [function(e, t, i) {
  28231. "use strict";
  28232. function n() {
  28233. this.actionSequence = [],
  28234. this.actionSequenceInProgress = !1
  28235. }
  28236. function r(e, t, i, n) {
  28237. c.trackAlways("zoom_" + e, {
  28238. from: t,
  28239. to: i,
  28240. pano: n
  28241. })
  28242. }
  28243. var o, a, s, l, c = e("../analytics");
  28244. n.prototype.reset = function(e) {
  28245. this.actionSequenceInProgress = !1,
  28246. this.actionSequence.length = 0
  28247. }
  28248. ,
  28249. n.prototype.addZoomAction = (a = o = null,
  28250. s = !1,
  28251. l = function() {
  28252. if (o = null,
  28253. 0 < this.actionSequence.length) {
  28254. var e = this.actionSequence[0].start
  28255. , t = this.actionSequence[this.actionSequence.length - 1].end;
  28256. 1 === e ? function(e, t) {
  28257. r("initial", 1, e, t)
  28258. }(t, a) : function(e, t, i) {
  28259. r("followup", e, t, i)
  28260. }(e, t, a)
  28261. }
  28262. this.reset()
  28263. }
  28264. ,
  28265. function(e, t, i) {
  28266. if (e !== t) {
  28267. s || (l = l.bind(this),
  28268. s = !0),
  28269. o && (window.clearTimeout(o),
  28270. o = null),
  28271. i === a && this.actionSequenceInProgress || (this.reset(),
  28272. a = i),
  28273. this.actionSequenceInProgress = !0;
  28274. var n = {
  28275. start: e,
  28276. end: t
  28277. };
  28278. this.actionSequence.push(n),
  28279. o = window.setTimeout(l, 150)
  28280. }
  28281. }
  28282. ),
  28283. t.exports = n
  28284. }
  28285. , {
  28286. "../analytics": 4
  28287. }],
  28288. 180: [function(e, t, i) {
  28289. "use strict";
  28290. function g(e) {
  28291. if (void 0 === e.parent)
  28292. return [e.data];
  28293. var t = g(e.parent);
  28294. return t.push(e.data),
  28295. t
  28296. }
  28297. function m(e) {
  28298. return e.toString()
  28299. }
  28300. function v(e, t) {
  28301. return e.f - t.f
  28302. }
  28303. var y = e("Set")
  28304. , A = e("heap")
  28305. , C = e("dict");
  28306. t.exports = function(e) {
  28307. void 0 === e.timeout && (e.timeout = 1 / 0);
  28308. var t = e.hash || m
  28309. , i = {
  28310. data: e.start,
  28311. g: 0,
  28312. h: e.heuristic(e.start)
  28313. }
  28314. , n = i;
  28315. i.f = i.h;
  28316. var r = new y
  28317. , o = new A(v)
  28318. , a = C();
  28319. o.push(i),
  28320. a.set(t(i.data), i);
  28321. for (var s = new Date; o.size(); ) {
  28322. if (new Date - s > e.timeout)
  28323. return {
  28324. status: "timeout",
  28325. cost: n.g,
  28326. path: g(n)
  28327. };
  28328. var l = o.pop();
  28329. if (a.delete(t(l.data)),
  28330. e.isEnd(l.data))
  28331. return {
  28332. status: "success",
  28333. cost: l.g,
  28334. path: g(l)
  28335. };
  28336. r.add(t(l.data));
  28337. for (var c = e.neighbor(l.data), h = 0; h < c.length; h++) {
  28338. var u = c[h];
  28339. if (!r.contains(t(u))) {
  28340. var d = l.g + e.distance(l.data, u)
  28341. , p = a.get(t(u))
  28342. , f = !1;
  28343. if (void 0 === p)
  28344. p = {
  28345. data: u
  28346. },
  28347. a.set(t(u), p);
  28348. else {
  28349. if (p.g < d)
  28350. continue;
  28351. f = !0
  28352. }
  28353. p.parent = l,
  28354. p.g = d,
  28355. p.h = e.heuristic(u),
  28356. p.f = d + p.h,
  28357. p.h < n.h && (n = p),
  28358. f ? o.heapify() : o.push(p)
  28359. }
  28360. }
  28361. }
  28362. return {
  28363. status: "noPath",
  28364. cost: n.g,
  28365. path: g(n)
  28366. }
  28367. }
  28368. }
  28369. , {
  28370. Set: 196,
  28371. dict: 210,
  28372. heap: 211
  28373. }],
  28374. 181: [function(i, n, e) {
  28375. (function(e) {
  28376. "use strict";
  28377. function s(e, t, i) {
  28378. function n() {
  28379. l.warn("Retrying ", t),
  28380. s(e, t, i).done(a.resolve.bind(a)).progress(a.notify.bind(a)).fail(a.reject.bind(a))
  28381. }
  28382. var r = function(e, t, i) {
  28383. var n = new XMLHttpRequest;
  28384. if (i && "withCredentials"in n)
  28385. n.open(e, t, i);
  28386. else if ("undefined" != typeof XDomainRequest)
  28387. (n = new XDomainRequest).open(e, t);
  28388. else {
  28389. if (i)
  28390. throw "Browser does not support CORS!";
  28391. n.open(e, t)
  28392. }
  28393. return n
  28394. }(e, t, !1);
  28395. if ((i = i || {}).retries = void 0 !== i.retries ? i.retries : 0,
  28396. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  28397. i.responseType)
  28398. if (-1 < ["arraybuffer", "text", "json"].indexOf(i.responseType))
  28399. r.responseType = i.responseType;
  28400. else {
  28401. if ("image/jpeg" !== i.responseType)
  28402. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  28403. r.responseType = "arraybuffer"
  28404. }
  28405. if ("json" === i.responseType && r.setRequestHeader("Accept", "application/json"),
  28406. i.auth && r.setRequestHeader("Authorization", i.auth),
  28407. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  28408. r.setRequestHeader("Content-Type", "application/json")),
  28409. "object" == typeof i.headers)
  28410. for (var o in i.headers)
  28411. r.setRequestHeader(o, i.headers[o]);
  28412. var a = $.Deferred();
  28413. return r.onreadystatechange = function(e) {
  28414. if (4 === this.readyState)
  28415. if (500 <= this.status && this.status <= 600 && i.retry && i.retries < 3)
  28416. i.retries++,
  28417. setTimeout(n, 1e3);
  28418. else if (200 === this.status) {
  28419. var t = function(e, t) {
  28420. var i = e.response;
  28421. if ("json" === t && "object" != typeof i)
  28422. try {
  28423. i = JSON.parse(e.responseText)
  28424. } catch (e) {
  28425. return void a.reject({
  28426. error: "Failed parsing JSON"
  28427. })
  28428. }
  28429. else if ("image/jpeg" === t) {
  28430. var n = new Uint8Array(e.response)
  28431. , r = new Blob([n],{
  28432. type: "image/jpeg"
  28433. })
  28434. , o = URL.createObjectURL(r);
  28435. (i = new Image).src = o,
  28436. i.crossOrigin = "Anonymous",
  28437. i.onload = function() {
  28438. URL.revokeObjectURL(o)
  28439. }
  28440. }
  28441. return i
  28442. }(this, i.responseType);
  28443. a.resolve(t)
  28444. } else
  28445. a.reject(this)
  28446. }
  28447. ,
  28448. r.onprogress = function(e) {
  28449. a.notify(e)
  28450. }
  28451. ,
  28452. r.send(i.data),
  28453. a.promise()
  28454. }
  28455. function o(e, t) {
  28456. var i = e + "__" + (t.responseType || null) + "__" + (t.auth || null) + "__" + (t.prefetchFrom || null);
  28457. return t.headers && function(t) {
  28458. return Object.keys(t).sort().map(function(e) {
  28459. return {
  28460. key: e,
  28461. value: t[e]
  28462. }
  28463. })
  28464. }(t.headers).forEach(function(e) {
  28465. i += "__" + e.key + ":" + e.value
  28466. }),
  28467. i
  28468. }
  28469. var t = i("./logger")
  28470. , a = i("../ab")
  28471. , l = new t(e);
  28472. window.URL = window.URL || window.webkitURL,
  28473. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  28474. window.DATA = window.DATA || {},
  28475. n.exports = {
  28476. get: function(e, t) {
  28477. var i, n = void 0 === (t = t || {}).cache || t.cache;
  28478. if (n) {
  28479. var r = function(e, t) {
  28480. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[o(e, t)] : null
  28481. }(e, t);
  28482. if (r)
  28483. return r
  28484. }
  28485. return i = t.prefetchFrom && window.DATA[t.prefetchFrom] ? $.when(window.DATA[t.prefetchFrom]) : s("GET", e, t),
  28486. n && function(e, t, i) {
  28487. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[o(e, t)] = i)
  28488. }(e, t, i),
  28489. i
  28490. },
  28491. post: function(e, t) {
  28492. return s("POST", e, t)
  28493. },
  28494. patch: function(e, t) {
  28495. return s("PATCH", e, t)
  28496. },
  28497. getImage: function(e, t) {
  28498. function i() {
  28499. l.warn("Retrying ", e),
  28500. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  28501. }
  28502. var n = $.Deferred()
  28503. , r = new Image
  28504. , o = this;
  28505. return e = a.changeIfImageOptimzing(e),
  28506. null != t || (t = 3),
  28507. r.onerror = function() {
  28508. 0 < t ? setTimeout(i, 1e3) : n.reject()
  28509. }
  28510. ,
  28511. r.onload = function() {
  28512. n.resolve(r)
  28513. }
  28514. ,
  28515. r.crossOrigin = "anonymous",
  28516. r.src = e,
  28517. n
  28518. }
  28519. }
  28520. }
  28521. ).call(this, "/js/util/ajax.js")
  28522. }
  28523. , {
  28524. "../ab": 3,
  28525. "./logger": 189
  28526. }],
  28527. 182: [function(e, t, i) {
  28528. "use strict";
  28529. function n(e, t) {
  28530. var i = window.navigator.userAgent.match(e);
  28531. return i = i ? i[1].split(t) : [],
  28532. {
  28533. major: parseInt(i[0]) || 0,
  28534. minor: parseInt(i[1]) || 0,
  28535. patch: parseInt(i[2]) || 0
  28536. }
  28537. }
  28538. var r = e("../exception/DeviceMismatchException");
  28539. t.exports = {
  28540. supportsFullscreen: function() {
  28541. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  28542. },
  28543. isPointerLocked: function() {
  28544. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  28545. },
  28546. requestFullscreen: function(e, t) {
  28547. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  28548. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  28549. },
  28550. requestPointerLock: function() {
  28551. var e;
  28552. if (document.fullscreenElement)
  28553. e = document.fullscreenElement();
  28554. else if (document.mozFullscreenElement)
  28555. e = document.mozFullscreenElement();
  28556. else if (document.mozFullScreenElement)
  28557. e = document.mozFullScreenElement();
  28558. else {
  28559. if (!document.webkitFullscreenElement)
  28560. return;
  28561. e = document.webkitFullscreenElement()
  28562. }
  28563. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  28564. e.requestPointerLock(),
  28565. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  28566. },
  28567. exitPointerLock: function() {
  28568. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  28569. document.exitPointerLock()
  28570. },
  28571. exitFullscreen: function() {
  28572. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  28573. },
  28574. details: function() {
  28575. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  28576. return e ? {
  28577. name: e[1],
  28578. version: parseInt(e[2]),
  28579. platform: navigator.platform
  28580. } : {}
  28581. },
  28582. is: function(e) {
  28583. return this.details() && this.details().name === e
  28584. },
  28585. inIframe: function() {
  28586. return window.parent !== window
  28587. },
  28588. aspectRatio: function() {
  28589. var e = $("#player").width() / $("#player").height();
  28590. return isFinite(e) ? e : 0
  28591. },
  28592. userAgent: function() {
  28593. return window.navigator.userAgent
  28594. },
  28595. isLandscape: function() {
  28596. return this.isMobile && 1 < this.aspectRatio()
  28597. },
  28598. isSmallScreen: function() {
  28599. return screen.width / window.devicePixelRatio < 240
  28600. },
  28601. detectIE: function() {
  28602. return -1 !== window.navigator.userAgent.indexOf("MSIE ") || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  28603. },
  28604. detectSafari: function() {
  28605. return -1 !== window.navigator.userAgent.indexOf("Safari") && !this.detectChrome()
  28606. },
  28607. detectFirefox: function() {
  28608. return -1 !== window.navigator.userAgent.indexOf("Firefox")
  28609. },
  28610. detectChrome: function() {
  28611. return -1 !== window.navigator.userAgent.indexOf("Chrome") && !this.detectOpera()
  28612. },
  28613. detectOpera: function() {
  28614. return -1 !== window.navigator.userAgent.indexOf("OPR")
  28615. },
  28616. detectIOS: function() {
  28617. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  28618. },
  28619. detectIPad: function() {
  28620. var e = window.navigator.userAgent;
  28621. return /iPad/.test(e)
  28622. },
  28623. detectIPod: function() {
  28624. var e = window.navigator.userAgent;
  28625. return /iPod/.test(e)
  28626. },
  28627. detectIPhone: function() {
  28628. var e = window.navigator.userAgent;
  28629. return /iPhone/.test(e)
  28630. },
  28631. detectAndroid: function() {
  28632. return -1 !== window.navigator.userAgent.indexOf("Android")
  28633. },
  28634. detectAndroidMobile: function() {
  28635. var e = window.navigator.userAgent;
  28636. return this.detectAndroid() && -1 !== e.indexOf("Mobile")
  28637. },
  28638. detectSamsungNative: function() {
  28639. var e = window.navigator.userAgent;
  28640. return -1 !== e.indexOf("SM-G900H") || -1 !== e.indexOf("GT-I9500") || -1 !== e.indexOf("SM-N900")
  28641. },
  28642. detectSamsungS6: function() {
  28643. return -1 !== window.navigator.userAgent.indexOf("SM-G92")
  28644. },
  28645. detectHUAWEI5X: function() {
  28646. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  28647. },
  28648. detectWebVR: function() {
  28649. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  28650. },
  28651. getVRDisplay: function() {
  28652. var t = $.Deferred();
  28653. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(e) {
  28654. 1 <= e.length && t.resolve(e[0]),
  28655. t.reject(null)
  28656. }),
  28657. t) : t.reject(null)
  28658. },
  28659. iosVersion: function() {
  28660. if (!this.detectIOS())
  28661. throw new r("Did not detect an iDevice");
  28662. return n(/((?:\d+\_?){1,3}) like Mac OS/, "_")
  28663. },
  28664. androidVersion: function() {
  28665. if (!this.detectAndroid())
  28666. throw new r("Did not detect an Android based device");
  28667. return n(/Android ((?:\d+\.?){1,3})/, ".")
  28668. },
  28669. valueFromCookie: function(e, t) {
  28670. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  28671. if (!i)
  28672. return t;
  28673. var n = i[1];
  28674. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  28675. }
  28676. }
  28677. Object.assign(window.browser, t.exports)
  28678. t.exports = window.browser
  28679. }
  28680. , {
  28681. "../exception/DeviceMismatchException": 56
  28682. }],
  28683. 183: [function(i, n, e) {
  28684. (function(e) {
  28685. "use strict";
  28686. var o = i("../controls/serializer")
  28687. , a = i("../util/math")
  28688. , s = i("./browser")
  28689. , l = i("../enum/Viewmode")
  28690. , t = i("../util/logger")
  28691. , c = i("three")
  28692. , h = new t(e);
  28693. n.exports = {
  28694. getStartCameraOptions: function(e, t) {
  28695. var i = function(e) {
  28696. var t = s.valueFromHash("start", "")
  28697. , i = {};
  28698. if ("" !== t) {
  28699. h.debug("Start override found in parameters, trying to parse..."),
  28700. i = function(e) {
  28701. return o.deserialize(e)
  28702. }(t) || {};
  28703. var n = s.valueFromHash("tag", null);
  28704. n && (i.tag = n),
  28705. i.panoId && (i.pano = e.get(i.panoId))
  28706. }
  28707. return i
  28708. }(t);
  28709. if (0 < Object.keys(i).length)
  28710. return i;
  28711. if (e.heroImage)
  28712. i = function(e, t) {
  28713. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  28714. return {};
  28715. var i = {}
  28716. , n = e.heroImage.metadata;
  28717. h.debug("Using start position from thumbnail image"),
  28718. i.position = n.camera_position,
  28719. i.quaternion = n.camera_quaternion;
  28720. try {
  28721. i.mode = l.convertWorkshopModeInt(n.camera_mode),
  28722. i.mode === l.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  28723. } catch (e) {
  28724. h.debug(e.message)
  28725. }
  28726. return i
  28727. }(e, t);
  28728. else if (window.DATA.camera_start) {
  28729. var n = window.DATA.camera_start;
  28730. try {
  28731. 0 < Object.keys(n).length && !a.isEmptyQuaternion(n.camera.quaternion) && (i.mode = l.convertWorkshopModeInt(n.mode),
  28732. i.position = (new c.Vector3).fromArray(n.camera.position),
  28733. i.quaternion = (new c.Quaternion).fromArray(n.camera.quaternion),
  28734. i.zoom = a.convertWorkshopOrthoZoom(n.camera.zoom),
  28735. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  28736. h.debug("Using camera_start"),
  28737. h.debug("Modeldata pano: ", i.pano.quaternion),
  28738. h.debug("Camera start pano: ", n.pano.quaternion)),
  28739. i.mode !== l.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility));
  28740. } catch (e) {
  28741. h.warn(e.message)
  28742. if(i.mode == "panorama" && !i.pano){
  28743. i.pano = t.list[0]
  28744. }
  28745. }
  28746. }
  28747. if (e.outsideAllowed() || i.mode === l.PANORAMA || (i = {}),
  28748. i.mode === l.MESH && i.position && (i.mode = l.PANORAMA,
  28749. i.pano = t.findClosest(i.position) ,
  28750. i.quaternion = i.pano.quaternion),
  28751. 0 === Object.keys(i).length) {
  28752. var r = t.list[0];
  28753. r && (i.mode = l.PANORAMA,
  28754. i.pano = r,
  28755. i.position = r.position,
  28756. i.quaternion = r.quaternion,
  28757. h.info("Starting at 1st pano " + r.id))
  28758. }
  28759. return i.mode = i.mode || l.DOLLHOUSE,
  28760. i
  28761. }
  28762. }
  28763. }
  28764. ).call(this, "/js/util/camera.js")
  28765. }
  28766. , {
  28767. "../controls/serializer": 14,
  28768. "../enum/Viewmode": 51,
  28769. "../util/logger": 189,
  28770. "../util/math": 190,
  28771. "./browser": 182,
  28772. three: 217
  28773. }],
  28774. 184: [function(e, t, i) {
  28775. "use strict";
  28776. function r(e, t, i) {
  28777. var n = t
  28778. , r = i;
  28779. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (n / r)) * a.DEGREES_PER_RADIAN
  28780. }
  28781. function o(e, t, i) {
  28782. var n = t
  28783. , r = i;
  28784. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (r / n)) * a.DEGREES_PER_RADIAN
  28785. }
  28786. var a = e("./MathLight");
  28787. t.exports = {
  28788. clampVFOV: function(e, t, i, n) {
  28789. return t < r(e, i, n) ? o(t, i, n) : e
  28790. },
  28791. getHFOVForCamera: function(e, t, i) {
  28792. return r(e.fov, t, i)
  28793. },
  28794. getHFOVFromVFOV: r,
  28795. getVFOVFromHFOV: o
  28796. }
  28797. window.MathLight = t.exports
  28798. MathLight.closeTo = function(e1,e2, precision){//xzw add 判断e1,e2是否接近
  28799. var prec = Math.pow(10, - (precision || 4));
  28800. var s1 = Math.abs(e1.x - e2.x) < prec && Math.abs(e1.y - e2.y) < prec && Math.abs(e1.z - e2.z) < prec
  28801. if(e1.w){
  28802. return s1 && Math.abs(e1.w - e2.w) < prec
  28803. }else return s1
  28804. }
  28805. }
  28806. , {
  28807. "./MathLight": 176
  28808. }],
  28809. 185: [function(e, t, i) {
  28810. "use strict";
  28811. var a = e("three");
  28812. t.exports = {
  28813. delayOneFrame: function(e) {
  28814. window.setTimeout(e, 1)
  28815. },
  28816. normalizeUrl: function(e) {
  28817. return e.replace("https://", "http://")
  28818. },
  28819. domainFromUrl: function(e) {
  28820. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  28821. return t ? t[3] : e
  28822. },
  28823. average: function(e, t) {
  28824. if (0 === e.length)
  28825. return null;
  28826. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  28827. i += t ? e[r][t] : e[r],
  28828. n++
  28829. }
  28830. return i / n
  28831. },
  28832. countUnique: function(e) {
  28833. for (var t = {}, i = 0; i < e.length; i++)
  28834. t[e[i]] = 1 + (t[e[i]] || 0);
  28835. return Object.keys(t).length
  28836. },
  28837. averageVectors: function(e, t) {
  28838. var i = new a.Vector3;
  28839. if (0 === e.length)
  28840. return i;
  28841. for (var n = 0, r = 0; r < e.length; r++) {
  28842. var o = t ? e[r][t] : e[r];
  28843. i.add(o),
  28844. n++
  28845. }
  28846. return i.divideScalar(n)
  28847. },
  28848. equalLists: function(e, t) {
  28849. if (e.length !== t.length)
  28850. return !1;
  28851. for (var i = 0; i < e.length; i++)
  28852. if (e[i] !== t[i])
  28853. return !1;
  28854. return !0
  28855. },
  28856. lowerMedian: function(e, t) {
  28857. return 0 === e.length ? null : (t = t || 2,
  28858. e.sort(function(e, t) {
  28859. return e - t
  28860. }),
  28861. e[Math.floor(e.length / t)])
  28862. },
  28863. stableSort: function(e, n) {
  28864. return e.map(function(e, t) {
  28865. return {
  28866. value: e,
  28867. index: t
  28868. }
  28869. }).sort(function(e, t) {
  28870. var i = n(e.value, t.value);
  28871. return 0 !== i ? i : e.index - t.index
  28872. }).map(function(e) {
  28873. return e.value
  28874. })
  28875. },
  28876. filterAll: function(e, i) {
  28877. return e.filter(function(t) {
  28878. return i.every(function(e) {
  28879. return e(t)
  28880. })
  28881. })
  28882. },
  28883. formatDate: function(e) {
  28884. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  28885. },
  28886. formatDatetime: function(e) {
  28887. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  28888. },
  28889. randomString: function(e) {
  28890. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  28891. t += i.charAt(Math.floor(Math.random() * i.length));
  28892. return t
  28893. },
  28894. uint8ToBase64: function(e, t) {
  28895. t && "number" == typeof t || (t = 8192);
  28896. for (var i = [], n = 0; n < e.length; n += t)
  28897. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  28898. return btoa(i.join(""))
  28899. },
  28900. uuid4: function e(t) {
  28901. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  28902. },
  28903. nth: function(e) {
  28904. return 1 === (e %= 10) ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  28905. },
  28906. extendObject: function(t, i) {
  28907. return Object.keys(i).forEach(function(e) {
  28908. t[e] = i[e]
  28909. }),
  28910. t
  28911. },
  28912. deepExtend: function e(t) {
  28913. t = t || {};
  28914. for (var i = 1; i < arguments.length; i++) {
  28915. var n = arguments[i];
  28916. if (n)
  28917. for (var r in n)
  28918. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  28919. }
  28920. return t
  28921. },
  28922. inherit: function(e, t) {
  28923. e.prototype = Object.create(t.prototype),
  28924. e.prototype.constructor = e
  28925. },
  28926. extend: function(e, t) {
  28927. for (var i in t.prototype)
  28928. e.prototype[i] = t.prototype[i]
  28929. },
  28930. getFileNameFromUrl:function(url){
  28931. return url.split('/').pop();
  28932. },
  28933. },
  28934. Math.sign = function(e) {
  28935. return e < 0 ? -1 : 1
  28936. }
  28937. window.common = t.exports
  28938. expandCommon(common)
  28939. }
  28940. , {
  28941. three: 217
  28942. }],
  28943. 186: [function(e, t, i) {
  28944. "use strict";
  28945. var r = {
  28946. linearTween: function(e, t, i, n) {
  28947. return i * e / n + t
  28948. },
  28949. easeInQuad: function(e, t, i, n) {
  28950. return i * (e /= n) * e + t
  28951. },
  28952. easeOutQuad: function(e, t, i, n) {
  28953. return -i * (e /= n) * (e - 2) + t
  28954. },
  28955. easeInOutQuad: function(e, t, i, n) {
  28956. return (e /= n / 2) < 1 ? i / 2 * e * e + t : -i / 2 * (--e * (e - 2) - 1) + t
  28957. },
  28958. easeInCubic: function(e, t, i, n) {
  28959. return i * (e /= n) * e * e + t
  28960. },
  28961. easeOutCubic: function(e, t, i, n) {
  28962. return e /= n,
  28963. i * (--e * e * e + 1) + t
  28964. },
  28965. easeInOutCubic: function(e, t, i, n) {
  28966. return (e /= n / 2) < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t
  28967. },
  28968. easeInQuart: function(e, t, i, n) {
  28969. return i * (e /= n) * e * e * e + t
  28970. },
  28971. easeOutQuart: function(e, t, i, n) {
  28972. return e /= n,
  28973. -i * (--e * e * e * e - 1) + t
  28974. },
  28975. easeInOutQuart: function(e, t, i, n) {
  28976. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e + t : -i / 2 * ((e -= 2) * e * e * e - 2) + t
  28977. },
  28978. easeInQuint: function(e, t, i, n) {
  28979. return i * (e /= n) * e * e * e * e + t
  28980. },
  28981. easeOutQuint: function(e, t, i, n) {
  28982. return e /= n,
  28983. i * (--e * e * e * e * e + 1) + t
  28984. },
  28985. easeInOutQuint: function(e, t, i, n) {
  28986. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e * e + t : i / 2 * ((e -= 2) * e * e * e * e + 2) + t
  28987. },
  28988. easeInSine: function(e, t, i, n) {
  28989. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  28990. },
  28991. easeOutSine: function(e, t, i, n) {
  28992. return i * Math.sin(e / n * (Math.PI / 2)) + t
  28993. },
  28994. easeInOutSine: function(e, t, i, n) {
  28995. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  28996. },
  28997. easeInExpo: function(e, t, i, n) {
  28998. return i * Math.pow(2, 10 * (e / n - 1)) + t
  28999. },
  29000. easeOutExpo: function(e, t, i, n) {
  29001. return i * (1 - Math.pow(2, -10 * e / n)) + t
  29002. },
  29003. easeInOutExpo: function(e, t, i, n) {
  29004. return (e /= n / 2) < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  29005. i / 2 * (2 - Math.pow(2, -10 * e)) + t)
  29006. },
  29007. easeInCirc: function(e, t, i, n) {
  29008. return e /= n,
  29009. -i * (Math.sqrt(1 - e * e) - 1) + t
  29010. },
  29011. easeOutCirc: function(e, t, i, n) {
  29012. return e /= n,
  29013. e--,
  29014. i * Math.sqrt(1 - e * e) + t
  29015. },
  29016. easeInOutCirc: function(e, t, i, n) {
  29017. return (e /= n / 2) < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  29018. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  29019. },
  29020. easeInElastic: function(e, t, i, n) {
  29021. var r = 1.70158
  29022. , o = 0
  29023. , a = i;
  29024. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  29025. r = a < Math.abs(i) ? (a = i,
  29026. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  29027. -a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) + t)
  29028. },
  29029. easeOutElastic: function(e, t, i, n) {
  29030. var r = 1.70158
  29031. , o = 0
  29032. , a = i;
  29033. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  29034. r = a < Math.abs(i) ? (a = i,
  29035. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  29036. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  29037. },
  29038. easeInOutElastic: function(e, t, i, n) {
  29039. var r = 1.70158
  29040. , o = 0
  29041. , a = i;
  29042. return 0 === e ? t : 2 == (e /= n / 2) ? t + i : (o = o || n * (.3 * 1.5),
  29043. r = a < Math.abs(i) ? (a = i,
  29044. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  29045. e < 1 ? a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) * -.5 + t : a * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) * .5 + i + t)
  29046. },
  29047. easeInBack: function(e, t, i, n, r) {
  29048. return void 0 === r && (r = 1.70158),
  29049. i * (e /= n) * e * ((r + 1) * e - r) + t
  29050. },
  29051. easeOutBack: function(e, t, i, n, r) {
  29052. return void 0 === r && (r = 1.70158),
  29053. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  29054. },
  29055. easeInOutBack: function(e, t, i, n, r) {
  29056. return void 0 === r && (r = 1.70158),
  29057. (e /= n / 2) < 1 ? i / 2 * (e * e * ((1 + (r *= 1.525)) * e - r)) + t : i / 2 * ((e -= 2) * e * ((1 + (r *= 1.525)) * e + r) + 2) + t
  29058. },
  29059. easeOutBounce: function(e, t, i, n) {
  29060. 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
  29061. },
  29062. easeInBounce: function(e, t, i, n) {
  29063. return i - r.easeOutBounce(n - e, 0, i, n) + t
  29064. },
  29065. easeInOutBounce: function(e, t, i, n) {
  29066. return e < n / 2 ? .5 * r.easeInBounce(2 * e, 0, i, n) + t : .5 * r.easeOutBounce(x, 2 * e - n, 0, i, n) + .5 * i + t
  29067. }
  29068. };
  29069. window.easing = t.exports = r
  29070. }
  29071. , {}],
  29072. 187: [function(e, t, i) {
  29073. "use strict";
  29074. function n() {
  29075. this.events = [],
  29076. this.valid = !1
  29077. }
  29078. var r = e("../enum/Joystick");
  29079. n.prototype.push = function(e, t) {
  29080. this.events.push({
  29081. direction: e,
  29082. pano: t
  29083. }),
  29084. this.valid = !0
  29085. }
  29086. ,
  29087. n.prototype.pop = function(e) {
  29088. var t = this.events.pop();
  29089. return this.events.length < 1 && (this.valid = !1),
  29090. t
  29091. }
  29092. ,
  29093. n.prototype.peek = function() {
  29094. return this.events.length ? this.events[this.events.length - 1] : {
  29095. direction: null,
  29096. pano: null
  29097. }
  29098. }
  29099. ,
  29100. n.prototype.invalidate = function() {
  29101. this.events = [],
  29102. this.valid = !1
  29103. }
  29104. ,
  29105. n.prototype.reversePano = function(e) {
  29106. if (!this.valid)
  29107. return null;
  29108. var t = this.peek();
  29109. return r.opposite(e) === t.direction ? (this.pop(),
  29110. t.pano) : null
  29111. }
  29112. ,
  29113. t.exports = n
  29114. }
  29115. , {
  29116. "../enum/Joystick": 29
  29117. }],
  29118. 188: [function(e, t, i) {
  29119. "use strict";
  29120. window.lerp = t.exports = {
  29121. vector: function(t, i) {
  29122. var n = t.clone();
  29123. return i = i.clone(),
  29124. function(e) {
  29125. t.set(n.x * (1 - e) + i.x * e, n.y * (1 - e) + i.y * e, n.z * (1 - e) + i.z * e)
  29126. }
  29127. },
  29128. quaternion: function(t, i) {
  29129. var n = t.clone();
  29130. return function(e) {
  29131. t.copy(n).slerp(i, e)
  29132. }
  29133. },
  29134. property: function(t, i, n, r) {
  29135. var o = t[i];
  29136. return function(e) {
  29137. t[i] = o * (1 - e) + n * e,
  29138. r && r(t[i])
  29139. }
  29140. },
  29141. uniform: function(t, i, n) {
  29142. var r = t.material.uniforms[i].value;
  29143. return function(e) {
  29144. t.material.uniforms[i] && (t.material.uniforms[i].value = r * (1 - e) + n * e)
  29145. }
  29146. },
  29147. matrix4: function(o, a) {
  29148. var s = o.clone();
  29149. return function(e) {
  29150. for (var t = o.elements, i = s.elements, n = a.elements, r = 0; r < 16; r++)
  29151. t[r] = i[r] * (1 - e) + n[r] * e
  29152. }
  29153. },
  29154. allUniforms: function(e, t, i) {
  29155. var n = e.map(function(e) {
  29156. return this.uniform(e, t, i)
  29157. }
  29158. .bind(this));
  29159. return function(t) {
  29160. n.forEach(function(e) {
  29161. e(t)
  29162. })
  29163. }
  29164. }
  29165. }
  29166. }
  29167. , {}],
  29168. 189: [function(e, t, i) {
  29169. "use strict";
  29170. function h(n) {
  29171. var e, t, i, r, o = n.split("/"), a = "[" + o[o.length - 1].replace(".js", "") + "]", s = {};
  29172. if (h.consoleEnabled) {
  29173. var l = function(e) {
  29174. $("#debug-console").append("<p>" + e + "</p>"),
  29175. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  29176. };
  29177. e = function(e) {
  29178. l(Array.prototype.slice.call(arguments).join(" "))
  29179. }
  29180. ,
  29181. t = function(e) {
  29182. l(Array.prototype.slice.call(arguments).join(" "))
  29183. }
  29184. ,
  29185. i = function(e) {
  29186. l("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  29187. }
  29188. ,
  29189. r = function(e) {
  29190. l("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  29191. }
  29192. } else
  29193. console.log ? (e = console.log,
  29194. t = console.info ? console.info : console.log,
  29195. i = console.warn ? console.warn : console.log,
  29196. r = console.error ? console.error : console.log) : e = t = i = r = function() {}
  29197. ;
  29198. function c(e) {
  29199. return [a, h.timestamp()].concat(Array.prototype.slice.call(e))
  29200. }
  29201. return {
  29202. debug: function() {
  29203. h.level >= h.levels.debug && e.apply(console, c(arguments))
  29204. },
  29205. info: function() {
  29206. h.level >= h.levels.info && t.apply(console, c(arguments))
  29207. },
  29208. warn: function() {
  29209. (function(e, t) {
  29210. if (u) {
  29211. var i = Array.prototype.slice.call(e).join(" ");
  29212. u.captureMessage(i, {
  29213. level: t,
  29214. path: n,
  29215. timestamp: h.timestamp()
  29216. })
  29217. }
  29218. }
  29219. )(arguments, "warn"),
  29220. h.level >= h.levels.warn && i.apply(console, c(arguments))
  29221. },
  29222. error: function() {
  29223. (function(e, t) {
  29224. if (u) {
  29225. var i = Array.prototype.slice.call(e).join(" ");
  29226. u.captureException(new Error(i), {
  29227. level: t,
  29228. path: n,
  29229. timestamp: h.timestamp()
  29230. })
  29231. }
  29232. }
  29233. )(arguments, "error"),
  29234. h.level >= h.levels.error && r.apply(console, c(arguments))
  29235. },
  29236. v3str: function(e, t) {
  29237. var i = void 0 === t ? 2 : t;
  29238. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  29239. },
  29240. eulstr: function(e, t) {
  29241. var i = void 0 === t ? 2 : t;
  29242. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  29243. },
  29244. time: function(e) {
  29245. h.level >= h.levels.debug && (s[e] = Date.now())
  29246. },
  29247. timeEnd: function(e) {
  29248. if (h.level >= h.levels.debug) {
  29249. var t = s[e];
  29250. if (!t)
  29251. return;
  29252. var i = (Date.now() - t) / 1e3;
  29253. this.debug(e, i + "s")
  29254. }
  29255. }
  29256. }
  29257. }
  29258. var u = window.Raven;
  29259. h.timestamp = function() {
  29260. return (Date.now() - window.navigationStart) / 1e3 + "s"
  29261. }
  29262. ,
  29263. h.level = (h.levels = {
  29264. debug: 3,
  29265. info: 2,
  29266. warn: 1,
  29267. error: 0
  29268. }).info,
  29269. t.exports = h
  29270. }
  29271. , {}],
  29272. 190: [function(e, t, i) {
  29273. "use strict";
  29274. var o = e("three")
  29275. , r = e("../enum/GLCubeFaces");
  29276. e("../constants");
  29277. t.exports = {
  29278. convertVisionVector: function(e) {
  29279. return new o.Vector3(e.x,e.z,-e.y)
  29280. },
  29281. convertVisionQuaternion: function(e) {
  29282. return new o.Quaternion(e.x,e.z,-e.y,e.w).multiply((new o.Quaternion).setFromAxisAngle(new o.Vector3(0,1,0), o.Math.degToRad(90)))
  29283. },
  29284. convertWorkshopVector: function(e) {
  29285. return new o.Vector3(-e.x,e.y,e.z)
  29286. },
  29287. convertWorkshopQuaternion: function(e) {
  29288. return new o.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new o.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  29289. },
  29290. convertWorkshopPanoramaQuaternion: function(e) {
  29291. return new o.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new o.Quaternion).setFromAxisAngle(new o.Vector3(0,1,0), o.Math.degToRad(270)))
  29292. },
  29293. convertWorkshopOrthoZoom: function(e) {
  29294. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  29295. },
  29296. toPrecision: function(e, t) {
  29297. function i(e, t) {
  29298. var i = Math.pow(10, t);
  29299. return Math.round(e * i) / i
  29300. }
  29301. if (e instanceof Array) {
  29302. for (var n = 0; n < e.length; n++)
  29303. e[n] = i(e[n], t);
  29304. return e
  29305. }
  29306. return i(e, t)
  29307. },
  29308. isEmptyQuaternion: function(e) {
  29309. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  29310. },
  29311. projectPositionToCanvas: function(e, t, i) {
  29312. (i = i || new o.Vector3).copy(e);
  29313. var n = .5 * $("#player").width()
  29314. , r = .5 * $("#player").height();
  29315. return i.project(t),
  29316. i.x = i.x * n + n,
  29317. i.y = -i.y * r + r,
  29318. i
  29319. },
  29320. convertScreenPositionToNDC: function(e, t, i) {
  29321. return (i = i || new o.Vector2).x = e / $("#player").width() * 2 - 1,
  29322. i.y = -t / $("#player").height() * 2 + 1,
  29323. i
  29324. },
  29325. constrainedTurn: function(e) {
  29326. var t = e % (2 * Math.PI);
  29327. return t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  29328. },
  29329. getFOVDotThreshold: function(e) {
  29330. return Math.cos(o.Math.degToRad(e / 2))
  29331. },
  29332. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  29333. switch (e) {
  29334. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  29335. i.set(1, t.y, t.x);
  29336. break;
  29337. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  29338. i.set(-1, t.y, -t.x);
  29339. break;
  29340. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  29341. i.set(-t.x, 1, -t.y);
  29342. break;
  29343. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  29344. i.set(-t.x, -1, t.y);
  29345. break;
  29346. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  29347. i.set(-t.x, t.y, 1);
  29348. break;
  29349. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  29350. i.set(t.x, t.y, -1)
  29351. }
  29352. n && i.normalize()
  29353. },
  29354. //add:
  29355. getPos2d : function(point, camera, dom){
  29356. var camera = camera ;
  29357. var dom = dom;
  29358. 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);
  29359. var x,y;
  29360. x = (pos.x + 1) / 2 * dom.clientWidth;
  29361. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  29362. var inSight = x <= dom.clientWidth && x >= 0
  29363. && y <= dom.clientHeight && y >= 0
  29364. return {
  29365. pos: new THREE.Vector2(x,y),
  29366. vector: pos,
  29367. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  29368. inSight : inSight //在屏幕范围内可见
  29369. };
  29370. },
  29371. getDirByLonLat: function(lon, lat) {
  29372. var dir = new THREE.Vector3();
  29373. var phi = THREE.Math.degToRad(90 - lat);
  29374. var theta = THREE.Math.degToRad(lon);
  29375. dir.x = Math.sin(phi) * Math.cos(theta);
  29376. dir.y = Math.cos(phi);
  29377. dir.z = Math.sin(phi) * Math.sin(theta);
  29378. return dir.negate();
  29379. }
  29380. }
  29381. window.math = t.exports
  29382. expandMath(math)
  29383. }
  29384. , {
  29385. "../constants": 8,
  29386. "../enum/GLCubeFaces": 25,
  29387. three: 217
  29388. }],
  29389. 191: [function(e, t, i) {
  29390. "use strict";
  29391. function o(e) {
  29392. return r[e]
  29393. }
  29394. var n = e("../enum/GLCubeFaces")
  29395. , a = [0, 1, 2, 3, 4, 5]
  29396. , r = {
  29397. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  29398. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  29399. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  29400. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  29401. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  29402. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  29403. };
  29404. t.exports = {
  29405. mapFaceToCubemapFace: o,
  29406. getCubemapUrls: function(i, n, r) {
  29407. return a.map(function(e, t) {
  29408. return i.get("pan/" + r + "/" + n + "_skybox" + o(e) + ".jpg")
  29409. }
  29410. .bind(this))
  29411. }
  29412. }
  29413. }
  29414. , {
  29415. "../enum/GLCubeFaces": 25
  29416. }],
  29417. 192: [function(e, t, i) {
  29418. "use strict";
  29419. t.exports = {
  29420. captureErrors: function(e, t, i) {
  29421. if ("Raven"in window) {
  29422. Raven.config(e, t).install(),
  29423. i && Raven.setTagsContext(i);
  29424. var n = console.warn
  29425. , r = console.error;
  29426. console.warn = function() {
  29427. var e = Array.prototype.slice.call(arguments);
  29428. Raven.captureMessage(e.join(" "), {
  29429. level: "warning"
  29430. }),
  29431. n.apply(console, e)
  29432. }
  29433. ,
  29434. console.error = function() {
  29435. var e = Array.prototype.slice.call(arguments);
  29436. Raven.captureException(new Error(e.join(" ")), {
  29437. level: "error"
  29438. }),
  29439. r.apply(console, e)
  29440. }
  29441. } else
  29442. console.error("Raven not found, not capturing errors.")
  29443. }
  29444. }
  29445. }
  29446. , {}],
  29447. 193: [function(c, h, e) {
  29448. (function(e) {
  29449. "use strict";
  29450. var i, n = c("./browser"), r = c("../constants"), o = c("url"), t = c("./logger"), a = c("three"), s = new t(e), l = {
  29451. getAuthorizationHeader: function() {
  29452. var e = n.valueFromHash("auth");
  29453. if (e)
  29454. return e.replace(",", " ");
  29455. var t = n.valueFromCookie("token");
  29456. return t ? "Token " + t : null
  29457. },
  29458. parseSidUrl: function(e) {
  29459. var t, i;
  29460. if (t = g_Prefix,
  29461. (e = e || "").match(/^https?/)) {
  29462. o.parse(e);
  29463. t = g_Prefix,
  29464. i = e
  29465. } else
  29466. i = (t = g_Prefix) + "data/" + e;
  29467. return {
  29468. urlBase: t,
  29469. urlModel: i,
  29470. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  29471. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  29472. }
  29473. },
  29474. getModelIDFromQueryString: function() {
  29475. return n.valueFromHash("model") || n.valueFromHash("m")
  29476. },
  29477. /* normalizeModeldata: function(e, i) {
  29478. e = JSON.parse(JSON.stringify(e));
  29479. var n = null;
  29480. if (e.images.forEach(function(t) {
  29481. if (t.metadata) {
  29482. if ("string" == typeof t.metadata)
  29483. try {
  29484. t.metadata = JSON.parse(t.metadata)
  29485. } catch (e) {
  29486. s.warn("Unable to parse image metadata"),
  29487. t.metadata = null
  29488. }
  29489. else
  29490. "object" == typeof t.metadata && s.debug("image.metadata already a JSON object");
  29491. t.metadata.camera_position instanceof Array ? (t.metadata.camera_position = (new a.Vector3).fromArray(t.metadata.camera_position),
  29492. t.metadata.camera_quaternion = (new a.Quaternion).fromArray(t.metadata.camera_quaternion)) : (t.metadata.camera_quaternion && (t.metadata.camera_quaternion = i.convertWorkshopQuaternion(t.metadata.camera_quaternion)),
  29493. t.metadata.camera_position && (t.metadata.camera_position = i.convertWorkshopVector(t.metadata.camera_position)),
  29494. t.metadata.zoom = t.metadata.zoom || 1),
  29495. !n && e.icon && e.icon === t.sid && (n = t.metadata)
  29496. }
  29497. }),
  29498. n && n.camera_quaternion && n.camera_position && n.scan_position && n.scan_quaternion) {
  29499. var t = {};
  29500. t.pano = {
  29501. quaternion: i.convertWorkshopPanoramaQuaternion(n.scan_quaternion),
  29502. position: i.convertWorkshopVector(n.scan_position),
  29503. uuid: n.scan_id
  29504. },
  29505. t.camera = {
  29506. quaternion: n.camera_quaternion,
  29507. position: n.camera_position
  29508. },
  29509. e.startPano = t
  29510. }
  29511. return e
  29512. }, */
  29513. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  29514. e = JSON.parse(JSON.stringify(e));
  29515. var i = null;
  29516. var deal = function(n) {
  29517. if(!n.metadata) return;
  29518. if ("string" == typeof n.metadata)
  29519. try {
  29520. n.metadata = JSON.parse(n.metadata)
  29521. } catch (e) {
  29522. s.warn("Unable to parse image metadata"),
  29523. n.metadata = null
  29524. }
  29525. else{
  29526. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  29527. }
  29528. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  29529. n.metadata.camera_position = new a.Vector3().fromArray(n.metadata.camera_position);
  29530. n.metadata.camera_quaternion = new a.Quaternion().fromArray(n.metadata.camera_quaternion);
  29531. }else{
  29532. n.metadata.camera_position = new a.Vector3().copy(n.metadata.camera_position)
  29533. n.metadata.camera_quaternion = new a.Quaternion().copy(n.metadata.camera_quaternion)
  29534. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  29535. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  29536. }
  29537. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  29538. }
  29539. //改
  29540. e.images.forEach(info=>{
  29541. if(info.locations){
  29542. info.locations.forEach(a=>deal(a))
  29543. }else{
  29544. deal(info)
  29545. }
  29546. })
  29547. //icon初始视角的:
  29548. if(i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  29549. var n = {};
  29550. n.pano = {
  29551. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  29552. position: t.convertWorkshopVector(i.scan_position),
  29553. uuid: i.scan_id
  29554. },
  29555. n.camera = {
  29556. quaternion: i.camera_quaternion,
  29557. position: i.camera_position
  29558. },
  29559. e.startPano = n
  29560. }
  29561. return e
  29562. },
  29563. visionVersionToInt: (i = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")),
  29564. function(e) {
  29565. if (!e)
  29566. throw new Error("Vision version is required");
  29567. var t = i.exec(e);
  29568. if (null === t)
  29569. throw new Error("String is not a vision version: " + e);
  29570. return parseInt(t[1])
  29571. }
  29572. ),
  29573. modelDataPromisesTiles: function(e) {
  29574. var t = e.vision_version || window.DATA.vision_version;
  29575. if (t)
  29576. try {
  29577. return l.visionVersionToInt(t) >= l.visionVersionToInt(r.visionTilingStartVersion)
  29578. } catch (e) {
  29579. s.warn("Invalid vision version: " + t)
  29580. }
  29581. return !1
  29582. }
  29583. };
  29584. h.exports = l
  29585. }
  29586. ).call(this, "/js/util/showcase.js")
  29587. }
  29588. , {
  29589. "../constants": 8,
  29590. "./browser": 182,
  29591. "./logger": 189,
  29592. three: 217,
  29593. url: 208
  29594. }],
  29595. 194: [function(e, t, i) {
  29596. "use strict";
  29597. var r = e("../util/ajax")
  29598. , o = e("three")
  29599. , a = e("../settings")
  29600. , s = {};
  29601. t.exports = {
  29602. load: function(e, t, i) {
  29603. var n = s[e];
  29604. return n ? t && setTimeout(function() {
  29605. t(n)
  29606. }, 1) : (n = new o.Texture,
  29607. a.minimalMemoryMode && (n.minFilter = o.LinearFilter,
  29608. n.magFilter = o.LinearFilter,
  29609. n.generateMipmaps = !1),
  29610. n.sourceFile = e,
  29611. s[e] = n,
  29612. r.getImage(e).then(function(e) {
  29613. n.image = e,
  29614. n.needsUpdate = !0,
  29615. t && t(n)
  29616. }).fail(i)),
  29617. n
  29618. },
  29619. loadBase64: function(e, t) {
  29620. t = t || "png";
  29621. var i = new o.Texture;
  29622. return i.image = document.createElement("img"),
  29623. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  29624. a.minimalMemoryMode && (i.minFilter = o.LinearFilter,
  29625. i.magFilter = o.LinearFilter,
  29626. i.generateMipmaps = !1),
  29627. i.needsUpdate = !0,
  29628. i
  29629. },
  29630. isLoaded: function(e) {
  29631. return !!s[e]
  29632. }
  29633. }
  29634. window.Texture = t.exports
  29635. }
  29636. , {
  29637. "../settings": 166,
  29638. "../util/ajax": 181,
  29639. three: 217
  29640. }],
  29641. 195: [function(e, t, i) {
  29642. "use strict";
  29643. var l = e("./easing");
  29644. window.transitions = t.exports = {
  29645. globalDone: null,
  29646. funcs: [],
  29647. counter: 0,
  29648. uniqueID: 0,
  29649. start: function(e, t, i, n, r, o, a) {
  29650. return n = n || 0,
  29651. this.funcs.push({
  29652. func: e,
  29653. current: -n * Math.abs(t),
  29654. duration: (1 - Math.max(n, 0)) * Math.abs(t),
  29655. done: i,
  29656. easing: r || l.linearTween,
  29657. cycling: t < 0,
  29658. running: !0,
  29659. debug: n < 0,
  29660. name: o || "T" + this.counter,
  29661. id: void 0 === a ? this.counter : a,
  29662. paused: !1
  29663. }),
  29664. e(0, 16),
  29665. this.counter += 1,
  29666. e
  29667. },
  29668. trigger: function(e) {
  29669. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  29670. , i = e.func || function() {}
  29671. , n = void 0 === e.duration ? 0 : e.duration;
  29672. void 0 !== e.cycling && e.cycling && (n = -Math.abs(n));
  29673. var r = e.done || null
  29674. , o = e.easing || l.linearTween
  29675. , a = e.name || "R" + this.counter
  29676. , s = void 0 === e.id ? this.counter : e.id;
  29677. return this.start(i, n, r, t, o, a, s)
  29678. },
  29679. setTimeout: function(e, t, i) {
  29680. var n = void 0 === i ? this.counter : i;
  29681. return this.trigger({
  29682. done: e,
  29683. duration: void 0 === t ? 0 : t,
  29684. name: "O" + this.counter,
  29685. id: n
  29686. })
  29687. },
  29688. pause: function() {
  29689. this.paused = !0
  29690. },
  29691. resume: function() {
  29692. this.paused = !1
  29693. },
  29694. update: function(n) {
  29695. this.funcs.forEach(function(e) {
  29696. if (!(e.paused || (e.current += 1e3 * n,
  29697. e.current < 0)))
  29698. if (e.current >= e.duration && !e.cycling) {
  29699. var t = e.easing(1, 0, 1, 1);
  29700. e.func(t, 1e3 * n),
  29701. e.done && e.done(),
  29702. e.running = !1
  29703. } else {
  29704. var i = e.easing(e.current % e.duration / e.duration, 0, 1, 1);
  29705. (e.func(i, 1e3 * n) || !1) && (e.done && e.done(),
  29706. e.running = !1)
  29707. }
  29708. });
  29709. var e = this.funcs.length;
  29710. this.funcs = this.funcs.filter(function(e) {
  29711. return e.running
  29712. });
  29713. var t = this.funcs.length;
  29714. if (0 < e && 0 === t && this.globalDone) {
  29715. var i = this.globalDone;
  29716. this.globalDone = null,
  29717. i()
  29718. }
  29719. },
  29720. adjustSpeed: function(e, t) {
  29721. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  29722. var r = i[n];
  29723. r.duration /= t,
  29724. r.current /= t
  29725. }
  29726. },
  29727. getById: function(t) {
  29728. return this.funcs.filter(function(e) {
  29729. return t === e.id
  29730. })
  29731. },
  29732. get: function(e) {
  29733. for (var t = 0; t < this.funcs.length; t += 1)
  29734. if (this.funcs[t].func === e)
  29735. return this.funcs[t];
  29736. return null
  29737. },
  29738. isRunning: function(e) {
  29739. var t = this.get(e);
  29740. return null !== t && t.running
  29741. },
  29742. countActive: function() {
  29743. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  29744. e += this.funcs[t].running;
  29745. return e
  29746. },
  29747. listActive: function() {
  29748. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  29749. this.funcs[t].running && e.push(this.funcs[t].name);
  29750. return e
  29751. },
  29752. done: function(e) {
  29753. this.globalDone = e
  29754. },
  29755. cancelById: function(e) {
  29756. var t = void 0 === e ? 0 : e;
  29757. this.funcs = this.funcs.filter(function(e) {
  29758. return e.id !== t
  29759. })
  29760. },
  29761. cancel: function(t) {
  29762. this.funcs = this.funcs.filter(function(e) {
  29763. return e.func !== t
  29764. })
  29765. },
  29766. getUniqueId: function() {
  29767. return this.uniqueID -= 1,
  29768. this.uniqueID
  29769. }
  29770. }
  29771. }
  29772. , {
  29773. "./easing": 186
  29774. }],
  29775. 196: [function(e, t, i) {
  29776. function n(e) {
  29777. if (this.set = {},
  29778. this.infContains = function() {
  29779. return !0
  29780. }
  29781. ,
  29782. "object" == typeof e)
  29783. if (e instanceof Array)
  29784. for (var t = 0; t < e.length; t++)
  29785. this.set[e[t]] = !0;
  29786. else
  29787. this.set = e;
  29788. else if ("function" == typeof e)
  29789. this.infContains = e;
  29790. else if (void 0 !== e)
  29791. throw new Error("set must be either an array or an object.")
  29792. }
  29793. (t.exports = n).prototype.has = n.prototype.contains = function(e) {
  29794. return !!this.set[e]
  29795. }
  29796. ,
  29797. n.prototype.add = function(e) {
  29798. if (1 == arguments.length)
  29799. this.set[e] = !0;
  29800. else
  29801. for (var t = 0; t < arguments.length; t++)
  29802. this.set[arguments[t]] = !0
  29803. }
  29804. ,
  29805. n.prototype.addAll = function(e) {
  29806. if ("object" != typeof e && !(e instanceof Array))
  29807. throw new Error("arr must be an array.");
  29808. for (var t = 0; t < e.length; t++)
  29809. this.add(e[t])
  29810. }
  29811. ,
  29812. n.prototype.delete = n.prototype.remove = function(e) {
  29813. if (1 == arguments.length)
  29814. delete this.set[e];
  29815. else
  29816. for (var t = 0; t < arguments.length; t++)
  29817. delete this.set[arguments[t]]
  29818. }
  29819. ,
  29820. n.prototype.clear = function() {
  29821. this.set = {}
  29822. }
  29823. ,
  29824. n.prototype.size = function() {
  29825. return Object.keys(this.set).length
  29826. }
  29827. ,
  29828. n.prototype.toString = function() {
  29829. return "{" + Object.keys(this.set).toString() + "}"
  29830. }
  29831. ,
  29832. n.prototype["*values"] = n.prototype.toArray = function() {
  29833. return void 0 === this.set ? [] : Object.keys(this.set)
  29834. }
  29835. }
  29836. , {}],
  29837. 197: [function(e, t, i) {}
  29838. , {}],
  29839. 198: [function(N, e, F) {
  29840. (function(e) {
  29841. "use strict";
  29842. function i() {
  29843. return u.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  29844. }
  29845. function o(e, t) {
  29846. if (i() < t)
  29847. throw new RangeError("Invalid typed array length");
  29848. return u.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t)).__proto__ = u.prototype : (null === e && (e = new u(t)),
  29849. e.length = t),
  29850. e
  29851. }
  29852. function u(e, t, i) {
  29853. if (!(u.TYPED_ARRAY_SUPPORT || this instanceof u))
  29854. return new u(e,t,i);
  29855. if ("number" != typeof e)
  29856. return n(this, e, t, i);
  29857. if ("string" == typeof t)
  29858. throw new Error("If encoding is specified then the first argument must be a string");
  29859. return a(this, e)
  29860. }
  29861. function n(e, t, i, n) {
  29862. if ("number" == typeof t)
  29863. throw new TypeError('"value" argument must not be a number');
  29864. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? function(e, t, i, n) {
  29865. if (t.byteLength,
  29866. i < 0 || t.byteLength < i)
  29867. throw new RangeError("'offset' is out of bounds");
  29868. if (t.byteLength < i + (n || 0))
  29869. throw new RangeError("'length' is out of bounds");
  29870. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  29871. u.TYPED_ARRAY_SUPPORT ? (e = t).__proto__ = u.prototype : e = s(e, t),
  29872. e
  29873. }(e, t, i, n) : "string" == typeof t ? function(e, t, i) {
  29874. if ("string" == typeof i && "" !== i || (i = "utf8"),
  29875. !u.isEncoding(i))
  29876. throw new TypeError('"encoding" must be a valid string encoding');
  29877. var n = 0 | c(t, i)
  29878. , r = (e = o(e, n)).write(t, i);
  29879. return r !== n && (e = e.slice(0, r)),
  29880. e
  29881. }(e, t, i) : function(e, t) {
  29882. if (u.isBuffer(t)) {
  29883. var i = 0 | l(t.length);
  29884. return 0 === (e = o(e, i)).length || t.copy(e, 0, 0, i),
  29885. e
  29886. }
  29887. if (t) {
  29888. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  29889. return "number" != typeof t.length || function(e) {
  29890. return e != e
  29891. }(t.length) ? o(e, 0) : s(e, t);
  29892. if ("Buffer" === t.type && L(t.data))
  29893. return s(e, t.data)
  29894. }
  29895. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  29896. }(e, t)
  29897. }
  29898. function r(e) {
  29899. if ("number" != typeof e)
  29900. throw new TypeError('"size" argument must be a number');
  29901. if (e < 0)
  29902. throw new RangeError('"size" argument must not be negative')
  29903. }
  29904. function a(e, t) {
  29905. if (r(t),
  29906. e = o(e, t < 0 ? 0 : 0 | l(t)),
  29907. !u.TYPED_ARRAY_SUPPORT)
  29908. for (var i = 0; i < t; ++i)
  29909. e[i] = 0;
  29910. return e
  29911. }
  29912. function s(e, t) {
  29913. var i = t.length < 0 ? 0 : 0 | l(t.length);
  29914. e = o(e, i);
  29915. for (var n = 0; n < i; n += 1)
  29916. e[n] = 255 & t[n];
  29917. return e
  29918. }
  29919. function l(e) {
  29920. if (e >= i())
  29921. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i().toString(16) + " bytes");
  29922. return 0 | e
  29923. }
  29924. function c(e, t) {
  29925. if (u.isBuffer(e))
  29926. return e.length;
  29927. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  29928. return e.byteLength;
  29929. "string" != typeof e && (e = "" + e);
  29930. var i = e.length;
  29931. if (0 === i)
  29932. return 0;
  29933. for (var n = !1; ; )
  29934. switch (t) {
  29935. case "ascii":
  29936. case "latin1":
  29937. case "binary":
  29938. return i;
  29939. case "utf8":
  29940. case "utf-8":
  29941. case void 0:
  29942. return S(e).length;
  29943. case "ucs2":
  29944. case "ucs-2":
  29945. case "utf16le":
  29946. case "utf-16le":
  29947. return 2 * i;
  29948. case "hex":
  29949. return i >>> 1;
  29950. case "base64":
  29951. return M(e).length;
  29952. default:
  29953. if (n)
  29954. return S(e).length;
  29955. t = ("" + t).toLowerCase(),
  29956. n = !0
  29957. }
  29958. }
  29959. function h(e, t, i) {
  29960. var n = e[t];
  29961. e[t] = e[i],
  29962. e[i] = n
  29963. }
  29964. function d(e, t, i, n, r) {
  29965. if (0 === e.length)
  29966. return -1;
  29967. if ("string" == typeof i ? (n = i,
  29968. i = 0) : 2147483647 < i ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  29969. i = +i,
  29970. isNaN(i) && (i = r ? 0 : e.length - 1),
  29971. i < 0 && (i = e.length + i),
  29972. i >= e.length) {
  29973. if (r)
  29974. return -1;
  29975. i = e.length - 1
  29976. } else if (i < 0) {
  29977. if (!r)
  29978. return -1;
  29979. i = 0
  29980. }
  29981. if ("string" == typeof t && (t = u.from(t, n)),
  29982. u.isBuffer(t))
  29983. return 0 === t.length ? -1 : p(e, t, i, n, r);
  29984. if ("number" == typeof t)
  29985. return t &= 255,
  29986. u.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? r ? Uint8Array.prototype.indexOf.call(e, t, i) : Uint8Array.prototype.lastIndexOf.call(e, t, i) : p(e, [t], i, n, r);
  29987. throw new TypeError("val must be string, number or Buffer")
  29988. }
  29989. function p(e, t, i, n, r) {
  29990. function o(e, t) {
  29991. return 1 === s ? e[t] : e.readUInt16BE(t * s)
  29992. }
  29993. var a, s = 1, l = e.length, c = t.length;
  29994. if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  29995. if (e.length < 2 || t.length < 2)
  29996. return -1;
  29997. l /= s = 2,
  29998. c /= 2,
  29999. i /= 2
  30000. }
  30001. if (r) {
  30002. var h = -1;
  30003. for (a = i; a < l; a++)
  30004. if (o(e, a) === o(t, -1 === h ? 0 : a - h)) {
  30005. if (-1 === h && (h = a),
  30006. a - h + 1 === c)
  30007. return h * s
  30008. } else
  30009. -1 !== h && (a -= a - h),
  30010. h = -1
  30011. } else
  30012. for (l < i + c && (i = l - c),
  30013. a = i; 0 <= a; a--) {
  30014. for (var u = !0, d = 0; d < c; d++)
  30015. if (o(e, a + d) !== o(t, d)) {
  30016. u = !1;
  30017. break
  30018. }
  30019. if (u)
  30020. return a
  30021. }
  30022. return -1
  30023. }
  30024. function g(e, t, i, n) {
  30025. i = Number(i) || 0;
  30026. var r = e.length - i;
  30027. n ? r < (n = Number(n)) && (n = r) : n = r;
  30028. var o = t.length;
  30029. if (o % 2 != 0)
  30030. throw new TypeError("Invalid hex string");
  30031. o / 2 < n && (n = o / 2);
  30032. for (var a = 0; a < n; ++a) {
  30033. var s = parseInt(t.substr(2 * a, 2), 16);
  30034. if (isNaN(s))
  30035. return a;
  30036. e[i + a] = s
  30037. }
  30038. return a
  30039. }
  30040. function m(e, t, i, n) {
  30041. return R(function(e) {
  30042. for (var t = [], i = 0; i < e.length; ++i)
  30043. t.push(255 & e.charCodeAt(i));
  30044. return t
  30045. }(t), e, i, n)
  30046. }
  30047. function f(e, t, i) {
  30048. i = Math.min(e.length, i);
  30049. for (var n = [], r = t; r < i; ) {
  30050. var o, a, s, l, c = e[r], h = null, u = 239 < c ? 4 : 223 < c ? 3 : 191 < c ? 2 : 1;
  30051. if (r + u <= i)
  30052. switch (u) {
  30053. case 1:
  30054. c < 128 && (h = c);
  30055. break;
  30056. case 2:
  30057. 128 == (192 & (o = e[r + 1])) && (127 < (l = (31 & c) << 6 | 63 & o) && (h = l));
  30058. break;
  30059. case 3:
  30060. o = e[r + 1],
  30061. a = e[r + 2],
  30062. 128 == (192 & o) && 128 == (192 & a) && (2047 < (l = (15 & c) << 12 | (63 & o) << 6 | 63 & a) && (l < 55296 || 57343 < l) && (h = l));
  30063. break;
  30064. case 4:
  30065. o = e[r + 1],
  30066. a = e[r + 2],
  30067. s = e[r + 3],
  30068. 128 == (192 & o) && 128 == (192 & a) && 128 == (192 & s) && (65535 < (l = (15 & c) << 18 | (63 & o) << 12 | (63 & a) << 6 | 63 & s) && l < 1114112 && (h = l))
  30069. }
  30070. null === h ? (h = 65533,
  30071. u = 1) : 65535 < h && (h -= 65536,
  30072. n.push(h >>> 10 & 1023 | 55296),
  30073. h = 56320 | 1023 & h),
  30074. n.push(h),
  30075. r += u
  30076. }
  30077. return function(e) {
  30078. var t = e.length;
  30079. if (t <= D)
  30080. return String.fromCharCode.apply(String, e);
  30081. for (var i = "", n = 0; n < t; )
  30082. i += String.fromCharCode.apply(String, e.slice(n, n += D));
  30083. return i
  30084. }(n)
  30085. }
  30086. function v(e, t, i) {
  30087. var n = "";
  30088. i = Math.min(e.length, i);
  30089. for (var r = t; r < i; ++r)
  30090. n += String.fromCharCode(127 & e[r]);
  30091. return n
  30092. }
  30093. function y(e, t, i) {
  30094. var n = "";
  30095. i = Math.min(e.length, i);
  30096. for (var r = t; r < i; ++r)
  30097. n += String.fromCharCode(e[r]);
  30098. return n
  30099. }
  30100. function A(e, t, i) {
  30101. var n, r = e.length;
  30102. (!t || t < 0) && (t = 0),
  30103. (!i || i < 0 || r < i) && (i = r);
  30104. for (var o = "", a = t; a < i; ++a)
  30105. o += (n = e[a]) < 16 ? "0" + n.toString(16) : n.toString(16);
  30106. return o
  30107. }
  30108. function C(e, t, i) {
  30109. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  30110. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  30111. return r
  30112. }
  30113. function I(e, t, i) {
  30114. if (e % 1 != 0 || e < 0)
  30115. throw new RangeError("offset is not uint");
  30116. if (i < e + t)
  30117. throw new RangeError("Trying to access beyond buffer length")
  30118. }
  30119. function E(e, t, i, n, r, o) {
  30120. if (!u.isBuffer(e))
  30121. throw new TypeError('"buffer" argument must be a Buffer instance');
  30122. if (r < t || t < o)
  30123. throw new RangeError('"value" argument is out of bounds');
  30124. if (i + n > e.length)
  30125. throw new RangeError("Index out of range")
  30126. }
  30127. function _(e, t, i, n) {
  30128. t < 0 && (t = 65535 + t + 1);
  30129. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  30130. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  30131. }
  30132. function b(e, t, i, n) {
  30133. t < 0 && (t = 4294967295 + t + 1);
  30134. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  30135. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  30136. }
  30137. function w(e, t, i, n) {
  30138. if (i + n > e.length)
  30139. throw new RangeError("Index out of range");
  30140. if (i < 0)
  30141. throw new RangeError("Index out of range")
  30142. }
  30143. function T(e, t, i, n, r) {
  30144. return r || w(e, 0, i, 4),
  30145. O.write(e, t, i, n, 23, 4),
  30146. i + 4
  30147. }
  30148. function x(e, t, i, n, r) {
  30149. return r || w(e, 0, i, 8),
  30150. O.write(e, t, i, n, 52, 8),
  30151. i + 8
  30152. }
  30153. function S(e, t) {
  30154. t = t || 1 / 0;
  30155. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  30156. if (55295 < (i = e.charCodeAt(a)) && i < 57344) {
  30157. if (!r) {
  30158. if (56319 < i) {
  30159. -1 < (t -= 3) && o.push(239, 191, 189);
  30160. continue
  30161. }
  30162. if (a + 1 === n) {
  30163. -1 < (t -= 3) && o.push(239, 191, 189);
  30164. continue
  30165. }
  30166. r = i;
  30167. continue
  30168. }
  30169. if (i < 56320) {
  30170. -1 < (t -= 3) && o.push(239, 191, 189),
  30171. r = i;
  30172. continue
  30173. }
  30174. i = 65536 + (r - 55296 << 10 | i - 56320)
  30175. } else
  30176. r && -1 < (t -= 3) && o.push(239, 191, 189);
  30177. if (r = null,
  30178. i < 128) {
  30179. if ((t -= 1) < 0)
  30180. break;
  30181. o.push(i)
  30182. } else if (i < 2048) {
  30183. if ((t -= 2) < 0)
  30184. break;
  30185. o.push(i >> 6 | 192, 63 & i | 128)
  30186. } else if (i < 65536) {
  30187. if ((t -= 3) < 0)
  30188. break;
  30189. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  30190. } else {
  30191. if (!(i < 1114112))
  30192. throw new Error("Invalid code point");
  30193. if ((t -= 4) < 0)
  30194. break;
  30195. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  30196. }
  30197. }
  30198. return o
  30199. }
  30200. function M(e) {
  30201. return P.toByteArray(function(e) {
  30202. if ((e = function(e) {
  30203. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  30204. }(e).replace(t, "")).length < 2)
  30205. return "";
  30206. for (; e.length % 4 != 0; )
  30207. e += "=";
  30208. return e
  30209. }(e))
  30210. }
  30211. function R(e, t, i, n) {
  30212. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  30213. t[r + i] = e[r];
  30214. return r
  30215. }
  30216. var P = N("base64-js")
  30217. , O = N("ieee754")
  30218. , L = N("isarray");
  30219. F.Buffer = u,
  30220. F.SlowBuffer = function(e) {
  30221. return +e != e && (e = 0),
  30222. u.alloc(+e)
  30223. }
  30224. ,
  30225. F.INSPECT_MAX_BYTES = 50,
  30226. u.TYPED_ARRAY_SUPPORT = void 0 !== e.TYPED_ARRAY_SUPPORT ? e.TYPED_ARRAY_SUPPORT : function() {
  30227. try {
  30228. var e = new Uint8Array(1);
  30229. return e.__proto__ = {
  30230. __proto__: Uint8Array.prototype,
  30231. foo: function() {
  30232. return 42
  30233. }
  30234. },
  30235. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  30236. } catch (e) {
  30237. return !1
  30238. }
  30239. }(),
  30240. F.kMaxLength = i(),
  30241. u.poolSize = 8192,
  30242. u._augment = function(e) {
  30243. return e.__proto__ = u.prototype,
  30244. e
  30245. }
  30246. ,
  30247. u.from = function(e, t, i) {
  30248. return n(null, e, t, i)
  30249. }
  30250. ,
  30251. u.TYPED_ARRAY_SUPPORT && (u.prototype.__proto__ = Uint8Array.prototype,
  30252. u.__proto__ = Uint8Array,
  30253. "undefined" != typeof Symbol && Symbol.species && u[Symbol.species] === u && Object.defineProperty(u, Symbol.species, {
  30254. value: null,
  30255. configurable: !0
  30256. })),
  30257. u.alloc = function(e, t, i) {
  30258. return function(e, t, i, n) {
  30259. return r(t),
  30260. 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)
  30261. }(null, e, t, i)
  30262. }
  30263. ,
  30264. u.allocUnsafe = function(e) {
  30265. return a(null, e)
  30266. }
  30267. ,
  30268. u.allocUnsafeSlow = function(e) {
  30269. return a(null, e)
  30270. }
  30271. ,
  30272. u.isBuffer = function(e) {
  30273. return !(null == e || !e._isBuffer)
  30274. }
  30275. ,
  30276. u.compare = function(e, t) {
  30277. if (!u.isBuffer(e) || !u.isBuffer(t))
  30278. throw new TypeError("Arguments must be Buffers");
  30279. if (e === t)
  30280. return 0;
  30281. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  30282. if (e[r] !== t[r]) {
  30283. i = e[r],
  30284. n = t[r];
  30285. break
  30286. }
  30287. return i < n ? -1 : n < i ? 1 : 0
  30288. }
  30289. ,
  30290. u.isEncoding = function(e) {
  30291. switch (String(e).toLowerCase()) {
  30292. case "hex":
  30293. case "utf8":
  30294. case "utf-8":
  30295. case "ascii":
  30296. case "latin1":
  30297. case "binary":
  30298. case "base64":
  30299. case "ucs2":
  30300. case "ucs-2":
  30301. case "utf16le":
  30302. case "utf-16le":
  30303. return !0;
  30304. default:
  30305. return !1
  30306. }
  30307. }
  30308. ,
  30309. u.concat = function(e, t) {
  30310. if (!L(e))
  30311. throw new TypeError('"list" argument must be an Array of Buffers');
  30312. if (0 === e.length)
  30313. return u.alloc(0);
  30314. var i;
  30315. if (void 0 === t)
  30316. for (i = t = 0; i < e.length; ++i)
  30317. t += e[i].length;
  30318. var n = u.allocUnsafe(t)
  30319. , r = 0;
  30320. for (i = 0; i < e.length; ++i) {
  30321. var o = e[i];
  30322. if (!u.isBuffer(o))
  30323. throw new TypeError('"list" argument must be an Array of Buffers');
  30324. o.copy(n, r),
  30325. r += o.length
  30326. }
  30327. return n
  30328. }
  30329. ,
  30330. u.byteLength = c,
  30331. u.prototype._isBuffer = !0,
  30332. u.prototype.swap16 = function() {
  30333. var e = this.length;
  30334. if (e % 2 != 0)
  30335. throw new RangeError("Buffer size must be a multiple of 16-bits");
  30336. for (var t = 0; t < e; t += 2)
  30337. h(this, t, t + 1);
  30338. return this
  30339. }
  30340. ,
  30341. u.prototype.swap32 = function() {
  30342. var e = this.length;
  30343. if (e % 4 != 0)
  30344. throw new RangeError("Buffer size must be a multiple of 32-bits");
  30345. for (var t = 0; t < e; t += 4)
  30346. h(this, t, t + 3),
  30347. h(this, t + 1, t + 2);
  30348. return this
  30349. }
  30350. ,
  30351. u.prototype.swap64 = function() {
  30352. var e = this.length;
  30353. if (e % 8 != 0)
  30354. throw new RangeError("Buffer size must be a multiple of 64-bits");
  30355. for (var t = 0; t < e; t += 8)
  30356. h(this, t, t + 7),
  30357. h(this, t + 1, t + 6),
  30358. h(this, t + 2, t + 5),
  30359. h(this, t + 3, t + 4);
  30360. return this
  30361. }
  30362. ,
  30363. u.prototype.toString = function() {
  30364. var e = 0 | this.length;
  30365. return 0 == e ? "" : 0 === arguments.length ? f(this, 0, e) : function(e, t, i) {
  30366. var n, r, o, a = !1;
  30367. if ((void 0 === t || t < 0) && (t = 0),
  30368. t > this.length)
  30369. return "";
  30370. if ((void 0 === i || i > this.length) && (i = this.length),
  30371. i <= 0)
  30372. return "";
  30373. if ((i >>>= 0) <= (t >>>= 0))
  30374. return "";
  30375. for (e = e || "utf8"; ; )
  30376. switch (e) {
  30377. case "hex":
  30378. return A(this, t, i);
  30379. case "utf8":
  30380. case "utf-8":
  30381. return f(this, t, i);
  30382. case "ascii":
  30383. return v(this, t, i);
  30384. case "latin1":
  30385. case "binary":
  30386. return y(this, t, i);
  30387. case "base64":
  30388. return n = this,
  30389. o = i,
  30390. 0 === (r = t) && o === n.length ? P.fromByteArray(n) : P.fromByteArray(n.slice(r, o));
  30391. case "ucs2":
  30392. case "ucs-2":
  30393. case "utf16le":
  30394. case "utf-16le":
  30395. return C(this, t, i);
  30396. default:
  30397. if (a)
  30398. throw new TypeError("Unknown encoding: " + e);
  30399. e = (e + "").toLowerCase(),
  30400. a = !0
  30401. }
  30402. }
  30403. .apply(this, arguments)
  30404. }
  30405. ,
  30406. u.prototype.equals = function(e) {
  30407. if (!u.isBuffer(e))
  30408. throw new TypeError("Argument must be a Buffer");
  30409. return this === e || 0 === u.compare(this, e)
  30410. }
  30411. ,
  30412. u.prototype.inspect = function() {
  30413. var e = ""
  30414. , t = F.INSPECT_MAX_BYTES;
  30415. return 0 < this.length && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  30416. this.length > t && (e += " ... ")),
  30417. "<Buffer " + e + ">"
  30418. }
  30419. ,
  30420. u.prototype.compare = function(e, t, i, n, r) {
  30421. if (!u.isBuffer(e))
  30422. throw new TypeError("Argument must be a Buffer");
  30423. if (void 0 === t && (t = 0),
  30424. void 0 === i && (i = e ? e.length : 0),
  30425. void 0 === n && (n = 0),
  30426. void 0 === r && (r = this.length),
  30427. t < 0 || i > e.length || n < 0 || r > this.length)
  30428. throw new RangeError("out of range index");
  30429. if (r <= n && i <= t)
  30430. return 0;
  30431. if (r <= n)
  30432. return -1;
  30433. if (i <= t)
  30434. return 1;
  30435. if (this === e)
  30436. return 0;
  30437. for (var o = (r >>>= 0) - (n >>>= 0), a = (i >>>= 0) - (t >>>= 0), s = Math.min(o, a), l = this.slice(n, r), c = e.slice(t, i), h = 0; h < s; ++h)
  30438. if (l[h] !== c[h]) {
  30439. o = l[h],
  30440. a = c[h];
  30441. break
  30442. }
  30443. return o < a ? -1 : a < o ? 1 : 0
  30444. }
  30445. ,
  30446. u.prototype.includes = function(e, t, i) {
  30447. return -1 !== this.indexOf(e, t, i)
  30448. }
  30449. ,
  30450. u.prototype.indexOf = function(e, t, i) {
  30451. return d(this, e, t, i, !0)
  30452. }
  30453. ,
  30454. u.prototype.lastIndexOf = function(e, t, i) {
  30455. return d(this, e, t, i, !1)
  30456. }
  30457. ,
  30458. u.prototype.write = function(e, t, i, n) {
  30459. if (void 0 === t)
  30460. n = "utf8",
  30461. i = this.length,
  30462. t = 0;
  30463. else if (void 0 === i && "string" == typeof t)
  30464. n = t,
  30465. i = this.length,
  30466. t = 0;
  30467. else {
  30468. if (!isFinite(t))
  30469. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  30470. t |= 0,
  30471. isFinite(i) ? (i |= 0,
  30472. void 0 === n && (n = "utf8")) : (n = i,
  30473. i = void 0)
  30474. }
  30475. var r, o, a, s, l, c, h, u, d, p = this.length - t;
  30476. if ((void 0 === i || p < i) && (i = p),
  30477. 0 < e.length && (i < 0 || t < 0) || t > this.length)
  30478. throw new RangeError("Attempt to write outside buffer bounds");
  30479. n = n || "utf8";
  30480. for (var f = !1; ; )
  30481. switch (n) {
  30482. case "hex":
  30483. return g(this, e, t, i);
  30484. case "utf8":
  30485. case "utf-8":
  30486. return u = t,
  30487. d = i,
  30488. R(S(e, (h = this).length - u), h, u, d);
  30489. case "ascii":
  30490. return m(this, e, t, i);
  30491. case "latin1":
  30492. case "binary":
  30493. return m(this, e, t, i);
  30494. case "base64":
  30495. return s = this,
  30496. l = t,
  30497. c = i,
  30498. R(M(e), s, l, c);
  30499. case "ucs2":
  30500. case "ucs-2":
  30501. case "utf16le":
  30502. case "utf-16le":
  30503. return o = t,
  30504. a = i,
  30505. R(function(e, t) {
  30506. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  30507. i = e.charCodeAt(a),
  30508. n = i >> 8,
  30509. r = i % 256,
  30510. o.push(r),
  30511. o.push(n);
  30512. return o
  30513. }(e, (r = this).length - o), r, o, a);
  30514. default:
  30515. if (f)
  30516. throw new TypeError("Unknown encoding: " + n);
  30517. n = ("" + n).toLowerCase(),
  30518. f = !0
  30519. }
  30520. }
  30521. ,
  30522. u.prototype.toJSON = function() {
  30523. return {
  30524. type: "Buffer",
  30525. data: Array.prototype.slice.call(this._arr || this, 0)
  30526. }
  30527. }
  30528. ;
  30529. var D = 4096;
  30530. u.prototype.slice = function(e, t) {
  30531. var i, n = this.length;
  30532. if ((e = ~~e) < 0 ? (e += n) < 0 && (e = 0) : n < e && (e = n),
  30533. (t = void 0 === t ? n : ~~t) < 0 ? (t += n) < 0 && (t = 0) : n < t && (t = n),
  30534. t < e && (t = e),
  30535. u.TYPED_ARRAY_SUPPORT)
  30536. (i = this.subarray(e, t)).__proto__ = u.prototype;
  30537. else {
  30538. var r = t - e;
  30539. i = new u(r,void 0);
  30540. for (var o = 0; o < r; ++o)
  30541. i[o] = this[o + e]
  30542. }
  30543. return i
  30544. }
  30545. ,
  30546. u.prototype.readUIntLE = function(e, t, i) {
  30547. e |= 0,
  30548. t |= 0,
  30549. i || I(e, t, this.length);
  30550. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30551. n += this[e + o] * r;
  30552. return n
  30553. }
  30554. ,
  30555. u.prototype.readUIntBE = function(e, t, i) {
  30556. e |= 0,
  30557. t |= 0,
  30558. i || I(e, t, this.length);
  30559. for (var n = this[e + --t], r = 1; 0 < t && (r *= 256); )
  30560. n += this[e + --t] * r;
  30561. return n
  30562. }
  30563. ,
  30564. u.prototype.readUInt8 = function(e, t) {
  30565. return t || I(e, 1, this.length),
  30566. this[e]
  30567. }
  30568. ,
  30569. u.prototype.readUInt16LE = function(e, t) {
  30570. return t || I(e, 2, this.length),
  30571. this[e] | this[e + 1] << 8
  30572. }
  30573. ,
  30574. u.prototype.readUInt16BE = function(e, t) {
  30575. return t || I(e, 2, this.length),
  30576. this[e] << 8 | this[e + 1]
  30577. }
  30578. ,
  30579. u.prototype.readUInt32LE = function(e, t) {
  30580. return t || I(e, 4, this.length),
  30581. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  30582. }
  30583. ,
  30584. u.prototype.readUInt32BE = function(e, t) {
  30585. return t || I(e, 4, this.length),
  30586. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  30587. }
  30588. ,
  30589. u.prototype.readIntLE = function(e, t, i) {
  30590. e |= 0,
  30591. t |= 0,
  30592. i || I(e, t, this.length);
  30593. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30594. n += this[e + o] * r;
  30595. return (r *= 128) <= n && (n -= Math.pow(2, 8 * t)),
  30596. n
  30597. }
  30598. ,
  30599. u.prototype.readIntBE = function(e, t, i) {
  30600. e |= 0,
  30601. t |= 0,
  30602. i || I(e, t, this.length);
  30603. for (var n = t, r = 1, o = this[e + --n]; 0 < n && (r *= 256); )
  30604. o += this[e + --n] * r;
  30605. return (r *= 128) <= o && (o -= Math.pow(2, 8 * t)),
  30606. o
  30607. }
  30608. ,
  30609. u.prototype.readInt8 = function(e, t) {
  30610. return t || I(e, 1, this.length),
  30611. 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
  30612. }
  30613. ,
  30614. u.prototype.readInt16LE = function(e, t) {
  30615. t || I(e, 2, this.length);
  30616. var i = this[e] | this[e + 1] << 8;
  30617. return 32768 & i ? 4294901760 | i : i
  30618. }
  30619. ,
  30620. u.prototype.readInt16BE = function(e, t) {
  30621. t || I(e, 2, this.length);
  30622. var i = this[e + 1] | this[e] << 8;
  30623. return 32768 & i ? 4294901760 | i : i
  30624. }
  30625. ,
  30626. u.prototype.readInt32LE = function(e, t) {
  30627. return t || I(e, 4, this.length),
  30628. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  30629. }
  30630. ,
  30631. u.prototype.readInt32BE = function(e, t) {
  30632. return t || I(e, 4, this.length),
  30633. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  30634. }
  30635. ,
  30636. u.prototype.readFloatLE = function(e, t) {
  30637. return t || I(e, 4, this.length),
  30638. O.read(this, e, !0, 23, 4)
  30639. }
  30640. ,
  30641. u.prototype.readFloatBE = function(e, t) {
  30642. return t || I(e, 4, this.length),
  30643. O.read(this, e, !1, 23, 4)
  30644. }
  30645. ,
  30646. u.prototype.readDoubleLE = function(e, t) {
  30647. return t || I(e, 8, this.length),
  30648. O.read(this, e, !0, 52, 8)
  30649. }
  30650. ,
  30651. u.prototype.readDoubleBE = function(e, t) {
  30652. return t || I(e, 8, this.length),
  30653. O.read(this, e, !1, 52, 8)
  30654. }
  30655. ,
  30656. u.prototype.writeUIntLE = function(e, t, i, n) {
  30657. e = +e,
  30658. t |= 0,
  30659. i |= 0,
  30660. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30661. var r = 1
  30662. , o = 0;
  30663. for (this[t] = 255 & e; ++o < i && (r *= 256); )
  30664. this[t + o] = e / r & 255;
  30665. return t + i
  30666. }
  30667. ,
  30668. u.prototype.writeUIntBE = function(e, t, i, n) {
  30669. e = +e,
  30670. t |= 0,
  30671. i |= 0,
  30672. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30673. var r = i - 1
  30674. , o = 1;
  30675. for (this[t + r] = 255 & e; 0 <= --r && (o *= 256); )
  30676. this[t + r] = e / o & 255;
  30677. return t + i
  30678. }
  30679. ,
  30680. u.prototype.writeUInt8 = function(e, t, i) {
  30681. return e = +e,
  30682. t |= 0,
  30683. i || E(this, e, t, 1, 255, 0),
  30684. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30685. this[t] = 255 & e,
  30686. t + 1
  30687. }
  30688. ,
  30689. u.prototype.writeUInt16LE = function(e, t, i) {
  30690. return e = +e,
  30691. t |= 0,
  30692. i || E(this, e, t, 2, 65535, 0),
  30693. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30694. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30695. t + 2
  30696. }
  30697. ,
  30698. u.prototype.writeUInt16BE = function(e, t, i) {
  30699. return e = +e,
  30700. t |= 0,
  30701. i || E(this, e, t, 2, 65535, 0),
  30702. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30703. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30704. t + 2
  30705. }
  30706. ,
  30707. u.prototype.writeUInt32LE = function(e, t, i) {
  30708. return e = +e,
  30709. t |= 0,
  30710. i || E(this, e, t, 4, 4294967295, 0),
  30711. u.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  30712. this[t + 2] = e >>> 16,
  30713. this[t + 1] = e >>> 8,
  30714. this[t] = 255 & e) : b(this, e, t, !0),
  30715. t + 4
  30716. }
  30717. ,
  30718. u.prototype.writeUInt32BE = function(e, t, i) {
  30719. return e = +e,
  30720. t |= 0,
  30721. i || E(this, e, t, 4, 4294967295, 0),
  30722. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30723. this[t + 1] = e >>> 16,
  30724. this[t + 2] = e >>> 8,
  30725. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30726. t + 4
  30727. }
  30728. ,
  30729. u.prototype.writeIntLE = function(e, t, i, n) {
  30730. if (e = +e,
  30731. t |= 0,
  30732. !n) {
  30733. var r = Math.pow(2, 8 * i - 1);
  30734. E(this, e, t, i, r - 1, -r)
  30735. }
  30736. var o = 0
  30737. , a = 1
  30738. , s = 0;
  30739. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  30740. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  30741. this[t + o] = (e / a >> 0) - s & 255;
  30742. return t + i
  30743. }
  30744. ,
  30745. u.prototype.writeIntBE = function(e, t, i, n) {
  30746. if (e = +e,
  30747. t |= 0,
  30748. !n) {
  30749. var r = Math.pow(2, 8 * i - 1);
  30750. E(this, e, t, i, r - 1, -r)
  30751. }
  30752. var o = i - 1
  30753. , a = 1
  30754. , s = 0;
  30755. for (this[t + o] = 255 & e; 0 <= --o && (a *= 256); )
  30756. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  30757. this[t + o] = (e / a >> 0) - s & 255;
  30758. return t + i
  30759. }
  30760. ,
  30761. u.prototype.writeInt8 = function(e, t, i) {
  30762. return e = +e,
  30763. t |= 0,
  30764. i || E(this, e, t, 1, 127, -128),
  30765. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30766. e < 0 && (e = 255 + e + 1),
  30767. this[t] = 255 & e,
  30768. t + 1
  30769. }
  30770. ,
  30771. u.prototype.writeInt16LE = function(e, t, i) {
  30772. return e = +e,
  30773. t |= 0,
  30774. i || E(this, e, t, 2, 32767, -32768),
  30775. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30776. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30777. t + 2
  30778. }
  30779. ,
  30780. u.prototype.writeInt16BE = function(e, t, i) {
  30781. return e = +e,
  30782. t |= 0,
  30783. i || E(this, e, t, 2, 32767, -32768),
  30784. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30785. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30786. t + 2
  30787. }
  30788. ,
  30789. u.prototype.writeInt32LE = function(e, t, i) {
  30790. return e = +e,
  30791. t |= 0,
  30792. i || E(this, e, t, 4, 2147483647, -2147483648),
  30793. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30794. this[t + 1] = e >>> 8,
  30795. this[t + 2] = e >>> 16,
  30796. this[t + 3] = e >>> 24) : b(this, e, t, !0),
  30797. t + 4
  30798. }
  30799. ,
  30800. u.prototype.writeInt32BE = function(e, t, i) {
  30801. return e = +e,
  30802. t |= 0,
  30803. i || E(this, e, t, 4, 2147483647, -2147483648),
  30804. e < 0 && (e = 4294967295 + e + 1),
  30805. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30806. this[t + 1] = e >>> 16,
  30807. this[t + 2] = e >>> 8,
  30808. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30809. t + 4
  30810. }
  30811. ,
  30812. u.prototype.writeFloatLE = function(e, t, i) {
  30813. return T(this, e, t, !0, i)
  30814. }
  30815. ,
  30816. u.prototype.writeFloatBE = function(e, t, i) {
  30817. return T(this, e, t, !1, i)
  30818. }
  30819. ,
  30820. u.prototype.writeDoubleLE = function(e, t, i) {
  30821. return x(this, e, t, !0, i)
  30822. }
  30823. ,
  30824. u.prototype.writeDoubleBE = function(e, t, i) {
  30825. return x(this, e, t, !1, i)
  30826. }
  30827. ,
  30828. u.prototype.copy = function(e, t, i, n) {
  30829. if (i = i || 0,
  30830. n || 0 === n || (n = this.length),
  30831. t >= e.length && (t = e.length),
  30832. t = t || 0,
  30833. 0 < n && n < i && (n = i),
  30834. n === i)
  30835. return 0;
  30836. if (0 === e.length || 0 === this.length)
  30837. return 0;
  30838. if (t < 0)
  30839. throw new RangeError("targetStart out of bounds");
  30840. if (i < 0 || i >= this.length)
  30841. throw new RangeError("sourceStart out of bounds");
  30842. if (n < 0)
  30843. throw new RangeError("sourceEnd out of bounds");
  30844. n > this.length && (n = this.length),
  30845. e.length - t < n - i && (n = e.length - t + i);
  30846. var r, o = n - i;
  30847. if (this === e && i < t && t < n)
  30848. for (r = o - 1; 0 <= r; --r)
  30849. e[r + t] = this[r + i];
  30850. else if (o < 1e3 || !u.TYPED_ARRAY_SUPPORT)
  30851. for (r = 0; r < o; ++r)
  30852. e[r + t] = this[r + i];
  30853. else
  30854. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  30855. return o
  30856. }
  30857. ,
  30858. u.prototype.fill = function(e, t, i, n) {
  30859. if ("string" == typeof e) {
  30860. if ("string" == typeof t ? (n = t,
  30861. t = 0,
  30862. i = this.length) : "string" == typeof i && (n = i,
  30863. i = this.length),
  30864. 1 === e.length) {
  30865. var r = e.charCodeAt(0);
  30866. r < 256 && (e = r)
  30867. }
  30868. if (void 0 !== n && "string" != typeof n)
  30869. throw new TypeError("encoding must be a string");
  30870. if ("string" == typeof n && !u.isEncoding(n))
  30871. throw new TypeError("Unknown encoding: " + n)
  30872. } else
  30873. "number" == typeof e && (e &= 255);
  30874. if (t < 0 || this.length < t || this.length < i)
  30875. throw new RangeError("Out of range index");
  30876. if (i <= t)
  30877. return this;
  30878. var o;
  30879. if (t >>>= 0,
  30880. i = void 0 === i ? this.length : i >>> 0,
  30881. "number" == typeof (e = e || 0))
  30882. for (o = t; o < i; ++o)
  30883. this[o] = e;
  30884. else {
  30885. var a = u.isBuffer(e) ? e : S(new u(e,n).toString())
  30886. , s = a.length;
  30887. for (o = 0; o < i - t; ++o)
  30888. this[o + t] = a[o % s]
  30889. }
  30890. return this
  30891. }
  30892. ;
  30893. var t = /[^+\/0-9A-Za-z-_]/g
  30894. }
  30895. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30896. }
  30897. , {
  30898. "base64-js": 199,
  30899. ieee754: 200,
  30900. isarray: 201
  30901. }],
  30902. 199: [function(e, t, i) {
  30903. "use strict";
  30904. function l(e) {
  30905. var t = e.length;
  30906. if (0 < t % 4)
  30907. throw new Error("Invalid string. Length must be a multiple of 4");
  30908. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  30909. }
  30910. function c(e, t, i) {
  30911. for (var n, r = [], o = t; o < i; o += 3)
  30912. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  30913. r.push(h[(a = n) >> 18 & 63] + h[a >> 12 & 63] + h[a >> 6 & 63] + h[63 & a]);
  30914. var a;
  30915. return r.join("")
  30916. }
  30917. i.byteLength = function(e) {
  30918. return 3 * e.length / 4 - l(e)
  30919. }
  30920. ,
  30921. i.toByteArray = function(e) {
  30922. var t, i, n, r, o, a = e.length;
  30923. r = l(e),
  30924. o = new d(3 * a / 4 - r),
  30925. i = 0 < r ? a - 4 : a;
  30926. var s = 0;
  30927. for (t = 0; t < i; t += 4,
  30928. 3)
  30929. n = u[e.charCodeAt(t)] << 18 | u[e.charCodeAt(t + 1)] << 12 | u[e.charCodeAt(t + 2)] << 6 | u[e.charCodeAt(t + 3)],
  30930. o[s++] = n >> 16 & 255,
  30931. o[s++] = n >> 8 & 255,
  30932. o[s++] = 255 & n;
  30933. return 2 === r ? (n = u[e.charCodeAt(t)] << 2 | u[e.charCodeAt(t + 1)] >> 4,
  30934. o[s++] = 255 & n) : 1 === r && (n = u[e.charCodeAt(t)] << 10 | u[e.charCodeAt(t + 1)] << 4 | u[e.charCodeAt(t + 2)] >> 2,
  30935. o[s++] = n >> 8 & 255,
  30936. o[s++] = 255 & n),
  30937. o
  30938. }
  30939. ,
  30940. i.fromByteArray = function(e) {
  30941. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 0, s = i - n; a < s; a += 16383)
  30942. o.push(c(e, a, s < a + 16383 ? s : a + 16383));
  30943. return 1 == n ? (t = e[i - 1],
  30944. r += h[t >> 2],
  30945. r += h[t << 4 & 63],
  30946. r += "==") : 2 == n && (t = (e[i - 2] << 8) + e[i - 1],
  30947. r += h[t >> 10],
  30948. r += h[t >> 4 & 63],
  30949. r += h[t << 2 & 63],
  30950. r += "="),
  30951. o.push(r),
  30952. o.join("")
  30953. }
  30954. ;
  30955. for (var h = [], u = [], d = "undefined" != typeof Uint8Array ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = 0, o = n.length; r < o; ++r)
  30956. h[r] = n[r],
  30957. u[n.charCodeAt(r)] = r;
  30958. u["-".charCodeAt(0)] = 62,
  30959. u["_".charCodeAt(0)] = 63
  30960. }
  30961. , {}],
  30962. 200: [function(e, t, i) {
  30963. i.read = function(e, t, i, n, r) {
  30964. 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];
  30965. for (u += d,
  30966. o = p & (1 << -h) - 1,
  30967. p >>= -h,
  30968. h += s; 0 < h; o = 256 * o + e[t + u],
  30969. u += d,
  30970. h -= 8)
  30971. ;
  30972. for (a = o & (1 << -h) - 1,
  30973. o >>= -h,
  30974. h += n; 0 < h; a = 256 * a + e[t + u],
  30975. u += d,
  30976. h -= 8)
  30977. ;
  30978. if (0 === o)
  30979. o = 1 - c;
  30980. else {
  30981. if (o === l)
  30982. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  30983. a += Math.pow(2, n),
  30984. o -= c
  30985. }
  30986. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  30987. }
  30988. ,
  30989. i.write = function(e, t, i, n, r, o) {
  30990. 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;
  30991. for (t = Math.abs(t),
  30992. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  30993. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  30994. t * (l = Math.pow(2, -a)) < 1 && (a--,
  30995. l *= 2),
  30996. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  30997. l /= 2),
  30998. h <= a + u ? (s = 0,
  30999. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  31000. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  31001. a = 0)); 8 <= r; e[i + p] = 255 & s,
  31002. p += f,
  31003. s /= 256,
  31004. r -= 8)
  31005. ;
  31006. for (a = a << r | s,
  31007. c += r; 0 < c; e[i + p] = 255 & a,
  31008. p += f,
  31009. a /= 256,
  31010. c -= 8)
  31011. ;
  31012. e[i + p - f] |= 128 * g
  31013. }
  31014. }
  31015. , {}],
  31016. 201: [function(e, t, i) {
  31017. var n = {}.toString;
  31018. t.exports = Array.isArray || function(e) {
  31019. return "[object Array]" == n.call(e)
  31020. }
  31021. }
  31022. , {}],
  31023. 202: [function(e, t, i) {
  31024. function n() {
  31025. this._events = this._events || {},
  31026. this._maxListeners = this._maxListeners || void 0
  31027. }
  31028. function l(e) {
  31029. return "function" == typeof e
  31030. }
  31031. function c(e) {
  31032. return "object" == typeof e && null !== e
  31033. }
  31034. function h(e) {
  31035. return void 0 === e
  31036. }
  31037. ((t.exports = n).EventEmitter = n).prototype._events = void 0,
  31038. n.prototype._maxListeners = void 0,
  31039. n.defaultMaxListeners = 10,
  31040. n.prototype.setMaxListeners = function(e) {
  31041. if (!function(e) {
  31042. return "number" == typeof e
  31043. }(e) || e < 0 || isNaN(e))
  31044. throw TypeError("n must be a positive number");
  31045. return this._maxListeners = e,
  31046. this
  31047. }
  31048. ,
  31049. n.prototype.emit = function(e) {
  31050. var t, i, n, r, o, a;
  31051. if (this._events || (this._events = {}),
  31052. "error" === e && (!this._events.error || c(this._events.error) && !this._events.error.length)) {
  31053. if ((t = arguments[1])instanceof Error)
  31054. throw t;
  31055. var s = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  31056. throw s.context = t,
  31057. s
  31058. }
  31059. if (h(i = this._events[e]))
  31060. return !1;
  31061. if (l(i))
  31062. switch (arguments.length) {
  31063. case 1:
  31064. i.call(this);
  31065. break;
  31066. case 2:
  31067. i.call(this, arguments[1]);
  31068. break;
  31069. case 3:
  31070. i.call(this, arguments[1], arguments[2]);
  31071. break;
  31072. default:
  31073. r = Array.prototype.slice.call(arguments, 1),
  31074. i.apply(this, r)
  31075. }
  31076. else if (c(i))
  31077. for (r = Array.prototype.slice.call(arguments, 1),
  31078. n = (a = i.slice()).length,
  31079. o = 0; o < n; o++)
  31080. a[o].apply(this, r);
  31081. return !0
  31082. }
  31083. ,
  31084. n.prototype.on = n.prototype.addListener = function(e, t) {
  31085. var i;
  31086. if (!l(t))
  31087. throw TypeError("listener must be a function");
  31088. return this._events || (this._events = {}),
  31089. this._events.newListener && this.emit("newListener", e, l(t.listener) ? t.listener : t),
  31090. this._events[e] ? c(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  31091. c(this._events[e]) && !this._events[e].warned && ((i = h(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners) && 0 < i && this._events[e].length > i && (this._events[e].warned = !0,
  31092. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  31093. "function" == typeof console.trace && console.trace())),
  31094. this
  31095. }
  31096. ,
  31097. n.prototype.once = function(e, t) {
  31098. function i() {
  31099. this.removeListener(e, i),
  31100. n || (n = !0,
  31101. t.apply(this, arguments))
  31102. }
  31103. if (!l(t))
  31104. throw TypeError("listener must be a function");
  31105. var n = !1;
  31106. return i.listener = t,
  31107. this.on(e, i),
  31108. this
  31109. }
  31110. ,
  31111. n.prototype.removeListener = function(e, t) {
  31112. var i, n, r, o;
  31113. if (!l(t))
  31114. throw TypeError("listener must be a function");
  31115. if (!this._events || !this._events[e])
  31116. return this;
  31117. if (r = (i = this._events[e]).length,
  31118. n = -1,
  31119. i === t || l(i.listener) && i.listener === t)
  31120. delete this._events[e],
  31121. this._events.removeListener && this.emit("removeListener", e, t);
  31122. else if (c(i)) {
  31123. for (o = r; 0 < o--; )
  31124. if (i[o] === t || i[o].listener && i[o].listener === t) {
  31125. n = o;
  31126. break
  31127. }
  31128. if (n < 0)
  31129. return this;
  31130. 1 === i.length ? (i.length = 0,
  31131. delete this._events[e]) : i.splice(n, 1),
  31132. this._events.removeListener && this.emit("removeListener", e, t)
  31133. }
  31134. return this
  31135. }
  31136. ,
  31137. n.prototype.removeAllListeners = function(e) {
  31138. var t, i;
  31139. if (!this._events)
  31140. return this;
  31141. if (!this._events.removeListener)
  31142. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  31143. this;
  31144. if (0 === arguments.length) {
  31145. for (t in this._events)
  31146. "removeListener" !== t && this.removeAllListeners(t);
  31147. return this.removeAllListeners("removeListener"),
  31148. this._events = {},
  31149. this
  31150. }
  31151. if (l(i = this._events[e]))
  31152. this.removeListener(e, i);
  31153. else if (i)
  31154. for (; i.length; )
  31155. this.removeListener(e, i[i.length - 1]);
  31156. return delete this._events[e],
  31157. this
  31158. }
  31159. ,
  31160. n.prototype.listeners = function(e) {
  31161. return this._events && this._events[e] ? l(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  31162. }
  31163. ,
  31164. n.prototype.listenerCount = function(e) {
  31165. if (this._events) {
  31166. var t = this._events[e];
  31167. if (l(t))
  31168. return 1;
  31169. if (t)
  31170. return t.length
  31171. }
  31172. return 0
  31173. }
  31174. ,
  31175. n.listenerCount = function(e, t) {
  31176. return e.listenerCount(t)
  31177. }
  31178. }
  31179. , {}],
  31180. 203: [function(e, t, i) {
  31181. function n() {
  31182. throw new Error("setTimeout has not been defined")
  31183. }
  31184. function r() {
  31185. throw new Error("clearTimeout has not been defined")
  31186. }
  31187. function o(t) {
  31188. if (h === setTimeout)
  31189. return setTimeout(t, 0);
  31190. if ((h === n || !h) && setTimeout)
  31191. return h = setTimeout,
  31192. setTimeout(t, 0);
  31193. try {
  31194. return h(t, 0)
  31195. } catch (e) {
  31196. try {
  31197. return h.call(null, t, 0)
  31198. } catch (e) {
  31199. return h.call(this, t, 0)
  31200. }
  31201. }
  31202. }
  31203. function a() {
  31204. g && p && (g = !1,
  31205. p.length ? f = p.concat(f) : m = -1,
  31206. f.length && s())
  31207. }
  31208. function s() {
  31209. if (!g) {
  31210. var e = o(a);
  31211. g = !0;
  31212. for (var t = f.length; t; ) {
  31213. for (p = f,
  31214. f = []; ++m < t; )
  31215. p && p[m].run();
  31216. m = -1,
  31217. t = f.length
  31218. }
  31219. p = null,
  31220. g = !1,
  31221. function(t) {
  31222. if (u === clearTimeout)
  31223. return clearTimeout(t);
  31224. if ((u === r || !u) && clearTimeout)
  31225. return u = clearTimeout,
  31226. clearTimeout(t);
  31227. try {
  31228. u(t)
  31229. } catch (e) {
  31230. try {
  31231. return u.call(null, t)
  31232. } catch (e) {
  31233. return u.call(this, t)
  31234. }
  31235. }
  31236. }(e)
  31237. }
  31238. }
  31239. function l(e, t) {
  31240. this.fun = e,
  31241. this.array = t
  31242. }
  31243. function c() {}
  31244. var h, u, d = t.exports = {};
  31245. !function() {
  31246. try {
  31247. h = "function" == typeof setTimeout ? setTimeout : n
  31248. } catch (e) {
  31249. h = n
  31250. }
  31251. try {
  31252. u = "function" == typeof clearTimeout ? clearTimeout : r
  31253. } catch (e) {
  31254. u = r
  31255. }
  31256. }();
  31257. var p, f = [], g = !1, m = -1;
  31258. d.nextTick = function(e) {
  31259. var t = new Array(arguments.length - 1);
  31260. if (1 < arguments.length)
  31261. for (var i = 1; i < arguments.length; i++)
  31262. t[i - 1] = arguments[i];
  31263. f.push(new l(e,t)),
  31264. 1 !== f.length || g || o(s)
  31265. }
  31266. ,
  31267. l.prototype.run = function() {
  31268. this.fun.apply(null, this.array)
  31269. }
  31270. ,
  31271. d.title = "browser",
  31272. d.browser = !0,
  31273. d.env = {},
  31274. d.argv = [],
  31275. d.version = "",
  31276. d.versions = {},
  31277. d.on = c,
  31278. d.addListener = c,
  31279. d.once = c,
  31280. d.off = c,
  31281. d.removeListener = c,
  31282. d.removeAllListeners = c,
  31283. d.emit = c,
  31284. d.binding = function(e) {
  31285. throw new Error("process.binding is not supported")
  31286. }
  31287. ,
  31288. d.cwd = function() {
  31289. return "/"
  31290. }
  31291. ,
  31292. d.chdir = function(e) {
  31293. throw new Error("process.chdir is not supported")
  31294. }
  31295. ,
  31296. d.umask = function() {
  31297. return 0
  31298. }
  31299. }
  31300. , {}],
  31301. 204: [function(e, O, L) {
  31302. (function(P) {
  31303. !function(e) {
  31304. function v(e) {
  31305. throw new RangeError(g[e])
  31306. }
  31307. function r(e, t) {
  31308. for (var i = e.length, n = []; i--; )
  31309. n[i] = t(e[i]);
  31310. return n
  31311. }
  31312. function t(e, t) {
  31313. var i = e.split("@")
  31314. , n = "";
  31315. return 1 < i.length && (n = i[0] + "@",
  31316. e = i[1]),
  31317. n + r((e = e.replace(f, ".")).split("."), t).join(".")
  31318. }
  31319. function y(e) {
  31320. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  31321. 55296 <= (t = e.charCodeAt(r++)) && t <= 56319 && r < o ? 56320 == (64512 & (i = e.charCodeAt(r++))) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  31322. r--) : n.push(t);
  31323. return n
  31324. }
  31325. function A(e) {
  31326. return r(e, function(e) {
  31327. var t = "";
  31328. return 65535 < e && (t += R((e -= 65536) >>> 10 & 1023 | 55296),
  31329. e = 56320 | 1023 & e),
  31330. t + R(e)
  31331. }).join("")
  31332. }
  31333. function C(e, t) {
  31334. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  31335. }
  31336. function I(e, t, i) {
  31337. var n = 0;
  31338. for (e = i ? M(e / u) : e >> 1,
  31339. e += M(e / t); m * w >> 1 < e; n += _)
  31340. e = M(e / m);
  31341. return M(n + (m + 1) * e / (e + h))
  31342. }
  31343. function i(e) {
  31344. var t, i, n, r, o, a, s, l, c, h, u, d = [], p = e.length, f = 0, g = x, m = T;
  31345. for ((i = e.lastIndexOf(S)) < 0 && (i = 0),
  31346. n = 0; n < i; ++n)
  31347. 128 <= e.charCodeAt(n) && v("not-basic"),
  31348. d.push(e.charCodeAt(n));
  31349. for (r = 0 < i ? i + 1 : 0; r < p; ) {
  31350. for (o = f,
  31351. a = 1,
  31352. s = _; p <= r && v("invalid-input"),
  31353. u = e.charCodeAt(r++),
  31354. (_ <= (l = u - 48 < 10 ? u - 22 : u - 65 < 26 ? u - 65 : u - 97 < 26 ? u - 97 : _) || l > M((E - f) / a)) && v("overflow"),
  31355. f += l * a,
  31356. !(l < (c = s <= m ? b : m + w <= s ? w : s - m)); s += _)
  31357. a > M(E / (h = _ - c)) && v("overflow"),
  31358. a *= h;
  31359. m = I(f - o, t = d.length + 1, 0 == o),
  31360. M(f / t) > E - g && v("overflow"),
  31361. g += M(f / t),
  31362. f %= t,
  31363. d.splice(f++, 0, g)
  31364. }
  31365. return A(d)
  31366. }
  31367. function n(e) {
  31368. var t, i, n, r, o, a, s, l, c, h, u, d, p, f, g, m = [];
  31369. for (d = (e = y(e)).length,
  31370. t = x,
  31371. o = T,
  31372. a = i = 0; a < d; ++a)
  31373. (u = e[a]) < 128 && m.push(R(u));
  31374. for (n = r = m.length,
  31375. r && m.push(S); n < d; ) {
  31376. for (s = E,
  31377. a = 0; a < d; ++a)
  31378. t <= (u = e[a]) && u < s && (s = u);
  31379. for (s - t > M((E - i) / (p = n + 1)) && v("overflow"),
  31380. i += (s - t) * p,
  31381. t = s,
  31382. a = 0; a < d; ++a)
  31383. if ((u = e[a]) < t && ++i > E && v("overflow"),
  31384. u == t) {
  31385. for (l = i,
  31386. c = _; !(l < (h = c <= o ? b : o + w <= c ? w : c - o)); c += _)
  31387. g = l - h,
  31388. f = _ - h,
  31389. m.push(R(C(h + g % f, 0))),
  31390. l = M(g / f);
  31391. m.push(R(C(l, 0))),
  31392. o = I(i, p, n == r),
  31393. i = 0,
  31394. ++n
  31395. }
  31396. ++i,
  31397. ++t
  31398. }
  31399. return m.join("")
  31400. }
  31401. var o = "object" == typeof L && L && !L.nodeType && L
  31402. , a = "object" == typeof O && O && !O.nodeType && O
  31403. , s = "object" == typeof P && P;
  31404. s.global !== s && s.window !== s && s.self !== s || (e = s);
  31405. var l, c, E = 2147483647, _ = 36, b = 1, w = 26, h = 38, u = 700, T = 72, x = 128, S = "-", d = /^xn--/, p = /[^\x20-\x7E]/, f = /[\x2E\u3002\uFF0E\uFF61]/g, g = {
  31406. overflow: "Overflow: input needs wider integers to process",
  31407. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  31408. "invalid-input": "Invalid input"
  31409. }, m = _ - b, M = Math.floor, R = String.fromCharCode;
  31410. if (l = {
  31411. version: "1.4.1",
  31412. ucs2: {
  31413. decode: y,
  31414. encode: A
  31415. },
  31416. decode: i,
  31417. encode: n,
  31418. toASCII: function(e) {
  31419. return t(e, function(e) {
  31420. return p.test(e) ? "xn--" + n(e) : e
  31421. })
  31422. },
  31423. toUnicode: function(e) {
  31424. return t(e, function(e) {
  31425. return d.test(e) ? i(e.slice(4).toLowerCase()) : e
  31426. })
  31427. }
  31428. },
  31429. "function" == typeof define && "object" == typeof define.amd && define.amd)
  31430. define("punycode", function() {
  31431. return l
  31432. });
  31433. else if (o && a)
  31434. if (O.exports == o)
  31435. a.exports = l;
  31436. else
  31437. for (c in l)
  31438. l.hasOwnProperty(c) && (o[c] = l[c]);
  31439. else
  31440. e.punycode = l
  31441. }(this)
  31442. }
  31443. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  31444. }
  31445. , {}],
  31446. 205: [function(e, t, i) {
  31447. "use strict";
  31448. t.exports = function(e, t, i, n) {
  31449. t = t || "&",
  31450. i = i || "=";
  31451. var r = {};
  31452. if ("string" != typeof e || 0 === e.length)
  31453. return r;
  31454. var o = /\+/g;
  31455. e = e.split(t);
  31456. var a = 1e3;
  31457. n && "number" == typeof n.maxKeys && (a = n.maxKeys);
  31458. var s, l, c = e.length;
  31459. 0 < a && a < c && (c = a);
  31460. for (var h = 0; h < c; ++h) {
  31461. var u, d, p, f, g = e[h].replace(o, "%20"), m = g.indexOf(i);
  31462. d = 0 <= m ? (u = g.substr(0, m),
  31463. g.substr(m + 1)) : (u = g,
  31464. ""),
  31465. p = decodeURIComponent(u),
  31466. f = decodeURIComponent(d),
  31467. s = r,
  31468. l = p,
  31469. Object.prototype.hasOwnProperty.call(s, l) ? v(r[p]) ? r[p].push(f) : r[p] = [r[p], f] : r[p] = f
  31470. }
  31471. return r
  31472. }
  31473. ;
  31474. var v = Array.isArray || function(e) {
  31475. return "[object Array]" === Object.prototype.toString.call(e)
  31476. }
  31477. }
  31478. , {}],
  31479. 206: [function(e, t, i) {
  31480. "use strict";
  31481. function o(e, t) {
  31482. if (e.map)
  31483. return e.map(t);
  31484. for (var i = [], n = 0; n < e.length; n++)
  31485. i.push(t(e[n], n));
  31486. return i
  31487. }
  31488. function a(e) {
  31489. switch (typeof e) {
  31490. case "string":
  31491. return e;
  31492. case "boolean":
  31493. return e ? "true" : "false";
  31494. case "number":
  31495. return isFinite(e) ? e : "";
  31496. default:
  31497. return ""
  31498. }
  31499. }
  31500. t.exports = function(i, n, r, e) {
  31501. return n = n || "&",
  31502. r = r || "=",
  31503. null === i && (i = void 0),
  31504. "object" == typeof i ? o(l(i), function(e) {
  31505. var t = encodeURIComponent(a(e)) + r;
  31506. return s(i[e]) ? o(i[e], function(e) {
  31507. return t + encodeURIComponent(a(e))
  31508. }).join(n) : t + encodeURIComponent(a(i[e]))
  31509. }).join(n) : e ? encodeURIComponent(a(e)) + r + encodeURIComponent(a(i)) : ""
  31510. }
  31511. ;
  31512. var s = Array.isArray || function(e) {
  31513. return "[object Array]" === Object.prototype.toString.call(e)
  31514. }
  31515. , l = Object.keys || function(e) {
  31516. var t = [];
  31517. for (var i in e)
  31518. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  31519. return t
  31520. }
  31521. }
  31522. , {}],
  31523. 207: [function(e, t, i) {
  31524. "use strict";
  31525. i.decode = i.parse = e("./decode"),
  31526. i.encode = i.stringify = e("./encode")
  31527. }
  31528. , {
  31529. "./decode": 205,
  31530. "./encode": 206
  31531. }],
  31532. 208: [function(e, t, i) {
  31533. "use strict";
  31534. function x() {
  31535. this.protocol = null,
  31536. this.slashes = null,
  31537. this.auth = null,
  31538. this.host = null,
  31539. this.port = null,
  31540. this.hostname = null,
  31541. this.hash = null,
  31542. this.search = null,
  31543. this.query = null,
  31544. this.pathname = null,
  31545. this.path = null,
  31546. this.href = null
  31547. }
  31548. function n(e, t, i) {
  31549. if (e && D.isObject(e) && e instanceof x)
  31550. return e;
  31551. var n = new x;
  31552. return n.parse(e, t, i),
  31553. n
  31554. }
  31555. var L = e("punycode")
  31556. , D = e("./util");
  31557. i.parse = n,
  31558. i.resolve = function(e, t) {
  31559. return n(e, !1, !0).resolve(t)
  31560. }
  31561. ,
  31562. i.resolveObject = function(e, t) {
  31563. return e ? n(e, !1, !0).resolveObject(t) : t
  31564. }
  31565. ,
  31566. i.format = function(e) {
  31567. return D.isString(e) && (e = n(e)),
  31568. e instanceof x ? e.format() : x.prototype.format.call(e)
  31569. }
  31570. ,
  31571. i.Url = x;
  31572. var N = /^([a-z0-9.+-]+:)/i
  31573. , r = /:[0-9]*$/
  31574. , F = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  31575. , o = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"])
  31576. , B = ["'"].concat(o)
  31577. , V = ["%", "/", "?", ";", "#"].concat(B)
  31578. , k = ["/", "?", "#"]
  31579. , U = /^[+a-z0-9A-Z_-]{0,63}$/
  31580. , H = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  31581. , z = {
  31582. javascript: !0,
  31583. "javascript:": !0
  31584. }
  31585. , G = {
  31586. javascript: !0,
  31587. "javascript:": !0
  31588. }
  31589. , W = {
  31590. http: !0,
  31591. https: !0,
  31592. ftp: !0,
  31593. gopher: !0,
  31594. file: !0,
  31595. "http:": !0,
  31596. "https:": !0,
  31597. "ftp:": !0,
  31598. "gopher:": !0,
  31599. "file:": !0
  31600. }
  31601. , j = e("querystring");
  31602. x.prototype.parse = function(e, t, i) {
  31603. if (!D.isString(e))
  31604. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  31605. var n = e.indexOf("?")
  31606. , r = -1 !== n && n < e.indexOf("#") ? "?" : "#"
  31607. , o = e.split(r);
  31608. o[0] = o[0].replace(/\\/g, "/");
  31609. var a = e = o.join(r);
  31610. if (a = a.trim(),
  31611. !i && 1 === e.split("#").length) {
  31612. var s = F.exec(a);
  31613. if (s)
  31614. return this.path = a,
  31615. this.href = a,
  31616. this.pathname = s[1],
  31617. s[2] ? (this.search = s[2],
  31618. this.query = t ? j.parse(this.search.substr(1)) : this.search.substr(1)) : t && (this.search = "",
  31619. this.query = {}),
  31620. this
  31621. }
  31622. var l = N.exec(a);
  31623. if (l) {
  31624. var c = (l = l[0]).toLowerCase();
  31625. this.protocol = c,
  31626. a = a.substr(l.length)
  31627. }
  31628. if (i || l || a.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  31629. var h = "//" === a.substr(0, 2);
  31630. !h || l && G[l] || (a = a.substr(2),
  31631. this.slashes = !0)
  31632. }
  31633. if (!G[l] && (h || l && !W[l])) {
  31634. for (var u = -1, d = 0; d < k.length; d++) {
  31635. -1 !== (g = a.indexOf(k[d])) && (-1 === u || g < u) && (u = g)
  31636. }
  31637. var p, f;
  31638. -1 !== (f = -1 === u ? a.lastIndexOf("@") : a.lastIndexOf("@", u)) && (p = a.slice(0, f),
  31639. a = a.slice(f + 1),
  31640. this.auth = decodeURIComponent(p)),
  31641. u = -1;
  31642. for (d = 0; d < V.length; d++) {
  31643. var g;
  31644. -1 !== (g = a.indexOf(V[d])) && (-1 === u || g < u) && (u = g)
  31645. }
  31646. -1 === u && (u = a.length),
  31647. this.host = a.slice(0, u),
  31648. a = a.slice(u),
  31649. this.parseHost(),
  31650. this.hostname = this.hostname || "";
  31651. var m = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  31652. if (!m)
  31653. for (var v = this.hostname.split(/\./), y = (d = 0,
  31654. v.length); d < y; d++) {
  31655. var A = v[d];
  31656. if (A && !A.match(U)) {
  31657. for (var C = "", I = 0, E = A.length; I < E; I++)
  31658. C += 127 < A.charCodeAt(I) ? "x" : A[I];
  31659. if (!C.match(U)) {
  31660. var _ = v.slice(0, d)
  31661. , b = v.slice(d + 1)
  31662. , w = A.match(H);
  31663. w && (_.push(w[1]),
  31664. b.unshift(w[2])),
  31665. b.length && (a = "/" + b.join(".") + a),
  31666. this.hostname = _.join(".");
  31667. break
  31668. }
  31669. }
  31670. }
  31671. 255 < this.hostname.length ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  31672. m || (this.hostname = L.toASCII(this.hostname));
  31673. var T = this.port ? ":" + this.port : ""
  31674. , x = this.hostname || "";
  31675. this.host = x + T,
  31676. this.href += this.host,
  31677. m && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  31678. "/" !== a[0] && (a = "/" + a))
  31679. }
  31680. if (!z[c])
  31681. for (d = 0,
  31682. y = B.length; d < y; d++) {
  31683. var S = B[d];
  31684. if (-1 !== a.indexOf(S)) {
  31685. var M = encodeURIComponent(S);
  31686. M === S && (M = escape(S)),
  31687. a = a.split(S).join(M)
  31688. }
  31689. }
  31690. var R = a.indexOf("#");
  31691. -1 !== R && (this.hash = a.substr(R),
  31692. a = a.slice(0, R));
  31693. var P = a.indexOf("?");
  31694. if (-1 !== P ? (this.search = a.substr(P),
  31695. this.query = a.substr(P + 1),
  31696. t && (this.query = j.parse(this.query)),
  31697. a = a.slice(0, P)) : t && (this.search = "",
  31698. this.query = {}),
  31699. a && (this.pathname = a),
  31700. W[c] && this.hostname && !this.pathname && (this.pathname = "/"),
  31701. this.pathname || this.search) {
  31702. T = this.pathname || "";
  31703. var O = this.search || "";
  31704. this.path = T + O
  31705. }
  31706. return this.href = this.format(),
  31707. this
  31708. }
  31709. ,
  31710. x.prototype.format = function() {
  31711. var e = this.auth || "";
  31712. e && (e = (e = encodeURIComponent(e)).replace(/%3A/i, ":"),
  31713. e += "@");
  31714. var t = this.protocol || ""
  31715. , i = this.pathname || ""
  31716. , n = this.hash || ""
  31717. , r = !1
  31718. , o = "";
  31719. this.host ? r = e + this.host : this.hostname && (r = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"),
  31720. this.port && (r += ":" + this.port)),
  31721. this.query && D.isObject(this.query) && Object.keys(this.query).length && (o = j.stringify(this.query));
  31722. var a = this.search || o && "?" + o || "";
  31723. return t && ":" !== t.substr(-1) && (t += ":"),
  31724. this.slashes || (!t || W[t]) && !1 !== r ? (r = "//" + (r || ""),
  31725. i && "/" !== i.charAt(0) && (i = "/" + i)) : r = r || "",
  31726. n && "#" !== n.charAt(0) && (n = "#" + n),
  31727. a && "?" !== a.charAt(0) && (a = "?" + a),
  31728. t + r + (i = i.replace(/[?#]/g, function(e) {
  31729. return encodeURIComponent(e)
  31730. })) + (a = a.replace("#", "%23")) + n
  31731. }
  31732. ,
  31733. x.prototype.resolve = function(e) {
  31734. return this.resolveObject(n(e, !1, !0)).format()
  31735. }
  31736. ,
  31737. x.prototype.resolveObject = function(e) {
  31738. if (D.isString(e)) {
  31739. var t = new x;
  31740. t.parse(e, !1, !0),
  31741. e = t
  31742. }
  31743. for (var i = new x, n = Object.keys(this), r = 0; r < n.length; r++) {
  31744. var o = n[r];
  31745. i[o] = this[o]
  31746. }
  31747. if (i.hash = e.hash,
  31748. "" === e.href)
  31749. return i.href = i.format(),
  31750. i;
  31751. if (e.slashes && !e.protocol) {
  31752. for (var a = Object.keys(e), s = 0; s < a.length; s++) {
  31753. var l = a[s];
  31754. "protocol" !== l && (i[l] = e[l])
  31755. }
  31756. return W[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  31757. i.href = i.format(),
  31758. i
  31759. }
  31760. if (e.protocol && e.protocol !== i.protocol) {
  31761. if (!W[e.protocol]) {
  31762. for (var c = Object.keys(e), h = 0; h < c.length; h++) {
  31763. var u = c[h];
  31764. i[u] = e[u]
  31765. }
  31766. return i.href = i.format(),
  31767. i
  31768. }
  31769. if (i.protocol = e.protocol,
  31770. e.host || G[e.protocol])
  31771. i.pathname = e.pathname;
  31772. else {
  31773. for (var d = (e.pathname || "").split("/"); d.length && !(e.host = d.shift()); )
  31774. ;
  31775. e.host || (e.host = ""),
  31776. e.hostname || (e.hostname = ""),
  31777. "" !== d[0] && d.unshift(""),
  31778. d.length < 2 && d.unshift(""),
  31779. i.pathname = d.join("/")
  31780. }
  31781. if (i.search = e.search,
  31782. i.query = e.query,
  31783. i.host = e.host || "",
  31784. i.auth = e.auth,
  31785. i.hostname = e.hostname || e.host,
  31786. i.port = e.port,
  31787. i.pathname || i.search) {
  31788. var p = i.pathname || ""
  31789. , f = i.search || "";
  31790. i.path = p + f
  31791. }
  31792. return i.slashes = i.slashes || e.slashes,
  31793. i.href = i.format(),
  31794. i
  31795. }
  31796. var g = i.pathname && "/" === i.pathname.charAt(0)
  31797. , m = e.host || e.pathname && "/" === e.pathname.charAt(0)
  31798. , v = m || g || i.host && e.pathname
  31799. , y = v
  31800. , A = i.pathname && i.pathname.split("/") || []
  31801. , C = (d = e.pathname && e.pathname.split("/") || [],
  31802. i.protocol && !W[i.protocol]);
  31803. if (C && (i.hostname = "",
  31804. i.port = null,
  31805. i.host && ("" === A[0] ? A[0] = i.host : A.unshift(i.host)),
  31806. i.host = "",
  31807. e.protocol && (e.hostname = null,
  31808. e.port = null,
  31809. e.host && ("" === d[0] ? d[0] = e.host : d.unshift(e.host)),
  31810. e.host = null),
  31811. v = v && ("" === d[0] || "" === A[0])),
  31812. m)
  31813. i.host = e.host || "" === e.host ? e.host : i.host,
  31814. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  31815. i.search = e.search,
  31816. i.query = e.query,
  31817. A = d;
  31818. else if (d.length)
  31819. (A = A || []).pop(),
  31820. A = A.concat(d),
  31821. i.search = e.search,
  31822. i.query = e.query;
  31823. else if (!D.isNullOrUndefined(e.search)) {
  31824. if (C)
  31825. i.hostname = i.host = A.shift(),
  31826. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31827. i.host = i.hostname = w.shift());
  31828. return i.search = e.search,
  31829. i.query = e.query,
  31830. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31831. i.href = i.format(),
  31832. i
  31833. }
  31834. if (!A.length)
  31835. return i.pathname = null,
  31836. i.search ? i.path = "/" + i.search : i.path = null,
  31837. i.href = i.format(),
  31838. i;
  31839. for (var I = A.slice(-1)[0], E = (i.host || e.host || 1 < A.length) && ("." === I || ".." === I) || "" === I, _ = 0, b = A.length; 0 <= b; b--)
  31840. "." === (I = A[b]) ? A.splice(b, 1) : ".." === I ? (A.splice(b, 1),
  31841. _++) : _ && (A.splice(b, 1),
  31842. _--);
  31843. if (!v && !y)
  31844. for (; _--; )
  31845. A.unshift("..");
  31846. !v || "" === A[0] || A[0] && "/" === A[0].charAt(0) || A.unshift(""),
  31847. E && "/" !== A.join("/").substr(-1) && A.push("");
  31848. var w, T = "" === A[0] || A[0] && "/" === A[0].charAt(0);
  31849. C && (i.hostname = i.host = T ? "" : A.length ? A.shift() : "",
  31850. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31851. i.host = i.hostname = w.shift()));
  31852. return (v = v || i.host && A.length) && !T && A.unshift(""),
  31853. A.length ? i.pathname = A.join("/") : (i.pathname = null,
  31854. i.path = null),
  31855. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31856. i.auth = e.auth || i.auth,
  31857. i.slashes = i.slashes || e.slashes,
  31858. i.href = i.format(),
  31859. i
  31860. }
  31861. ,
  31862. x.prototype.parseHost = function() {
  31863. var e = this.host
  31864. , t = r.exec(e);
  31865. t && (":" !== (t = t[0]) && (this.port = t.substr(1)),
  31866. e = e.substr(0, e.length - t.length)),
  31867. e && (this.hostname = e)
  31868. }
  31869. }
  31870. , {
  31871. "./util": 209,
  31872. punycode: 204,
  31873. querystring: 207
  31874. }],
  31875. 209: [function(e, t, i) {
  31876. "use strict";
  31877. t.exports = {
  31878. isString: function(e) {
  31879. return "string" == typeof e
  31880. },
  31881. isObject: function(e) {
  31882. return "object" == typeof e && null !== e
  31883. },
  31884. isNull: function(e) {
  31885. return null === e
  31886. },
  31887. isNullOrUndefined: function(e) {
  31888. return null == e
  31889. }
  31890. }
  31891. }
  31892. , {}],
  31893. 210: [function(e, t, i) {
  31894. "use strict";
  31895. function r(e) {
  31896. return c + e
  31897. }
  31898. function s(e) {
  31899. if ("string" != typeof e)
  31900. throw new TypeError("key must be a string.")
  31901. }
  31902. var l = Object.prototype.hasOwnProperty
  31903. , c = "~";
  31904. t.exports = function(t) {
  31905. var o = Object.create(null)
  31906. , n = 0
  31907. , a = {};
  31908. return function(e, t) {
  31909. for (var i in t)
  31910. Object.defineProperty(e, i, {
  31911. value: t[i],
  31912. configurable: !0,
  31913. writable: !0
  31914. })
  31915. }(a, {
  31916. get: function(e, t) {
  31917. s(e);
  31918. var i = r(e);
  31919. return i in o ? o[i] : t
  31920. },
  31921. set: function(e, t) {
  31922. s(e);
  31923. var i = r(e);
  31924. return i in o || ++n,
  31925. o[i] = t
  31926. },
  31927. has: function(e) {
  31928. return s(e),
  31929. r(e)in o
  31930. },
  31931. delete: function(e) {
  31932. s(e);
  31933. var t = r(e);
  31934. return t in o && (--n,
  31935. delete o[t],
  31936. !0)
  31937. },
  31938. clear: function() {
  31939. o = Object.create(null),
  31940. n = 0
  31941. },
  31942. forEach: function(e, t) {
  31943. if ("function" != typeof e)
  31944. throw new TypeError("`callback` must be a function");
  31945. for (var i in o)
  31946. if (l.call(o, i)) {
  31947. var n = i.substring(c.length)
  31948. , r = o[i];
  31949. e.call(t, r, n, a)
  31950. }
  31951. }
  31952. }),
  31953. Object.defineProperty(a, "size", {
  31954. get: function() {
  31955. return n
  31956. },
  31957. configurable: !0
  31958. }),
  31959. "object" == typeof t && null !== t && Object.keys(t).forEach(function(e) {
  31960. a.set(e, t[e])
  31961. }),
  31962. a
  31963. }
  31964. }
  31965. , {}],
  31966. 211: [function(e, t, i) {
  31967. t.exports = e("./lib/heap")
  31968. }
  31969. , {
  31970. "./lib/heap": 212
  31971. }],
  31972. 212: [function(e, y, A) {
  31973. (function() {
  31974. var e, d, l, p, f, t, c, i, g, m, n, r, o, h, u, a, s;
  31975. function v(e) {
  31976. this.cmp = null != e ? e : d,
  31977. this.nodes = []
  31978. }
  31979. l = Math.floor,
  31980. m = Math.min,
  31981. d = function(e, t) {
  31982. return e < t ? -1 : t < e ? 1 : 0
  31983. }
  31984. ,
  31985. g = function(e, t, i, n, r) {
  31986. var o;
  31987. if (null == i && (i = 0),
  31988. null == r && (r = d),
  31989. i < 0)
  31990. throw new Error("lo must be non-negative");
  31991. for (null == n && (n = e.length); i < n; )
  31992. r(t, e[o = l((i + n) / 2)]) < 0 ? n = o : i = o + 1;
  31993. return [].splice.apply(e, [i, i - i].concat(t)),
  31994. t
  31995. }
  31996. ,
  31997. t = function(e, t, i) {
  31998. return null == i && (i = d),
  31999. e.push(t),
  32000. h(e, 0, e.length - 1, i)
  32001. }
  32002. ,
  32003. f = function(e, t) {
  32004. var i, n;
  32005. return null == t && (t = d),
  32006. i = e.pop(),
  32007. e.length ? (n = e[0],
  32008. e[0] = i,
  32009. u(e, 0, t)) : n = i,
  32010. n
  32011. }
  32012. ,
  32013. i = function(e, t, i) {
  32014. var n;
  32015. return null == i && (i = d),
  32016. n = e[0],
  32017. e[0] = t,
  32018. u(e, 0, i),
  32019. n
  32020. }
  32021. ,
  32022. c = function(e, t, i) {
  32023. var n;
  32024. return null == i && (i = d),
  32025. e.length && i(e[0], t) < 0 && (t = (n = [e[0], t])[0],
  32026. e[0] = n[1],
  32027. u(e, 0, i)),
  32028. t
  32029. }
  32030. ,
  32031. p = function(i, e) {
  32032. var t, n, r, o, a, s;
  32033. for (null == e && (e = d),
  32034. a = [],
  32035. n = 0,
  32036. r = (o = function() {
  32037. s = [];
  32038. for (var e = 0, t = l(i.length / 2); 0 <= t ? e < t : t < e; 0 <= t ? e++ : e--)
  32039. s.push(e);
  32040. return s
  32041. }
  32042. .apply(this).reverse()).length; n < r; n++)
  32043. t = o[n],
  32044. a.push(u(i, t, e));
  32045. return a
  32046. }
  32047. ,
  32048. o = function(e, t, i) {
  32049. var n;
  32050. if (null == i && (i = d),
  32051. -1 !== (n = e.indexOf(t)))
  32052. return h(e, 0, n, i),
  32053. u(e, n, i)
  32054. }
  32055. ,
  32056. n = function(e, t, i) {
  32057. var n, r, o, a, s;
  32058. if (null == i && (i = d),
  32059. !(r = e.slice(0, t)).length)
  32060. return r;
  32061. for (p(r, i),
  32062. o = 0,
  32063. a = (s = e.slice(t)).length; o < a; o++)
  32064. n = s[o],
  32065. c(r, n, i);
  32066. return r.sort(i).reverse()
  32067. }
  32068. ,
  32069. r = function(e, t, i) {
  32070. var n, r, o, a, s, l, c, h, u;
  32071. if (null == i && (i = d),
  32072. 10 * t <= e.length) {
  32073. if (!(o = e.slice(0, t).sort(i)).length)
  32074. return o;
  32075. for (r = o[o.length - 1],
  32076. a = 0,
  32077. l = (c = e.slice(t)).length; a < l; a++)
  32078. i(n = c[a], r) < 0 && (g(o, n, 0, null, i),
  32079. o.pop(),
  32080. r = o[o.length - 1]);
  32081. return o
  32082. }
  32083. for (p(e, i),
  32084. u = [],
  32085. s = 0,
  32086. h = m(t, e.length); 0 <= h ? s < h : h < s; 0 <= h ? ++s : --s)
  32087. u.push(f(e, i));
  32088. return u
  32089. }
  32090. ,
  32091. h = function(e, t, i, n) {
  32092. var r, o, a;
  32093. for (null == n && (n = d),
  32094. r = e[i]; t < i && n(r, o = e[a = i - 1 >> 1]) < 0; )
  32095. e[i] = o,
  32096. i = a;
  32097. return e[i] = r
  32098. }
  32099. ,
  32100. u = function(e, t, i) {
  32101. var n, r, o, a, s;
  32102. for (null == i && (i = d),
  32103. r = e.length,
  32104. o = e[s = t],
  32105. n = 2 * t + 1; n < r; )
  32106. (a = n + 1) < r && !(i(e[n], e[a]) < 0) && (n = a),
  32107. e[t] = e[n],
  32108. n = 2 * (t = n) + 1;
  32109. return e[t] = o,
  32110. h(e, s, t, i)
  32111. }
  32112. ,
  32113. v.push = t,
  32114. v.pop = f,
  32115. v.replace = i,
  32116. v.pushpop = c,
  32117. v.heapify = p,
  32118. v.updateItem = o,
  32119. v.nlargest = n,
  32120. v.nsmallest = r,
  32121. v.prototype.push = function(e) {
  32122. return t(this.nodes, e, this.cmp)
  32123. }
  32124. ,
  32125. v.prototype.pop = function() {
  32126. return f(this.nodes, this.cmp)
  32127. }
  32128. ,
  32129. v.prototype.peek = function() {
  32130. return this.nodes[0]
  32131. }
  32132. ,
  32133. v.prototype.contains = function(e) {
  32134. return -1 !== this.nodes.indexOf(e)
  32135. }
  32136. ,
  32137. v.prototype.replace = function(e) {
  32138. return i(this.nodes, e, this.cmp)
  32139. }
  32140. ,
  32141. v.prototype.pushpop = function(e) {
  32142. return c(this.nodes, e, this.cmp)
  32143. }
  32144. ,
  32145. v.prototype.heapify = function() {
  32146. return p(this.nodes, this.cmp)
  32147. }
  32148. ,
  32149. v.prototype.updateItem = function(e) {
  32150. return o(this.nodes, e, this.cmp)
  32151. }
  32152. ,
  32153. v.prototype.clear = function() {
  32154. return this.nodes = []
  32155. }
  32156. ,
  32157. v.prototype.empty = function() {
  32158. return 0 === this.nodes.length
  32159. }
  32160. ,
  32161. v.prototype.size = function() {
  32162. return this.nodes.length
  32163. }
  32164. ,
  32165. v.prototype.clone = function() {
  32166. var e;
  32167. return (e = new v).nodes = this.nodes.slice(0),
  32168. e
  32169. }
  32170. ,
  32171. v.prototype.toArray = function() {
  32172. return this.nodes.slice(0)
  32173. }
  32174. ,
  32175. v.prototype.insert = v.prototype.push,
  32176. v.prototype.top = v.prototype.peek,
  32177. v.prototype.front = v.prototype.peek,
  32178. v.prototype.has = v.prototype.contains,
  32179. v.prototype.copy = v.prototype.clone,
  32180. e = v,
  32181. a = this,
  32182. s = function() {
  32183. return e
  32184. }
  32185. ,
  32186. "function" == typeof define && define.amd ? define([], s) : "object" == typeof A ? y.exports = s() : a.Heap = s()
  32187. }
  32188. ).call(this)
  32189. }
  32190. , {}],
  32191. 213: [function(e, t, i) {
  32192. function n() {}
  32193. function o(e) {
  32194. if ("object" != typeof this)
  32195. throw new TypeError("Promises must be constructed via new");
  32196. if ("function" != typeof e)
  32197. throw new TypeError("not a function");
  32198. this._state = 0,
  32199. this._handled = !1,
  32200. this._value = void 0,
  32201. this._deferreds = [],
  32202. h(e, this)
  32203. }
  32204. function r(i, n) {
  32205. for (; 3 === i._state; )
  32206. i = i._value;
  32207. return 0 === i._state ? void i._deferreds.push(n) : (i._handled = !0,
  32208. void o._immediateFn(function() {
  32209. var e = 1 === i._state ? n.onFulfilled : n.onRejected;
  32210. if (null !== e) {
  32211. var t;
  32212. try {
  32213. t = e(i._value)
  32214. } catch (e) {
  32215. return void s(n.promise, e)
  32216. }
  32217. a(n.promise, t)
  32218. } else
  32219. (1 === i._state ? a : s)(n.promise, i._value)
  32220. }))
  32221. }
  32222. function a(e, t) {
  32223. try {
  32224. if (t === e)
  32225. throw new TypeError("A promise cannot be resolved with itself.");
  32226. if (t && ("object" == typeof t || "function" == typeof t)) {
  32227. var i = t.then;
  32228. if (t instanceof o)
  32229. return e._state = 3,
  32230. e._value = t,
  32231. void l(e);
  32232. if ("function" == typeof i)
  32233. return void h(function(e, t) {
  32234. return function() {
  32235. e.apply(t, arguments)
  32236. }
  32237. }(i, t), e)
  32238. }
  32239. e._state = 1,
  32240. e._value = t,
  32241. l(e)
  32242. } catch (t) {
  32243. s(e, t)
  32244. }
  32245. }
  32246. function s(e, t) {
  32247. e._state = 2,
  32248. e._value = t,
  32249. l(e)
  32250. }
  32251. function l(e) {
  32252. 2 === e._state && 0 === e._deferreds.length && o._immediateFn(function() {
  32253. e._handled || o._unhandledRejectionFn(e._value)
  32254. });
  32255. for (var t = 0, i = e._deferreds.length; t < i; t++)
  32256. r(e, e._deferreds[t]);
  32257. e._deferreds = null
  32258. }
  32259. function c(e, t, i) {
  32260. this.onFulfilled = "function" == typeof e ? e : null,
  32261. this.onRejected = "function" == typeof t ? t : null,
  32262. this.promise = i
  32263. }
  32264. function h(e, t) {
  32265. var i = !1;
  32266. try {
  32267. e(function(e) {
  32268. i || (i = !0,
  32269. a(t, e))
  32270. }, function(e) {
  32271. i || (i = !0,
  32272. s(t, e))
  32273. })
  32274. } catch (e) {
  32275. if (i)
  32276. return;
  32277. i = !0,
  32278. s(t, e)
  32279. }
  32280. }
  32281. var u, d;
  32282. u = this,
  32283. d = setTimeout,
  32284. o.prototype.catch = function(e) {
  32285. return this.then(null, e)
  32286. }
  32287. ,
  32288. o.prototype.then = function(e, t) {
  32289. var i = new this.constructor(n);
  32290. return r(this, new c(e,t,i)),
  32291. i
  32292. }
  32293. ,
  32294. o.all = function(e) {
  32295. var s = Array.prototype.slice.call(e);
  32296. return new o(function(n, r) {
  32297. function o(t, e) {
  32298. try {
  32299. if (e && ("object" == typeof e || "function" == typeof e)) {
  32300. var i = e.then;
  32301. if ("function" == typeof i)
  32302. return void i.call(e, function(e) {
  32303. o(t, e)
  32304. }, r)
  32305. }
  32306. s[t] = e,
  32307. 0 == --a && n(s)
  32308. } catch (e) {
  32309. r(e)
  32310. }
  32311. }
  32312. if (0 === s.length)
  32313. return n([]);
  32314. for (var a = s.length, e = 0; e < s.length; e++)
  32315. o(e, s[e])
  32316. }
  32317. )
  32318. }
  32319. ,
  32320. o.resolve = function(t) {
  32321. return t && "object" == typeof t && t.constructor === o ? t : new o(function(e) {
  32322. e(t)
  32323. }
  32324. )
  32325. }
  32326. ,
  32327. o.reject = function(i) {
  32328. return new o(function(e, t) {
  32329. t(i)
  32330. }
  32331. )
  32332. }
  32333. ,
  32334. o.race = function(r) {
  32335. return new o(function(e, t) {
  32336. for (var i = 0, n = r.length; i < n; i++)
  32337. r[i].then(e, t)
  32338. }
  32339. )
  32340. }
  32341. ,
  32342. o._immediateFn = "function" == typeof setImmediate && function(e) {
  32343. setImmediate(e)
  32344. }
  32345. || function(e) {
  32346. d(e, 0)
  32347. }
  32348. ,
  32349. o._unhandledRejectionFn = function(e) {
  32350. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  32351. }
  32352. ,
  32353. o._setImmediateFn = function(e) {
  32354. o._immediateFn = e
  32355. }
  32356. ,
  32357. o._setUnhandledRejectionFn = function(e) {
  32358. o._unhandledRejectionFn = e
  32359. }
  32360. ,
  32361. void 0 !== t && t.exports ? t.exports = o : u.Promise || (u.Promise = o)
  32362. }
  32363. , {}],
  32364. 214: [function(p, i, e) {
  32365. (function(d) {
  32366. var e, t;
  32367. e = this,
  32368. t = function(I, e) {
  32369. "use strict";
  32370. var a, t, u, i, s, n, r, o = {};
  32371. return o.ByteBuffer = I,
  32372. o.Long = I.Long || null,
  32373. o.VERSION = "5.0.1",
  32374. o.WIRE_TYPES = {},
  32375. o.WIRE_TYPES.VARINT = 0,
  32376. o.WIRE_TYPES.BITS64 = 1,
  32377. o.WIRE_TYPES.LDELIM = 2,
  32378. o.WIRE_TYPES.STARTGROUP = 3,
  32379. o.WIRE_TYPES.ENDGROUP = 4,
  32380. o.WIRE_TYPES.BITS32 = 5,
  32381. o.PACKABLE_WIRE_TYPES = [o.WIRE_TYPES.VARINT, o.WIRE_TYPES.BITS64, o.WIRE_TYPES.BITS32],
  32382. o.TYPES = {
  32383. int32: {
  32384. name: "int32",
  32385. wireType: o.WIRE_TYPES.VARINT,
  32386. defaultValue: 0
  32387. },
  32388. uint32: {
  32389. name: "uint32",
  32390. wireType: o.WIRE_TYPES.VARINT,
  32391. defaultValue: 0
  32392. },
  32393. sint32: {
  32394. name: "sint32",
  32395. wireType: o.WIRE_TYPES.VARINT,
  32396. defaultValue: 0
  32397. },
  32398. int64: {
  32399. name: "int64",
  32400. wireType: o.WIRE_TYPES.VARINT,
  32401. defaultValue: o.Long ? o.Long.ZERO : void 0
  32402. },
  32403. uint64: {
  32404. name: "uint64",
  32405. wireType: o.WIRE_TYPES.VARINT,
  32406. defaultValue: o.Long ? o.Long.UZERO : void 0
  32407. },
  32408. sint64: {
  32409. name: "sint64",
  32410. wireType: o.WIRE_TYPES.VARINT,
  32411. defaultValue: o.Long ? o.Long.ZERO : void 0
  32412. },
  32413. bool: {
  32414. name: "bool",
  32415. wireType: o.WIRE_TYPES.VARINT,
  32416. defaultValue: !1
  32417. },
  32418. double: {
  32419. name: "double",
  32420. wireType: o.WIRE_TYPES.BITS64,
  32421. defaultValue: 0
  32422. },
  32423. string: {
  32424. name: "string",
  32425. wireType: o.WIRE_TYPES.LDELIM,
  32426. defaultValue: ""
  32427. },
  32428. bytes: {
  32429. name: "bytes",
  32430. wireType: o.WIRE_TYPES.LDELIM,
  32431. defaultValue: null
  32432. },
  32433. fixed32: {
  32434. name: "fixed32",
  32435. wireType: o.WIRE_TYPES.BITS32,
  32436. defaultValue: 0
  32437. },
  32438. sfixed32: {
  32439. name: "sfixed32",
  32440. wireType: o.WIRE_TYPES.BITS32,
  32441. defaultValue: 0
  32442. },
  32443. fixed64: {
  32444. name: "fixed64",
  32445. wireType: o.WIRE_TYPES.BITS64,
  32446. defaultValue: o.Long ? o.Long.UZERO : void 0
  32447. },
  32448. sfixed64: {
  32449. name: "sfixed64",
  32450. wireType: o.WIRE_TYPES.BITS64,
  32451. defaultValue: o.Long ? o.Long.ZERO : void 0
  32452. },
  32453. float: {
  32454. name: "float",
  32455. wireType: o.WIRE_TYPES.BITS32,
  32456. defaultValue: 0
  32457. },
  32458. enum: {
  32459. name: "enum",
  32460. wireType: o.WIRE_TYPES.VARINT,
  32461. defaultValue: 0
  32462. },
  32463. message: {
  32464. name: "message",
  32465. wireType: o.WIRE_TYPES.LDELIM,
  32466. defaultValue: null
  32467. },
  32468. group: {
  32469. name: "group",
  32470. wireType: o.WIRE_TYPES.STARTGROUP,
  32471. defaultValue: null
  32472. }
  32473. },
  32474. o.MAP_KEY_TYPES = [o.TYPES.int32, o.TYPES.sint32, o.TYPES.sfixed32, o.TYPES.uint32, o.TYPES.fixed32, o.TYPES.int64, o.TYPES.sint64, o.TYPES.sfixed64, o.TYPES.uint64, o.TYPES.fixed64, o.TYPES.bool, o.TYPES.string, o.TYPES.bytes],
  32475. o.ID_MIN = 1,
  32476. o.ID_MAX = 536870911,
  32477. o.convertFieldsToCamelCase = !1,
  32478. o.populateAccessors = !0,
  32479. o.populateDefaults = !0,
  32480. o.Util = ((r = {}).IS_NODE = !("object" != typeof d || d + "" != "[object process]" || d.browser),
  32481. r.XHR = function() {
  32482. for (var e = [function() {
  32483. return new XMLHttpRequest
  32484. }
  32485. , function() {
  32486. return new ActiveXObject("Msxml2.XMLHTTP")
  32487. }
  32488. , function() {
  32489. return new ActiveXObject("Msxml3.XMLHTTP")
  32490. }
  32491. , function() {
  32492. return new ActiveXObject("Microsoft.XMLHTTP")
  32493. }
  32494. ], t = null, i = 0; i < e.length; i++) {
  32495. try {
  32496. t = e[i]()
  32497. } catch (e) {
  32498. continue
  32499. }
  32500. break
  32501. }
  32502. if (!t)
  32503. throw Error("XMLHttpRequest is not supported");
  32504. return t
  32505. }
  32506. ,
  32507. r.fetch = function(e, i) {
  32508. if (i && "function" != typeof i && (i = null),
  32509. r.IS_NODE) {
  32510. var t = p("fs");
  32511. if (i)
  32512. t.readFile(e, function(e, t) {
  32513. i(e ? null : "" + t)
  32514. });
  32515. else
  32516. try {
  32517. return t.readFileSync(e)
  32518. } catch (e) {
  32519. return null
  32520. }
  32521. } else {
  32522. var n = r.XHR();
  32523. if (n.open("GET", e, !!i),
  32524. n.setRequestHeader("Accept", "text/plain"),
  32525. "function" == typeof n.overrideMimeType && n.overrideMimeType("text/plain"),
  32526. !i)
  32527. return n.send(null),
  32528. 200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null;
  32529. if (n.onreadystatechange = function() {
  32530. 4 == n.readyState && i(200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null)
  32531. }
  32532. ,
  32533. 4 == n.readyState)
  32534. return;
  32535. n.send(null)
  32536. }
  32537. }
  32538. ,
  32539. r.toCamelCase = function(e) {
  32540. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  32541. return t.toUpperCase()
  32542. })
  32543. }
  32544. ,
  32545. r),
  32546. o.Lang = {
  32547. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  32548. RULE: /^(?:required|optional|repeated|map)$/,
  32549. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  32550. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  32551. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  32552. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  32553. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  32554. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  32555. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  32556. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  32557. NUMBER_OCT: /^0[0-7]+$/,
  32558. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  32559. BOOL: /^(?:true|false)$/i,
  32560. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32561. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32562. WHITESPACE: /\s/,
  32563. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  32564. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  32565. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  32566. },
  32567. o.DotProto = function(r, a) {
  32568. function s(e, t) {
  32569. var i = -1
  32570. , n = 1;
  32571. if ("-" == e.charAt(0) && (n = -1,
  32572. e = e.substring(1)),
  32573. a.NUMBER_DEC.test(e))
  32574. i = parseInt(e);
  32575. else if (a.NUMBER_HEX.test(e))
  32576. i = parseInt(e.substring(2), 16);
  32577. else {
  32578. if (!a.NUMBER_OCT.test(e))
  32579. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32580. i = parseInt(e.substring(1), 8)
  32581. }
  32582. if (i = n * i | 0,
  32583. !t && i < 0)
  32584. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32585. return i
  32586. }
  32587. function o(e) {
  32588. var t = 1;
  32589. if ("-" == e.charAt(0) && (t = -1,
  32590. e = e.substring(1)),
  32591. a.NUMBER_DEC.test(e))
  32592. return t * parseInt(e, 10);
  32593. if (a.NUMBER_HEX.test(e))
  32594. return t * parseInt(e.substring(2), 16);
  32595. if (a.NUMBER_OCT.test(e))
  32596. return t * parseInt(e.substring(1), 8);
  32597. if ("inf" === e)
  32598. return t * (1 / 0);
  32599. if ("nan" === e)
  32600. return NaN;
  32601. if (a.NUMBER_FLT.test(e))
  32602. return t * parseFloat(e);
  32603. throw Error("illegal number value: " + (t < 0 ? "-" : "") + e)
  32604. }
  32605. function n(e, t, i) {
  32606. void 0 === e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  32607. e[t].push(i))
  32608. }
  32609. function t(e) {
  32610. this.source = e + "",
  32611. this.index = 0,
  32612. this.line = 1,
  32613. this.stack = [],
  32614. this._stringOpen = null
  32615. }
  32616. var e = {}
  32617. , i = t.prototype;
  32618. i._readString = function() {
  32619. var e = '"' === this._stringOpen ? a.STRING_DQ : a.STRING_SQ;
  32620. e.lastIndex = this.index - 1;
  32621. var t = e.exec(this.source);
  32622. if (!t)
  32623. throw Error("unterminated string");
  32624. return this.index = e.lastIndex,
  32625. this.stack.push(this._stringOpen),
  32626. this._stringOpen = null,
  32627. t[1]
  32628. }
  32629. ,
  32630. i.next = function() {
  32631. if (0 < this.stack.length)
  32632. return this.stack.shift();
  32633. if (this.index >= this.source.length)
  32634. return null;
  32635. if (null !== this._stringOpen)
  32636. return this._readString();
  32637. var e, t, i;
  32638. do {
  32639. for (e = !1; a.WHITESPACE.test(i = this.source.charAt(this.index)); )
  32640. if ("\n" === i && ++this.line,
  32641. ++this.index === this.source.length)
  32642. return null;
  32643. if ("/" === this.source.charAt(this.index))
  32644. if (++this.index,
  32645. "/" === this.source.charAt(this.index)) {
  32646. for (; "\n" !== this.source.charAt(++this.index); )
  32647. if (this.index == this.source.length)
  32648. return null;
  32649. ++this.index,
  32650. ++this.line,
  32651. e = !0
  32652. } else {
  32653. if ("*" !== (i = this.source.charAt(this.index)))
  32654. return "/";
  32655. do {
  32656. if ("\n" === i && ++this.line,
  32657. ++this.index === this.source.length)
  32658. return null;
  32659. t = i,
  32660. i = this.source.charAt(this.index)
  32661. } while ("*" !== t || "/" !== i);++this.index,
  32662. e = !0
  32663. }
  32664. } while (e);if (this.index === this.source.length)
  32665. return null;
  32666. var n = this.index;
  32667. if (a.DELIM.lastIndex = 0,
  32668. !a.DELIM.test(this.source.charAt(n++)))
  32669. for (; n < this.source.length && !a.DELIM.test(this.source.charAt(n)); )
  32670. ++n;
  32671. var r = this.source.substring(this.index, this.index = n);
  32672. return '"' !== r && "'" !== r || (this._stringOpen = r),
  32673. r
  32674. }
  32675. ,
  32676. i.peek = function() {
  32677. if (0 === this.stack.length) {
  32678. var e = this.next();
  32679. if (null === e)
  32680. return null;
  32681. this.stack.push(e)
  32682. }
  32683. return this.stack[0]
  32684. }
  32685. ,
  32686. i.skip = function(e) {
  32687. var t = this.next();
  32688. if (t !== e)
  32689. throw Error("illegal '" + t + "', '" + e + "' expected")
  32690. }
  32691. ,
  32692. i.omit = function(e) {
  32693. return this.peek() === e && (this.next(),
  32694. !0)
  32695. }
  32696. ,
  32697. i.toString = function() {
  32698. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  32699. }
  32700. ,
  32701. e.Tokenizer = t;
  32702. function l(e) {
  32703. this.tn = new t(e),
  32704. this.proto3 = !1
  32705. }
  32706. var c = l.prototype;
  32707. return c.parse = function() {
  32708. var e, t, i = {
  32709. name: "[ROOT]",
  32710. package: null,
  32711. messages: [],
  32712. enums: [],
  32713. imports: [],
  32714. options: {},
  32715. services: []
  32716. }, n = !0;
  32717. try {
  32718. for (; e = this.tn.next(); )
  32719. switch (e) {
  32720. case "package":
  32721. if (!n || null !== i.package)
  32722. throw Error("unexpected 'package'");
  32723. if (e = this.tn.next(),
  32724. !a.TYPEREF.test(e))
  32725. throw Error("illegal package name: " + e);
  32726. this.tn.skip(";"),
  32727. i.package = e;
  32728. break;
  32729. case "import":
  32730. if (!n)
  32731. throw Error("unexpected 'import'");
  32732. "public" !== (e = this.tn.peek()) && !(t = "weak" === e) || this.tn.next(),
  32733. e = this._readString(),
  32734. this.tn.skip(";"),
  32735. t || i.imports.push(e);
  32736. break;
  32737. case "syntax":
  32738. if (!n)
  32739. throw Error("unexpected 'syntax'");
  32740. this.tn.skip("="),
  32741. "proto3" === (i.syntax = this._readString()) && (this.proto3 = !0),
  32742. this.tn.skip(";");
  32743. break;
  32744. case "message":
  32745. this._parseMessage(i, null),
  32746. n = !1;
  32747. break;
  32748. case "enum":
  32749. this._parseEnum(i),
  32750. n = !1;
  32751. break;
  32752. case "option":
  32753. this._parseOption(i);
  32754. break;
  32755. case "service":
  32756. this._parseService(i);
  32757. break;
  32758. case "extend":
  32759. this._parseExtend(i);
  32760. break;
  32761. default:
  32762. throw Error("unexpected '" + e + "'")
  32763. }
  32764. } catch (e) {
  32765. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  32766. e
  32767. }
  32768. return delete i.name,
  32769. i
  32770. }
  32771. ,
  32772. l.parse = function(e) {
  32773. return new l(e).parse()
  32774. }
  32775. ,
  32776. c._readString = function() {
  32777. var e, t, i = "";
  32778. do {
  32779. if ("'" !== (t = this.tn.next()) && '"' !== t)
  32780. throw Error("illegal string delimiter: " + t);
  32781. i += this.tn.next(),
  32782. this.tn.skip(t),
  32783. e = this.tn.peek()
  32784. } while ('"' === e || '"' === e);return i
  32785. }
  32786. ,
  32787. c._readValue = function(e) {
  32788. var t = this.tn.peek();
  32789. if ('"' === t || "'" === t)
  32790. return this._readString();
  32791. if (this.tn.next(),
  32792. a.NUMBER.test(t))
  32793. return o(t);
  32794. if (a.BOOL.test(t))
  32795. return "true" === t.toLowerCase();
  32796. if (e && a.TYPEREF.test(t))
  32797. return t;
  32798. throw Error("illegal value: " + t)
  32799. }
  32800. ,
  32801. c._parseOption = function(e, t) {
  32802. var i = this.tn.next()
  32803. , n = !1;
  32804. if ("(" === i && (n = !0,
  32805. i = this.tn.next()),
  32806. !a.TYPEREF.test(i))
  32807. throw Error("illegal option name: " + i);
  32808. var r = i;
  32809. n && (this.tn.skip(")"),
  32810. r = "(" + r + ")",
  32811. i = this.tn.peek(),
  32812. a.FQTYPEREF.test(i) && (r += i,
  32813. this.tn.next())),
  32814. this.tn.skip("="),
  32815. this._parseOptionValue(e, r),
  32816. t || this.tn.skip(";")
  32817. }
  32818. ,
  32819. c._parseOptionValue = function(e, t) {
  32820. var i = this.tn.peek();
  32821. if ("{" !== i)
  32822. n(e.options, t, this._readValue(!0));
  32823. else
  32824. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); ) {
  32825. if (!a.NAME.test(i))
  32826. throw Error("illegal option name: " + t + "." + i);
  32827. this.tn.omit(":") ? n(e.options, t + "." + i, this._readValue(!0)) : this._parseOptionValue(e, t + "." + i)
  32828. }
  32829. }
  32830. ,
  32831. c._parseService = function(e) {
  32832. var t = this.tn.next();
  32833. if (!a.NAME.test(t))
  32834. throw Error("illegal service name at line " + this.tn.line + ": " + t);
  32835. var i = {
  32836. name: t,
  32837. rpc: {},
  32838. options: {}
  32839. };
  32840. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32841. if ("option" === t)
  32842. this._parseOption(i);
  32843. else {
  32844. if ("rpc" !== t)
  32845. throw Error("illegal service token: " + t);
  32846. this._parseServiceRPC(i)
  32847. }
  32848. this.tn.omit(";"),
  32849. e.services.push(i)
  32850. }
  32851. ,
  32852. c._parseServiceRPC = function(e) {
  32853. var t = this.tn.next();
  32854. if (!a.NAME.test(t))
  32855. throw Error("illegal rpc service method name: " + t);
  32856. var i = t
  32857. , n = {
  32858. request: null,
  32859. response: null,
  32860. request_stream: !1,
  32861. response_stream: !1,
  32862. options: {}
  32863. };
  32864. if (this.tn.skip("("),
  32865. "stream" === (t = this.tn.next()).toLowerCase() && (n.request_stream = !0,
  32866. t = this.tn.next()),
  32867. !a.TYPEREF.test(t))
  32868. throw Error("illegal rpc service request type: " + t);
  32869. if (n.request = t,
  32870. this.tn.skip(")"),
  32871. "returns" !== (t = this.tn.next()).toLowerCase())
  32872. throw Error("illegal rpc service request type delimiter: " + t);
  32873. if (this.tn.skip("("),
  32874. "stream" === (t = this.tn.next()).toLowerCase() && (n.response_stream = !0,
  32875. t = this.tn.next()),
  32876. n.response = t,
  32877. this.tn.skip(")"),
  32878. "{" === (t = this.tn.peek())) {
  32879. for (this.tn.next(); "}" !== (t = this.tn.next()); ) {
  32880. if ("option" !== t)
  32881. throw Error("illegal rpc service token: " + t);
  32882. this._parseOption(n)
  32883. }
  32884. this.tn.omit(";")
  32885. } else
  32886. this.tn.skip(";");
  32887. void 0 === e.rpc && (e.rpc = {}),
  32888. e.rpc[i] = n
  32889. }
  32890. ,
  32891. c._parseMessage = function(e, t) {
  32892. var i = !!t
  32893. , n = this.tn.next()
  32894. , r = {
  32895. name: "",
  32896. fields: [],
  32897. enums: [],
  32898. messages: [],
  32899. options: {},
  32900. services: [],
  32901. oneofs: {}
  32902. };
  32903. if (!a.NAME.test(n))
  32904. throw Error("illegal " + (i ? "group" : "message") + " name: " + n);
  32905. for (r.name = n,
  32906. i && (this.tn.skip("="),
  32907. t.id = s(this.tn.next()),
  32908. r.isGroup = !0),
  32909. "[" === (n = this.tn.peek()) && t && this._parseFieldOptions(t),
  32910. this.tn.skip("{"); "}" !== (n = this.tn.next()); )
  32911. if (a.RULE.test(n))
  32912. this._parseMessageField(r, n);
  32913. else if ("oneof" === n)
  32914. this._parseMessageOneOf(r);
  32915. else if ("enum" === n)
  32916. this._parseEnum(r);
  32917. else if ("message" === n)
  32918. this._parseMessage(r);
  32919. else if ("option" === n)
  32920. this._parseOption(r);
  32921. else if ("service" === n)
  32922. this._parseService(r);
  32923. else if ("extensions" === n)
  32924. r.extensions = this._parseExtensionRanges();
  32925. else if ("reserved" === n)
  32926. this._parseIgnored();
  32927. else if ("extend" === n)
  32928. this._parseExtend(r);
  32929. else {
  32930. if (!a.TYPEREF.test(n))
  32931. throw Error("illegal message token: " + n);
  32932. if (!this.proto3)
  32933. throw Error("illegal field rule: " + n);
  32934. this._parseMessageField(r, "optional", n)
  32935. }
  32936. return this.tn.omit(";"),
  32937. e.messages.push(r),
  32938. r
  32939. }
  32940. ,
  32941. c._parseIgnored = function() {
  32942. for (; ";" !== this.tn.peek(); )
  32943. this.tn.next();
  32944. this.tn.skip(";")
  32945. }
  32946. ,
  32947. c._parseMessageField = function(e, t, i) {
  32948. if (!a.RULE.test(t))
  32949. throw Error("illegal message field rule: " + t);
  32950. var n, r = {
  32951. rule: t,
  32952. type: "",
  32953. name: "",
  32954. options: {},
  32955. id: 0
  32956. };
  32957. if ("map" === t) {
  32958. if (i)
  32959. throw Error("illegal type: " + i);
  32960. if (this.tn.skip("<"),
  32961. n = this.tn.next(),
  32962. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32963. throw Error("illegal message field type: " + n);
  32964. if (r.keytype = n,
  32965. this.tn.skip(","),
  32966. n = this.tn.next(),
  32967. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32968. throw Error("illegal message field: " + n);
  32969. if (r.type = n,
  32970. this.tn.skip(">"),
  32971. n = this.tn.next(),
  32972. !a.NAME.test(n))
  32973. throw Error("illegal message field name: " + n);
  32974. r.name = n,
  32975. this.tn.skip("="),
  32976. r.id = s(this.tn.next()),
  32977. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32978. this.tn.skip(";")
  32979. } else if ("group" === (i = void 0 !== i ? i : this.tn.next())) {
  32980. var o = this._parseMessage(e, r);
  32981. if (!/^[A-Z]/.test(o.name))
  32982. throw Error("illegal group name: " + o.name);
  32983. r.type = o.name,
  32984. r.name = o.name.toLowerCase(),
  32985. this.tn.omit(";")
  32986. } else {
  32987. if (!a.TYPE.test(i) && !a.TYPEREF.test(i))
  32988. throw Error("illegal message field type: " + i);
  32989. if (r.type = i,
  32990. n = this.tn.next(),
  32991. !a.NAME.test(n))
  32992. throw Error("illegal message field name: " + n);
  32993. r.name = n,
  32994. this.tn.skip("="),
  32995. r.id = s(this.tn.next()),
  32996. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32997. this.tn.skip(";")
  32998. }
  32999. return e.fields.push(r),
  33000. r
  33001. }
  33002. ,
  33003. c._parseMessageOneOf = function(e) {
  33004. var t = this.tn.next();
  33005. if (!a.NAME.test(t))
  33006. throw Error("illegal oneof name: " + t);
  33007. var i, n = t, r = [];
  33008. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  33009. (i = this._parseMessageField(e, "optional", t)).oneof = n,
  33010. r.push(i.id);
  33011. this.tn.omit(";"),
  33012. e.oneofs[n] = r
  33013. }
  33014. ,
  33015. c._parseFieldOptions = function(e) {
  33016. this.tn.skip("[");
  33017. for (var t = !0; "]" !== this.tn.peek(); )
  33018. t || this.tn.skip(","),
  33019. this._parseOption(e, !0),
  33020. t = !1;
  33021. this.tn.next()
  33022. }
  33023. ,
  33024. c._parseEnum = function(e) {
  33025. var t = {
  33026. name: "",
  33027. values: [],
  33028. options: {}
  33029. }
  33030. , i = this.tn.next();
  33031. if (!a.NAME.test(i))
  33032. throw Error("illegal name: " + i);
  33033. for (t.name = i,
  33034. this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  33035. if ("option" === i)
  33036. this._parseOption(t);
  33037. else {
  33038. if (!a.NAME.test(i))
  33039. throw Error("illegal name: " + i);
  33040. this.tn.skip("=");
  33041. var n = {
  33042. name: i,
  33043. id: s(this.tn.next(), !0)
  33044. };
  33045. "[" === (i = this.tn.peek()) && this._parseFieldOptions({
  33046. options: {}
  33047. }),
  33048. this.tn.skip(";"),
  33049. t.values.push(n)
  33050. }
  33051. this.tn.omit(";"),
  33052. e.enums.push(t)
  33053. }
  33054. ,
  33055. c._parseExtensionRanges = function() {
  33056. var e, t, i, n = [];
  33057. do {
  33058. for (t = []; ; ) {
  33059. switch (e = this.tn.next()) {
  33060. case "min":
  33061. i = r.ID_MIN;
  33062. break;
  33063. case "max":
  33064. i = r.ID_MAX;
  33065. break;
  33066. default:
  33067. i = o(e)
  33068. }
  33069. if (t.push(i),
  33070. 2 === t.length)
  33071. break;
  33072. if ("to" !== this.tn.peek()) {
  33073. t.push(i);
  33074. break
  33075. }
  33076. this.tn.next()
  33077. }
  33078. n.push(t)
  33079. } while (this.tn.omit(","));return this.tn.skip(";"),
  33080. n
  33081. }
  33082. ,
  33083. c._parseExtend = function(e) {
  33084. var t = this.tn.next();
  33085. if (!a.TYPEREF.test(t))
  33086. throw Error("illegal extend reference: " + t);
  33087. var i = {
  33088. ref: t,
  33089. fields: []
  33090. };
  33091. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  33092. if (a.RULE.test(t))
  33093. this._parseMessageField(i, t);
  33094. else {
  33095. if (!a.TYPEREF.test(t))
  33096. throw Error("illegal extend token: " + t);
  33097. if (!this.proto3)
  33098. throw Error("illegal field rule: " + t);
  33099. this._parseMessageField(i, "optional", t)
  33100. }
  33101. return this.tn.omit(";"),
  33102. e.messages.push(i),
  33103. i
  33104. }
  33105. ,
  33106. c.toString = function() {
  33107. return "Parser at line " + this.tn.line
  33108. }
  33109. ,
  33110. e.Parser = l,
  33111. e
  33112. }(o, o.Lang),
  33113. o.Reflect = function(g) {
  33114. function a(e, t) {
  33115. if (e && "number" == typeof e.low && "number" == typeof e.high && "boolean" == typeof e.unsigned && e.low == e.low && e.high == e.high)
  33116. return new g.Long(e.low,e.high,void 0 === t ? e.unsigned : t);
  33117. if ("string" == typeof e)
  33118. return g.Long.fromString(e, t || !1, 10);
  33119. if ("number" == typeof e)
  33120. return g.Long.fromNumber(e, t || !1);
  33121. throw Error("not convertible to Long")
  33122. }
  33123. function m(e, t) {
  33124. var i = t.readVarint32()
  33125. , n = 7 & i
  33126. , r = i >>> 3;
  33127. switch (n) {
  33128. case g.WIRE_TYPES.VARINT:
  33129. for (; 128 == (128 & (i = t.readUint8())); )
  33130. ;
  33131. break;
  33132. case g.WIRE_TYPES.BITS64:
  33133. t.offset += 8;
  33134. break;
  33135. case g.WIRE_TYPES.LDELIM:
  33136. i = t.readVarint32(),
  33137. t.offset += i;
  33138. break;
  33139. case g.WIRE_TYPES.STARTGROUP:
  33140. m(r, t);
  33141. break;
  33142. case g.WIRE_TYPES.ENDGROUP:
  33143. if (r === e)
  33144. return !1;
  33145. throw Error("Illegal GROUPEND after unknown group: " + r + " (" + e + " expected)");
  33146. case g.WIRE_TYPES.BITS32:
  33147. t.offset += 4;
  33148. break;
  33149. default:
  33150. throw Error("Illegal wire type in unknown group " + e + ": " + n)
  33151. }
  33152. return !0
  33153. }
  33154. function h(e, t, i) {
  33155. this.builder = e,
  33156. this.parent = t,
  33157. this.name = i,
  33158. this.className
  33159. }
  33160. var s = {}
  33161. , e = h.prototype;
  33162. e.fqn = function() {
  33163. for (var e = this.name, t = this; null != (t = t.parent); )
  33164. e = t.name + "." + e;
  33165. return e
  33166. }
  33167. ,
  33168. e.toString = function(e) {
  33169. return (e ? this.className + " " : "") + this.fqn()
  33170. }
  33171. ,
  33172. e.build = function() {
  33173. throw Error(this.toString(!0) + " cannot be built directly")
  33174. }
  33175. ,
  33176. s.T = h;
  33177. function l(e, t, i, n, r) {
  33178. h.call(this, e, t, i),
  33179. this.className = "Namespace",
  33180. this.children = [],
  33181. this.options = n || {},
  33182. this.syntax = r || "proto2"
  33183. }
  33184. var t = l.prototype = Object.create(h.prototype);
  33185. t.getChildren = function(e) {
  33186. if (null == (e = e || null))
  33187. return this.children.slice();
  33188. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  33189. this.children[i]instanceof e && t.push(this.children[i]);
  33190. return t
  33191. }
  33192. ,
  33193. t.addChild = function(e) {
  33194. var t;
  33195. if (t = this.getChild(e.name))
  33196. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  33197. t.name = t.originalName;
  33198. else {
  33199. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  33200. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  33201. e.name = e.originalName
  33202. }
  33203. this.children.push(e)
  33204. }
  33205. ,
  33206. t.getChild = function(e) {
  33207. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  33208. if (this.children[i][t] === e)
  33209. return this.children[i];
  33210. return null
  33211. }
  33212. ,
  33213. t.resolve = function(e, t) {
  33214. var i, n = "string" == typeof e ? e.split(".") : e, r = this, o = 0;
  33215. if ("" === n[o]) {
  33216. for (; null !== r.parent; )
  33217. r = r.parent;
  33218. o++
  33219. }
  33220. do {
  33221. do {
  33222. if (!(r instanceof s.Namespace)) {
  33223. r = null;
  33224. break
  33225. }
  33226. if (!(i = r.getChild(n[o])) || !(i instanceof s.T) || t && !(i instanceof s.Namespace)) {
  33227. r = null;
  33228. break
  33229. }
  33230. r = i,
  33231. o++
  33232. } while (o < n.length);if (null != r)
  33233. break;
  33234. if (null !== this.parent)
  33235. return this.parent.resolve(e, t)
  33236. } while (null != r);return r
  33237. }
  33238. ,
  33239. t.qn = function(e) {
  33240. for (var t = [], i = e; t.unshift(i.name),
  33241. null !== (i = i.parent); )
  33242. ;
  33243. for (var n = 1; n <= t.length; n++) {
  33244. var r = t.slice(t.length - n);
  33245. if (e === this.resolve(r, e instanceof s.Namespace))
  33246. return r.join(".")
  33247. }
  33248. return e.fqn()
  33249. }
  33250. ,
  33251. t.build = function() {
  33252. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  33253. (e = i[n])instanceof l && (t[e.name] = e.build());
  33254. return Object.defineProperty && Object.defineProperty(t, "$options", {
  33255. value: this.buildOpt()
  33256. }),
  33257. t
  33258. }
  33259. ,
  33260. t.buildOpt = function() {
  33261. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  33262. var r = t[i]
  33263. , o = this.options[t[i]];
  33264. e[r] = o
  33265. }
  33266. return e
  33267. }
  33268. ,
  33269. t.getOption = function(e) {
  33270. return void 0 === e ? this.options : void 0 !== this.options[e] ? this.options[e] : null
  33271. }
  33272. ,
  33273. s.Namespace = l;
  33274. function u(e, t, i, n) {
  33275. if (this.type = e,
  33276. this.resolvedType = t,
  33277. this.isMapKey = i,
  33278. this.syntax = n,
  33279. i && g.MAP_KEY_TYPES.indexOf(e) < 0)
  33280. throw Error("Invalid map key type: " + e.name)
  33281. }
  33282. var i = u.prototype;
  33283. u.defaultFieldValue = function(e) {
  33284. if ("string" == typeof e && (e = g.TYPES[e]),
  33285. void 0 === e.defaultValue)
  33286. throw Error("default value for type " + e.name + " is not supported");
  33287. return e == g.TYPES.bytes ? new I(0) : e.defaultValue
  33288. }
  33289. ,
  33290. i.verifyValue = function(t) {
  33291. function i(e, t) {
  33292. throw Error("Illegal value for " + n.toString(!0) + " of type " + n.type.name + ": " + e + " (" + t + ")")
  33293. }
  33294. var n = this;
  33295. switch (this.type) {
  33296. case g.TYPES.int32:
  33297. case g.TYPES.sint32:
  33298. case g.TYPES.sfixed32:
  33299. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33300. 4294967295 < t ? 0 | t : t;
  33301. case g.TYPES.uint32:
  33302. case g.TYPES.fixed32:
  33303. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33304. t < 0 ? t >>> 0 : t;
  33305. case g.TYPES.int64:
  33306. case g.TYPES.sint64:
  33307. case g.TYPES.sfixed64:
  33308. if (g.Long)
  33309. try {
  33310. return a(t, !1)
  33311. } catch (e) {
  33312. i(typeof t, e.message)
  33313. }
  33314. else
  33315. i(typeof t, "requires Long.js");
  33316. case g.TYPES.uint64:
  33317. case g.TYPES.fixed64:
  33318. if (g.Long)
  33319. try {
  33320. return a(t, !0)
  33321. } catch (e) {
  33322. i(typeof t, e.message)
  33323. }
  33324. else
  33325. i(typeof t, "requires Long.js");
  33326. case g.TYPES.bool:
  33327. return "boolean" != typeof t && i(typeof t, "not a boolean"),
  33328. t;
  33329. case g.TYPES.float:
  33330. case g.TYPES.double:
  33331. return "number" != typeof t && i(typeof t, "not a number"),
  33332. t;
  33333. case g.TYPES.string:
  33334. return "string" == typeof t || t && t instanceof String || i(typeof t, "not a string"),
  33335. "" + t;
  33336. case g.TYPES.bytes:
  33337. return I.isByteBuffer(t) ? t : I.wrap(t, "base64");
  33338. case g.TYPES.enum:
  33339. var e = this.resolvedType.getChildren(g.Reflect.Enum.Value);
  33340. for (o = 0; o < e.length; o++) {
  33341. if (e[o].name == t)
  33342. return e[o].id;
  33343. if (e[o].id == t)
  33344. return e[o].id
  33345. }
  33346. if ("proto3" === this.syntax)
  33347. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33348. (4294967295 < t || t < 0) && i(typeof t, "not in range for uint32"),
  33349. t;
  33350. i(t, "not a valid enum value");
  33351. case g.TYPES.group:
  33352. case g.TYPES.message:
  33353. if (t && "object" == typeof t || i(typeof t, "object expected"),
  33354. t instanceof this.resolvedType.clazz)
  33355. return t;
  33356. if (t instanceof g.Builder.Message) {
  33357. var r = {};
  33358. for (var o in t)
  33359. t.hasOwnProperty(o) && (r[o] = t[o]);
  33360. t = r
  33361. }
  33362. return new this.resolvedType.clazz(t)
  33363. }
  33364. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + t + " (undefined type " + this.type + ")")
  33365. }
  33366. ,
  33367. i.calculateLength = function(e, t) {
  33368. if (null === t)
  33369. return 0;
  33370. var i;
  33371. switch (this.type) {
  33372. case g.TYPES.int32:
  33373. return t < 0 ? I.calculateVarint64(t) : I.calculateVarint32(t);
  33374. case g.TYPES.uint32:
  33375. return I.calculateVarint32(t);
  33376. case g.TYPES.sint32:
  33377. return I.calculateVarint32(I.zigZagEncode32(t));
  33378. case g.TYPES.fixed32:
  33379. case g.TYPES.sfixed32:
  33380. case g.TYPES.float:
  33381. return 4;
  33382. case g.TYPES.int64:
  33383. case g.TYPES.uint64:
  33384. return I.calculateVarint64(t);
  33385. case g.TYPES.sint64:
  33386. return I.calculateVarint64(I.zigZagEncode64(t));
  33387. case g.TYPES.fixed64:
  33388. case g.TYPES.sfixed64:
  33389. return 8;
  33390. case g.TYPES.bool:
  33391. return 1;
  33392. case g.TYPES.enum:
  33393. return I.calculateVarint32(t);
  33394. case g.TYPES.double:
  33395. return 8;
  33396. case g.TYPES.string:
  33397. return i = I.calculateUTF8Bytes(t),
  33398. I.calculateVarint32(i) + i;
  33399. case g.TYPES.bytes:
  33400. if (t.remaining() < 0)
  33401. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33402. return I.calculateVarint32(t.remaining()) + t.remaining();
  33403. case g.TYPES.message:
  33404. return i = this.resolvedType.calculate(t),
  33405. I.calculateVarint32(i) + i;
  33406. case g.TYPES.group:
  33407. return (i = this.resolvedType.calculate(t)) + I.calculateVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP)
  33408. }
  33409. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33410. }
  33411. ,
  33412. i.encodeValue = function(e, t, i) {
  33413. if (null === t)
  33414. return i;
  33415. switch (this.type) {
  33416. case g.TYPES.int32:
  33417. t < 0 ? i.writeVarint64(t) : i.writeVarint32(t);
  33418. break;
  33419. case g.TYPES.uint32:
  33420. i.writeVarint32(t);
  33421. break;
  33422. case g.TYPES.sint32:
  33423. i.writeVarint32ZigZag(t);
  33424. break;
  33425. case g.TYPES.fixed32:
  33426. i.writeUint32(t);
  33427. break;
  33428. case g.TYPES.sfixed32:
  33429. i.writeInt32(t);
  33430. break;
  33431. case g.TYPES.int64:
  33432. case g.TYPES.uint64:
  33433. i.writeVarint64(t);
  33434. break;
  33435. case g.TYPES.sint64:
  33436. i.writeVarint64ZigZag(t);
  33437. break;
  33438. case g.TYPES.fixed64:
  33439. i.writeUint64(t);
  33440. break;
  33441. case g.TYPES.sfixed64:
  33442. i.writeInt64(t);
  33443. break;
  33444. case g.TYPES.bool:
  33445. "string" == typeof t ? i.writeVarint32("false" === t.toLowerCase() ? 0 : !!t) : i.writeVarint32(t ? 1 : 0);
  33446. break;
  33447. case g.TYPES.enum:
  33448. i.writeVarint32(t);
  33449. break;
  33450. case g.TYPES.float:
  33451. i.writeFloat32(t);
  33452. break;
  33453. case g.TYPES.double:
  33454. i.writeFloat64(t);
  33455. break;
  33456. case g.TYPES.string:
  33457. i.writeVString(t);
  33458. break;
  33459. case g.TYPES.bytes:
  33460. if (t.remaining() < 0)
  33461. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33462. var n = t.offset;
  33463. i.writeVarint32(t.remaining()),
  33464. i.append(t),
  33465. t.offset = n;
  33466. break;
  33467. case g.TYPES.message:
  33468. var r = (new I).LE();
  33469. this.resolvedType.encode(t, r),
  33470. i.writeVarint32(r.offset),
  33471. i.append(r.flip());
  33472. break;
  33473. case g.TYPES.group:
  33474. this.resolvedType.encode(t, i),
  33475. i.writeVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP);
  33476. break;
  33477. default:
  33478. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33479. }
  33480. return i
  33481. }
  33482. ,
  33483. i.decode = function(e, t, i) {
  33484. if (t != this.type.wireType)
  33485. throw Error("Unexpected wire type for element");
  33486. var n, r;
  33487. switch (this.type) {
  33488. case g.TYPES.int32:
  33489. return 0 | e.readVarint32();
  33490. case g.TYPES.uint32:
  33491. return e.readVarint32() >>> 0;
  33492. case g.TYPES.sint32:
  33493. return 0 | e.readVarint32ZigZag();
  33494. case g.TYPES.fixed32:
  33495. return e.readUint32() >>> 0;
  33496. case g.TYPES.sfixed32:
  33497. return 0 | e.readInt32();
  33498. case g.TYPES.int64:
  33499. return e.readVarint64();
  33500. case g.TYPES.uint64:
  33501. return e.readVarint64().toUnsigned();
  33502. case g.TYPES.sint64:
  33503. return e.readVarint64ZigZag();
  33504. case g.TYPES.fixed64:
  33505. return e.readUint64();
  33506. case g.TYPES.sfixed64:
  33507. return e.readInt64();
  33508. case g.TYPES.bool:
  33509. return !!e.readVarint32();
  33510. case g.TYPES.enum:
  33511. return e.readVarint32();
  33512. case g.TYPES.float:
  33513. return e.readFloat();
  33514. case g.TYPES.double:
  33515. return e.readDouble();
  33516. case g.TYPES.string:
  33517. return e.readVString();
  33518. case g.TYPES.bytes:
  33519. if (r = e.readVarint32(),
  33520. e.remaining() < r)
  33521. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + e.remaining());
  33522. return (n = e.clone()).limit = n.offset + r,
  33523. e.offset += r,
  33524. n;
  33525. case g.TYPES.message:
  33526. return r = e.readVarint32(),
  33527. this.resolvedType.decode(e, r);
  33528. case g.TYPES.group:
  33529. return this.resolvedType.decode(e, -1, i)
  33530. }
  33531. throw Error("[INTERNAL] Illegal decode type")
  33532. }
  33533. ,
  33534. i.valueFromString = function(e) {
  33535. if (!this.isMapKey)
  33536. throw Error("valueFromString() called on non-map-key element");
  33537. switch (this.type) {
  33538. case g.TYPES.int32:
  33539. case g.TYPES.sint32:
  33540. case g.TYPES.sfixed32:
  33541. case g.TYPES.uint32:
  33542. case g.TYPES.fixed32:
  33543. return this.verifyValue(parseInt(e));
  33544. case g.TYPES.int64:
  33545. case g.TYPES.sint64:
  33546. case g.TYPES.sfixed64:
  33547. case g.TYPES.uint64:
  33548. case g.TYPES.fixed64:
  33549. return this.verifyValue(e);
  33550. case g.TYPES.bool:
  33551. return "true" === e;
  33552. case g.TYPES.string:
  33553. return this.verifyValue(e);
  33554. case g.TYPES.bytes:
  33555. return I.fromBinary(e)
  33556. }
  33557. }
  33558. ,
  33559. i.valueToString = function(e) {
  33560. if (!this.isMapKey)
  33561. throw Error("valueToString() called on non-map-key element");
  33562. return this.type === g.TYPES.bytes ? e.toString("binary") : e.toString()
  33563. }
  33564. ,
  33565. s.Element = u;
  33566. var d = function(e, t, i, n, r, o) {
  33567. l.call(this, e, t, i, n, o),
  33568. this.className = "Message",
  33569. this.extensions = void 0,
  33570. this.clazz = null,
  33571. this.isGroup = !!r,
  33572. this._fields = null,
  33573. this._fieldsById = null,
  33574. this._fieldsByName = null
  33575. }
  33576. , n = d.prototype = Object.create(l.prototype);
  33577. n.build = function(e) {
  33578. if (this.clazz && !e)
  33579. return this.clazz;
  33580. var t = function(u, a) {
  33581. function d(e, i, n, r) {
  33582. if (null === e || "object" != typeof e) {
  33583. if (r && r instanceof u.Reflect.Enum) {
  33584. var t = u.Reflect.Enum.getName(r.object, e);
  33585. if (null !== t)
  33586. return t
  33587. }
  33588. return e
  33589. }
  33590. if (I.isByteBuffer(e))
  33591. return i ? e.toBase64() : e.toBuffer();
  33592. if (u.Long.isLong(e))
  33593. return n ? e.toString() : u.Long.fromValue(e);
  33594. var o;
  33595. if (Array.isArray(e))
  33596. return o = [],
  33597. e.forEach(function(e, t) {
  33598. o[t] = d(e, i, n, r)
  33599. }),
  33600. o;
  33601. if (o = {},
  33602. e instanceof u.Map) {
  33603. for (var a = e.entries(), s = a.next(); !s.done; s = a.next())
  33604. o[e.keyElem.valueToString(s.value[0])] = d(s.value[1], i, n, e.valueElem.resolvedType);
  33605. return o
  33606. }
  33607. var l = e.$type
  33608. , c = void 0;
  33609. for (var h in e)
  33610. e.hasOwnProperty(h) && (l && (c = l.getChild(h)) ? o[h] = d(e[h], i, n, c.resolvedType) : o[h] = d(e[h], i, n));
  33611. return o
  33612. }
  33613. var s = a.getChildren(u.Reflect.Message.Field)
  33614. , l = a.getChildren(u.Reflect.Message.OneOf)
  33615. , c = function(e, t) {
  33616. u.Builder.Message.call(this);
  33617. for (var i = 0, n = l.length; i < n; ++i)
  33618. this[l[i].name] = null;
  33619. for (i = 0,
  33620. n = s.length; i < n; ++i) {
  33621. var r = s[i];
  33622. this[r.name] = r.repeated ? [] : r.map ? new u.Map(r) : null,
  33623. !r.required && "proto3" !== a.syntax || null === r.defaultValue || (this[r.name] = r.defaultValue)
  33624. }
  33625. var o;
  33626. if (0 < arguments.length)
  33627. if (1 !== arguments.length || null === e || "object" != typeof e || !("function" != typeof e.encode || e instanceof c) || Array.isArray(e) || e instanceof u.Map || I.isByteBuffer(e) || e instanceof ArrayBuffer || u.Long && e instanceof u.Long)
  33628. for (i = 0,
  33629. n = arguments.length; i < n; ++i)
  33630. void 0 !== (o = arguments[i]) && this.$set(s[i].name, o);
  33631. else
  33632. this.$set(e)
  33633. }
  33634. , o = c.prototype = Object.create(u.Builder.Message.prototype);
  33635. o.add = function(e, t, i) {
  33636. var n = a._fieldsByName[e];
  33637. if (!i) {
  33638. if (!n)
  33639. throw Error(this + "#" + e + " is undefined");
  33640. if (!(n instanceof u.Reflect.Message.Field))
  33641. throw Error(this + "#" + e + " is not a field: " + n.toString(!0));
  33642. if (!n.repeated)
  33643. throw Error(this + "#" + e + " is not a repeated field");
  33644. t = n.verifyValue(t, !0)
  33645. }
  33646. return null === this[e] && (this[e] = []),
  33647. this[e].push(t),
  33648. this
  33649. }
  33650. ,
  33651. o.$add = o.add,
  33652. o.set = function(e, t, i) {
  33653. if (e && "object" == typeof e) {
  33654. for (var n in i = t,
  33655. e)
  33656. e.hasOwnProperty(n) && void 0 !== (t = e[n]) && this.$set(n, t, i);
  33657. return this
  33658. }
  33659. var r = a._fieldsByName[e];
  33660. if (i)
  33661. this[e] = t;
  33662. else {
  33663. if (!r)
  33664. throw Error(this + "#" + e + " is not a field: undefined");
  33665. if (!(r instanceof u.Reflect.Message.Field))
  33666. throw Error(this + "#" + e + " is not a field: " + r.toString(!0));
  33667. this[r.name] = t = r.verifyValue(t)
  33668. }
  33669. if (r && r.oneof) {
  33670. var o = this[r.oneof.name];
  33671. null !== t ? (null !== o && o !== r.name && (this[o] = null),
  33672. this[r.oneof.name] = r.name) : o === e && (this[r.oneof.name] = null)
  33673. }
  33674. return this
  33675. }
  33676. ,
  33677. o.$set = o.set,
  33678. o.get = function(e, t) {
  33679. if (t)
  33680. return this[e];
  33681. var i = a._fieldsByName[e];
  33682. if (!(i && i instanceof u.Reflect.Message.Field))
  33683. throw Error(this + "#" + e + " is not a field: undefined");
  33684. if (!(i instanceof u.Reflect.Message.Field))
  33685. throw Error(this + "#" + e + " is not a field: " + i.toString(!0));
  33686. return this[i.name]
  33687. }
  33688. ,
  33689. o.$get = o.get;
  33690. for (var e = 0; e < s.length; e++) {
  33691. var t = s[e];
  33692. t instanceof u.Reflect.Message.ExtensionField || a.builder.options.populateAccessors && function(i) {
  33693. var e = i.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  33694. return e.toUpperCase().replace("_", "")
  33695. });
  33696. e = e.substring(0, 1).toUpperCase() + e.substring(1);
  33697. function t(e, t) {
  33698. return this[i.name] = t ? e : i.verifyValue(e),
  33699. this
  33700. }
  33701. function n() {
  33702. return this[i.name]
  33703. }
  33704. var r = i.originalName.replace(/([A-Z])/g, function(e) {
  33705. return "_" + e
  33706. });
  33707. null === a.getChild("set" + e) && (o["set" + e] = t),
  33708. null === a.getChild("set_" + r) && (o["set_" + r] = t),
  33709. null === a.getChild("get" + e) && (o["get" + e] = n),
  33710. null === a.getChild("get_" + r) && (o["get_" + r] = n)
  33711. }(t)
  33712. }
  33713. return o.encode = function(t, e) {
  33714. "boolean" == typeof t && (e = t,
  33715. t = void 0);
  33716. var i = !1;
  33717. t || (t = new I,
  33718. i = !0);
  33719. var n = t.littleEndian;
  33720. try {
  33721. return a.encode(this, t.LE(), e),
  33722. (i ? t.flip() : t).LE(n)
  33723. } catch (e) {
  33724. throw t.LE(n),
  33725. e
  33726. }
  33727. }
  33728. ,
  33729. c.encode = function(e, t, i) {
  33730. return new c(e).encode(t, i)
  33731. }
  33732. ,
  33733. o.calculate = function() {
  33734. return a.calculate(this)
  33735. }
  33736. ,
  33737. o.encodeDelimited = function(e, t) {
  33738. var i = !1;
  33739. e || (e = new I,
  33740. i = !0);
  33741. var n = (new I).LE();
  33742. return a.encode(this, n, t).flip(),
  33743. e.writeVarint32(n.remaining()),
  33744. e.append(n),
  33745. i ? e.flip() : e
  33746. }
  33747. ,
  33748. o.encodeAB = function() {
  33749. try {
  33750. return this.encode().toArrayBuffer()
  33751. } catch (e) {
  33752. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  33753. e
  33754. }
  33755. }
  33756. ,
  33757. o.toArrayBuffer = o.encodeAB,
  33758. o.encodeNB = function() {
  33759. try {
  33760. return this.encode().toBuffer()
  33761. } catch (e) {
  33762. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  33763. e
  33764. }
  33765. }
  33766. ,
  33767. o.toBuffer = o.encodeNB,
  33768. o.encode64 = function() {
  33769. try {
  33770. return this.encode().toBase64()
  33771. } catch (e) {
  33772. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  33773. e
  33774. }
  33775. }
  33776. ,
  33777. o.toBase64 = o.encode64,
  33778. o.encodeHex = function() {
  33779. try {
  33780. return this.encode().toHex()
  33781. } catch (e) {
  33782. throw e.encoded && (e.encoded = e.encoded.toHex()),
  33783. e
  33784. }
  33785. }
  33786. ,
  33787. o.toHex = o.encodeHex,
  33788. o.toRaw = function(e, t) {
  33789. return d(this, !!e, !!t, this.$type)
  33790. }
  33791. ,
  33792. o.encodeJSON = function() {
  33793. return JSON.stringify(d(this, !0, !0, this.$type))
  33794. }
  33795. ,
  33796. c.decode = function(t, e, i) {
  33797. "string" == typeof e && (i = e,
  33798. e = -1),
  33799. "string" == typeof t && (t = I.wrap(t, i || "base64"));
  33800. var n = (t = I.isByteBuffer(t) ? t : I.wrap(t)).littleEndian;
  33801. try {
  33802. var r = a.decode(t.LE());
  33803. return t.LE(n),
  33804. r
  33805. } catch (e) {
  33806. throw t.LE(n),
  33807. e
  33808. }
  33809. }
  33810. ,
  33811. c.decodeDelimited = function(t, e) {
  33812. if ("string" == typeof t && (t = I.wrap(t, e || "base64")),
  33813. (t = I.isByteBuffer(t) ? t : I.wrap(t)).remaining() < 1)
  33814. return null;
  33815. var i = t.offset
  33816. , n = t.readVarint32();
  33817. if (t.remaining() < n)
  33818. return t.offset = i,
  33819. null;
  33820. try {
  33821. var r = a.decode(t.slice(t.offset, t.offset + n).LE());
  33822. return t.offset += n,
  33823. r
  33824. } catch (e) {
  33825. throw t.offset += n,
  33826. e
  33827. }
  33828. }
  33829. ,
  33830. c.decode64 = function(e) {
  33831. return c.decode(e, "base64")
  33832. }
  33833. ,
  33834. c.decodeHex = function(e) {
  33835. return c.decode(e, "hex")
  33836. }
  33837. ,
  33838. c.decodeJSON = function(e) {
  33839. return new c(JSON.parse(e))
  33840. }
  33841. ,
  33842. o.toString = function() {
  33843. return a.toString()
  33844. }
  33845. ,
  33846. Object.defineProperty && (Object.defineProperty(c, "$options", {
  33847. value: a.buildOpt()
  33848. }),
  33849. Object.defineProperty(o, "$options", {
  33850. value: c.$options
  33851. }),
  33852. Object.defineProperty(c, "$type", {
  33853. value: a
  33854. }),
  33855. Object.defineProperty(o, "$type", {
  33856. value: a
  33857. })),
  33858. c
  33859. }(g, this);
  33860. this._fields = [],
  33861. this._fieldsById = {},
  33862. this._fieldsByName = {};
  33863. for (var i, n = 0, r = this.children.length; n < r; n++)
  33864. if ((i = this.children[n])instanceof p || i instanceof d || i instanceof y) {
  33865. if (t.hasOwnProperty(i.name))
  33866. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + i.toString(!0) + " cannot override static property '" + i.name + "'");
  33867. t[i.name] = i.build()
  33868. } else if (i instanceof d.Field)
  33869. i.build(),
  33870. this._fields.push(i),
  33871. this._fieldsById[i.id] = i,
  33872. this._fieldsByName[i.name] = i;
  33873. else if (!(i instanceof d.OneOf || i instanceof v))
  33874. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[n].toString(!0));
  33875. return this.clazz = t
  33876. }
  33877. ,
  33878. n.encode = function(e, t, i) {
  33879. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  33880. r = e[(n = this._fields[a]).name],
  33881. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  33882. if (null === o)
  33883. return t;
  33884. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  33885. throw l.encoded = t,
  33886. l
  33887. }
  33888. ,
  33889. n.calculate = function(e) {
  33890. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  33891. if (i = e[(t = this._fields[r]).name],
  33892. t.required && null === i)
  33893. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  33894. n += t.calculate(i, e)
  33895. }
  33896. return n
  33897. }
  33898. ,
  33899. n.decode = function(e, t, i) {
  33900. t = "number" == typeof t ? t : -1;
  33901. for (var n, r, o, a, s = e.offset, l = new this.clazz; e.offset < s + t || -1 === t && 0 < e.remaining(); ) {
  33902. if (o = (n = e.readVarint32()) >>> 3,
  33903. (r = 7 & n) === g.WIRE_TYPES.ENDGROUP) {
  33904. if (o !== i)
  33905. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + o + " (" + (i ? i + " expected" : "not a group") + ")");
  33906. break
  33907. }
  33908. if (a = this._fieldsById[o]) {
  33909. if (a.repeated && !a.options.packed)
  33910. l[a.name].push(a.decode(r, e));
  33911. else if (a.map) {
  33912. var c = a.decode(r, e);
  33913. l[a.name].set(c[0], c[1])
  33914. } else if (l[a.name] = a.decode(r, e),
  33915. a.oneof) {
  33916. var h = l[a.oneof.name];
  33917. null !== h && h !== a.name && (l[h] = null),
  33918. l[a.oneof.name] = a.name
  33919. }
  33920. } else
  33921. switch (r) {
  33922. case g.WIRE_TYPES.VARINT:
  33923. e.readVarint32();
  33924. break;
  33925. case g.WIRE_TYPES.BITS32:
  33926. e.offset += 4;
  33927. break;
  33928. case g.WIRE_TYPES.BITS64:
  33929. e.offset += 8;
  33930. break;
  33931. case g.WIRE_TYPES.LDELIM:
  33932. var u = e.readVarint32();
  33933. e.offset += u;
  33934. break;
  33935. case g.WIRE_TYPES.STARTGROUP:
  33936. for (; m(o, e); )
  33937. ;
  33938. break;
  33939. default:
  33940. throw Error("Illegal wire type for unknown field " + o + " in " + this.toString(!0) + "#decode: " + r)
  33941. }
  33942. }
  33943. for (var d = 0, p = this._fields.length; d < p; ++d)
  33944. if (null === l[(a = this._fields[d]).name])
  33945. if ("proto3" === this.syntax)
  33946. l[a.name] = a.defaultValue;
  33947. else {
  33948. if (a.required) {
  33949. var f = Error("Missing at least one required field for " + this.toString(!0) + ": " + a.name);
  33950. throw f.decoded = l,
  33951. f
  33952. }
  33953. g.populateDefaults && null !== a.defaultValue && (l[a.name] = a.defaultValue)
  33954. }
  33955. return l
  33956. }
  33957. ,
  33958. s.Message = d;
  33959. function c(e, t, i, n, r, o, a, s, l, c) {
  33960. h.call(this, e, t, o),
  33961. this.className = "Message.Field",
  33962. this.required = "required" === i,
  33963. this.repeated = "repeated" === i,
  33964. this.map = "map" === i,
  33965. this.keyType = n || null,
  33966. this.type = r,
  33967. this.resolvedType = null,
  33968. this.id = a,
  33969. this.options = s || {},
  33970. this.defaultValue = null,
  33971. this.oneof = l || null,
  33972. this.syntax = c || "proto2",
  33973. this.originalName = this.name,
  33974. this.element = null,
  33975. this.keyElement = null,
  33976. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = g.Util.toCamelCase(this.name))
  33977. }
  33978. var r = c.prototype = Object.create(h.prototype);
  33979. r.build = function() {
  33980. this.element = new u(this.type,this.resolvedType,!1,this.syntax),
  33981. this.map && (this.keyElement = new u(this.keyType,void 0,!0,this.syntax)),
  33982. "proto3" !== this.syntax || this.repeated || this.map ? void 0 !== this.options.default && (this.defaultValue = this.verifyValue(this.options.default)) : this.defaultValue = u.defaultFieldValue(this.type)
  33983. }
  33984. ,
  33985. r.verifyValue = function(e, t) {
  33986. function i(e, t) {
  33987. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  33988. }
  33989. t = t || !1;
  33990. var n, r = this;
  33991. if (null === e)
  33992. return this.required && i(typeof e, "required"),
  33993. "proto3" === this.syntax && this.type !== g.TYPES.message && i(typeof e, "proto3 field without field presence cannot be null"),
  33994. null;
  33995. if (!this.repeated || t)
  33996. return this.map && !t ? e instanceof g.Map ? e : (e instanceof Object || i(typeof e, "expected ProtoBuf.Map or raw object for map field"),
  33997. new g.Map(this,e)) : (!this.repeated && Array.isArray(e) && i(typeof e, "no array expected"),
  33998. this.element.verifyValue(e));
  33999. Array.isArray(e) || (e = [e]);
  34000. var o = [];
  34001. for (n = 0; n < e.length; n++)
  34002. o.push(this.element.verifyValue(e[n]));
  34003. return o
  34004. }
  34005. ,
  34006. r.hasWirePresence = function(e, t) {
  34007. if ("proto3" !== this.syntax)
  34008. return null !== e;
  34009. if (this.oneof && t[this.oneof.name] === this.name)
  34010. return !0;
  34011. switch (this.type) {
  34012. case g.TYPES.int32:
  34013. case g.TYPES.sint32:
  34014. case g.TYPES.sfixed32:
  34015. case g.TYPES.uint32:
  34016. case g.TYPES.fixed32:
  34017. return 0 !== e;
  34018. case g.TYPES.int64:
  34019. case g.TYPES.sint64:
  34020. case g.TYPES.sfixed64:
  34021. case g.TYPES.uint64:
  34022. case g.TYPES.fixed64:
  34023. return 0 !== e.low || 0 !== e.high;
  34024. case g.TYPES.bool:
  34025. return e;
  34026. case g.TYPES.float:
  34027. case g.TYPES.double:
  34028. return 0 !== e;
  34029. case g.TYPES.string:
  34030. return 0 < e.length;
  34031. case g.TYPES.bytes:
  34032. return 0 < e.remaining();
  34033. case g.TYPES.enum:
  34034. return 0 !== e;
  34035. case g.TYPES.message:
  34036. return null !== e;
  34037. default:
  34038. return !0
  34039. }
  34040. }
  34041. ,
  34042. r.encode = function(t, r, e) {
  34043. if (null === this.type || "object" != typeof this.type)
  34044. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  34045. if (null === t || this.repeated && 0 == t.length)
  34046. return r;
  34047. try {
  34048. var i;
  34049. if (this.repeated)
  34050. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  34051. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  34052. r.ensureCapacity(r.offset += 1);
  34053. var n = r.offset;
  34054. for (i = 0; i < t.length; i++)
  34055. this.element.encodeValue(this.id, t[i], r);
  34056. var o = r.offset - n
  34057. , a = I.calculateVarint32(o);
  34058. if (1 < a) {
  34059. var s = r.slice(n, r.offset);
  34060. n += a - 1,
  34061. r.offset = n,
  34062. r.append(s)
  34063. }
  34064. r.writeVarint32(o, n - a)
  34065. } else
  34066. for (i = 0; i < t.length; i++)
  34067. r.writeVarint32(this.id << 3 | this.type.wireType),
  34068. this.element.encodeValue(this.id, t[i], r);
  34069. else
  34070. this.map ? t.forEach(function(e, t, i) {
  34071. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  34072. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  34073. r.writeVarint32(n),
  34074. r.writeVarint32(8 | this.keyType.wireType),
  34075. this.keyElement.encodeValue(1, t, r),
  34076. r.writeVarint32(16 | this.type.wireType),
  34077. this.element.encodeValue(2, e, r)
  34078. }, this) : this.hasWirePresence(t, e) && (r.writeVarint32(this.id << 3 | this.type.wireType),
  34079. this.element.encodeValue(this.id, t, r))
  34080. } catch (e) {
  34081. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  34082. }
  34083. return r
  34084. }
  34085. ,
  34086. r.calculate = function(t, e) {
  34087. if (t = this.verifyValue(t),
  34088. null === this.type || "object" != typeof this.type)
  34089. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  34090. if (null === t || this.repeated && 0 == t.length)
  34091. return 0;
  34092. var r = 0;
  34093. try {
  34094. var i, n;
  34095. if (this.repeated)
  34096. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  34097. for (r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  34098. i = n = 0; i < t.length; i++)
  34099. n += this.element.calculateLength(this.id, t[i]);
  34100. r += I.calculateVarint32(n),
  34101. r += n
  34102. } else
  34103. for (i = 0; i < t.length; i++)
  34104. r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  34105. r += this.element.calculateLength(this.id, t[i]);
  34106. else
  34107. this.map ? t.forEach(function(e, t, i) {
  34108. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  34109. r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  34110. r += I.calculateVarint32(n),
  34111. r += n
  34112. }, this) : this.hasWirePresence(t, e) && (r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  34113. r += this.element.calculateLength(this.id, t))
  34114. } catch (e) {
  34115. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  34116. }
  34117. return r
  34118. }
  34119. ,
  34120. r.decode = function(e, t, i) {
  34121. var n, r;
  34122. if (!(!this.map && e == this.type.wireType || !i && this.repeated && this.options.packed && e == g.WIRE_TYPES.LDELIM || this.map && e == g.WIRE_TYPES.LDELIM))
  34123. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + e + " (" + this.type.wireType + " expected)");
  34124. if (e == g.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) && !i) {
  34125. r = t.readVarint32(),
  34126. r = t.offset + r;
  34127. for (var o = []; t.offset < r; )
  34128. o.push(this.decode(this.type.wireType, t, !0));
  34129. return o
  34130. }
  34131. if (this.map) {
  34132. var a = u.defaultFieldValue(this.keyType);
  34133. if (n = u.defaultFieldValue(this.type),
  34134. r = t.readVarint32(),
  34135. t.remaining() < r)
  34136. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + t.remaining());
  34137. var s = t.clone();
  34138. for (s.limit = s.offset + r,
  34139. t.offset += r; 0 < s.remaining(); ) {
  34140. var l = s.readVarint32();
  34141. e = 7 & l;
  34142. var c = l >>> 3;
  34143. if (1 == c)
  34144. a = this.keyElement.decode(s, e, c);
  34145. else {
  34146. if (2 != c)
  34147. throw Error("Unexpected tag in map field key/value submessage");
  34148. n = this.element.decode(s, e, c)
  34149. }
  34150. }
  34151. return [a, n]
  34152. }
  34153. return this.element.decode(t, e, this.id)
  34154. }
  34155. ,
  34156. s.Message.Field = c;
  34157. function o(e, t, i, n, r, o, a) {
  34158. c.call(this, e, t, i, null, n, r, o, a),
  34159. this.extension
  34160. }
  34161. o.prototype = Object.create(c.prototype),
  34162. s.Message.ExtensionField = o;
  34163. s.Message.OneOf = function(e, t, i) {
  34164. h.call(this, e, t, i),
  34165. this.fields = []
  34166. }
  34167. ;
  34168. var p = function(e, t, i, n, r) {
  34169. l.call(this, e, t, i, n, r),
  34170. this.className = "Enum",
  34171. this.object = null
  34172. };
  34173. p.getName = function(e, t) {
  34174. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  34175. if (e[i = n[r]] === t)
  34176. return i;
  34177. return null
  34178. }
  34179. ,
  34180. (p.prototype = Object.create(l.prototype)).build = function(e) {
  34181. if (this.object && !e)
  34182. return this.object;
  34183. for (var t = new g.Builder.Enum, i = this.getChildren(p.Value), n = 0, r = i.length; n < r; ++n)
  34184. t[i[n].name] = i[n].id;
  34185. return Object.defineProperty && Object.defineProperty(t, "$options", {
  34186. value: this.buildOpt(),
  34187. enumerable: !1
  34188. }),
  34189. this.object = t
  34190. }
  34191. ,
  34192. s.Enum = p;
  34193. function f(e, t, i, n) {
  34194. h.call(this, e, t, i),
  34195. this.className = "Enum.Value",
  34196. this.id = n
  34197. }
  34198. f.prototype = Object.create(h.prototype),
  34199. s.Enum.Value = f;
  34200. var v = function(e, t, i, n) {
  34201. h.call(this, e, t, i),
  34202. this.field = n
  34203. };
  34204. v.prototype = Object.create(h.prototype),
  34205. s.Extension = v;
  34206. var y = function(e, t, i, n) {
  34207. l.call(this, e, t, i, n),
  34208. this.className = "Service",
  34209. this.clazz = null
  34210. };
  34211. (y.prototype = Object.create(l.prototype)).build = function(e) {
  34212. return this.clazz && !e ? this.clazz : this.clazz = function(t, r) {
  34213. for (var o = function(e) {
  34214. t.Builder.Service.call(this),
  34215. this.rpcImpl = e || function(e, t, i) {
  34216. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  34217. }
  34218. }, e = o.prototype = Object.create(t.Builder.Service.prototype), i = r.getChildren(t.Reflect.Service.RPCMethod), n = 0; n < i.length; n++)
  34219. !function(n) {
  34220. e[n.name] = function(e, i) {
  34221. try {
  34222. try {
  34223. e = n.resolvedRequestType.clazz.decode(I.wrap(e))
  34224. } catch (e) {
  34225. if (!(e instanceof TypeError))
  34226. throw e
  34227. }
  34228. if (null === e || "object" != typeof e)
  34229. throw Error("Illegal arguments");
  34230. e instanceof n.resolvedRequestType.clazz || (e = new n.resolvedRequestType.clazz(e)),
  34231. this.rpcImpl(n.fqn(), e, function(e, t) {
  34232. if (!e) {
  34233. null === t && (t = "");
  34234. try {
  34235. t = n.resolvedResponseType.clazz.decode(t)
  34236. } catch (e) {}
  34237. return t && t instanceof n.resolvedResponseType.clazz ? void i(null, t) : void i(Error("Illegal response type received in service method " + r.name + "#" + n.name))
  34238. }
  34239. i(e)
  34240. })
  34241. } catch (e) {
  34242. setTimeout(i.bind(this, e), 0)
  34243. }
  34244. }
  34245. ,
  34246. o[n.name] = function(e, t, i) {
  34247. new o(e)[n.name](t, i)
  34248. }
  34249. ,
  34250. Object.defineProperty && (Object.defineProperty(o[n.name], "$options", {
  34251. value: n.buildOpt()
  34252. }),
  34253. Object.defineProperty(e[n.name], "$options", {
  34254. value: o[n.name].$options
  34255. }))
  34256. }(i[n]);
  34257. return Object.defineProperty && (Object.defineProperty(o, "$options", {
  34258. value: r.buildOpt()
  34259. }),
  34260. Object.defineProperty(e, "$options", {
  34261. value: o.$options
  34262. }),
  34263. Object.defineProperty(o, "$type", {
  34264. value: r
  34265. }),
  34266. Object.defineProperty(e, "$type", {
  34267. value: r
  34268. })),
  34269. o
  34270. }(g, this)
  34271. }
  34272. ,
  34273. s.Service = y;
  34274. function A(e, t, i, n) {
  34275. h.call(this, e, t, i),
  34276. this.className = "Service.Method",
  34277. this.options = n || {}
  34278. }
  34279. (A.prototype = Object.create(h.prototype)).buildOpt = t.buildOpt,
  34280. s.Service.Method = A;
  34281. function C(e, t, i, n, r, o, a, s) {
  34282. A.call(this, e, t, i, s),
  34283. this.className = "Service.RPCMethod",
  34284. this.requestName = n,
  34285. this.responseName = r,
  34286. this.requestStream = o,
  34287. this.responseStream = a,
  34288. this.resolvedRequestType = null,
  34289. this.resolvedResponseType = null
  34290. }
  34291. return C.prototype = Object.create(A.prototype),
  34292. s.Service.RPCMethod = C,
  34293. s
  34294. }(o),
  34295. o.Builder = (i = (u = o).Lang,
  34296. s = o.Reflect,
  34297. n = h.prototype,
  34298. h.isMessage = function(e) {
  34299. return "string" == typeof e.name && void 0 === e.values && void 0 === e.rpc
  34300. }
  34301. ,
  34302. h.isMessageField = function(e) {
  34303. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && void 0 !== e.id
  34304. }
  34305. ,
  34306. h.isEnum = function(e) {
  34307. return "string" == typeof e.name && !(void 0 === e.values || !Array.isArray(e.values) || 0 === e.values.length)
  34308. }
  34309. ,
  34310. h.isService = function(e) {
  34311. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  34312. }
  34313. ,
  34314. h.isExtend = function(e) {
  34315. return "string" == typeof e.ref
  34316. }
  34317. ,
  34318. n.reset = function() {
  34319. return this.ptr = this.ns,
  34320. this
  34321. }
  34322. ,
  34323. n.define = function(e) {
  34324. if ("string" != typeof e || !i.TYPEREF.test(e))
  34325. throw Error("illegal namespace: " + e);
  34326. return e.split(".").forEach(function(e) {
  34327. var t = this.ptr.getChild(e);
  34328. null === t && this.ptr.addChild(t = new s.Namespace(this,this.ptr,e)),
  34329. this.ptr = t
  34330. }, this),
  34331. this
  34332. }
  34333. ,
  34334. n.create = function(e) {
  34335. if (!e)
  34336. return this;
  34337. if (Array.isArray(e)) {
  34338. if (0 === e.length)
  34339. return this;
  34340. e = e.slice()
  34341. } else
  34342. e = [e];
  34343. for (var t = [e]; 0 < t.length; ) {
  34344. if (e = t.pop(),
  34345. !Array.isArray(e))
  34346. throw Error("not a valid namespace: " + JSON.stringify(e));
  34347. for (; 0 < e.length; ) {
  34348. var i = e.shift();
  34349. if (h.isMessage(i)) {
  34350. var o = new s.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax)
  34351. , n = {};
  34352. i.oneofs && Object.keys(i.oneofs).forEach(function(e) {
  34353. o.addChild(n[e] = new s.Message.OneOf(this,o,e))
  34354. }, this),
  34355. i.fields && i.fields.forEach(function(e) {
  34356. if (null !== o.getChild(0 | e.id))
  34357. throw Error("duplicate or invalid field id in " + o.name + ": " + e.id);
  34358. if (e.options && "object" != typeof e.options)
  34359. throw Error("illegal field options in " + o.name + "#" + e.name);
  34360. var t = null;
  34361. if ("string" == typeof e.oneof && !(t = n[e.oneof]))
  34362. throw Error("illegal oneof in " + o.name + "#" + e.name + ": " + e.oneof);
  34363. e = new s.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),
  34364. t && t.fields.push(e),
  34365. o.addChild(e)
  34366. }, this);
  34367. var r = [];
  34368. if (i.enums && i.enums.forEach(function(e) {
  34369. r.push(e)
  34370. }),
  34371. i.messages && i.messages.forEach(function(e) {
  34372. r.push(e)
  34373. }),
  34374. i.services && i.services.forEach(function(e) {
  34375. r.push(e)
  34376. }),
  34377. i.extensions && ("number" == typeof i.extensions[0] ? o.extensions = [i.extensions] : o.extensions = i.extensions),
  34378. this.ptr.addChild(o),
  34379. 0 < r.length) {
  34380. t.push(e),
  34381. e = r,
  34382. r = null,
  34383. this.ptr = o,
  34384. o = null;
  34385. continue
  34386. }
  34387. r = null
  34388. } else if (h.isEnum(i))
  34389. o = new s.Enum(this,this.ptr,i.name,i.options,i.syntax),
  34390. i.values.forEach(function(e) {
  34391. o.addChild(new s.Enum.Value(this,o,e.name,e.id))
  34392. }, this),
  34393. this.ptr.addChild(o);
  34394. else if (h.isService(i))
  34395. o = new s.Service(this,this.ptr,i.name,i.options),
  34396. Object.keys(i.rpc).forEach(function(e) {
  34397. var t = i.rpc[e];
  34398. o.addChild(new s.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  34399. }, this),
  34400. this.ptr.addChild(o);
  34401. else {
  34402. if (!h.isExtend(i))
  34403. throw Error("not a valid definition: " + JSON.stringify(i));
  34404. if (o = this.ptr.resolve(i.ref, !0))
  34405. i.fields.forEach(function(t) {
  34406. if (null !== o.getChild(0 | t.id))
  34407. throw Error("duplicate extended field id in " + o.name + ": " + t.id);
  34408. if (o.extensions) {
  34409. var i = !1;
  34410. if (o.extensions.forEach(function(e) {
  34411. t.id >= e[0] && t.id <= e[1] && (i = !0)
  34412. }),
  34413. !i)
  34414. throw Error("illegal extended field id in " + o.name + ": " + t.id + " (not within valid ranges)")
  34415. }
  34416. var e = t.name;
  34417. this.options.convertFieldsToCamelCase && (e = u.Util.toCamelCase(e));
  34418. var n = new s.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn() + "." + e,t.id,t.options)
  34419. , r = new s.Extension(this,this.ptr,t.name,n);
  34420. n.extension = r,
  34421. this.ptr.addChild(r),
  34422. o.addChild(n)
  34423. }, this);
  34424. else if (!/\.?google\.protobuf\./.test(i.ref))
  34425. throw Error("extended message " + i.ref + " is not defined")
  34426. }
  34427. o = i = null
  34428. }
  34429. e = null,
  34430. this.ptr = this.ptr.parent
  34431. }
  34432. return this.resolved = !1,
  34433. this.result = null,
  34434. this
  34435. }
  34436. ,
  34437. n.import = function(t, e) {
  34438. var i = "/";
  34439. if ("string" == typeof e) {
  34440. if (u.Util.IS_NODE && (e = p("path").resolve(e)),
  34441. !0 === this.files[e])
  34442. return this.reset();
  34443. this.files[e] = !0
  34444. } else if ("object" == typeof e) {
  34445. var n = e.root;
  34446. u.Util.IS_NODE && (n = p("path").resolve(n)),
  34447. (0 <= n.indexOf("\\") || 0 <= e.file.indexOf("\\")) && (i = "\\");
  34448. var r = n + i + e.file;
  34449. if (!0 === this.files[r])
  34450. return this.reset();
  34451. this.files[r] = !0
  34452. }
  34453. if (t.imports && 0 < t.imports.length) {
  34454. var o, a = !1;
  34455. "object" == typeof e ? (this.importRoot = e.root,
  34456. a = !0,
  34457. o = this.importRoot,
  34458. e = e.file,
  34459. (0 <= o.indexOf("\\") || 0 <= e.indexOf("\\")) && (i = "\\")) : "string" == typeof e ? this.importRoot ? o = this.importRoot : 0 <= e.indexOf("/") ? "" === (o = e.replace(/\/[^\/]*$/, "")) && (o = "/") : 0 <= e.indexOf("\\") ? (o = e.replace(/\\[^\\]*$/, ""),
  34460. i = "\\") : o = "." : o = null;
  34461. for (var s = 0; s < t.imports.length; s++)
  34462. if ("string" == typeof t.imports[s]) {
  34463. if (!o)
  34464. throw Error("cannot determine import root");
  34465. var l = t.imports[s];
  34466. if ("google/protobuf/descriptor.proto" === l)
  34467. continue;
  34468. if (l = o + i + l,
  34469. !0 === this.files[l])
  34470. continue;
  34471. /\.proto$/i.test(l) && !u.DotProto && (l = l.replace(/\.proto$/, ".json"));
  34472. var c = u.Util.fetch(l);
  34473. if (null === c)
  34474. throw Error("failed to import '" + l + "' in '" + e + "': file not found");
  34475. /\.json$/i.test(l) ? this.import(JSON.parse(c + ""), l) : this.import(u.DotProto.Parser.parse(c), l)
  34476. } else
  34477. e ? /\.(\w+)$/.test(e) ? this.import(t.imports[s], e.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  34478. return t + "_import" + s + "." + i
  34479. })) : this.import(t.imports[s], e + "_import" + s) : this.import(t.imports[s]);
  34480. a && (this.importRoot = null)
  34481. }
  34482. t.package && this.define(t.package),
  34483. t.syntax && function t(i) {
  34484. i.messages && i.messages.forEach(function(e) {
  34485. e.syntax = i.syntax,
  34486. t(e)
  34487. }),
  34488. i.enums && i.enums.forEach(function(e) {
  34489. e.syntax = i.syntax
  34490. })
  34491. }(t);
  34492. var h = this.ptr;
  34493. return t.options && Object.keys(t.options).forEach(function(e) {
  34494. h.options[e] = t.options[e]
  34495. }),
  34496. t.messages && (this.create(t.messages),
  34497. this.ptr = h),
  34498. t.enums && (this.create(t.enums),
  34499. this.ptr = h),
  34500. t.services && (this.create(t.services),
  34501. this.ptr = h),
  34502. t.extends && this.create(t.extends),
  34503. this.reset()
  34504. }
  34505. ,
  34506. n.resolveAll = function() {
  34507. var e;
  34508. if (null == this.ptr || "object" == typeof this.ptr.type)
  34509. return this;
  34510. if (this.ptr instanceof s.Namespace)
  34511. this.ptr.children.forEach(function(e) {
  34512. this.ptr = e,
  34513. this.resolveAll()
  34514. }, this);
  34515. else if (this.ptr instanceof s.Message.Field) {
  34516. if (i.TYPE.test(this.ptr.type))
  34517. this.ptr.type = u.TYPES[this.ptr.type];
  34518. else {
  34519. if (!i.TYPEREF.test(this.ptr.type))
  34520. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34521. if (!(e = (this.ptr instanceof s.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0)))
  34522. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34523. if ((this.ptr.resolvedType = e)instanceof s.Enum) {
  34524. if (this.ptr.type = u.TYPES.enum,
  34525. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  34526. throw Error("proto3 message cannot reference proto2 enum")
  34527. } else {
  34528. if (!(e instanceof s.Message))
  34529. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34530. this.ptr.type = e.isGroup ? u.TYPES.group : u.TYPES.message
  34531. }
  34532. }
  34533. if (this.ptr.map) {
  34534. if (!i.TYPE.test(this.ptr.keyType))
  34535. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  34536. this.ptr.keyType = u.TYPES[this.ptr.keyType]
  34537. }
  34538. } else if (this.ptr instanceof u.Reflect.Service.Method) {
  34539. if (!(this.ptr instanceof u.Reflect.Service.RPCMethod))
  34540. throw Error("illegal service type in " + this.ptr.toString(!0));
  34541. if (!((e = this.ptr.parent.resolve(this.ptr.requestName, !0)) && e instanceof u.Reflect.Message))
  34542. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  34543. if (this.ptr.resolvedRequestType = e,
  34544. !((e = this.ptr.parent.resolve(this.ptr.responseName, !0)) && e instanceof u.Reflect.Message))
  34545. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  34546. this.ptr.resolvedResponseType = e
  34547. } else if (!(this.ptr instanceof u.Reflect.Message.OneOf || this.ptr instanceof u.Reflect.Extension || this.ptr instanceof u.Reflect.Enum.Value))
  34548. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  34549. return this.reset()
  34550. }
  34551. ,
  34552. n.build = function(e) {
  34553. if (this.reset(),
  34554. this.resolved || (this.resolveAll(),
  34555. this.resolved = !0,
  34556. this.result = null),
  34557. null === this.result && (this.result = this.ns.build()),
  34558. !e)
  34559. return this.result;
  34560. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  34561. if (!i[t[n]]) {
  34562. i = null;
  34563. break
  34564. }
  34565. i = i[t[n]]
  34566. }
  34567. return i
  34568. }
  34569. ,
  34570. n.lookup = function(e, t) {
  34571. return e ? this.ns.resolve(e, t) : this.ns
  34572. }
  34573. ,
  34574. n.toString = function() {
  34575. return "Builder"
  34576. }
  34577. ,
  34578. h.Message = function() {}
  34579. ,
  34580. h.Enum = function() {}
  34581. ,
  34582. h.Service = function() {}
  34583. ,
  34584. h),
  34585. o.Map = (a = o.Reflect,
  34586. (t = c.prototype).clear = function() {
  34587. this.map = {}
  34588. }
  34589. ,
  34590. t.delete = function(e) {
  34591. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  34592. , i = t in this.map;
  34593. return delete this.map[t],
  34594. i
  34595. }
  34596. ,
  34597. t.entries = function() {
  34598. for (var e, t = [], i = Object.keys(this.map), n = 0; n < i.length; n++)
  34599. t.push([(e = this.map[i[n]]).key, e.value]);
  34600. return l(t)
  34601. }
  34602. ,
  34603. t.keys = function() {
  34604. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34605. e.push(this.map[t[i]].key);
  34606. return l(e)
  34607. }
  34608. ,
  34609. t.values = function() {
  34610. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34611. e.push(this.map[t[i]].value);
  34612. return l(e)
  34613. }
  34614. ,
  34615. t.forEach = function(e, t) {
  34616. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  34617. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  34618. }
  34619. ,
  34620. t.set = function(e, t) {
  34621. var i = this.keyElem.verifyValue(e)
  34622. , n = this.valueElem.verifyValue(t);
  34623. return this.map[this.keyElem.valueToString(i)] = {
  34624. key: i,
  34625. value: n
  34626. },
  34627. this
  34628. }
  34629. ,
  34630. t.get = function(e) {
  34631. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34632. if (t in this.map)
  34633. return this.map[t].value
  34634. }
  34635. ,
  34636. t.has = function(e) {
  34637. return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map
  34638. }
  34639. ,
  34640. c),
  34641. o.loadProto = function(e, t, i) {
  34642. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34643. t = void 0),
  34644. o.loadJson(o.DotProto.Parser.parse(e), t, i)
  34645. }
  34646. ,
  34647. o.protoFromString = o.loadProto,
  34648. o.loadProtoFile = function(t, i, n) {
  34649. if (i && "object" == typeof i ? (n = i,
  34650. i = null) : i && "function" == typeof i || (i = null),
  34651. i)
  34652. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34653. if (null !== e)
  34654. try {
  34655. i(null, o.loadProto(e, n, t))
  34656. } catch (e) {
  34657. i(e)
  34658. }
  34659. else
  34660. i(Error("Failed to fetch file"))
  34661. });
  34662. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34663. return null === e ? null : o.loadProto(e, n, t)
  34664. }
  34665. ,
  34666. o.protoFromFile = o.loadProtoFile,
  34667. o.newBuilder = function(e) {
  34668. return void 0 === (e = e || {}).convertFieldsToCamelCase && (e.convertFieldsToCamelCase = o.convertFieldsToCamelCase),
  34669. void 0 === e.populateAccessors && (e.populateAccessors = o.populateAccessors),
  34670. new o.Builder(e)
  34671. }
  34672. ,
  34673. o.loadJson = function(e, t, i) {
  34674. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34675. t = null),
  34676. t && "object" == typeof t || (t = o.newBuilder()),
  34677. "string" == typeof e && (e = JSON.parse(e)),
  34678. t.import(e, i),
  34679. t.resolveAll(),
  34680. t
  34681. }
  34682. ,
  34683. o.loadJsonFile = function(t, i, n) {
  34684. if (i && "object" == typeof i ? (n = i,
  34685. i = null) : i && "function" == typeof i || (i = null),
  34686. i)
  34687. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34688. if (null !== e)
  34689. try {
  34690. i(null, o.loadJson(JSON.parse(e), n, t))
  34691. } catch (e) {
  34692. i(e)
  34693. }
  34694. else
  34695. i(Error("Failed to fetch file"))
  34696. });
  34697. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34698. return null === e ? null : o.loadJson(JSON.parse(e), n, t)
  34699. }
  34700. ,
  34701. o;
  34702. function l(e) {
  34703. var t = 0;
  34704. return {
  34705. next: function() {
  34706. return t < e.length ? {
  34707. done: !1,
  34708. value: e[t++]
  34709. } : {
  34710. done: !0
  34711. }
  34712. }
  34713. }
  34714. }
  34715. function c(e, t) {
  34716. if (!e.map)
  34717. throw Error("field is not a map");
  34718. if (this.field = e,
  34719. this.keyElem = new a.Element(e.keyType,null,!0,e.syntax),
  34720. this.valueElem = new a.Element(e.type,e.resolvedType,!1,e.syntax),
  34721. this.map = {},
  34722. Object.defineProperty(this, "size", {
  34723. get: function() {
  34724. return Object.keys(this.map).length
  34725. }
  34726. }),
  34727. t)
  34728. for (var i = Object.keys(t), n = 0; n < i.length; n++) {
  34729. var r = this.keyElem.valueFromString(i[n])
  34730. , o = this.valueElem.verifyValue(t[i[n]]);
  34731. this.map[this.keyElem.valueToString(r)] = {
  34732. key: r,
  34733. value: o
  34734. }
  34735. }
  34736. }
  34737. function h(e) {
  34738. this.ns = new s.Namespace(this,null,""),
  34739. this.ptr = this.ns,
  34740. this.resolved = !1,
  34741. this.result = null,
  34742. this.files = {},
  34743. this.importRoot = null,
  34744. this.options = e || {}
  34745. }
  34746. }
  34747. ,
  34748. "function" == typeof define && define.amd ? define(["bytebuffer"], t) : "function" == typeof p && "object" == typeof i && i && i.exports ? i.exports = t(p("bytebuffer")) : (e.dcodeIO = e.dcodeIO || {}).ProtoBuf = t(e.dcodeIO.ByteBuffer)
  34749. }
  34750. ).call(this, p("_process"))
  34751. }
  34752. , {
  34753. _process: 203,
  34754. bytebuffer: 215,
  34755. fs: 197,
  34756. path: 197
  34757. }],
  34758. 215: [function(t, e, i) {
  34759. var n, r;
  34760. n = this,
  34761. r = function(l) {
  34762. "use strict";
  34763. function s(e) {
  34764. var t = 0;
  34765. return function() {
  34766. return t < e.length ? e.charCodeAt(t++) : null
  34767. }
  34768. }
  34769. function c() {
  34770. var e = []
  34771. , t = [];
  34772. return function() {
  34773. return 0 === arguments.length ? t.join("") + i.apply(String, e) : (1024 < e.length + arguments.length && (t.push(i.apply(String, e)),
  34774. e.length = 0),
  34775. void Array.prototype.push.apply(e, arguments))
  34776. }
  34777. }
  34778. function n(e, t, i, n, r) {
  34779. 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];
  34780. for (u += d,
  34781. o = p & (1 << -h) - 1,
  34782. p >>= -h,
  34783. h += s; 0 < h; o = 256 * o + e[t + u],
  34784. u += d,
  34785. h -= 8)
  34786. ;
  34787. for (a = o & (1 << -h) - 1,
  34788. o >>= -h,
  34789. h += n; 0 < h; a = 256 * a + e[t + u],
  34790. u += d,
  34791. h -= 8)
  34792. ;
  34793. if (0 === o)
  34794. o = 1 - c;
  34795. else {
  34796. if (o === l)
  34797. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  34798. a += Math.pow(2, n),
  34799. o -= c
  34800. }
  34801. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  34802. }
  34803. function r(e, t, i, n, r, o) {
  34804. 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;
  34805. for (t = Math.abs(t),
  34806. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  34807. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  34808. t * (l = Math.pow(2, -a)) < 1 && (a--,
  34809. l *= 2),
  34810. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  34811. l /= 2),
  34812. h <= a + u ? (s = 0,
  34813. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  34814. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  34815. a = 0)); 8 <= r; e[i + p] = 255 & s,
  34816. p += f,
  34817. s /= 256,
  34818. r -= 8)
  34819. ;
  34820. for (a = a << r | s,
  34821. c += r; 0 < c; e[i + p] = 255 & a,
  34822. p += f,
  34823. a /= 256,
  34824. c -= 8)
  34825. ;
  34826. e[i + p - f] |= 128 * g
  34827. }
  34828. var f = function(e, t, i) {
  34829. if (void 0 === e && (e = f.DEFAULT_CAPACITY),
  34830. void 0 === t && (t = f.DEFAULT_ENDIAN),
  34831. void 0 === i && (i = f.DEFAULT_NOASSERT),
  34832. !i) {
  34833. if ((e |= 0) < 0)
  34834. throw RangeError("Illegal capacity");
  34835. t = !!t,
  34836. i = !!i
  34837. }
  34838. this.buffer = 0 === e ? o : new ArrayBuffer(e),
  34839. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  34840. this.offset = 0,
  34841. this.markedOffset = -1,
  34842. this.limit = e,
  34843. this.littleEndian = t,
  34844. this.noAssert = i
  34845. };
  34846. f.VERSION = "5.0.1",
  34847. f.LITTLE_ENDIAN = !0,
  34848. f.BIG_ENDIAN = !1,
  34849. f.DEFAULT_CAPACITY = 16,
  34850. f.DEFAULT_ENDIAN = f.BIG_ENDIAN,
  34851. f.DEFAULT_NOASSERT = !1,
  34852. f.Long = l || null;
  34853. var a = f.prototype;
  34854. a.__isByteBuffer__,
  34855. Object.defineProperty(a, "__isByteBuffer__", {
  34856. value: !0,
  34857. enumerable: !1,
  34858. configurable: !1
  34859. });
  34860. var o = new ArrayBuffer(0)
  34861. , i = String.fromCharCode;
  34862. f.accessor = function() {
  34863. return Uint8Array
  34864. }
  34865. ,
  34866. f.allocate = function(e, t, i) {
  34867. return new f(e,t,i)
  34868. }
  34869. ,
  34870. f.concat = function(e, t, i, n) {
  34871. "boolean" != typeof t && "string" == typeof t || (n = i,
  34872. i = t,
  34873. t = void 0);
  34874. for (var r, o = 0, a = 0, s = e.length; a < s; ++a)
  34875. f.isByteBuffer(e[a]) || (e[a] = f.wrap(e[a], t)),
  34876. 0 < (r = e[a].limit - e[a].offset) && (o += r);
  34877. if (0 === o)
  34878. return new f(0,i,n);
  34879. var l, c = new f(o,i,n);
  34880. for (a = 0; a < s; )
  34881. (r = (l = e[a++]).limit - l.offset) <= 0 || (c.view.set(l.view.subarray(l.offset, l.limit), c.offset),
  34882. c.offset += r);
  34883. return c.limit = c.offset,
  34884. c.offset = 0,
  34885. c
  34886. }
  34887. ,
  34888. f.isByteBuffer = function(e) {
  34889. return !0 === (e && e.__isByteBuffer__)
  34890. }
  34891. ,
  34892. f.type = function() {
  34893. return ArrayBuffer
  34894. }
  34895. ,
  34896. f.wrap = function(e, t, i, n) {
  34897. if ("string" != typeof t && (n = i,
  34898. i = t,
  34899. t = void 0),
  34900. "string" == typeof e)
  34901. switch (void 0 === t && (t = "utf8"),
  34902. t) {
  34903. case "base64":
  34904. return f.fromBase64(e, i);
  34905. case "hex":
  34906. return f.fromHex(e, i);
  34907. case "binary":
  34908. return f.fromBinary(e, i);
  34909. case "utf8":
  34910. return f.fromUTF8(e, i);
  34911. case "debug":
  34912. return f.fromDebug(e, i);
  34913. default:
  34914. throw Error("Unsupported encoding: " + t)
  34915. }
  34916. if (null === e || "object" != typeof e)
  34917. throw TypeError("Illegal buffer");
  34918. var r;
  34919. if (f.isByteBuffer(e))
  34920. return (r = a.clone.call(e)).markedOffset = -1,
  34921. r;
  34922. if (e instanceof Uint8Array)
  34923. r = new f(0,i,n),
  34924. 0 < e.length && (r.buffer = e.buffer,
  34925. r.offset = e.byteOffset,
  34926. r.limit = e.byteOffset + e.byteLength,
  34927. r.view = new Uint8Array(e.buffer));
  34928. else if (e instanceof ArrayBuffer)
  34929. r = new f(0,i,n),
  34930. 0 < e.byteLength && (r.buffer = e,
  34931. r.offset = 0,
  34932. r.limit = e.byteLength,
  34933. r.view = 0 < e.byteLength ? new Uint8Array(e) : null);
  34934. else {
  34935. if ("[object Array]" !== Object.prototype.toString.call(e))
  34936. throw TypeError("Illegal buffer");
  34937. (r = new f(e.length,i,n)).limit = e.length;
  34938. for (var o = 0; o < e.length; ++o)
  34939. r.view[o] = e[o]
  34940. }
  34941. return r
  34942. }
  34943. ,
  34944. a.writeBitSet = function(e, t) {
  34945. var i = void 0 === t;
  34946. if (i && (t = this.offset),
  34947. !this.noAssert) {
  34948. if (!(e instanceof Array))
  34949. throw TypeError("Illegal BitSet: Not an array");
  34950. if ("number" != typeof t || t % 1 != 0)
  34951. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34952. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34953. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34954. }
  34955. var n, r = t, o = e.length, a = o >> 3, s = 0;
  34956. for (t += this.writeVarint32(o, t); a--; )
  34957. 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,
  34958. this.writeByte(n, t++);
  34959. if (s < o) {
  34960. var l = 0;
  34961. for (n = 0; s < o; )
  34962. n |= (1 & !!e[s++]) << l++;
  34963. this.writeByte(n, t++)
  34964. }
  34965. return i ? (this.offset = t,
  34966. this) : t - r
  34967. }
  34968. ,
  34969. a.readBitSet = function(e) {
  34970. var t = void 0 === e;
  34971. t && (e = this.offset);
  34972. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  34973. for (e += n.length; o--; )
  34974. i = this.readByte(e++),
  34975. s[a++] = !!(1 & i),
  34976. s[a++] = !!(2 & i),
  34977. s[a++] = !!(4 & i),
  34978. s[a++] = !!(8 & i),
  34979. s[a++] = !!(16 & i),
  34980. s[a++] = !!(32 & i),
  34981. s[a++] = !!(64 & i),
  34982. s[a++] = !!(128 & i);
  34983. if (a < r) {
  34984. var l = 0;
  34985. for (i = this.readByte(e++); a < r; )
  34986. s[a++] = !!(i >> l++ & 1)
  34987. }
  34988. return t && (this.offset = e),
  34989. s
  34990. }
  34991. ,
  34992. a.readBytes = function(e, t) {
  34993. var i = void 0 === t;
  34994. if (i && (t = this.offset),
  34995. !this.noAssert) {
  34996. if ("number" != typeof t || t % 1 != 0)
  34997. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34998. if ((t >>>= 0) < 0 || t + e > this.buffer.byteLength)
  34999. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  35000. }
  35001. var n = this.slice(t, t + e);
  35002. return i && (this.offset += e),
  35003. n
  35004. }
  35005. ,
  35006. a.writeBytes = a.append,
  35007. a.writeInt8 = function(e, t) {
  35008. var i = void 0 === t;
  35009. if (i && (t = this.offset),
  35010. !this.noAssert) {
  35011. if ("number" != typeof e || e % 1 != 0)
  35012. throw TypeError("Illegal value: " + e + " (not an integer)");
  35013. if (e |= 0,
  35014. "number" != typeof t || t % 1 != 0)
  35015. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35016. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35017. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35018. }
  35019. t += 1;
  35020. var n = this.buffer.byteLength;
  35021. return n < t && this.resize((n *= 2) > t ? n : t),
  35022. t -= 1,
  35023. this.view[t] = e,
  35024. i && (this.offset += 1),
  35025. this
  35026. }
  35027. ,
  35028. a.writeByte = a.writeInt8,
  35029. a.readInt8 = function(e) {
  35030. var t = void 0 === e;
  35031. if (t && (e = this.offset),
  35032. !this.noAssert) {
  35033. if ("number" != typeof e || e % 1 != 0)
  35034. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35035. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35036. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35037. }
  35038. var i = this.view[e];
  35039. return 128 == (128 & i) && (i = -(255 - i + 1)),
  35040. t && (this.offset += 1),
  35041. i
  35042. }
  35043. ,
  35044. a.readByte = a.readInt8,
  35045. a.writeUint8 = function(e, t) {
  35046. var i = void 0 === t;
  35047. if (i && (t = this.offset),
  35048. !this.noAssert) {
  35049. if ("number" != typeof e || e % 1 != 0)
  35050. throw TypeError("Illegal value: " + e + " (not an integer)");
  35051. if (e >>>= 0,
  35052. "number" != typeof t || t % 1 != 0)
  35053. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35054. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35055. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35056. }
  35057. t += 1;
  35058. var n = this.buffer.byteLength;
  35059. return n < t && this.resize((n *= 2) > t ? n : t),
  35060. t -= 1,
  35061. this.view[t] = e,
  35062. i && (this.offset += 1),
  35063. this
  35064. }
  35065. ,
  35066. a.writeUInt8 = a.writeUint8,
  35067. a.readUint8 = function(e) {
  35068. var t = void 0 === e;
  35069. if (t && (e = this.offset),
  35070. !this.noAssert) {
  35071. if ("number" != typeof e || e % 1 != 0)
  35072. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35073. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35074. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35075. }
  35076. var i = this.view[e];
  35077. return t && (this.offset += 1),
  35078. i
  35079. }
  35080. ,
  35081. a.readUInt8 = a.readUint8,
  35082. a.writeInt16 = function(e, t) {
  35083. var i = void 0 === t;
  35084. if (i && (t = this.offset),
  35085. !this.noAssert) {
  35086. if ("number" != typeof e || e % 1 != 0)
  35087. throw TypeError("Illegal value: " + e + " (not an integer)");
  35088. if (e |= 0,
  35089. "number" != typeof t || t % 1 != 0)
  35090. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35091. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35092. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35093. }
  35094. t += 2;
  35095. var n = this.buffer.byteLength;
  35096. return n < t && this.resize((n *= 2) > t ? n : t),
  35097. t -= 2,
  35098. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  35099. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  35100. this.view[t + 1] = 255 & e),
  35101. i && (this.offset += 2),
  35102. this
  35103. }
  35104. ,
  35105. a.writeShort = a.writeInt16,
  35106. a.readInt16 = function(e) {
  35107. var t = void 0 === e;
  35108. if (t && (e = this.offset),
  35109. !this.noAssert) {
  35110. if ("number" != typeof e || e % 1 != 0)
  35111. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35112. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  35113. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  35114. }
  35115. var i = 0;
  35116. return this.littleEndian ? (i = this.view[e],
  35117. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  35118. i |= this.view[e + 1]),
  35119. 32768 == (32768 & i) && (i = -(65535 - i + 1)),
  35120. t && (this.offset += 2),
  35121. i
  35122. }
  35123. ,
  35124. a.readShort = a.readInt16,
  35125. a.writeUint16 = function(e, t) {
  35126. var i = void 0 === t;
  35127. if (i && (t = this.offset),
  35128. !this.noAssert) {
  35129. if ("number" != typeof e || e % 1 != 0)
  35130. throw TypeError("Illegal value: " + e + " (not an integer)");
  35131. if (e >>>= 0,
  35132. "number" != typeof t || t % 1 != 0)
  35133. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35134. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35135. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35136. }
  35137. t += 2;
  35138. var n = this.buffer.byteLength;
  35139. return n < t && this.resize((n *= 2) > t ? n : t),
  35140. t -= 2,
  35141. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  35142. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  35143. this.view[t + 1] = 255 & e),
  35144. i && (this.offset += 2),
  35145. this
  35146. }
  35147. ,
  35148. a.writeUInt16 = a.writeUint16,
  35149. a.readUint16 = function(e) {
  35150. var t = void 0 === e;
  35151. if (t && (e = this.offset),
  35152. !this.noAssert) {
  35153. if ("number" != typeof e || e % 1 != 0)
  35154. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35155. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  35156. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  35157. }
  35158. var i = 0;
  35159. return this.littleEndian ? (i = this.view[e],
  35160. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  35161. i |= this.view[e + 1]),
  35162. t && (this.offset += 2),
  35163. i
  35164. }
  35165. ,
  35166. a.readUInt16 = a.readUint16,
  35167. a.writeInt32 = function(e, t) {
  35168. var i = void 0 === t;
  35169. if (i && (t = this.offset),
  35170. !this.noAssert) {
  35171. if ("number" != typeof e || e % 1 != 0)
  35172. throw TypeError("Illegal value: " + e + " (not an integer)");
  35173. if (e |= 0,
  35174. "number" != typeof t || t % 1 != 0)
  35175. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35176. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35177. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35178. }
  35179. t += 4;
  35180. var n = this.buffer.byteLength;
  35181. return n < t && this.resize((n *= 2) > t ? n : t),
  35182. t -= 4,
  35183. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  35184. this.view[t + 2] = e >>> 16 & 255,
  35185. this.view[t + 1] = e >>> 8 & 255,
  35186. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  35187. this.view[t + 1] = e >>> 16 & 255,
  35188. this.view[t + 2] = e >>> 8 & 255,
  35189. this.view[t + 3] = 255 & e),
  35190. i && (this.offset += 4),
  35191. this
  35192. }
  35193. ,
  35194. a.writeInt = a.writeInt32,
  35195. a.readInt32 = function(e) {
  35196. var t = void 0 === e;
  35197. if (t && (e = this.offset),
  35198. !this.noAssert) {
  35199. if ("number" != typeof e || e % 1 != 0)
  35200. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35201. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35202. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35203. }
  35204. var i = 0;
  35205. return this.littleEndian ? (i = this.view[e + 2] << 16,
  35206. i |= this.view[e + 1] << 8,
  35207. i |= this.view[e],
  35208. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  35209. i |= this.view[e + 2] << 8,
  35210. i |= this.view[e + 3],
  35211. i += this.view[e] << 24 >>> 0),
  35212. i |= 0,
  35213. t && (this.offset += 4),
  35214. i
  35215. }
  35216. ,
  35217. a.readInt = a.readInt32,
  35218. a.writeUint32 = function(e, t) {
  35219. var i = void 0 === t;
  35220. if (i && (t = this.offset),
  35221. !this.noAssert) {
  35222. if ("number" != typeof e || e % 1 != 0)
  35223. throw TypeError("Illegal value: " + e + " (not an integer)");
  35224. if (e >>>= 0,
  35225. "number" != typeof t || t % 1 != 0)
  35226. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35227. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35228. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35229. }
  35230. t += 4;
  35231. var n = this.buffer.byteLength;
  35232. return n < t && this.resize((n *= 2) > t ? n : t),
  35233. t -= 4,
  35234. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  35235. this.view[t + 2] = e >>> 16 & 255,
  35236. this.view[t + 1] = e >>> 8 & 255,
  35237. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  35238. this.view[t + 1] = e >>> 16 & 255,
  35239. this.view[t + 2] = e >>> 8 & 255,
  35240. this.view[t + 3] = 255 & e),
  35241. i && (this.offset += 4),
  35242. this
  35243. }
  35244. ,
  35245. a.writeUInt32 = a.writeUint32,
  35246. a.readUint32 = function(e) {
  35247. var t = void 0 === e;
  35248. if (t && (e = this.offset),
  35249. !this.noAssert) {
  35250. if ("number" != typeof e || e % 1 != 0)
  35251. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35252. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35253. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35254. }
  35255. var i = 0;
  35256. return this.littleEndian ? (i = this.view[e + 2] << 16,
  35257. i |= this.view[e + 1] << 8,
  35258. i |= this.view[e],
  35259. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  35260. i |= this.view[e + 2] << 8,
  35261. i |= this.view[e + 3],
  35262. i += this.view[e] << 24 >>> 0),
  35263. t && (this.offset += 4),
  35264. i
  35265. }
  35266. ,
  35267. a.readUInt32 = a.readUint32,
  35268. l && (a.writeInt64 = function(e, t) {
  35269. var i = void 0 === t;
  35270. if (i && (t = this.offset),
  35271. !this.noAssert) {
  35272. if ("number" == typeof e)
  35273. e = l.fromNumber(e);
  35274. else if ("string" == typeof e)
  35275. e = l.fromString(e);
  35276. else if (!(e && e instanceof l))
  35277. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35278. if ("number" != typeof t || t % 1 != 0)
  35279. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35280. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35281. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35282. }
  35283. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  35284. t += 8;
  35285. var n = this.buffer.byteLength;
  35286. n < t && this.resize((n *= 2) > t ? n : t),
  35287. t -= 8;
  35288. var r = e.low
  35289. , o = e.high;
  35290. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  35291. this.view[t + 2] = r >>> 16 & 255,
  35292. this.view[t + 1] = r >>> 8 & 255,
  35293. this.view[t] = 255 & r,
  35294. t += 4,
  35295. this.view[t + 3] = o >>> 24 & 255,
  35296. this.view[t + 2] = o >>> 16 & 255,
  35297. this.view[t + 1] = o >>> 8 & 255,
  35298. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  35299. this.view[t + 1] = o >>> 16 & 255,
  35300. this.view[t + 2] = o >>> 8 & 255,
  35301. this.view[t + 3] = 255 & o,
  35302. t += 4,
  35303. this.view[t] = r >>> 24 & 255,
  35304. this.view[t + 1] = r >>> 16 & 255,
  35305. this.view[t + 2] = r >>> 8 & 255,
  35306. this.view[t + 3] = 255 & r),
  35307. i && (this.offset += 8),
  35308. this
  35309. }
  35310. ,
  35311. a.writeLong = a.writeInt64,
  35312. a.readInt64 = function(e) {
  35313. var t = void 0 === e;
  35314. if (t && (e = this.offset),
  35315. !this.noAssert) {
  35316. if ("number" != typeof e || e % 1 != 0)
  35317. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35318. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35319. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35320. }
  35321. var i = 0
  35322. , n = 0;
  35323. this.littleEndian ? (i = this.view[e + 2] << 16,
  35324. i |= this.view[e + 1] << 8,
  35325. i |= this.view[e],
  35326. i += this.view[e + 3] << 24 >>> 0,
  35327. e += 4,
  35328. n = this.view[e + 2] << 16,
  35329. n |= this.view[e + 1] << 8,
  35330. n |= this.view[e],
  35331. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  35332. n |= this.view[e + 2] << 8,
  35333. n |= this.view[e + 3],
  35334. n += this.view[e] << 24 >>> 0,
  35335. e += 4,
  35336. i = this.view[e + 1] << 16,
  35337. i |= this.view[e + 2] << 8,
  35338. i |= this.view[e + 3],
  35339. i += this.view[e] << 24 >>> 0);
  35340. var r = new l(i,n,!1);
  35341. return t && (this.offset += 8),
  35342. r
  35343. }
  35344. ,
  35345. a.readLong = a.readInt64,
  35346. a.writeUint64 = function(e, t) {
  35347. var i = void 0 === t;
  35348. if (i && (t = this.offset),
  35349. !this.noAssert) {
  35350. if ("number" == typeof e)
  35351. e = l.fromNumber(e);
  35352. else if ("string" == typeof e)
  35353. e = l.fromString(e);
  35354. else if (!(e && e instanceof l))
  35355. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35356. if ("number" != typeof t || t % 1 != 0)
  35357. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35358. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35359. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35360. }
  35361. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  35362. t += 8;
  35363. var n = this.buffer.byteLength;
  35364. n < t && this.resize((n *= 2) > t ? n : t),
  35365. t -= 8;
  35366. var r = e.low
  35367. , o = e.high;
  35368. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  35369. this.view[t + 2] = r >>> 16 & 255,
  35370. this.view[t + 1] = r >>> 8 & 255,
  35371. this.view[t] = 255 & r,
  35372. t += 4,
  35373. this.view[t + 3] = o >>> 24 & 255,
  35374. this.view[t + 2] = o >>> 16 & 255,
  35375. this.view[t + 1] = o >>> 8 & 255,
  35376. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  35377. this.view[t + 1] = o >>> 16 & 255,
  35378. this.view[t + 2] = o >>> 8 & 255,
  35379. this.view[t + 3] = 255 & o,
  35380. t += 4,
  35381. this.view[t] = r >>> 24 & 255,
  35382. this.view[t + 1] = r >>> 16 & 255,
  35383. this.view[t + 2] = r >>> 8 & 255,
  35384. this.view[t + 3] = 255 & r),
  35385. i && (this.offset += 8),
  35386. this
  35387. }
  35388. ,
  35389. a.writeUInt64 = a.writeUint64,
  35390. a.readUint64 = function(e) {
  35391. var t = void 0 === e;
  35392. if (t && (e = this.offset),
  35393. !this.noAssert) {
  35394. if ("number" != typeof e || e % 1 != 0)
  35395. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35396. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35397. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35398. }
  35399. var i = 0
  35400. , n = 0;
  35401. this.littleEndian ? (i = this.view[e + 2] << 16,
  35402. i |= this.view[e + 1] << 8,
  35403. i |= this.view[e],
  35404. i += this.view[e + 3] << 24 >>> 0,
  35405. e += 4,
  35406. n = this.view[e + 2] << 16,
  35407. n |= this.view[e + 1] << 8,
  35408. n |= this.view[e],
  35409. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  35410. n |= this.view[e + 2] << 8,
  35411. n |= this.view[e + 3],
  35412. n += this.view[e] << 24 >>> 0,
  35413. e += 4,
  35414. i = this.view[e + 1] << 16,
  35415. i |= this.view[e + 2] << 8,
  35416. i |= this.view[e + 3],
  35417. i += this.view[e] << 24 >>> 0);
  35418. var r = new l(i,n,!0);
  35419. return t && (this.offset += 8),
  35420. r
  35421. }
  35422. ,
  35423. a.readUInt64 = a.readUint64),
  35424. a.writeFloat32 = function(e, t) {
  35425. var i = void 0 === t;
  35426. if (i && (t = this.offset),
  35427. !this.noAssert) {
  35428. if ("number" != typeof e)
  35429. throw TypeError("Illegal value: " + e + " (not a number)");
  35430. if ("number" != typeof t || t % 1 != 0)
  35431. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35432. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35433. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35434. }
  35435. t += 4;
  35436. var n = this.buffer.byteLength;
  35437. return n < t && this.resize((n *= 2) > t ? n : t),
  35438. t -= 4,
  35439. r(this.view, e, t, this.littleEndian, 23, 4),
  35440. i && (this.offset += 4),
  35441. this
  35442. }
  35443. ,
  35444. a.writeFloat = a.writeFloat32,
  35445. a.readFloat32 = function(e) {
  35446. var t = void 0 === e;
  35447. if (t && (e = this.offset),
  35448. !this.noAssert) {
  35449. if ("number" != typeof e || e % 1 != 0)
  35450. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35451. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35452. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35453. }
  35454. var i = n(this.view, e, this.littleEndian, 23, 4);
  35455. return t && (this.offset += 4),
  35456. i
  35457. }
  35458. ,
  35459. a.readFloat = a.readFloat32,
  35460. a.writeFloat64 = function(e, t) {
  35461. var i = void 0 === t;
  35462. if (i && (t = this.offset),
  35463. !this.noAssert) {
  35464. if ("number" != typeof e)
  35465. throw TypeError("Illegal value: " + e + " (not a number)");
  35466. if ("number" != typeof t || t % 1 != 0)
  35467. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35468. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35469. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35470. }
  35471. t += 8;
  35472. var n = this.buffer.byteLength;
  35473. return n < t && this.resize((n *= 2) > t ? n : t),
  35474. t -= 8,
  35475. r(this.view, e, t, this.littleEndian, 52, 8),
  35476. i && (this.offset += 8),
  35477. this
  35478. }
  35479. ,
  35480. a.writeDouble = a.writeFloat64,
  35481. a.readFloat64 = function(e) {
  35482. var t = void 0 === e;
  35483. if (t && (e = this.offset),
  35484. !this.noAssert) {
  35485. if ("number" != typeof e || e % 1 != 0)
  35486. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35487. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35488. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35489. }
  35490. var i = n(this.view, e, this.littleEndian, 52, 8);
  35491. return t && (this.offset += 8),
  35492. i
  35493. }
  35494. ,
  35495. a.readDouble = a.readFloat64,
  35496. f.MAX_VARINT32_BYTES = 5,
  35497. f.calculateVarint32 = function(e) {
  35498. return (e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  35499. }
  35500. ,
  35501. f.zigZagEncode32 = function(e) {
  35502. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  35503. }
  35504. ,
  35505. f.zigZagDecode32 = function(e) {
  35506. return e >>> 1 ^ -(1 & e) | 0
  35507. }
  35508. ,
  35509. a.writeVarint32 = function(e, t) {
  35510. var i = void 0 === t;
  35511. if (i && (t = this.offset),
  35512. !this.noAssert) {
  35513. if ("number" != typeof e || e % 1 != 0)
  35514. throw TypeError("Illegal value: " + e + " (not an integer)");
  35515. if (e |= 0,
  35516. "number" != typeof t || t % 1 != 0)
  35517. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35518. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35519. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35520. }
  35521. var n, r = f.calculateVarint32(e);
  35522. t += r;
  35523. var o = this.buffer.byteLength;
  35524. for (o < t && this.resize((o *= 2) > t ? o : t),
  35525. t -= r,
  35526. e >>>= 0; 128 <= e; )
  35527. n = 127 & e | 128,
  35528. this.view[t++] = n,
  35529. e >>>= 7;
  35530. return this.view[t++] = e,
  35531. i ? (this.offset = t,
  35532. this) : r
  35533. }
  35534. ,
  35535. a.writeVarint32ZigZag = function(e, t) {
  35536. return this.writeVarint32(f.zigZagEncode32(e), t)
  35537. }
  35538. ,
  35539. a.readVarint32 = function(e) {
  35540. var t = void 0 === e;
  35541. if (t && (e = this.offset),
  35542. !this.noAssert) {
  35543. if ("number" != typeof e || e % 1 != 0)
  35544. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35545. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35546. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35547. }
  35548. var i, n = 0, r = 0;
  35549. do {
  35550. if (!this.noAssert && e > this.limit) {
  35551. var o = Error("Truncated");
  35552. throw o.truncated = !0,
  35553. o
  35554. }
  35555. i = this.view[e++],
  35556. n < 5 && (r |= (127 & i) << 7 * n),
  35557. ++n
  35558. } while (0 != (128 & i));return r |= 0,
  35559. t ? (this.offset = e,
  35560. r) : {
  35561. value: r,
  35562. length: n
  35563. }
  35564. }
  35565. ,
  35566. a.readVarint32ZigZag = function(e) {
  35567. var t = this.readVarint32(e);
  35568. return "object" == typeof t ? t.value = f.zigZagDecode32(t.value) : t = f.zigZagDecode32(t),
  35569. t
  35570. }
  35571. ,
  35572. l && (f.MAX_VARINT64_BYTES = 10,
  35573. f.calculateVarint64 = function(e) {
  35574. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e));
  35575. var t = e.toInt() >>> 0
  35576. , i = e.shiftRightUnsigned(28).toInt() >>> 0
  35577. , n = e.shiftRightUnsigned(56).toInt() >>> 0;
  35578. return 0 == n ? 0 == i ? t < 16384 ? t < 128 ? 1 : 2 : t < 1 << 21 ? 3 : 4 : i < 16384 ? i < 128 ? 5 : 6 : i < 1 << 21 ? 7 : 8 : n < 128 ? 9 : 10
  35579. }
  35580. ,
  35581. f.zigZagEncode64 = function(e) {
  35582. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35583. e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()
  35584. }
  35585. ,
  35586. f.zigZagDecode64 = function(e) {
  35587. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35588. e.shiftRightUnsigned(1).xor(e.and(l.ONE).toSigned().negate()).toSigned()
  35589. }
  35590. ,
  35591. a.writeVarint64 = function(e, t) {
  35592. var i = void 0 === t;
  35593. if (i && (t = this.offset),
  35594. !this.noAssert) {
  35595. if ("number" == typeof e)
  35596. e = l.fromNumber(e);
  35597. else if ("string" == typeof e)
  35598. e = l.fromString(e);
  35599. else if (!(e && e instanceof l))
  35600. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35601. if ("number" != typeof t || t % 1 != 0)
  35602. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35603. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35604. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35605. }
  35606. "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned());
  35607. var n = f.calculateVarint64(e)
  35608. , r = e.toInt() >>> 0
  35609. , o = e.shiftRightUnsigned(28).toInt() >>> 0
  35610. , a = e.shiftRightUnsigned(56).toInt() >>> 0;
  35611. t += n;
  35612. var s = this.buffer.byteLength;
  35613. switch (s < t && this.resize((s *= 2) > t ? s : t),
  35614. t -= n,
  35615. n) {
  35616. case 10:
  35617. this.view[t + 9] = a >>> 7 & 1;
  35618. case 9:
  35619. this.view[t + 8] = 9 !== n ? 128 | a : 127 & a;
  35620. case 8:
  35621. this.view[t + 7] = 8 !== n ? o >>> 21 | 128 : o >>> 21 & 127;
  35622. case 7:
  35623. this.view[t + 6] = 7 !== n ? o >>> 14 | 128 : o >>> 14 & 127;
  35624. case 6:
  35625. this.view[t + 5] = 6 !== n ? o >>> 7 | 128 : o >>> 7 & 127;
  35626. case 5:
  35627. this.view[t + 4] = 5 !== n ? 128 | o : 127 & o;
  35628. case 4:
  35629. this.view[t + 3] = 4 !== n ? r >>> 21 | 128 : r >>> 21 & 127;
  35630. case 3:
  35631. this.view[t + 2] = 3 !== n ? r >>> 14 | 128 : r >>> 14 & 127;
  35632. case 2:
  35633. this.view[t + 1] = 2 !== n ? r >>> 7 | 128 : r >>> 7 & 127;
  35634. case 1:
  35635. this.view[t] = 1 !== n ? 128 | r : 127 & r
  35636. }
  35637. return i ? (this.offset += n,
  35638. this) : n
  35639. }
  35640. ,
  35641. a.writeVarint64ZigZag = function(e, t) {
  35642. return this.writeVarint64(f.zigZagEncode64(e), t)
  35643. }
  35644. ,
  35645. a.readVarint64 = function(e) {
  35646. var t = void 0 === e;
  35647. if (t && (e = this.offset),
  35648. !this.noAssert) {
  35649. if ("number" != typeof e || e % 1 != 0)
  35650. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35651. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35652. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35653. }
  35654. var i = e
  35655. , n = 0
  35656. , r = 0
  35657. , o = 0
  35658. , a = 0;
  35659. if (n = 127 & (a = this.view[e++]),
  35660. 128 & a && (n |= (127 & (a = this.view[e++])) << 7,
  35661. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 14,
  35662. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 21,
  35663. (128 & a || this.noAssert && void 0 === a) && (r = 127 & (a = this.view[e++]),
  35664. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 7,
  35665. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 14,
  35666. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 21,
  35667. (128 & a || this.noAssert && void 0 === a) && (o = 127 & (a = this.view[e++]),
  35668. (128 & a || this.noAssert && void 0 === a) && (o |= (127 & (a = this.view[e++])) << 7,
  35669. 128 & a || this.noAssert && void 0 === a))))))))))
  35670. throw Error("Buffer overrun");
  35671. var s = l.fromBits(n | r << 28, r >>> 4 | o << 24, !1);
  35672. return t ? (this.offset = e,
  35673. s) : {
  35674. value: s,
  35675. length: e - i
  35676. }
  35677. }
  35678. ,
  35679. a.readVarint64ZigZag = function(e) {
  35680. var t = this.readVarint64(e);
  35681. return t && t.value instanceof l ? t.value = f.zigZagDecode64(t.value) : t = f.zigZagDecode64(t),
  35682. t
  35683. }
  35684. ),
  35685. a.writeCString = function(e, t) {
  35686. var i = void 0 === t;
  35687. i && (t = this.offset);
  35688. var n, r = e.length;
  35689. if (!this.noAssert) {
  35690. if ("string" != typeof e)
  35691. throw TypeError("Illegal str: Not a string");
  35692. for (n = 0; n < r; ++n)
  35693. if (0 === e.charCodeAt(n))
  35694. throw RangeError("Illegal str: Contains NULL-characters");
  35695. if ("number" != typeof t || t % 1 != 0)
  35696. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35697. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35698. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35699. }
  35700. r = d.calculateUTF16asUTF8(s(e))[1],
  35701. t += r + 1;
  35702. var o = this.buffer.byteLength;
  35703. return o < t && this.resize((o *= 2) > t ? o : t),
  35704. t -= r + 1,
  35705. d.encodeUTF16toUTF8(s(e), function(e) {
  35706. this.view[t++] = e
  35707. }
  35708. .bind(this)),
  35709. this.view[t++] = 0,
  35710. i ? (this.offset = t,
  35711. this) : r
  35712. }
  35713. ,
  35714. a.readCString = function(e) {
  35715. var t = void 0 === e;
  35716. if (t && (e = this.offset),
  35717. !this.noAssert) {
  35718. if ("number" != typeof e || e % 1 != 0)
  35719. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35720. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35721. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35722. }
  35723. var i, n = e, r = -1;
  35724. return d.decodeUTF8toUTF16(function() {
  35725. if (0 === r)
  35726. return null;
  35727. if (e >= this.limit)
  35728. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  35729. return 0 === (r = this.view[e++]) ? null : r
  35730. }
  35731. .bind(this), i = c(), !0),
  35732. t ? (this.offset = e,
  35733. i()) : {
  35734. string: i(),
  35735. length: e - n
  35736. }
  35737. }
  35738. ,
  35739. a.writeIString = function(e, t) {
  35740. var i = void 0 === t;
  35741. if (i && (t = this.offset),
  35742. !this.noAssert) {
  35743. if ("string" != typeof e)
  35744. throw TypeError("Illegal str: Not a string");
  35745. if ("number" != typeof t || t % 1 != 0)
  35746. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35747. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35748. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35749. }
  35750. var n, r = t;
  35751. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35752. t += 4 + n;
  35753. var o = this.buffer.byteLength;
  35754. if (o < t && this.resize((o *= 2) > t ? o : t),
  35755. t -= 4 + n,
  35756. this.littleEndian ? (this.view[t + 3] = n >>> 24 & 255,
  35757. this.view[t + 2] = n >>> 16 & 255,
  35758. this.view[t + 1] = n >>> 8 & 255,
  35759. this.view[t] = 255 & n) : (this.view[t] = n >>> 24 & 255,
  35760. this.view[t + 1] = n >>> 16 & 255,
  35761. this.view[t + 2] = n >>> 8 & 255,
  35762. this.view[t + 3] = 255 & n),
  35763. t += 4,
  35764. d.encodeUTF16toUTF8(s(e), function(e) {
  35765. this.view[t++] = e
  35766. }
  35767. .bind(this)),
  35768. t !== r + 4 + n)
  35769. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + 4 + n));
  35770. return i ? (this.offset = t,
  35771. this) : t - r
  35772. }
  35773. ,
  35774. a.readIString = function(e) {
  35775. var t = void 0 === e;
  35776. if (t && (e = this.offset),
  35777. !this.noAssert) {
  35778. if ("number" != typeof e || e % 1 != 0)
  35779. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35780. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35781. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35782. }
  35783. var i = e
  35784. , n = this.readUint32(e)
  35785. , r = this.readUTF8String(n, f.METRICS_BYTES, e += 4);
  35786. return e += r.length,
  35787. t ? (this.offset = e,
  35788. r.string) : {
  35789. string: r.string,
  35790. length: e - i
  35791. }
  35792. }
  35793. ,
  35794. f.METRICS_CHARS = "c",
  35795. f.METRICS_BYTES = "b",
  35796. a.writeUTF8String = function(e, t) {
  35797. var i = void 0 === t;
  35798. if (i && (t = this.offset),
  35799. !this.noAssert) {
  35800. if ("number" != typeof t || t % 1 != 0)
  35801. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35802. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35803. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35804. }
  35805. var n, r = t;
  35806. n = d.calculateUTF16asUTF8(s(e))[1],
  35807. t += n;
  35808. var o = this.buffer.byteLength;
  35809. return o < t && this.resize((o *= 2) > t ? o : t),
  35810. t -= n,
  35811. d.encodeUTF16toUTF8(s(e), function(e) {
  35812. this.view[t++] = e
  35813. }
  35814. .bind(this)),
  35815. i ? (this.offset = t,
  35816. this) : t - r
  35817. }
  35818. ,
  35819. a.writeString = a.writeUTF8String,
  35820. f.calculateUTF8Chars = function(e) {
  35821. return d.calculateUTF16asUTF8(s(e))[0]
  35822. }
  35823. ,
  35824. f.calculateUTF8Bytes = function(e) {
  35825. return d.calculateUTF16asUTF8(s(e))[1]
  35826. }
  35827. ,
  35828. f.calculateString = f.calculateUTF8Bytes,
  35829. a.readUTF8String = function(e, t, i) {
  35830. "number" == typeof t && (i = t,
  35831. t = void 0);
  35832. var n = void 0 === i;
  35833. if (n && (i = this.offset),
  35834. void 0 === t && (t = f.METRICS_CHARS),
  35835. !this.noAssert) {
  35836. if ("number" != typeof e || e % 1 != 0)
  35837. throw TypeError("Illegal length: " + e + " (not an integer)");
  35838. if (e |= 0,
  35839. "number" != typeof i || i % 1 != 0)
  35840. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35841. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35842. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35843. }
  35844. var r, o = 0, a = i;
  35845. if (t === f.METRICS_CHARS) {
  35846. if (r = c(),
  35847. d.decodeUTF8(function() {
  35848. return o < e && i < this.limit ? this.view[i++] : null
  35849. }
  35850. .bind(this), function(e) {
  35851. ++o,
  35852. d.UTF8toUTF16(e, r)
  35853. }),
  35854. o !== e)
  35855. throw RangeError("Illegal range: Truncated data, " + o + " == " + e);
  35856. return n ? (this.offset = i,
  35857. r()) : {
  35858. string: r(),
  35859. length: i - a
  35860. }
  35861. }
  35862. if (t !== f.METRICS_BYTES)
  35863. throw TypeError("Unsupported metrics: " + t);
  35864. if (!this.noAssert) {
  35865. if ("number" != typeof i || i % 1 != 0)
  35866. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35867. if ((i >>>= 0) < 0 || i + e > this.buffer.byteLength)
  35868. throw RangeError("Illegal offset: 0 <= " + i + " (+" + e + ") <= " + this.buffer.byteLength)
  35869. }
  35870. var s = i + e;
  35871. if (d.decodeUTF8toUTF16(function() {
  35872. return i < s ? this.view[i++] : null
  35873. }
  35874. .bind(this), r = c(), this.noAssert),
  35875. i !== s)
  35876. throw RangeError("Illegal range: Truncated data, " + i + " == " + s);
  35877. return n ? (this.offset = i,
  35878. r()) : {
  35879. string: r(),
  35880. length: i - a
  35881. }
  35882. }
  35883. ,
  35884. a.readString = a.readUTF8String,
  35885. a.writeVString = function(e, t) {
  35886. var i = void 0 === t;
  35887. if (i && (t = this.offset),
  35888. !this.noAssert) {
  35889. if ("string" != typeof e)
  35890. throw TypeError("Illegal str: Not a string");
  35891. if ("number" != typeof t || t % 1 != 0)
  35892. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35893. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35894. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35895. }
  35896. var n, r, o = t;
  35897. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35898. r = f.calculateVarint32(n),
  35899. t += r + n;
  35900. var a = this.buffer.byteLength;
  35901. if (a < t && this.resize((a *= 2) > t ? a : t),
  35902. t -= r + n,
  35903. t += this.writeVarint32(n, t),
  35904. d.encodeUTF16toUTF8(s(e), function(e) {
  35905. this.view[t++] = e
  35906. }
  35907. .bind(this)),
  35908. t !== o + n + r)
  35909. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + n + r));
  35910. return i ? (this.offset = t,
  35911. this) : t - o
  35912. }
  35913. ,
  35914. a.readVString = function(e) {
  35915. var t = void 0 === e;
  35916. if (t && (e = this.offset),
  35917. !this.noAssert) {
  35918. if ("number" != typeof e || e % 1 != 0)
  35919. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35920. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35921. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35922. }
  35923. var i = e
  35924. , n = this.readVarint32(e)
  35925. , r = this.readUTF8String(n.value, f.METRICS_BYTES, e += n.length);
  35926. return e += r.length,
  35927. t ? (this.offset = e,
  35928. r.string) : {
  35929. string: r.string,
  35930. length: e - i
  35931. }
  35932. }
  35933. ,
  35934. a.append = function(e, t, i) {
  35935. "number" != typeof t && "string" == typeof t || (i = t,
  35936. t = void 0);
  35937. var n = void 0 === i;
  35938. if (n && (i = this.offset),
  35939. !this.noAssert) {
  35940. if ("number" != typeof i || i % 1 != 0)
  35941. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35942. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35943. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35944. }
  35945. e instanceof f || (e = f.wrap(e, t));
  35946. var r = e.limit - e.offset;
  35947. if (r <= 0)
  35948. return this;
  35949. i += r;
  35950. var o = this.buffer.byteLength;
  35951. return o < i && this.resize((o *= 2) > i ? o : i),
  35952. i -= r,
  35953. this.view.set(e.view.subarray(e.offset, e.limit), i),
  35954. e.offset += r,
  35955. n && (this.offset += r),
  35956. this
  35957. }
  35958. ,
  35959. a.appendTo = function(e, t) {
  35960. return e.append(this, t),
  35961. this
  35962. }
  35963. ,
  35964. a.assert = function(e) {
  35965. return this.noAssert = !e,
  35966. this
  35967. }
  35968. ,
  35969. a.capacity = function() {
  35970. return this.buffer.byteLength
  35971. }
  35972. ,
  35973. a.clear = function() {
  35974. return this.offset = 0,
  35975. this.limit = this.buffer.byteLength,
  35976. this.markedOffset = -1,
  35977. this
  35978. }
  35979. ,
  35980. a.clone = function(e) {
  35981. var t = new f(0,this.littleEndian,this.noAssert);
  35982. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  35983. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  35984. t.view = this.view),
  35985. t.offset = this.offset,
  35986. t.markedOffset = this.markedOffset,
  35987. t.limit = this.limit,
  35988. t
  35989. }
  35990. ,
  35991. a.compact = function(e, t) {
  35992. if (void 0 === e && (e = this.offset),
  35993. void 0 === t && (t = this.limit),
  35994. !this.noAssert) {
  35995. if ("number" != typeof e || e % 1 != 0)
  35996. throw TypeError("Illegal begin: Not an integer");
  35997. if (e >>>= 0,
  35998. "number" != typeof t || t % 1 != 0)
  35999. throw TypeError("Illegal end: Not an integer");
  36000. if (t >>>= 0,
  36001. e < 0 || t < e || t > this.buffer.byteLength)
  36002. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36003. }
  36004. if (0 === e && t === this.buffer.byteLength)
  36005. return this;
  36006. var i = t - e;
  36007. if (0 == i)
  36008. return this.buffer = o,
  36009. this.view = null,
  36010. 0 <= this.markedOffset && (this.markedOffset -= e),
  36011. this.offset = 0,
  36012. this.limit = 0,
  36013. this;
  36014. var n = new ArrayBuffer(i)
  36015. , r = new Uint8Array(n);
  36016. return r.set(this.view.subarray(e, t)),
  36017. this.buffer = n,
  36018. this.view = r,
  36019. 0 <= this.markedOffset && (this.markedOffset -= e),
  36020. this.offset = 0,
  36021. this.limit = i,
  36022. this
  36023. }
  36024. ,
  36025. a.copy = function(e, t) {
  36026. if (void 0 === e && (e = this.offset),
  36027. void 0 === t && (t = this.limit),
  36028. !this.noAssert) {
  36029. if ("number" != typeof e || e % 1 != 0)
  36030. throw TypeError("Illegal begin: Not an integer");
  36031. if (e >>>= 0,
  36032. "number" != typeof t || t % 1 != 0)
  36033. throw TypeError("Illegal end: Not an integer");
  36034. if (t >>>= 0,
  36035. e < 0 || t < e || t > this.buffer.byteLength)
  36036. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36037. }
  36038. if (e === t)
  36039. return new f(0,this.littleEndian,this.noAssert);
  36040. var i = t - e
  36041. , n = new f(i,this.littleEndian,this.noAssert);
  36042. return n.offset = 0,
  36043. n.limit = i,
  36044. 0 <= n.markedOffset && (n.markedOffset -= e),
  36045. this.copyTo(n, 0, e, t),
  36046. n
  36047. }
  36048. ,
  36049. a.copyTo = function(e, t, i, n) {
  36050. var r, o;
  36051. if (!this.noAssert && !f.isByteBuffer(e))
  36052. throw TypeError("Illegal target: Not a ByteBuffer");
  36053. if (t = (o = void 0 === t) ? e.offset : 0 | t,
  36054. i = (r = void 0 === i) ? this.offset : 0 | i,
  36055. n = void 0 === n ? this.limit : 0 | n,
  36056. t < 0 || t > e.buffer.byteLength)
  36057. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  36058. if (i < 0 || n > this.buffer.byteLength)
  36059. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  36060. var a = n - i;
  36061. return 0 == a ? e : (e.ensureCapacity(t + a),
  36062. e.view.set(this.view.subarray(i, n), t),
  36063. r && (this.offset += a),
  36064. o && (e.offset += a),
  36065. this)
  36066. }
  36067. ,
  36068. a.ensureCapacity = function(e) {
  36069. var t = this.buffer.byteLength;
  36070. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  36071. }
  36072. ,
  36073. a.fill = function(e, t, i) {
  36074. var n = void 0 === t;
  36075. if (n && (t = this.offset),
  36076. "string" == typeof e && 0 < e.length && (e = e.charCodeAt(0)),
  36077. void 0 === t && (t = this.offset),
  36078. void 0 === i && (i = this.limit),
  36079. !this.noAssert) {
  36080. if ("number" != typeof e || e % 1 != 0)
  36081. throw TypeError("Illegal value: " + e + " (not an integer)");
  36082. if (e |= 0,
  36083. "number" != typeof t || t % 1 != 0)
  36084. throw TypeError("Illegal begin: Not an integer");
  36085. if (t >>>= 0,
  36086. "number" != typeof i || i % 1 != 0)
  36087. throw TypeError("Illegal end: Not an integer");
  36088. if (i >>>= 0,
  36089. t < 0 || i < t || i > this.buffer.byteLength)
  36090. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36091. }
  36092. if (i <= t)
  36093. return this;
  36094. for (; t < i; )
  36095. this.view[t++] = e;
  36096. return n && (this.offset = t),
  36097. this
  36098. }
  36099. ,
  36100. a.flip = function() {
  36101. return this.limit = this.offset,
  36102. this.offset = 0,
  36103. this
  36104. }
  36105. ,
  36106. a.mark = function(e) {
  36107. if (e = void 0 === e ? this.offset : e,
  36108. !this.noAssert) {
  36109. if ("number" != typeof e || e % 1 != 0)
  36110. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36111. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength)
  36112. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  36113. }
  36114. return this.markedOffset = e,
  36115. this
  36116. }
  36117. ,
  36118. a.order = function(e) {
  36119. if (!this.noAssert && "boolean" != typeof e)
  36120. throw TypeError("Illegal littleEndian: Not a boolean");
  36121. return this.littleEndian = !!e,
  36122. this
  36123. }
  36124. ,
  36125. a.LE = function(e) {
  36126. return this.littleEndian = void 0 === e || !!e,
  36127. this
  36128. }
  36129. ,
  36130. a.BE = function(e) {
  36131. return this.littleEndian = void 0 !== e && !e,
  36132. this
  36133. }
  36134. ,
  36135. a.prepend = function(e, t, i) {
  36136. "number" != typeof t && "string" == typeof t || (i = t,
  36137. t = void 0);
  36138. var n = void 0 === i;
  36139. if (n && (i = this.offset),
  36140. !this.noAssert) {
  36141. if ("number" != typeof i || i % 1 != 0)
  36142. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36143. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  36144. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36145. }
  36146. e instanceof f || (e = f.wrap(e, t));
  36147. var r = e.limit - e.offset;
  36148. if (r <= 0)
  36149. return this;
  36150. var o = r - i;
  36151. if (0 < o) {
  36152. var a = new ArrayBuffer(this.buffer.byteLength + o)
  36153. , s = new Uint8Array(a);
  36154. s.set(this.view.subarray(i, this.buffer.byteLength), r),
  36155. this.buffer = a,
  36156. this.view = s,
  36157. this.offset += o,
  36158. 0 <= this.markedOffset && (this.markedOffset += o),
  36159. this.limit += o,
  36160. i += o
  36161. } else
  36162. new Uint8Array(this.buffer);
  36163. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  36164. e.offset = e.limit,
  36165. n && (this.offset -= r),
  36166. this
  36167. }
  36168. ,
  36169. a.prependTo = function(e, t) {
  36170. return e.prepend(this, t),
  36171. this
  36172. }
  36173. ,
  36174. a.printDebug = function(e) {
  36175. "function" != typeof e && (e = console.log.bind(console)),
  36176. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  36177. }
  36178. ,
  36179. a.remaining = function() {
  36180. return this.limit - this.offset
  36181. }
  36182. ,
  36183. a.reset = function() {
  36184. return 0 <= this.markedOffset ? (this.offset = this.markedOffset,
  36185. this.markedOffset = -1) : this.offset = 0,
  36186. this
  36187. }
  36188. ,
  36189. a.resize = function(e) {
  36190. if (!this.noAssert) {
  36191. if ("number" != typeof e || e % 1 != 0)
  36192. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  36193. if ((e |= 0) < 0)
  36194. throw RangeError("Illegal capacity: 0 <= " + e)
  36195. }
  36196. if (this.buffer.byteLength < e) {
  36197. var t = new ArrayBuffer(e)
  36198. , i = new Uint8Array(t);
  36199. i.set(this.view),
  36200. this.buffer = t,
  36201. this.view = i
  36202. }
  36203. return this
  36204. }
  36205. ,
  36206. a.reverse = function(e, t) {
  36207. if (void 0 === e && (e = this.offset),
  36208. void 0 === t && (t = this.limit),
  36209. !this.noAssert) {
  36210. if ("number" != typeof e || e % 1 != 0)
  36211. throw TypeError("Illegal begin: Not an integer");
  36212. if (e >>>= 0,
  36213. "number" != typeof t || t % 1 != 0)
  36214. throw TypeError("Illegal end: Not an integer");
  36215. if (t >>>= 0,
  36216. e < 0 || t < e || t > this.buffer.byteLength)
  36217. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36218. }
  36219. return e === t || Array.prototype.reverse.call(this.view.subarray(e, t)),
  36220. this
  36221. }
  36222. ,
  36223. a.skip = function(e) {
  36224. if (!this.noAssert) {
  36225. if ("number" != typeof e || e % 1 != 0)
  36226. throw TypeError("Illegal length: " + e + " (not an integer)");
  36227. e |= 0
  36228. }
  36229. var t = this.offset + e;
  36230. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  36231. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  36232. return this.offset = t,
  36233. this
  36234. }
  36235. ,
  36236. a.slice = function(e, t) {
  36237. if (void 0 === e && (e = this.offset),
  36238. void 0 === t && (t = this.limit),
  36239. !this.noAssert) {
  36240. if ("number" != typeof e || e % 1 != 0)
  36241. throw TypeError("Illegal begin: Not an integer");
  36242. if (e >>>= 0,
  36243. "number" != typeof t || t % 1 != 0)
  36244. throw TypeError("Illegal end: Not an integer");
  36245. if (t >>>= 0,
  36246. e < 0 || t < e || t > this.buffer.byteLength)
  36247. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36248. }
  36249. var i = this.clone();
  36250. return i.offset = e,
  36251. i.limit = t,
  36252. i
  36253. }
  36254. ,
  36255. a.toBuffer = function(e) {
  36256. var t = this.offset
  36257. , i = this.limit;
  36258. if (!this.noAssert) {
  36259. if ("number" != typeof t || t % 1 != 0)
  36260. throw TypeError("Illegal offset: Not an integer");
  36261. if (t >>>= 0,
  36262. "number" != typeof i || i % 1 != 0)
  36263. throw TypeError("Illegal limit: Not an integer");
  36264. if (i >>>= 0,
  36265. t < 0 || i < t || i > this.buffer.byteLength)
  36266. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36267. }
  36268. if (!e && 0 === t && i === this.buffer.byteLength)
  36269. return this.buffer;
  36270. if (t === i)
  36271. return o;
  36272. var n = new ArrayBuffer(i - t);
  36273. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  36274. n
  36275. }
  36276. ,
  36277. a.toArrayBuffer = a.toBuffer,
  36278. a.toString = function(e, t, i) {
  36279. if (void 0 === e)
  36280. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  36281. switch ("number" == typeof e && (i = t = e = "utf8"),
  36282. e) {
  36283. case "utf8":
  36284. return this.toUTF8(t, i);
  36285. case "base64":
  36286. return this.toBase64(t, i);
  36287. case "hex":
  36288. return this.toHex(t, i);
  36289. case "binary":
  36290. return this.toBinary(t, i);
  36291. case "debug":
  36292. return this.toDebug();
  36293. case "columns":
  36294. return this.toColumns();
  36295. default:
  36296. throw Error("Unsupported encoding: " + e)
  36297. }
  36298. }
  36299. ;
  36300. var h = function() {
  36301. for (var e = {}, r = [65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47], a = [], t = 0, i = r.length; t < i; ++t)
  36302. a[r[t]] = t;
  36303. return e.encode = function(e, t) {
  36304. for (var i, n; null !== (i = e()); )
  36305. t(r[i >> 2 & 63]),
  36306. n = (3 & i) << 4,
  36307. null !== (i = e()) ? (t(r[63 & ((n |= i >> 4 & 15) | i >> 4 & 15)]),
  36308. n = (15 & i) << 2,
  36309. null !== (i = e()) ? (t(r[63 & (n | i >> 6 & 3)]),
  36310. t(r[63 & i])) : (t(r[63 & n]),
  36311. t(61))) : (t(r[63 & n]),
  36312. t(61),
  36313. t(61))
  36314. }
  36315. ,
  36316. e.decode = function(e, t) {
  36317. function i(e) {
  36318. throw Error("Illegal character code: " + e)
  36319. }
  36320. for (var n, r, o; null !== (n = e()); )
  36321. if (void 0 === (r = a[n]) && i(n),
  36322. null !== (n = e()) && (void 0 === (o = a[n]) && i(n),
  36323. t(r << 2 >>> 0 | (48 & o) >> 4),
  36324. null !== (n = e()))) {
  36325. if (void 0 === (r = a[n])) {
  36326. if (61 === n)
  36327. break;
  36328. i(n)
  36329. }
  36330. if (t((15 & o) << 4 >>> 0 | (60 & r) >> 2),
  36331. null !== (n = e())) {
  36332. if (void 0 === (o = a[n])) {
  36333. if (61 === n)
  36334. break;
  36335. i(n)
  36336. }
  36337. t((3 & r) << 6 >>> 0 | o)
  36338. }
  36339. }
  36340. }
  36341. ,
  36342. e.test = function(e) {
  36343. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  36344. }
  36345. ,
  36346. e
  36347. }();
  36348. a.toBase64 = function(e, t) {
  36349. if (void 0 === e && (e = this.offset),
  36350. void 0 === t && (t = this.limit),
  36351. t |= 0,
  36352. (e |= 0) < 0 || t > this.capacity || t < e)
  36353. throw RangeError("begin, end");
  36354. var i;
  36355. return h.encode(function() {
  36356. return e < t ? this.view[e++] : null
  36357. }
  36358. .bind(this), i = c()),
  36359. i()
  36360. }
  36361. ,
  36362. f.fromBase64 = function(e, t) {
  36363. if ("string" != typeof e)
  36364. throw TypeError("str");
  36365. var i = new f(e.length / 4 * 3,t)
  36366. , n = 0;
  36367. return h.decode(s(e), function(e) {
  36368. i.view[n++] = e
  36369. }),
  36370. i.limit = n,
  36371. i
  36372. }
  36373. ,
  36374. f.btoa = function(e) {
  36375. return f.fromBinary(e).toBase64()
  36376. }
  36377. ,
  36378. f.atob = function(e) {
  36379. return f.fromBase64(e).toBinary()
  36380. }
  36381. ,
  36382. a.toBinary = function(e, t) {
  36383. if (void 0 === e && (e = this.offset),
  36384. void 0 === t && (t = this.limit),
  36385. t |= 0,
  36386. (e |= 0) < 0 || t > this.capacity() || t < e)
  36387. throw RangeError("begin, end");
  36388. if (e === t)
  36389. return "";
  36390. for (var i = [], n = []; e < t; )
  36391. i.push(this.view[e++]),
  36392. 1024 <= i.length && (n.push(String.fromCharCode.apply(String, i)),
  36393. i = []);
  36394. return n.join("") + String.fromCharCode.apply(String, i)
  36395. }
  36396. ,
  36397. f.fromBinary = function(e, t) {
  36398. if ("string" != typeof e)
  36399. throw TypeError("str");
  36400. for (var i, n = 0, r = e.length, o = new f(r,t); n < r; ) {
  36401. if (255 < (i = e.charCodeAt(n)))
  36402. throw RangeError("illegal char code: " + i);
  36403. o.view[n++] = i
  36404. }
  36405. return o.limit = r,
  36406. o
  36407. }
  36408. ,
  36409. a.toDebug = function(e) {
  36410. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  36411. if (-1 !== i && (r += (t = this.view[i]) < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  36412. e && (o += 32 < t && t < 127 ? String.fromCharCode(t) : ".")),
  36413. ++i,
  36414. e && 0 < i && i % 16 == 0 && i !== n) {
  36415. for (; r.length < 51; )
  36416. r += " ";
  36417. a += r + o + "\n",
  36418. r = o = ""
  36419. }
  36420. 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 ? " " : ""
  36421. }
  36422. if (e && " " !== r) {
  36423. for (; r.length < 51; )
  36424. r += " ";
  36425. a += r + o + "\n"
  36426. }
  36427. return e ? a : r
  36428. }
  36429. ,
  36430. f.fromDebug = function(e, t, i) {
  36431. for (var n, r, o = e.length, a = new f((o + 1) / 3 | 0,t,i), s = 0, l = 0, c = !1, h = !1, u = !1, d = !1, p = !1; s < o; ) {
  36432. switch (n = e.charAt(s++)) {
  36433. case "!":
  36434. if (!i) {
  36435. if (h || u || d) {
  36436. p = !0;
  36437. break
  36438. }
  36439. h = u = d = !0
  36440. }
  36441. a.offset = a.markedOffset = a.limit = l,
  36442. c = !1;
  36443. break;
  36444. case "|":
  36445. if (!i) {
  36446. if (h || d) {
  36447. p = !0;
  36448. break
  36449. }
  36450. h = d = !0
  36451. }
  36452. a.offset = a.limit = l,
  36453. c = !1;
  36454. break;
  36455. case "[":
  36456. if (!i) {
  36457. if (h || u) {
  36458. p = !0;
  36459. break
  36460. }
  36461. h = u = !0
  36462. }
  36463. a.offset = a.markedOffset = l,
  36464. c = !1;
  36465. break;
  36466. case "<":
  36467. if (!i) {
  36468. if (h) {
  36469. p = !0;
  36470. break
  36471. }
  36472. h = !0
  36473. }
  36474. a.offset = l,
  36475. c = !1;
  36476. break;
  36477. case "]":
  36478. if (!i) {
  36479. if (d || u) {
  36480. p = !0;
  36481. break
  36482. }
  36483. d = u = !0
  36484. }
  36485. a.limit = a.markedOffset = l,
  36486. c = !1;
  36487. break;
  36488. case ">":
  36489. if (!i) {
  36490. if (d) {
  36491. p = !0;
  36492. break
  36493. }
  36494. d = !0
  36495. }
  36496. a.limit = l,
  36497. c = !1;
  36498. break;
  36499. case "'":
  36500. if (!i) {
  36501. if (u) {
  36502. p = !0;
  36503. break
  36504. }
  36505. u = !0
  36506. }
  36507. a.markedOffset = l,
  36508. c = !1;
  36509. break;
  36510. case " ":
  36511. c = !1;
  36512. break;
  36513. default:
  36514. if (!i && c) {
  36515. p = !0;
  36516. break
  36517. }
  36518. if (r = parseInt(n + e.charAt(s++), 16),
  36519. !i && (isNaN(r) || r < 0 || 255 < r))
  36520. throw TypeError("Illegal str: Not a debug encoded string");
  36521. a.view[l++] = r,
  36522. c = !0
  36523. }
  36524. if (p)
  36525. throw TypeError("Illegal str: Invalid symbol at " + s)
  36526. }
  36527. if (!i) {
  36528. if (!h || !d)
  36529. throw TypeError("Illegal str: Missing offset or limit");
  36530. if (l < a.buffer.byteLength)
  36531. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + l + " < " + o)
  36532. }
  36533. return a
  36534. }
  36535. ,
  36536. a.toHex = function(e, t) {
  36537. if (e = void 0 === e ? this.offset : e,
  36538. t = void 0 === t ? this.limit : t,
  36539. !this.noAssert) {
  36540. if ("number" != typeof e || e % 1 != 0)
  36541. throw TypeError("Illegal begin: Not an integer");
  36542. if (e >>>= 0,
  36543. "number" != typeof t || t % 1 != 0)
  36544. throw TypeError("Illegal end: Not an integer");
  36545. if (t >>>= 0,
  36546. e < 0 || t < e || t > this.buffer.byteLength)
  36547. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36548. }
  36549. for (var i, n = new Array(t - e); e < t; )
  36550. (i = this.view[e++]) < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  36551. return n.join("")
  36552. }
  36553. ,
  36554. f.fromHex = function(e, t, i) {
  36555. if (!i) {
  36556. if ("string" != typeof e)
  36557. throw TypeError("Illegal str: Not a string");
  36558. if (e.length % 2 != 0)
  36559. throw TypeError("Illegal str: Length not a multiple of 2")
  36560. }
  36561. for (var n, r = e.length, o = new f(r / 2 | 0,t), a = 0, s = 0; a < r; a += 2) {
  36562. if (n = parseInt(e.substring(a, a + 2), 16),
  36563. !i && (!isFinite(n) || n < 0 || 255 < n))
  36564. throw TypeError("Illegal str: Contains non-hex characters");
  36565. o.view[s++] = n
  36566. }
  36567. return o.limit = s,
  36568. o
  36569. }
  36570. ;
  36571. var u, d = u = {
  36572. MAX_CODEPOINT: 1114111,
  36573. encodeUTF8: function(e, t) {
  36574. var i = null;
  36575. for ("number" == typeof e && (i = e,
  36576. e = function() {
  36577. return null
  36578. }
  36579. ); null !== i || null !== (i = e()); )
  36580. i < 128 ? t(127 & i) : (i < 2048 ? t(i >> 6 & 31 | 192) : (i < 65536 ? t(i >> 12 & 15 | 224) : (t(i >> 18 & 7 | 240),
  36581. t(i >> 12 & 63 | 128)),
  36582. t(i >> 6 & 63 | 128)),
  36583. t(63 & i | 128)),
  36584. i = null
  36585. },
  36586. decodeUTF8: function(e, t) {
  36587. for (var i, n, r, o, a = function(e) {
  36588. e = e.slice(0, e.indexOf(null));
  36589. var t = Error(e.toString());
  36590. throw t.name = "TruncatedError",
  36591. t.bytes = e,
  36592. t
  36593. }; null !== (i = e()); )
  36594. if (0 == (128 & i))
  36595. t(i);
  36596. else if (192 == (224 & i))
  36597. null === (n = e()) && a([i, n]),
  36598. t((31 & i) << 6 | 63 & n);
  36599. else if (224 == (240 & i))
  36600. null !== (n = e()) && null !== (r = e()) || a([i, n, r]),
  36601. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  36602. else {
  36603. if (240 != (248 & i))
  36604. throw RangeError("Illegal starting byte: " + i);
  36605. null !== (n = e()) && null !== (r = e()) && null !== (o = e()) || a([i, n, r, o]),
  36606. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  36607. }
  36608. },
  36609. UTF16toUTF8: function(e, t) {
  36610. for (var i, n = null; null !== (i = null !== n ? n : e()); )
  36611. 55296 <= i && i <= 57343 && null !== (n = e()) && 56320 <= n && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  36612. n = null) : t(i);
  36613. null !== n && t(n)
  36614. },
  36615. UTF8toUTF16: function(e, t) {
  36616. var i = null;
  36617. for ("number" == typeof e && (i = e,
  36618. e = function() {
  36619. return null
  36620. }
  36621. ); null !== i || null !== (i = e()); )
  36622. i <= 65535 ? t(i) : (t(55296 + ((i -= 65536) >> 10)),
  36623. t(i % 1024 + 56320)),
  36624. i = null
  36625. },
  36626. encodeUTF16toUTF8: function(e, t) {
  36627. u.UTF16toUTF8(e, function(e) {
  36628. u.encodeUTF8(e, t)
  36629. })
  36630. },
  36631. decodeUTF8toUTF16: function(e, t) {
  36632. u.decodeUTF8(e, function(e) {
  36633. u.UTF8toUTF16(e, t)
  36634. })
  36635. },
  36636. calculateCodePoint: function(e) {
  36637. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36638. },
  36639. calculateUTF8: function(e) {
  36640. for (var t, i = 0; null !== (t = e()); )
  36641. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  36642. return i
  36643. },
  36644. calculateUTF16asUTF8: function(e) {
  36645. var t = 0
  36646. , i = 0;
  36647. return u.UTF16toUTF8(e, function(e) {
  36648. ++t,
  36649. i += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36650. }),
  36651. [t, i]
  36652. }
  36653. };
  36654. return a.toUTF8 = function(t, i) {
  36655. if (void 0 === t && (t = this.offset),
  36656. void 0 === i && (i = this.limit),
  36657. !this.noAssert) {
  36658. if ("number" != typeof t || t % 1 != 0)
  36659. throw TypeError("Illegal begin: Not an integer");
  36660. if (t >>>= 0,
  36661. "number" != typeof i || i % 1 != 0)
  36662. throw TypeError("Illegal end: Not an integer");
  36663. if (i >>>= 0,
  36664. t < 0 || i < t || i > this.buffer.byteLength)
  36665. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36666. }
  36667. var e;
  36668. try {
  36669. d.decodeUTF8toUTF16(function() {
  36670. return t < i ? this.view[t++] : null
  36671. }
  36672. .bind(this), e = c())
  36673. } catch (e) {
  36674. if (t !== i)
  36675. throw RangeError("Illegal range: Truncated data, " + t + " != " + i)
  36676. }
  36677. return e()
  36678. }
  36679. ,
  36680. f.fromUTF8 = function(e, t, i) {
  36681. if (!i && "string" != typeof e)
  36682. throw TypeError("Illegal str: Not a string");
  36683. var n = new f(d.calculateUTF16asUTF8(s(e), !0)[1],t,i)
  36684. , r = 0;
  36685. return d.encodeUTF16toUTF8(s(e), function(e) {
  36686. n.view[r++] = e
  36687. }),
  36688. n.limit = r,
  36689. n
  36690. }
  36691. ,
  36692. f
  36693. }
  36694. ,
  36695. "function" == typeof define && define.amd ? define(["long"], r) : "function" == typeof t && "object" == typeof e && e && e.exports ? e.exports = function() {
  36696. var e;
  36697. try {
  36698. e = t("long")
  36699. } catch (e) {}
  36700. return r(e)
  36701. }() : (n.dcodeIO = n.dcodeIO || {}).ByteBuffer = r(n.dcodeIO.Long)
  36702. }
  36703. , {
  36704. long: 216
  36705. }],
  36706. 216: [function(e, t, i) {
  36707. var n, r;
  36708. n = this,
  36709. r = function() {
  36710. "use strict";
  36711. function n(e, t, i) {
  36712. this.low = 0 | e,
  36713. this.high = 0 | t,
  36714. this.unsigned = !!i
  36715. }
  36716. function p(e) {
  36717. return !0 === (e && e.__isLong__)
  36718. }
  36719. function e(e, t) {
  36720. var i, n, r;
  36721. return t ? (r = 0 <= (e >>>= 0) && e < 256) && (n = a[e]) ? n : (i = g(e, (0 | e) < 0 ? -1 : 0, !0),
  36722. r && (a[e] = i),
  36723. i) : (r = -128 <= (e |= 0) && e < 128) && (n = o[e]) ? n : (i = g(e, e < 0 ? -1 : 0, !1),
  36724. r && (o[e] = i),
  36725. i)
  36726. }
  36727. function f(e, t) {
  36728. if (isNaN(e) || !isFinite(e))
  36729. return t ? l : y;
  36730. if (t) {
  36731. if (e < 0)
  36732. return l;
  36733. if (r <= e)
  36734. return I
  36735. } else {
  36736. if (e <= -s)
  36737. return E;
  36738. if (s <= e + 1)
  36739. return C
  36740. }
  36741. return e < 0 ? f(-e, t).neg() : g(e % i | 0, e / i | 0, t)
  36742. }
  36743. function g(e, t, i) {
  36744. return new n(e,t,i)
  36745. }
  36746. function h(e, t, i) {
  36747. if (0 === e.length)
  36748. throw Error("empty string");
  36749. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  36750. return y;
  36751. if (t = "number" == typeof t ? (i = t,
  36752. !1) : !!t,
  36753. (i = i || 10) < 2 || 36 < i)
  36754. throw RangeError("radix");
  36755. var n;
  36756. if (0 < (n = e.indexOf("-")))
  36757. throw Error("interior hyphen");
  36758. if (0 === n)
  36759. return h(e.substring(1), t, i).neg();
  36760. for (var r = f(u(i, 8)), o = y, a = 0; a < e.length; a += 8) {
  36761. var s = Math.min(8, e.length - a)
  36762. , l = parseInt(e.substring(a, a + s), i);
  36763. if (s < 8) {
  36764. var c = f(u(i, s));
  36765. o = o.mul(c).add(f(l))
  36766. } else
  36767. o = (o = o.mul(r)).add(f(l))
  36768. }
  36769. return o.unsigned = t,
  36770. o
  36771. }
  36772. function m(e) {
  36773. return e instanceof n ? e : "number" == typeof e ? f(e) : "string" == typeof e ? h(e) : g(e.low, e.high, e.unsigned)
  36774. }
  36775. Object.defineProperty(n.prototype, "__isLong__", {
  36776. value: !0,
  36777. enumerable: !1,
  36778. configurable: !1
  36779. }),
  36780. n.isLong = p;
  36781. var o = {}
  36782. , a = {};
  36783. n.fromInt = e,
  36784. n.fromNumber = f,
  36785. n.fromBits = g;
  36786. var u = Math.pow;
  36787. n.fromString = h,
  36788. n.fromValue = m;
  36789. var i = 4294967296
  36790. , r = 0x10000000000000000
  36791. , s = r / 2
  36792. , v = e(1 << 24)
  36793. , y = e(0);
  36794. n.ZERO = y;
  36795. var l = e(0, !0);
  36796. n.UZERO = l;
  36797. var c = e(1);
  36798. n.ONE = c;
  36799. var d = e(1, !0);
  36800. n.UONE = d;
  36801. var A = e(-1);
  36802. n.NEG_ONE = A;
  36803. var C = g(-1, 2147483647, !1);
  36804. n.MAX_VALUE = C;
  36805. var I = g(-1, -1, !0);
  36806. n.MAX_UNSIGNED_VALUE = I;
  36807. var E = g(0, -2147483648, !1);
  36808. n.MIN_VALUE = E;
  36809. var t = n.prototype;
  36810. return t.toInt = function() {
  36811. return this.unsigned ? this.low >>> 0 : this.low
  36812. }
  36813. ,
  36814. t.toNumber = function() {
  36815. return this.unsigned ? (this.high >>> 0) * i + (this.low >>> 0) : this.high * i + (this.low >>> 0)
  36816. }
  36817. ,
  36818. t.toString = function(e) {
  36819. if ((e = e || 10) < 2 || 36 < e)
  36820. throw RangeError("radix");
  36821. if (this.isZero())
  36822. return "0";
  36823. if (this.isNegative()) {
  36824. if (this.eq(E)) {
  36825. var t = f(e)
  36826. , i = this.div(t)
  36827. , n = i.mul(t).sub(this);
  36828. return i.toString(e) + n.toInt().toString(e)
  36829. }
  36830. return "-" + this.neg().toString(e)
  36831. }
  36832. for (var r = f(u(e, 6), this.unsigned), o = this, a = ""; ; ) {
  36833. var s = o.div(r)
  36834. , l = (o.sub(s.mul(r)).toInt() >>> 0).toString(e);
  36835. if ((o = s).isZero())
  36836. return l + a;
  36837. for (; l.length < 6; )
  36838. l = "0" + l;
  36839. a = "" + l + a
  36840. }
  36841. }
  36842. ,
  36843. t.getHighBits = function() {
  36844. return this.high
  36845. }
  36846. ,
  36847. t.getHighBitsUnsigned = function() {
  36848. return this.high >>> 0
  36849. }
  36850. ,
  36851. t.getLowBits = function() {
  36852. return this.low
  36853. }
  36854. ,
  36855. t.getLowBitsUnsigned = function() {
  36856. return this.low >>> 0
  36857. }
  36858. ,
  36859. t.getNumBitsAbs = function() {
  36860. if (this.isNegative())
  36861. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  36862. for (var e = 0 != this.high ? this.high : this.low, t = 31; 0 < t && 0 == (e & 1 << t); t--)
  36863. ;
  36864. return 0 != this.high ? t + 33 : t + 1
  36865. }
  36866. ,
  36867. t.isZero = function() {
  36868. return 0 === this.high && 0 === this.low
  36869. }
  36870. ,
  36871. t.isNegative = function() {
  36872. return !this.unsigned && this.high < 0
  36873. }
  36874. ,
  36875. t.isPositive = function() {
  36876. return this.unsigned || 0 <= this.high
  36877. }
  36878. ,
  36879. t.isOdd = function() {
  36880. return 1 == (1 & this.low)
  36881. }
  36882. ,
  36883. t.isEven = function() {
  36884. return 0 == (1 & this.low)
  36885. }
  36886. ,
  36887. t.equals = function(e) {
  36888. return p(e) || (e = m(e)),
  36889. (this.unsigned === e.unsigned || this.high >>> 31 != 1 || e.high >>> 31 != 1) && this.high === e.high && this.low === e.low
  36890. }
  36891. ,
  36892. t.eq = t.equals,
  36893. t.notEquals = function(e) {
  36894. return !this.eq(e)
  36895. }
  36896. ,
  36897. t.neq = t.notEquals,
  36898. t.lessThan = function(e) {
  36899. return this.comp(e) < 0
  36900. }
  36901. ,
  36902. t.lt = t.lessThan,
  36903. t.lessThanOrEqual = function(e) {
  36904. return this.comp(e) <= 0
  36905. }
  36906. ,
  36907. t.lte = t.lessThanOrEqual,
  36908. t.greaterThan = function(e) {
  36909. return 0 < this.comp(e)
  36910. }
  36911. ,
  36912. t.gt = t.greaterThan,
  36913. t.greaterThanOrEqual = function(e) {
  36914. return 0 <= this.comp(e)
  36915. }
  36916. ,
  36917. t.gte = t.greaterThanOrEqual,
  36918. t.compare = function(e) {
  36919. if (p(e) || (e = m(e)),
  36920. this.eq(e))
  36921. return 0;
  36922. var t = this.isNegative()
  36923. , i = e.isNegative();
  36924. return t && !i ? -1 : !t && i ? 1 : this.unsigned ? e.high >>> 0 > this.high >>> 0 || e.high === this.high && e.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.sub(e).isNegative() ? -1 : 1
  36925. }
  36926. ,
  36927. t.comp = t.compare,
  36928. t.negate = function() {
  36929. return !this.unsigned && this.eq(E) ? E : this.not().add(c)
  36930. }
  36931. ,
  36932. t.neg = t.negate,
  36933. t.add = function(e) {
  36934. p(e) || (e = m(e));
  36935. var t = this.high >>> 16
  36936. , i = 65535 & this.high
  36937. , n = this.low >>> 16
  36938. , r = 65535 & this.low
  36939. , o = e.high >>> 16
  36940. , a = 65535 & e.high
  36941. , s = e.low >>> 16
  36942. , l = 0
  36943. , c = 0
  36944. , h = 0
  36945. , u = 0;
  36946. return h += (u += r + (65535 & e.low)) >>> 16,
  36947. c += (h += n + s) >>> 16,
  36948. l += (c += i + a) >>> 16,
  36949. l += t + o,
  36950. g((h &= 65535) << 16 | (u &= 65535), (l &= 65535) << 16 | (c &= 65535), this.unsigned)
  36951. }
  36952. ,
  36953. t.subtract = function(e) {
  36954. return p(e) || (e = m(e)),
  36955. this.add(e.neg())
  36956. }
  36957. ,
  36958. t.sub = t.subtract,
  36959. t.multiply = function(e) {
  36960. if (this.isZero())
  36961. return y;
  36962. if (p(e) || (e = m(e)),
  36963. e.isZero())
  36964. return y;
  36965. if (this.eq(E))
  36966. return e.isOdd() ? E : y;
  36967. if (e.eq(E))
  36968. return this.isOdd() ? E : y;
  36969. if (this.isNegative())
  36970. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  36971. if (e.isNegative())
  36972. return this.mul(e.neg()).neg();
  36973. if (this.lt(v) && e.lt(v))
  36974. return f(this.toNumber() * e.toNumber(), this.unsigned);
  36975. var t = this.high >>> 16
  36976. , i = 65535 & this.high
  36977. , n = this.low >>> 16
  36978. , r = 65535 & this.low
  36979. , o = e.high >>> 16
  36980. , a = 65535 & e.high
  36981. , s = e.low >>> 16
  36982. , l = 65535 & e.low
  36983. , c = 0
  36984. , h = 0
  36985. , u = 0
  36986. , d = 0;
  36987. return u += (d += r * l) >>> 16,
  36988. h += (u += n * l) >>> 16,
  36989. u &= 65535,
  36990. h += (u += r * s) >>> 16,
  36991. c += (h += i * l) >>> 16,
  36992. h &= 65535,
  36993. c += (h += n * s) >>> 16,
  36994. h &= 65535,
  36995. c += (h += r * a) >>> 16,
  36996. c += t * l + i * s + n * a + r * o,
  36997. g((u &= 65535) << 16 | (d &= 65535), (c &= 65535) << 16 | (h &= 65535), this.unsigned)
  36998. }
  36999. ,
  37000. t.mul = t.multiply,
  37001. t.divide = function(e) {
  37002. if (p(e) || (e = m(e)),
  37003. e.isZero())
  37004. throw Error("division by zero");
  37005. if (this.isZero())
  37006. return this.unsigned ? l : y;
  37007. var t, i, n;
  37008. if (this.unsigned) {
  37009. if (e.unsigned || (e = e.toUnsigned()),
  37010. e.gt(this))
  37011. return l;
  37012. if (e.gt(this.shru(1)))
  37013. return d;
  37014. n = l
  37015. } else {
  37016. if (this.eq(E))
  37017. return e.eq(c) || e.eq(A) ? E : e.eq(E) ? c : (t = this.shr(1).div(e).shl(1)).eq(y) ? e.isNegative() ? c : A : (i = this.sub(e.mul(t)),
  37018. n = t.add(i.div(e)));
  37019. if (e.eq(E))
  37020. return this.unsigned ? l : y;
  37021. if (this.isNegative())
  37022. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  37023. if (e.isNegative())
  37024. return this.div(e.neg()).neg();
  37025. n = y
  37026. }
  37027. for (i = this; i.gte(e); ) {
  37028. t = Math.max(1, Math.floor(i.toNumber() / e.toNumber()));
  37029. for (var r = Math.ceil(Math.log(t) / Math.LN2), o = r <= 48 ? 1 : u(2, r - 48), a = f(t), s = a.mul(e); s.isNegative() || s.gt(i); )
  37030. s = (a = f(t -= o, this.unsigned)).mul(e);
  37031. a.isZero() && (a = c),
  37032. n = n.add(a),
  37033. i = i.sub(s)
  37034. }
  37035. return n
  37036. }
  37037. ,
  37038. t.div = t.divide,
  37039. t.modulo = function(e) {
  37040. return p(e) || (e = m(e)),
  37041. this.sub(this.div(e).mul(e))
  37042. }
  37043. ,
  37044. t.mod = t.modulo,
  37045. t.not = function() {
  37046. return g(~this.low, ~this.high, this.unsigned)
  37047. }
  37048. ,
  37049. t.and = function(e) {
  37050. return p(e) || (e = m(e)),
  37051. g(this.low & e.low, this.high & e.high, this.unsigned)
  37052. }
  37053. ,
  37054. t.or = function(e) {
  37055. return p(e) || (e = m(e)),
  37056. g(this.low | e.low, this.high | e.high, this.unsigned)
  37057. }
  37058. ,
  37059. t.xor = function(e) {
  37060. return p(e) || (e = m(e)),
  37061. g(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  37062. }
  37063. ,
  37064. t.shiftLeft = function(e) {
  37065. return p(e) && (e = e.toInt()),
  37066. 0 == (e &= 63) ? this : e < 32 ? g(this.low << e, this.high << e | this.low >>> 32 - e, this.unsigned) : g(0, this.low << e - 32, this.unsigned)
  37067. }
  37068. ,
  37069. t.shl = t.shiftLeft,
  37070. t.shiftRight = function(e) {
  37071. return p(e) && (e = e.toInt()),
  37072. 0 == (e &= 63) ? this : e < 32 ? g(this.low >>> e | this.high << 32 - e, this.high >> e, this.unsigned) : g(this.high >> e - 32, 0 <= this.high ? 0 : -1, this.unsigned)
  37073. }
  37074. ,
  37075. t.shr = t.shiftRight,
  37076. t.shiftRightUnsigned = function(e) {
  37077. if (p(e) && (e = e.toInt()),
  37078. 0 === (e &= 63))
  37079. return this;
  37080. var t = this.high;
  37081. return e < 32 ? g(this.low >>> e | t << 32 - e, t >>> e, this.unsigned) : g(32 === e ? t : t >>> e - 32, 0, this.unsigned)
  37082. }
  37083. ,
  37084. t.shru = t.shiftRightUnsigned,
  37085. t.toSigned = function() {
  37086. return this.unsigned ? g(this.low, this.high, !1) : this
  37087. }
  37088. ,
  37089. t.toUnsigned = function() {
  37090. return this.unsigned ? this : g(this.low, this.high, !0)
  37091. }
  37092. ,
  37093. t.toBytes = function(e) {
  37094. return e ? this.toBytesLE() : this.toBytesBE()
  37095. }
  37096. ,
  37097. t.toBytesLE = function() {
  37098. var e = this.high
  37099. , t = this.low;
  37100. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  37101. }
  37102. ,
  37103. t.toBytesBE = function() {
  37104. var e = this.high
  37105. , t = this.low;
  37106. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  37107. }
  37108. ,
  37109. n
  37110. }
  37111. ,
  37112. "function" == typeof define && define.amd ? define([], r) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = r() : (n.dcodeIO = n.dcodeIO || {}).Long = r()
  37113. }
  37114. , {}],
  37115. 217: [function(e, t, i) {
  37116. var n, r, o, a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M, R, P, O, L, D, N, F, B, V, k, U, H, z, G, W, j, Y, q, X, Z, K, Q, J, $, ee, te, ie, ne, re, oe, ae, se, le, ce, he, ue, de, pe, fe, ge, me, ve, ye, Ae, Ce, Ie, Ee, _e, be, we, Te, xe, Se, Me, Re, Pe, Oe, Le, De, Ne, Fe, Be, Ve, ke, Ue, He, ze, Ge, We, je, Ye, qe, Xe, Ze, Ke, Qe, Je, $e, et, tt, it, nt, rt, ot, at, st, lt, ct, ht, ut, dt, pt, ft, gt, mt, vt, yt, At, Ct, It, Et, _t, bt, wt, Tt, xt, St, Mt, Rt, Pt, Ot, Lt, Dt, Nt, Ft, Bt, Vt, kt, Ut, Ht, zt, Gt, Wt, jt, Yt, qt, Xt, Zt, Kt, Qt, Jt, $t, ei, ti, ii, ni, ri, oi, ai, si, li, ci, hi, ui, di, pi, fi, gi, mi, vi, yi, Ai, Ci = {
  37117. REVISION: "75"
  37118. };
  37119. function Ii(e, t) {
  37120. return e.distance - t.distance
  37121. }
  37122. function Ei(e, t, i, n) {
  37123. if (!1 !== e.visible && (e.raycast(t, i),
  37124. !0 === n))
  37125. for (var r = e.children, o = 0, a = r.length; o < a; o++)
  37126. Ei(r[o], t, i, !0)
  37127. }
  37128. function _i(e, t, i) {
  37129. return i < 0 && (i += 1),
  37130. 1 < i && (i -= 1),
  37131. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  37132. }
  37133. function bi(e, t, i, n, r, o, a) {
  37134. return Ci.Triangle.barycoordFromPoint(e, t, i, n, Vt),
  37135. r.multiplyScalar(Vt.x),
  37136. o.multiplyScalar(Vt.y),
  37137. a.multiplyScalar(Vt.z),
  37138. r.add(o).add(a),
  37139. r.clone()
  37140. }
  37141. function wi(e, t, i, n, r, o, a) {
  37142. var s = e.material;
  37143. if (null === (s.side === Ci.BackSide ? i.intersectTriangle(o, r, n, !0, a) : i.intersectTriangle(n, r, o, s.side !== Ci.DoubleSide, a)))
  37144. return null;
  37145. Ut.copy(a),
  37146. Ut.applyMatrix4(e.matrixWorld);
  37147. var l = t.ray.origin.distanceTo(Ut);
  37148. return l < t.near || l > t.far ? null : {
  37149. distance: l,
  37150. point: Ut.clone(),
  37151. object: e
  37152. }
  37153. }
  37154. function Ti(e, t, i, n, r, o, a, s) {
  37155. Mt.fromArray(n, 3 * o),
  37156. Rt.fromArray(n, 3 * a),
  37157. Pt.fromArray(n, 3 * s);
  37158. var l = wi(e, t, i, Mt, Rt, Pt, kt);
  37159. return l && (r && (Nt.fromArray(r, 2 * o),
  37160. Ft.fromArray(r, 2 * a),
  37161. Bt.fromArray(r, 2 * s),
  37162. l.uv = bi(kt, Mt, Rt, Pt, Nt, Ft, Bt)),
  37163. l.face = new Ci.Face3(o,a,s,Ci.Triangle.normal(Mt, Rt, Pt)),
  37164. l.faceIndex = o),
  37165. l
  37166. }
  37167. function xi() {}
  37168. function Si(e, t, i, n, r, o) {
  37169. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E;
  37170. if (s = e[o[t]].x,
  37171. l = e[o[t]].y,
  37172. c = e[o[i]].x,
  37173. h = e[o[i]].y,
  37174. u = e[o[n]].x,
  37175. d = e[o[n]].y,
  37176. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  37177. return !1;
  37178. for (g = u - c,
  37179. m = d - h,
  37180. v = s - u,
  37181. y = l - d,
  37182. A = c - s,
  37183. C = h - l,
  37184. a = 0; a < r; a++)
  37185. if (p = e[o[a]].x,
  37186. f = e[o[a]].y,
  37187. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = A * (f - l) - C * (p - s),
  37188. E = v * (f - d) - y * (p - u),
  37189. g * (f - h) - m * (p - c) >= -Number.EPSILON && E >= -Number.EPSILON && I >= -Number.EPSILON))
  37190. return !1;
  37191. return !0
  37192. }
  37193. function Mi(e) {
  37194. switch (e) {
  37195. case Ci.LinearEncoding:
  37196. return ["Linear", "( value )"];
  37197. case Ci.sRGBEncoding:
  37198. return ["sRGB", "( value )"];
  37199. case Ci.RGBEEncoding:
  37200. return ["RGBE", "( value )"];
  37201. case Ci.RGBM7Encoding:
  37202. return ["RGBM", "( value, 7.0 )"];
  37203. case Ci.RGBM16Encoding:
  37204. return ["RGBM", "( value, 16.0 )"];
  37205. case Ci.RGBDEncoding:
  37206. return ["RGBD", "( value, 256.0 )"];
  37207. case Ci.GammaEncoding:
  37208. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  37209. default:
  37210. throw new Error("unsupported encoding: " + e)
  37211. }
  37212. }
  37213. function Ri(e, t) {
  37214. var i = Mi(t);
  37215. return "vec4 " + e + "( vec4 value ) { return " + i[0] + "ToLinear" + i[1] + "; }"
  37216. }
  37217. function Pi(e) {
  37218. return "" !== e
  37219. }
  37220. function Oi(e, t) {
  37221. 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)
  37222. }
  37223. function Li(e) {
  37224. return e.replace(/#include +<([\w\d.]+)>/g, function(e, t) {
  37225. var i = Ci.ShaderChunk[t];
  37226. if (void 0 === i)
  37227. throw new Error("Can not resolve #include <" + t + ">");
  37228. return Li(i)
  37229. })
  37230. }
  37231. function Di(e) {
  37232. return e.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, function(e, t, i, n) {
  37233. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  37234. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  37235. return r
  37236. })
  37237. }
  37238. function Ni(e, t, i, n) {
  37239. gi.set(t, i, n).unproject(mi);
  37240. var r = fi[e];
  37241. if (void 0 !== r)
  37242. for (var o = 0, a = r.length; o < a; o++)
  37243. pi.vertices[r[o]].copy(gi)
  37244. }
  37245. "function" == typeof define && define.amd ? define("three", Ci) : void 0 !== i && void 0 !== t && (t.exports = Ci),
  37246. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  37247. void 0 === Math.sign && (Math.sign = function(e) {
  37248. return e < 0 ? -1 : 0 < e ? 1 : +e
  37249. }
  37250. ),
  37251. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  37252. get: function() {
  37253. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  37254. }
  37255. }),
  37256. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  37257. writable: !0,
  37258. configurable: !0,
  37259. value: function(e) {
  37260. "use strict";
  37261. if (null == e)
  37262. throw new TypeError("Cannot convert first argument to object");
  37263. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  37264. var r = arguments[i];
  37265. if (null != r) {
  37266. r = Object(r);
  37267. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  37268. var l = o[a]
  37269. , c = Object.getOwnPropertyDescriptor(r, l);
  37270. void 0 !== c && c.enumerable && (t[l] = r[l])
  37271. }
  37272. }
  37273. }
  37274. return t
  37275. }
  37276. }),
  37277. Ci.MOUSE = {
  37278. LEFT: 0,
  37279. MIDDLE: 1,
  37280. RIGHT: 2
  37281. },
  37282. Ci.CullFaceNone = 0,
  37283. Ci.CullFaceBack = 1,
  37284. Ci.CullFaceFront = 2,
  37285. Ci.CullFaceFrontBack = 3,
  37286. Ci.FrontFaceDirectionCW = 0,
  37287. Ci.FrontFaceDirectionCCW = 1,
  37288. Ci.BasicShadowMap = 0,
  37289. Ci.PCFShadowMap = 1,
  37290. Ci.PCFSoftShadowMap = 2,
  37291. Ci.FrontSide = 0,
  37292. Ci.BackSide = 1,
  37293. Ci.DoubleSide = 2,
  37294. Ci.FlatShading = 1,
  37295. Ci.SmoothShading = 2,
  37296. Ci.NoColors = 0,
  37297. Ci.FaceColors = 1,
  37298. Ci.VertexColors = 2,
  37299. Ci.NoBlending = 0,
  37300. Ci.NormalBlending = 1,
  37301. Ci.AdditiveBlending = 2,
  37302. Ci.SubtractiveBlending = 3,
  37303. Ci.MultiplyBlending = 4,
  37304. Ci.CustomBlending = 5,
  37305. Ci.AddEquation = 100,
  37306. Ci.SubtractEquation = 101,
  37307. Ci.ReverseSubtractEquation = 102,
  37308. Ci.MinEquation = 103,
  37309. Ci.MaxEquation = 104,
  37310. Ci.ZeroFactor = 200,
  37311. Ci.OneFactor = 201,
  37312. Ci.SrcColorFactor = 202,
  37313. Ci.OneMinusSrcColorFactor = 203,
  37314. Ci.SrcAlphaFactor = 204,
  37315. Ci.OneMinusSrcAlphaFactor = 205,
  37316. Ci.DstAlphaFactor = 206,
  37317. Ci.OneMinusDstAlphaFactor = 207,
  37318. Ci.DstColorFactor = 208,
  37319. Ci.OneMinusDstColorFactor = 209,
  37320. Ci.SrcAlphaSaturateFactor = 210,
  37321. Ci.NeverDepth = 0,
  37322. Ci.AlwaysDepth = 1,
  37323. Ci.LessDepth = 2,
  37324. Ci.LessEqualDepth = 3,
  37325. Ci.EqualDepth = 4,
  37326. Ci.GreaterEqualDepth = 5,
  37327. Ci.GreaterDepth = 6,
  37328. Ci.NotEqualDepth = 7,
  37329. Ci.MultiplyOperation = 0,
  37330. Ci.MixOperation = 1,
  37331. Ci.AddOperation = 2,
  37332. Ci.NoToneMapping = 0,
  37333. Ci.LinearToneMapping = 1,
  37334. Ci.ReinhardToneMapping = 2,
  37335. Ci.Uncharted2ToneMapping = 3,
  37336. Ci.CineonToneMapping = 4,
  37337. Ci.UVMapping = 300,
  37338. Ci.CubeReflectionMapping = 301,
  37339. Ci.CubeRefractionMapping = 302,
  37340. Ci.EquirectangularReflectionMapping = 303,
  37341. Ci.EquirectangularRefractionMapping = 304,
  37342. Ci.SphericalReflectionMapping = 305,
  37343. Ci.CubeUVReflectionMapping = 306,
  37344. Ci.CubeUVRefractionMapping = 307,
  37345. Ci.RepeatWrapping = 1e3,
  37346. Ci.ClampToEdgeWrapping = 1001,
  37347. Ci.MirroredRepeatWrapping = 1002,
  37348. Ci.NearestFilter = 1003,
  37349. Ci.NearestMipMapNearestFilter = 1004,
  37350. Ci.NearestMipMapLinearFilter = 1005,
  37351. Ci.LinearFilter = 1006,
  37352. Ci.LinearMipMapNearestFilter = 1007,
  37353. Ci.LinearMipMapLinearFilter = 1008,
  37354. Ci.UnsignedByteType = 1009,
  37355. Ci.ByteType = 1010,
  37356. Ci.ShortType = 1011,
  37357. Ci.UnsignedShortType = 1012,
  37358. Ci.IntType = 1013,
  37359. Ci.UnsignedIntType = 1014,
  37360. Ci.FloatType = 1015,
  37361. Ci.HalfFloatType = 1025,
  37362. Ci.UnsignedShort4444Type = 1016,
  37363. Ci.UnsignedShort5551Type = 1017,
  37364. Ci.UnsignedShort565Type = 1018,
  37365. Ci.AlphaFormat = 1019,
  37366. Ci.RGBFormat = 1020,
  37367. Ci.RGBAFormat = 1021,
  37368. Ci.LuminanceFormat = 1022,
  37369. Ci.LuminanceAlphaFormat = 1023,
  37370. Ci.RGBEFormat = Ci.RGBAFormat,
  37371. Ci.RGB_S3TC_DXT1_Format = 2001,
  37372. Ci.RGBA_S3TC_DXT1_Format = 2002,
  37373. Ci.RGBA_S3TC_DXT3_Format = 2003,
  37374. Ci.RGBA_S3TC_DXT5_Format = 2004,
  37375. Ci.RGB_PVRTC_4BPPV1_Format = 2100,
  37376. Ci.RGB_PVRTC_2BPPV1_Format = 2101,
  37377. Ci.RGBA_PVRTC_4BPPV1_Format = 2102,
  37378. Ci.RGBA_PVRTC_2BPPV1_Format = 2103,
  37379. Ci.RGB_ETC1_Format = 2151,
  37380. Ci.LoopOnce = 2200,
  37381. Ci.LoopRepeat = 2201,
  37382. Ci.LoopPingPong = 2202,
  37383. Ci.InterpolateDiscrete = 2300,
  37384. Ci.InterpolateLinear = 2301,
  37385. Ci.InterpolateSmooth = 2302,
  37386. Ci.ZeroCurvatureEnding = 2400,
  37387. Ci.ZeroSlopeEnding = 2401,
  37388. Ci.WrapAroundEnding = 2402,
  37389. Ci.TrianglesDrawMode = 0,
  37390. Ci.TriangleStripDrawMode = 1,
  37391. Ci.TriangleFanDrawMode = 2,
  37392. Ci.LinearEncoding = 3e3,
  37393. Ci.sRGBEncoding = 3001,
  37394. Ci.GammaEncoding = 3007,
  37395. Ci.RGBEEncoding = 3002,
  37396. Ci.LogLuvEncoding = 3003,
  37397. Ci.RGBM7Encoding = 3004,
  37398. Ci.RGBM16Encoding = 3005,
  37399. Ci.RGBDEncoding = 3006,
  37400. Ci.Color = function(e) {
  37401. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  37402. }
  37403. ,
  37404. Ci.Color.prototype = {
  37405. constructor: Ci.Color,
  37406. r: 1,
  37407. g: 1,
  37408. b: 1,
  37409. set: function(e) {
  37410. return e instanceof Ci.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  37411. this
  37412. },
  37413. setScalar: function(e) {
  37414. this.r = e,
  37415. this.g = e,
  37416. this.b = e
  37417. },
  37418. setHex: function(e) {
  37419. return e = Math.floor(e),
  37420. this.r = (e >> 16 & 255) / 255,
  37421. this.g = (e >> 8 & 255) / 255,
  37422. this.b = (255 & e) / 255,
  37423. this
  37424. },
  37425. setRGB: function(e, t, i) {
  37426. return this.r = e,
  37427. this.g = t,
  37428. this.b = i,
  37429. this
  37430. },
  37431. setHSL: function(e, t, i) {
  37432. if (e = Ci.Math.euclideanModulo(e, 1),
  37433. t = Ci.Math.clamp(t, 0, 1),
  37434. i = Ci.Math.clamp(i, 0, 1),
  37435. 0 === t)
  37436. this.r = this.g = this.b = i;
  37437. else {
  37438. var n = i <= .5 ? i * (1 + t) : i + t - i * t
  37439. , r = 2 * i - n;
  37440. this.r = _i(r, n, e + 1 / 3),
  37441. this.g = _i(r, n, e),
  37442. this.b = _i(r, n, e - 1 / 3)
  37443. }
  37444. return this
  37445. },
  37446. setStyle: function(t) {
  37447. function e(e) {
  37448. void 0 !== e && parseFloat(e) < 1 && console.warn("THREE.Color: Alpha component of " + t + " will be ignored.")
  37449. }
  37450. var i;
  37451. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)) {
  37452. var n, r = i[1], o = i[2];
  37453. switch (r) {
  37454. case "rgb":
  37455. case "rgba":
  37456. if (n = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37457. return this.r = Math.min(255, parseInt(n[1], 10)) / 255,
  37458. this.g = Math.min(255, parseInt(n[2], 10)) / 255,
  37459. this.b = Math.min(255, parseInt(n[3], 10)) / 255,
  37460. e(n[5]),
  37461. this;
  37462. if (n = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37463. return this.r = Math.min(100, parseInt(n[1], 10)) / 100,
  37464. this.g = Math.min(100, parseInt(n[2], 10)) / 100,
  37465. this.b = Math.min(100, parseInt(n[3], 10)) / 100,
  37466. e(n[5]),
  37467. this;
  37468. break;
  37469. case "hsl":
  37470. case "hsla":
  37471. if (n = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) {
  37472. var a = parseFloat(n[1]) / 360
  37473. , s = parseInt(n[2], 10) / 100
  37474. , l = parseInt(n[3], 10) / 100;
  37475. return e(n[5]),
  37476. this.setHSL(a, s, l)
  37477. }
  37478. }
  37479. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(t)) {
  37480. var c, h = (c = i[1]).length;
  37481. if (3 === h)
  37482. return this.r = parseInt(c.charAt(0) + c.charAt(0), 16) / 255,
  37483. this.g = parseInt(c.charAt(1) + c.charAt(1), 16) / 255,
  37484. this.b = parseInt(c.charAt(2) + c.charAt(2), 16) / 255,
  37485. this;
  37486. if (6 === h)
  37487. return this.r = parseInt(c.charAt(0) + c.charAt(1), 16) / 255,
  37488. this.g = parseInt(c.charAt(2) + c.charAt(3), 16) / 255,
  37489. this.b = parseInt(c.charAt(4) + c.charAt(5), 16) / 255,
  37490. this
  37491. }
  37492. t && 0 < t.length && (void 0 !== (c = Ci.ColorKeywords[t]) ? this.setHex(c) : console.warn("THREE.Color: Unknown color " + t));
  37493. return this
  37494. },
  37495. clone: function() {
  37496. return new this.constructor(this.r,this.g,this.b)
  37497. },
  37498. copy: function(e) {
  37499. return this.r = e.r,
  37500. this.g = e.g,
  37501. this.b = e.b,
  37502. this
  37503. },
  37504. copyGammaToLinear: function(e, t) {
  37505. return void 0 === t && (t = 2),
  37506. this.r = Math.pow(e.r, t),
  37507. this.g = Math.pow(e.g, t),
  37508. this.b = Math.pow(e.b, t),
  37509. this
  37510. },
  37511. copyLinearToGamma: function(e, t) {
  37512. void 0 === t && (t = 2);
  37513. var i = 0 < t ? 1 / t : 1;
  37514. return this.r = Math.pow(e.r, i),
  37515. this.g = Math.pow(e.g, i),
  37516. this.b = Math.pow(e.b, i),
  37517. this
  37518. },
  37519. convertGammaToLinear: function() {
  37520. var e = this.r
  37521. , t = this.g
  37522. , i = this.b;
  37523. return this.r = e * e,
  37524. this.g = t * t,
  37525. this.b = i * i,
  37526. this
  37527. },
  37528. convertLinearToGamma: function() {
  37529. return this.r = Math.sqrt(this.r),
  37530. this.g = Math.sqrt(this.g),
  37531. this.b = Math.sqrt(this.b),
  37532. this
  37533. },
  37534. getHex: function() {
  37535. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  37536. },
  37537. getHexString: function() {
  37538. return ("000000" + this.getHex().toString(16)).slice(-6)
  37539. },
  37540. getHSL: function(e) {
  37541. var t, i, n = e || {
  37542. h: 0,
  37543. s: 0,
  37544. l: 0
  37545. }, 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;
  37546. if (l === s)
  37547. i = t = 0;
  37548. else {
  37549. var h = s - l;
  37550. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  37551. s) {
  37552. case r:
  37553. t = (o - a) / h + (o < a ? 6 : 0);
  37554. break;
  37555. case o:
  37556. t = (a - r) / h + 2;
  37557. break;
  37558. case a:
  37559. t = (r - o) / h + 4
  37560. }
  37561. t /= 6
  37562. }
  37563. return n.h = t,
  37564. n.s = i,
  37565. n.l = c,
  37566. n
  37567. },
  37568. getStyle: function() {
  37569. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  37570. },
  37571. offsetHSL: function(e, t, i) {
  37572. var n = this.getHSL();
  37573. return n.h += e,
  37574. n.s += t,
  37575. n.l += i,
  37576. this.setHSL(n.h, n.s, n.l),
  37577. this
  37578. },
  37579. add: function(e) {
  37580. return this.r += e.r,
  37581. this.g += e.g,
  37582. this.b += e.b,
  37583. this
  37584. },
  37585. addColors: function(e, t) {
  37586. return this.r = e.r + t.r,
  37587. this.g = e.g + t.g,
  37588. this.b = e.b + t.b,
  37589. this
  37590. },
  37591. addScalar: function(e) {
  37592. return this.r += e,
  37593. this.g += e,
  37594. this.b += e,
  37595. this
  37596. },
  37597. multiply: function(e) {
  37598. return this.r *= e.r,
  37599. this.g *= e.g,
  37600. this.b *= e.b,
  37601. this
  37602. },
  37603. multiplyScalar: function(e) {
  37604. return this.r *= e,
  37605. this.g *= e,
  37606. this.b *= e,
  37607. this
  37608. },
  37609. lerp: function(e, t) {
  37610. return this.r += (e.r - this.r) * t,
  37611. this.g += (e.g - this.g) * t,
  37612. this.b += (e.b - this.b) * t,
  37613. this
  37614. },
  37615. equals: function(e) {
  37616. return e.r === this.r && e.g === this.g && e.b === this.b
  37617. },
  37618. fromArray: function(e, t) {
  37619. return void 0 === t && (t = 0),
  37620. this.r = e[t],
  37621. this.g = e[t + 1],
  37622. this.b = e[t + 2],
  37623. this
  37624. },
  37625. toArray: function(e, t) {
  37626. return void 0 === e && (e = []),
  37627. void 0 === t && (t = 0),
  37628. e[t] = this.r,
  37629. e[t + 1] = this.g,
  37630. e[t + 2] = this.b,
  37631. e
  37632. }
  37633. },
  37634. Ci.ColorKeywords = {
  37635. aliceblue: 15792383,
  37636. antiquewhite: 16444375,
  37637. aqua: 65535,
  37638. aquamarine: 8388564,
  37639. azure: 15794175,
  37640. beige: 16119260,
  37641. bisque: 16770244,
  37642. black: 0,
  37643. blanchedalmond: 16772045,
  37644. blue: 255,
  37645. blueviolet: 9055202,
  37646. brown: 10824234,
  37647. burlywood: 14596231,
  37648. cadetblue: 6266528,
  37649. chartreuse: 8388352,
  37650. chocolate: 13789470,
  37651. coral: 16744272,
  37652. cornflowerblue: 6591981,
  37653. cornsilk: 16775388,
  37654. crimson: 14423100,
  37655. cyan: 65535,
  37656. darkblue: 139,
  37657. darkcyan: 35723,
  37658. darkgoldenrod: 12092939,
  37659. darkgray: 11119017,
  37660. darkgreen: 25600,
  37661. darkgrey: 11119017,
  37662. darkkhaki: 12433259,
  37663. darkmagenta: 9109643,
  37664. darkolivegreen: 5597999,
  37665. darkorange: 16747520,
  37666. darkorchid: 10040012,
  37667. darkred: 9109504,
  37668. darksalmon: 15308410,
  37669. darkseagreen: 9419919,
  37670. darkslateblue: 4734347,
  37671. darkslategray: 3100495,
  37672. darkslategrey: 3100495,
  37673. darkturquoise: 52945,
  37674. darkviolet: 9699539,
  37675. deeppink: 16716947,
  37676. deepskyblue: 49151,
  37677. dimgray: 6908265,
  37678. dimgrey: 6908265,
  37679. dodgerblue: 2003199,
  37680. firebrick: 11674146,
  37681. floralwhite: 16775920,
  37682. forestgreen: 2263842,
  37683. fuchsia: 16711935,
  37684. gainsboro: 14474460,
  37685. ghostwhite: 16316671,
  37686. gold: 16766720,
  37687. goldenrod: 14329120,
  37688. gray: 8421504,
  37689. green: 32768,
  37690. greenyellow: 11403055,
  37691. grey: 8421504,
  37692. honeydew: 15794160,
  37693. hotpink: 16738740,
  37694. indianred: 13458524,
  37695. indigo: 4915330,
  37696. ivory: 16777200,
  37697. khaki: 15787660,
  37698. lavender: 15132410,
  37699. lavenderblush: 16773365,
  37700. lawngreen: 8190976,
  37701. lemonchiffon: 16775885,
  37702. lightblue: 11393254,
  37703. lightcoral: 15761536,
  37704. lightcyan: 14745599,
  37705. lightgoldenrodyellow: 16448210,
  37706. lightgray: 13882323,
  37707. lightgreen: 9498256,
  37708. lightgrey: 13882323,
  37709. lightpink: 16758465,
  37710. lightsalmon: 16752762,
  37711. lightseagreen: 2142890,
  37712. lightskyblue: 8900346,
  37713. lightslategray: 7833753,
  37714. lightslategrey: 7833753,
  37715. lightsteelblue: 11584734,
  37716. lightyellow: 16777184,
  37717. lime: 65280,
  37718. limegreen: 3329330,
  37719. linen: 16445670,
  37720. magenta: 16711935,
  37721. maroon: 8388608,
  37722. mediumaquamarine: 6737322,
  37723. mediumblue: 205,
  37724. mediumorchid: 12211667,
  37725. mediumpurple: 9662683,
  37726. mediumseagreen: 3978097,
  37727. mediumslateblue: 8087790,
  37728. mediumspringgreen: 64154,
  37729. mediumturquoise: 4772300,
  37730. mediumvioletred: 13047173,
  37731. midnightblue: 1644912,
  37732. mintcream: 16121850,
  37733. mistyrose: 16770273,
  37734. moccasin: 16770229,
  37735. navajowhite: 16768685,
  37736. navy: 128,
  37737. oldlace: 16643558,
  37738. olive: 8421376,
  37739. olivedrab: 7048739,
  37740. orange: 16753920,
  37741. orangered: 16729344,
  37742. orchid: 14315734,
  37743. palegoldenrod: 15657130,
  37744. palegreen: 10025880,
  37745. paleturquoise: 11529966,
  37746. palevioletred: 14381203,
  37747. papayawhip: 16773077,
  37748. peachpuff: 16767673,
  37749. peru: 13468991,
  37750. pink: 16761035,
  37751. plum: 14524637,
  37752. powderblue: 11591910,
  37753. purple: 8388736,
  37754. red: 16711680,
  37755. rosybrown: 12357519,
  37756. royalblue: 4286945,
  37757. saddlebrown: 9127187,
  37758. salmon: 16416882,
  37759. sandybrown: 16032864,
  37760. seagreen: 3050327,
  37761. seashell: 16774638,
  37762. sienna: 10506797,
  37763. silver: 12632256,
  37764. skyblue: 8900331,
  37765. slateblue: 6970061,
  37766. slategray: 7372944,
  37767. slategrey: 7372944,
  37768. snow: 16775930,
  37769. springgreen: 65407,
  37770. steelblue: 4620980,
  37771. tan: 13808780,
  37772. teal: 32896,
  37773. thistle: 14204888,
  37774. tomato: 16737095,
  37775. turquoise: 4251856,
  37776. violet: 15631086,
  37777. wheat: 16113331,
  37778. white: 16777215,
  37779. whitesmoke: 16119285,
  37780. yellow: 16776960,
  37781. yellowgreen: 10145074
  37782. },
  37783. Ci.Quaternion = function(e, t, i, n) {
  37784. this._x = e || 0,
  37785. this._y = t || 0,
  37786. this._z = i || 0,
  37787. this._w = void 0 !== n ? n : 1
  37788. }
  37789. ,
  37790. Ci.Quaternion.prototype = {
  37791. constructor: Ci.Quaternion,
  37792. get x() {
  37793. return this._x
  37794. },
  37795. set x(e) {
  37796. this._x = e,
  37797. this.onChangeCallback()
  37798. },
  37799. get y() {
  37800. return this._y
  37801. },
  37802. set y(e) {
  37803. this._y = e,
  37804. this.onChangeCallback()
  37805. },
  37806. get z() {
  37807. return this._z
  37808. },
  37809. set z(e) {
  37810. this._z = e,
  37811. this.onChangeCallback()
  37812. },
  37813. get w() {
  37814. return this._w
  37815. },
  37816. set w(e) {
  37817. this._w = e,
  37818. this.onChangeCallback()
  37819. },
  37820. set: function(e, t, i, n) {
  37821. return this._x = e,
  37822. this._y = t,
  37823. this._z = i,
  37824. this._w = n,
  37825. this.onChangeCallback(),
  37826. this
  37827. },
  37828. clone: function() {
  37829. return new this.constructor(this._x,this._y,this._z,this._w)
  37830. },
  37831. toObject:function(){//add
  37832. return {x:this.x, y:this.y,z:this.z, w:this.w};
  37833. },
  37834. copy: function(e) {
  37835. return this._x = e.x,
  37836. this._y = e.y,
  37837. this._z = e.z,
  37838. this._w = e.w,
  37839. this.onChangeCallback(),
  37840. this
  37841. },
  37842. setFromEuler: function(e, t) {
  37843. if (e instanceof Ci.Euler == 0)
  37844. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  37845. var i = Math.cos(e._x / 2)
  37846. , n = Math.cos(e._y / 2)
  37847. , r = Math.cos(e._z / 2)
  37848. , o = Math.sin(e._x / 2)
  37849. , a = Math.sin(e._y / 2)
  37850. , s = Math.sin(e._z / 2)
  37851. , l = e.order;
  37852. return "XYZ" === l ? (this._x = o * n * r + i * a * s,
  37853. this._y = i * a * r - o * n * s,
  37854. this._z = i * n * s + o * a * r,
  37855. this._w = i * n * r - o * a * s) : "YXZ" === l ? (this._x = o * n * r + i * a * s,
  37856. this._y = i * a * r - o * n * s,
  37857. this._z = i * n * s - o * a * r,
  37858. this._w = i * n * r + o * a * s) : "ZXY" === l ? (this._x = o * n * r - i * a * s,
  37859. this._y = i * a * r + o * n * s,
  37860. this._z = i * n * s + o * a * r,
  37861. this._w = i * n * r - o * a * s) : "ZYX" === l ? (this._x = o * n * r - i * a * s,
  37862. this._y = i * a * r + o * n * s,
  37863. this._z = i * n * s - o * a * r,
  37864. this._w = i * n * r + o * a * s) : "YZX" === l ? (this._x = o * n * r + i * a * s,
  37865. this._y = i * a * r + o * n * s,
  37866. this._z = i * n * s - o * a * r,
  37867. this._w = i * n * r - o * a * s) : "XZY" === l && (this._x = o * n * r - i * a * s,
  37868. this._y = i * a * r - o * n * s,
  37869. this._z = i * n * s + o * a * r,
  37870. this._w = i * n * r + o * a * s),
  37871. !1 !== t && this.onChangeCallback(),
  37872. this
  37873. },
  37874. setFromAxisAngle: function(e, t) {
  37875. var i = t / 2
  37876. , n = Math.sin(i);
  37877. return this._x = e.x * n,
  37878. this._y = e.y * n,
  37879. this._z = e.z * n,
  37880. this._w = Math.cos(i),
  37881. this.onChangeCallback(),
  37882. this
  37883. },
  37884. setFromRotationMatrix: function(e) {
  37885. 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;
  37886. return 0 < d ? (t = .5 / Math.sqrt(d + 1),
  37887. this._w = .25 / t,
  37888. this._x = (h - l) * t,
  37889. this._y = (o - c) * t,
  37890. this._z = (a - r) * t) : s < n && u < n ? (t = 2 * Math.sqrt(1 + n - s - u),
  37891. this._w = (h - l) / t,
  37892. this._x = .25 * t,
  37893. this._y = (r + a) / t,
  37894. this._z = (o + c) / t) : u < s ? (t = 2 * Math.sqrt(1 + s - n - u),
  37895. this._w = (o - c) / t,
  37896. this._x = (r + a) / t,
  37897. this._y = .25 * t,
  37898. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  37899. this._w = (a - r) / t,
  37900. this._x = (o + c) / t,
  37901. this._y = (l + h) / t,
  37902. this._z = .25 * t),
  37903. this.onChangeCallback(),
  37904. this
  37905. },
  37906. setFromUnitVectors: function(e, t) {
  37907. return void 0 === Be && (Be = new Ci.Vector3),
  37908. (Ve = e.dot(t) + 1) < 1e-6 ? (Ve = 0,
  37909. Math.abs(e.x) > Math.abs(e.z) ? Be.set(-e.y, e.x, 0) : Be.set(0, -e.z, e.y)) : Be.crossVectors(e, t),
  37910. this._x = Be.x,
  37911. this._y = Be.y,
  37912. this._z = Be.z,
  37913. this._w = Ve,
  37914. this.normalize(),
  37915. this
  37916. },
  37917. inverse: function() {
  37918. return this.conjugate().normalize(),
  37919. this
  37920. },
  37921. conjugate: function() {
  37922. return this._x *= -1,
  37923. this._y *= -1,
  37924. this._z *= -1,
  37925. this.onChangeCallback(),
  37926. this
  37927. },
  37928. dot: function(e) {
  37929. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  37930. },
  37931. lengthSq: function() {
  37932. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  37933. },
  37934. length: function() {
  37935. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  37936. },
  37937. normalize: function() {
  37938. var e = this.length();
  37939. return 0 === e ? (this._x = 0,
  37940. this._y = 0,
  37941. this._z = 0,
  37942. this._w = 1) : (e = 1 / e,
  37943. this._x = this._x * e,
  37944. this._y = this._y * e,
  37945. this._z = this._z * e,
  37946. this._w = this._w * e),
  37947. this.onChangeCallback(),
  37948. this
  37949. },
  37950. multiply: function(e, t) {
  37951. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  37952. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  37953. },
  37954. multiplyQuaternions: function(e, t) {
  37955. var i = e._x
  37956. , n = e._y
  37957. , r = e._z
  37958. , o = e._w
  37959. , a = t._x
  37960. , s = t._y
  37961. , l = t._z
  37962. , c = t._w;
  37963. return this._x = i * c + o * a + n * l - r * s,
  37964. this._y = n * c + o * s + r * a - i * l,
  37965. this._z = r * c + o * l + i * s - n * a,
  37966. this._w = o * c - i * a - n * s - r * l,
  37967. this.onChangeCallback(),
  37968. this
  37969. },
  37970. slerp: function(e, t) {
  37971. if (0 === t)
  37972. return this;
  37973. if (1 === t)
  37974. return this.copy(e);
  37975. var i = this._x
  37976. , n = this._y
  37977. , r = this._z
  37978. , o = this._w
  37979. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  37980. if (a < 0 ? (this._w = -e._w,
  37981. this._x = -e._x,
  37982. this._y = -e._y,
  37983. this._z = -e._z,
  37984. a = -a) : this.copy(e),
  37985. 1 <= a)
  37986. return this._w = o,
  37987. this._x = i,
  37988. this._y = n,
  37989. this._z = r,
  37990. this;
  37991. var s = Math.sqrt(1 - a * a);
  37992. if (Math.abs(s) < .001)
  37993. return this._w = .5 * (o + this._w),
  37994. this._x = .5 * (i + this._x),
  37995. this._y = .5 * (n + this._y),
  37996. this._z = .5 * (r + this._z),
  37997. this;
  37998. var l = Math.atan2(s, a)
  37999. , c = Math.sin((1 - t) * l) / s
  38000. , h = Math.sin(t * l) / s;
  38001. return this._w = o * c + this._w * h,
  38002. this._x = i * c + this._x * h,
  38003. this._y = n * c + this._y * h,
  38004. this._z = r * c + this._z * h,
  38005. this.onChangeCallback(),
  38006. this
  38007. },
  38008. equals: function(e) {
  38009. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  38010. },
  38011. fromArray: function(e, t) {
  38012. return void 0 === t && (t = 0),
  38013. this._x = e[t],
  38014. this._y = e[t + 1],
  38015. this._z = e[t + 2],
  38016. this._w = e[t + 3],
  38017. this.onChangeCallback(),
  38018. this
  38019. },
  38020. toArray: function(e, t) {
  38021. return void 0 === e && (e = []),
  38022. void 0 === t && (t = 0),
  38023. e[t] = this._x,
  38024. e[t + 1] = this._y,
  38025. e[t + 2] = this._z,
  38026. e[t + 3] = this._w,
  38027. e
  38028. },
  38029. onChange: function(e) {
  38030. return this.onChangeCallback = e,
  38031. this
  38032. },
  38033. onChangeCallback: function() {}
  38034. },
  38035. Object.assign(Ci.Quaternion, {
  38036. slerp: function(e, t, i, n) {
  38037. return i.copy(e).slerp(t, n)
  38038. },
  38039. slerpFlat: function(e, t, i, n, r, o, a) {
  38040. var s = i[n + 0]
  38041. , l = i[n + 1]
  38042. , c = i[n + 2]
  38043. , h = i[n + 3]
  38044. , u = r[o + 0]
  38045. , d = r[o + 1]
  38046. , p = r[o + 2]
  38047. , f = r[o + 3];
  38048. if (h !== f || s !== u || l !== d || c !== p) {
  38049. var g = 1 - a
  38050. , m = s * u + l * d + c * p + h * f
  38051. , v = 0 <= m ? 1 : -1
  38052. , y = 1 - m * m;
  38053. if (y > Number.EPSILON) {
  38054. var A = Math.sqrt(y)
  38055. , C = Math.atan2(A, m * v);
  38056. g = Math.sin(g * C) / A,
  38057. a = Math.sin(a * C) / A
  38058. }
  38059. var I = a * v;
  38060. if (s = s * g + u * I,
  38061. l = l * g + d * I,
  38062. c = c * g + p * I,
  38063. h = h * g + f * I,
  38064. g === 1 - a) {
  38065. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  38066. s *= E,
  38067. l *= E,
  38068. c *= E,
  38069. h *= E
  38070. }
  38071. }
  38072. e[t] = s,
  38073. e[t + 1] = l,
  38074. e[t + 2] = c,
  38075. e[t + 3] = h
  38076. }
  38077. }),
  38078. Ci.Vector2 = function(e, t) {
  38079. this.x = e || 0,
  38080. this.y = t || 0
  38081. }
  38082. ,
  38083. Ci.Vector2.prototype = {
  38084. constructor: Ci.Vector2,
  38085. get width() {
  38086. return this.x
  38087. },
  38088. set width(e) {
  38089. this.x = e
  38090. },
  38091. get height() {
  38092. return this.y
  38093. },
  38094. set height(e) {
  38095. this.y = e
  38096. },
  38097. set: function(e, t) {
  38098. return this.x = e,
  38099. this.y = t,
  38100. this
  38101. },
  38102. setScalar: function(e) {
  38103. return this.x = e,
  38104. this.y = e,
  38105. this
  38106. },
  38107. setX: function(e) {
  38108. return this.x = e,
  38109. this
  38110. },
  38111. setY: function(e) {
  38112. return this.y = e,
  38113. this
  38114. },
  38115. setComponent: function(e, t) {
  38116. switch (e) {
  38117. case 0:
  38118. this.x = t;
  38119. break;
  38120. case 1:
  38121. this.y = t;
  38122. break;
  38123. default:
  38124. throw new Error("index is out of range: " + e)
  38125. }
  38126. },
  38127. getComponent: function(e) {
  38128. switch (e) {
  38129. case 0:
  38130. return this.x;
  38131. case 1:
  38132. return this.y;
  38133. default:
  38134. throw new Error("index is out of range: " + e)
  38135. }
  38136. },
  38137. clone: function() {
  38138. return new this.constructor(this.x,this.y)
  38139. },
  38140. copy: function(e) {
  38141. return this.x = e.x,
  38142. this.y = e.y,
  38143. this
  38144. },
  38145. add: function(e, t) {
  38146. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38147. this.addVectors(e, t)) : (this.x += e.x,
  38148. this.y += e.y,
  38149. this)
  38150. },
  38151. addScalar: function(e) {
  38152. return this.x += e,
  38153. this.y += e,
  38154. this
  38155. },
  38156. addVectors: function(e, t) {
  38157. return this.x = e.x + t.x,
  38158. this.y = e.y + t.y,
  38159. this
  38160. },
  38161. addScaledVector: function(e, t) {
  38162. return this.x += e.x * t,
  38163. this.y += e.y * t,
  38164. this
  38165. },
  38166. sub: function(e, t) {
  38167. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38168. this.subVectors(e, t)) : (this.x -= e.x,
  38169. this.y -= e.y,
  38170. this)
  38171. },
  38172. subScalar: function(e) {
  38173. return this.x -= e,
  38174. this.y -= e,
  38175. this
  38176. },
  38177. subVectors: function(e, t) {
  38178. return this.x = e.x - t.x,
  38179. this.y = e.y - t.y,
  38180. this
  38181. },
  38182. multiply: function(e) {
  38183. return this.x *= e.x,
  38184. this.y *= e.y,
  38185. this
  38186. },
  38187. multiplyScalar: function(e) {
  38188. return isFinite(e) ? (this.x *= e,
  38189. this.y *= e) : (this.x = 0,
  38190. this.y = 0),
  38191. this
  38192. },
  38193. divide: function(e) {
  38194. return this.x /= e.x,
  38195. this.y /= e.y,
  38196. this
  38197. },
  38198. divideScalar: function(e) {
  38199. return this.multiplyScalar(1 / e)
  38200. },
  38201. min: function(e) {
  38202. return this.x = Math.min(this.x, e.x),
  38203. this.y = Math.min(this.y, e.y),
  38204. this
  38205. },
  38206. max: function(e) {
  38207. return this.x = Math.max(this.x, e.x),
  38208. this.y = Math.max(this.y, e.y),
  38209. this
  38210. },
  38211. clamp: function(e, t) {
  38212. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38213. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38214. this
  38215. },
  38216. clampScalar: function(e, t) {
  38217. return void 0 === Ne && (Ne = new Ci.Vector2,
  38218. Fe = new Ci.Vector2),
  38219. Ne.set(e, e),
  38220. Fe.set(t, t),
  38221. this.clamp(Ne, Fe)
  38222. },
  38223. clampLength: function(e, t) {
  38224. var i = this.length();
  38225. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38226. this
  38227. },
  38228. floor: function() {
  38229. return this.x = Math.floor(this.x),
  38230. this.y = Math.floor(this.y),
  38231. this
  38232. },
  38233. ceil: function() {
  38234. return this.x = Math.ceil(this.x),
  38235. this.y = Math.ceil(this.y),
  38236. this
  38237. },
  38238. round: function() {
  38239. return this.x = Math.round(this.x),
  38240. this.y = Math.round(this.y),
  38241. this
  38242. },
  38243. roundToZero: function() {
  38244. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38245. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38246. this
  38247. },
  38248. negate: function() {
  38249. return this.x = -this.x,
  38250. this.y = -this.y,
  38251. this
  38252. },
  38253. dot: function(e) {
  38254. return this.x * e.x + this.y * e.y
  38255. },
  38256. lengthSq: function() {
  38257. return this.x * this.x + this.y * this.y
  38258. },
  38259. length: function() {
  38260. return Math.sqrt(this.x * this.x + this.y * this.y)
  38261. },
  38262. lengthManhattan: function() {
  38263. return Math.abs(this.x) + Math.abs(this.y)
  38264. },
  38265. normalize: function() {
  38266. return this.divideScalar(this.length())
  38267. },
  38268. angle: function() {
  38269. var e = Math.atan2(this.y, this.x);
  38270. return e < 0 && (e += 2 * Math.PI),
  38271. e
  38272. },
  38273. distanceTo: function(e) {
  38274. return Math.sqrt(this.distanceToSquared(e))
  38275. },
  38276. distanceToSquared: function(e) {
  38277. var t = this.x - e.x
  38278. , i = this.y - e.y;
  38279. return t * t + i * i
  38280. },
  38281. setLength: function(e) {
  38282. return this.multiplyScalar(e / this.length())
  38283. },
  38284. lerp: function(e, t) {
  38285. return this.x += (e.x - this.x) * t,
  38286. this.y += (e.y - this.y) * t,
  38287. this
  38288. },
  38289. lerpVectors: function(e, t, i) {
  38290. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38291. this
  38292. },
  38293. equals: function(e) {
  38294. return e.x === this.x && e.y === this.y
  38295. },
  38296. fromArray: function(e, t) {
  38297. return void 0 === t && (t = 0),
  38298. this.x = e[t],
  38299. this.y = e[t + 1],
  38300. this
  38301. },
  38302. toArray: function(e, t) {
  38303. return void 0 === e && (e = []),
  38304. void 0 === t && (t = 0),
  38305. e[t] = this.x,
  38306. e[t + 1] = this.y,
  38307. e
  38308. },
  38309. fromAttribute: function(e, t, i) {
  38310. return void 0 === i && (i = 0),
  38311. t = t * e.itemSize + i,
  38312. this.x = e.array[t],
  38313. this.y = e.array[t + 1],
  38314. this
  38315. },
  38316. rotateAround: function(e, t) {
  38317. var i = Math.cos(t)
  38318. , n = Math.sin(t)
  38319. , r = this.x - e.x
  38320. , o = this.y - e.y;
  38321. return this.x = r * i - o * n + e.x,
  38322. this.y = r * n + o * i + e.y,
  38323. this
  38324. }
  38325. },
  38326. Ci.Vector3 = function(e, t, i) {
  38327. this.x = e || 0,
  38328. this.y = t || 0,
  38329. this.z = i || 0
  38330. }
  38331. ,
  38332. Ci.Vector3.prototype = {
  38333. constructor: Ci.Vector3,
  38334. set: function(e, t, i) {
  38335. return this.x = e,
  38336. this.y = t,
  38337. this.z = i,
  38338. this
  38339. },
  38340. setScalar: function(e) {
  38341. return this.x = e,
  38342. this.y = e,
  38343. this.z = e,
  38344. this
  38345. },
  38346. setX: function(e) {
  38347. return this.x = e,
  38348. this
  38349. },
  38350. setY: function(e) {
  38351. return this.y = e,
  38352. this
  38353. },
  38354. setZ: function(e) {
  38355. return this.z = e,
  38356. this
  38357. },
  38358. setComponent: function(e, t) {
  38359. switch (e) {
  38360. case 0:
  38361. this.x = t;
  38362. break;
  38363. case 1:
  38364. this.y = t;
  38365. break;
  38366. case 2:
  38367. this.z = t;
  38368. break;
  38369. default:
  38370. throw new Error("index is out of range: " + e)
  38371. }
  38372. },
  38373. getComponent: function(e) {
  38374. switch (e) {
  38375. case 0:
  38376. return this.x;
  38377. case 1:
  38378. return this.y;
  38379. case 2:
  38380. return this.z;
  38381. default:
  38382. throw new Error("index is out of range: " + e)
  38383. }
  38384. },
  38385. clone: function() {
  38386. return new this.constructor(this.x,this.y,this.z)
  38387. },
  38388. copy: function(e) {
  38389. return this.x = e.x,
  38390. this.y = e.y,
  38391. this.z = e.z,
  38392. this
  38393. },
  38394. add: function(e, t) {
  38395. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38396. this.addVectors(e, t)) : (this.x += e.x,
  38397. this.y += e.y,
  38398. this.z += e.z,
  38399. this)
  38400. },
  38401. addScalar: function(e) {
  38402. return this.x += e,
  38403. this.y += e,
  38404. this.z += e,
  38405. this
  38406. },
  38407. addVectors: function(e, t) {
  38408. return this.x = e.x + t.x,
  38409. this.y = e.y + t.y,
  38410. this.z = e.z + t.z,
  38411. this
  38412. },
  38413. addScaledVector: function(e, t) {
  38414. return this.x += e.x * t,
  38415. this.y += e.y * t,
  38416. this.z += e.z * t,
  38417. this
  38418. },
  38419. sub: function(e, t) {
  38420. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38421. this.subVectors(e, t)) : (this.x -= e.x,
  38422. this.y -= e.y,
  38423. this.z -= e.z,
  38424. this)
  38425. },
  38426. subScalar: function(e) {
  38427. return this.x -= e,
  38428. this.y -= e,
  38429. this.z -= e,
  38430. this
  38431. },
  38432. subVectors: function(e, t) {
  38433. return this.x = e.x - t.x,
  38434. this.y = e.y - t.y,
  38435. this.z = e.z - t.z,
  38436. this
  38437. },
  38438. multiply: function(e, t) {
  38439. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  38440. this.multiplyVectors(e, t)) : (this.x *= e.x,
  38441. this.y *= e.y,
  38442. this.z *= e.z,
  38443. this)
  38444. },
  38445. multiplyScalar: function(e) {
  38446. return isFinite(e) ? (this.x *= e,
  38447. this.y *= e,
  38448. this.z *= e) : (this.x = 0,
  38449. this.y = 0,
  38450. this.z = 0),
  38451. this
  38452. },
  38453. multiplyVectors: function(e, t) {
  38454. return this.x = e.x * t.x,
  38455. this.y = e.y * t.y,
  38456. this.z = e.z * t.z,
  38457. this
  38458. },
  38459. applyEuler: function(e) {
  38460. return e instanceof Ci.Euler == 0 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  38461. void 0 === De && (De = new Ci.Quaternion),
  38462. this.applyQuaternion(De.setFromEuler(e)),
  38463. this
  38464. },
  38465. applyAxisAngle: function(e, t) {
  38466. return void 0 === Le && (Le = new Ci.Quaternion),
  38467. this.applyQuaternion(Le.setFromAxisAngle(e, t)),
  38468. this
  38469. },
  38470. applyMatrix3: function(e) {
  38471. var t = this.x
  38472. , i = this.y
  38473. , n = this.z
  38474. , r = e.elements;
  38475. return this.x = r[0] * t + r[3] * i + r[6] * n,
  38476. this.y = r[1] * t + r[4] * i + r[7] * n,
  38477. this.z = r[2] * t + r[5] * i + r[8] * n,
  38478. this
  38479. },
  38480. applyMatrix4: function(e) {
  38481. var t = this.x
  38482. , i = this.y
  38483. , n = this.z
  38484. , r = e.elements;
  38485. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  38486. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  38487. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  38488. this
  38489. },
  38490. applyProjection: function(e) {
  38491. var t = this.x
  38492. , i = this.y
  38493. , n = this.z
  38494. , r = e.elements
  38495. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  38496. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  38497. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  38498. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  38499. this
  38500. },
  38501. applyQuaternion: function(e) {
  38502. var t = this.x
  38503. , i = this.y
  38504. , n = this.z
  38505. , r = e.x
  38506. , o = e.y
  38507. , a = e.z
  38508. , s = e.w
  38509. , l = s * t + o * n - a * i
  38510. , c = s * i + a * t - r * n
  38511. , h = s * n + r * i - o * t
  38512. , u = -r * t - o * i - a * n;
  38513. return this.x = l * s + u * -r + c * -a - h * -o,
  38514. this.y = c * s + u * -o + h * -r - l * -a,
  38515. this.z = h * s + u * -a + l * -o - c * -r,
  38516. this
  38517. },
  38518. project: function(e) {
  38519. return void 0 === Oe && (Oe = new Ci.Matrix4),
  38520. Oe.multiplyMatrices(e.projectionMatrix, Oe.getInverse(e.matrixWorld)),
  38521. this.applyProjection(Oe)
  38522. },
  38523. unproject: function(e) {
  38524. return void 0 === Pe && (Pe = new Ci.Matrix4),
  38525. Pe.multiplyMatrices(e.matrixWorld, Pe.getInverse(e.projectionMatrix)),
  38526. this.applyProjection(Pe)
  38527. },
  38528. transformDirection: function(e) {
  38529. var t = this.x
  38530. , i = this.y
  38531. , n = this.z
  38532. , r = e.elements;
  38533. return this.x = r[0] * t + r[4] * i + r[8] * n,
  38534. this.y = r[1] * t + r[5] * i + r[9] * n,
  38535. this.z = r[2] * t + r[6] * i + r[10] * n,
  38536. this.normalize(),
  38537. this
  38538. },
  38539. divide: function(e) {
  38540. return this.x /= e.x,
  38541. this.y /= e.y,
  38542. this.z /= e.z,
  38543. this
  38544. },
  38545. divideScalar: function(e) {
  38546. return this.multiplyScalar(1 / e)
  38547. },
  38548. min: function(e) {
  38549. return this.x = Math.min(this.x, e.x),
  38550. this.y = Math.min(this.y, e.y),
  38551. this.z = Math.min(this.z, e.z),
  38552. this
  38553. },
  38554. max: function(e) {
  38555. return this.x = Math.max(this.x, e.x),
  38556. this.y = Math.max(this.y, e.y),
  38557. this.z = Math.max(this.z, e.z),
  38558. this
  38559. },
  38560. clamp: function(e, t) {
  38561. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38562. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38563. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38564. this
  38565. },
  38566. clampScalar: function(e, t) {
  38567. return void 0 === Me && (Me = new Ci.Vector3,
  38568. Re = new Ci.Vector3),
  38569. Me.set(e, e, e),
  38570. Re.set(t, t, t),
  38571. this.clamp(Me, Re)
  38572. },
  38573. clampLength: function(e, t) {
  38574. var i = this.length();
  38575. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38576. this
  38577. },
  38578. floor: function() {
  38579. return this.x = Math.floor(this.x),
  38580. this.y = Math.floor(this.y),
  38581. this.z = Math.floor(this.z),
  38582. this
  38583. },
  38584. ceil: function() {
  38585. return this.x = Math.ceil(this.x),
  38586. this.y = Math.ceil(this.y),
  38587. this.z = Math.ceil(this.z),
  38588. this
  38589. },
  38590. round: function() {
  38591. return this.x = Math.round(this.x),
  38592. this.y = Math.round(this.y),
  38593. this.z = Math.round(this.z),
  38594. this
  38595. },
  38596. roundToZero: function() {
  38597. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38598. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38599. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38600. this
  38601. },
  38602. negate: function() {
  38603. return this.x = -this.x,
  38604. this.y = -this.y,
  38605. this.z = -this.z,
  38606. this
  38607. },
  38608. dot: function(e) {
  38609. return this.x * e.x + this.y * e.y + this.z * e.z
  38610. },
  38611. lengthSq: function() {
  38612. return this.x * this.x + this.y * this.y + this.z * this.z
  38613. },
  38614. length: function() {
  38615. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  38616. },
  38617. lengthManhattan: function() {
  38618. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  38619. },
  38620. normalize: function() {
  38621. return this.divideScalar(this.length())
  38622. },
  38623. setLength: function(e) {
  38624. return this.multiplyScalar(e / this.length())
  38625. },
  38626. lerp: function(e, t) {
  38627. return this.x += (e.x - this.x) * t,
  38628. this.y += (e.y - this.y) * t,
  38629. this.z += (e.z - this.z) * t,
  38630. this
  38631. },
  38632. lerpVectors: function(e, t, i) {
  38633. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38634. this
  38635. },
  38636. cross: function(e, t) {
  38637. if (void 0 !== t)
  38638. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  38639. this.crossVectors(e, t);
  38640. var i = this.x
  38641. , n = this.y
  38642. , r = this.z;
  38643. return this.x = n * e.z - r * e.y,
  38644. this.y = r * e.x - i * e.z,
  38645. this.z = i * e.y - n * e.x,
  38646. this
  38647. },
  38648. crossVectors: function(e, t) {
  38649. var i = e.x
  38650. , n = e.y
  38651. , r = e.z
  38652. , o = t.x
  38653. , a = t.y
  38654. , s = t.z;
  38655. return this.x = n * s - r * a,
  38656. this.y = r * o - i * s,
  38657. this.z = i * a - n * o,
  38658. this
  38659. },
  38660. projectOnVector: function(e) {
  38661. return void 0 === xe && (xe = new Ci.Vector3),
  38662. xe.copy(e).normalize(),
  38663. Se = this.dot(xe),
  38664. this.copy(xe).multiplyScalar(Se)
  38665. },
  38666. projectOnPlane: function(e) {
  38667. return void 0 === Te && (Te = new Ci.Vector3),
  38668. Te.copy(this).projectOnVector(e),
  38669. this.sub(Te)
  38670. },
  38671. reflect: function(e) {
  38672. return void 0 === we && (we = new Ci.Vector3),
  38673. this.sub(we.copy(e).multiplyScalar(2 * this.dot(e)))
  38674. },
  38675. angleTo: function(e) {
  38676. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  38677. return Math.acos(Ci.Math.clamp(t, -1, 1))
  38678. },
  38679. distanceTo: function(e) {
  38680. return Math.sqrt(this.distanceToSquared(e))
  38681. },
  38682. distanceToSquared: function(e) {
  38683. var t = this.x - e.x
  38684. , i = this.y - e.y
  38685. , n = this.z - e.z;
  38686. return t * t + i * i + n * n
  38687. },
  38688. setFromSpherical: function(e) {
  38689. var t = Math.sin(e.phi) * e.radius;
  38690. return this.x = t * Math.sin(e.theta),
  38691. this.y = Math.cos(e.phi) * e.radius,
  38692. this.z = t * Math.cos(e.theta),
  38693. this
  38694. },
  38695. setFromMatrixPosition: function(e) {
  38696. return this.setFromMatrixColumn(e, 3)
  38697. },
  38698. setFromMatrixScale: function(e) {
  38699. var t = this.setFromMatrixColumn(e, 0).length()
  38700. , i = this.setFromMatrixColumn(e, 1).length()
  38701. , n = this.setFromMatrixColumn(e, 2).length();
  38702. return this.x = t,
  38703. this.y = i,
  38704. this.z = n,
  38705. this
  38706. },
  38707. setFromMatrixColumn: function(e, t) {
  38708. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  38709. t = e = t),
  38710. this.fromArray(e.elements, 4 * t)
  38711. },
  38712. equals: function(e) {
  38713. return e.x === this.x && e.y === this.y && e.z === this.z
  38714. },
  38715. fromArray: function(e, t) {
  38716. return void 0 === t && (t = 0),
  38717. this.x = e[t],
  38718. this.y = e[t + 1],
  38719. this.z = e[t + 2],
  38720. this
  38721. },
  38722. toArray: function(e, t) {
  38723. return void 0 === e && (e = []),
  38724. void 0 === t && (t = 0),
  38725. e[t] = this.x,
  38726. e[t + 1] = this.y,
  38727. e[t + 2] = this.z,
  38728. e
  38729. },
  38730. fromAttribute: function(e, t, i) {
  38731. return void 0 === i && (i = 0),
  38732. t = t * e.itemSize + i,
  38733. this.x = e.array[t],
  38734. this.y = e.array[t + 1],
  38735. this.z = e.array[t + 2],
  38736. this
  38737. }
  38738. },
  38739. Ci.Vector4 = function(e, t, i, n) {
  38740. this.x = e || 0,
  38741. this.y = t || 0,
  38742. this.z = i || 0,
  38743. this.w = void 0 !== n ? n : 1
  38744. }
  38745. ,
  38746. Ci.Vector4.prototype = {
  38747. constructor: Ci.Vector4,
  38748. set: function(e, t, i, n) {
  38749. return this.x = e,
  38750. this.y = t,
  38751. this.z = i,
  38752. this.w = n,
  38753. this
  38754. },
  38755. setScalar: function(e) {
  38756. return this.x = e,
  38757. this.y = e,
  38758. this.z = e,
  38759. this.w = e,
  38760. this
  38761. },
  38762. setX: function(e) {
  38763. return this.x = e,
  38764. this
  38765. },
  38766. setY: function(e) {
  38767. return this.y = e,
  38768. this
  38769. },
  38770. setZ: function(e) {
  38771. return this.z = e,
  38772. this
  38773. },
  38774. setW: function(e) {
  38775. return this.w = e,
  38776. this
  38777. },
  38778. setComponent: function(e, t) {
  38779. switch (e) {
  38780. case 0:
  38781. this.x = t;
  38782. break;
  38783. case 1:
  38784. this.y = t;
  38785. break;
  38786. case 2:
  38787. this.z = t;
  38788. break;
  38789. case 3:
  38790. this.w = t;
  38791. break;
  38792. default:
  38793. throw new Error("index is out of range: " + e)
  38794. }
  38795. },
  38796. getComponent: function(e) {
  38797. switch (e) {
  38798. case 0:
  38799. return this.x;
  38800. case 1:
  38801. return this.y;
  38802. case 2:
  38803. return this.z;
  38804. case 3:
  38805. return this.w;
  38806. default:
  38807. throw new Error("index is out of range: " + e)
  38808. }
  38809. },
  38810. clone: function() {
  38811. return new this.constructor(this.x,this.y,this.z,this.w)
  38812. },
  38813. copy: function(e) {
  38814. return this.x = e.x,
  38815. this.y = e.y,
  38816. this.z = e.z,
  38817. this.w = void 0 !== e.w ? e.w : 1,
  38818. this
  38819. },
  38820. add: function(e, t) {
  38821. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38822. this.addVectors(e, t)) : (this.x += e.x,
  38823. this.y += e.y,
  38824. this.z += e.z,
  38825. this.w += e.w,
  38826. this)
  38827. },
  38828. addScalar: function(e) {
  38829. return this.x += e,
  38830. this.y += e,
  38831. this.z += e,
  38832. this.w += e,
  38833. this
  38834. },
  38835. addVectors: function(e, t) {
  38836. return this.x = e.x + t.x,
  38837. this.y = e.y + t.y,
  38838. this.z = e.z + t.z,
  38839. this.w = e.w + t.w,
  38840. this
  38841. },
  38842. addScaledVector: function(e, t) {
  38843. return this.x += e.x * t,
  38844. this.y += e.y * t,
  38845. this.z += e.z * t,
  38846. this.w += e.w * t,
  38847. this
  38848. },
  38849. sub: function(e, t) {
  38850. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38851. this.subVectors(e, t)) : (this.x -= e.x,
  38852. this.y -= e.y,
  38853. this.z -= e.z,
  38854. this.w -= e.w,
  38855. this)
  38856. },
  38857. subScalar: function(e) {
  38858. return this.x -= e,
  38859. this.y -= e,
  38860. this.z -= e,
  38861. this.w -= e,
  38862. this
  38863. },
  38864. subVectors: function(e, t) {
  38865. return this.x = e.x - t.x,
  38866. this.y = e.y - t.y,
  38867. this.z = e.z - t.z,
  38868. this.w = e.w - t.w,
  38869. this
  38870. },
  38871. multiplyScalar: function(e) {
  38872. return isFinite(e) ? (this.x *= e,
  38873. this.y *= e,
  38874. this.z *= e,
  38875. this.w *= e) : (this.x = 0,
  38876. this.y = 0,
  38877. this.z = 0,
  38878. this.w = 0),
  38879. this
  38880. },
  38881. applyMatrix4: function(e) {
  38882. var t = this.x
  38883. , i = this.y
  38884. , n = this.z
  38885. , r = this.w
  38886. , o = e.elements;
  38887. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  38888. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  38889. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  38890. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  38891. this
  38892. },
  38893. divideScalar: function(e) {
  38894. return this.multiplyScalar(1 / e)
  38895. },
  38896. setAxisAngleFromQuaternion: function(e) {
  38897. this.w = 2 * Math.acos(e.w);
  38898. var t = Math.sqrt(1 - e.w * e.w);
  38899. return t < 1e-4 ? (this.x = 1,
  38900. this.y = 0,
  38901. this.z = 0) : (this.x = e.x / t,
  38902. this.y = e.y / t,
  38903. this.z = e.z / t),
  38904. this
  38905. },
  38906. setAxisAngleFromRotationMatrix: function(e) {
  38907. var t, i, n, r, o = e.elements, a = o[0], s = o[4], l = o[8], c = o[1], h = o[5], u = o[9], d = o[2], p = o[6], f = o[10];
  38908. if (Math.abs(s - c) < .01 && Math.abs(l - d) < .01 && Math.abs(u - p) < .01) {
  38909. if (Math.abs(s + c) < .1 && Math.abs(l + d) < .1 && Math.abs(u + p) < .1 && Math.abs(a + h + f - 3) < .1)
  38910. return this.set(1, 0, 0, 0),
  38911. this;
  38912. t = Math.PI;
  38913. var g = (a + 1) / 2
  38914. , m = (h + 1) / 2
  38915. , v = (f + 1) / 2
  38916. , y = (s + c) / 4
  38917. , A = (l + d) / 4
  38918. , C = (u + p) / 4;
  38919. return m < g && v < g ? r = g < .01 ? (i = 0,
  38920. n = .707106781) : (n = y / (i = Math.sqrt(g)),
  38921. A / i) : v < m ? r = m < .01 ? (n = 0,
  38922. i = .707106781) : (i = y / (n = Math.sqrt(m)),
  38923. C / n) : v < .01 ? (n = i = .707106781,
  38924. r = 0) : (i = A / (r = Math.sqrt(v)),
  38925. n = C / r),
  38926. this.set(i, n, r, t),
  38927. this
  38928. }
  38929. var I = Math.sqrt((p - u) * (p - u) + (l - d) * (l - d) + (c - s) * (c - s));
  38930. return Math.abs(I) < .001 && (I = 1),
  38931. this.x = (p - u) / I,
  38932. this.y = (l - d) / I,
  38933. this.z = (c - s) / I,
  38934. this.w = Math.acos((a + h + f - 1) / 2),
  38935. this
  38936. },
  38937. min: function(e) {
  38938. return this.x = Math.min(this.x, e.x),
  38939. this.y = Math.min(this.y, e.y),
  38940. this.z = Math.min(this.z, e.z),
  38941. this.w = Math.min(this.w, e.w),
  38942. this
  38943. },
  38944. max: function(e) {
  38945. return this.x = Math.max(this.x, e.x),
  38946. this.y = Math.max(this.y, e.y),
  38947. this.z = Math.max(this.z, e.z),
  38948. this.w = Math.max(this.w, e.w),
  38949. this
  38950. },
  38951. clamp: function(e, t) {
  38952. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38953. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38954. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38955. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  38956. this
  38957. },
  38958. clampScalar: function(e, t) {
  38959. return void 0 === _e && (_e = new Ci.Vector4,
  38960. be = new Ci.Vector4),
  38961. _e.set(e, e, e, e),
  38962. be.set(t, t, t, t),
  38963. this.clamp(_e, be)
  38964. },
  38965. floor: function() {
  38966. return this.x = Math.floor(this.x),
  38967. this.y = Math.floor(this.y),
  38968. this.z = Math.floor(this.z),
  38969. this.w = Math.floor(this.w),
  38970. this
  38971. },
  38972. ceil: function() {
  38973. return this.x = Math.ceil(this.x),
  38974. this.y = Math.ceil(this.y),
  38975. this.z = Math.ceil(this.z),
  38976. this.w = Math.ceil(this.w),
  38977. this
  38978. },
  38979. round: function() {
  38980. return this.x = Math.round(this.x),
  38981. this.y = Math.round(this.y),
  38982. this.z = Math.round(this.z),
  38983. this.w = Math.round(this.w),
  38984. this
  38985. },
  38986. roundToZero: function() {
  38987. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38988. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38989. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38990. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  38991. this
  38992. },
  38993. negate: function() {
  38994. return this.x = -this.x,
  38995. this.y = -this.y,
  38996. this.z = -this.z,
  38997. this.w = -this.w,
  38998. this
  38999. },
  39000. dot: function(e) {
  39001. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  39002. },
  39003. lengthSq: function() {
  39004. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  39005. },
  39006. length: function() {
  39007. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  39008. },
  39009. lengthManhattan: function() {
  39010. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  39011. },
  39012. normalize: function() {
  39013. return this.divideScalar(this.length())
  39014. },
  39015. setLength: function(e) {
  39016. return this.multiplyScalar(e / this.length())
  39017. },
  39018. lerp: function(e, t) {
  39019. return this.x += (e.x - this.x) * t,
  39020. this.y += (e.y - this.y) * t,
  39021. this.z += (e.z - this.z) * t,
  39022. this.w += (e.w - this.w) * t,
  39023. this
  39024. },
  39025. lerpVectors: function(e, t, i) {
  39026. return this.subVectors(t, e).multiplyScalar(i).add(e),
  39027. this
  39028. },
  39029. equals: function(e) {
  39030. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  39031. },
  39032. fromArray: function(e, t) {
  39033. return void 0 === t && (t = 0),
  39034. this.x = e[t],
  39035. this.y = e[t + 1],
  39036. this.z = e[t + 2],
  39037. this.w = e[t + 3],
  39038. this
  39039. },
  39040. toArray: function(e, t) {
  39041. return void 0 === e && (e = []),
  39042. void 0 === t && (t = 0),
  39043. e[t] = this.x,
  39044. e[t + 1] = this.y,
  39045. e[t + 2] = this.z,
  39046. e[t + 3] = this.w,
  39047. e
  39048. },
  39049. fromAttribute: function(e, t, i) {
  39050. return void 0 === i && (i = 0),
  39051. t = t * e.itemSize + i,
  39052. this.x = e.array[t],
  39053. this.y = e.array[t + 1],
  39054. this.z = e.array[t + 2],
  39055. this.w = e.array[t + 3],
  39056. this
  39057. }
  39058. },
  39059. Ci.Euler = function(e, t, i, n) {
  39060. this._x = e || 0,
  39061. this._y = t || 0,
  39062. this._z = i || 0,
  39063. this._order = n || Ci.Euler.DefaultOrder
  39064. }
  39065. ,
  39066. Ci.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  39067. Ci.Euler.DefaultOrder = "XYZ",
  39068. Ci.Euler.prototype = {
  39069. constructor: Ci.Euler,
  39070. get x() {
  39071. return this._x
  39072. },
  39073. set x(e) {
  39074. this._x = e,
  39075. this.onChangeCallback()
  39076. },
  39077. get y() {
  39078. return this._y
  39079. },
  39080. set y(e) {
  39081. this._y = e,
  39082. this.onChangeCallback()
  39083. },
  39084. get z() {
  39085. return this._z
  39086. },
  39087. set z(e) {
  39088. this._z = e,
  39089. this.onChangeCallback()
  39090. },
  39091. get order() {
  39092. return this._order
  39093. },
  39094. set order(e) {
  39095. this._order = e,
  39096. this.onChangeCallback()
  39097. },
  39098. set: function(e, t, i, n) {
  39099. return this._x = e,
  39100. this._y = t,
  39101. this._z = i,
  39102. this._order = n || this._order,
  39103. this.onChangeCallback(),
  39104. this
  39105. },
  39106. clone: function() {
  39107. return new this.constructor(this._x,this._y,this._z,this._order)
  39108. },
  39109. copy: function(e) {
  39110. return this._x = e._x,
  39111. this._y = e._y,
  39112. this._z = e._z,
  39113. this._order = e._order,
  39114. this.onChangeCallback(),
  39115. this
  39116. },
  39117. toObject: function() {//xzw
  39118. return {x:this.x,y:this.y,z:this.z}
  39119. },
  39120. setFromRotationMatrix: function(e, t, i) {
  39121. var n = Ci.Math.clamp
  39122. , r = e.elements
  39123. , o = r[0]
  39124. , a = r[4]
  39125. , s = r[8]
  39126. , l = r[1]
  39127. , c = r[5]
  39128. , h = r[9]
  39129. , u = r[2]
  39130. , d = r[6]
  39131. , p = r[10];
  39132. return "XYZ" === (t = t || this._order) ? (this._y = Math.asin(n(s, -1, 1)),
  39133. Math.abs(s) < .99999 ? (this._x = Math.atan2(-h, p),
  39134. this._z = Math.atan2(-a, o)) : (this._x = Math.atan2(d, c),
  39135. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-n(h, -1, 1)),
  39136. Math.abs(h) < .99999 ? (this._y = Math.atan2(s, p),
  39137. this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, o),
  39138. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(n(d, -1, 1)),
  39139. Math.abs(d) < .99999 ? (this._y = Math.atan2(-u, p),
  39140. this._z = Math.atan2(-a, c)) : (this._y = 0,
  39141. this._z = Math.atan2(l, o))) : "ZYX" === t ? (this._y = Math.asin(-n(u, -1, 1)),
  39142. Math.abs(u) < .99999 ? (this._x = Math.atan2(d, p),
  39143. this._z = Math.atan2(l, o)) : (this._x = 0,
  39144. this._z = Math.atan2(-a, c))) : "YZX" === t ? (this._z = Math.asin(n(l, -1, 1)),
  39145. Math.abs(l) < .99999 ? (this._x = Math.atan2(-h, c),
  39146. this._y = Math.atan2(-u, o)) : (this._x = 0,
  39147. this._y = Math.atan2(s, p))) : "XZY" === t ? (this._z = Math.asin(-n(a, -1, 1)),
  39148. Math.abs(a) < .99999 ? (this._x = Math.atan2(d, c),
  39149. this._y = Math.atan2(s, o)) : (this._x = Math.atan2(-h, p),
  39150. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  39151. this._order = t,
  39152. !1 !== i && this.onChangeCallback(),
  39153. this
  39154. },
  39155. setFromQuaternion: function(e, t, i) {
  39156. return void 0 === Ee && (Ee = new Ci.Matrix4),
  39157. Ee.makeRotationFromQuaternion(e),
  39158. this.setFromRotationMatrix(Ee, t, i),
  39159. this
  39160. },
  39161. setFromVector3: function(e, t) {
  39162. return this.set(e.x, e.y, e.z, t || this._order)
  39163. },
  39164. reorder: (Ie = new Ci.Quaternion,
  39165. function(e) {
  39166. Ie.setFromEuler(this),
  39167. this.setFromQuaternion(Ie, e)
  39168. }
  39169. ),
  39170. equals: function(e) {
  39171. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  39172. },
  39173. fromArray: function(e) {
  39174. return this._x = e[0],
  39175. this._y = e[1],
  39176. this._z = e[2],
  39177. void 0 !== e[3] && (this._order = e[3]),
  39178. this.onChangeCallback(),
  39179. this
  39180. },
  39181. toArray: function(e, t) {
  39182. return void 0 === e && (e = []),
  39183. void 0 === t && (t = 0),
  39184. e[t] = this._x,
  39185. e[t + 1] = this._y,
  39186. e[t + 2] = this._z,
  39187. e[t + 3] = this._order,
  39188. e
  39189. },
  39190. toVector3: function(e) {
  39191. return e ? e.set(this._x, this._y, this._z) : new Ci.Vector3(this._x,this._y,this._z)
  39192. },
  39193. onChange: function(e) {
  39194. return this.onChangeCallback = e,
  39195. this
  39196. },
  39197. onChangeCallback: function() {}
  39198. },
  39199. Ci.Line3 = function(e, t) {
  39200. this.start = void 0 !== e ? e : new Ci.Vector3,
  39201. this.end = void 0 !== t ? t : new Ci.Vector3
  39202. }
  39203. ,
  39204. Ci.Line3.prototype = {
  39205. constructor: Ci.Line3,
  39206. set: function(e, t) {
  39207. return this.start.copy(e),
  39208. this.end.copy(t),
  39209. this
  39210. },
  39211. clone: function() {
  39212. return (new this.constructor).copy(this)
  39213. },
  39214. copy: function(e) {
  39215. return this.start.copy(e.start),
  39216. this.end.copy(e.end),
  39217. this
  39218. },
  39219. center: function(e) {
  39220. return (e || new Ci.Vector3).addVectors(this.start, this.end).multiplyScalar(.5)
  39221. },
  39222. delta: function(e) {
  39223. return (e || new Ci.Vector3).subVectors(this.end, this.start)
  39224. },
  39225. distanceSq: function() {
  39226. return this.start.distanceToSquared(this.end)
  39227. },
  39228. distance: function() {
  39229. return this.start.distanceTo(this.end)
  39230. },
  39231. at: function(e, t) {
  39232. var i = t || new Ci.Vector3;
  39233. return this.delta(i).multiplyScalar(e).add(this.start)
  39234. },
  39235. closestPointToPointParameter: (Ae = new Ci.Vector3,
  39236. Ce = new Ci.Vector3,
  39237. function(e, t) {
  39238. Ae.subVectors(e, this.start),
  39239. Ce.subVectors(this.end, this.start);
  39240. var i = Ce.dot(Ce)
  39241. , n = Ce.dot(Ae) / i;
  39242. return t && (n = Ci.Math.clamp(n, 0, 1)),
  39243. n
  39244. }
  39245. ),
  39246. closestPointToPoint: function(e, t, i) {
  39247. var n = this.closestPointToPointParameter(e, t)
  39248. , r = i || new Ci.Vector3;
  39249. return this.delta(r).multiplyScalar(n).add(this.start)
  39250. },
  39251. applyMatrix4: function(e) {
  39252. return this.start.applyMatrix4(e),
  39253. this.end.applyMatrix4(e),
  39254. this
  39255. },
  39256. equals: function(e) {
  39257. return e.start.equals(this.start) && e.end.equals(this.end)
  39258. }
  39259. },
  39260. Ci.Box2 = function(e, t) {
  39261. this.min = void 0 !== e ? e : new Ci.Vector2(1 / 0,1 / 0),
  39262. this.max = void 0 !== t ? t : new Ci.Vector2(-1 / 0,-1 / 0)
  39263. }
  39264. ,
  39265. Ci.Box2.prototype = {
  39266. constructor: Ci.Box2,
  39267. set: function(e, t) {
  39268. return this.min.copy(e),
  39269. this.max.copy(t),
  39270. this
  39271. },
  39272. setFromPoints: function(e) {
  39273. this.makeEmpty();
  39274. for (var t = 0, i = e.length; t < i; t++)
  39275. this.expandByPoint(e[t]);
  39276. return this
  39277. },
  39278. setFromCenterAndSize: (ye = new Ci.Vector2,
  39279. function(e, t) {
  39280. var i = ye.copy(t).multiplyScalar(.5);
  39281. return this.min.copy(e).sub(i),
  39282. this.max.copy(e).add(i),
  39283. this
  39284. }
  39285. ),
  39286. clone: function() {
  39287. return (new this.constructor).copy(this)
  39288. },
  39289. copy: function(e) {
  39290. return this.min.copy(e.min),
  39291. this.max.copy(e.max),
  39292. this
  39293. },
  39294. makeEmpty: function() {
  39295. return this.min.x = this.min.y = 1 / 0,
  39296. this.max.x = this.max.y = -1 / 0,
  39297. this
  39298. },
  39299. isEmpty: function() {
  39300. return this.max.x < this.min.x || this.max.y < this.min.y
  39301. },
  39302. center: function(e) {
  39303. return (e || new Ci.Vector2).addVectors(this.min, this.max).multiplyScalar(.5)
  39304. },
  39305. size: function(e) {
  39306. return (e || new Ci.Vector2).subVectors(this.max, this.min)
  39307. },
  39308. expandByPoint: function(e) {
  39309. return this.min.min(e),
  39310. this.max.max(e),
  39311. this
  39312. },
  39313. expandByVector: function(e) {
  39314. return this.min.sub(e),
  39315. this.max.add(e),
  39316. this
  39317. },
  39318. expandByScalar: function(e) {
  39319. return this.min.addScalar(-e),
  39320. this.max.addScalar(e),
  39321. this
  39322. },
  39323. containsPoint: function(e) {
  39324. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  39325. },
  39326. containsBox: function(e) {
  39327. 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
  39328. },
  39329. getParameter: function(e, t) {
  39330. return (t || new Ci.Vector2).set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y))
  39331. },
  39332. intersectsBox: function(e) {
  39333. 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)
  39334. },
  39335. clampPoint: function(e, t) {
  39336. return (t || new Ci.Vector2).copy(e).clamp(this.min, this.max)
  39337. },
  39338. distanceToPoint: (ve = new Ci.Vector2,
  39339. function(e) {
  39340. return ve.copy(e).clamp(this.min, this.max).sub(e).length()
  39341. }
  39342. ),
  39343. intersect: function(e) {
  39344. return this.min.max(e.min),
  39345. this.max.min(e.max),
  39346. this
  39347. },
  39348. union: function(e) {
  39349. return this.min.min(e.min),
  39350. this.max.max(e.max),
  39351. this
  39352. },
  39353. translate: function(e) {
  39354. return this.min.add(e),
  39355. this.max.add(e),
  39356. this
  39357. },
  39358. equals: function(e) {
  39359. return e.min.equals(this.min) && e.max.equals(this.max)
  39360. }
  39361. },
  39362. Ci.Box3 = function(e, t) {
  39363. this.min = void 0 !== e ? e : new Ci.Vector3(1 / 0,1 / 0,1 / 0),
  39364. this.max = void 0 !== t ? t : new Ci.Vector3(-1 / 0,-1 / 0,-1 / 0)
  39365. }
  39366. ,
  39367. Ci.Box3.prototype = {
  39368. constructor: Ci.Box3,
  39369. set: function(e, t) {
  39370. return this.min.copy(e),
  39371. this.max.copy(t),
  39372. this
  39373. },
  39374. setFromArray: function(e) {
  39375. this.makeEmpty();
  39376. 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) {
  39377. var c = e[s]
  39378. , h = e[s + 1]
  39379. , u = e[s + 2];
  39380. c < t && (t = c),
  39381. h < i && (i = h),
  39382. u < n && (n = u),
  39383. r < c && (r = c),
  39384. o < h && (o = h),
  39385. a < u && (a = u)
  39386. }
  39387. this.min.set(t, i, n),
  39388. this.max.set(r, o, a)
  39389. },
  39390. setFromPoints: function(e) {
  39391. this.makeEmpty();
  39392. for (var t = 0, i = e.length; t < i; t++)
  39393. this.expandByPoint(e[t]);
  39394. return this
  39395. },
  39396. setFromCenterAndSize: (me = new Ci.Vector3,
  39397. function(e, t) {
  39398. var i = me.copy(t).multiplyScalar(.5);
  39399. return this.min.copy(e).sub(i),
  39400. this.max.copy(e).add(i),
  39401. this
  39402. }
  39403. ),
  39404. setFromObject: function(e) {
  39405. void 0 === ge && (ge = new Ci.Box3);
  39406. var i = this;
  39407. return this.makeEmpty(),
  39408. e.updateMatrixWorld(!0),
  39409. e.traverse(function(e) {
  39410. var t = e.geometry;
  39411. void 0 !== t && (null === t.boundingBox && t.computeBoundingBox(),
  39412. !1 === t.boundingBox.isEmpty() && (ge.copy(t.boundingBox),
  39413. ge.applyMatrix4(e.matrixWorld),
  39414. i.union(ge)))
  39415. }),
  39416. this
  39417. },
  39418. clone: function() {
  39419. return (new this.constructor).copy(this)
  39420. },
  39421. copy: function(e) {
  39422. return this.min.copy(e.min),
  39423. this.max.copy(e.max),
  39424. this
  39425. },
  39426. makeEmpty: function() {
  39427. return this.min.x = this.min.y = this.min.z = 1 / 0,
  39428. this.max.x = this.max.y = this.max.z = -1 / 0,
  39429. this
  39430. },
  39431. isEmpty: function() {
  39432. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  39433. },
  39434. center: function(e) {
  39435. return (e || new Ci.Vector3).addVectors(this.min, this.max).multiplyScalar(.5)
  39436. },
  39437. size: function(e) {
  39438. return (e || new Ci.Vector3).subVectors(this.max, this.min)
  39439. },
  39440. expandByPoint: function(e) {
  39441. return this.min.min(e),
  39442. this.max.max(e),
  39443. this
  39444. },
  39445. expandByVector: function(e) {
  39446. return this.min.sub(e),
  39447. this.max.add(e),
  39448. this
  39449. },
  39450. expandByScalar: function(e) {
  39451. return this.min.addScalar(-e),
  39452. this.max.addScalar(e),
  39453. this
  39454. },
  39455. containsPoint: function(e) {
  39456. 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)
  39457. },
  39458. containsBox: function(e) {
  39459. 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
  39460. },
  39461. getParameter: function(e, t) {
  39462. return (t || new Ci.Vector3).set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y), (e.z - this.min.z) / (this.max.z - this.min.z))
  39463. },
  39464. intersectsBox: function(e) {
  39465. 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)
  39466. },
  39467. intersectsSphere: function(e) {
  39468. return void 0 === fe && (fe = new Ci.Vector3),
  39469. this.clampPoint(e.center, fe),
  39470. fe.distanceToSquared(e.center) <= e.radius * e.radius
  39471. },
  39472. intersectsPlane: function(e) {
  39473. var t, i;
  39474. return i = 0 < e.normal.x ? (t = e.normal.x * this.min.x,
  39475. e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  39476. e.normal.x * this.min.x),
  39477. 0 < e.normal.y ? (t += e.normal.y * this.min.y,
  39478. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  39479. i += e.normal.y * this.min.y),
  39480. 0 < e.normal.z ? (t += e.normal.z * this.min.z,
  39481. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  39482. i += e.normal.z * this.min.z),
  39483. t <= e.constant && i >= e.constant
  39484. },
  39485. clampPoint: function(e, t) {
  39486. return (t || new Ci.Vector3).copy(e).clamp(this.min, this.max)
  39487. },
  39488. distanceToPoint: (pe = new Ci.Vector3,
  39489. function(e) {
  39490. return pe.copy(e).clamp(this.min, this.max).sub(e).length()
  39491. }
  39492. ),
  39493. getBoundingSphere: (de = new Ci.Vector3,
  39494. function(e) {
  39495. var t = e || new Ci.Sphere;
  39496. return t.center = this.center(),
  39497. t.radius = .5 * this.size(de).length(),
  39498. t
  39499. }
  39500. ),
  39501. intersect: function(e) {
  39502. return this.min.max(e.min),
  39503. this.max.min(e.max),
  39504. this
  39505. },
  39506. union: function(e) {
  39507. return this.min.min(e.min),
  39508. this.max.max(e.max),
  39509. this
  39510. },
  39511. applyMatrix4: (ue = [new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3],
  39512. function(e) {
  39513. return ue[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
  39514. ue[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
  39515. ue[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
  39516. ue[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
  39517. ue[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
  39518. ue[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
  39519. ue[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
  39520. ue[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
  39521. this.makeEmpty(),
  39522. this.setFromPoints(ue),
  39523. this
  39524. }
  39525. ),
  39526. translate: function(e) {
  39527. return this.min.add(e),
  39528. this.max.add(e),
  39529. this
  39530. },
  39531. equals: function(e) {
  39532. return e.min.equals(this.min) && e.max.equals(this.max)
  39533. }
  39534. },
  39535. Ci.Matrix3 = function() {
  39536. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  39537. 0 < arguments.length && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  39538. }
  39539. ,
  39540. Ci.Matrix3.prototype = {
  39541. constructor: Ci.Matrix3,
  39542. set: function(e, t, i, n, r, o, a, s, l) {
  39543. var c = this.elements;
  39544. return c[0] = e,
  39545. c[1] = n,
  39546. c[2] = a,
  39547. c[3] = t,
  39548. c[4] = r,
  39549. c[5] = s,
  39550. c[6] = i,
  39551. c[7] = o,
  39552. c[8] = l,
  39553. this
  39554. },
  39555. identity: function() {
  39556. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  39557. this
  39558. },
  39559. clone: function() {
  39560. return (new this.constructor).fromArray(this.elements)
  39561. },
  39562. copy: function(e) {
  39563. var t = e.elements;
  39564. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  39565. this
  39566. },
  39567. setFromMatrix4: function(e) {
  39568. var t = e.elements;
  39569. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  39570. this
  39571. },
  39572. applyToVector3Array: function(e, t, i) {
  39573. void 0 === he && (he = new Ci.Vector3),
  39574. void 0 === t && (t = 0),
  39575. void 0 === i && (i = e.length);
  39576. for (var n = 0, r = t; n < i; n += 3,
  39577. r += 3)
  39578. he.fromArray(e, r),
  39579. he.applyMatrix3(this),
  39580. he.toArray(e, r);
  39581. return e
  39582. },
  39583. applyToBuffer: function(e, t, i) {
  39584. void 0 === ce && (ce = new Ci.Vector3),
  39585. void 0 === t && (t = 0),
  39586. void 0 === i && (i = e.length / e.itemSize);
  39587. for (var n = 0, r = t; n < i; n++,
  39588. r++)
  39589. ce.x = e.getX(r),
  39590. ce.y = e.getY(r),
  39591. ce.z = e.getZ(r),
  39592. ce.applyMatrix3(this),
  39593. e.setXYZ(ce.x, ce.y, ce.z);
  39594. return e
  39595. },
  39596. multiplyScalar: function(e) {
  39597. var t = this.elements;
  39598. return t[0] *= e,
  39599. t[3] *= e,
  39600. t[6] *= e,
  39601. t[1] *= e,
  39602. t[4] *= e,
  39603. t[7] *= e,
  39604. t[2] *= e,
  39605. t[5] *= e,
  39606. t[8] *= e,
  39607. this
  39608. },
  39609. determinant: function() {
  39610. var e = this.elements
  39611. , t = e[0]
  39612. , i = e[1]
  39613. , n = e[2]
  39614. , r = e[3]
  39615. , o = e[4]
  39616. , a = e[5]
  39617. , s = e[6]
  39618. , l = e[7]
  39619. , c = e[8];
  39620. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  39621. },
  39622. getInverse: function(e, t) {
  39623. e instanceof Ci.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  39624. var i = e.elements
  39625. , n = this.elements
  39626. , r = i[0]
  39627. , o = i[1]
  39628. , a = i[2]
  39629. , s = i[3]
  39630. , l = i[4]
  39631. , c = i[5]
  39632. , h = i[6]
  39633. , u = i[7]
  39634. , d = i[8]
  39635. , p = d * l - c * u
  39636. , f = c * h - d * s
  39637. , g = u * s - l * h
  39638. , m = r * p + o * f + a * g;
  39639. if (0 != m)
  39640. return n[0] = p,
  39641. n[1] = a * u - d * o,
  39642. n[2] = c * o - a * l,
  39643. n[3] = f,
  39644. n[4] = d * r - a * h,
  39645. n[5] = a * s - c * r,
  39646. n[6] = g,
  39647. n[7] = o * h - u * r,
  39648. n[8] = l * r - o * s,
  39649. this.multiplyScalar(1 / m);
  39650. var v = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  39651. if (t)
  39652. throw new Error(v);
  39653. return this.identity()/* console.warn(v), *///许钟文删 boxHelper报的
  39654. },
  39655. transpose: function() {
  39656. var e, t = this.elements;
  39657. return e = t[1],
  39658. t[1] = t[3],
  39659. t[3] = e,
  39660. e = t[2],
  39661. t[2] = t[6],
  39662. t[6] = e,
  39663. e = t[5],
  39664. t[5] = t[7],
  39665. t[7] = e,
  39666. this
  39667. },
  39668. flattenToArrayOffset: function(e, t) {
  39669. var i = this.elements;
  39670. return e[t] = i[0],
  39671. e[t + 1] = i[1],
  39672. e[t + 2] = i[2],
  39673. e[t + 3] = i[3],
  39674. e[t + 4] = i[4],
  39675. e[t + 5] = i[5],
  39676. e[t + 6] = i[6],
  39677. e[t + 7] = i[7],
  39678. e[t + 8] = i[8],
  39679. e
  39680. },
  39681. getNormalMatrix: function(e) {
  39682. return this.setFromMatrix4(e).getInverse(this).transpose()
  39683. },
  39684. transposeIntoArray: function(e) {
  39685. var t = this.elements;
  39686. return e[0] = t[0],
  39687. e[1] = t[3],
  39688. e[2] = t[6],
  39689. e[3] = t[1],
  39690. e[4] = t[4],
  39691. e[5] = t[7],
  39692. e[6] = t[2],
  39693. e[7] = t[5],
  39694. e[8] = t[8],
  39695. this
  39696. },
  39697. fromArray: function(e) {
  39698. return this.elements.set(e),
  39699. this
  39700. },
  39701. toArray: function() {
  39702. var e = this.elements;
  39703. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  39704. }
  39705. },
  39706. Ci.Matrix4 = function() {
  39707. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  39708. 0 < arguments.length && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  39709. }
  39710. ,
  39711. Ci.Matrix4.prototype = {
  39712. constructor: Ci.Matrix4,
  39713. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  39714. var m = this.elements;
  39715. return m[0] = e,
  39716. m[4] = t,
  39717. m[8] = i,
  39718. m[12] = n,
  39719. m[1] = r,
  39720. m[5] = o,
  39721. m[9] = a,
  39722. m[13] = s,
  39723. m[2] = l,
  39724. m[6] = c,
  39725. m[10] = h,
  39726. m[14] = u,
  39727. m[3] = d,
  39728. m[7] = p,
  39729. m[11] = f,
  39730. m[15] = g,
  39731. this
  39732. },
  39733. identity: function() {
  39734. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39735. this
  39736. },
  39737. clone: function() {
  39738. return (new Ci.Matrix4).fromArray(this.elements)
  39739. },
  39740. copy: function(e) {
  39741. return this.elements.set(e.elements),
  39742. this
  39743. },
  39744. copyPosition: function(e) {
  39745. var t = this.elements
  39746. , i = e.elements;
  39747. return t[12] = i[12],
  39748. t[13] = i[13],
  39749. t[14] = i[14],
  39750. this
  39751. },
  39752. extractBasis: function(e, t, i) {
  39753. return e.setFromMatrixColumn(this, 0),
  39754. t.setFromMatrixColumn(this, 1),
  39755. i.setFromMatrixColumn(this, 2),
  39756. this
  39757. },
  39758. makeBasis: function(e, t, i) {
  39759. 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),
  39760. this
  39761. },
  39762. extractRotation: function(e) {
  39763. void 0 === le && (le = new Ci.Vector3);
  39764. var t = this.elements
  39765. , i = e.elements
  39766. , n = 1 / le.setFromMatrixColumn(e, 0).length()
  39767. , r = 1 / le.setFromMatrixColumn(e, 1).length()
  39768. , o = 1 / le.setFromMatrixColumn(e, 2).length();
  39769. return t[0] = i[0] * n,
  39770. t[1] = i[1] * n,
  39771. t[2] = i[2] * n,
  39772. t[4] = i[4] * r,
  39773. t[5] = i[5] * r,
  39774. t[6] = i[6] * r,
  39775. t[8] = i[8] * o,
  39776. t[9] = i[9] * o,
  39777. t[10] = i[10] * o,
  39778. this
  39779. },
  39780. makeRotationFromEuler: function(e) {
  39781. e instanceof Ci.Euler == 0 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39782. var t = this.elements
  39783. , i = e.x
  39784. , n = e.y
  39785. , r = e.z
  39786. , o = Math.cos(i)
  39787. , a = Math.sin(i)
  39788. , s = Math.cos(n)
  39789. , l = Math.sin(n)
  39790. , c = Math.cos(r)
  39791. , h = Math.sin(r);
  39792. if ("XYZ" === e.order) {
  39793. var u = o * c
  39794. , d = o * h
  39795. , p = a * c
  39796. , f = a * h;
  39797. t[0] = s * c,
  39798. t[4] = -s * h,
  39799. t[8] = l,
  39800. t[1] = d + p * l,
  39801. t[5] = u - f * l,
  39802. t[9] = -a * s,
  39803. t[2] = f - u * l,
  39804. t[6] = p + d * l,
  39805. t[10] = o * s
  39806. } else if ("YXZ" === e.order) {
  39807. var g = s * c
  39808. , m = s * h
  39809. , v = l * c
  39810. , y = l * h;
  39811. t[0] = g + y * a,
  39812. t[4] = v * a - m,
  39813. t[8] = o * l,
  39814. t[1] = o * h,
  39815. t[5] = o * c,
  39816. t[9] = -a,
  39817. t[2] = m * a - v,
  39818. t[6] = y + g * a,
  39819. t[10] = o * s
  39820. } else if ("ZXY" === e.order) {
  39821. g = s * c,
  39822. m = s * h,
  39823. v = l * c,
  39824. y = l * h;
  39825. t[0] = g - y * a,
  39826. t[4] = -o * h,
  39827. t[8] = v + m * a,
  39828. t[1] = m + v * a,
  39829. t[5] = o * c,
  39830. t[9] = y - g * a,
  39831. t[2] = -o * l,
  39832. t[6] = a,
  39833. t[10] = o * s
  39834. } else if ("ZYX" === e.order) {
  39835. u = o * c,
  39836. d = o * h,
  39837. p = a * c,
  39838. f = a * h;
  39839. t[0] = s * c,
  39840. t[4] = p * l - d,
  39841. t[8] = u * l + f,
  39842. t[1] = s * h,
  39843. t[5] = f * l + u,
  39844. t[9] = d * l - p,
  39845. t[2] = -l,
  39846. t[6] = a * s,
  39847. t[10] = o * s
  39848. } else if ("YZX" === e.order) {
  39849. var A = o * s
  39850. , C = o * l
  39851. , I = a * s
  39852. , E = a * l;
  39853. t[0] = s * c,
  39854. t[4] = E - A * h,
  39855. t[8] = I * h + C,
  39856. t[1] = h,
  39857. t[5] = o * c,
  39858. t[9] = -a * c,
  39859. t[2] = -l * c,
  39860. t[6] = C * h + I,
  39861. t[10] = A - E * h
  39862. } else if ("XZY" === e.order) {
  39863. A = o * s,
  39864. C = o * l,
  39865. I = a * s,
  39866. E = a * l;
  39867. t[0] = s * c,
  39868. t[4] = -h,
  39869. t[8] = l * c,
  39870. t[1] = A * h + E,
  39871. t[5] = o * c,
  39872. t[9] = C * h - I,
  39873. t[2] = I * h - C,
  39874. t[6] = a * c,
  39875. t[10] = E * h + A
  39876. }
  39877. return t[3] = 0,
  39878. t[7] = 0,
  39879. t[11] = 0,
  39880. t[12] = 0,
  39881. t[13] = 0,
  39882. t[14] = 0,
  39883. t[15] = 1,
  39884. this
  39885. },
  39886. makeRotationFromQuaternion: function(e) {
  39887. var t = this.elements
  39888. , i = e.x
  39889. , n = e.y
  39890. , r = e.z
  39891. , o = e.w
  39892. , a = i + i
  39893. , s = n + n
  39894. , l = r + r
  39895. , c = i * a
  39896. , h = i * s
  39897. , u = i * l
  39898. , d = n * s
  39899. , p = n * l
  39900. , f = r * l
  39901. , g = o * a
  39902. , m = o * s
  39903. , v = o * l;
  39904. return t[0] = 1 - (d + f),
  39905. t[4] = h - v,
  39906. t[8] = u + m,
  39907. t[1] = h + v,
  39908. t[5] = 1 - (c + f),
  39909. t[9] = p - g,
  39910. t[2] = u - m,
  39911. t[6] = p + g,
  39912. t[10] = 1 - (c + d),
  39913. t[3] = 0,
  39914. t[7] = 0,
  39915. t[11] = 0,
  39916. t[12] = 0,
  39917. t[13] = 0,
  39918. t[14] = 0,
  39919. t[15] = 1,
  39920. this
  39921. },
  39922. lookAt: function(e, t, i) {
  39923. void 0 === oe && (oe = new Ci.Vector3),
  39924. void 0 === ae && (ae = new Ci.Vector3),
  39925. void 0 === se && (se = new Ci.Vector3);
  39926. var n = this.elements;
  39927. return se.subVectors(e, t).normalize(),
  39928. 0 === se.lengthSq() && (se.z = 1),
  39929. oe.crossVectors(i, se).normalize(),
  39930. 0 === oe.lengthSq() && (se.x += 1e-4,
  39931. oe.crossVectors(i, se).normalize()),
  39932. ae.crossVectors(se, oe),
  39933. n[0] = oe.x,
  39934. n[4] = ae.x,
  39935. n[8] = se.x,
  39936. n[1] = oe.y,
  39937. n[5] = ae.y,
  39938. n[9] = se.y,
  39939. n[2] = oe.z,
  39940. n[6] = ae.z,
  39941. n[10] = se.z,
  39942. this
  39943. },
  39944. multiply: function(e, t) {
  39945. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  39946. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  39947. },
  39948. multiplyMatrices: function(e, t) {
  39949. var i = e.elements
  39950. , n = t.elements
  39951. , r = this.elements
  39952. , o = i[0]
  39953. , a = i[4]
  39954. , s = i[8]
  39955. , l = i[12]
  39956. , c = i[1]
  39957. , h = i[5]
  39958. , u = i[9]
  39959. , d = i[13]
  39960. , p = i[2]
  39961. , f = i[6]
  39962. , g = i[10]
  39963. , m = i[14]
  39964. , v = i[3]
  39965. , y = i[7]
  39966. , A = i[11]
  39967. , C = i[15]
  39968. , I = n[0]
  39969. , E = n[4]
  39970. , _ = n[8]
  39971. , b = n[12]
  39972. , w = n[1]
  39973. , T = n[5]
  39974. , x = n[9]
  39975. , S = n[13]
  39976. , M = n[2]
  39977. , R = n[6]
  39978. , P = n[10]
  39979. , O = n[14]
  39980. , L = n[3]
  39981. , D = n[7]
  39982. , N = n[11]
  39983. , F = n[15];
  39984. return r[0] = o * I + a * w + s * M + l * L,
  39985. r[4] = o * E + a * T + s * R + l * D,
  39986. r[8] = o * _ + a * x + s * P + l * N,
  39987. r[12] = o * b + a * S + s * O + l * F,
  39988. r[1] = c * I + h * w + u * M + d * L,
  39989. r[5] = c * E + h * T + u * R + d * D,
  39990. r[9] = c * _ + h * x + u * P + d * N,
  39991. r[13] = c * b + h * S + u * O + d * F,
  39992. r[2] = p * I + f * w + g * M + m * L,
  39993. r[6] = p * E + f * T + g * R + m * D,
  39994. r[10] = p * _ + f * x + g * P + m * N,
  39995. r[14] = p * b + f * S + g * O + m * F,
  39996. r[3] = v * I + y * w + A * M + C * L,
  39997. r[7] = v * E + y * T + A * R + C * D,
  39998. r[11] = v * _ + y * x + A * P + C * N,
  39999. r[15] = v * b + y * S + A * O + C * F,
  40000. this
  40001. },
  40002. multiplyToArray: function(e, t, i) {
  40003. var n = this.elements;
  40004. return this.multiplyMatrices(e, t),
  40005. i[0] = n[0],
  40006. i[1] = n[1],
  40007. i[2] = n[2],
  40008. i[3] = n[3],
  40009. i[4] = n[4],
  40010. i[5] = n[5],
  40011. i[6] = n[6],
  40012. i[7] = n[7],
  40013. i[8] = n[8],
  40014. i[9] = n[9],
  40015. i[10] = n[10],
  40016. i[11] = n[11],
  40017. i[12] = n[12],
  40018. i[13] = n[13],
  40019. i[14] = n[14],
  40020. i[15] = n[15],
  40021. this
  40022. },
  40023. multiplyScalar: function(e) {
  40024. var t = this.elements;
  40025. return t[0] *= e,
  40026. t[4] *= e,
  40027. t[8] *= e,
  40028. t[12] *= e,
  40029. t[1] *= e,
  40030. t[5] *= e,
  40031. t[9] *= e,
  40032. t[13] *= e,
  40033. t[2] *= e,
  40034. t[6] *= e,
  40035. t[10] *= e,
  40036. t[14] *= e,
  40037. t[3] *= e,
  40038. t[7] *= e,
  40039. t[11] *= e,
  40040. t[15] *= e,
  40041. this
  40042. },
  40043. applyToVector3Array: function(e, t, i) {
  40044. void 0 === re && (re = new Ci.Vector3),
  40045. void 0 === t && (t = 0),
  40046. void 0 === i && (i = e.length);
  40047. for (var n = 0, r = t; n < i; n += 3,
  40048. r += 3)
  40049. re.fromArray(e, r),
  40050. re.applyMatrix4(this),
  40051. re.toArray(e, r);
  40052. return e
  40053. },
  40054. applyToBuffer: function(e, t, i) {
  40055. void 0 === ne && (ne = new Ci.Vector3),
  40056. void 0 === t && (t = 0),
  40057. void 0 === i && (i = e.length / e.itemSize);
  40058. for (var n = 0, r = t; n < i; n++,
  40059. r++)
  40060. ne.x = e.getX(r),
  40061. ne.y = e.getY(r),
  40062. ne.z = e.getZ(r),
  40063. ne.applyMatrix4(this),
  40064. e.setXYZ(ne.x, ne.y, ne.z);
  40065. return e
  40066. },
  40067. determinant: function() {
  40068. var e = this.elements
  40069. , t = e[0]
  40070. , i = e[4]
  40071. , n = e[8]
  40072. , r = e[12]
  40073. , o = e[1]
  40074. , a = e[5]
  40075. , s = e[9]
  40076. , l = e[13]
  40077. , c = e[2]
  40078. , h = e[6]
  40079. , u = e[10]
  40080. , d = e[14];
  40081. return e[3] * (+r * s * h - n * l * h - r * a * u + i * l * u + n * a * d - i * s * d) + e[7] * (+t * s * d - t * l * u + r * o * u - n * o * d + n * l * c - r * s * c) + e[11] * (+t * l * h - t * a * d - r * o * h + i * o * d + r * a * c - i * l * c) + e[15] * (-n * a * c - t * s * h + t * a * u + n * o * h - i * o * u + i * s * c)
  40082. },
  40083. transpose: function() {
  40084. var e, t = this.elements;
  40085. return e = t[1],
  40086. t[1] = t[4],
  40087. t[4] = e,
  40088. e = t[2],
  40089. t[2] = t[8],
  40090. t[8] = e,
  40091. e = t[6],
  40092. t[6] = t[9],
  40093. t[9] = e,
  40094. e = t[3],
  40095. t[3] = t[12],
  40096. t[12] = e,
  40097. e = t[7],
  40098. t[7] = t[13],
  40099. t[13] = e,
  40100. e = t[11],
  40101. t[11] = t[14],
  40102. t[14] = e,
  40103. this
  40104. },
  40105. flattenToArrayOffset: function(e, t) {
  40106. var i = this.elements;
  40107. return e[t] = i[0],
  40108. e[t + 1] = i[1],
  40109. e[t + 2] = i[2],
  40110. e[t + 3] = i[3],
  40111. e[t + 4] = i[4],
  40112. e[t + 5] = i[5],
  40113. e[t + 6] = i[6],
  40114. e[t + 7] = i[7],
  40115. e[t + 8] = i[8],
  40116. e[t + 9] = i[9],
  40117. e[t + 10] = i[10],
  40118. e[t + 11] = i[11],
  40119. e[t + 12] = i[12],
  40120. e[t + 13] = i[13],
  40121. e[t + 14] = i[14],
  40122. e[t + 15] = i[15],
  40123. e
  40124. },
  40125. getPosition: function() {
  40126. return void 0 === ie && (ie = new Ci.Vector3),
  40127. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  40128. ie.setFromMatrixColumn(this, 3)
  40129. },
  40130. setPosition: function(e) {
  40131. var t = this.elements;
  40132. return t[12] = e.x,
  40133. t[13] = e.y,
  40134. t[14] = e.z,
  40135. this
  40136. },
  40137. getInverse: function(e, t) {
  40138. var i = this.elements
  40139. , n = e.elements
  40140. , r = n[0]
  40141. , o = n[1]
  40142. , a = n[2]
  40143. , s = n[3]
  40144. , l = n[4]
  40145. , c = n[5]
  40146. , h = n[6]
  40147. , u = n[7]
  40148. , d = n[8]
  40149. , p = n[9]
  40150. , f = n[10]
  40151. , g = n[11]
  40152. , m = n[12]
  40153. , v = n[13]
  40154. , y = n[14]
  40155. , A = n[15]
  40156. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  40157. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  40158. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  40159. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  40160. , b = r * C + o * I + a * E + s * _;
  40161. if (0 != b)
  40162. return i[0] = C,
  40163. i[1] = v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A,
  40164. i[2] = c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A,
  40165. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  40166. i[4] = I,
  40167. i[5] = d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A,
  40168. i[6] = m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A,
  40169. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  40170. i[8] = E,
  40171. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A,
  40172. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A,
  40173. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  40174. i[12] = _,
  40175. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y,
  40176. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y,
  40177. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  40178. this.multiplyScalar(1 / b);
  40179. var w = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  40180. if (t)
  40181. throw new Error(w);
  40182. return console.warn(w),
  40183. this.identity()
  40184. },
  40185. scale: function(e) {
  40186. var t = this.elements
  40187. , i = e.x
  40188. , n = e.y
  40189. , r = e.z;
  40190. return t[0] *= i,
  40191. t[4] *= n,
  40192. t[8] *= r,
  40193. t[1] *= i,
  40194. t[5] *= n,
  40195. t[9] *= r,
  40196. t[2] *= i,
  40197. t[6] *= n,
  40198. t[10] *= r,
  40199. t[3] *= i,
  40200. t[7] *= n,
  40201. t[11] *= r,
  40202. this
  40203. },
  40204. getMaxScaleOnAxis: function() {
  40205. var e = this.elements
  40206. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  40207. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  40208. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  40209. return Math.sqrt(Math.max(t, i, n))
  40210. },
  40211. makeTranslation: function(e, t, i) {
  40212. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  40213. this
  40214. },
  40215. makeRotationX: function(e) {
  40216. var t = Math.cos(e)
  40217. , i = Math.sin(e);
  40218. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  40219. this
  40220. },
  40221. makeRotationY: function(e) {
  40222. var t = Math.cos(e)
  40223. , i = Math.sin(e);
  40224. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  40225. this
  40226. },
  40227. makeRotationZ: function(e) {
  40228. var t = Math.cos(e)
  40229. , i = Math.sin(e);
  40230. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  40231. this
  40232. },
  40233. makeRotationAxis: function(e, t) {
  40234. var i = Math.cos(t)
  40235. , n = Math.sin(t)
  40236. , r = 1 - i
  40237. , o = e.x
  40238. , a = e.y
  40239. , s = e.z
  40240. , l = r * o
  40241. , c = r * a;
  40242. 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),
  40243. this
  40244. },
  40245. makeScale: function(e, t, i) {
  40246. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  40247. this
  40248. },
  40249. compose: function(e, t, i) {
  40250. return this.makeRotationFromQuaternion(t),
  40251. this.scale(i),
  40252. this.setPosition(e),
  40253. this
  40254. },
  40255. decompose: function(e, t, i) {
  40256. void 0 === ee && (ee = new Ci.Vector3),
  40257. void 0 === te && (te = new Ci.Matrix4);
  40258. var n = this.elements
  40259. , r = ee.set(n[0], n[1], n[2]).length()
  40260. , o = ee.set(n[4], n[5], n[6]).length()
  40261. , a = ee.set(n[8], n[9], n[10]).length();
  40262. this.determinant() < 0 && (r = -r),
  40263. e.x = n[12],
  40264. e.y = n[13],
  40265. e.z = n[14],
  40266. te.elements.set(this.elements);
  40267. var s = 1 / r
  40268. , l = 1 / o
  40269. , c = 1 / a;
  40270. return te.elements[0] *= s,
  40271. te.elements[1] *= s,
  40272. te.elements[2] *= s,
  40273. te.elements[4] *= l,
  40274. te.elements[5] *= l,
  40275. te.elements[6] *= l,
  40276. te.elements[8] *= c,
  40277. te.elements[9] *= c,
  40278. te.elements[10] *= c,
  40279. t.setFromRotationMatrix(te),
  40280. i.x = r,
  40281. i.y = o,
  40282. i.z = a,
  40283. this
  40284. },
  40285. makeFrustum: function(e, t, i, n, r, o) {
  40286. var a = this.elements
  40287. , s = 2 * r / (t - e)
  40288. , l = 2 * r / (n - i)
  40289. , c = (t + e) / (t - e)
  40290. , h = (n + i) / (n - i)
  40291. , u = -(o + r) / (o - r)
  40292. , d = -2 * o * r / (o - r);
  40293. return a[0] = s,
  40294. a[4] = 0,
  40295. a[8] = c,
  40296. a[12] = 0,
  40297. a[1] = 0,
  40298. a[5] = l,
  40299. a[9] = h,
  40300. a[13] = 0,
  40301. a[2] = 0,
  40302. a[6] = 0,
  40303. a[10] = u,
  40304. a[14] = d,
  40305. a[3] = 0,
  40306. a[7] = 0,
  40307. a[11] = -1,
  40308. a[15] = 0,
  40309. this
  40310. },
  40311. makePerspective: function(e, t, i, n) {
  40312. var r = i * Math.tan(Ci.Math.degToRad(.5 * e))
  40313. , o = -r
  40314. , a = o * t
  40315. , s = r * t;
  40316. return this.makeFrustum(a, s, o, r, i, n)
  40317. },
  40318. makeOrthographic: function(e, t, i, n, r, o) {
  40319. var a = this.elements
  40320. , s = 1 / (t - e)
  40321. , l = 1 / (i - n)
  40322. , c = 1 / (o - r)
  40323. , h = (t + e) * s
  40324. , u = (i + n) * l
  40325. , d = (o + r) * c;
  40326. return a[0] = 2 * s,
  40327. a[4] = 0,
  40328. a[8] = 0,
  40329. a[12] = -h,
  40330. a[1] = 0,
  40331. a[5] = 2 * l,
  40332. a[9] = 0,
  40333. a[13] = -u,
  40334. a[2] = 0,
  40335. a[6] = 0,
  40336. a[10] = -2 * c,
  40337. a[14] = -d,
  40338. a[3] = 0,
  40339. a[7] = 0,
  40340. a[11] = 0,
  40341. a[15] = 1,
  40342. this
  40343. },
  40344. equals: function(e) {
  40345. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  40346. if (t[n] !== i[n])
  40347. return !1;
  40348. return !0
  40349. },
  40350. fromArray: function(e) {
  40351. return this.elements.set(e),
  40352. this
  40353. },
  40354. toArray: function() {
  40355. var e = this.elements;
  40356. 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]]
  40357. }
  40358. },
  40359. Ci.Ray = function(e, t) {
  40360. this.origin = void 0 !== e ? e : new Ci.Vector3,
  40361. this.direction = void 0 !== t ? t : new Ci.Vector3
  40362. }
  40363. ,
  40364. Ci.Ray.prototype = {
  40365. constructor: Ci.Ray,
  40366. set: function(e, t) {
  40367. return this.origin.copy(e),
  40368. this.direction.copy(t),
  40369. this
  40370. },
  40371. clone: function() {
  40372. return (new this.constructor).copy(this)
  40373. },
  40374. copy: function(e) {
  40375. return this.origin.copy(e.origin),
  40376. this.direction.copy(e.direction),
  40377. this
  40378. },
  40379. at: function(e, t) {
  40380. return (t || new Ci.Vector3).copy(this.direction).multiplyScalar(e).add(this.origin)
  40381. },
  40382. lookAt: function(e) {
  40383. this.direction.copy(e).sub(this.origin).normalize()
  40384. },
  40385. recast: ($ = new Ci.Vector3,
  40386. function(e) {
  40387. return this.origin.copy(this.at(e, $)),
  40388. this
  40389. }
  40390. ),
  40391. closestPointToPoint: function(e, t) {
  40392. var i = t || new Ci.Vector3;
  40393. i.subVectors(e, this.origin);
  40394. var n = i.dot(this.direction);
  40395. return n < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(n).add(this.origin)
  40396. },
  40397. distanceToPoint: function(e) {
  40398. return Math.sqrt(this.distanceSqToPoint(e))
  40399. },
  40400. distanceSqToPoint: (J = new Ci.Vector3,
  40401. function(e) {
  40402. var t = J.subVectors(e, this.origin).dot(this.direction);
  40403. return t < 0 ? this.origin.distanceToSquared(e) : (J.copy(this.direction).multiplyScalar(t).add(this.origin),
  40404. J.distanceToSquared(e))
  40405. }
  40406. ),
  40407. distanceSqToSegment: (Z = new Ci.Vector3,
  40408. K = new Ci.Vector3,
  40409. Q = new Ci.Vector3,
  40410. function(e, t, i, n) {
  40411. Z.copy(e).add(t).multiplyScalar(.5),
  40412. K.copy(t).sub(e).normalize(),
  40413. Q.copy(this.origin).sub(Z);
  40414. var r, o, a, s, l = .5 * e.distanceTo(t), c = -this.direction.dot(K), h = Q.dot(this.direction), u = -Q.dot(K), d = Q.lengthSq(), p = Math.abs(1 - c * c);
  40415. if (0 < p)
  40416. if (o = c * h - u,
  40417. s = l * p,
  40418. 0 <= (r = c * u - h))
  40419. if (-s <= o)
  40420. if (o <= s) {
  40421. var f = 1 / p;
  40422. a = (r *= f) * (r + c * (o *= f) + 2 * h) + o * (c * r + o + 2 * u) + d
  40423. } else
  40424. o = l,
  40425. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40426. else
  40427. o = -l,
  40428. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40429. else
  40430. a = o <= -s ? -(r = Math.max(0, -(-c * l + h))) * r + (o = 0 < r ? -l : Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d : o <= s ? (r = 0,
  40431. (o = Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d) : -(r = Math.max(0, -(c * l + h))) * r + (o = 0 < r ? l : Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d;
  40432. else
  40433. o = 0 < c ? -l : l,
  40434. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40435. return i && i.copy(this.direction).multiplyScalar(r).add(this.origin),
  40436. n && n.copy(K).multiplyScalar(o).add(Z),
  40437. a
  40438. }
  40439. ),
  40440. intersectSphere: (X = new Ci.Vector3,
  40441. function(e, t) {
  40442. X.subVectors(e.center, this.origin);
  40443. var i = X.dot(this.direction)
  40444. , n = X.dot(X) - i * i
  40445. , r = e.radius * e.radius;
  40446. if (r < n)
  40447. return null;
  40448. var o = Math.sqrt(r - n)
  40449. , a = i - o
  40450. , s = i + o;
  40451. return a < 0 && s < 0 ? null : a < 0 ? this.at(s, t) : this.at(a, t)
  40452. }
  40453. ),
  40454. intersectsSphere: function(e) {
  40455. return this.distanceToPoint(e.center) <= e.radius
  40456. },
  40457. distanceToPlane: function(e) {
  40458. var t = e.normal.dot(this.direction);
  40459. if (0 === t)
  40460. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  40461. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  40462. return 0 <= i ? i : null
  40463. },
  40464. intersectPlane: function(e, t) {
  40465. var i = this.distanceToPlane(e);
  40466. return null === i ? null : this.at(i, t)
  40467. },
  40468. intersectsPlane: function(e) {
  40469. var t = e.distanceToPoint(this.origin);
  40470. return 0 === t || e.normal.dot(this.direction) * t < 0
  40471. },
  40472. intersectBox: function(e, t) {
  40473. 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;
  40474. return n = 0 <= l ? (i = (e.min.x - u.x) * l,
  40475. (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  40476. (e.min.x - u.x) * l),
  40477. (o = 0 <= c ? (r = (e.min.y - u.y) * c,
  40478. (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  40479. (e.min.y - u.y) * c)) < i || n < r ? null : ((i < r || i != i) && (i = r),
  40480. (o < n || n != n) && (n = o),
  40481. (s = 0 <= h ? (a = (e.min.z - u.z) * h,
  40482. (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  40483. (e.min.z - u.z) * h)) < i || n < a ? null : ((i < a || i != i) && (i = a),
  40484. (s < n || n != n) && (n = s),
  40485. n < 0 ? null : this.at(0 <= i ? i : n, t)))
  40486. },
  40487. intersectsBox: (q = new Ci.Vector3,
  40488. function(e) {
  40489. return null !== this.intersectBox(e, q)
  40490. }
  40491. ),
  40492. intersectTriangle: (G = new Ci.Vector3,
  40493. W = new Ci.Vector3,
  40494. j = new Ci.Vector3,
  40495. Y = new Ci.Vector3,
  40496. function(e, t, i, n, r) {
  40497. W.subVectors(t, e),
  40498. j.subVectors(i, e),
  40499. Y.crossVectors(W, j);
  40500. var o, a = this.direction.dot(Y);
  40501. if (0 < a) {
  40502. if (n)
  40503. return null;
  40504. o = 1
  40505. } else {
  40506. if (!(a < 0))
  40507. return null;
  40508. o = -1,
  40509. a = -a
  40510. }
  40511. G.subVectors(this.origin, e);
  40512. var s = o * this.direction.dot(j.crossVectors(G, j));
  40513. if (s < 0)
  40514. return null;
  40515. var l = o * this.direction.dot(W.cross(G));
  40516. if (l < 0)
  40517. return null;
  40518. if (a < s + l)
  40519. return null;
  40520. var c = -o * G.dot(Y);
  40521. return c < 0 ? null : this.at(c / a, r)
  40522. }
  40523. ),
  40524. applyMatrix4: function(e) {
  40525. return this.direction.add(this.origin).applyMatrix4(e),
  40526. this.origin.applyMatrix4(e),
  40527. this.direction.sub(this.origin),
  40528. this.direction.normalize(),
  40529. this
  40530. },
  40531. equals: function(e) {
  40532. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  40533. }
  40534. },
  40535. Ci.Sphere = function(e, t) {
  40536. this.center = void 0 !== e ? e : new Ci.Vector3,
  40537. this.radius = void 0 !== t ? t : 0
  40538. }
  40539. ,
  40540. Ci.Sphere.prototype = {
  40541. constructor: Ci.Sphere,
  40542. set: function(e, t) {
  40543. return this.center.copy(e),
  40544. this.radius = t,
  40545. this
  40546. },
  40547. setFromPoints: (z = new Ci.Box3,
  40548. function(e, t) {
  40549. var i = this.center;
  40550. void 0 !== t ? i.copy(t) : z.setFromPoints(e).center(i);
  40551. for (var n = 0, r = 0, o = e.length; r < o; r++)
  40552. n = Math.max(n, i.distanceToSquared(e[r]));
  40553. return this.radius = Math.sqrt(n),
  40554. this
  40555. }
  40556. ),
  40557. clone: function() {
  40558. return (new this.constructor).copy(this)
  40559. },
  40560. copy: function(e) {
  40561. return this.center.copy(e.center),
  40562. this.radius = e.radius,
  40563. this
  40564. },
  40565. empty: function() {
  40566. return this.radius <= 0
  40567. },
  40568. containsPoint: function(e) {
  40569. return e.distanceToSquared(this.center) <= this.radius * this.radius
  40570. },
  40571. distanceToPoint: function(e) {
  40572. return e.distanceTo(this.center) - this.radius
  40573. },
  40574. intersectsSphere: function(e) {
  40575. var t = this.radius + e.radius;
  40576. return e.center.distanceToSquared(this.center) <= t * t
  40577. },
  40578. intersectsBox: function(e) {
  40579. return e.intersectsSphere(this)
  40580. },
  40581. intersectsPlane: function(e) {
  40582. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  40583. },
  40584. clampPoint: function(e, t) {
  40585. var i = this.center.distanceToSquared(e)
  40586. , n = t || new Ci.Vector3;
  40587. return n.copy(e),
  40588. i > this.radius * this.radius && (n.sub(this.center).normalize(),
  40589. n.multiplyScalar(this.radius).add(this.center)),
  40590. n
  40591. },
  40592. getBoundingBox: function(e) {
  40593. var t = e || new Ci.Box3;
  40594. return t.set(this.center, this.center),
  40595. t.expandByScalar(this.radius),
  40596. t
  40597. },
  40598. applyMatrix4: function(e) {
  40599. return this.center.applyMatrix4(e),
  40600. this.radius = this.radius * e.getMaxScaleOnAxis(),
  40601. this
  40602. },
  40603. translate: function(e) {
  40604. return this.center.add(e),
  40605. this
  40606. },
  40607. equals: function(e) {
  40608. return e.center.equals(this.center) && e.radius === this.radius
  40609. }
  40610. },
  40611. Ci.Frustum = function(e, t, i, n, r, o) {
  40612. this.planes = [void 0 !== e ? e : new Ci.Plane, void 0 !== t ? t : new Ci.Plane, void 0 !== i ? i : new Ci.Plane, void 0 !== n ? n : new Ci.Plane, void 0 !== r ? r : new Ci.Plane, void 0 !== o ? o : new Ci.Plane]
  40613. }
  40614. ,
  40615. Ci.Frustum.prototype = {
  40616. constructor: Ci.Frustum,
  40617. set: function(e, t, i, n, r, o) {
  40618. var a = this.planes;
  40619. return a[0].copy(e),
  40620. a[1].copy(t),
  40621. a[2].copy(i),
  40622. a[3].copy(n),
  40623. a[4].copy(r),
  40624. a[5].copy(o),
  40625. this
  40626. },
  40627. clone: function() {
  40628. return (new this.constructor).copy(this)
  40629. },
  40630. copy: function(e) {
  40631. for (var t = this.planes, i = 0; i < 6; i++)
  40632. t[i].copy(e.planes[i]);
  40633. return this
  40634. },
  40635. setFromMatrix: function(e) {
  40636. var t = this.planes
  40637. , i = e.elements
  40638. , n = i[0]
  40639. , r = i[1]
  40640. , o = i[2]
  40641. , a = i[3]
  40642. , s = i[4]
  40643. , l = i[5]
  40644. , c = i[6]
  40645. , h = i[7]
  40646. , u = i[8]
  40647. , d = i[9]
  40648. , p = i[10]
  40649. , f = i[11]
  40650. , g = i[12]
  40651. , m = i[13]
  40652. , v = i[14]
  40653. , y = i[15];
  40654. return t[0].setComponents(a - n, h - s, f - u, y - g).normalize(),
  40655. t[1].setComponents(a + n, h + s, f + u, y + g).normalize(),
  40656. t[2].setComponents(a + r, h + l, f + d, y + m).normalize(),
  40657. t[3].setComponents(a - r, h - l, f - d, y - m).normalize(),
  40658. t[4].setComponents(a - o, h - c, f - p, y - v).normalize(),
  40659. t[5].setComponents(a + o, h + c, f + p, y + v).normalize(),
  40660. this
  40661. },
  40662. intersectsObject: (H = new Ci.Sphere,
  40663. function(e) {
  40664. var t = e.geometry;
  40665. return null === t.boundingSphere && t.computeBoundingSphere(),
  40666. H.copy(t.boundingSphere),
  40667. H.applyMatrix4(e.matrixWorld),
  40668. this.intersectsSphere(H)
  40669. }
  40670. ),
  40671. intersectsSphere: function(e) {
  40672. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  40673. if (t[r].distanceToPoint(i) < n)
  40674. return !1
  40675. }
  40676. return !0
  40677. },
  40678. intersectsBox: (k = new Ci.Vector3,
  40679. U = new Ci.Vector3,
  40680. function(e) {
  40681. for (var t = this.planes, i = 0; i < 6; i++) {
  40682. var n = t[i];
  40683. k.x = 0 < n.normal.x ? e.min.x : e.max.x,
  40684. U.x = 0 < n.normal.x ? e.max.x : e.min.x,
  40685. k.y = 0 < n.normal.y ? e.min.y : e.max.y,
  40686. U.y = 0 < n.normal.y ? e.max.y : e.min.y,
  40687. k.z = 0 < n.normal.z ? e.min.z : e.max.z,
  40688. U.z = 0 < n.normal.z ? e.max.z : e.min.z;
  40689. var r = n.distanceToPoint(k)
  40690. , o = n.distanceToPoint(U);
  40691. if (r < 0 && o < 0)
  40692. return !1
  40693. }
  40694. return !0
  40695. }
  40696. ),
  40697. containsPoint: function(e) {
  40698. for (var t = this.planes, i = 0; i < 6; i++)
  40699. if (t[i].distanceToPoint(e) < 0)
  40700. return !1;
  40701. return !0
  40702. }
  40703. },
  40704. Ci.Plane = function(e, t) {
  40705. this.normal = void 0 !== e ? e : new Ci.Vector3(1,0,0),
  40706. this.constant = void 0 !== t ? t : 0
  40707. }
  40708. ,
  40709. Ci.Plane.prototype = {
  40710. constructor: Ci.Plane,
  40711. set: function(e, t) {
  40712. return this.normal.copy(e),
  40713. this.constant = t,
  40714. this
  40715. },
  40716. setComponents: function(e, t, i, n) {
  40717. return this.normal.set(e, t, i),
  40718. this.constant = n,
  40719. this
  40720. },
  40721. setFromNormalAndCoplanarPoint: function(e, t) {
  40722. return this.normal.copy(e),
  40723. this.constant = -t.dot(this.normal),
  40724. this
  40725. },
  40726. setFromCoplanarPoints: (B = new Ci.Vector3,
  40727. V = new Ci.Vector3,
  40728. function(e, t, i) {
  40729. var n = B.subVectors(i, t).cross(V.subVectors(e, t)).normalize();
  40730. return this.setFromNormalAndCoplanarPoint(n, e),
  40731. this
  40732. }
  40733. ),
  40734. clone: function() {
  40735. return (new this.constructor).copy(this)
  40736. },
  40737. copy: function(e) {
  40738. return this.normal.copy(e.normal),
  40739. this.constant = e.constant,
  40740. this
  40741. },
  40742. normalize: function() {
  40743. var e = 1 / this.normal.length();
  40744. return this.normal.multiplyScalar(e),
  40745. this.constant *= e,
  40746. this
  40747. },
  40748. negate: function() {
  40749. return this.constant *= -1,
  40750. this.normal.negate(),
  40751. this
  40752. },
  40753. distanceToPoint: function(e) {
  40754. return this.normal.dot(e) + this.constant
  40755. },
  40756. distanceToSphere: function(e) {
  40757. return this.distanceToPoint(e.center) - e.radius
  40758. },
  40759. projectPoint: function(e, t) {
  40760. return this.orthoPoint(e, t).sub(e).negate()
  40761. },
  40762. orthoPoint: function(e, t) {
  40763. var i = this.distanceToPoint(e);
  40764. return (t || new Ci.Vector3).copy(this.normal).multiplyScalar(i)
  40765. },
  40766. intersectLine: (F = new Ci.Vector3,
  40767. function(e, t) {
  40768. var i = t || new Ci.Vector3
  40769. , n = e.delta(F)
  40770. , r = this.normal.dot(n);
  40771. if (0 !== r) {
  40772. var o = -(e.start.dot(this.normal) + this.constant) / r;
  40773. if (!(o < 0 || 1 < o))
  40774. return i.copy(n).multiplyScalar(o).add(e.start)
  40775. } else if (0 === this.distanceToPoint(e.start))
  40776. return i.copy(e.start)
  40777. }
  40778. ),
  40779. intersectsLine: function(e) {
  40780. var t = this.distanceToPoint(e.start)
  40781. , i = this.distanceToPoint(e.end);
  40782. return t < 0 && 0 < i || i < 0 && 0 < t
  40783. },
  40784. intersectsBox: function(e) {
  40785. return e.intersectsPlane(this)
  40786. },
  40787. intersectsSphere: function(e) {
  40788. return e.intersectsPlane(this)
  40789. },
  40790. coplanarPoint: function(e) {
  40791. return (e || new Ci.Vector3).copy(this.normal).multiplyScalar(-this.constant)
  40792. },
  40793. applyMatrix4: (L = new Ci.Vector3,
  40794. D = new Ci.Vector3,
  40795. N = new Ci.Matrix3,
  40796. function(e, t) {
  40797. var i = t || N.getNormalMatrix(e)
  40798. , n = L.copy(this.normal).applyMatrix3(i)
  40799. , r = this.coplanarPoint(D);
  40800. return r.applyMatrix4(e),
  40801. this.setFromNormalAndCoplanarPoint(n, r),
  40802. this
  40803. }
  40804. ),
  40805. translate: function(e) {
  40806. return this.constant = this.constant - e.dot(this.normal),
  40807. this
  40808. },
  40809. equals: function(e) {
  40810. return e.normal.equals(this.normal) && e.constant === this.constant
  40811. }
  40812. },
  40813. Ci.Spherical = function(e, t, i) {
  40814. return this.radius = void 0 !== e ? e : 1,
  40815. this.phi = void 0 !== t ? t : 0,
  40816. this.theta = void 0 !== i ? i : 0,
  40817. this
  40818. }
  40819. ,
  40820. Ci.Spherical.prototype = {
  40821. constructor: Ci.Spherical,
  40822. set: function(e, t, i) {
  40823. this.radius = e,
  40824. this.phi = t,
  40825. this.theta = i
  40826. },
  40827. clone: function() {
  40828. return (new this.constructor).copy(this)
  40829. },
  40830. copy: function(e) {
  40831. return this.radius.copy(e.radius),
  40832. this.phi.copy(e.phi),
  40833. this.theta.copy(e.theta),
  40834. this
  40835. },
  40836. makeSafe: function() {
  40837. this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi))
  40838. },
  40839. setFromVector3: function(e) {
  40840. return this.radius = e.length(),
  40841. 0 === this.radius ? (this.theta = 0,
  40842. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  40843. this.phi = Math.acos(Ci.Math.clamp(e.y / this.radius, -1, 1))),
  40844. this
  40845. }
  40846. },
  40847. Ci.Math = {
  40848. generateUUID: (R = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),
  40849. P = new Array(36),
  40850. O = 0,
  40851. function() {
  40852. for (var e = 0; e < 36; e++)
  40853. 8 === e || 13 === e || 18 === e || 23 === e ? P[e] = "-" : 14 === e ? P[e] = "4" : (O <= 2 && (O = 33554432 + 16777216 * Math.random() | 0),
  40854. M = 15 & O,
  40855. O >>= 4,
  40856. P[e] = R[19 === e ? 3 & M | 8 : M]);
  40857. return P.join("")
  40858. }
  40859. ),
  40860. clamp: function(e, t, i) {
  40861. return Math.max(t, Math.min(i, e))
  40862. },
  40863. euclideanModulo: function(e, t) {
  40864. return (e % t + t) % t
  40865. },
  40866. mapLinear: function(e, t, i, n, r) {
  40867. return n + (e - t) * (r - n) / (i - t)
  40868. },
  40869. smoothstep: function(e, t, i) {
  40870. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * (3 - 2 * e)
  40871. },
  40872. smootherstep: function(e, t, i) {
  40873. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * e * (e * (6 * e - 15) + 10)
  40874. },
  40875. random16: function() {
  40876. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  40877. Math.random()
  40878. },
  40879. randInt: function(e, t) {
  40880. return e + Math.floor(Math.random() * (t - e + 1))
  40881. },
  40882. randFloat: function(e, t) {
  40883. return e + Math.random() * (t - e)
  40884. },
  40885. randFloatSpread: function(e) {
  40886. return e * (.5 - Math.random())
  40887. },
  40888. degToRad: (S = Math.PI / 180,
  40889. function(e) {
  40890. return e * S
  40891. }
  40892. ),
  40893. radToDeg: (x = 180 / Math.PI,
  40894. function(e) {
  40895. return e * x
  40896. }
  40897. ),
  40898. isPowerOfTwo: function(e) {
  40899. return 0 == (e & e - 1) && 0 !== e
  40900. },
  40901. nearestPowerOfTwo: function(e) {
  40902. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  40903. },
  40904. nextPowerOfTwo: function(e) {
  40905. return e--,
  40906. e |= e >> 1,
  40907. e |= e >> 2,
  40908. e |= e >> 4,
  40909. e |= e >> 8,
  40910. e |= e >> 16,
  40911. ++e
  40912. }
  40913. },
  40914. Ci.Spline = function(e) {
  40915. function t(e, t, i, n, r, o, a) {
  40916. var s = .5 * (i - e)
  40917. , l = .5 * (n - t);
  40918. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  40919. }
  40920. this.points = e;
  40921. var i, n, r, o, a, s, l, c, h, u = [], d = {
  40922. x: 0,
  40923. y: 0,
  40924. z: 0
  40925. };
  40926. this.initFromArray = function(e) {
  40927. this.points = [];
  40928. for (var t = 0; t < e.length; t++)
  40929. this.points[t] = {
  40930. x: e[t][0],
  40931. y: e[t][1],
  40932. z: e[t][2]
  40933. }
  40934. }
  40935. ,
  40936. this.getPoint = function(e) {
  40937. return i = (this.points.length - 1) * e,
  40938. n = Math.floor(i),
  40939. r = i - n,
  40940. u[0] = 0 === n ? n : n - 1,
  40941. u[1] = n,
  40942. u[2] = n > this.points.length - 2 ? this.points.length - 1 : n + 1,
  40943. u[3] = n > this.points.length - 3 ? this.points.length - 1 : n + 2,
  40944. s = this.points[u[0]],
  40945. l = this.points[u[1]],
  40946. c = this.points[u[2]],
  40947. h = this.points[u[3]],
  40948. a = r * (o = r * r),
  40949. d.x = t(s.x, l.x, c.x, h.x, r, o, a),
  40950. d.y = t(s.y, l.y, c.y, h.y, r, o, a),
  40951. d.z = t(s.z, l.z, c.z, h.z, r, o, a),
  40952. d
  40953. }
  40954. ,
  40955. this.getControlPointsArray = function() {
  40956. var e, t, i = this.points.length, n = [];
  40957. for (e = 0; e < i; e++)
  40958. t = this.points[e],
  40959. n[e] = [t.x, t.y, t.z];
  40960. return n
  40961. }
  40962. ,
  40963. this.getLength = function(e) {
  40964. var t, i, n, r, o = 0, a = 0, s = 0, l = new Ci.Vector3, c = new Ci.Vector3, h = [], u = 0;
  40965. for (h[0] = 0,
  40966. e = e || 100,
  40967. n = this.points.length * e,
  40968. l.copy(this.points[0]),
  40969. t = 1; t < n; t++)
  40970. i = t / n,
  40971. r = this.getPoint(i),
  40972. c.copy(r),
  40973. u += c.distanceTo(l),
  40974. l.copy(r),
  40975. o = (this.points.length - 1) * i,
  40976. (a = Math.floor(o)) !== s && (h[a] = u,
  40977. s = a);
  40978. return h[h.length] = u,
  40979. {
  40980. chunks: h,
  40981. total: u
  40982. }
  40983. }
  40984. ,
  40985. this.reparametrizeByArcLength = function(e) {
  40986. var t, i, n, r, o, a, s, l, c = [], h = new Ci.Vector3, u = this.getLength();
  40987. for (c.push(h.copy(this.points[0]).clone()),
  40988. t = 1; t < this.points.length; t++) {
  40989. for (a = u.chunks[t] - u.chunks[t - 1],
  40990. s = Math.ceil(e * a / u.total),
  40991. r = (t - 1) / (this.points.length - 1),
  40992. o = t / (this.points.length - 1),
  40993. i = 1; i < s - 1; i++)
  40994. n = r + i * (1 / s) * (o - r),
  40995. l = this.getPoint(n),
  40996. c.push(h.copy(l).clone());
  40997. c.push(h.copy(this.points[t]).clone())
  40998. }
  40999. this.points = c
  41000. }
  41001. }
  41002. ,
  41003. Ci.Triangle = function(e, t, i) {
  41004. this.a = void 0 !== e ? e : new Ci.Vector3,
  41005. this.b = void 0 !== t ? t : new Ci.Vector3,
  41006. this.c = void 0 !== i ? i : new Ci.Vector3
  41007. }
  41008. ,
  41009. Ci.Triangle.normal = (T = new Ci.Vector3,
  41010. function(e, t, i, n) {
  41011. var r = n || new Ci.Vector3;
  41012. r.subVectors(i, t),
  41013. T.subVectors(e, t),
  41014. r.cross(T);
  41015. var o = r.lengthSq();
  41016. return 0 < o ? r.multiplyScalar(1 / Math.sqrt(o)) : r.set(0, 0, 0)
  41017. }
  41018. ),
  41019. Ci.Triangle.barycoordFromPoint = (_ = new Ci.Vector3,
  41020. b = new Ci.Vector3,
  41021. w = new Ci.Vector3,
  41022. function(e, t, i, n, r) {
  41023. _.subVectors(n, t),
  41024. b.subVectors(i, t),
  41025. w.subVectors(e, t);
  41026. var o = _.dot(_)
  41027. , a = _.dot(b)
  41028. , s = _.dot(w)
  41029. , l = b.dot(b)
  41030. , c = b.dot(w)
  41031. , h = o * l - a * a
  41032. , u = r || new Ci.Vector3;
  41033. if (0 == h)
  41034. return u.set(-2, -1, -1);
  41035. var d = 1 / h
  41036. , p = (l * s - a * c) * d
  41037. , f = (o * c - a * s) * d;
  41038. return u.set(1 - p - f, f, p)
  41039. }
  41040. ),
  41041. Ci.Triangle.containsPoint = (E = new Ci.Vector3,
  41042. function(e, t, i, n) {
  41043. var r = Ci.Triangle.barycoordFromPoint(e, t, i, n, E);
  41044. return 0 <= r.x && 0 <= r.y && r.x + r.y <= 1
  41045. }
  41046. ),
  41047. Ci.Triangle.prototype = {
  41048. constructor: Ci.Triangle,
  41049. set: function(e, t, i) {
  41050. return this.a.copy(e),
  41051. this.b.copy(t),
  41052. this.c.copy(i),
  41053. this
  41054. },
  41055. setFromPointsAndIndices: function(e, t, i, n) {
  41056. return this.a.copy(e[t]),
  41057. this.b.copy(e[i]),
  41058. this.c.copy(e[n]),
  41059. this
  41060. },
  41061. clone: function() {
  41062. return (new this.constructor).copy(this)
  41063. },
  41064. copy: function(e) {
  41065. return this.a.copy(e.a),
  41066. this.b.copy(e.b),
  41067. this.c.copy(e.c),
  41068. this
  41069. },
  41070. area: (C = new Ci.Vector3,
  41071. I = new Ci.Vector3,
  41072. function() {
  41073. return C.subVectors(this.c, this.b),
  41074. I.subVectors(this.a, this.b),
  41075. .5 * C.cross(I).length()
  41076. }
  41077. ),
  41078. midpoint: function(e) {
  41079. return (e || new Ci.Vector3).addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  41080. },
  41081. normal: function(e) {
  41082. return Ci.Triangle.normal(this.a, this.b, this.c, e)
  41083. },
  41084. plane: function(e) {
  41085. return (e || new Ci.Plane).setFromCoplanarPoints(this.a, this.b, this.c)
  41086. },
  41087. barycoordFromPoint: function(e, t) {
  41088. return Ci.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  41089. },
  41090. containsPoint: function(e) {
  41091. return Ci.Triangle.containsPoint(e, this.a, this.b, this.c)
  41092. },
  41093. equals: function(e) {
  41094. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  41095. }
  41096. },
  41097. Ci.Interpolant = function(e, t, i, n) {
  41098. this.parameterPositions = e,
  41099. this._cachedIndex = 0,
  41100. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  41101. this.sampleValues = t,
  41102. this.valueSize = i
  41103. }
  41104. ,
  41105. Ci.Interpolant.prototype = {
  41106. constructor: Ci.Interpolant,
  41107. evaluate: function(e) {
  41108. var t = this.parameterPositions
  41109. , i = this._cachedIndex
  41110. , n = t[i]
  41111. , r = t[i - 1];
  41112. e: {
  41113. t: {
  41114. var o;
  41115. i: {
  41116. n: if (!(e < n)) {
  41117. for (var a = i + 2; ; ) {
  41118. if (void 0 === n) {
  41119. if (e < r)
  41120. break n;
  41121. return i = t.length,
  41122. this._cachedIndex = i,
  41123. this.afterEnd_(i - 1, e, r)
  41124. }
  41125. if (i === a)
  41126. break;
  41127. if (r = n,
  41128. e < (n = t[++i]))
  41129. break t
  41130. }
  41131. o = t.length;
  41132. break i
  41133. }
  41134. if (r <= e)
  41135. break e;
  41136. var s = t[1];
  41137. e < s && (i = 2,
  41138. r = s);
  41139. for (a = i - 2; ; ) {
  41140. if (void 0 === r)
  41141. return this._cachedIndex = 0,
  41142. this.beforeStart_(0, e, n);
  41143. if (i === a)
  41144. break;
  41145. if (n = r,
  41146. (r = t[--i - 1]) <= e)
  41147. break t
  41148. }
  41149. o = i,
  41150. i = 0
  41151. }
  41152. for (; i < o; ) {
  41153. var l = i + o >>> 1;
  41154. e < t[l] ? o = l : i = 1 + l
  41155. }
  41156. if (n = t[i],
  41157. void 0 === (r = t[i - 1]))
  41158. return this._cachedIndex = 0,
  41159. this.beforeStart_(0, e, n);
  41160. if (void 0 === n)
  41161. return i = t.length,
  41162. this._cachedIndex = i,
  41163. this.afterEnd_(i - 1, r, e)
  41164. }
  41165. this._cachedIndex = i,
  41166. this.intervalChanged_(i, r, n)
  41167. }
  41168. return this.interpolate_(i, r, e, n)
  41169. },
  41170. settings: null,
  41171. DefaultSettings_: {},
  41172. getSettings_: function() {
  41173. return this.settings || this.DefaultSettings_
  41174. },
  41175. copySampleValue_: function(e) {
  41176. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  41177. t[o] = i[r + o];
  41178. return t
  41179. },
  41180. interpolate_: function(e, t, i, n) {
  41181. throw new Error("call to abstract method")
  41182. },
  41183. intervalChanged_: function(e, t, i) {}
  41184. },
  41185. Object.assign(Ci.Interpolant.prototype, {
  41186. beforeStart_: Ci.Interpolant.prototype.copySampleValue_,
  41187. afterEnd_: Ci.Interpolant.prototype.copySampleValue_
  41188. }),
  41189. Ci.CubicInterpolant = function(e, t, i, n) {
  41190. Ci.Interpolant.call(this, e, t, i, n),
  41191. this._weightPrev = -0,
  41192. this._offsetPrev = -0,
  41193. this._weightNext = -0,
  41194. this._offsetNext = -0
  41195. }
  41196. ,
  41197. Ci.CubicInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41198. constructor: Ci.CubicInterpolant,
  41199. DefaultSettings_: {
  41200. endingStart: Ci.ZeroCurvatureEnding,
  41201. endingEnd: Ci.ZeroCurvatureEnding
  41202. },
  41203. intervalChanged_: function(e, t, i) {
  41204. var n = this.parameterPositions
  41205. , r = e - 2
  41206. , o = e + 1
  41207. , a = n[r]
  41208. , s = n[o];
  41209. if (void 0 === a)
  41210. switch (this.getSettings_().endingStart) {
  41211. case Ci.ZeroSlopeEnding:
  41212. r = e,
  41213. a = 2 * t - i;
  41214. break;
  41215. case Ci.WrapAroundEnding:
  41216. a = t + n[r = n.length - 2] - n[r + 1];
  41217. break;
  41218. default:
  41219. r = e,
  41220. a = i
  41221. }
  41222. if (void 0 === s)
  41223. switch (this.getSettings_().endingEnd) {
  41224. case Ci.ZeroSlopeEnding:
  41225. o = e,
  41226. s = 2 * i - t;
  41227. break;
  41228. case Ci.WrapAroundEnding:
  41229. s = i + n[o = 1] - n[0];
  41230. break;
  41231. default:
  41232. o = e - 1,
  41233. s = t
  41234. }
  41235. var l = .5 * (i - t)
  41236. , c = this.valueSize;
  41237. this._weightPrev = l / (t - a),
  41238. this._weightNext = l / (s - i),
  41239. this._offsetPrev = r * c,
  41240. this._offsetNext = o * c
  41241. },
  41242. interpolate_: function(e, t, i, n) {
  41243. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = s - a, c = this._offsetPrev, h = this._offsetNext, u = this._weightPrev, d = this._weightNext, p = (i - t) / (n - t), f = p * p, g = f * p, m = -u * g + 2 * u * f - u * p, v = (1 + u) * g + (-1.5 - 2 * u) * f + (-.5 + u) * p + 1, y = (-1 - d) * g + (1.5 + d) * f + .5 * p, A = d * g - d * f, C = 0; C !== a; ++C)
  41244. r[C] = m * o[c + C] + v * o[l + C] + y * o[s + C] + A * o[h + C];
  41245. return r
  41246. }
  41247. }),
  41248. Ci.DiscreteInterpolant = function(e, t, i, n) {
  41249. Ci.Interpolant.call(this, e, t, i, n)
  41250. }
  41251. ,
  41252. Ci.DiscreteInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41253. constructor: Ci.DiscreteInterpolant,
  41254. interpolate_: function(e, t, i, n) {
  41255. return this.copySampleValue_(e - 1)
  41256. }
  41257. }),
  41258. Ci.LinearInterpolant = function(e, t, i, n) {
  41259. Ci.Interpolant.call(this, e, t, i, n)
  41260. }
  41261. ,
  41262. Ci.LinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41263. constructor: Ci.LinearInterpolant,
  41264. interpolate_: function(e, t, i, n) {
  41265. 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)
  41266. r[u] = o[l + u] * h + o[s + u] * c;
  41267. return r
  41268. }
  41269. }),
  41270. Ci.QuaternionLinearInterpolant = function(e, t, i, n) {
  41271. Ci.Interpolant.call(this, e, t, i, n)
  41272. }
  41273. ,
  41274. Ci.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41275. constructor: Ci.QuaternionLinearInterpolant,
  41276. interpolate_: function(e, t, i, n) {
  41277. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = (i - t) / (n - t), c = s + a; s !== c; s += 4)
  41278. Ci.Quaternion.slerpFlat(r, 0, o, s - a, o, s, l);
  41279. return r
  41280. }
  41281. }),
  41282. Ci.Clock = function(e) {
  41283. this.autoStart = void 0 === e || e,
  41284. this.startTime = 0,
  41285. this.oldTime = 0,
  41286. this.elapsedTime = 0,
  41287. this.running = !1
  41288. }
  41289. ,
  41290. Ci.Clock.prototype = {
  41291. constructor: Ci.Clock,
  41292. start: function() {
  41293. this.startTime = performance.now(),
  41294. this.oldTime = this.startTime,
  41295. this.running = !0
  41296. },
  41297. stop: function() {
  41298. this.getElapsedTime(),
  41299. this.running = !1
  41300. },
  41301. getElapsedTime: function() {
  41302. return this.getDelta(),
  41303. this.elapsedTime
  41304. },
  41305. getDelta: function() {
  41306. var e = 0;
  41307. if (this.autoStart && !this.running && this.start(),
  41308. this.running) {
  41309. var t = performance.now();
  41310. e = .001 * (t - this.oldTime),
  41311. this.oldTime = t,
  41312. this.elapsedTime += e
  41313. }
  41314. return e
  41315. }
  41316. },
  41317. Ci.EventDispatcher = function() {}
  41318. ,
  41319. Ci.EventDispatcher.prototype = {
  41320. constructor: Ci.EventDispatcher,
  41321. apply: function(e) {
  41322. e.addEventListener = Ci.EventDispatcher.prototype.addEventListener,
  41323. e.hasEventListener = Ci.EventDispatcher.prototype.hasEventListener,
  41324. e.removeEventListener = Ci.EventDispatcher.prototype.removeEventListener,
  41325. e.dispatchEvent = Ci.EventDispatcher.prototype.dispatchEvent
  41326. },
  41327. addEventListener: function(e, t) {
  41328. void 0 === this._listeners && (this._listeners = {});
  41329. var i = this._listeners;
  41330. void 0 === i[e] && (i[e] = []),
  41331. -1 === i[e].indexOf(t) && i[e].push(t)
  41332. },
  41333. hasEventListener: function(e, t) {
  41334. if (void 0 === this._listeners)
  41335. return !1;
  41336. var i = this._listeners;
  41337. return void 0 !== i[e] && -1 !== i[e].indexOf(t)
  41338. },
  41339. removeEventListener: function(e, t) {
  41340. if (void 0 !== this._listeners) {
  41341. var i = this._listeners[e];
  41342. if (void 0 !== i) {
  41343. var n = i.indexOf(t);
  41344. -1 !== n && i.splice(n, 1)
  41345. }
  41346. }
  41347. },
  41348. dispatchEvent: function(e) {
  41349. if (void 0 !== this._listeners) {
  41350. var t = this._listeners[e.type];
  41351. if (void 0 !== t) {
  41352. e.target = this;
  41353. for (var i = [], n = t.length, r = 0; r < n; r++)
  41354. i[r] = t[r];
  41355. for (r = 0; r < n; r++)
  41356. i[r].call(this, e)
  41357. }
  41358. }
  41359. }
  41360. },
  41361. Ci.Layers = function() {
  41362. this.mask = 1
  41363. }
  41364. ,
  41365. Ci.Layers.prototype = {
  41366. constructor: Ci.Layers,
  41367. set: function(e) {
  41368. this.mask = 1 << e
  41369. },
  41370. enable: function(e) {
  41371. this.mask |= 1 << e
  41372. },
  41373. toggle: function(e) {
  41374. this.mask ^= 1 << e
  41375. },
  41376. disable: function(e) {
  41377. this.mask &= ~(1 << e)
  41378. },
  41379. test: function(e) {
  41380. return 0 != (this.mask & e.mask)
  41381. }
  41382. },
  41383. (A = Ci).Raycaster = function(e, t, i, n) {
  41384. this.ray = new A.Ray(e,t),
  41385. this.near = i || 0,
  41386. this.far = n || 1 / 0,
  41387. this.params = {
  41388. Mesh: {},
  41389. Line: {},
  41390. LOD: {},
  41391. Points: {
  41392. threshold: 1
  41393. },
  41394. Sprite: {}
  41395. },
  41396. Object.defineProperties(this.params, {
  41397. PointCloud: {
  41398. get: function() {
  41399. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  41400. this.Points
  41401. }
  41402. }
  41403. })
  41404. }
  41405. ,
  41406. A.Raycaster.prototype = {
  41407. constructor: A.Raycaster,
  41408. linePrecision: 1,
  41409. set: function(e, t) {
  41410. this.ray.set(e, t)
  41411. },
  41412. setFromCamera: function(e, t) {
  41413. t instanceof A.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld),
  41414. this.ray.direction.set(e.x, e.y, .5).unproject(t).sub(this.ray.origin).normalize()) : t instanceof A.OrthographicCamera ? (this.ray.origin.set(e.x, e.y, -1).unproject(t),
  41415. this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  41416. },
  41417. intersectObject: function(e, t) {
  41418. var i = [];
  41419. return Ei(e, this, i, t),
  41420. i.sort(Ii),
  41421. i
  41422. },
  41423. intersectObjects: function(e, t) {
  41424. var i = [];
  41425. if (!1 === Array.isArray(e))
  41426. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  41427. i;
  41428. for (var n = 0, r = e.length; n < r; n++)
  41429. Ei(e[n], this, i, t);
  41430. return i.sort(Ii),
  41431. i
  41432. }
  41433. },
  41434. Ci.Object3D = function() {
  41435. Object.defineProperty(this, "id", {
  41436. value: Ci.Object3DIdCount++
  41437. }),
  41438. this.uuid = Ci.Math.generateUUID(),
  41439. this.name = "",
  41440. this.type = "Object3D",
  41441. this.parent = null,
  41442. this.children = [],
  41443. this.up = Ci.Object3D.DefaultUp.clone();
  41444. var e = new Ci.Vector3
  41445. , t = new Ci.Euler
  41446. , i = new Ci.Quaternion
  41447. , n = new Ci.Vector3(1,1,1);
  41448. t.onChange(function() {
  41449. i.setFromEuler(t, !1)
  41450. }),
  41451. i.onChange(function() {
  41452. t.setFromQuaternion(i, void 0, !1)
  41453. }),
  41454. Object.defineProperties(this, {
  41455. position: {
  41456. enumerable: !0,
  41457. value: e
  41458. },
  41459. rotation: {
  41460. enumerable: !0,
  41461. value: t
  41462. },
  41463. quaternion: {
  41464. enumerable: !0,
  41465. value: i
  41466. },
  41467. scale: {
  41468. enumerable: !0,
  41469. value: n
  41470. },
  41471. modelViewMatrix: {
  41472. value: new Ci.Matrix4
  41473. },
  41474. normalMatrix: {
  41475. value: new Ci.Matrix3
  41476. }
  41477. }),
  41478. this.rotationAutoUpdate = !0,
  41479. this.matrix = new Ci.Matrix4,
  41480. this.matrixWorld = new Ci.Matrix4,
  41481. this.matrixAutoUpdate = Ci.Object3D.DefaultMatrixAutoUpdate,
  41482. this.matrixWorldNeedsUpdate = !1,
  41483. this.layers = new Ci.Layers,
  41484. this.visible = !0,
  41485. this.castShadow = !1,
  41486. this.receiveShadow = !1,
  41487. this.frustumCulled = !0,
  41488. this.renderOrder = 0,
  41489. this.userData = {}
  41490. }
  41491. ,
  41492. Ci.Object3D.DefaultUp = new Ci.Vector3(0,1,0),
  41493. Ci.Object3D.DefaultMatrixAutoUpdate = !0,
  41494. Ci.Object3D.prototype = {
  41495. constructor: Ci.Object3D,
  41496. applyMatrix: function(e) {
  41497. this.matrix.multiplyMatrices(e, this.matrix),
  41498. this.matrix.decompose(this.position, this.quaternion, this.scale)
  41499. },
  41500. setRotationFromAxisAngle: function(e, t) {
  41501. this.quaternion.setFromAxisAngle(e, t)
  41502. },
  41503. setRotationFromEuler: function(e) {
  41504. this.quaternion.setFromEuler(e, !0)
  41505. },
  41506. setRotationFromMatrix: function(e) {
  41507. this.quaternion.setFromRotationMatrix(e)
  41508. },
  41509. setRotationFromQuaternion: function(e) {
  41510. this.quaternion.copy(e)
  41511. },
  41512. rotateOnAxis: (y = new Ci.Quaternion,
  41513. function(e, t) {
  41514. return y.setFromAxisAngle(e, t),
  41515. this.quaternion.multiply(y),
  41516. this
  41517. }
  41518. ),
  41519. rotateX: (v = new Ci.Vector3(1,0,0),
  41520. function(e) {
  41521. return this.rotateOnAxis(v, e)
  41522. }
  41523. ),
  41524. rotateY: (m = new Ci.Vector3(0,1,0),
  41525. function(e) {
  41526. return this.rotateOnAxis(m, e)
  41527. }
  41528. ),
  41529. rotateZ: (g = new Ci.Vector3(0,0,1),
  41530. function(e) {
  41531. return this.rotateOnAxis(g, e)
  41532. }
  41533. ),
  41534. translateOnAxis: (f = new Ci.Vector3,
  41535. function(e, t) {
  41536. return f.copy(e).applyQuaternion(this.quaternion),
  41537. this.position.add(f.multiplyScalar(t)),
  41538. this
  41539. }
  41540. ),
  41541. translateX: (p = new Ci.Vector3(1,0,0),
  41542. function(e) {
  41543. return this.translateOnAxis(p, e)
  41544. }
  41545. ),
  41546. translateY: (d = new Ci.Vector3(0,1,0),
  41547. function(e) {
  41548. return this.translateOnAxis(d, e)
  41549. }
  41550. ),
  41551. translateZ: (u = new Ci.Vector3(0,0,1),
  41552. function(e) {
  41553. return this.translateOnAxis(u, e)
  41554. }
  41555. ),
  41556. localToWorld: function(e) {
  41557. return e.applyMatrix4(this.matrixWorld)
  41558. },
  41559. worldToLocal: (h = new Ci.Matrix4,
  41560. function(e) {
  41561. return e.applyMatrix4(h.getInverse(this.matrixWorld))
  41562. }
  41563. ),
  41564. lookAt: (c = new Ci.Matrix4,
  41565. function(e) {
  41566. c.lookAt(e, this.position, this.up),
  41567. this.quaternion.setFromRotationMatrix(c)
  41568. }
  41569. ),
  41570. add: function(e) {
  41571. if (1 < arguments.length) {
  41572. for (var t = 0; t < arguments.length; t++)
  41573. this.add(arguments[t]);
  41574. return this
  41575. }
  41576. return e === this ? console.error("THREE.Object3D.add: object can't be added as a child of itself.", e) : e instanceof Ci.Object3D ? (null !== e.parent && e.parent.remove(e),
  41577. e.parent = this,
  41578. e.dispatchEvent({
  41579. type: "added"
  41580. }),
  41581. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  41582. this
  41583. },
  41584. remove: function(e) {
  41585. if (1 < arguments.length)
  41586. for (var t = 0; t < arguments.length; t++)
  41587. this.remove(arguments[t]);
  41588. var i = this.children.indexOf(e);
  41589. -1 !== i && (e.parent = null,
  41590. e.dispatchEvent({
  41591. type: "removed"
  41592. }),
  41593. this.children.splice(i, 1))
  41594. },
  41595. getObjectById: function(e) {
  41596. return this.getObjectByProperty("id", e)
  41597. },
  41598. getObjectByName: function(e) {
  41599. return this.getObjectByProperty("name", e)
  41600. },
  41601. getObjectByProperty: function(e, t) {
  41602. if (this[e] === t)
  41603. return this;
  41604. for (var i = 0, n = this.children.length; i < n; i++) {
  41605. var r = this.children[i].getObjectByProperty(e, t);
  41606. if (void 0 !== r)
  41607. return r
  41608. }
  41609. },
  41610. getWorldPosition: function(e) {
  41611. var t = e || new Ci.Vector3;
  41612. return this.updateMatrixWorld(!0),
  41613. t.setFromMatrixPosition(this.matrixWorld)
  41614. },
  41615. getWorldQuaternion: (s = new Ci.Vector3,
  41616. l = new Ci.Vector3,
  41617. function(e) {
  41618. var t = e || new Ci.Quaternion;
  41619. return this.updateMatrixWorld(!0),
  41620. this.matrixWorld.decompose(s, t, l),
  41621. t
  41622. }
  41623. ),
  41624. getWorldRotation: (a = new Ci.Quaternion,
  41625. function(e) {
  41626. var t = e || new Ci.Euler;
  41627. return this.getWorldQuaternion(a),
  41628. t.setFromQuaternion(a, this.rotation.order, !1)
  41629. }
  41630. ),
  41631. getWorldScale: (r = new Ci.Vector3,
  41632. o = new Ci.Quaternion,
  41633. function(e) {
  41634. var t = e || new Ci.Vector3;
  41635. return this.updateMatrixWorld(!0),
  41636. this.matrixWorld.decompose(r, o, t),
  41637. t
  41638. }
  41639. ),
  41640. getWorldDirection: (n = new Ci.Quaternion,
  41641. function(e) {
  41642. var t = e || new Ci.Vector3;
  41643. return this.getWorldQuaternion(n),
  41644. t.set(0, 0, 1).applyQuaternion(n)
  41645. }
  41646. ),
  41647. raycast: function() {},
  41648. traverse: function(e) {
  41649. e(this);
  41650. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41651. t[i].traverse(e)
  41652. },
  41653. traverseVisible: function(e) {
  41654. if (!1 !== this.visible) {
  41655. e(this);
  41656. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41657. t[i].traverseVisible(e)
  41658. }
  41659. },
  41660. traverseAncestors: function(e) {
  41661. var t = this.parent;
  41662. null !== t && (e(t),
  41663. t.traverseAncestors(e))
  41664. },
  41665. updateMatrix: function() {
  41666. this.matrix.compose(this.position, this.quaternion, this.scale),
  41667. this.matrixWorldNeedsUpdate = !0
  41668. },
  41669. updateMatrixWorld: function(e) {
  41670. !0 === this.matrixAutoUpdate && this.updateMatrix(),
  41671. !0 !== this.matrixWorldNeedsUpdate && !0 !== e || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  41672. e = !(this.matrixWorldNeedsUpdate = !1));
  41673. for (var t = 0, i = this.children.length; t < i; t++)
  41674. this.children[t].updateMatrixWorld(e)
  41675. },
  41676. toJSON: function(e) {
  41677. function t(e) {
  41678. var t = [];
  41679. for (var i in e) {
  41680. var n = e[i];
  41681. delete n.metadata,
  41682. t.push(n)
  41683. }
  41684. return t
  41685. }
  41686. var i = void 0 === e
  41687. , n = {};
  41688. i && (e = {
  41689. geometries: {},
  41690. materials: {},
  41691. textures: {},
  41692. images: {}
  41693. },
  41694. n.metadata = {
  41695. version: 4.4,
  41696. type: "Object",
  41697. generator: "Object3D.toJSON"
  41698. });
  41699. var r = {};
  41700. if (r.uuid = this.uuid,
  41701. r.type = this.type,
  41702. "" !== this.name && (r.name = this.name),
  41703. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  41704. !0 === this.castShadow && (r.castShadow = !0),
  41705. !0 === this.receiveShadow && (r.receiveShadow = !0),
  41706. !1 === this.visible && (r.visible = !1),
  41707. r.matrix = this.matrix.toArray(),
  41708. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  41709. r.geometry = this.geometry.uuid),
  41710. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  41711. r.material = this.material.uuid),
  41712. 0 < this.children.length) {
  41713. r.children = [];
  41714. for (var o = 0; o < this.children.length; o++)
  41715. r.children.push(this.children[o].toJSON(e).object)
  41716. }
  41717. if (i) {
  41718. var a = t(e.geometries)
  41719. , s = t(e.materials)
  41720. , l = t(e.textures)
  41721. , c = t(e.images);
  41722. 0 < a.length && (n.geometries = a),
  41723. 0 < s.length && (n.materials = s),
  41724. 0 < l.length && (n.textures = l),
  41725. 0 < c.length && (n.images = c)
  41726. }
  41727. return n.object = r,
  41728. n
  41729. },
  41730. clone: function(e) {
  41731. return (new this.constructor).copy(this, e)
  41732. },
  41733. copy: function(e, t) {
  41734. if (void 0 === t && (t = !0),
  41735. this.name = e.name,
  41736. this.up.copy(e.up),
  41737. this.position.copy(e.position),
  41738. this.quaternion.copy(e.quaternion),
  41739. this.scale.copy(e.scale),
  41740. this.rotationAutoUpdate = e.rotationAutoUpdate,
  41741. this.matrix.copy(e.matrix),
  41742. this.matrixWorld.copy(e.matrixWorld),
  41743. this.matrixAutoUpdate = e.matrixAutoUpdate,
  41744. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  41745. this.visible = e.visible,
  41746. this.castShadow = e.castShadow,
  41747. this.receiveShadow = e.receiveShadow,
  41748. this.frustumCulled = e.frustumCulled,
  41749. this.renderOrder = e.renderOrder,
  41750. this.userData = JSON.parse(JSON.stringify(e.userData)),
  41751. !0 === t)
  41752. for (var i = 0; i < e.children.length; i++) {
  41753. var n = e.children[i];
  41754. this.add(n.clone())
  41755. }
  41756. return this
  41757. }
  41758. },
  41759. Ci.EventDispatcher.prototype.apply(Ci.Object3D.prototype),
  41760. Ci.Object3DIdCount = 0,
  41761. Ci.Face3 = function(e, t, i, n, r, o) {
  41762. this.a = e,
  41763. this.b = t,
  41764. this.c = i,
  41765. this.normal = n instanceof Ci.Vector3 ? n : new Ci.Vector3,
  41766. this.vertexNormals = Array.isArray(n) ? n : [],
  41767. this.color = r instanceof Ci.Color ? r : new Ci.Color,
  41768. this.vertexColors = Array.isArray(r) ? r : [],
  41769. this.materialIndex = void 0 !== o ? o : 0
  41770. }
  41771. ,
  41772. Ci.Face3.prototype = {
  41773. constructor: Ci.Face3,
  41774. clone: function() {
  41775. return (new this.constructor).copy(this)
  41776. },
  41777. copy: function(e) {
  41778. this.a = e.a,
  41779. this.b = e.b,
  41780. this.c = e.c,
  41781. this.normal.copy(e.normal),
  41782. this.color.copy(e.color),
  41783. this.materialIndex = e.materialIndex;
  41784. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  41785. this.vertexNormals[t] = e.vertexNormals[t].clone();
  41786. for (t = 0,
  41787. i = e.vertexColors.length; t < i; t++)
  41788. this.vertexColors[t] = e.vertexColors[t].clone();
  41789. return this
  41790. }
  41791. },
  41792. Ci.BufferAttribute = function(e, t) {
  41793. this.uuid = Ci.Math.generateUUID(),
  41794. this.array = e,
  41795. this.itemSize = t,
  41796. this.dynamic = !1,
  41797. this.updateRange = {
  41798. offset: 0,
  41799. count: -1
  41800. },
  41801. this.version = 0
  41802. }
  41803. ,
  41804. Ci.BufferAttribute.prototype = {
  41805. constructor: Ci.BufferAttribute,
  41806. get count() {
  41807. return this.array.length / this.itemSize
  41808. },
  41809. set needsUpdate(e) {
  41810. !0 === e && this.version++
  41811. },
  41812. setDynamic: function(e) {
  41813. return this.dynamic = e,
  41814. this
  41815. },
  41816. copy: function(e) {
  41817. return this.array = new e.array.constructor(e.array),
  41818. this.itemSize = e.itemSize,
  41819. this.dynamic = e.dynamic,
  41820. this
  41821. },
  41822. copyAt: function(e, t, i) {
  41823. e *= this.itemSize,
  41824. i *= t.itemSize;
  41825. for (var n = 0, r = this.itemSize; n < r; n++)
  41826. this.array[e + n] = t.array[i + n];
  41827. return this
  41828. },
  41829. copyArray: function(e) {
  41830. return this.array.set(e),
  41831. this
  41832. },
  41833. copyColorsArray: function(e) {
  41834. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41835. var o = e[n];
  41836. void 0 === o && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", n),
  41837. o = new Ci.Color),
  41838. t[i++] = o.r,
  41839. t[i++] = o.g,
  41840. t[i++] = o.b
  41841. }
  41842. return this
  41843. },
  41844. copyIndicesArray: function(e) {
  41845. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41846. var o = e[n];
  41847. t[i++] = o.a,
  41848. t[i++] = o.b,
  41849. t[i++] = o.c
  41850. }
  41851. return this
  41852. },
  41853. copyVector2sArray: function(e) {
  41854. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41855. var o = e[n];
  41856. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", n),
  41857. o = new Ci.Vector2),
  41858. t[i++] = o.x,
  41859. t[i++] = o.y
  41860. }
  41861. return this
  41862. },
  41863. copyVector3sArray: function(e) {
  41864. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41865. var o = e[n];
  41866. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", n),
  41867. o = new Ci.Vector3),
  41868. t[i++] = o.x,
  41869. t[i++] = o.y,
  41870. t[i++] = o.z
  41871. }
  41872. return this
  41873. },
  41874. copyVector4sArray: function(e) {
  41875. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41876. var o = e[n];
  41877. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", n),
  41878. o = new Ci.Vector4),
  41879. t[i++] = o.x,
  41880. t[i++] = o.y,
  41881. t[i++] = o.z,
  41882. t[i++] = o.w
  41883. }
  41884. return this
  41885. },
  41886. set: function(e, t) {
  41887. return void 0 === t && (t = 0),
  41888. this.array.set(e, t),
  41889. this
  41890. },
  41891. getX: function(e) {
  41892. return this.array[e * this.itemSize]
  41893. },
  41894. setX: function(e, t) {
  41895. return this.array[e * this.itemSize] = t,
  41896. this
  41897. },
  41898. getY: function(e) {
  41899. return this.array[e * this.itemSize + 1]
  41900. },
  41901. setY: function(e, t) {
  41902. return this.array[e * this.itemSize + 1] = t,
  41903. this
  41904. },
  41905. getZ: function(e) {
  41906. return this.array[e * this.itemSize + 2]
  41907. },
  41908. setZ: function(e, t) {
  41909. return this.array[e * this.itemSize + 2] = t,
  41910. this
  41911. },
  41912. getW: function(e) {
  41913. return this.array[e * this.itemSize + 3]
  41914. },
  41915. setW: function(e, t) {
  41916. return this.array[e * this.itemSize + 3] = t,
  41917. this
  41918. },
  41919. setXY: function(e, t, i) {
  41920. return e *= this.itemSize,
  41921. this.array[e + 0] = t,
  41922. this.array[e + 1] = i,
  41923. this
  41924. },
  41925. setXYZ: function(e, t, i, n) {
  41926. return e *= this.itemSize,
  41927. this.array[e + 0] = t,
  41928. this.array[e + 1] = i,
  41929. this.array[e + 2] = n,
  41930. this
  41931. },
  41932. setXYZW: function(e, t, i, n, r) {
  41933. return e *= this.itemSize,
  41934. this.array[e + 0] = t,
  41935. this.array[e + 1] = i,
  41936. this.array[e + 2] = n,
  41937. this.array[e + 3] = r,
  41938. this
  41939. },
  41940. clone: function() {
  41941. return (new this.constructor).copy(this)
  41942. }
  41943. },
  41944. Ci.Int8Attribute = function(e, t) {
  41945. return new Ci.BufferAttribute(new Int8Array(e),t)
  41946. }
  41947. ,
  41948. Ci.Uint8Attribute = function(e, t) {
  41949. return new Ci.BufferAttribute(new Uint8Array(e),t)
  41950. }
  41951. ,
  41952. Ci.Uint8ClampedAttribute = function(e, t) {
  41953. return new Ci.BufferAttribute(new Uint8ClampedArray(e),t)
  41954. }
  41955. ,
  41956. Ci.Int16Attribute = function(e, t) {
  41957. return new Ci.BufferAttribute(new Int16Array(e),t)
  41958. }
  41959. ,
  41960. Ci.Uint16Attribute = function(e, t) {
  41961. return new Ci.BufferAttribute(new Uint16Array(e),t)
  41962. }
  41963. ,
  41964. Ci.Int32Attribute = function(e, t) {
  41965. return new Ci.BufferAttribute(new Int32Array(e),t)
  41966. }
  41967. ,
  41968. Ci.Uint32Attribute = function(e, t) {
  41969. return new Ci.BufferAttribute(new Uint32Array(e),t)
  41970. }
  41971. ,
  41972. Ci.Float32Attribute = function(e, t) {
  41973. return new Ci.BufferAttribute(new Float32Array(e),t)
  41974. }
  41975. ,
  41976. Ci.Float64Attribute = function(e, t) {
  41977. return new Ci.BufferAttribute(new Float64Array(e),t)
  41978. }
  41979. ,
  41980. Ci.DynamicBufferAttribute = function(e, t) {
  41981. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  41982. new Ci.BufferAttribute(e,t).setDynamic(!0)
  41983. }
  41984. ,
  41985. Ci.InstancedBufferAttribute = function(e, t, i) {
  41986. Ci.BufferAttribute.call(this, e, t),
  41987. this.meshPerAttribute = i || 1
  41988. }
  41989. ,
  41990. Ci.InstancedBufferAttribute.prototype = Object.create(Ci.BufferAttribute.prototype),
  41991. Ci.InstancedBufferAttribute.prototype.constructor = Ci.InstancedBufferAttribute,
  41992. Ci.InstancedBufferAttribute.prototype.copy = function(e) {
  41993. return Ci.BufferAttribute.prototype.copy.call(this, e),
  41994. this.meshPerAttribute = e.meshPerAttribute,
  41995. this
  41996. }
  41997. ,
  41998. Ci.InterleavedBuffer = function(e, t) {
  41999. this.uuid = Ci.Math.generateUUID(),
  42000. this.array = e,
  42001. this.stride = t,
  42002. this.dynamic = !1,
  42003. this.updateRange = {
  42004. offset: 0,
  42005. count: -1
  42006. },
  42007. this.version = 0
  42008. }
  42009. ,
  42010. Ci.InterleavedBuffer.prototype = {
  42011. constructor: Ci.InterleavedBuffer,
  42012. get length() {
  42013. return this.array.length
  42014. },
  42015. get count() {
  42016. return this.array.length / this.stride
  42017. },
  42018. set needsUpdate(e) {
  42019. !0 === e && this.version++
  42020. },
  42021. setDynamic: function(e) {
  42022. return this.dynamic = e,
  42023. this
  42024. },
  42025. copy: function(e) {
  42026. return this.array = new e.array.constructor(e.array),
  42027. this.stride = e.stride,
  42028. this.dynamic = e.dynamic,
  42029. this
  42030. },
  42031. copyAt: function(e, t, i) {
  42032. e *= this.stride,
  42033. i *= t.stride;
  42034. for (var n = 0, r = this.stride; n < r; n++)
  42035. this.array[e + n] = t.array[i + n];
  42036. return this
  42037. },
  42038. set: function(e, t) {
  42039. return void 0 === t && (t = 0),
  42040. this.array.set(e, t),
  42041. this
  42042. },
  42043. clone: function() {
  42044. return (new this.constructor).copy(this)
  42045. }
  42046. },
  42047. Ci.InstancedInterleavedBuffer = function(e, t, i) {
  42048. Ci.InterleavedBuffer.call(this, e, t),
  42049. this.meshPerAttribute = i || 1
  42050. }
  42051. ,
  42052. Ci.InstancedInterleavedBuffer.prototype = Object.create(Ci.InterleavedBuffer.prototype),
  42053. Ci.InstancedInterleavedBuffer.prototype.constructor = Ci.InstancedInterleavedBuffer,
  42054. Ci.InstancedInterleavedBuffer.prototype.copy = function(e) {
  42055. return Ci.InterleavedBuffer.prototype.copy.call(this, e),
  42056. this.meshPerAttribute = e.meshPerAttribute,
  42057. this
  42058. }
  42059. ,
  42060. Ci.InterleavedBufferAttribute = function(e, t, i) {
  42061. this.uuid = Ci.Math.generateUUID(),
  42062. this.data = e,
  42063. this.itemSize = t,
  42064. this.offset = i
  42065. }
  42066. ,
  42067. Ci.InterleavedBufferAttribute.prototype = {
  42068. constructor: Ci.InterleavedBufferAttribute,
  42069. get length() {
  42070. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  42071. this.array.length
  42072. },
  42073. get count() {
  42074. return this.data.count
  42075. },
  42076. setX: function(e, t) {
  42077. return this.data.array[e * this.data.stride + this.offset] = t,
  42078. this
  42079. },
  42080. setY: function(e, t) {
  42081. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  42082. this
  42083. },
  42084. setZ: function(e, t) {
  42085. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  42086. this
  42087. },
  42088. setW: function(e, t) {
  42089. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  42090. this
  42091. },
  42092. getX: function(e) {
  42093. return this.data.array[e * this.data.stride + this.offset]
  42094. },
  42095. getY: function(e) {
  42096. return this.data.array[e * this.data.stride + this.offset + 1]
  42097. },
  42098. getZ: function(e) {
  42099. return this.data.array[e * this.data.stride + this.offset + 2]
  42100. },
  42101. getW: function(e) {
  42102. return this.data.array[e * this.data.stride + this.offset + 3]
  42103. },
  42104. setXY: function(e, t, i) {
  42105. return e = e * this.data.stride + this.offset,
  42106. this.data.array[e + 0] = t,
  42107. this.data.array[e + 1] = i,
  42108. this
  42109. },
  42110. setXYZ: function(e, t, i, n) {
  42111. return e = e * this.data.stride + this.offset,
  42112. this.data.array[e + 0] = t,
  42113. this.data.array[e + 1] = i,
  42114. this.data.array[e + 2] = n,
  42115. this
  42116. },
  42117. setXYZW: function(e, t, i, n, r) {
  42118. return e = e * this.data.stride + this.offset,
  42119. this.data.array[e + 0] = t,
  42120. this.data.array[e + 1] = i,
  42121. this.data.array[e + 2] = n,
  42122. this.data.array[e + 3] = r,
  42123. this
  42124. }
  42125. },
  42126. Ci.Geometry = function() {
  42127. Object.defineProperty(this, "id", {
  42128. value: Ci.GeometryIdCount++
  42129. }),
  42130. this.uuid = Ci.Math.generateUUID(),
  42131. this.name = "",
  42132. this.type = "Geometry",
  42133. this.vertices = [],
  42134. this.colors = [],
  42135. this.faces = [],
  42136. this.faceVertexUvs = [[]],
  42137. this.morphTargets = [],
  42138. this.morphNormals = [],
  42139. this.skinWeights = [],
  42140. this.skinIndices = [],
  42141. this.lineDistances = [],
  42142. this.boundingBox = null,
  42143. this.boundingSphere = null,
  42144. this.verticesNeedUpdate = !1,
  42145. this.elementsNeedUpdate = !1,
  42146. this.uvsNeedUpdate = !1,
  42147. this.normalsNeedUpdate = !1,
  42148. this.colorsNeedUpdate = !1,
  42149. this.lineDistancesNeedUpdate = !1,
  42150. this.groupsNeedUpdate = !1
  42151. }
  42152. ,
  42153. Ci.Geometry.prototype = {
  42154. constructor: Ci.Geometry,
  42155. applyMatrix: function(e) {
  42156. for (var t = (new Ci.Matrix3).getNormalMatrix(e), i = 0, n = this.vertices.length; i < n; i++) {
  42157. this.vertices[i].applyMatrix4(e)
  42158. }
  42159. for (i = 0,
  42160. n = this.faces.length; i < n; i++) {
  42161. var r = this.faces[i];
  42162. r.normal.applyMatrix3(t).normalize();
  42163. for (var o = 0, a = r.vertexNormals.length; o < a; o++)
  42164. r.vertexNormals[o].applyMatrix3(t).normalize()
  42165. }
  42166. return null !== this.boundingBox && this.computeBoundingBox(),
  42167. null !== this.boundingSphere && this.computeBoundingSphere(),
  42168. this.verticesNeedUpdate = !0,
  42169. this.normalsNeedUpdate = !0,
  42170. this
  42171. },
  42172. rotateX: function(e) {
  42173. return void 0 === mt && (mt = new Ci.Matrix4),
  42174. mt.makeRotationX(e),
  42175. this.applyMatrix(mt),
  42176. this
  42177. },
  42178. rotateY: function(e) {
  42179. return void 0 === gt && (gt = new Ci.Matrix4),
  42180. gt.makeRotationY(e),
  42181. this.applyMatrix(gt),
  42182. this
  42183. },
  42184. rotateZ: function(e) {
  42185. return void 0 === ft && (ft = new Ci.Matrix4),
  42186. ft.makeRotationZ(e),
  42187. this.applyMatrix(ft),
  42188. this
  42189. },
  42190. translate: function(e, t, i) {
  42191. return void 0 === pt && (pt = new Ci.Matrix4),
  42192. pt.makeTranslation(e, t, i),
  42193. this.applyMatrix(pt),
  42194. this
  42195. },
  42196. scale: function(e, t, i) {
  42197. return void 0 === dt && (dt = new Ci.Matrix4),
  42198. dt.makeScale(e, t, i),
  42199. this.applyMatrix(dt),
  42200. this
  42201. },
  42202. lookAt: function(e) {
  42203. void 0 === ut && (ut = new Ci.Object3D),
  42204. ut.lookAt(e),
  42205. ut.updateMatrix(),
  42206. this.applyMatrix(ut.matrix)
  42207. },
  42208. fromBufferGeometry: function(e) {
  42209. function t(e, t, i, n) {
  42210. var r = void 0 !== l ? [d[e].clone(), d[t].clone(), d[i].clone()] : []
  42211. , o = void 0 !== c ? [s.colors[e].clone(), s.colors[t].clone(), s.colors[i].clone()] : []
  42212. , a = new Ci.Face3(e,t,i,r,o,n);
  42213. s.faces.push(a),
  42214. void 0 !== h && s.faceVertexUvs[0].push([p[e].clone(), p[t].clone(), p[i].clone()]),
  42215. void 0 !== u && s.faceVertexUvs[1].push([f[e].clone(), f[t].clone(), f[i].clone()])
  42216. }
  42217. var s = this
  42218. , i = null !== e.index ? e.index.array : void 0
  42219. , n = e.attributes
  42220. , r = n.position.array
  42221. , l = void 0 !== n.normal ? n.normal.array : void 0
  42222. , c = void 0 !== n.color ? n.color.array : void 0
  42223. , h = void 0 !== n.uv ? n.uv.array : void 0
  42224. , u = void 0 !== n.uv2 ? n.uv2.array : void 0;
  42225. void 0 !== u && (this.faceVertexUvs[1] = []);
  42226. for (var d = [], p = [], f = [], o = 0, a = 0; o < r.length; o += 3,
  42227. a += 2)
  42228. s.vertices.push(new Ci.Vector3(r[o],r[o + 1],r[o + 2])),
  42229. void 0 !== l && d.push(new Ci.Vector3(l[o],l[o + 1],l[o + 2])),
  42230. void 0 !== c && s.colors.push(new Ci.Color(c[o],c[o + 1],c[o + 2])),
  42231. void 0 !== h && p.push(new Ci.Vector2(h[a],h[a + 1])),
  42232. void 0 !== u && f.push(new Ci.Vector2(u[a],u[a + 1]));
  42233. if (void 0 !== i) {
  42234. var g = e.groups;
  42235. if (0 < g.length)
  42236. for (o = 0; o < g.length; o++)
  42237. for (var m = g[o], v = m.start, y = (a = v,
  42238. v + m.count); a < y; a += 3)
  42239. t(i[a], i[a + 1], i[a + 2], m.materialIndex);
  42240. else
  42241. for (o = 0; o < i.length; o += 3)
  42242. t(i[o], i[o + 1], i[o + 2])
  42243. } else
  42244. for (o = 0; o < r.length / 3; o += 3)
  42245. t(o, o + 1, o + 2);
  42246. return this.computeFaceNormals(),
  42247. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42248. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42249. this
  42250. },
  42251. center: function() {
  42252. this.computeBoundingBox();
  42253. var e = this.boundingBox.center().negate();
  42254. return this.translate(e.x, e.y, e.z),
  42255. e
  42256. },
  42257. normalize: function() {
  42258. this.computeBoundingSphere();
  42259. var e = this.boundingSphere.center
  42260. , t = this.boundingSphere.radius
  42261. , i = 0 === t ? 1 : 1 / t
  42262. , n = new Ci.Matrix4;
  42263. return n.set(i, 0, 0, -i * e.x, 0, i, 0, -i * e.y, 0, 0, i, -i * e.z, 0, 0, 0, 1),
  42264. this.applyMatrix(n),
  42265. this
  42266. },
  42267. computeFaceNormals: function() {
  42268. for (var e = new Ci.Vector3, t = new Ci.Vector3, i = 0, n = this.faces.length; i < n; i++) {
  42269. var r = this.faces[i]
  42270. , o = this.vertices[r.a]
  42271. , a = this.vertices[r.b]
  42272. , s = this.vertices[r.c];
  42273. e.subVectors(s, a),
  42274. t.subVectors(o, a),
  42275. e.cross(t),
  42276. e.normalize(),
  42277. r.normal.copy(e)
  42278. }
  42279. },
  42280. computeVertexNormals: function(e) {
  42281. var t, i, n, r, o, a;
  42282. for (void 0 === e && (e = !0),
  42283. a = new Array(this.vertices.length),
  42284. t = 0,
  42285. i = this.vertices.length; t < i; t++)
  42286. a[t] = new Ci.Vector3;
  42287. if (e) {
  42288. var s, l, c, h = new Ci.Vector3, u = new Ci.Vector3;
  42289. for (n = 0,
  42290. r = this.faces.length; n < r; n++)
  42291. o = this.faces[n],
  42292. s = this.vertices[o.a],
  42293. l = this.vertices[o.b],
  42294. c = this.vertices[o.c],
  42295. h.subVectors(c, l),
  42296. u.subVectors(s, l),
  42297. h.cross(u),
  42298. a[o.a].add(h),
  42299. a[o.b].add(h),
  42300. a[o.c].add(h)
  42301. } else
  42302. for (n = 0,
  42303. r = this.faces.length; n < r; n++)
  42304. a[(o = this.faces[n]).a].add(o.normal),
  42305. a[o.b].add(o.normal),
  42306. a[o.c].add(o.normal);
  42307. for (t = 0,
  42308. i = this.vertices.length; t < i; t++)
  42309. a[t].normalize();
  42310. for (n = 0,
  42311. r = this.faces.length; n < r; n++) {
  42312. var d = (o = this.faces[n]).vertexNormals;
  42313. 3 === d.length ? (d[0].copy(a[o.a]),
  42314. d[1].copy(a[o.b]),
  42315. d[2].copy(a[o.c])) : (d[0] = a[o.a].clone(),
  42316. d[1] = a[o.b].clone(),
  42317. d[2] = a[o.c].clone())
  42318. }
  42319. 0 < this.faces.length && (this.normalsNeedUpdate = !0)
  42320. },
  42321. computeMorphNormals: function() {
  42322. var e, t, i, n, r;
  42323. for (i = 0,
  42324. n = this.faces.length; i < n; i++)
  42325. for ((r = this.faces[i]).__originalFaceNormal ? r.__originalFaceNormal.copy(r.normal) : r.__originalFaceNormal = r.normal.clone(),
  42326. r.__originalVertexNormals || (r.__originalVertexNormals = []),
  42327. e = 0,
  42328. t = r.vertexNormals.length; e < t; e++)
  42329. r.__originalVertexNormals[e] ? r.__originalVertexNormals[e].copy(r.vertexNormals[e]) : r.__originalVertexNormals[e] = r.vertexNormals[e].clone();
  42330. var o = new Ci.Geometry;
  42331. for (o.faces = this.faces,
  42332. e = 0,
  42333. t = this.morphTargets.length; e < t; e++) {
  42334. if (!this.morphNormals[e]) {
  42335. this.morphNormals[e] = {},
  42336. this.morphNormals[e].faceNormals = [],
  42337. this.morphNormals[e].vertexNormals = [];
  42338. var a = this.morphNormals[e].faceNormals
  42339. , s = this.morphNormals[e].vertexNormals;
  42340. for (i = 0,
  42341. n = this.faces.length; i < n; i++)
  42342. l = new Ci.Vector3,
  42343. c = {
  42344. a: new Ci.Vector3,
  42345. b: new Ci.Vector3,
  42346. c: new Ci.Vector3
  42347. },
  42348. a.push(l),
  42349. s.push(c)
  42350. }
  42351. var l, c, h = this.morphNormals[e];
  42352. for (o.vertices = this.morphTargets[e].vertices,
  42353. o.computeFaceNormals(),
  42354. o.computeVertexNormals(),
  42355. i = 0,
  42356. n = this.faces.length; i < n; i++)
  42357. r = this.faces[i],
  42358. l = h.faceNormals[i],
  42359. c = h.vertexNormals[i],
  42360. l.copy(r.normal),
  42361. c.a.copy(r.vertexNormals[0]),
  42362. c.b.copy(r.vertexNormals[1]),
  42363. c.c.copy(r.vertexNormals[2])
  42364. }
  42365. for (i = 0,
  42366. n = this.faces.length; i < n; i++)
  42367. (r = this.faces[i]).normal = r.__originalFaceNormal,
  42368. r.vertexNormals = r.__originalVertexNormals
  42369. },
  42370. computeTangents: function() {
  42371. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  42372. },
  42373. computeLineDistances: function() {
  42374. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  42375. 0 < i && (e += t[i].distanceTo(t[i - 1])),
  42376. this.lineDistances[i] = e
  42377. },
  42378. computeBoundingBox: function() {
  42379. null === this.boundingBox && (this.boundingBox = new Ci.Box3),
  42380. this.boundingBox.setFromPoints(this.vertices)
  42381. },
  42382. computeBoundingSphere: function() {
  42383. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere),
  42384. this.boundingSphere.setFromPoints(this.vertices)
  42385. },
  42386. merge: function(e, t, i) {
  42387. if (e instanceof Ci.Geometry != 0) {
  42388. var n, r = this.vertices.length, o = this.vertices, a = e.vertices, s = this.faces, l = e.faces, c = this.faceVertexUvs[0], h = e.faceVertexUvs[0];
  42389. void 0 === i && (i = 0),
  42390. void 0 !== t && (n = (new Ci.Matrix3).getNormalMatrix(t));
  42391. for (var u = 0, d = a.length; u < d; u++) {
  42392. var p = a[u].clone();
  42393. void 0 !== t && p.applyMatrix4(t),
  42394. o.push(p)
  42395. }
  42396. for (u = 0,
  42397. d = l.length; u < d; u++) {
  42398. var f, g, m, v = l[u], y = v.vertexNormals, A = v.vertexColors;
  42399. (f = new Ci.Face3(v.a + r,v.b + r,v.c + r)).normal.copy(v.normal),
  42400. void 0 !== n && f.normal.applyMatrix3(n).normalize();
  42401. for (var C = 0, I = y.length; C < I; C++)
  42402. g = y[C].clone(),
  42403. void 0 !== n && g.applyMatrix3(n).normalize(),
  42404. f.vertexNormals.push(g);
  42405. f.color.copy(v.color);
  42406. for (C = 0,
  42407. I = A.length; C < I; C++)
  42408. m = A[C],
  42409. f.vertexColors.push(m.clone());
  42410. f.materialIndex = v.materialIndex + i,
  42411. s.push(f)
  42412. }
  42413. for (u = 0,
  42414. d = h.length; u < d; u++) {
  42415. var E = h[u]
  42416. , _ = [];
  42417. if (void 0 !== E) {
  42418. for (C = 0,
  42419. I = E.length; C < I; C++)
  42420. _.push(E[C].clone());
  42421. c.push(_)
  42422. }
  42423. }
  42424. } else
  42425. console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e)
  42426. },
  42427. mergeMesh: function(e) {
  42428. return e instanceof Ci.Mesh == 0 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  42429. void this.merge(e.geometry, e.matrix))
  42430. },
  42431. mergeVertices: function() {
  42432. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = Math.pow(10, 4);
  42433. for (i = 0,
  42434. n = this.vertices.length; i < n; i++)
  42435. e = this.vertices[i],
  42436. void 0 === l[t = Math.round(e.x * u) + "_" + Math.round(e.y * u) + "_" + Math.round(e.z * u)] ? (l[t] = i,
  42437. c.push(this.vertices[i]),
  42438. h[i] = c.length - 1) : h[i] = h[l[t]];
  42439. var d = [];
  42440. for (i = 0,
  42441. n = this.faces.length; i < n; i++) {
  42442. (r = this.faces[i]).a = h[r.a],
  42443. r.b = h[r.b],
  42444. r.c = h[r.c],
  42445. o = [r.a, r.b, r.c];
  42446. for (var p = 0; p < 3; p++)
  42447. if (o[p] === o[(p + 1) % 3]) {
  42448. p,
  42449. d.push(i);
  42450. break
  42451. }
  42452. }
  42453. for (i = d.length - 1; 0 <= i; i--) {
  42454. var f = d[i];
  42455. for (this.faces.splice(f, 1),
  42456. a = 0,
  42457. s = this.faceVertexUvs.length; a < s; a++)
  42458. this.faceVertexUvs[a].splice(f, 1)
  42459. }
  42460. var g = this.vertices.length - c.length;
  42461. return this.vertices = c,
  42462. g
  42463. },
  42464. sortFacesByMaterialIndex: function() {
  42465. for (var e = this.faces, t = e.length, i = 0; i < t; i++)
  42466. e[i]._id = i;
  42467. e.sort(function(e, t) {
  42468. return e.materialIndex - t.materialIndex
  42469. });
  42470. var n, r, o = this.faceVertexUvs[0], a = this.faceVertexUvs[1];
  42471. o && o.length === t && (n = []),
  42472. a && a.length === t && (r = []);
  42473. for (i = 0; i < t; i++) {
  42474. var s = e[i]._id;
  42475. n && n.push(o[s]),
  42476. r && r.push(a[s])
  42477. }
  42478. n && (this.faceVertexUvs[0] = n),
  42479. r && (this.faceVertexUvs[1] = r)
  42480. },
  42481. toJSON: function() {
  42482. function e(e, t, i) {
  42483. return i ? e | 1 << t : e & ~(1 << t)
  42484. }
  42485. function t(e) {
  42486. var t = e.x.toString() + e.y.toString() + e.z.toString();
  42487. return void 0 !== d[t] || (d[t] = u.length / 3,
  42488. u.push(e.x, e.y, e.z)),
  42489. d[t]
  42490. }
  42491. function i(e) {
  42492. var t = e.r.toString() + e.g.toString() + e.b.toString();
  42493. return void 0 !== f[t] || (f[t] = p.length,
  42494. p.push(e.getHex())),
  42495. f[t]
  42496. }
  42497. function n(e) {
  42498. var t = e.x.toString() + e.y.toString();
  42499. return void 0 !== m[t] || (m[t] = g.length / 2,
  42500. g.push(e.x, e.y)),
  42501. m[t]
  42502. }
  42503. var r = {
  42504. metadata: {
  42505. version: 4.4,
  42506. type: "Geometry",
  42507. generator: "Geometry.toJSON"
  42508. }
  42509. };
  42510. if (r.uuid = this.uuid,
  42511. r.type = this.type,
  42512. "" !== this.name && (r.name = this.name),
  42513. void 0 !== this.parameters) {
  42514. var o = this.parameters;
  42515. for (var a in o)
  42516. void 0 !== o[a] && (r[a] = o[a]);
  42517. return r
  42518. }
  42519. for (var s = [], l = 0; l < this.vertices.length; l++) {
  42520. var c = this.vertices[l];
  42521. s.push(c.x, c.y, c.z)
  42522. }
  42523. var h = []
  42524. , u = []
  42525. , d = {}
  42526. , p = []
  42527. , f = {}
  42528. , g = []
  42529. , m = {};
  42530. for (l = 0; l < this.faces.length; l++) {
  42531. var v = this.faces[l]
  42532. , y = void 0 !== this.faceVertexUvs[0][l]
  42533. , A = 0 < v.normal.length()
  42534. , C = 0 < v.vertexNormals.length
  42535. , I = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  42536. , E = 0 < v.vertexColors.length
  42537. , _ = 0;
  42538. if (_ = e(_ = e(_ = e(_ = e(_ = e(_ = e(_ = e(_ = e(_, 0, 0), 1, !0), 2, !1), 3, y), 4, A), 5, C), 6, I), 7, E),
  42539. h.push(_),
  42540. h.push(v.a, v.b, v.c),
  42541. h.push(v.materialIndex),
  42542. y) {
  42543. var b = this.faceVertexUvs[0][l];
  42544. h.push(n(b[0]), n(b[1]), n(b[2]))
  42545. }
  42546. if (A && h.push(t(v.normal)),
  42547. C) {
  42548. var w = v.vertexNormals;
  42549. h.push(t(w[0]), t(w[1]), t(w[2]))
  42550. }
  42551. if (I && h.push(i(v.color)),
  42552. E) {
  42553. var T = v.vertexColors;
  42554. h.push(i(T[0]), i(T[1]), i(T[2]))
  42555. }
  42556. }
  42557. return r.data = {},
  42558. r.data.vertices = s,
  42559. r.data.normals = u,
  42560. 0 < p.length && (r.data.colors = p),
  42561. 0 < g.length && (r.data.uvs = [g]),
  42562. r.data.faces = h,
  42563. r
  42564. },
  42565. clone: function() {
  42566. return (new Ci.Geometry).copy(this)
  42567. },
  42568. copy: function(e) {
  42569. this.vertices = [],
  42570. this.faces = [],
  42571. this.faceVertexUvs = [[]];
  42572. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  42573. this.vertices.push(t[i].clone());
  42574. var r = e.faces;
  42575. for (i = 0,
  42576. n = r.length; i < n; i++)
  42577. this.faces.push(r[i].clone());
  42578. for (i = 0,
  42579. n = e.faceVertexUvs.length; i < n; i++) {
  42580. var o = e.faceVertexUvs[i];
  42581. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  42582. for (var a = 0, s = o.length; a < s; a++) {
  42583. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  42584. var d = l[h];
  42585. c.push(d.clone())
  42586. }
  42587. this.faceVertexUvs[i].push(c)
  42588. }
  42589. }
  42590. return this
  42591. },
  42592. dispose: function() {
  42593. this.dispatchEvent({
  42594. type: "dispose"
  42595. })
  42596. }
  42597. },
  42598. Ci.EventDispatcher.prototype.apply(Ci.Geometry.prototype),
  42599. Ci.GeometryIdCount = 0,
  42600. Ci.DirectGeometry = function() {
  42601. Object.defineProperty(this, "id", {
  42602. value: Ci.GeometryIdCount++
  42603. }),
  42604. this.uuid = Ci.Math.generateUUID(),
  42605. this.name = "",
  42606. this.type = "DirectGeometry",
  42607. this.indices = [],
  42608. this.vertices = [],
  42609. this.normals = [],
  42610. this.colors = [],
  42611. this.uvs = [],
  42612. this.uvs2 = [],
  42613. this.groups = [],
  42614. this.morphTargets = {},
  42615. this.skinWeights = [],
  42616. this.skinIndices = [],
  42617. this.boundingBox = null,
  42618. this.boundingSphere = null,
  42619. this.verticesNeedUpdate = !1,
  42620. this.normalsNeedUpdate = !1,
  42621. this.colorsNeedUpdate = !1,
  42622. this.uvsNeedUpdate = !1,
  42623. this.groupsNeedUpdate = !1
  42624. }
  42625. ,
  42626. Ci.DirectGeometry.prototype = {
  42627. constructor: Ci.DirectGeometry,
  42628. computeBoundingBox: Ci.Geometry.prototype.computeBoundingBox,
  42629. computeBoundingSphere: Ci.Geometry.prototype.computeBoundingSphere,
  42630. computeFaceNormals: function() {
  42631. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  42632. },
  42633. computeVertexNormals: function() {
  42634. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  42635. },
  42636. computeGroups: function(e) {
  42637. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  42638. var a = r[o];
  42639. a.materialIndex !== i && (i = a.materialIndex,
  42640. void 0 !== t && (t.count = 3 * o - t.start,
  42641. n.push(t)),
  42642. t = {
  42643. start: 3 * o,
  42644. materialIndex: i
  42645. })
  42646. }
  42647. void 0 !== t && (t.count = 3 * o - t.start,
  42648. n.push(t)),
  42649. this.groups = n
  42650. },
  42651. fromGeometry: function(e) {
  42652. var t, i = e.faces, n = e.vertices, r = e.faceVertexUvs, o = r[0] && 0 < r[0].length, a = r[1] && 0 < r[1].length, s = e.morphTargets, l = s.length;
  42653. if (0 < l) {
  42654. t = [];
  42655. for (var c = 0; c < l; c++)
  42656. t[c] = [];
  42657. this.morphTargets.position = t
  42658. }
  42659. var h, u = e.morphNormals, d = u.length;
  42660. if (0 < d) {
  42661. h = [];
  42662. for (c = 0; c < d; c++)
  42663. h[c] = [];
  42664. this.morphTargets.normal = h
  42665. }
  42666. var p = e.skinIndices
  42667. , f = e.skinWeights
  42668. , g = p.length === n.length
  42669. , m = f.length === n.length;
  42670. for (c = 0; c < i.length; c++) {
  42671. var v = i[c];
  42672. this.vertices.push(n[v.a], n[v.b], n[v.c]);
  42673. var y = v.vertexNormals;
  42674. if (3 === y.length)
  42675. this.normals.push(y[0], y[1], y[2]);
  42676. else {
  42677. var A = v.normal;
  42678. this.normals.push(A, A, A)
  42679. }
  42680. var C, I = v.vertexColors;
  42681. if (3 === I.length)
  42682. this.colors.push(I[0], I[1], I[2]);
  42683. else {
  42684. var E = v.color;
  42685. this.colors.push(E, E, E)
  42686. }
  42687. if (!0 === o)
  42688. void 0 !== (C = r[0][c]) ? this.uvs.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", c),
  42689. this.uvs.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42690. if (!0 === a)
  42691. void 0 !== (C = r[1][c]) ? this.uvs2.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", c),
  42692. this.uvs2.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42693. for (var _ = 0; _ < l; _++) {
  42694. var b = s[_].vertices;
  42695. t[_].push(b[v.a], b[v.b], b[v.c])
  42696. }
  42697. for (_ = 0; _ < d; _++) {
  42698. var w = u[_].vertexNormals[c];
  42699. h[_].push(w.a, w.b, w.c)
  42700. }
  42701. g && this.skinIndices.push(p[v.a], p[v.b], p[v.c]),
  42702. m && this.skinWeights.push(f[v.a], f[v.b], f[v.c])
  42703. }
  42704. return this.computeGroups(e),
  42705. this.verticesNeedUpdate = e.verticesNeedUpdate,
  42706. this.normalsNeedUpdate = e.normalsNeedUpdate,
  42707. this.colorsNeedUpdate = e.colorsNeedUpdate,
  42708. this.uvsNeedUpdate = e.uvsNeedUpdate,
  42709. this.groupsNeedUpdate = e.groupsNeedUpdate,
  42710. this
  42711. },
  42712. dispose: function() {
  42713. this.dispatchEvent({
  42714. type: "dispose"
  42715. })
  42716. }
  42717. },
  42718. Ci.EventDispatcher.prototype.apply(Ci.DirectGeometry.prototype),
  42719. Ci.BufferGeometry = function() {
  42720. Object.defineProperty(this, "id", {
  42721. value: Ci.GeometryIdCount++
  42722. }),
  42723. this.uuid = Ci.Math.generateUUID(),
  42724. this.name = "",
  42725. this.type = "BufferGeometry",
  42726. this.index = null,
  42727. this.attributes = {},
  42728. this.morphAttributes = {},
  42729. this.groups = [],
  42730. this.boundingBox = null,
  42731. this.boundingSphere = null,
  42732. this.drawRange = {
  42733. start: 0,
  42734. count: 1 / 0
  42735. }
  42736. }
  42737. ,
  42738. Ci.BufferGeometry.prototype = {
  42739. constructor: Ci.BufferGeometry,
  42740. getIndex: function() {
  42741. return this.index
  42742. },
  42743. setIndex: function(e) {
  42744. this.index = e
  42745. },
  42746. addAttribute: function(e, t) {
  42747. return t instanceof Ci.BufferAttribute == 0 && t instanceof Ci.InterleavedBufferAttribute == 0 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  42748. void this.addAttribute(e, new Ci.BufferAttribute(t,arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  42749. void this.setIndex(t)) : (this.attributes[e] = t,
  42750. this)
  42751. },
  42752. getAttribute: function(e) {
  42753. return this.attributes[e]
  42754. },
  42755. removeAttribute: function(e) {
  42756. return delete this.attributes[e],
  42757. this
  42758. },
  42759. addGroup: function(e, t, i) {
  42760. this.groups.push({
  42761. start: e,
  42762. count: t,
  42763. materialIndex: void 0 !== i ? i : 0
  42764. })
  42765. },
  42766. clearGroups: function() {
  42767. this.groups = []
  42768. },
  42769. setDrawRange: function(e, t) {
  42770. this.drawRange.start = e,
  42771. this.drawRange.count = t
  42772. },
  42773. applyMatrix: function(e) {
  42774. var t = this.attributes.position;
  42775. void 0 !== t && (e.applyToVector3Array(t.array),
  42776. t.needsUpdate = !0);
  42777. var i = this.attributes.normal;
  42778. void 0 !== i && ((new Ci.Matrix3).getNormalMatrix(e).applyToVector3Array(i.array),
  42779. i.needsUpdate = !0);
  42780. return null !== this.boundingBox && this.computeBoundingBox(),
  42781. null !== this.boundingSphere && this.computeBoundingSphere(),
  42782. this
  42783. },
  42784. rotateX: function(e) {
  42785. return void 0 === ht && (ht = new Ci.Matrix4),
  42786. ht.makeRotationX(e),
  42787. this.applyMatrix(ht),
  42788. this
  42789. },
  42790. rotateY: function(e) {
  42791. return void 0 === ct && (ct = new Ci.Matrix4),
  42792. ct.makeRotationY(e),
  42793. this.applyMatrix(ct),
  42794. this
  42795. },
  42796. rotateZ: function(e) {
  42797. return void 0 === lt && (lt = new Ci.Matrix4),
  42798. lt.makeRotationZ(e),
  42799. this.applyMatrix(lt),
  42800. this
  42801. },
  42802. translate: function(e, t, i) {
  42803. return void 0 === st && (st = new Ci.Matrix4),
  42804. st.makeTranslation(e, t, i),
  42805. this.applyMatrix(st),
  42806. this
  42807. },
  42808. scale: function(e, t, i) {
  42809. return void 0 === at && (at = new Ci.Matrix4),
  42810. at.makeScale(e, t, i),
  42811. this.applyMatrix(at),
  42812. this
  42813. },
  42814. lookAt: function(e) {
  42815. void 0 === ot && (ot = new Ci.Object3D),
  42816. ot.lookAt(e),
  42817. ot.updateMatrix(),
  42818. this.applyMatrix(ot.matrix)
  42819. },
  42820. center: function() {
  42821. this.computeBoundingBox();
  42822. var e = this.boundingBox.center().negate();
  42823. return this.translate(e.x, e.y, e.z),
  42824. e
  42825. },
  42826. setFromObject: function(e) {
  42827. var t = e.geometry;
  42828. if (e instanceof Ci.Points || e instanceof Ci.Line) {
  42829. var i = new Ci.Float32Attribute(3 * t.vertices.length,3)
  42830. , n = new Ci.Float32Attribute(3 * t.colors.length,3);
  42831. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  42832. this.addAttribute("color", n.copyColorsArray(t.colors)),
  42833. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  42834. var r = new Ci.Float32Attribute(t.lineDistances.length,1);
  42835. this.addAttribute("lineDistance", r.copyArray(t.lineDistances))
  42836. }
  42837. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  42838. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  42839. } else
  42840. e instanceof Ci.Mesh && t instanceof Ci.Geometry && this.fromGeometry(t);
  42841. return this
  42842. },
  42843. updateFromObject: function(e) {
  42844. var t, i = e.geometry;
  42845. if (e instanceof Ci.Mesh) {
  42846. var n = i.__directGeometry;
  42847. if (void 0 === n)
  42848. return this.fromGeometry(i);
  42849. n.verticesNeedUpdate = i.verticesNeedUpdate,
  42850. n.normalsNeedUpdate = i.normalsNeedUpdate,
  42851. n.colorsNeedUpdate = i.colorsNeedUpdate,
  42852. n.uvsNeedUpdate = i.uvsNeedUpdate,
  42853. n.groupsNeedUpdate = i.groupsNeedUpdate,
  42854. i.verticesNeedUpdate = !1,
  42855. i.normalsNeedUpdate = !1,
  42856. i.colorsNeedUpdate = !1,
  42857. i.uvsNeedUpdate = !1,
  42858. i.groupsNeedUpdate = !1,
  42859. i = n
  42860. }
  42861. !0 === i.verticesNeedUpdate && (void 0 !== (t = this.attributes.position) && (t.copyVector3sArray(i.vertices),
  42862. t.needsUpdate = !0),
  42863. i.verticesNeedUpdate = !1);
  42864. !0 === i.normalsNeedUpdate && (void 0 !== (t = this.attributes.normal) && (t.copyVector3sArray(i.normals),
  42865. t.needsUpdate = !0),
  42866. i.normalsNeedUpdate = !1);
  42867. !0 === i.colorsNeedUpdate && (void 0 !== (t = this.attributes.color) && (t.copyColorsArray(i.colors),
  42868. t.needsUpdate = !0),
  42869. i.colorsNeedUpdate = !1);
  42870. i.uvsNeedUpdate && (void 0 !== (t = this.attributes.uv) && (t.copyVector2sArray(i.uvs),
  42871. t.needsUpdate = !0),
  42872. i.uvsNeedUpdate = !1);
  42873. i.lineDistancesNeedUpdate && (void 0 !== (t = this.attributes.lineDistance) && (t.copyArray(i.lineDistances),
  42874. t.needsUpdate = !0),
  42875. i.lineDistancesNeedUpdate = !1);
  42876. return i.groupsNeedUpdate && (i.computeGroups(e.geometry),
  42877. this.groups = i.groups,
  42878. i.groupsNeedUpdate = !1),
  42879. this
  42880. },
  42881. fromGeometry: function(e) {
  42882. return e.__directGeometry = (new Ci.DirectGeometry).fromGeometry(e),
  42883. this.fromDirectGeometry(e.__directGeometry)
  42884. },
  42885. fromDirectGeometry: function(e) {
  42886. var t = new Float32Array(3 * e.vertices.length);
  42887. if (this.addAttribute("position", new Ci.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  42888. 0 < e.normals.length) {
  42889. var i = new Float32Array(3 * e.normals.length);
  42890. this.addAttribute("normal", new Ci.BufferAttribute(i,3).copyVector3sArray(e.normals))
  42891. }
  42892. if (0 < e.colors.length) {
  42893. var n = new Float32Array(3 * e.colors.length);
  42894. this.addAttribute("color", new Ci.BufferAttribute(n,3).copyColorsArray(e.colors))
  42895. }
  42896. if (0 < e.uvs.length) {
  42897. var r = new Float32Array(2 * e.uvs.length);
  42898. this.addAttribute("uv", new Ci.BufferAttribute(r,2).copyVector2sArray(e.uvs))
  42899. }
  42900. if (0 < e.uvs2.length) {
  42901. var o = new Float32Array(2 * e.uvs2.length);
  42902. this.addAttribute("uv2", new Ci.BufferAttribute(o,2).copyVector2sArray(e.uvs2))
  42903. }
  42904. if (0 < e.indices.length) {
  42905. var a = new (65535 < e.vertices.length ? Uint32Array : Uint16Array)(3 * e.indices.length);
  42906. this.setIndex(new Ci.BufferAttribute(a,1).copyIndicesArray(e.indices))
  42907. }
  42908. for (var s in this.groups = e.groups,
  42909. e.morphTargets) {
  42910. for (var l = [], c = e.morphTargets[s], h = 0, u = c.length; h < u; h++) {
  42911. var d = c[h]
  42912. , p = new Ci.Float32Attribute(3 * d.length,3);
  42913. l.push(p.copyVector3sArray(d))
  42914. }
  42915. this.morphAttributes[s] = l
  42916. }
  42917. if (0 < e.skinIndices.length) {
  42918. var f = new Ci.Float32Attribute(4 * e.skinIndices.length,4);
  42919. this.addAttribute("skinIndex", f.copyVector4sArray(e.skinIndices))
  42920. }
  42921. if (0 < e.skinWeights.length) {
  42922. var g = new Ci.Float32Attribute(4 * e.skinWeights.length,4);
  42923. this.addAttribute("skinWeight", g.copyVector4sArray(e.skinWeights))
  42924. }
  42925. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42926. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42927. this
  42928. },
  42929. computeBoundingBox: (new Ci.Vector3,
  42930. function() {
  42931. null === this.boundingBox && (this.boundingBox = new Ci.Box3);
  42932. var e = this.attributes.position.array;
  42933. e && this.boundingBox.setFromArray(e),
  42934. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  42935. this.boundingBox.max.set(0, 0, 0)),
  42936. (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)
  42937. }
  42938. ),
  42939. computeBoundingSphere: (nt = new Ci.Box3,
  42940. rt = new Ci.Vector3,
  42941. function() {
  42942. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere);
  42943. var e = this.attributes.position.array;
  42944. if (e) {
  42945. var t = this.boundingSphere.center;
  42946. nt.setFromArray(e),
  42947. nt.center(t);
  42948. for (var i = 0, n = 0, r = e.length; n < r; n += 3)
  42949. rt.fromArray(e, n),
  42950. i = Math.max(i, t.distanceToSquared(rt));
  42951. this.boundingSphere.radius = Math.sqrt(i),
  42952. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  42953. }
  42954. }
  42955. ),
  42956. computeFaceNormals: function() {},
  42957. computeVertexNormals: function() {
  42958. var e = this.index
  42959. , t = this.attributes
  42960. , i = this.groups;
  42961. if (t.position) {
  42962. var n = t.position.array;
  42963. if (void 0 === t.normal)
  42964. this.addAttribute("normal", new Ci.BufferAttribute(new Float32Array(n.length),3));
  42965. else
  42966. for (var r = t.normal.array, o = 0, a = r.length; o < a; o++)
  42967. r[o] = 0;
  42968. var s, l, c, h = t.normal.array, u = new Ci.Vector3, d = new Ci.Vector3, p = new Ci.Vector3, f = new Ci.Vector3, g = new Ci.Vector3;
  42969. if (e) {
  42970. var m = e.array;
  42971. 0 === i.length && this.addGroup(0, m.length);
  42972. for (var v = 0, y = i.length; v < y; ++v) {
  42973. var A = i[v]
  42974. , C = A.start;
  42975. for (o = C,
  42976. a = C + A.count; o < a; o += 3)
  42977. s = 3 * m[o + 0],
  42978. l = 3 * m[o + 1],
  42979. c = 3 * m[o + 2],
  42980. u.fromArray(n, s),
  42981. d.fromArray(n, l),
  42982. p.fromArray(n, c),
  42983. f.subVectors(p, d),
  42984. g.subVectors(u, d),
  42985. f.cross(g),
  42986. h[s] += f.x,
  42987. h[1 + s] += f.y,
  42988. h[2 + s] += f.z,
  42989. h[l] += f.x,
  42990. h[1 + l] += f.y,
  42991. h[2 + l] += f.z,
  42992. h[c] += f.x,
  42993. h[1 + c] += f.y,
  42994. h[2 + c] += f.z
  42995. }
  42996. } else
  42997. for (o = 0,
  42998. a = n.length; o < a; o += 9)
  42999. u.fromArray(n, o),
  43000. d.fromArray(n, o + 3),
  43001. p.fromArray(n, o + 6),
  43002. f.subVectors(p, d),
  43003. g.subVectors(u, d),
  43004. f.cross(g),
  43005. h[o] = f.x,
  43006. h[o + 1] = f.y,
  43007. h[o + 2] = f.z,
  43008. h[o + 3] = f.x,
  43009. h[o + 4] = f.y,
  43010. h[o + 5] = f.z,
  43011. h[o + 6] = f.x,
  43012. h[o + 7] = f.y,
  43013. h[o + 8] = f.z;
  43014. this.normalizeNormals(),
  43015. t.normal.needsUpdate = !0
  43016. }
  43017. },
  43018. merge: function(e, t) {
  43019. if (e instanceof Ci.BufferGeometry != 0) {
  43020. void 0 === t && (t = 0);
  43021. var i = this.attributes;
  43022. for (var n in i)
  43023. if (void 0 !== e.attributes[n])
  43024. for (var r = i[n].array, o = e.attributes[n], a = o.array, s = 0, l = o.itemSize * t; s < a.length; s++,
  43025. l++)
  43026. r[l] = a[s];
  43027. return this
  43028. }
  43029. console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e)
  43030. },
  43031. normalizeNormals: function() {
  43032. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  43033. e = r[o],
  43034. t = r[o + 1],
  43035. i = r[o + 2],
  43036. n = 1 / Math.sqrt(e * e + t * t + i * i),
  43037. r[o] *= n,
  43038. r[o + 1] *= n,
  43039. r[o + 2] *= n
  43040. },
  43041. toNonIndexed: function() {
  43042. if (null === this.index)
  43043. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  43044. this;
  43045. var e = new Ci.BufferGeometry
  43046. , t = this.index.array
  43047. , i = this.attributes;
  43048. for (var n in i) {
  43049. for (var r = i[n], o = r.array, a = r.itemSize, s = new o.constructor(t.length * a), l = 0, c = 0, h = 0, u = t.length; h < u; h++) {
  43050. l = t[h] * a;
  43051. for (var d = 0; d < a; d++)
  43052. s[c++] = o[l++]
  43053. }
  43054. e.addAttribute(n, new Ci.BufferAttribute(s,a))
  43055. }
  43056. return e
  43057. },
  43058. toJSON: function() {
  43059. var e = {
  43060. metadata: {
  43061. version: 4.4,
  43062. type: "BufferGeometry",
  43063. generator: "BufferGeometry.toJSON"
  43064. }
  43065. };
  43066. if (e.uuid = this.uuid,
  43067. e.type = this.type,
  43068. "" !== this.name && (e.name = this.name),
  43069. void 0 !== this.parameters) {
  43070. var t = this.parameters;
  43071. for (var i in t)
  43072. void 0 !== t[i] && (e[i] = t[i]);
  43073. return e
  43074. }
  43075. e.data = {
  43076. attributes: {}
  43077. };
  43078. var n = this.index;
  43079. if (null !== n) {
  43080. var r = Array.prototype.slice.call(n.array);
  43081. e.data.index = {
  43082. type: n.array.constructor.name,
  43083. array: r
  43084. }
  43085. }
  43086. var o = this.attributes;
  43087. for (var i in o) {
  43088. var a = o[i];
  43089. r = Array.prototype.slice.call(a.array);
  43090. e.data.attributes[i] = {
  43091. itemSize: a.itemSize,
  43092. type: a.array.constructor.name,
  43093. array: r
  43094. }
  43095. }
  43096. var s = this.groups;
  43097. 0 < s.length && (e.data.groups = JSON.parse(JSON.stringify(s)));
  43098. var l = this.boundingSphere;
  43099. return null !== l && (e.data.boundingSphere = {
  43100. center: l.center.toArray(),
  43101. radius: l.radius
  43102. }),
  43103. e
  43104. },
  43105. clone: function() {
  43106. return (new Ci.BufferGeometry).copy(this)
  43107. },
  43108. copy: function(e) {
  43109. var t = e.index;
  43110. null !== t && this.setIndex(t.clone());
  43111. var i = e.attributes;
  43112. for (var n in i) {
  43113. var r = i[n];
  43114. this.addAttribute(n, r.clone())
  43115. }
  43116. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  43117. var l = o[a];
  43118. this.addGroup(l.start, l.count)
  43119. }
  43120. return this
  43121. },
  43122. dispose: function() {
  43123. this.dispatchEvent({
  43124. type: "dispose"
  43125. })
  43126. }
  43127. },
  43128. Ci.EventDispatcher.prototype.apply(Ci.BufferGeometry.prototype),
  43129. Ci.BufferGeometry.MaxIndex = 65535,
  43130. Ci.InstancedBufferGeometry = function() {
  43131. Ci.BufferGeometry.call(this),
  43132. this.type = "InstancedBufferGeometry",
  43133. this.maxInstancedCount = void 0
  43134. }
  43135. ,
  43136. Ci.InstancedBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  43137. Ci.InstancedBufferGeometry.prototype.constructor = Ci.InstancedBufferGeometry,
  43138. Ci.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  43139. this.groups.push({
  43140. start: e,
  43141. count: t,
  43142. instances: i
  43143. })
  43144. }
  43145. ,
  43146. Ci.InstancedBufferGeometry.prototype.copy = function(e) {
  43147. var t = e.index;
  43148. null !== t && this.setIndex(t.clone());
  43149. var i = e.attributes;
  43150. for (var n in i) {
  43151. var r = i[n];
  43152. this.addAttribute(n, r.clone())
  43153. }
  43154. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  43155. var l = o[a];
  43156. this.addGroup(l.start, l.count, l.instances)
  43157. }
  43158. return this
  43159. }
  43160. ,
  43161. Ci.EventDispatcher.prototype.apply(Ci.InstancedBufferGeometry.prototype),
  43162. Ci.Uniform = function(e, t) {
  43163. this.type = e,
  43164. this.value = t,
  43165. this.dynamic = !1
  43166. }
  43167. ,
  43168. Ci.Uniform.prototype = {
  43169. constructor: Ci.Uniform,
  43170. onUpdate: function(e) {
  43171. return this.dynamic = !0,
  43172. this.onUpdateCallback = e,
  43173. this
  43174. }
  43175. },
  43176. Ci.AnimationClip = function(e, t, i) {
  43177. this.name = e || Ci.Math.generateUUID(),
  43178. this.tracks = i,
  43179. this.duration = void 0 !== t ? t : -1,
  43180. this.duration < 0 && this.resetDuration(),
  43181. this.trim(),
  43182. this.optimize()
  43183. }
  43184. ,
  43185. Ci.AnimationClip.prototype = {
  43186. constructor: Ci.AnimationClip,
  43187. resetDuration: function() {
  43188. for (var e = 0, t = 0, i = this.tracks.length; t !== i; ++t) {
  43189. var n = this.tracks[t];
  43190. e = Math.max(e, n.times[n.times.length - 1])
  43191. }
  43192. this.duration = e
  43193. },
  43194. trim: function() {
  43195. for (var e = 0; e < this.tracks.length; e++)
  43196. this.tracks[e].trim(0, this.duration);
  43197. return this
  43198. },
  43199. optimize: function() {
  43200. for (var e = 0; e < this.tracks.length; e++)
  43201. this.tracks[e].optimize();
  43202. return this
  43203. }
  43204. },
  43205. Object.assign(Ci.AnimationClip, {
  43206. parse: function(e) {
  43207. for (var t = [], i = e.tracks, n = 1 / (e.fps || 1), r = 0, o = i.length; r !== o; ++r)
  43208. t.push(Ci.KeyframeTrack.parse(i[r]).scale(n));
  43209. return new Ci.AnimationClip(e.name,e.duration,t)
  43210. },
  43211. toJSON: function(e) {
  43212. for (var t = [], i = e.tracks, n = {
  43213. name: e.name,
  43214. duration: e.duration,
  43215. tracks: t
  43216. }, r = 0, o = i.length; r !== o; ++r)
  43217. t.push(Ci.KeyframeTrack.toJSON(i[r]));
  43218. return n
  43219. },
  43220. CreateFromMorphTargetSequence: function(e, t, i) {
  43221. for (var n = t.length, r = [], o = 0; o < n; o++) {
  43222. var a = []
  43223. , s = [];
  43224. a.push((o + n - 1) % n, o, (o + 1) % n),
  43225. s.push(0, 1, 0);
  43226. var l = Ci.AnimationUtils.getKeyframeOrder(a);
  43227. a = Ci.AnimationUtils.sortedArray(a, 1, l),
  43228. s = Ci.AnimationUtils.sortedArray(s, 1, l),
  43229. 0 === a[0] && (a.push(n),
  43230. s.push(s[0])),
  43231. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluences[" + t[o].name + "]",a,s).scale(1 / i))
  43232. }
  43233. return new Ci.AnimationClip(e,-1,r)
  43234. },
  43235. findByName: function(e, t) {
  43236. for (var i = 0; i < e.length; i++)
  43237. if (e[i].name === t)
  43238. return e[i];
  43239. return null
  43240. },
  43241. CreateClipsFromMorphTargetSequences: function(e, t) {
  43242. for (var i = {}, n = /^([\w-]*?)([\d]+)$/, r = 0, o = e.length; r < o; r++) {
  43243. var a = e[r]
  43244. , s = a.name.match(n);
  43245. if (s && 1 < s.length) {
  43246. var l = i[h = s[1]];
  43247. l || (i[h] = l = []),
  43248. l.push(a)
  43249. }
  43250. }
  43251. var c = [];
  43252. for (var h in i)
  43253. c.push(Ci.AnimationClip.CreateFromMorphTargetSequence(h, i[h], t));
  43254. return c
  43255. },
  43256. parseAnimation: function(e, t, i) {
  43257. if (!e)
  43258. return console.error(" no animation in JSONLoader data"),
  43259. null;
  43260. function n(e, t, i, n, r) {
  43261. if (0 !== i.length) {
  43262. var o = []
  43263. , a = [];
  43264. Ci.AnimationUtils.flattenJSON(i, o, a, n),
  43265. 0 !== o.length && r.push(new e(t,o,a))
  43266. }
  43267. }
  43268. for (var r = [], o = e.name || "default", a = e.length || -1, s = e.fps || 30, l = e.hierarchy || [], c = 0; c < l.length; c++) {
  43269. var h = l[c].keys;
  43270. if (h && 0 != h.length)
  43271. if (h[0].morphTargets) {
  43272. for (var u = {}, d = 0; d < h.length; d++)
  43273. if (h[d].morphTargets)
  43274. for (var p = 0; p < h[d].morphTargets.length; p++)
  43275. u[h[d].morphTargets[p]] = -1;
  43276. for (var f in u) {
  43277. var g = []
  43278. , m = [];
  43279. for (p = 0; p !== h[d].morphTargets.length; ++p) {
  43280. var v = h[d];
  43281. g.push(v.time),
  43282. m.push(v.morphTarget === f ? 1 : 0)
  43283. }
  43284. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluence[" + f + "]",g,m))
  43285. }
  43286. a = u.length * (s || 1)
  43287. } else {
  43288. var y = ".bones[" + t[c].name + "]";
  43289. n(Ci.VectorKeyframeTrack, y + ".position", h, "pos", r),
  43290. n(Ci.QuaternionKeyframeTrack, y + ".quaternion", h, "rot", r),
  43291. n(Ci.VectorKeyframeTrack, y + ".scale", h, "scl", r)
  43292. }
  43293. }
  43294. return 0 === r.length ? null : new Ci.AnimationClip(o,a,r)
  43295. }
  43296. }),
  43297. Ci.AnimationMixer = function(e) {
  43298. this._root = e,
  43299. this._initMemoryManager(),
  43300. this._accuIndex = 0,
  43301. this.time = 0,
  43302. this.timeScale = 1
  43303. }
  43304. ,
  43305. Ci.AnimationMixer.prototype = {
  43306. constructor: Ci.AnimationMixer,
  43307. clipAction: function(e, t) {
  43308. var i, n = (t || this._root).uuid, r = "string" == typeof e ? e : e.name, o = e !== r ? e : null, a = this._actionsByClip[r];
  43309. if (void 0 !== a) {
  43310. var s = a.actionByRoot[n];
  43311. if (void 0 !== s)
  43312. return s;
  43313. if (o = (i = a.knownActions[0])._clip,
  43314. e !== r && e !== o)
  43315. throw new Error("Different clips with the same name detected!")
  43316. }
  43317. if (null === o)
  43318. return null;
  43319. var l = new Ci.AnimationMixer._Action(this,o,t);
  43320. return this._bindAction(l, i),
  43321. this._addInactiveAction(l, r, n),
  43322. l
  43323. },
  43324. existingAction: function(e, t) {
  43325. var i = (t || this._root).uuid
  43326. , n = "string" == typeof e ? e : e.name
  43327. , r = this._actionsByClip[n];
  43328. return void 0 !== r && r.actionByRoot[i] || null
  43329. },
  43330. stopAllAction: function() {
  43331. var e = this._actions
  43332. , t = this._nActiveActions
  43333. , i = this._bindings
  43334. , n = this._nActiveBindings;
  43335. this._nActiveActions = 0;
  43336. for (var r = this._nActiveBindings = 0; r !== t; ++r)
  43337. e[r].reset();
  43338. for (r = 0; r !== n; ++r)
  43339. i[r].useCount = 0;
  43340. return this
  43341. },
  43342. update: function(e) {
  43343. e *= this.timeScale;
  43344. 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) {
  43345. var s = t[a];
  43346. s.enabled && s._update(n, e, r, o)
  43347. }
  43348. var l = this._bindings
  43349. , c = this._nActiveBindings;
  43350. for (a = 0; a !== c; ++a)
  43351. l[a].apply(o);
  43352. return this
  43353. },
  43354. getRoot: function() {
  43355. return this._root
  43356. },
  43357. uncacheClip: function(e) {
  43358. var t = this._actions
  43359. , i = e.name
  43360. , n = this._actionsByClip
  43361. , r = n[i];
  43362. if (void 0 !== r) {
  43363. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  43364. var l = o[a];
  43365. this._deactivateAction(l);
  43366. var c = l._cacheIndex
  43367. , h = t[t.length - 1];
  43368. l._cacheIndex = null,
  43369. l._byClipCacheIndex = null,
  43370. t[h._cacheIndex = c] = h,
  43371. t.pop(),
  43372. this._removeInactiveBindingsForAction(l)
  43373. }
  43374. delete n[i]
  43375. }
  43376. },
  43377. uncacheRoot: function(e) {
  43378. var t = e.uuid
  43379. , i = this._actionsByClip;
  43380. for (var n in i) {
  43381. var r = i[n].actionByRoot[t];
  43382. void 0 !== r && (this._deactivateAction(r),
  43383. this._removeInactiveAction(r))
  43384. }
  43385. var o = this._bindingsByRootAndName[t];
  43386. if (void 0 !== o)
  43387. for (var a in o) {
  43388. var s = o[a];
  43389. s.restoreOriginalState(),
  43390. this._removeInactiveBinding(s)
  43391. }
  43392. },
  43393. uncacheAction: function(e, t) {
  43394. var i = this.existingAction(e, t);
  43395. null !== i && (this._deactivateAction(i),
  43396. this._removeInactiveAction(i))
  43397. }
  43398. },
  43399. Ci.EventDispatcher.prototype.apply(Ci.AnimationMixer.prototype),
  43400. Ci.AnimationMixer._Action = function(e, t, i) {
  43401. this._mixer = e,
  43402. this._clip = t,
  43403. this._localRoot = i || null;
  43404. for (var n = t.tracks, r = n.length, o = new Array(r), a = {
  43405. endingStart: Ci.ZeroCurvatureEnding,
  43406. endingEnd: Ci.ZeroCurvatureEnding
  43407. }, s = 0; s !== r; ++s) {
  43408. var l = n[s].createInterpolant(null);
  43409. (o[s] = l).settings = a
  43410. }
  43411. this._interpolantSettings = a,
  43412. this._interpolants = o,
  43413. this._propertyBindings = new Array(r),
  43414. this._cacheIndex = null,
  43415. this._byClipCacheIndex = null,
  43416. this._timeScaleInterpolant = null,
  43417. this._weightInterpolant = null,
  43418. this.loop = Ci.LoopRepeat,
  43419. this._loopCount = -1,
  43420. this._startTime = null,
  43421. this.time = 0,
  43422. this.timeScale = 1,
  43423. this._effectiveTimeScale = 1,
  43424. this.weight = 1,
  43425. this._effectiveWeight = 1,
  43426. this.repetitions = 1 / 0,
  43427. this.paused = !1,
  43428. this.enabled = !0,
  43429. this.clampWhenFinished = !1,
  43430. this.zeroSlopeAtStart = !0,
  43431. this.zeroSlopeAtEnd = !0
  43432. }
  43433. ,
  43434. Ci.AnimationMixer._Action.prototype = {
  43435. constructor: Ci.AnimationMixer._Action,
  43436. play: function() {
  43437. return this._mixer._activateAction(this),
  43438. this
  43439. },
  43440. stop: function() {
  43441. return this._mixer._deactivateAction(this),
  43442. this.reset()
  43443. },
  43444. reset: function() {
  43445. return this.paused = !1,
  43446. this.enabled = !0,
  43447. this.time = 0,
  43448. this._loopCount = -1,
  43449. this._startTime = null,
  43450. this.stopFading().stopWarping()
  43451. },
  43452. isRunning: function() {
  43453. return this._startTime,
  43454. this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  43455. },
  43456. isScheduled: function() {
  43457. return this._mixer._isActiveAction(this)
  43458. },
  43459. startAt: function(e) {
  43460. return this._startTime = e,
  43461. this
  43462. },
  43463. setLoop: function(e, t) {
  43464. return this.loop = e,
  43465. this.repetitions = t,
  43466. this
  43467. },
  43468. setEffectiveWeight: function(e) {
  43469. return this.weight = e,
  43470. this._effectiveWeight = this.enabled ? e : 0,
  43471. this.stopFading()
  43472. },
  43473. getEffectiveWeight: function() {
  43474. return this._effectiveWeight
  43475. },
  43476. fadeIn: function(e) {
  43477. return this._scheduleFading(e, 0, 1)
  43478. },
  43479. fadeOut: function(e) {
  43480. return this._scheduleFading(e, 1, 0)
  43481. },
  43482. crossFadeFrom: function(e, t, i) {
  43483. if (this._mixer,
  43484. e.fadeOut(t),
  43485. this.fadeIn(t),
  43486. i) {
  43487. var n = this._clip.duration
  43488. , r = e._clip.duration
  43489. , o = r / n
  43490. , a = n / r;
  43491. e.warp(1, o, t),
  43492. this.warp(a, 1, t)
  43493. }
  43494. return this
  43495. },
  43496. crossFadeTo: function(e, t, i) {
  43497. return e.crossFadeFrom(this, t, i)
  43498. },
  43499. stopFading: function() {
  43500. var e = this._weightInterpolant;
  43501. return null !== e && (this._weightInterpolant = null,
  43502. this._mixer._takeBackControlInterpolant(e)),
  43503. this
  43504. },
  43505. setEffectiveTimeScale: function(e) {
  43506. return this.timeScale = e,
  43507. this._effectiveTimeScale = this.paused ? 0 : e,
  43508. this.stopWarping()
  43509. },
  43510. getEffectiveTimeScale: function() {
  43511. return this._effectiveTimeScale
  43512. },
  43513. setDuration: function(e) {
  43514. return this.timeScale = this._clip.duration / e,
  43515. this.stopWarping()
  43516. },
  43517. syncWith: function(e) {
  43518. return this.time = e.time,
  43519. this.timeScale = e.timeScale,
  43520. this.stopWarping()
  43521. },
  43522. halt: function(e) {
  43523. return this.warp(this._currentTimeScale, 0, e)
  43524. },
  43525. warp: function(e, t, i) {
  43526. var n = this._mixer
  43527. , r = n.time
  43528. , o = this._timeScaleInterpolant
  43529. , a = this.timeScale;
  43530. null === o && (o = n._lendControlInterpolant(),
  43531. this._timeScaleInterpolant = o);
  43532. var s = o.parameterPositions
  43533. , l = o.sampleValues;
  43534. return s[0] = r,
  43535. s[1] = r + i,
  43536. l[0] = e / a,
  43537. l[1] = t / a,
  43538. this
  43539. },
  43540. stopWarping: function() {
  43541. var e = this._timeScaleInterpolant;
  43542. return null !== e && (this._timeScaleInterpolant = null,
  43543. this._mixer._takeBackControlInterpolant(e)),
  43544. this
  43545. },
  43546. getMixer: function() {
  43547. return this._mixer
  43548. },
  43549. getClip: function() {
  43550. return this._clip
  43551. },
  43552. getRoot: function() {
  43553. return this._localRoot || this._mixer._root
  43554. },
  43555. _update: function(e, t, i, n) {
  43556. var r = this._startTime;
  43557. if (null !== r) {
  43558. var o = (e - r) * i;
  43559. if (o < 0 || 0 === i)
  43560. return;
  43561. this._startTime = null,
  43562. t = i * o
  43563. }
  43564. t *= this._updateTimeScale(e);
  43565. var a = this._updateTime(t)
  43566. , s = this._updateWeight(e);
  43567. if (0 < s)
  43568. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  43569. l[h].evaluate(a),
  43570. c[h].accumulate(n, s)
  43571. },
  43572. _updateWeight: function(e) {
  43573. var t = 0;
  43574. if (this.enabled) {
  43575. t = this.weight;
  43576. var i = this._weightInterpolant;
  43577. if (null !== i) {
  43578. var n = i.evaluate(e)[0];
  43579. t *= n,
  43580. e > i.parameterPositions[1] && (this.stopFading(),
  43581. 0 === n && (this.enabled = !1))
  43582. }
  43583. }
  43584. return this._effectiveWeight = t
  43585. },
  43586. _updateTimeScale: function(e) {
  43587. var t = 0;
  43588. if (!this.paused) {
  43589. t = this.timeScale;
  43590. var i = this._timeScaleInterpolant;
  43591. if (null !== i)
  43592. t *= i.evaluate(e)[0],
  43593. e > i.parameterPositions[1] && (this.stopWarping(),
  43594. 0 === t ? this.pause = !0 : this.timeScale = t)
  43595. }
  43596. return this._effectiveTimeScale = t
  43597. },
  43598. _updateTime: function(e) {
  43599. var t = this.time + e;
  43600. if (0 === e)
  43601. return t;
  43602. var i = this._clip.duration
  43603. , n = this.loop
  43604. , r = this._loopCount
  43605. , o = !1;
  43606. switch (n) {
  43607. case Ci.LoopOnce:
  43608. if (-1 === r && (this.loopCount = 0,
  43609. this._setEndings(!0, !0, !1)),
  43610. i <= t)
  43611. t = i;
  43612. else {
  43613. if (!(t < 0))
  43614. break;
  43615. t = 0
  43616. }
  43617. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  43618. this._mixer.dispatchEvent({
  43619. type: "finished",
  43620. action: this,
  43621. direction: e < 0 ? -1 : 1
  43622. });
  43623. break;
  43624. case Ci.LoopPingPong:
  43625. o = !0;
  43626. case Ci.LoopRepeat:
  43627. if (-1 === r && (0 < e ? (r = 0,
  43628. this._setEndings(!0, 0 === this.repetitions, o)) : this._setEndings(0 === this.repetitions, !0, o)),
  43629. i <= t || t < 0) {
  43630. var a = Math.floor(t / i);
  43631. t -= i * a,
  43632. r += Math.abs(a);
  43633. var s = this.repetitions - r;
  43634. if (s < 0) {
  43635. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  43636. t = 0 < e ? i : 0,
  43637. this._mixer.dispatchEvent({
  43638. type: "finished",
  43639. action: this,
  43640. direction: 0 < e ? 1 : -1
  43641. });
  43642. break
  43643. }
  43644. if (0 == s) {
  43645. var l = e < 0;
  43646. this._setEndings(l, !l, o)
  43647. } else
  43648. this._setEndings(!1, !1, o);
  43649. this._loopCount = r,
  43650. this._mixer.dispatchEvent({
  43651. type: "loop",
  43652. action: this,
  43653. loopDelta: a
  43654. })
  43655. }
  43656. if (n === Ci.LoopPingPong && 1 == (1 & r))
  43657. return i - (this.time = t)
  43658. }
  43659. return this.time = t
  43660. },
  43661. _setEndings: function(e, t, i) {
  43662. var n = this._interpolantSettings;
  43663. i ? (n.endingStart = Ci.ZeroSlopeEnding,
  43664. n.endingEnd = Ci.ZeroSlopeEnding) : (n.endingStart = e ? this.zeroSlopeAtStart ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding,
  43665. n.endingEnd = t ? this.zeroSlopeAtEnd ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding)
  43666. },
  43667. _scheduleFading: function(e, t, i) {
  43668. var n = this._mixer
  43669. , r = n.time
  43670. , o = this._weightInterpolant;
  43671. null === o && (o = n._lendControlInterpolant(),
  43672. this._weightInterpolant = o);
  43673. var a = o.parameterPositions
  43674. , s = o.sampleValues;
  43675. return a[0] = r,
  43676. s[0] = t,
  43677. a[1] = r + e,
  43678. s[1] = i,
  43679. this
  43680. }
  43681. },
  43682. Object.assign(Ci.AnimationMixer.prototype, {
  43683. _bindAction: function(e, t) {
  43684. var i = e._localRoot || this._root
  43685. , n = e._clip.tracks
  43686. , r = n.length
  43687. , o = e._propertyBindings
  43688. , a = e._interpolants
  43689. , s = i.uuid
  43690. , l = this._bindingsByRootAndName
  43691. , c = l[s];
  43692. void 0 === c && (c = {},
  43693. l[s] = c);
  43694. for (var h = 0; h !== r; ++h) {
  43695. var u = n[h]
  43696. , d = u.name
  43697. , p = c[d];
  43698. if (void 0 !== p)
  43699. o[h] = p;
  43700. else {
  43701. if (void 0 !== (p = o[h])) {
  43702. null === p._cacheIndex && (++p.referenceCount,
  43703. this._addInactiveBinding(p, s, d));
  43704. continue
  43705. }
  43706. var f = t && t._propertyBindings[h].binding.parsedPath;
  43707. ++(p = new Ci.PropertyMixer(Ci.PropertyBinding.create(i, d, f),u.ValueTypeName,u.getValueSize())).referenceCount,
  43708. this._addInactiveBinding(p, s, d),
  43709. o[h] = p
  43710. }
  43711. a[h].resultBuffer = p.buffer
  43712. }
  43713. },
  43714. _activateAction: function(e) {
  43715. if (!this._isActiveAction(e)) {
  43716. if (null === e._cacheIndex) {
  43717. var t = (e._localRoot || this._root).uuid
  43718. , i = e._clip.name
  43719. , n = this._actionsByClip[i];
  43720. this._bindAction(e, n && n.knownActions[0]),
  43721. this._addInactiveAction(e, i, t)
  43722. }
  43723. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  43724. var s = r[o];
  43725. 0 == s.useCount++ && (this._lendBinding(s),
  43726. s.saveOriginalState())
  43727. }
  43728. this._lendAction(e)
  43729. }
  43730. },
  43731. _deactivateAction: function(e) {
  43732. if (this._isActiveAction(e)) {
  43733. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43734. var r = t[i];
  43735. 0 == --r.useCount && (r.restoreOriginalState(),
  43736. this._takeBackBinding(r))
  43737. }
  43738. this._takeBackAction(e)
  43739. }
  43740. },
  43741. _initMemoryManager: function() {
  43742. this._actions = [],
  43743. this._nActiveActions = 0,
  43744. this._actionsByClip = {},
  43745. this._bindings = [],
  43746. this._nActiveBindings = 0,
  43747. this._bindingsByRootAndName = {},
  43748. this._controlInterpolants = [],
  43749. this._nActiveControlInterpolants = 0;
  43750. var e = this;
  43751. this.stats = {
  43752. actions: {
  43753. get total() {
  43754. return e._actions.length
  43755. },
  43756. get inUse() {
  43757. return e._nActiveActions
  43758. }
  43759. },
  43760. bindings: {
  43761. get total() {
  43762. return e._bindings.length
  43763. },
  43764. get inUse() {
  43765. return e._nActiveBindings
  43766. }
  43767. },
  43768. controlInterpolants: {
  43769. get total() {
  43770. return e._controlInterpolants.length
  43771. },
  43772. get inUse() {
  43773. return e._nActiveControlInterpolants
  43774. }
  43775. }
  43776. }
  43777. },
  43778. _isActiveAction: function(e) {
  43779. var t = e._cacheIndex;
  43780. return null !== t && t < this._nActiveActions
  43781. },
  43782. _addInactiveAction: function(e, t, i) {
  43783. var n = this._actions
  43784. , r = this._actionsByClip
  43785. , o = r[t];
  43786. if (void 0 === o)
  43787. o = {
  43788. knownActions: [e],
  43789. actionByRoot: {}
  43790. },
  43791. e._byClipCacheIndex = 0,
  43792. r[t] = o;
  43793. else {
  43794. var a = o.knownActions;
  43795. e._byClipCacheIndex = a.length,
  43796. a.push(e)
  43797. }
  43798. e._cacheIndex = n.length,
  43799. n.push(e),
  43800. o.actionByRoot[i] = e
  43801. },
  43802. _removeInactiveAction: function(e) {
  43803. var t = this._actions
  43804. , i = t[t.length - 1]
  43805. , n = e._cacheIndex;
  43806. t[i._cacheIndex = n] = i,
  43807. t.pop(),
  43808. e._cacheIndex = null;
  43809. var r = e._clip.name
  43810. , o = this._actionsByClip
  43811. , a = o[r]
  43812. , s = a.knownActions
  43813. , l = s[s.length - 1]
  43814. , c = e._byClipCacheIndex;
  43815. s[l._byClipCacheIndex = c] = l,
  43816. s.pop(),
  43817. e._byClipCacheIndex = null,
  43818. delete a.actionByRoot[(t._localRoot || this._root).uuid],
  43819. 0 === s.length && delete o[r],
  43820. this._removeInactiveBindingsForAction(e)
  43821. },
  43822. _removeInactiveBindingsForAction: function(e) {
  43823. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43824. var r = t[i];
  43825. 0 == --r.referenceCount && this._removeInactiveBinding(r)
  43826. }
  43827. },
  43828. _lendAction: function(e) {
  43829. var t = this._actions
  43830. , i = e._cacheIndex
  43831. , n = this._nActiveActions++
  43832. , r = t[n];
  43833. t[e._cacheIndex = n] = e,
  43834. t[r._cacheIndex = i] = r
  43835. },
  43836. _takeBackAction: function(e) {
  43837. var t = this._actions
  43838. , i = e._cacheIndex
  43839. , n = --this._nActiveActions
  43840. , r = t[n];
  43841. t[e._cacheIndex = n] = e,
  43842. t[r._cacheIndex = i] = r
  43843. },
  43844. _addInactiveBinding: function(e, t, i) {
  43845. var n = this._bindingsByRootAndName
  43846. , r = n[t]
  43847. , o = this._bindings;
  43848. void 0 === r && (r = {},
  43849. n[t] = r),
  43850. (r[i] = e)._cacheIndex = o.length,
  43851. o.push(e)
  43852. },
  43853. _removeInactiveBinding: function(e) {
  43854. var t = this._bindings
  43855. , i = e.binding
  43856. , n = i.rootNode.uuid
  43857. , r = i.path
  43858. , o = this._bindingsByRootAndName
  43859. , a = o[n]
  43860. , s = t[t.length - 1]
  43861. , l = e._cacheIndex;
  43862. t[s._cacheIndex = l] = s,
  43863. t.pop(),
  43864. delete a[r];
  43865. e: {
  43866. for (var c in a)
  43867. break e;
  43868. delete o[n]
  43869. }
  43870. },
  43871. _lendBinding: function(e) {
  43872. var t = this._bindings
  43873. , i = e._cacheIndex
  43874. , n = this._nActiveBindings++
  43875. , r = t[n];
  43876. t[e._cacheIndex = n] = e,
  43877. t[r._cacheIndex = i] = r
  43878. },
  43879. _takeBackBinding: function(e) {
  43880. var t = this._bindings
  43881. , i = e._cacheIndex
  43882. , n = --this._nActiveBindings
  43883. , r = t[n];
  43884. t[e._cacheIndex = n] = e,
  43885. t[r._cacheIndex = i] = r
  43886. },
  43887. _lendControlInterpolant: function() {
  43888. var e = this._controlInterpolants
  43889. , t = this._nActiveControlInterpolants++
  43890. , i = e[t];
  43891. return void 0 === i && (e[(i = new Ci.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex = t] = i),
  43892. i
  43893. },
  43894. _takeBackControlInterpolant: function(e) {
  43895. var t = this._controlInterpolants
  43896. , i = e.__cacheIndex
  43897. , n = --this._nActiveControlInterpolants
  43898. , r = t[n];
  43899. t[e.__cacheIndex = n] = e,
  43900. t[r.__cacheIndex = i] = r
  43901. },
  43902. _controlInterpolantsResultBuffer: new Float32Array(1)
  43903. }),
  43904. Ci.AnimationObjectGroup = function(e) {
  43905. this.uuid = Ci.Math.generateUUID(),
  43906. this._objects = Array.prototype.slice.call(arguments),
  43907. this.nCachedObjects_ = 0;
  43908. var t = {};
  43909. this._indicesByUUID = t;
  43910. for (var i = 0, n = arguments.length; i !== n; ++i)
  43911. t[arguments[i].uuid] = i;
  43912. this._paths = [],
  43913. this._parsedPaths = [],
  43914. this._bindings = [],
  43915. this._bindingsIndicesByPath = {};
  43916. var r = this;
  43917. this.stats = {
  43918. objects: {
  43919. get total() {
  43920. return r._objects.length
  43921. },
  43922. get inUse() {
  43923. return this.total - r.nCachedObjects_
  43924. }
  43925. },
  43926. get bindingsPerObject() {
  43927. return r._bindings.length
  43928. }
  43929. }
  43930. }
  43931. ,
  43932. Ci.AnimationObjectGroup.prototype = {
  43933. constructor: Ci.AnimationObjectGroup,
  43934. add: function(e) {
  43935. for (var t = this._objects, i = t.length, n = this.nCachedObjects_, r = this._indicesByUUID, o = this._paths, a = this._parsedPaths, s = this._bindings, l = s.length, c = 0, h = arguments.length; c !== h; ++c) {
  43936. var u = arguments[c]
  43937. , d = u.uuid
  43938. , p = r[d];
  43939. if (void 0 === p) {
  43940. p = i++,
  43941. r[d] = p,
  43942. t.push(u);
  43943. for (var f = 0, g = l; f !== g; ++f)
  43944. s[f].push(new Ci.PropertyBinding(u,o[f],a[f]))
  43945. } else if (p < n) {
  43946. var m = t[p]
  43947. , v = --n
  43948. , y = t[v];
  43949. t[r[y.uuid] = p] = y,
  43950. t[r[d] = v] = u;
  43951. for (f = 0,
  43952. g = l; f !== g; ++f) {
  43953. var A = s[f]
  43954. , C = A[v]
  43955. , I = A[p];
  43956. A[p] = C,
  43957. void 0 === I && (I = new Ci.PropertyBinding(u,o[f],a[f])),
  43958. A[v] = I
  43959. }
  43960. } else
  43961. t[p] !== m && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  43962. }
  43963. this.nCachedObjects_ = n
  43964. },
  43965. remove: function(e) {
  43966. for (var t = this._objects, i = (t.length,
  43967. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  43968. var l = arguments[a]
  43969. , c = l.uuid
  43970. , h = n[c];
  43971. if (void 0 !== h && i <= h) {
  43972. var u = i++
  43973. , d = t[u];
  43974. t[n[d.uuid] = h] = d,
  43975. t[n[c] = u] = l;
  43976. for (var p = 0, f = o; p !== f; ++p) {
  43977. var g = r[p]
  43978. , m = g[u]
  43979. , v = g[h];
  43980. g[h] = m,
  43981. g[u] = v
  43982. }
  43983. }
  43984. }
  43985. this.nCachedObjects_ = i
  43986. },
  43987. uncache: function(e) {
  43988. 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) {
  43989. var c = arguments[s].uuid
  43990. , h = r[c];
  43991. if (void 0 !== h)
  43992. if (delete r[c],
  43993. h < n) {
  43994. var u = --n
  43995. , d = t[u]
  43996. , p = t[y = --i];
  43997. t[r[d.uuid] = h] = d,
  43998. t[r[p.uuid] = u] = p,
  43999. t.pop();
  44000. for (var f = 0, g = a; f !== g; ++f) {
  44001. var m = (A = o[f])[u]
  44002. , v = A[y];
  44003. A[h] = m,
  44004. A[u] = v,
  44005. A.pop()
  44006. }
  44007. } else {
  44008. var y;
  44009. t[r[(p = t[y = --i]).uuid] = h] = p,
  44010. t.pop();
  44011. for (f = 0,
  44012. g = a; f !== g; ++f) {
  44013. var A;
  44014. (A = o[f])[h] = A[y],
  44015. A.pop()
  44016. }
  44017. }
  44018. }
  44019. this.nCachedObjects_ = n
  44020. },
  44021. subscribe_: function(e, t) {
  44022. var i = this._bindingsIndicesByPath
  44023. , n = i[e]
  44024. , r = this._bindings;
  44025. if (void 0 !== n)
  44026. return r[n];
  44027. var o = this._paths
  44028. , a = this._parsedPaths
  44029. , s = this._objects
  44030. , l = s.length
  44031. , c = this.nCachedObjects_
  44032. , h = new Array(l);
  44033. n = r.length,
  44034. i[e] = n,
  44035. o.push(e),
  44036. a.push(t),
  44037. r.push(h);
  44038. for (var u = c, d = s.length; u !== d; ++u) {
  44039. var p = s[u];
  44040. h[u] = new Ci.PropertyBinding(p,e,t)
  44041. }
  44042. return h
  44043. },
  44044. unsubscribe_: function(e) {
  44045. var t = this._bindingsIndicesByPath
  44046. , i = t[e];
  44047. if (void 0 !== i) {
  44048. var n = this._paths
  44049. , r = this._parsedPaths
  44050. , o = this._bindings
  44051. , a = o.length - 1
  44052. , s = o[a];
  44053. o[t[e[a]] = i] = s,
  44054. o.pop(),
  44055. r[i] = r[a],
  44056. r.pop(),
  44057. n[i] = n[a],
  44058. n.pop()
  44059. }
  44060. }
  44061. },
  44062. Ci.AnimationUtils = {
  44063. arraySlice: function(e, t, i) {
  44064. return Ci.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  44065. },
  44066. convertArray: function(e, t, i) {
  44067. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  44068. },
  44069. isTypedArray: function(e) {
  44070. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  44071. },
  44072. getKeyframeOrder: function(i) {
  44073. for (var e = i.length, t = new Array(e), n = 0; n !== e; ++n)
  44074. t[n] = n;
  44075. return t.sort(function(e, t) {
  44076. return i[e] - i[t]
  44077. }),
  44078. t
  44079. },
  44080. sortedArray: function(e, t, i) {
  44081. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  44082. for (var s = i[o] * t, l = 0; l !== t; ++l)
  44083. r[a++] = e[s + l];
  44084. return r
  44085. },
  44086. flattenJSON: function(e, t, i, n) {
  44087. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  44088. o = e[r++];
  44089. if (void 0 !== o) {
  44090. var a = o[n];
  44091. if (void 0 !== a)
  44092. if (Array.isArray(a))
  44093. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  44094. i.push.apply(i, a)),
  44095. void 0 !== (o = e[r++]); )
  44096. ;
  44097. else if (void 0 !== a.toArray)
  44098. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  44099. a.toArray(i, i.length)),
  44100. void 0 !== (o = e[r++]); )
  44101. ;
  44102. else
  44103. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  44104. i.push(a)),
  44105. void 0 !== (o = e[r++]); )
  44106. ;
  44107. }
  44108. }
  44109. },
  44110. Ci.KeyframeTrack = function(e, t, i, n) {
  44111. if (void 0 === e)
  44112. throw new Error("track name is undefined");
  44113. if (void 0 === t || 0 === t.length)
  44114. throw new Error("no keyframes in track named " + e);
  44115. this.name = e,
  44116. this.times = Ci.AnimationUtils.convertArray(t, this.TimeBufferType),
  44117. this.values = Ci.AnimationUtils.convertArray(i, this.ValueBufferType),
  44118. this.setInterpolation(n || this.DefaultInterpolation),
  44119. this.validate(),
  44120. this.optimize()
  44121. }
  44122. ,
  44123. Ci.KeyframeTrack.prototype = {
  44124. constructor: Ci.KeyframeTrack,
  44125. TimeBufferType: Float32Array,
  44126. ValueBufferType: Float32Array,
  44127. DefaultInterpolation: Ci.InterpolateLinear,
  44128. InterpolantFactoryMethodDiscrete: function(e) {
  44129. return new Ci.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  44130. },
  44131. InterpolantFactoryMethodLinear: function(e) {
  44132. return new Ci.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44133. },
  44134. InterpolantFactoryMethodSmooth: function(e) {
  44135. return new Ci.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  44136. },
  44137. setInterpolation: function(e) {
  44138. var t = void 0;
  44139. switch (e) {
  44140. case Ci.InterpolateDiscrete:
  44141. t = this.InterpolantFactoryMethodDiscrete;
  44142. break;
  44143. case Ci.InterpolateLinear:
  44144. t = this.InterpolantFactoryMethodLinear;
  44145. break;
  44146. case Ci.InterpolateSmooth:
  44147. t = this.InterpolantFactoryMethodSmooth
  44148. }
  44149. if (void 0 !== t)
  44150. this.createInterpolant = t;
  44151. else {
  44152. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  44153. if (void 0 === this.createInterpolant) {
  44154. if (e === this.DefaultInterpolation)
  44155. throw new Error(i);
  44156. this.setInterpolation(this.DefaultInterpolation)
  44157. }
  44158. console.warn(i)
  44159. }
  44160. },
  44161. getInterpolation: function() {
  44162. switch (this.createInterpolant) {
  44163. case this.InterpolantFactoryMethodDiscrete:
  44164. return Ci.InterpolateDiscrete;
  44165. case this.InterpolantFactoryMethodLinear:
  44166. return Ci.InterpolateLinear;
  44167. case this.InterpolantFactoryMethodSmooth:
  44168. return Ci.InterpolateSmooth
  44169. }
  44170. },
  44171. getValueSize: function() {
  44172. return this.values.length / this.times.length
  44173. },
  44174. shift: function(e) {
  44175. if (0 !== e)
  44176. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  44177. t[i] += e;
  44178. return this
  44179. },
  44180. scale: function(e) {
  44181. if (1 !== e)
  44182. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  44183. t[i] *= e;
  44184. return this
  44185. },
  44186. trim: function(e, t) {
  44187. for (var i = this.times, n = i.length, r = 0, o = n - 1; r !== n && i[r] < e; )
  44188. ++r;
  44189. for (; -1 !== o && i[o] > t; )
  44190. --o;
  44191. if (++o,
  44192. 0 !== r || o !== n) {
  44193. o <= r && (r = (o = Math.max(o, 1)) - 1);
  44194. var a = this.getValueSize();
  44195. this.times = Ci.AnimationUtils.arraySlice(i, r, o),
  44196. this.values = Ci.AnimationUtils.arraySlice(this.values, r * a, o * a)
  44197. }
  44198. return this
  44199. },
  44200. validate: function() {
  44201. var e = !0
  44202. , t = this.getValueSize();
  44203. t - Math.floor(t) != 0 && (console.error("invalid value size in track", this),
  44204. e = !1);
  44205. var i = this.times
  44206. , n = this.values
  44207. , r = i.length;
  44208. 0 === r && (console.error("track is empty", this),
  44209. e = !1);
  44210. for (var o = null, a = 0; a !== r; a++) {
  44211. var s = i[a];
  44212. if ("number" == typeof s && isNaN(s)) {
  44213. console.error("time is not a valid number", this, a, s),
  44214. e = !1;
  44215. break
  44216. }
  44217. if (null !== o && s < o) {
  44218. console.error("out of order keys", this, a, s, o),
  44219. e = !1;
  44220. break
  44221. }
  44222. o = s
  44223. }
  44224. if (void 0 !== n && Ci.AnimationUtils.isTypedArray(n)) {
  44225. a = 0;
  44226. for (var l = n.length; a !== l; ++a) {
  44227. var c = n[a];
  44228. if (isNaN(c)) {
  44229. console.error("value is not a valid number", this, a, c),
  44230. e = !1;
  44231. break
  44232. }
  44233. }
  44234. }
  44235. return e
  44236. },
  44237. optimize: function() {
  44238. for (var e = this.times, t = this.values, i = this.getValueSize(), n = 1, r = 1, o = e.length - 1; r <= o; ++r) {
  44239. var a = !1
  44240. , s = e[r];
  44241. if (s !== e[r + 1] && (1 !== r || s !== s[0]))
  44242. for (var l = r * i, c = l - i, h = l + i, u = 0; u !== i; ++u) {
  44243. var d = t[l + u];
  44244. if (d !== t[c + u] || d !== t[h + u]) {
  44245. a = !0;
  44246. break
  44247. }
  44248. }
  44249. if (a) {
  44250. if (r !== n) {
  44251. e[n] = e[r];
  44252. var p = r * i
  44253. , f = n * i;
  44254. for (u = 0; u !== i; ++u)
  44255. t[f + u] = t[p + u]
  44256. }
  44257. ++n
  44258. }
  44259. }
  44260. return n !== e.length && (this.times = Ci.AnimationUtils.arraySlice(e, 0, n),
  44261. this.values = Ci.AnimationUtils.arraySlice(t, 0, n * i)),
  44262. this
  44263. }
  44264. },
  44265. Object.assign(Ci.KeyframeTrack, {
  44266. parse: function(e) {
  44267. if (void 0 === e.type)
  44268. throw new Error("track type undefined, can not parse");
  44269. var t = Ci.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  44270. if (void 0 === e.times) {
  44271. console.warn("legacy JSON format detected, converting");
  44272. var i = []
  44273. , n = [];
  44274. Ci.AnimationUtils.flattenJSON(e.keys, i, n, "value"),
  44275. e.times = i,
  44276. e.values = n
  44277. }
  44278. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  44279. },
  44280. toJSON: function(e) {
  44281. var t, i = e.constructor;
  44282. if (void 0 !== i.toJSON)
  44283. t = i.toJSON(e);
  44284. else {
  44285. t = {
  44286. name: e.name,
  44287. times: Ci.AnimationUtils.convertArray(e.times, Array),
  44288. values: Ci.AnimationUtils.convertArray(e.values, Array)
  44289. };
  44290. var n = e.getInterpolation();
  44291. n !== e.DefaultInterpolation && (t.interpolation = n)
  44292. }
  44293. return t.type = e.ValueTypeName,
  44294. t
  44295. },
  44296. _getTrackTypeForValueTypeName: function(e) {
  44297. switch (e.toLowerCase()) {
  44298. case "scalar":
  44299. case "double":
  44300. case "float":
  44301. case "number":
  44302. case "integer":
  44303. return Ci.NumberKeyframeTrack;
  44304. case "vector":
  44305. case "vector2":
  44306. case "vector3":
  44307. case "vector4":
  44308. return Ci.VectorKeyframeTrack;
  44309. case "color":
  44310. return Ci.ColorKeyframeTrack;
  44311. case "quaternion":
  44312. return Ci.QuaternionKeyframeTrack;
  44313. case "bool":
  44314. case "boolean":
  44315. return Ci.BooleanKeyframeTrack;
  44316. case "string":
  44317. return Ci.StringKeyframeTrack
  44318. }
  44319. throw new Error("Unsupported typeName: " + e)
  44320. }
  44321. }),
  44322. Ci.PropertyBinding = function(e, t, i) {
  44323. this.path = t,
  44324. this.parsedPath = i || Ci.PropertyBinding.parseTrackName(t),
  44325. this.node = Ci.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  44326. this.rootNode = e
  44327. }
  44328. ,
  44329. Ci.PropertyBinding.prototype = {
  44330. constructor: Ci.PropertyBinding,
  44331. getValue: function(e, t) {
  44332. this.bind(),
  44333. this.getValue(e, t)
  44334. },
  44335. setValue: function(e, t) {
  44336. this.bind(),
  44337. this.setValue(e, t)
  44338. },
  44339. bind: function() {
  44340. var e = this.node
  44341. , t = this.parsedPath
  44342. , i = t.objectName
  44343. , n = t.propertyName
  44344. , r = t.propertyIndex;
  44345. if (e || (e = Ci.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  44346. this.node = e),
  44347. this.getValue = this._getValue_unavailable,
  44348. this.setValue = this._setValue_unavailable,
  44349. e) {
  44350. if (i) {
  44351. var o = t.objectIndex;
  44352. switch (i) {
  44353. case "materials":
  44354. if (!e.material)
  44355. return void console.error(" can not bind to material as node does not have a material", this);
  44356. if (!e.material.materials)
  44357. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  44358. e = e.material.materials;
  44359. break;
  44360. case "bones":
  44361. if (!e.skeleton)
  44362. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  44363. e = e.skeleton.bones;
  44364. for (var a = 0; a < e.length; a++)
  44365. if (e[a].name === o) {
  44366. o = a;
  44367. break
  44368. }
  44369. break;
  44370. default:
  44371. if (void 0 === e[i])
  44372. return void console.error(" can not bind to objectName of node, undefined", this);
  44373. e = e[i]
  44374. }
  44375. if (void 0 !== o) {
  44376. if (void 0 === e[o])
  44377. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  44378. e = e[o]
  44379. }
  44380. }
  44381. var s = e[n];
  44382. if (s) {
  44383. var l = this.Versioning.None;
  44384. void 0 !== e.needsUpdate ? (l = this.Versioning.NeedsUpdate,
  44385. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (l = this.Versioning.MatrixWorldNeedsUpdate,
  44386. this.targetObject = e);
  44387. var c = this.BindingType.Direct;
  44388. if (void 0 !== r) {
  44389. if ("morphTargetInfluences" === n) {
  44390. if (!e.geometry)
  44391. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  44392. if (!e.geometry.morphTargets)
  44393. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  44394. for (a = 0; a < this.node.geometry.morphTargets.length; a++)
  44395. if (e.geometry.morphTargets[a].name === r) {
  44396. r = a;
  44397. break
  44398. }
  44399. }
  44400. c = this.BindingType.ArrayElement,
  44401. this.resolvedProperty = s,
  44402. this.propertyIndex = r
  44403. } else
  44404. void 0 !== s.fromArray && void 0 !== s.toArray ? (c = this.BindingType.HasFromToArray,
  44405. this.resolvedProperty = s) : void 0 !== s.length ? (c = this.BindingType.EntireArray,
  44406. this.resolvedProperty = s) : this.propertyName = n;
  44407. this.getValue = this.GetterByBindingType[c],
  44408. this.setValue = this.SetterByBindingTypeAndVersioning[c][l]
  44409. } else {
  44410. var h = t.nodeName;
  44411. console.error(" trying to update property for track: " + h + "." + n + " but it wasn't found.", e)
  44412. }
  44413. } else
  44414. console.error(" trying to update node for track: " + this.path + " but it wasn't found.")
  44415. },
  44416. unbind: function() {
  44417. this.node = null,
  44418. this.getValue = this._getValue_unbound,
  44419. this.setValue = this._setValue_unbound
  44420. }
  44421. },
  44422. Object.assign(Ci.PropertyBinding.prototype, {
  44423. _getValue_unavailable: function() {},
  44424. _setValue_unavailable: function() {},
  44425. _getValue_unbound: Ci.PropertyBinding.prototype.getValue,
  44426. _setValue_unbound: Ci.PropertyBinding.prototype.setValue,
  44427. BindingType: {
  44428. Direct: 0,
  44429. EntireArray: 1,
  44430. ArrayElement: 2,
  44431. HasFromToArray: 3
  44432. },
  44433. Versioning: {
  44434. None: 0,
  44435. NeedsUpdate: 1,
  44436. MatrixWorldNeedsUpdate: 2
  44437. },
  44438. GetterByBindingType: [function(e, t) {
  44439. e[t] = this.node[this.propertyName]
  44440. }
  44441. , function(e, t) {
  44442. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44443. e[t++] = i[n]
  44444. }
  44445. , function(e, t) {
  44446. e[t] = this.resolvedProperty[this.propertyIndex]
  44447. }
  44448. , function(e, t) {
  44449. this.resolvedProperty.toArray(e, t)
  44450. }
  44451. ],
  44452. SetterByBindingTypeAndVersioning: [[function(e, t) {
  44453. this.node[this.propertyName] = e[t]
  44454. }
  44455. , function(e, t) {
  44456. this.node[this.propertyName] = e[t],
  44457. this.targetObject.needsUpdate = !0
  44458. }
  44459. , function(e, t) {
  44460. this.node[this.propertyName] = e[t],
  44461. this.targetObject.matrixWorldNeedsUpdate = !0
  44462. }
  44463. ], [function(e, t) {
  44464. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44465. i[n] = e[t++]
  44466. }
  44467. , function(e, t) {
  44468. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44469. i[n] = e[t++];
  44470. this.targetObject.needsUpdate = !0
  44471. }
  44472. , function(e, t) {
  44473. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44474. i[n] = e[t++];
  44475. this.targetObject.matrixWorldNeedsUpdate = !0
  44476. }
  44477. ], [function(e, t) {
  44478. this.resolvedProperty[this.propertyIndex] = e[t]
  44479. }
  44480. , function(e, t) {
  44481. this.resolvedProperty[this.propertyIndex] = e[t],
  44482. this.targetObject.needsUpdate = !0
  44483. }
  44484. , function(e, t) {
  44485. this.resolvedProperty[this.propertyIndex] = e[t],
  44486. this.targetObject.matrixWorldNeedsUpdate = !0
  44487. }
  44488. ], [function(e, t) {
  44489. this.resolvedProperty.fromArray(e, t)
  44490. }
  44491. , function(e, t) {
  44492. this.resolvedProperty.fromArray(e, t),
  44493. this.targetObject.needsUpdate = !0
  44494. }
  44495. , function(e, t) {
  44496. this.resolvedProperty.fromArray(e, t),
  44497. this.targetObject.matrixWorldNeedsUpdate = !0
  44498. }
  44499. ]]
  44500. }),
  44501. Ci.PropertyBinding.Composite = function(e, t, i) {
  44502. var n = i || Ci.PropertyBinding.parseTrackName(t);
  44503. this._targetGroup = e,
  44504. this._bindings = e.subscribe_(t, n)
  44505. }
  44506. ,
  44507. Ci.PropertyBinding.Composite.prototype = {
  44508. constructor: Ci.PropertyBinding.Composite,
  44509. getValue: function(e, t) {
  44510. this.bind();
  44511. var i = this._targetGroup.nCachedObjects_
  44512. , n = this._bindings[i];
  44513. void 0 !== n && n.getValue(e, t)
  44514. },
  44515. setValue: function(e, t) {
  44516. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  44517. i[n].setValue(e, t)
  44518. },
  44519. bind: function() {
  44520. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44521. e[t].bind()
  44522. },
  44523. unbind: function() {
  44524. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44525. e[t].unbind()
  44526. }
  44527. },
  44528. Ci.PropertyBinding.create = function(e, t, i) {
  44529. return e instanceof Ci.AnimationObjectGroup ? new Ci.PropertyBinding.Composite(e,t,i) : new Ci.PropertyBinding(e,t,i)
  44530. }
  44531. ,
  44532. Ci.PropertyBinding.parseTrackName = function(e) {
  44533. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  44534. , i = t.exec(e);
  44535. if (!i)
  44536. throw new Error("cannot parse trackName at all: " + e);
  44537. i.index === t.lastIndex && t.lastIndex++;
  44538. var n = {
  44539. nodeName: i[3],
  44540. objectName: i[5],
  44541. objectIndex: i[7],
  44542. propertyName: i[9],
  44543. propertyIndex: i[11]
  44544. };
  44545. if (null === n.propertyName || 0 === n.propertyName.length)
  44546. throw new Error("can not parse propertyName from trackName: " + e);
  44547. return n
  44548. }
  44549. ,
  44550. Ci.PropertyBinding.findNode = function(e, r) {
  44551. if (!r || "" === r || "root" === r || "." === r || -1 === r || r === e.name || r === e.uuid)
  44552. return e;
  44553. if (e.skeleton) {
  44554. var t = function(e) {
  44555. for (var t = 0; t < e.bones.length; t++) {
  44556. var i = e.bones[t];
  44557. if (i.name === r)
  44558. return i
  44559. }
  44560. return null
  44561. }(e.skeleton);
  44562. if (t)
  44563. return t
  44564. }
  44565. if (e.children) {
  44566. var o = function(e) {
  44567. for (var t = 0; t < e.length; t++) {
  44568. var i = e[t];
  44569. if (i.name === r || i.uuid === r)
  44570. return i;
  44571. var n = o(i.children);
  44572. if (n)
  44573. return n
  44574. }
  44575. return null
  44576. }
  44577. , i = o(e.children);
  44578. if (i)
  44579. return i
  44580. }
  44581. return null
  44582. }
  44583. ,
  44584. Ci.PropertyMixer = function(e, t, i) {
  44585. this.binding = e,
  44586. this.valueSize = i;
  44587. var n, r = Float64Array;
  44588. switch (t) {
  44589. case "quaternion":
  44590. n = this._slerp;
  44591. break;
  44592. case "string":
  44593. case "bool":
  44594. r = Array,
  44595. n = this._select;
  44596. break;
  44597. default:
  44598. n = this._lerp
  44599. }
  44600. this.buffer = new r(4 * i),
  44601. this._mixBufferRegion = n,
  44602. this.cumulativeWeight = 0,
  44603. this.useCount = 0,
  44604. this.referenceCount = 0
  44605. }
  44606. ,
  44607. Ci.PropertyMixer.prototype = {
  44608. constructor: Ci.PropertyMixer,
  44609. accumulate: function(e, t) {
  44610. var i = this.buffer
  44611. , n = this.valueSize
  44612. , r = e * n + n
  44613. , o = this.cumulativeWeight;
  44614. if (0 === o) {
  44615. for (var a = 0; a !== n; ++a)
  44616. i[r + a] = i[a];
  44617. o = t
  44618. } else {
  44619. var s = t / (o += t);
  44620. this._mixBufferRegion(i, r, 0, s, n)
  44621. }
  44622. this.cumulativeWeight = o
  44623. },
  44624. apply: function(e) {
  44625. var t = this.valueSize
  44626. , i = this.buffer
  44627. , n = e * t + t
  44628. , r = this.cumulativeWeight
  44629. , o = this.binding;
  44630. if (this.cumulativeWeight = 0,
  44631. r < 1) {
  44632. var a = 3 * t;
  44633. this._mixBufferRegion(i, n, a, 1 - r, t)
  44634. }
  44635. for (var s = t, l = t + t; s !== l; ++s)
  44636. if (i[s] !== i[s + t]) {
  44637. o.setValue(i, n);
  44638. break
  44639. }
  44640. },
  44641. saveOriginalState: function() {
  44642. var e = this.binding
  44643. , t = this.buffer
  44644. , i = this.valueSize
  44645. , n = 3 * i;
  44646. e.getValue(t, n);
  44647. for (var r = i, o = n; r !== o; ++r)
  44648. t[r] = t[n + r % i];
  44649. this.cumulativeWeight = 0
  44650. },
  44651. restoreOriginalState: function() {
  44652. var e = 3 * this.valueSize;
  44653. this.binding.setValue(this.buffer, e)
  44654. },
  44655. _select: function(e, t, i, n, r) {
  44656. if (.5 <= n)
  44657. for (var o = 0; o !== r; ++o)
  44658. e[t + o] = e[i + o]
  44659. },
  44660. _slerp: function(e, t, i, n, r) {
  44661. Ci.Quaternion.slerpFlat(e, t, e, t, e, i, n)
  44662. },
  44663. _lerp: function(e, t, i, n, r) {
  44664. for (var o = 1 - n, a = 0; a !== r; ++a) {
  44665. var s = t + a;
  44666. e[s] = e[s] * o + e[i + a] * n
  44667. }
  44668. }
  44669. },
  44670. Ci.BooleanKeyframeTrack = function(e, t, i) {
  44671. Ci.KeyframeTrack.call(this, e, t, i)
  44672. }
  44673. ,
  44674. Ci.BooleanKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44675. constructor: Ci.BooleanKeyframeTrack,
  44676. ValueTypeName: "bool",
  44677. ValueBufferType: Array,
  44678. DefaultInterpolation: Ci.IntepolateDiscrete,
  44679. InterpolantFactoryMethodLinear: void 0,
  44680. InterpolantFactoryMethodSmooth: void 0
  44681. }),
  44682. Ci.NumberKeyframeTrack = function(e, t, i, n) {
  44683. Ci.KeyframeTrack.call(this, e, t, i, n)
  44684. }
  44685. ,
  44686. Ci.NumberKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44687. constructor: Ci.NumberKeyframeTrack,
  44688. ValueTypeName: "number"
  44689. }),
  44690. Ci.QuaternionKeyframeTrack = function(e, t, i, n) {
  44691. Ci.KeyframeTrack.call(this, e, t, i, n)
  44692. }
  44693. ,
  44694. Ci.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44695. constructor: Ci.QuaternionKeyframeTrack,
  44696. ValueTypeName: "quaternion",
  44697. DefaultInterpolation: Ci.InterpolateLinear,
  44698. InterpolantFactoryMethodLinear: function(e) {
  44699. return new Ci.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44700. },
  44701. InterpolantFactoryMethodSmooth: void 0
  44702. }),
  44703. Ci.StringKeyframeTrack = function(e, t, i, n) {
  44704. Ci.KeyframeTrack.call(this, e, t, i, n)
  44705. }
  44706. ,
  44707. Ci.StringKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44708. constructor: Ci.StringKeyframeTrack,
  44709. ValueTypeName: "string",
  44710. ValueBufferType: Array,
  44711. DefaultInterpolation: Ci.IntepolateDiscrete,
  44712. InterpolantFactoryMethodLinear: void 0,
  44713. InterpolantFactoryMethodSmooth: void 0
  44714. }),
  44715. Ci.VectorKeyframeTrack = function(e, t, i, n) {
  44716. Ci.KeyframeTrack.call(this, e, t, i, n)
  44717. }
  44718. ,
  44719. Ci.VectorKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44720. constructor: Ci.VectorKeyframeTrack,
  44721. ValueTypeName: "vector"
  44722. }),
  44723. Ci.Audio = function(e) {
  44724. Ci.Object3D.call(this),
  44725. this.type = "Audio",
  44726. this.context = e.context,
  44727. this.source = this.context.createBufferSource(),
  44728. this.source.onended = this.onEnded.bind(this),
  44729. this.gain = this.context.createGain(),
  44730. this.gain.connect(e.getInput()),
  44731. this.autoplay = !1,
  44732. this.startTime = 0,
  44733. this.playbackRate = 1,
  44734. this.isPlaying = !1,
  44735. this.hasPlaybackControl = !0,
  44736. this.sourceType = "empty",
  44737. this.filter = null
  44738. }
  44739. ,
  44740. Ci.Audio.prototype = Object.create(Ci.Object3D.prototype),
  44741. Ci.Audio.prototype.constructor = Ci.Audio,
  44742. Ci.Audio.prototype.getOutput = function() {
  44743. return this.gain
  44744. }
  44745. ,
  44746. Ci.Audio.prototype.load = function(e) {
  44747. var t = new Ci.AudioBuffer(this.context);
  44748. return t.load(e),
  44749. this.setBuffer(t),
  44750. this
  44751. }
  44752. ,
  44753. Ci.Audio.prototype.setNodeSource = function(e) {
  44754. return this.hasPlaybackControl = !1,
  44755. this.sourceType = "audioNode",
  44756. this.source = e,
  44757. this.connect(),
  44758. this
  44759. }
  44760. ,
  44761. Ci.Audio.prototype.setBuffer = function(e) {
  44762. var t = this;
  44763. return e.onReady(function(e) {
  44764. t.source.buffer = e,
  44765. t.sourceType = "buffer",
  44766. t.autoplay && t.play()
  44767. }),
  44768. this
  44769. }
  44770. ,
  44771. Ci.Audio.prototype.play = function() {
  44772. if (!0 !== this.isPlaying)
  44773. if (!1 !== this.hasPlaybackControl) {
  44774. var e = this.context.createBufferSource();
  44775. e.buffer = this.source.buffer,
  44776. e.loop = this.source.loop,
  44777. e.onended = this.source.onended,
  44778. e.start(0, this.startTime),
  44779. e.playbackRate.value = this.playbackRate,
  44780. this.isPlaying = !0,
  44781. this.source = e,
  44782. this.connect()
  44783. } else
  44784. console.warn("THREE.Audio: this Audio has no playback control.");
  44785. else
  44786. console.warn("THREE.Audio: Audio is already playing.")
  44787. }
  44788. ,
  44789. Ci.Audio.prototype.pause = function() {
  44790. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44791. void (this.startTime = this.context.currentTime))
  44792. }
  44793. ,
  44794. Ci.Audio.prototype.stop = function() {
  44795. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44796. void (this.startTime = 0))
  44797. }
  44798. ,
  44799. Ci.Audio.prototype.connect = function() {
  44800. null !== this.filter ? (this.source.connect(this.filter),
  44801. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  44802. }
  44803. ,
  44804. Ci.Audio.prototype.disconnect = function() {
  44805. null !== this.filter ? (this.source.disconnect(this.filter),
  44806. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  44807. }
  44808. ,
  44809. Ci.Audio.prototype.getFilter = function() {
  44810. return this.filter
  44811. }
  44812. ,
  44813. Ci.Audio.prototype.setFilter = function(e) {
  44814. void 0 === e && (e = null),
  44815. !0 === this.isPlaying ? (this.disconnect(),
  44816. this.filter = e,
  44817. this.connect()) : this.filter = e
  44818. }
  44819. ,
  44820. Ci.Audio.prototype.setPlaybackRate = function(e) {
  44821. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  44822. void (!0 === this.isPlaying && (this.source.playbackRate.value = this.playbackRate)))
  44823. }
  44824. ,
  44825. Ci.Audio.prototype.getPlaybackRate = function() {
  44826. return this.playbackRate
  44827. }
  44828. ,
  44829. Ci.Audio.prototype.onEnded = function() {
  44830. this.isPlaying = !1
  44831. }
  44832. ,
  44833. Ci.Audio.prototype.setLoop = function(e) {
  44834. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  44835. }
  44836. ,
  44837. Ci.Audio.prototype.getLoop = function() {
  44838. return !1 === this.hasPlaybackControl ? (console.warn("THREE.Audio: this Audio has no playback control."),
  44839. !1) : this.source.loop
  44840. }
  44841. ,
  44842. Ci.Audio.prototype.setVolume = function(e) {
  44843. this.gain.gain.value = e
  44844. }
  44845. ,
  44846. Ci.Audio.prototype.getVolume = function() {
  44847. return this.gain.gain.value
  44848. }
  44849. ,
  44850. Ci.AudioAnalyser = function(e, t) {
  44851. this.analyser = e.context.createAnalyser(),
  44852. this.analyser.fftSize = void 0 !== t ? t : 2048,
  44853. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  44854. e.getOutput().connect(this.analyser)
  44855. }
  44856. ,
  44857. Ci.AudioAnalyser.prototype = {
  44858. constructor: Ci.AudioAnalyser,
  44859. getData: function() {
  44860. return this.analyser.getByteFrequencyData(this.data),
  44861. this.data
  44862. }
  44863. },
  44864. Ci.AudioBuffer = function(e) {
  44865. this.context = e,
  44866. this.ready = !1,
  44867. this.readyCallbacks = []
  44868. }
  44869. ,
  44870. Ci.AudioBuffer.prototype.load = function(e) {
  44871. var i = this
  44872. , t = new XMLHttpRequest;
  44873. return t.open("GET", e, !0),
  44874. t.responseType = "arraybuffer",
  44875. t.onload = function(e) {
  44876. i.context.decodeAudioData(this.response, function(e) {
  44877. i.buffer = e,
  44878. i.ready = !0;
  44879. for (var t = 0; t < i.readyCallbacks.length; t++)
  44880. i.readyCallbacks[t](i.buffer);
  44881. i.readyCallbacks = []
  44882. })
  44883. }
  44884. ,
  44885. t.send(),
  44886. this
  44887. }
  44888. ,
  44889. Ci.AudioBuffer.prototype.onReady = function(e) {
  44890. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  44891. }
  44892. ,
  44893. Ci.PositionalAudio = function(e) {
  44894. Ci.Audio.call(this, e),
  44895. this.panner = this.context.createPanner(),
  44896. this.panner.connect(this.gain)
  44897. }
  44898. ,
  44899. Ci.PositionalAudio.prototype = Object.create(Ci.Audio.prototype),
  44900. Ci.PositionalAudio.prototype.constructor = Ci.PositionalAudio,
  44901. Ci.PositionalAudio.prototype.getOutput = function() {
  44902. return this.panner
  44903. }
  44904. ,
  44905. Ci.PositionalAudio.prototype.setRefDistance = function(e) {
  44906. this.panner.refDistance = e
  44907. }
  44908. ,
  44909. Ci.PositionalAudio.prototype.getRefDistance = function() {
  44910. return this.panner.refDistance
  44911. }
  44912. ,
  44913. Ci.PositionalAudio.prototype.setRolloffFactor = function(e) {
  44914. this.panner.rolloffFactor = e
  44915. }
  44916. ,
  44917. Ci.PositionalAudio.prototype.getRolloffFactor = function() {
  44918. return this.panner.rolloffFactor
  44919. }
  44920. ,
  44921. Ci.PositionalAudio.prototype.setDistanceModel = function(e) {
  44922. this.panner.distanceModel = e
  44923. }
  44924. ,
  44925. Ci.PositionalAudio.prototype.getDistanceModel = function() {
  44926. return this.panner.distanceModel
  44927. }
  44928. ,
  44929. Ci.PositionalAudio.prototype.setMaxDistance = function(e) {
  44930. this.panner.maxDistance = e
  44931. }
  44932. ,
  44933. Ci.PositionalAudio.prototype.getMaxDistance = function() {
  44934. return this.panner.maxDistance
  44935. }
  44936. ,
  44937. Ci.PositionalAudio.prototype.updateMatrixWorld = (it = new Ci.Vector3,
  44938. function(e) {
  44939. Ci.Object3D.prototype.updateMatrixWorld.call(this, e),
  44940. it.setFromMatrixPosition(this.matrixWorld),
  44941. this.panner.setPosition(it.x, it.y, it.z)
  44942. }
  44943. ),
  44944. Ci.AudioListener = function() {
  44945. Ci.Object3D.call(this),
  44946. this.type = "AudioListener",
  44947. this.context = new (window.AudioContext || window.webkitAudioContext),
  44948. this.gain = this.context.createGain(),
  44949. this.gain.connect(this.context.destination),
  44950. this.filter = null
  44951. }
  44952. ,
  44953. Ci.AudioListener.prototype = Object.create(Ci.Object3D.prototype),
  44954. Ci.AudioListener.prototype.constructor = Ci.AudioListener,
  44955. Ci.AudioListener.prototype.getInput = function() {
  44956. return this.gain
  44957. }
  44958. ,
  44959. Ci.AudioListener.prototype.removeFilter = function() {
  44960. null !== this.filter && (this.gain.disconnect(this.filter),
  44961. this.filter.disconnect(this.context.destination),
  44962. this.gain.connect(this.context.destination),
  44963. this.filter = null)
  44964. }
  44965. ,
  44966. Ci.AudioListener.prototype.setFilter = function(e) {
  44967. null !== this.filter ? (this.gain.disconnect(this.filter),
  44968. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  44969. this.filter = e,
  44970. this.gain.connect(this.filter),
  44971. this.filter.connect(this.context.destination)
  44972. }
  44973. ,
  44974. Ci.AudioListener.prototype.getFilter = function() {
  44975. return this.filter
  44976. }
  44977. ,
  44978. Ci.AudioListener.prototype.setMasterVolume = function(e) {
  44979. this.gain.gain.value = e
  44980. }
  44981. ,
  44982. Ci.AudioListener.prototype.getMasterVolume = function() {
  44983. return this.gain.gain.value
  44984. }
  44985. ,
  44986. Ci.AudioListener.prototype.updateMatrixWorld = (Je = new Ci.Vector3,
  44987. $e = new Ci.Quaternion,
  44988. et = new Ci.Vector3,
  44989. tt = new Ci.Vector3,
  44990. function(e) {
  44991. Ci.Object3D.prototype.updateMatrixWorld.call(this, e);
  44992. var t = this.context.listener
  44993. , i = this.up;
  44994. this.matrixWorld.decompose(Je, $e, et),
  44995. tt.set(0, 0, -1).applyQuaternion($e),
  44996. t.setPosition(Je.x, Je.y, Je.z),
  44997. t.setOrientation(tt.x, tt.y, tt.z, i.x, i.y, i.z)
  44998. }
  44999. ),
  45000. Ci.Camera = function() {
  45001. Ci.Object3D.call(this),
  45002. this.type = "Camera",
  45003. this.matrixWorldInverse = new Ci.Matrix4,
  45004. this.projectionMatrix = new Ci.Matrix4
  45005. }
  45006. ,
  45007. Ci.Camera.prototype = Object.create(Ci.Object3D.prototype),
  45008. Ci.Camera.prototype.constructor = Ci.Camera,
  45009. Ci.Camera.prototype.getWorldDirection = (Qe = new Ci.Quaternion,
  45010. function(e) {
  45011. var t = e || new Ci.Vector3;
  45012. return this.getWorldQuaternion(Qe),
  45013. t.set(0, 0, -1).applyQuaternion(Qe)
  45014. }
  45015. ),
  45016. Ci.Camera.prototype.lookAt = (Ke = new Ci.Matrix4,
  45017. function(e) {
  45018. Ke.lookAt(this.position, e, this.up),
  45019. this.quaternion.setFromRotationMatrix(Ke)
  45020. }
  45021. ),
  45022. Ci.Camera.prototype.clone = function() {
  45023. return (new this.constructor).copy(this)
  45024. }
  45025. ,
  45026. Ci.Camera.prototype.copy = function(e) {
  45027. return Ci.Object3D.prototype.copy.call(this, e),
  45028. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  45029. this.projectionMatrix.copy(e.projectionMatrix),
  45030. this
  45031. }
  45032. ,
  45033. Ci.CubeCamera = function(e, t, i) {
  45034. Ci.Object3D.call(this),
  45035. this.type = "CubeCamera";
  45036. var r = new Ci.PerspectiveCamera(90,1,e,t);
  45037. r.up.set(0, -1, 0),
  45038. r.lookAt(new Ci.Vector3(1,0,0)),
  45039. this.add(r);
  45040. var o = new Ci.PerspectiveCamera(90,1,e,t);
  45041. o.up.set(0, -1, 0),
  45042. o.lookAt(new Ci.Vector3(-1,0,0)),
  45043. this.add(o);
  45044. var a = new Ci.PerspectiveCamera(90,1,e,t);
  45045. a.up.set(0, 0, 1),
  45046. a.lookAt(new Ci.Vector3(0,1,0)),
  45047. this.add(a);
  45048. var s = new Ci.PerspectiveCamera(90,1,e,t);
  45049. s.up.set(0, 0, -1),
  45050. s.lookAt(new Ci.Vector3(0,-1,0)),
  45051. this.add(s);
  45052. var l = new Ci.PerspectiveCamera(90,1,e,t);
  45053. l.up.set(0, -1, 0),
  45054. l.lookAt(new Ci.Vector3(0,0,1)),
  45055. this.add(l);
  45056. var c = new Ci.PerspectiveCamera(90,1,e,t);
  45057. c.up.set(0, -1, 0),
  45058. c.lookAt(new Ci.Vector3(0,0,-1)),
  45059. this.add(c);
  45060. var n = {
  45061. format: Ci.RGBFormat,
  45062. magFilter: Ci.LinearFilter,
  45063. minFilter: Ci.LinearFilter
  45064. };
  45065. this.renderTarget = new Ci.WebGLRenderTargetCube(i,i,n),
  45066. this.updateCubeMap = function(e, t) {
  45067. null === this.parent && this.updateMatrixWorld();
  45068. var i = this.renderTarget
  45069. , n = i.texture.generateMipmaps;
  45070. i.texture.generateMipmaps = !1,
  45071. i.activeCubeFace = 0,
  45072. e.render(t, r, i),
  45073. i.activeCubeFace = 1,
  45074. e.render(t, o, i),
  45075. i.activeCubeFace = 2,
  45076. e.render(t, a, i),
  45077. i.activeCubeFace = 3,
  45078. e.render(t, s, i),
  45079. i.activeCubeFace = 4,
  45080. e.render(t, l, i),
  45081. i.texture.generateMipmaps = n,
  45082. i.activeCubeFace = 5,
  45083. e.render(t, c, i),
  45084. e.setRenderTarget(null)
  45085. }
  45086. }
  45087. ,
  45088. Ci.CubeCamera.prototype = Object.create(Ci.Object3D.prototype),
  45089. Ci.CubeCamera.prototype.constructor = Ci.CubeCamera,
  45090. Ci.OrthographicCamera = function(e, t, i, n, r, o) {
  45091. Ci.Camera.call(this),
  45092. this.type = "OrthographicCamera",
  45093. this.zoom = 1,
  45094. this.left = e,
  45095. this.right = t,
  45096. this.top = i,
  45097. this.bottom = n,
  45098. this.near = void 0 !== r ? r : .1,
  45099. this.far = void 0 !== o ? o : 2e3,
  45100. this.updateProjectionMatrix()
  45101. }
  45102. ,
  45103. Ci.OrthographicCamera.prototype = Object.create(Ci.Camera.prototype),
  45104. Ci.OrthographicCamera.prototype.constructor = Ci.OrthographicCamera,
  45105. Ci.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  45106. var e = (this.right - this.left) / (2 * this.zoom)
  45107. , t = (this.top - this.bottom) / (2 * this.zoom)
  45108. , i = (this.right + this.left) / 2
  45109. , n = (this.top + this.bottom) / 2;
  45110. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  45111. }
  45112. ,
  45113. Ci.OrthographicCamera.prototype.copy = function(e) {
  45114. return Ci.Camera.prototype.copy.call(this, e),
  45115. this.left = e.left,
  45116. this.right = e.right,
  45117. this.top = e.top,
  45118. this.bottom = e.bottom,
  45119. this.near = e.near,
  45120. this.far = e.far,
  45121. this.zoom = e.zoom,
  45122. this
  45123. }
  45124. ,
  45125. Ci.OrthographicCamera.prototype.toJSON = function(e) {
  45126. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  45127. return t.object.zoom = this.zoom,
  45128. t.object.left = this.left,
  45129. t.object.right = this.right,
  45130. t.object.top = this.top,
  45131. t.object.bottom = this.bottom,
  45132. t.object.near = this.near,
  45133. t.object.far = this.far,
  45134. t
  45135. }
  45136. ,
  45137. Ci.PerspectiveCamera = function(e, t, i, n) {
  45138. Ci.Camera.call(this),
  45139. this.type = "PerspectiveCamera",
  45140. this.focalLength = 10,
  45141. this.zoom = 1,
  45142. this.fov = void 0 !== e ? e : 50,
  45143. this.aspect = void 0 !== t ? t : 1,
  45144. this.near = void 0 !== i ? i : .1,
  45145. this.far = void 0 !== n ? n : 2e3,
  45146. this.updateProjectionMatrix()
  45147. }
  45148. ,
  45149. Ci.PerspectiveCamera.prototype = Object.create(Ci.Camera.prototype),
  45150. Ci.PerspectiveCamera.prototype.constructor = Ci.PerspectiveCamera,
  45151. Ci.PerspectiveCamera.prototype.setLens = function(e, t) {
  45152. void 0 === t && (t = 24),
  45153. this.fov = 2 * Ci.Math.radToDeg(Math.atan(t / (2 * e))),
  45154. this.updateProjectionMatrix()
  45155. }
  45156. ,
  45157. Ci.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  45158. this.fullWidth = e,
  45159. this.fullHeight = t,
  45160. this.x = i,
  45161. this.y = n,
  45162. this.width = r,
  45163. this.height = o,
  45164. this.updateProjectionMatrix()
  45165. }
  45166. ,
  45167. Ci.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  45168. var e = Ci.Math.radToDeg(2 * Math.atan(Math.tan(.5 * Ci.Math.degToRad(this.fov)) / this.zoom));
  45169. if (this.fullWidth) {
  45170. var t = this.fullWidth / this.fullHeight
  45171. , i = Math.tan(Ci.Math.degToRad(.5 * e)) * this.near
  45172. , n = -i
  45173. , r = t * n
  45174. , o = t * i
  45175. , a = Math.abs(o - r)
  45176. , s = Math.abs(i - n);
  45177. this.projectionMatrix.makeFrustum(r + this.x * a / this.fullWidth, r + (this.x + this.width) * a / this.fullWidth, i - (this.y + this.height) * s / this.fullHeight, i - this.y * s / this.fullHeight, this.near, this.far)
  45178. } else
  45179. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  45180. }
  45181. ,
  45182. Ci.PerspectiveCamera.prototype.copy = function(e) {
  45183. return Ci.Camera.prototype.copy.call(this, e),
  45184. this.focalLength = e.focalLength,
  45185. this.zoom = e.zoom,
  45186. this.fov = e.fov,
  45187. this.aspect = e.aspect,
  45188. this.near = e.near,
  45189. this.far = e.far,
  45190. this
  45191. }
  45192. ,
  45193. Ci.PerspectiveCamera.prototype.toJSON = function(e) {
  45194. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  45195. return t.object.focalLength = this.focalLength,
  45196. t.object.zoom = this.zoom,
  45197. t.object.fov = this.fov,
  45198. t.object.aspect = this.aspect,
  45199. t.object.near = this.near,
  45200. t.object.far = this.far,
  45201. t
  45202. }
  45203. ,
  45204. Ci.StereoCamera = function() {
  45205. this.type = "StereoCamera",
  45206. this.aspect = 1,
  45207. this.cameraL = new Ci.PerspectiveCamera,
  45208. this.cameraL.layers.enable(1),
  45209. this.cameraL.matrixAutoUpdate = !1,
  45210. this.cameraR = new Ci.PerspectiveCamera,
  45211. this.cameraR.layers.enable(2),
  45212. this.cameraR.matrixAutoUpdate = !1
  45213. }
  45214. ,
  45215. Ci.StereoCamera.prototype = {
  45216. constructor: Ci.StereoCamera,
  45217. update: (Xe = new Ci.Matrix4,
  45218. Ze = new Ci.Matrix4,
  45219. function(e) {
  45220. if (Ge !== e.focalLength || We !== e.fov || je !== e.aspect * this.aspect || Ye !== e.near || qe !== e.far) {
  45221. Ge = e.focalLength,
  45222. We = e.fov,
  45223. je = e.aspect * this.aspect,
  45224. Ye = e.near,
  45225. qe = e.far;
  45226. var t, i, n = e.projectionMatrix.clone(), r = .032 * Ye / Ge, o = Ye * Math.tan(Ci.Math.degToRad(.5 * We));
  45227. Ze.elements[12] = -.032,
  45228. Xe.elements[12] = .032,
  45229. t = -o * je + r,
  45230. i = o * je + r,
  45231. n.elements[0] = 2 * Ye / (i - t),
  45232. n.elements[8] = (i + t) / (i - t),
  45233. this.cameraL.projectionMatrix.copy(n),
  45234. t = -o * je - r,
  45235. i = o * je - r,
  45236. n.elements[0] = 2 * Ye / (i - t),
  45237. n.elements[8] = (i + t) / (i - t),
  45238. this.cameraR.projectionMatrix.copy(n)
  45239. }
  45240. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ze),
  45241. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Xe)
  45242. }
  45243. )
  45244. },
  45245. Ci.Light = function(e, t) {
  45246. Ci.Object3D.call(this),
  45247. this.type = "Light",
  45248. this.color = new Ci.Color(e),
  45249. this.intensity = void 0 !== t ? t : 1,
  45250. this.receiveShadow = void 0
  45251. }
  45252. ,
  45253. Ci.Light.prototype = Object.create(Ci.Object3D.prototype),
  45254. Ci.Light.prototype.constructor = Ci.Light,
  45255. Ci.Light.prototype.copy = function(e) {
  45256. return Ci.Object3D.prototype.copy.call(this, e),
  45257. this.color.copy(e.color),
  45258. this.intensity = e.intensity,
  45259. this
  45260. }
  45261. ,
  45262. Ci.Light.prototype.toJSON = function(e) {
  45263. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  45264. return t.object.color = this.color.getHex(),
  45265. t.object.intensity = this.intensity,
  45266. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  45267. void 0 !== this.distance && (t.object.distance = this.distance),
  45268. void 0 !== this.angle && (t.object.angle = this.angle),
  45269. void 0 !== this.decay && (t.object.decay = this.decay),
  45270. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  45271. t
  45272. }
  45273. ,
  45274. Ci.LightShadow = function(e) {
  45275. this.camera = e,
  45276. this.bias = 0,
  45277. this.radius = 1,
  45278. this.mapSize = new Ci.Vector2(512,512),
  45279. this.map = null,
  45280. this.matrix = new Ci.Matrix4
  45281. }
  45282. ,
  45283. Ci.LightShadow.prototype = {
  45284. constructor: Ci.LightShadow,
  45285. copy: function(e) {
  45286. return this.camera = e.camera.clone(),
  45287. this.bias = e.bias,
  45288. this.radius = e.radius,
  45289. this.mapSize.copy(e.mapSize),
  45290. this
  45291. },
  45292. clone: function() {
  45293. return (new this.constructor).copy(this)
  45294. }
  45295. },
  45296. Ci.AmbientLight = function(e, t) {
  45297. Ci.Light.call(this, e, t),
  45298. this.type = "AmbientLight",
  45299. this.castShadow = void 0
  45300. }
  45301. ,
  45302. Ci.AmbientLight.prototype = Object.create(Ci.Light.prototype),
  45303. Ci.AmbientLight.prototype.constructor = Ci.AmbientLight,
  45304. Ci.DirectionalLight = function(e, t) {
  45305. Ci.Light.call(this, e, t),
  45306. this.type = "DirectionalLight",
  45307. this.position.set(0, 1, 0),
  45308. this.updateMatrix(),
  45309. this.target = new Ci.Object3D,
  45310. this.shadow = new Ci.LightShadow(new Ci.OrthographicCamera(-5,5,5,-5,.5,500))
  45311. }
  45312. ,
  45313. Ci.DirectionalLight.prototype = Object.create(Ci.Light.prototype),
  45314. Ci.DirectionalLight.prototype.constructor = Ci.DirectionalLight,
  45315. Ci.DirectionalLight.prototype.copy = function(e) {
  45316. return Ci.Light.prototype.copy.call(this, e),
  45317. this.target = e.target.clone(),
  45318. this.shadow = e.shadow.clone(),
  45319. this
  45320. }
  45321. ,
  45322. Ci.HemisphereLight = function(e, t, i) {
  45323. Ci.Light.call(this, e, i),
  45324. this.type = "HemisphereLight",
  45325. this.castShadow = void 0,
  45326. this.position.set(0, 1, 0),
  45327. this.updateMatrix(),
  45328. this.groundColor = new Ci.Color(t)
  45329. }
  45330. ,
  45331. Ci.HemisphereLight.prototype = Object.create(Ci.Light.prototype),
  45332. Ci.HemisphereLight.prototype.constructor = Ci.HemisphereLight,
  45333. Ci.HemisphereLight.prototype.copy = function(e) {
  45334. return Ci.Light.prototype.copy.call(this, e),
  45335. this.groundColor.copy(e.groundColor),
  45336. this
  45337. }
  45338. ,
  45339. Ci.PointLight = function(e, t, i, n) {
  45340. Ci.Light.call(this, e, t),
  45341. this.type = "PointLight",
  45342. this.distance = void 0 !== i ? i : 0,
  45343. this.decay = void 0 !== n ? n : 1,
  45344. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(90,1,.5,500))
  45345. }
  45346. ,
  45347. Ci.PointLight.prototype = Object.create(Ci.Light.prototype),
  45348. Ci.PointLight.prototype.constructor = Ci.PointLight,
  45349. Object.defineProperty(Ci.PointLight.prototype, "power", {
  45350. get: function() {
  45351. return 4 * this.intensity * Math.PI
  45352. },
  45353. set: function(e) {
  45354. this.intensity = e / (4 * Math.PI)
  45355. }
  45356. }),
  45357. Ci.PointLight.prototype.copy = function(e) {
  45358. return Ci.Light.prototype.copy.call(this, e),
  45359. this.distance = e.distance,
  45360. this.decay = e.decay,
  45361. this.shadow = e.shadow.clone(),
  45362. this
  45363. }
  45364. ,
  45365. Ci.SpotLight = function(e, t, i, n, r, o) {
  45366. Ci.Light.call(this, e, t),
  45367. this.type = "SpotLight",
  45368. this.position.set(0, 1, 0),
  45369. this.updateMatrix(),
  45370. this.target = new Ci.Object3D,
  45371. this.distance = void 0 !== i ? i : 0,
  45372. this.angle = void 0 !== n ? n : Math.PI / 3,
  45373. this.penumbra = void 0 !== r ? r : 0,
  45374. this.decay = void 0 !== o ? o : 1,
  45375. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(50,1,.5,500))
  45376. }
  45377. ,
  45378. Ci.SpotLight.prototype = Object.create(Ci.Light.prototype),
  45379. Ci.SpotLight.prototype.constructor = Ci.SpotLight,
  45380. Object.defineProperty(Ci.SpotLight.prototype, "power", {
  45381. get: function() {
  45382. return this.intensity * Math.PI
  45383. },
  45384. set: function(e) {
  45385. this.intensity = e / Math.PI
  45386. }
  45387. }),
  45388. Ci.SpotLight.prototype.copy = function(e) {
  45389. return Ci.Light.prototype.copy.call(this, e),
  45390. this.distance = e.distance,
  45391. this.angle = e.angle,
  45392. this.penumbra = e.penumbra,
  45393. this.decay = e.decay,
  45394. this.target = e.target.clone(),
  45395. this.shadow = e.shadow.clone(),
  45396. this
  45397. }
  45398. ,
  45399. Ci.Cache = {
  45400. enabled: !1,
  45401. files: {},
  45402. add: function(e, t) {
  45403. !1 !== this.enabled && (this.files[e] = t)
  45404. },
  45405. get: function(e) {
  45406. if (!1 !== this.enabled)
  45407. return this.files[e]
  45408. },
  45409. remove: function(e) {
  45410. delete this.files[e]
  45411. },
  45412. clear: function() {
  45413. this.files = {}
  45414. }
  45415. },
  45416. Ci.Loader = function() {
  45417. this.onLoadStart = function() {}
  45418. ,
  45419. this.onLoadProgress = function() {}
  45420. ,
  45421. this.onLoadComplete = function() {}
  45422. }
  45423. ,
  45424. Ci.Loader.prototype = {
  45425. constructor: Ci.Loader,
  45426. crossOrigin: void 0,
  45427. extractUrlBase: function(e) {
  45428. var t = e.split("/");
  45429. return 1 === t.length ? "./" : (t.pop(),
  45430. t.join("/") + "/")
  45431. },
  45432. initMaterials: function(e, t, i) {
  45433. for (var n = [], r = 0; r < e.length; ++r)
  45434. n[r] = this.createMaterial(e[r], t, i);
  45435. return n
  45436. },
  45437. createMaterial: function(e, c, h) {
  45438. function t(e, t, i, n, r) {
  45439. var o, a = c + e, s = Ci.Loader.Handlers.get(a);
  45440. o = null !== s ? s.load(a) : (He.setCrossOrigin(h),
  45441. He.load(a)),
  45442. void 0 !== t && (o.repeat.fromArray(t),
  45443. 1 !== t[0] && (o.wrapS = Ci.RepeatWrapping),
  45444. 1 !== t[1] && (o.wrapT = Ci.RepeatWrapping)),
  45445. void 0 !== i && o.offset.fromArray(i),
  45446. void 0 !== n && ("repeat" === n[0] && (o.wrapS = Ci.RepeatWrapping),
  45447. "mirror" === n[0] && (o.wrapS = Ci.MirroredRepeatWrapping),
  45448. "repeat" === n[1] && (o.wrapT = Ci.RepeatWrapping),
  45449. "mirror" === n[1] && (o.wrapT = Ci.MirroredRepeatWrapping)),
  45450. void 0 !== r && (o.anisotropy = r);
  45451. var l = Ci.Math.generateUUID();
  45452. return u[l] = o,
  45453. l
  45454. }
  45455. void 0 === Ue && (Ue = new Ci.Color),
  45456. void 0 === He && (He = new Ci.TextureLoader),
  45457. void 0 === ze && (ze = new Ci.MaterialLoader);
  45458. var u = {}
  45459. , i = {
  45460. uuid: Ci.Math.generateUUID(),
  45461. type: "MeshLambertMaterial"
  45462. };
  45463. for (var n in e) {
  45464. var r = e[n];
  45465. switch (n) {
  45466. case "DbgColor":
  45467. case "DbgIndex":
  45468. case "opticalDensity":
  45469. case "illumination":
  45470. break;
  45471. case "DbgName":
  45472. i.name = r;
  45473. break;
  45474. case "blending":
  45475. i.blending = Ci[r];
  45476. break;
  45477. case "colorAmbient":
  45478. case "mapAmbient":
  45479. console.warn("THREE.Loader.createMaterial:", n, "is no longer supported.");
  45480. break;
  45481. case "colorDiffuse":
  45482. i.color = Ue.fromArray(r).getHex();
  45483. break;
  45484. case "colorSpecular":
  45485. i.specular = Ue.fromArray(r).getHex();
  45486. break;
  45487. case "colorEmissive":
  45488. i.emissive = Ue.fromArray(r).getHex();
  45489. break;
  45490. case "specularCoef":
  45491. i.shininess = r;
  45492. break;
  45493. case "shading":
  45494. "basic" === r.toLowerCase() && (i.type = "MeshBasicMaterial"),
  45495. "phong" === r.toLowerCase() && (i.type = "MeshPhongMaterial");
  45496. break;
  45497. case "mapDiffuse":
  45498. i.map = t(r, e.mapDiffuseRepeat, e.mapDiffuseOffset, e.mapDiffuseWrap, e.mapDiffuseAnisotropy);
  45499. break;
  45500. case "mapDiffuseRepeat":
  45501. case "mapDiffuseOffset":
  45502. case "mapDiffuseWrap":
  45503. case "mapDiffuseAnisotropy":
  45504. break;
  45505. case "mapLight":
  45506. i.lightMap = t(r, e.mapLightRepeat, e.mapLightOffset, e.mapLightWrap, e.mapLightAnisotropy);
  45507. break;
  45508. case "mapLightRepeat":
  45509. case "mapLightOffset":
  45510. case "mapLightWrap":
  45511. case "mapLightAnisotropy":
  45512. break;
  45513. case "mapAO":
  45514. i.aoMap = t(r, e.mapAORepeat, e.mapAOOffset, e.mapAOWrap, e.mapAOAnisotropy);
  45515. break;
  45516. case "mapAORepeat":
  45517. case "mapAOOffset":
  45518. case "mapAOWrap":
  45519. case "mapAOAnisotropy":
  45520. break;
  45521. case "mapBump":
  45522. i.bumpMap = t(r, e.mapBumpRepeat, e.mapBumpOffset, e.mapBumpWrap, e.mapBumpAnisotropy);
  45523. break;
  45524. case "mapBumpScale":
  45525. i.bumpScale = r;
  45526. break;
  45527. case "mapBumpRepeat":
  45528. case "mapBumpOffset":
  45529. case "mapBumpWrap":
  45530. case "mapBumpAnisotropy":
  45531. break;
  45532. case "mapNormal":
  45533. i.normalMap = t(r, e.mapNormalRepeat, e.mapNormalOffset, e.mapNormalWrap, e.mapNormalAnisotropy);
  45534. break;
  45535. case "mapNormalFactor":
  45536. i.normalScale = [r, r];
  45537. break;
  45538. case "mapNormalRepeat":
  45539. case "mapNormalOffset":
  45540. case "mapNormalWrap":
  45541. case "mapNormalAnisotropy":
  45542. break;
  45543. case "mapSpecular":
  45544. i.specularMap = t(r, e.mapSpecularRepeat, e.mapSpecularOffset, e.mapSpecularWrap, e.mapSpecularAnisotropy);
  45545. break;
  45546. case "mapSpecularRepeat":
  45547. case "mapSpecularOffset":
  45548. case "mapSpecularWrap":
  45549. case "mapSpecularAnisotropy":
  45550. break;
  45551. case "mapAlpha":
  45552. i.alphaMap = t(r, e.mapAlphaRepeat, e.mapAlphaOffset, e.mapAlphaWrap, e.mapAlphaAnisotropy);
  45553. break;
  45554. case "mapAlphaRepeat":
  45555. case "mapAlphaOffset":
  45556. case "mapAlphaWrap":
  45557. case "mapAlphaAnisotropy":
  45558. break;
  45559. case "flipSided":
  45560. i.side = Ci.BackSide;
  45561. break;
  45562. case "doubleSided":
  45563. i.side = Ci.DoubleSide;
  45564. break;
  45565. case "transparency":
  45566. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  45567. i.opacity = r;
  45568. break;
  45569. case "depthTest":
  45570. case "depthWrite":
  45571. case "colorWrite":
  45572. case "opacity":
  45573. case "reflectivity":
  45574. case "transparent":
  45575. case "visible":
  45576. case "wireframe":
  45577. i[n] = r;
  45578. break;
  45579. case "vertexColors":
  45580. !0 === r && (i.vertexColors = Ci.VertexColors),
  45581. "face" === r && (i.vertexColors = Ci.FaceColors);
  45582. break;
  45583. default:
  45584. console.error("THREE.Loader.createMaterial: Unsupported", n, r)
  45585. }
  45586. }
  45587. return "MeshBasicMaterial" === i.type && delete i.emissive,
  45588. "MeshPhongMaterial" !== i.type && delete i.specular,
  45589. i.opacity < 1 && (i.transparent = !0),
  45590. ze.setTextures(u),
  45591. ze.parse(i)
  45592. }
  45593. },
  45594. Ci.Loader.Handlers = {
  45595. handlers: [],
  45596. add: function(e, t) {
  45597. this.handlers.push(e, t)
  45598. },
  45599. get: function(e) {
  45600. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  45601. var r = t[i]
  45602. , o = t[i + 1];
  45603. if (r.test(e))
  45604. return o
  45605. }
  45606. return null
  45607. }
  45608. },
  45609. Ci.XHRLoader = function(e) {
  45610. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45611. }
  45612. ,
  45613. Ci.XHRLoader.prototype = {
  45614. constructor: Ci.XHRLoader,
  45615. load: function(i, n, t, r) {
  45616. void 0 !== this.path && (i = this.path + i);
  45617. var o = this
  45618. , e = Ci.Cache.get(i);
  45619. if (void 0 !== e)
  45620. return n && setTimeout(function() {
  45621. n(e)
  45622. }, 0),
  45623. e;
  45624. var a = new XMLHttpRequest;
  45625. return a.overrideMimeType("text/plain"),
  45626. a.open("GET", i, !0),
  45627. a.addEventListener("load", function(e) {
  45628. var t = e.target.response;
  45629. Ci.Cache.add(i, t),
  45630. 200 === this.status ? (n && n(t),
  45631. o.manager.itemEnd(i)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  45632. n && n(t),
  45633. o.manager.itemEnd(i)) : (r && r(e),
  45634. o.manager.itemError(i))
  45635. }, !1),
  45636. void 0 !== t && a.addEventListener("progress", function(e) {
  45637. t(e)
  45638. }, !1),
  45639. a.addEventListener("error", function(e) {
  45640. r && r(e),
  45641. o.manager.itemError(i)
  45642. }, !1),
  45643. void 0 !== this.responseType && (a.responseType = this.responseType),
  45644. void 0 !== this.withCredentials && (a.withCredentials = this.withCredentials),
  45645. a.send(null),
  45646. o.manager.itemStart(i),
  45647. a
  45648. },
  45649. setPath: function(e) {
  45650. this.path = e
  45651. },
  45652. setResponseType: function(e) {
  45653. this.responseType = e
  45654. },
  45655. setWithCredentials: function(e) {
  45656. this.withCredentials = e
  45657. }
  45658. },
  45659. Ci.FontLoader = function(e) {
  45660. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45661. }
  45662. ,
  45663. Ci.FontLoader.prototype = {
  45664. constructor: Ci.FontLoader,
  45665. load: function(e, t, i, n) {
  45666. new Ci.XHRLoader(this.manager).load(e, function(e) {
  45667. t(new Ci.Font(JSON.parse(e.substring(65, e.length - 2))))
  45668. }, i, n)
  45669. }
  45670. },
  45671. Ci.ImageLoader = function(e) {
  45672. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45673. }
  45674. ,
  45675. Ci.ImageLoader.prototype = {
  45676. constructor: Ci.ImageLoader,
  45677. load: function(t, i, n, r) {
  45678. void 0 !== this.path && (t = this.path + t);
  45679. var o = this
  45680. , e = Ci.Cache.get(t);
  45681. if (void 0 !== e)
  45682. return o.manager.itemStart(t),
  45683. i ? setTimeout(function() {
  45684. i(e),
  45685. o.manager.itemEnd(t)
  45686. }, 0) : o.manager.itemEnd(t),
  45687. e;
  45688. var a = document.createElement("img");
  45689. return a.addEventListener("load", function(e) {
  45690. Ci.Cache.add(t, this),
  45691. i && i(this),
  45692. o.manager.itemEnd(t)
  45693. }, !1),
  45694. void 0 !== n && a.addEventListener("progress", function(e) {
  45695. n(e)
  45696. }, !1),
  45697. a.addEventListener("error", function(e) {
  45698. r && r(e),
  45699. o.manager.itemError(t)
  45700. }, !1),
  45701. void 0 !== this.crossOrigin && (a.crossOrigin = this.crossOrigin),
  45702. o.manager.itemStart(t),
  45703. a.src = t,
  45704. a
  45705. },
  45706. setCrossOrigin: function(e) {
  45707. this.crossOrigin = e
  45708. },
  45709. setPath: function(e) {
  45710. this.path = e
  45711. }
  45712. },
  45713. Ci.JSONLoader = function(e) {
  45714. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  45715. e = void 0),
  45716. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45717. this.withCredentials = !1
  45718. }
  45719. ,
  45720. Ci.JSONLoader.prototype = {
  45721. constructor: Ci.JSONLoader,
  45722. get statusDomElement() {
  45723. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  45724. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  45725. this._statusDomElement
  45726. },
  45727. load: function(o, a, e, t) {
  45728. var s = this
  45729. , l = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : Ci.Loader.prototype.extractUrlBase(o)
  45730. , i = new Ci.XHRLoader(this.manager);
  45731. i.setWithCredentials(this.withCredentials),
  45732. i.load(o, function(e) {
  45733. var t = JSON.parse(e)
  45734. , i = t.metadata;
  45735. if (void 0 !== i) {
  45736. var n = i.type;
  45737. if (void 0 !== n) {
  45738. if ("object" === n.toLowerCase())
  45739. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.ObjectLoader instead.");
  45740. if ("scene" === n.toLowerCase())
  45741. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.SceneLoader instead.")
  45742. }
  45743. }
  45744. var r = s.parse(t, l);
  45745. a(r.geometry, r.materials)
  45746. }, e, t)
  45747. },
  45748. setTexturePath: function(e) {
  45749. this.texturePath = e
  45750. },
  45751. parse: function(D, e) {
  45752. var N = new Ci.Geometry
  45753. , t = void 0 !== D.scale ? 1 / D.scale : 1;
  45754. if (function(e) {
  45755. function t(e, t) {
  45756. return e & 1 << t
  45757. }
  45758. var i, n, r, o, a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M = D.faces, R = D.vertices, P = D.normals, O = D.colors, L = 0;
  45759. if (void 0 !== D.uvs) {
  45760. for (i = 0; i < D.uvs.length; i++)
  45761. D.uvs[i].length && L++;
  45762. for (i = 0; i < L; i++)
  45763. N.faceVertexUvs[i] = []
  45764. }
  45765. for (o = 0,
  45766. a = R.length; o < a; )
  45767. (A = new Ci.Vector3).x = R[o++] * e,
  45768. A.y = R[o++] * e,
  45769. A.z = R[o++] * e,
  45770. N.vertices.push(A);
  45771. for (o = 0,
  45772. a = M.length; o < a; )
  45773. if (d = t(u = M[o++], 0),
  45774. p = t(u, 1),
  45775. f = t(u, 3),
  45776. g = t(u, 4),
  45777. m = t(u, 5),
  45778. v = t(u, 6),
  45779. y = t(u, 7),
  45780. d) {
  45781. if ((I = new Ci.Face3).a = M[o],
  45782. I.b = M[o + 1],
  45783. I.c = M[o + 3],
  45784. (E = new Ci.Face3).a = M[o + 1],
  45785. E.b = M[o + 2],
  45786. E.c = M[o + 3],
  45787. o += 4,
  45788. p && (h = M[o++],
  45789. I.materialIndex = h,
  45790. E.materialIndex = h),
  45791. r = N.faces.length,
  45792. f)
  45793. for (i = 0; i < L; i++)
  45794. for (w = D.uvs[i],
  45795. N.faceVertexUvs[i][r] = [],
  45796. N.faceVertexUvs[i][r + 1] = [],
  45797. n = 0; n < 4; n++)
  45798. x = w[2 * (c = M[o++])],
  45799. S = w[2 * c + 1],
  45800. T = new Ci.Vector2(x,S),
  45801. 2 !== n && N.faceVertexUvs[i][r].push(T),
  45802. 0 !== n && N.faceVertexUvs[i][r + 1].push(T);
  45803. if (g && (l = 3 * M[o++],
  45804. I.normal.set(P[l++], P[l++], P[l]),
  45805. E.normal.copy(I.normal)),
  45806. m)
  45807. for (i = 0; i < 4; i++)
  45808. l = 3 * M[o++],
  45809. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45810. 2 !== i && I.vertexNormals.push(b),
  45811. 0 !== i && E.vertexNormals.push(b);
  45812. if (v && (_ = O[s = M[o++]],
  45813. I.color.setHex(_),
  45814. E.color.setHex(_)),
  45815. y)
  45816. for (i = 0; i < 4; i++)
  45817. _ = O[s = M[o++]],
  45818. 2 !== i && I.vertexColors.push(new Ci.Color(_)),
  45819. 0 !== i && E.vertexColors.push(new Ci.Color(_));
  45820. N.faces.push(I),
  45821. N.faces.push(E)
  45822. } else {
  45823. if ((C = new Ci.Face3).a = M[o++],
  45824. C.b = M[o++],
  45825. C.c = M[o++],
  45826. p && (h = M[o++],
  45827. C.materialIndex = h),
  45828. r = N.faces.length,
  45829. f)
  45830. for (i = 0; i < L; i++)
  45831. for (w = D.uvs[i],
  45832. N.faceVertexUvs[i][r] = [],
  45833. n = 0; n < 3; n++)
  45834. x = w[2 * (c = M[o++])],
  45835. S = w[2 * c + 1],
  45836. T = new Ci.Vector2(x,S),
  45837. N.faceVertexUvs[i][r].push(T);
  45838. if (g && (l = 3 * M[o++],
  45839. C.normal.set(P[l++], P[l++], P[l])),
  45840. m)
  45841. for (i = 0; i < 3; i++)
  45842. l = 3 * M[o++],
  45843. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45844. C.vertexNormals.push(b);
  45845. if (v && (s = M[o++],
  45846. C.color.setHex(O[s])),
  45847. y)
  45848. for (i = 0; i < 3; i++)
  45849. s = M[o++],
  45850. C.vertexColors.push(new Ci.Color(O[s]));
  45851. N.faces.push(C)
  45852. }
  45853. }(t),
  45854. function() {
  45855. var e = void 0 !== D.influencesPerVertex ? D.influencesPerVertex : 2;
  45856. if (D.skinWeights)
  45857. for (var t = 0, i = D.skinWeights.length; t < i; t += e) {
  45858. var n = D.skinWeights[t]
  45859. , r = 1 < e ? D.skinWeights[t + 1] : 0
  45860. , o = 2 < e ? D.skinWeights[t + 2] : 0
  45861. , a = 3 < e ? D.skinWeights[t + 3] : 0;
  45862. N.skinWeights.push(new Ci.Vector4(n,r,o,a))
  45863. }
  45864. if (D.skinIndices)
  45865. for (t = 0,
  45866. i = D.skinIndices.length; t < i; t += e) {
  45867. var s = D.skinIndices[t]
  45868. , l = 1 < e ? D.skinIndices[t + 1] : 0
  45869. , c = 2 < e ? D.skinIndices[t + 2] : 0
  45870. , h = 3 < e ? D.skinIndices[t + 3] : 0;
  45871. N.skinIndices.push(new Ci.Vector4(s,l,c,h))
  45872. }
  45873. N.bones = D.bones,
  45874. N.bones && 0 < N.bones.length && (N.skinWeights.length !== N.skinIndices.length || N.skinIndices.length !== N.vertices.length) && console.warn("When skinning, number of vertices (" + N.vertices.length + "), skinIndices (" + N.skinIndices.length + "), and skinWeights (" + N.skinWeights.length + ") should match.")
  45875. }(),
  45876. function(e) {
  45877. if (void 0 !== D.morphTargets)
  45878. for (var t = 0, i = D.morphTargets.length; t < i; t++) {
  45879. N.morphTargets[t] = {},
  45880. N.morphTargets[t].name = D.morphTargets[t].name,
  45881. N.morphTargets[t].vertices = [];
  45882. for (var n = N.morphTargets[t].vertices, r = D.morphTargets[t].vertices, o = 0, a = r.length; o < a; o += 3) {
  45883. var s = new Ci.Vector3;
  45884. s.x = r[o] * e,
  45885. s.y = r[o + 1] * e,
  45886. s.z = r[o + 2] * e,
  45887. n.push(s)
  45888. }
  45889. }
  45890. if (void 0 !== D.morphColors && 0 < D.morphColors.length) {
  45891. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  45892. var l = N.faces
  45893. , c = D.morphColors[0].colors;
  45894. for (t = 0,
  45895. i = l.length; t < i; t++)
  45896. l[t].color.fromArray(c, 3 * t)
  45897. }
  45898. }(t),
  45899. function() {
  45900. var e = []
  45901. , t = [];
  45902. void 0 !== D.animation && t.push(D.animation),
  45903. void 0 !== D.animations && (D.animations.length ? t = t.concat(D.animations) : t.push(D.animations));
  45904. for (var i = 0; i < t.length; i++) {
  45905. var n = Ci.AnimationClip.parseAnimation(t[i], N.bones);
  45906. n && e.push(n)
  45907. }
  45908. if (N.morphTargets) {
  45909. var r = Ci.AnimationClip.CreateClipsFromMorphTargetSequences(N.morphTargets, 10);
  45910. e = e.concat(r)
  45911. }
  45912. 0 < e.length && (N.animations = e)
  45913. }(),
  45914. N.computeFaceNormals(),
  45915. N.computeBoundingSphere(),
  45916. void 0 === D.materials || 0 === D.materials.length)
  45917. return {
  45918. geometry: N
  45919. };
  45920. var i = Ci.Loader.prototype.initMaterials(D.materials, e, this.crossOrigin);
  45921. return {
  45922. geometry: N,
  45923. materials: i
  45924. }
  45925. }
  45926. },
  45927. Ci.LoadingManager = function(e, t, i) {
  45928. var n = this
  45929. , r = !1
  45930. , o = 0
  45931. , a = 0;
  45932. this.onStart = void 0,
  45933. this.onLoad = e,
  45934. this.onProgress = t,
  45935. this.onError = i,
  45936. this.itemStart = function(e) {
  45937. a++,
  45938. !1 === r && void 0 !== n.onStart && n.onStart(e, o, a),
  45939. r = !0
  45940. }
  45941. ,
  45942. this.itemEnd = function(e) {
  45943. o++,
  45944. void 0 !== n.onProgress && n.onProgress(e, o, a),
  45945. o === a && (r = !1,
  45946. void 0 !== n.onLoad && n.onLoad())
  45947. }
  45948. ,
  45949. this.itemError = function(e) {
  45950. void 0 !== n.onError && n.onError(e)
  45951. }
  45952. }
  45953. ,
  45954. Ci.DefaultLoadingManager = new Ci.LoadingManager,
  45955. Ci.BufferGeometryLoader = function(e) {
  45956. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45957. }
  45958. ,
  45959. Ci.BufferGeometryLoader.prototype = {
  45960. constructor: Ci.BufferGeometryLoader,
  45961. load: function(e, t, i, n) {
  45962. var r = this;
  45963. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45964. t(r.parse(JSON.parse(e)))
  45965. }, i, n)
  45966. },
  45967. parse: function(e) {
  45968. var t = new Ci.BufferGeometry
  45969. , i = e.data.index
  45970. , n = {
  45971. Int8Array: Int8Array,
  45972. Uint8Array: Uint8Array,
  45973. Uint8ClampedArray: Uint8ClampedArray,
  45974. Int16Array: Int16Array,
  45975. Uint16Array: Uint16Array,
  45976. Int32Array: Int32Array,
  45977. Uint32Array: Uint32Array,
  45978. Float32Array: Float32Array,
  45979. Float64Array: Float64Array
  45980. };
  45981. if (void 0 !== i) {
  45982. var r = new n[i.type](i.array);
  45983. t.setIndex(new Ci.BufferAttribute(r,1))
  45984. }
  45985. var o = e.data.attributes;
  45986. for (var a in o) {
  45987. var s = o[a];
  45988. r = new n[s.type](s.array);
  45989. t.addAttribute(a, new Ci.BufferAttribute(r,s.itemSize))
  45990. }
  45991. var l = e.data.groups || e.data.drawcalls || e.data.offsets;
  45992. if (void 0 !== l)
  45993. for (var c = 0, h = l.length; c !== h; ++c) {
  45994. var u = l[c];
  45995. t.addGroup(u.start, u.count, u.materialIndex)
  45996. }
  45997. var d = e.data.boundingSphere;
  45998. if (void 0 !== d) {
  45999. var p = new Ci.Vector3;
  46000. void 0 !== d.center && p.fromArray(d.center),
  46001. t.boundingSphere = new Ci.Sphere(p,d.radius)
  46002. }
  46003. return t
  46004. }
  46005. },
  46006. Ci.MaterialLoader = function(e) {
  46007. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46008. this.textures = {}
  46009. }
  46010. ,
  46011. Ci.MaterialLoader.prototype = {
  46012. constructor: Ci.MaterialLoader,
  46013. load: function(e, t, i, n) {
  46014. var r = this;
  46015. new Ci.XHRLoader(r.manager).load(e, function(e) {
  46016. t(r.parse(JSON.parse(e)))
  46017. }, i, n)
  46018. },
  46019. setTextures: function(e) {
  46020. this.textures = e
  46021. },
  46022. getTexture: function(e) {
  46023. var t = this.textures;
  46024. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  46025. t[e]
  46026. },
  46027. parse: function(e) {
  46028. var t = new Ci[e.type];
  46029. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  46030. void 0 !== e.name && (t.name = e.name),
  46031. void 0 !== e.color && t.color.setHex(e.color),
  46032. void 0 !== e.roughness && (t.roughness = e.roughness),
  46033. void 0 !== e.metalness && (t.metalness = e.metalness),
  46034. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  46035. void 0 !== e.specular && t.specular.setHex(e.specular),
  46036. void 0 !== e.shininess && (t.shininess = e.shininess),
  46037. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  46038. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  46039. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  46040. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  46041. void 0 !== e.shading && (t.shading = e.shading),
  46042. void 0 !== e.blending && (t.blending = e.blending),
  46043. void 0 !== e.side && (t.side = e.side),
  46044. void 0 !== e.opacity && (t.opacity = e.opacity),
  46045. void 0 !== e.transparent && (t.transparent = e.transparent),
  46046. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  46047. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  46048. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  46049. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  46050. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  46051. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  46052. void 0 !== e.size && (t.size = e.size),
  46053. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  46054. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  46055. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  46056. t.transparent = !0),
  46057. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  46058. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  46059. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  46060. void 0 !== e.normalScale) {
  46061. var i = e.normalScale;
  46062. !1 === Array.isArray(i) && (i = [i, i]),
  46063. t.normalScale = (new Ci.Vector2).fromArray(i)
  46064. }
  46065. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  46066. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  46067. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  46068. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  46069. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  46070. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  46071. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  46072. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  46073. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  46074. t.combine = Ci.MultiplyOperation),
  46075. e.reflectivity && (t.reflectivity = e.reflectivity),
  46076. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  46077. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  46078. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  46079. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  46080. void 0 !== e.materials)
  46081. for (var n = 0, r = e.materials.length; n < r; n++)
  46082. t.materials.push(this.parse(e.materials[n]));
  46083. return t
  46084. }
  46085. },
  46086. Ci.ObjectLoader = function(e) {
  46087. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46088. this.texturePath = ""
  46089. }
  46090. ,
  46091. Ci.ObjectLoader.prototype = {
  46092. constructor: Ci.ObjectLoader,
  46093. load: function(e, t, i, n) {
  46094. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  46095. var r = this;
  46096. new Ci.XHRLoader(r.manager).load(e, function(e) {
  46097. r.parse(JSON.parse(e), t)
  46098. }, i, n)
  46099. },
  46100. setTexturePath: function(e) {
  46101. this.texturePath = e
  46102. },
  46103. setCrossOrigin: function(e) {
  46104. this.crossOrigin = e
  46105. },
  46106. parse: function(e, t) {
  46107. var i = this.parseGeometries(e.geometries)
  46108. , n = this.parseImages(e.images, function() {
  46109. void 0 !== t && t(a)
  46110. })
  46111. , r = this.parseTextures(e.textures, n)
  46112. , o = this.parseMaterials(e.materials, r)
  46113. , a = this.parseObject(e.object, i, o);
  46114. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  46115. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  46116. a
  46117. },
  46118. parseGeometries: function(e) {
  46119. var t = {};
  46120. if (void 0 !== e)
  46121. for (var i = new Ci.JSONLoader, n = new Ci.BufferGeometryLoader, r = 0, o = e.length; r < o; r++) {
  46122. var a, s = e[r];
  46123. switch (s.type) {
  46124. case "PlaneGeometry":
  46125. case "PlaneBufferGeometry":
  46126. a = new Ci[s.type](s.width,s.height,s.widthSegments,s.heightSegments);
  46127. break;
  46128. case "BoxGeometry":
  46129. case "BoxBufferGeometry":
  46130. case "CubeGeometry":
  46131. a = new Ci[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);
  46132. break;
  46133. case "CircleGeometry":
  46134. case "CircleBufferGeometry":
  46135. a = new Ci[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);
  46136. break;
  46137. case "CylinderGeometry":
  46138. case "CylinderBufferGeometry":
  46139. a = new Ci[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);
  46140. break;
  46141. case "SphereGeometry":
  46142. case "SphereBufferGeometry":
  46143. a = new Ci[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);
  46144. break;
  46145. case "DodecahedronGeometry":
  46146. a = new Ci.DodecahedronGeometry(s.radius,s.detail);
  46147. break;
  46148. case "IcosahedronGeometry":
  46149. a = new Ci.IcosahedronGeometry(s.radius,s.detail);
  46150. break;
  46151. case "OctahedronGeometry":
  46152. a = new Ci.OctahedronGeometry(s.radius,s.detail);
  46153. break;
  46154. case "TetrahedronGeometry":
  46155. a = new Ci.TetrahedronGeometry(s.radius,s.detail);
  46156. break;
  46157. case "RingGeometry":
  46158. case "RingBufferGeometry":
  46159. a = new Ci[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);
  46160. break;
  46161. case "TorusGeometry":
  46162. case "TorusBufferGeometry":
  46163. a = new Ci[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);
  46164. break;
  46165. case "TorusKnotGeometry":
  46166. case "TorusKnotBufferGeometry":
  46167. a = new Ci[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);
  46168. break;
  46169. case "LatheGeometry":
  46170. a = new Ci.LatheGeometry(s.points,s.segments,s.phiStart,s.phiLength);
  46171. break;
  46172. case "BufferGeometry":
  46173. a = n.parse(s);
  46174. break;
  46175. case "Geometry":
  46176. a = i.parse(s.data, this.texturePath).geometry;
  46177. break;
  46178. default:
  46179. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + s.type + '"');
  46180. continue
  46181. }
  46182. a.uuid = s.uuid,
  46183. void 0 !== s.name && (a.name = s.name),
  46184. t[s.uuid] = a
  46185. }
  46186. return t
  46187. },
  46188. parseMaterials: function(e, t) {
  46189. var i = {};
  46190. if (void 0 !== e) {
  46191. var n = new Ci.MaterialLoader;
  46192. n.setTextures(t);
  46193. for (var r = 0, o = e.length; r < o; r++) {
  46194. var a = n.parse(e[r]);
  46195. i[a.uuid] = a
  46196. }
  46197. }
  46198. return i
  46199. },
  46200. parseAnimations: function(e) {
  46201. for (var t = [], i = 0; i < e.length; i++) {
  46202. var n = Ci.AnimationClip.parse(e[i]);
  46203. t.push(n)
  46204. }
  46205. return t
  46206. },
  46207. parseImages: function(e, t) {
  46208. function i(e) {
  46209. return n.manager.itemStart(e),
  46210. a.load(e, function() {
  46211. n.manager.itemEnd(e)
  46212. })
  46213. }
  46214. var n = this
  46215. , r = {};
  46216. if (void 0 !== e && 0 < e.length) {
  46217. var o = new Ci.LoadingManager(t)
  46218. , a = new Ci.ImageLoader(o);
  46219. a.setCrossOrigin(this.crossOrigin);
  46220. for (var s = 0, l = e.length; s < l; s++) {
  46221. var c = e[s]
  46222. , h = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url) ? c.url : n.texturePath + c.url;
  46223. r[c.uuid] = i(h)
  46224. }
  46225. }
  46226. return r
  46227. },
  46228. parseTextures: function(e, t) {
  46229. function i(e) {
  46230. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  46231. Ci[e])
  46232. }
  46233. var n = {};
  46234. if (void 0 !== e)
  46235. for (var r = 0, o = e.length; r < o; r++) {
  46236. var a = e[r];
  46237. void 0 === a.image && console.warn('THREE.ObjectLoader: No "image" specified for', a.uuid),
  46238. void 0 === t[a.image] && console.warn("THREE.ObjectLoader: Undefined image", a.image);
  46239. var s = new Ci.Texture(t[a.image]);
  46240. s.needsUpdate = !0,
  46241. s.uuid = a.uuid,
  46242. void 0 !== a.name && (s.name = a.name),
  46243. void 0 !== a.mapping && (s.mapping = i(a.mapping)),
  46244. void 0 !== a.offset && (s.offset = new Ci.Vector2(a.offset[0],a.offset[1])),
  46245. void 0 !== a.repeat && (s.repeat = new Ci.Vector2(a.repeat[0],a.repeat[1])),
  46246. void 0 !== a.minFilter && (s.minFilter = i(a.minFilter)),
  46247. void 0 !== a.magFilter && (s.magFilter = i(a.magFilter)),
  46248. void 0 !== a.anisotropy && (s.anisotropy = a.anisotropy),
  46249. Array.isArray(a.wrap) && (s.wrapS = i(a.wrap[0]),
  46250. s.wrapT = i(a.wrap[1])),
  46251. n[a.uuid] = s
  46252. }
  46253. return n
  46254. },
  46255. parseObject: (ke = new Ci.Matrix4,
  46256. function(e, t, i) {
  46257. function n(e) {
  46258. return void 0 === t[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  46259. t[e]
  46260. }
  46261. function r(e) {
  46262. if (void 0 !== e)
  46263. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  46264. i[e]
  46265. }
  46266. var o;
  46267. switch (e.type) {
  46268. case "Scene":
  46269. o = new Ci.Scene;
  46270. break;
  46271. case "PerspectiveCamera":
  46272. o = new Ci.PerspectiveCamera(e.fov,e.aspect,e.near,e.far);
  46273. break;
  46274. case "OrthographicCamera":
  46275. o = new Ci.OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far);
  46276. break;
  46277. case "AmbientLight":
  46278. o = new Ci.AmbientLight(e.color,e.intensity);
  46279. break;
  46280. case "DirectionalLight":
  46281. o = new Ci.DirectionalLight(e.color,e.intensity);
  46282. break;
  46283. case "PointLight":
  46284. o = new Ci.PointLight(e.color,e.intensity,e.distance,e.decay);
  46285. break;
  46286. case "SpotLight":
  46287. o = new Ci.SpotLight(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);
  46288. break;
  46289. case "HemisphereLight":
  46290. o = new Ci.HemisphereLight(e.color,e.groundColor,e.intensity);
  46291. break;
  46292. case "Mesh":
  46293. var a = n(e.geometry)
  46294. , s = r(e.material);
  46295. o = a.bones && 0 < a.bones.length ? new Ci.SkinnedMesh(a,s) : new Ci.Mesh(a,s);
  46296. break;
  46297. case "LOD":
  46298. o = new Ci.LOD;
  46299. break;
  46300. case "Line":
  46301. o = new Ci.Line(n(e.geometry),r(e.material),e.mode);
  46302. break;
  46303. case "PointCloud":
  46304. case "Points":
  46305. o = new Ci.Points(n(e.geometry),r(e.material));
  46306. break;
  46307. case "Sprite":
  46308. o = new Ci.Sprite(r(e.material));
  46309. break;
  46310. case "Group":
  46311. o = new Ci.Group;
  46312. break;
  46313. default:
  46314. o = new Ci.Object3D
  46315. }
  46316. if (o.uuid = e.uuid,
  46317. void 0 !== e.name && (o.name = e.name),
  46318. void 0 !== e.matrix ? (ke.fromArray(e.matrix),
  46319. ke.decompose(o.position, o.quaternion, o.scale)) : (void 0 !== e.position && o.position.fromArray(e.position),
  46320. void 0 !== e.rotation && o.rotation.fromArray(e.rotation),
  46321. void 0 !== e.scale && o.scale.fromArray(e.scale)),
  46322. void 0 !== e.castShadow && (o.castShadow = e.castShadow),
  46323. void 0 !== e.receiveShadow && (o.receiveShadow = e.receiveShadow),
  46324. void 0 !== e.visible && (o.visible = e.visible),
  46325. void 0 !== e.userData && (o.userData = e.userData),
  46326. void 0 !== e.children)
  46327. for (var l in e.children)
  46328. o.add(this.parseObject(e.children[l], t, i));
  46329. if ("LOD" === e.type)
  46330. for (var c = e.levels, h = 0; h < c.length; h++) {
  46331. var u = c[h];
  46332. void 0 !== (l = o.getObjectByProperty("uuid", u.object)) && o.addLevel(l, u.distance)
  46333. }
  46334. return o
  46335. }
  46336. )
  46337. },
  46338. Ci.TextureLoader = function(e) {
  46339. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46340. }
  46341. ,
  46342. Ci.TextureLoader.prototype = {
  46343. constructor: Ci.TextureLoader,
  46344. load: function(e, t, i, n) {
  46345. var r = new Ci.Texture
  46346. , o = new Ci.ImageLoader(this.manager);
  46347. return o.setCrossOrigin(this.crossOrigin),
  46348. o.setPath(this.path),
  46349. o.load(e, function(e) {
  46350. r.image = e,
  46351. r.needsUpdate = !0,
  46352. void 0 !== t && t(r)
  46353. }, i, n),
  46354. r
  46355. },
  46356. setCrossOrigin: function(e) {
  46357. this.crossOrigin = e
  46358. },
  46359. setPath: function(e) {
  46360. this.path = e
  46361. }
  46362. },
  46363. Ci.CubeTextureLoader = function(e) {
  46364. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46365. }
  46366. ,
  46367. Ci.CubeTextureLoader.prototype = {
  46368. constructor: Ci.CubeTextureLoader,
  46369. load: function(e, i, t, n) {
  46370. function r(t) {
  46371. a.load(e[t], function(e) {
  46372. o.images[t] = e,
  46373. 6 === ++s && (o.needsUpdate = !0,
  46374. i && i(o))
  46375. }, void 0, n)
  46376. }
  46377. var o = new Ci.CubeTexture
  46378. , a = new Ci.ImageLoader(this.manager);
  46379. a.setCrossOrigin(this.crossOrigin),
  46380. a.setPath(this.path);
  46381. for (var s = 0, l = 0; l < e.length; ++l)
  46382. r(l);
  46383. return o
  46384. },
  46385. setCrossOrigin: function(e) {
  46386. this.crossOrigin = e
  46387. },
  46388. setPath: function(e) {
  46389. this.path = e
  46390. }
  46391. },
  46392. Ci.DataTextureLoader = Ci.BinaryTextureLoader = function(e) {
  46393. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46394. this._parser = null
  46395. }
  46396. ,
  46397. Ci.BinaryTextureLoader.prototype = {
  46398. constructor: Ci.BinaryTextureLoader,
  46399. load: function(e, i, t, n) {
  46400. var r = this
  46401. , o = new Ci.DataTexture
  46402. , a = new Ci.XHRLoader(this.manager);
  46403. return a.setResponseType("arraybuffer"),
  46404. a.load(e, function(e) {
  46405. var t = r._parser(e);
  46406. t && (void 0 !== t.image ? o.image = t.image : void 0 !== t.data && (o.image.width = t.width,
  46407. o.image.height = t.height,
  46408. o.image.data = t.data),
  46409. o.wrapS = void 0 !== t.wrapS ? t.wrapS : Ci.ClampToEdgeWrapping,
  46410. o.wrapT = void 0 !== t.wrapT ? t.wrapT : Ci.ClampToEdgeWrapping,
  46411. o.magFilter = void 0 !== t.magFilter ? t.magFilter : Ci.LinearFilter,
  46412. o.minFilter = void 0 !== t.minFilter ? t.minFilter : Ci.LinearMipMapLinearFilter,
  46413. o.anisotropy = void 0 !== t.anisotropy ? t.anisotropy : 1,
  46414. void 0 !== t.format && (o.format = t.format),
  46415. void 0 !== t.type && (o.type = t.type),
  46416. void 0 !== t.mipmaps && (o.mipmaps = t.mipmaps),
  46417. 1 === t.mipmapCount && (o.minFilter = Ci.LinearFilter),
  46418. o.needsUpdate = !0,
  46419. i && i(o, t))
  46420. }, t, n),
  46421. o
  46422. }
  46423. },
  46424. Ci.CompressedTextureLoader = function(e) {
  46425. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46426. this._parser = null
  46427. }
  46428. ,
  46429. Ci.CompressedTextureLoader.prototype = {
  46430. constructor: Ci.CompressedTextureLoader,
  46431. load: function(e, o, t, n) {
  46432. function i(i) {
  46433. r.load(e[i], function(e) {
  46434. var t = a._parser(e, !0);
  46435. s[i] = {
  46436. width: t.width,
  46437. height: t.height,
  46438. format: t.format,
  46439. mipmaps: t.mipmaps
  46440. },
  46441. 6 === (c += 1) && (1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46442. l.format = t.format,
  46443. l.needsUpdate = !0,
  46444. o && o(l))
  46445. }, t, n)
  46446. }
  46447. var a = this
  46448. , s = []
  46449. , l = new Ci.CompressedTexture;
  46450. l.image = s;
  46451. var r = new Ci.XHRLoader(this.manager);
  46452. if (r.setPath(this.path),
  46453. r.setResponseType("arraybuffer"),
  46454. Array.isArray(e))
  46455. for (var c = 0, h = 0, u = e.length; h < u; ++h)
  46456. i(h);
  46457. else
  46458. r.load(e, function(e) {
  46459. var t = a._parser(e, !0);
  46460. if (t.isCubemap)
  46461. for (var i = t.mipmaps.length / t.mipmapCount, n = 0; n < i; n++) {
  46462. s[n] = {
  46463. mipmaps: []
  46464. };
  46465. for (var r = 0; r < t.mipmapCount; r++)
  46466. s[n].mipmaps.push(t.mipmaps[n * t.mipmapCount + r]),
  46467. s[n].format = t.format,
  46468. s[n].width = t.width,
  46469. s[n].height = t.height
  46470. }
  46471. else
  46472. l.image.width = t.width,
  46473. l.image.height = t.height,
  46474. l.mipmaps = t.mipmaps;
  46475. 1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46476. l.format = t.format,
  46477. l.needsUpdate = !0,
  46478. o && o(l)
  46479. }, t, n);
  46480. return l
  46481. },
  46482. setPath: function(e) {
  46483. this.path = e
  46484. }
  46485. },
  46486. Ci.Material = function() {
  46487. Object.defineProperty(this, "id", {
  46488. value: Ci.MaterialIdCount++
  46489. }),
  46490. this.uuid = Ci.Math.generateUUID(),
  46491. this.name = "",
  46492. this.type = "Material",
  46493. this.side = Ci.FrontSide,
  46494. this.opacity = 1,
  46495. this.transparent = !1,
  46496. this.blending = Ci.NormalBlending,
  46497. this.blendSrc = Ci.SrcAlphaFactor,
  46498. this.blendDst = Ci.OneMinusSrcAlphaFactor,
  46499. this.blendEquation = Ci.AddEquation,
  46500. this.blendSrcAlpha = null,
  46501. this.blendDstAlpha = null,
  46502. this.blendEquationAlpha = null,
  46503. this.depthFunc = Ci.LessEqualDepth,
  46504. this.depthTest = !0,
  46505. this.depthWrite = !0,
  46506. this.colorWrite = !0,
  46507. this.precision = null,
  46508. this.polygonOffset = !1,
  46509. this.polygonOffsetFactor = 0,
  46510. this.polygonOffsetUnits = 0,
  46511. this.alphaTest = 0,
  46512. this.premultipliedAlpha = !1,
  46513. this.overdraw = 0,
  46514. this.visible = !0,
  46515. this._needsUpdate = !0
  46516. }
  46517. ,
  46518. Ci.Material.prototype = {
  46519. constructor: Ci.Material,
  46520. get needsUpdate() {
  46521. return this._needsUpdate
  46522. },
  46523. set needsUpdate(e) {
  46524. !0 === e && this.update(),
  46525. this._needsUpdate = e
  46526. },
  46527. setValues: function(e) {
  46528. if (void 0 !== e)
  46529. for (var t in e) {
  46530. var i = e[t];
  46531. if (void 0 !== i) {
  46532. var n = this[t];
  46533. void 0 !== n ? n instanceof Ci.Color ? n.set(i) : n instanceof Ci.Vector3 && i instanceof Ci.Vector3 ? n.copy(i) : this[t] = "overdraw" === t ? Number(i) : i : console.warn("THREE." + this.type + ": '" + t + "' is not a property of this material.")
  46534. } else
  46535. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  46536. }
  46537. },
  46538. toJSON: function(e) {
  46539. function t(e) {
  46540. var t = [];
  46541. for (var i in e) {
  46542. var n = e[i];
  46543. delete n.metadata,
  46544. t.push(n)
  46545. }
  46546. return t
  46547. }
  46548. var i = void 0 === e;
  46549. i && (e = {
  46550. textures: {},
  46551. images: {}
  46552. });
  46553. var n = {
  46554. metadata: {
  46555. version: 4.4,
  46556. type: "Material",
  46557. generator: "Material.toJSON"
  46558. }
  46559. };
  46560. if (n.uuid = this.uuid,
  46561. n.type = this.type,
  46562. "" !== this.name && (n.name = this.name),
  46563. this.color instanceof Ci.Color && (n.color = this.color.getHex()),
  46564. .5 !== this.roughness && (n.roughness = this.roughness),
  46565. .5 !== this.metalness && (n.metalness = this.metalness),
  46566. this.emissive instanceof Ci.Color && (n.emissive = this.emissive.getHex()),
  46567. this.specular instanceof Ci.Color && (n.specular = this.specular.getHex()),
  46568. void 0 !== this.shininess && (n.shininess = this.shininess),
  46569. this.map instanceof Ci.Texture && (n.map = this.map.toJSON(e).uuid),
  46570. this.alphaMap instanceof Ci.Texture && (n.alphaMap = this.alphaMap.toJSON(e).uuid),
  46571. this.lightMap instanceof Ci.Texture && (n.lightMap = this.lightMap.toJSON(e).uuid),
  46572. this.bumpMap instanceof Ci.Texture && (n.bumpMap = this.bumpMap.toJSON(e).uuid,
  46573. n.bumpScale = this.bumpScale),
  46574. this.normalMap instanceof Ci.Texture && (n.normalMap = this.normalMap.toJSON(e).uuid,
  46575. n.normalScale = this.normalScale.toArray()),
  46576. this.displacementMap instanceof Ci.Texture && (n.displacementMap = this.displacementMap.toJSON(e).uuid,
  46577. n.displacementScale = this.displacementScale,
  46578. n.displacementBias = this.displacementBias),
  46579. this.roughnessMap instanceof Ci.Texture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  46580. this.metalnessMap instanceof Ci.Texture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  46581. this.emissiveMap instanceof Ci.Texture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  46582. this.specularMap instanceof Ci.Texture && (n.specularMap = this.specularMap.toJSON(e).uuid),
  46583. this.envMap instanceof Ci.Texture && (n.envMap = this.envMap.toJSON(e).uuid,
  46584. n.reflectivity = this.reflectivity),
  46585. void 0 !== this.size && (n.size = this.size),
  46586. void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation),
  46587. void 0 !== this.vertexColors && this.vertexColors !== Ci.NoColors && (n.vertexColors = this.vertexColors),
  46588. void 0 !== this.shading && this.shading !== Ci.SmoothShading && (n.shading = this.shading),
  46589. void 0 !== this.blending && this.blending !== Ci.NormalBlending && (n.blending = this.blending),
  46590. void 0 !== this.side && this.side !== Ci.FrontSide && (n.side = this.side),
  46591. this.opacity < 1 && (n.opacity = this.opacity),
  46592. !0 === this.transparent && (n.transparent = this.transparent),
  46593. 0 < this.alphaTest && (n.alphaTest = this.alphaTest),
  46594. !0 === this.premultipliedAlpha && (n.premultipliedAlpha = this.premultipliedAlpha),
  46595. !0 === this.wireframe && (n.wireframe = this.wireframe),
  46596. 1 < this.wireframeLinewidth && (n.wireframeLinewidth = this.wireframeLinewidth),
  46597. i) {
  46598. var r = t(e.textures)
  46599. , o = t(e.images);
  46600. 0 < r.length && (n.textures = r),
  46601. 0 < o.length && (n.images = o)
  46602. }
  46603. return n
  46604. },
  46605. clone: function() {
  46606. return (new this.constructor).copy(this)
  46607. },
  46608. copy: function(e) {
  46609. return this.name = e.name,
  46610. this.side = e.side,
  46611. this.opacity = e.opacity,
  46612. this.transparent = e.transparent,
  46613. this.blending = e.blending,
  46614. this.blendSrc = e.blendSrc,
  46615. this.blendDst = e.blendDst,
  46616. this.blendEquation = e.blendEquation,
  46617. this.blendSrcAlpha = e.blendSrcAlpha,
  46618. this.blendDstAlpha = e.blendDstAlpha,
  46619. this.blendEquationAlpha = e.blendEquationAlpha,
  46620. this.depthFunc = e.depthFunc,
  46621. this.depthTest = e.depthTest,
  46622. this.depthWrite = e.depthWrite,
  46623. this.colorWrite = e.colorWrite,
  46624. this.precision = e.precision,
  46625. this.polygonOffset = e.polygonOffset,
  46626. this.polygonOffsetFactor = e.polygonOffsetFactor,
  46627. this.polygonOffsetUnits = e.polygonOffsetUnits,
  46628. this.alphaTest = e.alphaTest,
  46629. this.premultipliedAlpha = e.premultipliedAlpha,
  46630. this.overdraw = e.overdraw,
  46631. this.visible = e.visible,
  46632. this
  46633. },
  46634. update: function() {
  46635. this.dispatchEvent({
  46636. type: "update"
  46637. })
  46638. },
  46639. dispose: function() {
  46640. this.dispatchEvent({
  46641. type: "dispose"
  46642. })
  46643. }
  46644. },
  46645. Ci.EventDispatcher.prototype.apply(Ci.Material.prototype),
  46646. Ci.MaterialIdCount = 0,
  46647. Ci.LineBasicMaterial = function(e) {
  46648. Ci.Material.call(this),
  46649. this.type = "LineBasicMaterial",
  46650. this.color = new Ci.Color(16777215),
  46651. this.linewidth = 1,
  46652. this.linecap = "round",
  46653. this.linejoin = "round",
  46654. this.blending = Ci.NormalBlending,
  46655. this.vertexColors = Ci.NoColors,
  46656. this.fog = !0,
  46657. this.setValues(e)
  46658. }
  46659. ,
  46660. Ci.LineBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46661. Ci.LineBasicMaterial.prototype.constructor = Ci.LineBasicMaterial,
  46662. Ci.LineBasicMaterial.prototype.copy = function(e) {
  46663. return Ci.Material.prototype.copy.call(this, e),
  46664. this.color.copy(e.color),
  46665. this.linewidth = e.linewidth,
  46666. this.linecap = e.linecap,
  46667. this.linejoin = e.linejoin,
  46668. this.vertexColors = e.vertexColors,
  46669. this.fog = e.fog,
  46670. this
  46671. }
  46672. ,
  46673. Ci.LineDashedMaterial = function(e) {
  46674. Ci.Material.call(this),
  46675. this.type = "LineDashedMaterial",
  46676. this.color = new Ci.Color(16777215),
  46677. this.linewidth = 1,
  46678. this.scale = 1,
  46679. this.dashSize = 3,
  46680. this.gapSize = 1,
  46681. this.blending = Ci.NormalBlending,
  46682. this.vertexColors = Ci.NoColors,
  46683. this.fog = !0,
  46684. this.setValues(e)
  46685. }
  46686. ,
  46687. Ci.LineDashedMaterial.prototype = Object.create(Ci.Material.prototype),
  46688. Ci.LineDashedMaterial.prototype.constructor = Ci.LineDashedMaterial,
  46689. Ci.LineDashedMaterial.prototype.copy = function(e) {
  46690. return Ci.Material.prototype.copy.call(this, e),
  46691. this.color.copy(e.color),
  46692. this.linewidth = e.linewidth,
  46693. this.scale = e.scale,
  46694. this.dashSize = e.dashSize,
  46695. this.gapSize = e.gapSize,
  46696. this.vertexColors = e.vertexColors,
  46697. this.fog = e.fog,
  46698. this
  46699. }
  46700. ,
  46701. Ci.MeshBasicMaterial = function(e) {
  46702. Ci.Material.call(this),
  46703. this.type = "MeshBasicMaterial",
  46704. this.color = new Ci.Color(16777215),
  46705. this.map = null,
  46706. this.aoMap = null,
  46707. this.aoMapIntensity = 1,
  46708. this.specularMap = null,
  46709. this.alphaMap = null,
  46710. this.envMap = null,
  46711. this.combine = Ci.MultiplyOperation,
  46712. this.reflectivity = 1,
  46713. this.refractionRatio = .98,
  46714. this.fog = !0,
  46715. this.shading = Ci.SmoothShading,
  46716. this.blending = Ci.NormalBlending,
  46717. this.wireframe = !1,
  46718. this.wireframeLinewidth = 1,
  46719. this.wireframeLinecap = "round",
  46720. this.wireframeLinejoin = "round",
  46721. this.vertexColors = Ci.NoColors,
  46722. this.skinning = !1,
  46723. this.morphTargets = !1,
  46724. this.setValues(e)
  46725. }
  46726. ,
  46727. Ci.MeshBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46728. Ci.MeshBasicMaterial.prototype.constructor = Ci.MeshBasicMaterial,
  46729. Ci.MeshBasicMaterial.prototype.copy = function(e) {
  46730. return Ci.Material.prototype.copy.call(this, e),
  46731. this.color.copy(e.color),
  46732. this.map = e.map,
  46733. this.aoMap = e.aoMap,
  46734. this.aoMapIntensity = e.aoMapIntensity,
  46735. this.specularMap = e.specularMap,
  46736. this.alphaMap = e.alphaMap,
  46737. this.envMap = e.envMap,
  46738. this.combine = e.combine,
  46739. this.reflectivity = e.reflectivity,
  46740. this.refractionRatio = e.refractionRatio,
  46741. this.fog = e.fog,
  46742. this.shading = e.shading,
  46743. this.wireframe = e.wireframe,
  46744. this.wireframeLinewidth = e.wireframeLinewidth,
  46745. this.wireframeLinecap = e.wireframeLinecap,
  46746. this.wireframeLinejoin = e.wireframeLinejoin,
  46747. this.vertexColors = e.vertexColors,
  46748. this.skinning = e.skinning,
  46749. this.morphTargets = e.morphTargets,
  46750. this
  46751. }
  46752. ,
  46753. Ci.MeshLambertMaterial = function(e) {
  46754. Ci.Material.call(this),
  46755. this.type = "MeshLambertMaterial",
  46756. this.color = new Ci.Color(16777215),
  46757. this.map = null,
  46758. this.lightMap = null,
  46759. this.lightMapIntensity = 1,
  46760. this.aoMap = null,
  46761. this.aoMapIntensity = 1,
  46762. this.emissive = new Ci.Color(0),
  46763. this.emissiveIntensity = 1,
  46764. this.emissiveMap = null,
  46765. this.specularMap = null,
  46766. this.alphaMap = null,
  46767. this.envMap = null,
  46768. this.combine = Ci.MultiplyOperation,
  46769. this.reflectivity = 1,
  46770. this.refractionRatio = .98,
  46771. this.fog = !0,
  46772. this.blending = Ci.NormalBlending,
  46773. this.wireframe = !1,
  46774. this.wireframeLinewidth = 1,
  46775. this.wireframeLinecap = "round",
  46776. this.wireframeLinejoin = "round",
  46777. this.vertexColors = Ci.NoColors,
  46778. this.skinning = !1,
  46779. this.morphTargets = !1,
  46780. this.morphNormals = !1,
  46781. this.setValues(e)
  46782. }
  46783. ,
  46784. Ci.MeshLambertMaterial.prototype = Object.create(Ci.Material.prototype),
  46785. Ci.MeshLambertMaterial.prototype.constructor = Ci.MeshLambertMaterial,
  46786. Ci.MeshLambertMaterial.prototype.copy = function(e) {
  46787. return Ci.Material.prototype.copy.call(this, e),
  46788. this.color.copy(e.color),
  46789. this.map = e.map,
  46790. this.lightMap = e.lightMap,
  46791. this.lightMapIntensity = e.lightMapIntensity,
  46792. this.aoMap = e.aoMap,
  46793. this.aoMapIntensity = e.aoMapIntensity,
  46794. this.emissive.copy(e.emissive),
  46795. this.emissiveMap = e.emissiveMap,
  46796. this.emissiveIntensity = e.emissiveIntensity,
  46797. this.specularMap = e.specularMap,
  46798. this.alphaMap = e.alphaMap,
  46799. this.envMap = e.envMap,
  46800. this.combine = e.combine,
  46801. this.reflectivity = e.reflectivity,
  46802. this.refractionRatio = e.refractionRatio,
  46803. this.fog = e.fog,
  46804. this.wireframe = e.wireframe,
  46805. this.wireframeLinewidth = e.wireframeLinewidth,
  46806. this.wireframeLinecap = e.wireframeLinecap,
  46807. this.wireframeLinejoin = e.wireframeLinejoin,
  46808. this.vertexColors = e.vertexColors,
  46809. this.skinning = e.skinning,
  46810. this.morphTargets = e.morphTargets,
  46811. this.morphNormals = e.morphNormals,
  46812. this
  46813. }
  46814. ,
  46815. Ci.MeshPhongMaterial = function(e) {
  46816. Ci.Material.call(this),
  46817. this.type = "MeshPhongMaterial",
  46818. this.color = new Ci.Color(16777215),
  46819. this.specular = new Ci.Color(1118481),
  46820. this.shininess = 30,
  46821. this.map = null,
  46822. this.lightMap = null,
  46823. this.lightMapIntensity = 1,
  46824. this.aoMap = null,
  46825. this.aoMapIntensity = 1,
  46826. this.emissive = new Ci.Color(0),
  46827. this.emissiveIntensity = 1,
  46828. this.emissiveMap = null,
  46829. this.bumpMap = null,
  46830. this.bumpScale = 1,
  46831. this.normalMap = null,
  46832. this.normalScale = new Ci.Vector2(1,1),
  46833. this.displacementMap = null,
  46834. this.displacementScale = 1,
  46835. this.displacementBias = 0,
  46836. this.specularMap = null,
  46837. this.alphaMap = null,
  46838. this.envMap = null,
  46839. this.combine = Ci.MultiplyOperation,
  46840. this.reflectivity = 1,
  46841. this.refractionRatio = .98,
  46842. this.fog = !0,
  46843. this.shading = Ci.SmoothShading,
  46844. this.blending = Ci.NormalBlending,
  46845. this.wireframe = !1,
  46846. this.wireframeLinewidth = 1,
  46847. this.wireframeLinecap = "round",
  46848. this.wireframeLinejoin = "round",
  46849. this.vertexColors = Ci.NoColors,
  46850. this.skinning = !1,
  46851. this.morphTargets = !1,
  46852. this.morphNormals = !1,
  46853. this.setValues(e)
  46854. }
  46855. ,
  46856. Ci.MeshPhongMaterial.prototype = Object.create(Ci.Material.prototype),
  46857. Ci.MeshPhongMaterial.prototype.constructor = Ci.MeshPhongMaterial,
  46858. Ci.MeshPhongMaterial.prototype.copy = function(e) {
  46859. return Ci.Material.prototype.copy.call(this, e),
  46860. this.color.copy(e.color),
  46861. this.specular.copy(e.specular),
  46862. this.shininess = e.shininess,
  46863. this.map = e.map,
  46864. this.lightMap = e.lightMap,
  46865. this.lightMapIntensity = e.lightMapIntensity,
  46866. this.aoMap = e.aoMap,
  46867. this.aoMapIntensity = e.aoMapIntensity,
  46868. this.emissive.copy(e.emissive),
  46869. this.emissiveMap = e.emissiveMap,
  46870. this.emissiveIntensity = e.emissiveIntensity,
  46871. this.bumpMap = e.bumpMap,
  46872. this.bumpScale = e.bumpScale,
  46873. this.normalMap = e.normalMap,
  46874. this.normalScale.copy(e.normalScale),
  46875. this.displacementMap = e.displacementMap,
  46876. this.displacementScale = e.displacementScale,
  46877. this.displacementBias = e.displacementBias,
  46878. this.specularMap = e.specularMap,
  46879. this.alphaMap = e.alphaMap,
  46880. this.envMap = e.envMap,
  46881. this.combine = e.combine,
  46882. this.reflectivity = e.reflectivity,
  46883. this.refractionRatio = e.refractionRatio,
  46884. this.fog = e.fog,
  46885. this.shading = e.shading,
  46886. this.wireframe = e.wireframe,
  46887. this.wireframeLinewidth = e.wireframeLinewidth,
  46888. this.wireframeLinecap = e.wireframeLinecap,
  46889. this.wireframeLinejoin = e.wireframeLinejoin,
  46890. this.vertexColors = e.vertexColors,
  46891. this.skinning = e.skinning,
  46892. this.morphTargets = e.morphTargets,
  46893. this.morphNormals = e.morphNormals,
  46894. this
  46895. }
  46896. ,
  46897. Ci.MeshStandardMaterial = function(e) {
  46898. Ci.Material.call(this),
  46899. this.type = "MeshStandardMaterial",
  46900. this.color = new Ci.Color(16777215),
  46901. this.roughness = .5,
  46902. this.metalness = .5,
  46903. this.map = null,
  46904. this.lightMap = null,
  46905. this.lightMapIntensity = 1,
  46906. this.aoMap = null,
  46907. this.aoMapIntensity = 1,
  46908. this.emissive = new Ci.Color(0),
  46909. this.emissiveIntensity = 1,
  46910. this.emissiveMap = null,
  46911. this.bumpMap = null,
  46912. this.bumpScale = 1,
  46913. this.normalMap = null,
  46914. this.normalScale = new Ci.Vector2(1,1),
  46915. this.displacementMap = null,
  46916. this.displacementScale = 1,
  46917. this.displacementBias = 0,
  46918. this.roughnessMap = null,
  46919. this.metalnessMap = null,
  46920. this.alphaMap = null,
  46921. this.envMap = null,
  46922. this.envMapIntensity = 1,
  46923. this.refractionRatio = .98,
  46924. this.fog = !0,
  46925. this.shading = Ci.SmoothShading,
  46926. this.blending = Ci.NormalBlending,
  46927. this.wireframe = !1,
  46928. this.wireframeLinewidth = 1,
  46929. this.wireframeLinecap = "round",
  46930. this.wireframeLinejoin = "round",
  46931. this.vertexColors = Ci.NoColors,
  46932. this.skinning = !1,
  46933. this.morphTargets = !1,
  46934. this.morphNormals = !1,
  46935. this.setValues(e)
  46936. }
  46937. ,
  46938. Ci.MeshStandardMaterial.prototype = Object.create(Ci.Material.prototype),
  46939. Ci.MeshStandardMaterial.prototype.constructor = Ci.MeshStandardMaterial,
  46940. Ci.MeshStandardMaterial.prototype.copy = function(e) {
  46941. return Ci.Material.prototype.copy.call(this, e),
  46942. this.color.copy(e.color),
  46943. this.roughness = e.roughness,
  46944. this.metalness = e.metalness,
  46945. this.map = e.map,
  46946. this.lightMap = e.lightMap,
  46947. this.lightMapIntensity = e.lightMapIntensity,
  46948. this.aoMap = e.aoMap,
  46949. this.aoMapIntensity = e.aoMapIntensity,
  46950. this.emissive.copy(e.emissive),
  46951. this.emissiveMap = e.emissiveMap,
  46952. this.emissiveIntensity = e.emissiveIntensity,
  46953. this.bumpMap = e.bumpMap,
  46954. this.bumpScale = e.bumpScale,
  46955. this.normalMap = e.normalMap,
  46956. this.normalScale.copy(e.normalScale),
  46957. this.displacementMap = e.displacementMap,
  46958. this.displacementScale = e.displacementScale,
  46959. this.displacementBias = e.displacementBias,
  46960. this.roughnessMap = e.roughnessMap,
  46961. this.metalnessMap = e.metalnessMap,
  46962. this.alphaMap = e.alphaMap,
  46963. this.envMap = e.envMap,
  46964. this.envMapIntensity = e.envMapIntensity,
  46965. this.refractionRatio = e.refractionRatio,
  46966. this.fog = e.fog,
  46967. this.shading = e.shading,
  46968. this.wireframe = e.wireframe,
  46969. this.wireframeLinewidth = e.wireframeLinewidth,
  46970. this.wireframeLinecap = e.wireframeLinecap,
  46971. this.wireframeLinejoin = e.wireframeLinejoin,
  46972. this.vertexColors = e.vertexColors,
  46973. this.skinning = e.skinning,
  46974. this.morphTargets = e.morphTargets,
  46975. this.morphNormals = e.morphNormals,
  46976. this
  46977. }
  46978. ,
  46979. Ci.MeshDepthMaterial = function(e) {
  46980. Ci.Material.call(this),
  46981. this.type = "MeshDepthMaterial",
  46982. this.morphTargets = !1,
  46983. this.wireframe = !1,
  46984. this.wireframeLinewidth = 1,
  46985. this.setValues(e)
  46986. }
  46987. ,
  46988. Ci.MeshDepthMaterial.prototype = Object.create(Ci.Material.prototype),
  46989. Ci.MeshDepthMaterial.prototype.constructor = Ci.MeshDepthMaterial,
  46990. Ci.MeshDepthMaterial.prototype.copy = function(e) {
  46991. return Ci.Material.prototype.copy.call(this, e),
  46992. this.wireframe = e.wireframe,
  46993. this.wireframeLinewidth = e.wireframeLinewidth,
  46994. this
  46995. }
  46996. ,
  46997. Ci.MeshNormalMaterial = function(e) {
  46998. Ci.Material.call(this, e),
  46999. this.type = "MeshNormalMaterial",
  47000. this.wireframe = !1,
  47001. this.wireframeLinewidth = 1,
  47002. this.morphTargets = !1,
  47003. this.setValues(e)
  47004. }
  47005. ,
  47006. Ci.MeshNormalMaterial.prototype = Object.create(Ci.Material.prototype),
  47007. Ci.MeshNormalMaterial.prototype.constructor = Ci.MeshNormalMaterial,
  47008. Ci.MeshNormalMaterial.prototype.copy = function(e) {
  47009. return Ci.Material.prototype.copy.call(this, e),
  47010. this.wireframe = e.wireframe,
  47011. this.wireframeLinewidth = e.wireframeLinewidth,
  47012. this
  47013. }
  47014. ,
  47015. Ci.MultiMaterial = function(e) {
  47016. this.uuid = Ci.Math.generateUUID(),
  47017. this.type = "MultiMaterial",
  47018. this.materials = e instanceof Array ? e : [],
  47019. this.visible = !0
  47020. }
  47021. ,
  47022. Ci.MultiMaterial.prototype = {
  47023. constructor: Ci.MultiMaterial,
  47024. toJSON: function(e) {
  47025. for (var t = {
  47026. metadata: {
  47027. version: 4.2,
  47028. type: "material",
  47029. generator: "MaterialExporter"
  47030. },
  47031. uuid: this.uuid,
  47032. type: this.type,
  47033. materials: []
  47034. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  47035. var o = i[n].toJSON(e);
  47036. delete o.metadata,
  47037. t.materials.push(o)
  47038. }
  47039. return t.visible = this.visible,
  47040. t
  47041. },
  47042. clone: function() {
  47043. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  47044. e.materials.push(this.materials[t].clone());
  47045. return e.visible = this.visible,
  47046. e
  47047. }
  47048. },
  47049. Ci.PointsMaterial = function(e) {
  47050. Ci.Material.call(this),
  47051. this.type = "PointsMaterial",
  47052. this.color = new Ci.Color(16777215),
  47053. this.map = null,
  47054. this.size = 1,
  47055. this.sizeAttenuation = !0,
  47056. this.blending = Ci.NormalBlending,
  47057. this.vertexColors = Ci.NoColors,
  47058. this.fog = !0,
  47059. this.setValues(e)
  47060. }
  47061. ,
  47062. Ci.PointsMaterial.prototype = Object.create(Ci.Material.prototype),
  47063. Ci.PointsMaterial.prototype.constructor = Ci.PointsMaterial,
  47064. Ci.PointsMaterial.prototype.copy = function(e) {
  47065. return Ci.Material.prototype.copy.call(this, e),
  47066. this.color.copy(e.color),
  47067. this.map = e.map,
  47068. this.size = e.size,
  47069. this.sizeAttenuation = e.sizeAttenuation,
  47070. this.vertexColors = e.vertexColors,
  47071. this.fog = e.fog,
  47072. this
  47073. }
  47074. ,
  47075. Ci.ShaderMaterial = function(e) {
  47076. Ci.Material.call(this),
  47077. this.type = "ShaderMaterial",
  47078. this.defines = {},
  47079. this.uniforms = {},
  47080. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  47081. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  47082. this.shading = Ci.SmoothShading,
  47083. this.linewidth = 1,
  47084. this.wireframe = !1,
  47085. this.wireframeLinewidth = 1,
  47086. this.fog = !1,
  47087. this.lights = !1,
  47088. this.vertexColors = Ci.NoColors,
  47089. this.skinning = !1,
  47090. this.morphTargets = !1,
  47091. this.morphNormals = !1,
  47092. this.extensions = {
  47093. derivatives: !1,
  47094. fragDepth: !1,
  47095. drawBuffers: !1,
  47096. shaderTextureLOD: !1
  47097. },
  47098. this.defaultAttributeValues = {
  47099. color: [1, 1, 1],
  47100. uv: [0, 0],
  47101. uv2: [0, 0]
  47102. },
  47103. (this.index0AttributeName = void 0) !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  47104. this.setValues(e))
  47105. }
  47106. ,
  47107. Ci.ShaderMaterial.prototype = Object.create(Ci.Material.prototype),
  47108. Ci.ShaderMaterial.prototype.constructor = Ci.ShaderMaterial,
  47109. Ci.ShaderMaterial.prototype.copy = function(e) {
  47110. return Ci.Material.prototype.copy.call(this, e),
  47111. this.fragmentShader = e.fragmentShader,
  47112. this.vertexShader = e.vertexShader,
  47113. this.uniforms = Ci.UniformsUtils.clone(e.uniforms),
  47114. this.defines = e.defines,
  47115. this.shading = e.shading,
  47116. this.wireframe = e.wireframe,
  47117. this.wireframeLinewidth = e.wireframeLinewidth,
  47118. this.fog = e.fog,
  47119. this.lights = e.lights,
  47120. this.vertexColors = e.vertexColors,
  47121. this.skinning = e.skinning,
  47122. this.morphTargets = e.morphTargets,
  47123. this.morphNormals = e.morphNormals,
  47124. this.extensions = e.extensions,
  47125. this
  47126. }
  47127. ,
  47128. Ci.ShaderMaterial.prototype.toJSON = function(e) {
  47129. var t = Ci.Material.prototype.toJSON.call(this, e);
  47130. return t.uniforms = this.uniforms,
  47131. t.vertexShader = this.vertexShader,
  47132. t.fragmentShader = this.fragmentShader,
  47133. t
  47134. }
  47135. ,
  47136. Ci.RawShaderMaterial = function(e) {
  47137. Ci.ShaderMaterial.call(this, e),
  47138. this.type = "RawShaderMaterial"
  47139. }
  47140. ,
  47141. Ci.RawShaderMaterial.prototype = Object.create(Ci.ShaderMaterial.prototype),
  47142. Ci.RawShaderMaterial.prototype.constructor = Ci.RawShaderMaterial,
  47143. Ci.SpriteMaterial = function(e) {
  47144. Ci.Material.call(this),
  47145. this.type = "SpriteMaterial",
  47146. this.color = new Ci.Color(16777215),
  47147. this.map = null,
  47148. this.rotation = 0,
  47149. this.fog = !1,
  47150. this.setValues(e)
  47151. }
  47152. ,
  47153. Ci.SpriteMaterial.prototype = Object.create(Ci.Material.prototype),
  47154. Ci.SpriteMaterial.prototype.constructor = Ci.SpriteMaterial,
  47155. Ci.SpriteMaterial.prototype.copy = function(e) {
  47156. return Ci.Material.prototype.copy.call(this, e),
  47157. this.color.copy(e.color),
  47158. this.map = e.map,
  47159. this.rotation = e.rotation,
  47160. this.fog = e.fog,
  47161. this
  47162. }
  47163. ,
  47164. Ci.Texture = function(e, t, i, n, r, o, a, s, l) {
  47165. Object.defineProperty(this, "id", {
  47166. value: Ci.TextureIdCount++
  47167. }),
  47168. this.uuid = Ci.Math.generateUUID(),
  47169. this.name = "",
  47170. this.sourceFile = "",
  47171. this.image = void 0 !== e ? e : Ci.Texture.DEFAULT_IMAGE,
  47172. this.mipmaps = [],
  47173. this.mapping = void 0 !== t ? t : Ci.Texture.DEFAULT_MAPPING,
  47174. this.wrapS = void 0 !== i ? i : Ci.ClampToEdgeWrapping,
  47175. this.wrapT = void 0 !== n ? n : Ci.ClampToEdgeWrapping,
  47176. this.magFilter = void 0 !== r ? r : Ci.LinearFilter,
  47177. this.minFilter = void 0 !== o ? o : Ci.LinearMipMapLinearFilter,
  47178. this.anisotropy = void 0 !== l ? l : 1,
  47179. this.format = void 0 !== a ? a : Ci.RGBAFormat,
  47180. this.type = void 0 !== s ? s : Ci.UnsignedByteType,
  47181. this.offset = new Ci.Vector2(0,0),
  47182. this.repeat = new Ci.Vector2(1,1),
  47183. this.generateMipmaps = !0,
  47184. this.premultiplyAlpha = !1,
  47185. this.flipY = !0,
  47186. this.unpackAlignment = 4,
  47187. this.encoding = Ci.LinearEncoding,
  47188. this.version = 0,
  47189. this.onUpdate = null
  47190. }
  47191. ,
  47192. Ci.Texture.DEFAULT_IMAGE = void 0,
  47193. Ci.Texture.DEFAULT_MAPPING = Ci.UVMapping,
  47194. Ci.Texture.prototype = {
  47195. constructor: Ci.Texture,
  47196. set needsUpdate(e) {
  47197. !0 === e && this.version++
  47198. },
  47199. clone: function() {
  47200. return (new this.constructor).copy(this)
  47201. },
  47202. copy: function(e) {
  47203. return this.image = e.image,
  47204. this.mipmaps = e.mipmaps.slice(0),
  47205. this.mapping = e.mapping,
  47206. this.wrapS = e.wrapS,
  47207. this.wrapT = e.wrapT,
  47208. this.magFilter = e.magFilter,
  47209. this.minFilter = e.minFilter,
  47210. this.anisotropy = e.anisotropy,
  47211. this.format = e.format,
  47212. this.type = e.type,
  47213. this.offset.copy(e.offset),
  47214. this.repeat.copy(e.repeat),
  47215. this.generateMipmaps = e.generateMipmaps,
  47216. this.premultiplyAlpha = e.premultiplyAlpha,
  47217. this.flipY = e.flipY,
  47218. this.unpackAlignment = e.unpackAlignment,
  47219. this.encoding = e.encoding,
  47220. this
  47221. },
  47222. toJSON: function(e) {
  47223. if (void 0 !== e.textures[this.uuid])
  47224. return e.textures[this.uuid];
  47225. var t, i, n = {
  47226. metadata: {
  47227. version: 4.4,
  47228. type: "Texture",
  47229. generator: "Texture.toJSON"
  47230. },
  47231. uuid: this.uuid,
  47232. name: this.name,
  47233. mapping: this.mapping,
  47234. repeat: [this.repeat.x, this.repeat.y],
  47235. offset: [this.offset.x, this.offset.y],
  47236. wrap: [this.wrapS, this.wrapT],
  47237. minFilter: this.minFilter,
  47238. magFilter: this.magFilter,
  47239. anisotropy: this.anisotropy
  47240. };
  47241. if (void 0 !== this.image) {
  47242. var r = this.image;
  47243. void 0 === r.uuid && (r.uuid = Ci.Math.generateUUID()),
  47244. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  47245. uuid: r.uuid,
  47246. url: (t = r,
  47247. void 0 !== t.toDataURL ? i = t : ((i = document.createElement("canvas")).width = t.width,
  47248. i.height = t.height,
  47249. i.getContext("2d").drawImage(t, 0, 0, t.width, t.height)),
  47250. 2048 < i.width || 2048 < i.height ? i.toDataURL("image/jpeg", .6) : i.toDataURL("image/png"))
  47251. }),
  47252. n.image = r.uuid
  47253. }
  47254. return e.textures[this.uuid] = n
  47255. },
  47256. dispose: function() {
  47257. this.dispatchEvent({
  47258. type: "dispose"
  47259. })
  47260. },
  47261. transformUv: function(e) {
  47262. if (this.mapping === Ci.UVMapping) {
  47263. if (e.multiply(this.repeat),
  47264. e.add(this.offset),
  47265. e.x < 0 || 1 < e.x)
  47266. switch (this.wrapS) {
  47267. case Ci.RepeatWrapping:
  47268. e.x = e.x - Math.floor(e.x);
  47269. break;
  47270. case Ci.ClampToEdgeWrapping:
  47271. e.x = e.x < 0 ? 0 : 1;
  47272. break;
  47273. case Ci.MirroredRepeatWrapping:
  47274. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  47275. }
  47276. if (e.y < 0 || 1 < e.y)
  47277. switch (this.wrapT) {
  47278. case Ci.RepeatWrapping:
  47279. e.y = e.y - Math.floor(e.y);
  47280. break;
  47281. case Ci.ClampToEdgeWrapping:
  47282. e.y = e.y < 0 ? 0 : 1;
  47283. break;
  47284. case Ci.MirroredRepeatWrapping:
  47285. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  47286. }
  47287. this.flipY && (e.y = 1 - e.y)
  47288. }
  47289. }
  47290. },
  47291. Ci.EventDispatcher.prototype.apply(Ci.Texture.prototype),
  47292. Ci.TextureIdCount = 0,
  47293. Ci.CanvasTexture = function(e, t, i, n, r, o, a, s, l) {
  47294. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  47295. this.needsUpdate = !0
  47296. }
  47297. ,
  47298. Ci.CanvasTexture.prototype = Object.create(Ci.Texture.prototype),
  47299. Ci.CanvasTexture.prototype.constructor = Ci.CanvasTexture,
  47300. Ci.CubeTexture = function(e, t, i, n, r, o, a, s, l) {
  47301. e = void 0 !== e ? e : [],
  47302. t = void 0 !== t ? t : Ci.CubeReflectionMapping,
  47303. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  47304. this.flipY = !1
  47305. }
  47306. ,
  47307. Ci.CubeTexture.prototype = Object.create(Ci.Texture.prototype),
  47308. Ci.CubeTexture.prototype.constructor = Ci.CubeTexture,
  47309. Object.defineProperty(Ci.CubeTexture.prototype, "images", {
  47310. get: function() {
  47311. return this.image
  47312. },
  47313. set: function(e) {
  47314. this.image = e
  47315. }
  47316. }),
  47317. Ci.CompressedTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  47318. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  47319. this.image = {
  47320. width: t,
  47321. height: i
  47322. },
  47323. this.mipmaps = e,
  47324. this.flipY = !1,
  47325. this.generateMipmaps = !1
  47326. }
  47327. ,
  47328. Ci.CompressedTexture.prototype = Object.create(Ci.Texture.prototype),
  47329. Ci.CompressedTexture.prototype.constructor = Ci.CompressedTexture,
  47330. Ci.DataTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  47331. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  47332. this.image = {
  47333. data: e,
  47334. width: t,
  47335. height: i
  47336. },
  47337. this.magFilter = void 0 !== l ? l : Ci.NearestFilter,
  47338. this.minFilter = void 0 !== c ? c : Ci.NearestFilter,
  47339. this.flipY = !1,
  47340. this.generateMipmaps = !1
  47341. }
  47342. ,
  47343. Ci.DataTexture.prototype = Object.create(Ci.Texture.prototype),
  47344. Ci.DataTexture.prototype.constructor = Ci.DataTexture,
  47345. Ci.VideoTexture = function(t, e, i, n, r, o, a, s, l) {
  47346. Ci.Texture.call(this, t, e, i, n, r, o, a, s, l),
  47347. this.generateMipmaps = !1;
  47348. var c = this;
  47349. !function e() {
  47350. requestAnimationFrame(e),
  47351. !t.paused && t.readyState === t.HAVE_ENOUGH_DATA && (c.needsUpdate = !0)
  47352. }()
  47353. }
  47354. ,
  47355. Ci.VideoTexture.prototype = Object.create(Ci.Texture.prototype),
  47356. Ci.VideoTexture.prototype.constructor = Ci.VideoTexture,
  47357. Ci.Group = function() {
  47358. Ci.Object3D.call(this),
  47359. this.type = "Group"
  47360. }
  47361. ,
  47362. Ci.Group.prototype = Object.create(Ci.Object3D.prototype),
  47363. Ci.Group.prototype.constructor = Ci.Group,
  47364. Ci.Points = function(e, t) {
  47365. Ci.Object3D.call(this),
  47366. this.type = "Points",
  47367. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47368. this.material = void 0 !== t ? t : new Ci.PointsMaterial({
  47369. color: 16777215 * Math.random()
  47370. })
  47371. }
  47372. ,
  47373. Ci.Points.prototype = Object.create(Ci.Object3D.prototype),
  47374. Ci.Points.prototype.constructor = Ci.Points,
  47375. Ci.Points.prototype.raycast = (Wt = new Ci.Matrix4,
  47376. jt = new Ci.Ray,
  47377. Yt = new Ci.Sphere,
  47378. function(o, a) {
  47379. function e(e, t) {
  47380. var i = jt.distanceSqToPoint(e);
  47381. if (i < c) {
  47382. var n = jt.closestPointToPoint(e);
  47383. n.applyMatrix4(l);
  47384. var r = o.ray.origin.distanceTo(n);
  47385. if (r < o.near || r > o.far)
  47386. return;
  47387. a.push({
  47388. distance: r,
  47389. distanceToRay: Math.sqrt(i),
  47390. point: n.clone(),
  47391. index: t,
  47392. face: null,
  47393. object: s
  47394. })
  47395. }
  47396. }
  47397. var s = this
  47398. , t = this.geometry
  47399. , l = this.matrixWorld
  47400. , i = o.params.Points.threshold;
  47401. if (null === t.boundingSphere && t.computeBoundingSphere(),
  47402. Yt.copy(t.boundingSphere),
  47403. Yt.applyMatrix4(l),
  47404. !1 !== o.ray.intersectsSphere(Yt)) {
  47405. Wt.getInverse(l),
  47406. jt.copy(o.ray).applyMatrix4(Wt);
  47407. var n = i / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  47408. , c = n * n
  47409. , r = new Ci.Vector3;
  47410. if (t instanceof Ci.BufferGeometry) {
  47411. var h = t.index
  47412. , u = t.attributes.position.array;
  47413. if (null !== h)
  47414. for (var d = h.array, p = 0, f = d.length; p < f; p++) {
  47415. var g = d[p];
  47416. r.fromArray(u, 3 * g),
  47417. e(r, g)
  47418. }
  47419. else {
  47420. p = 0;
  47421. for (var m = u.length / 3; p < m; p++)
  47422. r.fromArray(u, 3 * p),
  47423. e(r, p)
  47424. }
  47425. } else {
  47426. var v = t.vertices;
  47427. for (p = 0,
  47428. m = v.length; p < m; p++)
  47429. e(v[p], p)
  47430. }
  47431. }
  47432. }
  47433. ),
  47434. Ci.Points.prototype.clone = function() {
  47435. return new this.constructor(this.geometry,this.material).copy(this)
  47436. }
  47437. ,
  47438. Ci.Line = function(e, t, i) {
  47439. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  47440. new Ci.LineSegments(e,t)) : (Ci.Object3D.call(this),
  47441. this.type = "Line",
  47442. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47443. void (this.material = void 0 !== t ? t : new Ci.LineBasicMaterial({
  47444. color: 16777215 * Math.random()
  47445. })))
  47446. }
  47447. ,
  47448. Ci.Line.prototype = Object.create(Ci.Object3D.prototype),
  47449. Ci.Line.prototype.constructor = Ci.Line,
  47450. Ci.Line.prototype.raycast = (Ht = new Ci.Matrix4,
  47451. zt = new Ci.Ray,
  47452. Gt = new Ci.Sphere,
  47453. function(e, t) {
  47454. var i = e.linePrecision
  47455. , n = i * i
  47456. , r = this.geometry
  47457. , o = this.matrixWorld;
  47458. if (null === r.boundingSphere && r.computeBoundingSphere(),
  47459. Gt.copy(r.boundingSphere),
  47460. Gt.applyMatrix4(o),
  47461. !1 !== e.ray.intersectsSphere(Gt)) {
  47462. Ht.getInverse(o),
  47463. zt.copy(e.ray).applyMatrix4(Ht);
  47464. var a = new Ci.Vector3
  47465. , s = new Ci.Vector3
  47466. , l = new Ci.Vector3
  47467. , c = new Ci.Vector3
  47468. , h = this instanceof Ci.LineSegments ? 2 : 1;
  47469. if (r instanceof Ci.BufferGeometry) {
  47470. var u = r.index
  47471. , d = r.attributes.position.array;
  47472. if (null !== u)
  47473. for (var p = u.array, f = 0, g = p.length - 1; f < g; f += h) {
  47474. var m = p[f]
  47475. , v = p[f + 1];
  47476. a.fromArray(d, 3 * m),
  47477. s.fromArray(d, 3 * v),
  47478. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47479. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47480. distance: C,
  47481. point: l.clone().applyMatrix4(this.matrixWorld),
  47482. index: f,
  47483. face: null,
  47484. faceIndex: null,
  47485. object: this
  47486. }))
  47487. }
  47488. else
  47489. for (f = 0,
  47490. g = d.length / 3 - 1; f < g; f += h)
  47491. a.fromArray(d, 3 * f),
  47492. s.fromArray(d, 3 * f + 3),
  47493. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47494. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47495. distance: C,
  47496. point: l.clone().applyMatrix4(this.matrixWorld),
  47497. index: f,
  47498. face: null,
  47499. faceIndex: null,
  47500. object: this
  47501. }))
  47502. } else if (r instanceof Ci.Geometry) {
  47503. var y = r.vertices
  47504. , A = y.length;
  47505. for (f = 0; f < A - 1; f += h) {
  47506. var C;
  47507. n < zt.distanceSqToSegment(y[f], y[f + 1], c, l) || (c.applyMatrix4(this.matrixWorld),
  47508. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47509. distance: C,
  47510. point: l.clone().applyMatrix4(this.matrixWorld),
  47511. index: f,
  47512. face: null,
  47513. faceIndex: null,
  47514. object: this
  47515. }))
  47516. }
  47517. }
  47518. }
  47519. }
  47520. ),
  47521. Ci.Line.prototype.clone = function() {
  47522. return new this.constructor(this.geometry,this.material).copy(this)
  47523. }
  47524. ,
  47525. Ci.LineStrip = 0,
  47526. Ci.LinePieces = 1,
  47527. Ci.LineSegments = function(e, t) {
  47528. Ci.Line.call(this, e, t),
  47529. this.type = "LineSegments"
  47530. }
  47531. ,
  47532. Ci.LineSegments.prototype = Object.create(Ci.Line.prototype),
  47533. Ci.LineSegments.prototype.constructor = Ci.LineSegments,
  47534. Ci.Mesh = function(e, t) {
  47535. Ci.Object3D.call(this),
  47536. this.type = "Mesh",
  47537. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47538. this.material = void 0 !== t ? t : new Ci.MeshBasicMaterial({
  47539. color: 16777215 * Math.random()
  47540. }),
  47541. this.drawMode = Ci.TrianglesDrawMode,
  47542. this.updateMorphTargets()
  47543. }
  47544. ,
  47545. Ci.Mesh.prototype = Object.create(Ci.Object3D.prototype),
  47546. Ci.Mesh.prototype.constructor = Ci.Mesh,
  47547. Ci.Mesh.prototype.setDrawMode = function(e) {
  47548. this.drawMode = e
  47549. }
  47550. ,
  47551. Ci.Mesh.prototype.updateMorphTargets = function() {
  47552. if (void 0 !== this.geometry.morphTargets && 0 < this.geometry.morphTargets.length) {
  47553. this.morphTargetBase = -1,
  47554. this.morphTargetInfluences = [],
  47555. this.morphTargetDictionary = {};
  47556. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  47557. this.morphTargetInfluences.push(0),
  47558. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  47559. }
  47560. }
  47561. ,
  47562. Ci.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  47563. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  47564. 0)
  47565. }
  47566. ,
  47567. Ci.Mesh.prototype.raycast = (Tt = new Ci.Matrix4,
  47568. xt = new Ci.Ray,
  47569. St = new Ci.Sphere,
  47570. Mt = new Ci.Vector3,
  47571. Rt = new Ci.Vector3,
  47572. Pt = new Ci.Vector3,
  47573. Ot = new Ci.Vector3,
  47574. Lt = new Ci.Vector3,
  47575. Dt = new Ci.Vector3,
  47576. Nt = new Ci.Vector2,
  47577. Ft = new Ci.Vector2,
  47578. Bt = new Ci.Vector2,
  47579. Vt = new Ci.Vector3,
  47580. kt = new Ci.Vector3,
  47581. Ut = new Ci.Vector3,
  47582. function(e, t) {
  47583. var i, n, r = this.geometry, o = this.material, a = this.matrixWorld;
  47584. if (void 0 !== o && (null === r.boundingSphere && r.computeBoundingSphere(),
  47585. St.copy(r.boundingSphere),
  47586. St.applyMatrix4(a),
  47587. !1 !== e.ray.intersectsSphere(St) && (Tt.getInverse(a),
  47588. xt.copy(e.ray).applyMatrix4(Tt),
  47589. null === r.boundingBox || !1 !== xt.intersectsBox(r.boundingBox))))
  47590. if (r instanceof Ci.BufferGeometry) {
  47591. var s, l, c, h = r.index, u = r.attributes, d = u.position.array;
  47592. if (void 0 !== u.uv && (i = u.uv.array),
  47593. null !== h)
  47594. for (var p = h.array, f = 0, g = p.length; f < g; f += 3)
  47595. s = p[f],
  47596. l = p[f + 1],
  47597. c = p[f + 2],
  47598. (n = Ti(this, e, xt, d, i, s, l, c)) && (n.faceIndex = Math.floor(f / 3),
  47599. t.push(n));
  47600. else
  47601. for (f = 0,
  47602. g = d.length; f < g; f += 9)
  47603. (n = Ti(this, e, xt, d, i, s = f / 3, l = s + 1, c = s + 2)) && (n.index = s,
  47604. t.push(n))
  47605. } else if (r instanceof Ci.Geometry) {
  47606. var m, v, y, A = o instanceof Ci.MultiMaterial, C = 1 == A ? o.materials : null, I = r.vertices, E = r.faces, _ = r.faceVertexUvs[0];
  47607. 0 < _.length && (i = _);
  47608. for (var b = 0, w = E.length; b < w; b++) {
  47609. var T = E[b]
  47610. , x = 1 == A ? C[T.materialIndex] : o;
  47611. if (void 0 !== x) {
  47612. if (m = I[T.a],
  47613. v = I[T.b],
  47614. y = I[T.c],
  47615. !0 === x.morphTargets) {
  47616. var S = r.morphTargets
  47617. , M = this.morphTargetInfluences;
  47618. Mt.set(0, 0, 0),
  47619. Rt.set(0, 0, 0),
  47620. Pt.set(0, 0, 0);
  47621. for (var R = 0, P = S.length; R < P; R++) {
  47622. var O = M[R];
  47623. if (0 !== O) {
  47624. var L = S[R].vertices;
  47625. Mt.addScaledVector(Ot.subVectors(L[T.a], m), O),
  47626. Rt.addScaledVector(Lt.subVectors(L[T.b], v), O),
  47627. Pt.addScaledVector(Dt.subVectors(L[T.c], y), O)
  47628. }
  47629. }
  47630. Mt.add(m),
  47631. Rt.add(v),
  47632. Pt.add(y),
  47633. m = Mt,
  47634. v = Rt,
  47635. y = Pt
  47636. }
  47637. if (n = wi(this, e, xt, m, v, y, kt)) {
  47638. if (i) {
  47639. var D = i[b];
  47640. Nt.copy(D[0]),
  47641. Ft.copy(D[1]),
  47642. Bt.copy(D[2]),
  47643. n.uv = bi(kt, m, v, y, Nt, Ft, Bt)
  47644. }
  47645. n.face = T,
  47646. n.faceIndex = b,
  47647. t.push(n)
  47648. }
  47649. }
  47650. }
  47651. }
  47652. }
  47653. ),
  47654. Ci.Mesh.prototype.clone = function() {
  47655. return new this.constructor(this.geometry,this.material).copy(this)
  47656. }
  47657. ,
  47658. Ci.Bone = function(e) {
  47659. Ci.Object3D.call(this),
  47660. this.type = "Bone",
  47661. this.skin = e
  47662. }
  47663. ,
  47664. Ci.Bone.prototype = Object.create(Ci.Object3D.prototype),
  47665. Ci.Bone.prototype.constructor = Ci.Bone,
  47666. Ci.Bone.prototype.copy = function(e) {
  47667. return Ci.Object3D.prototype.copy.call(this, e),
  47668. this.skin = e.skin,
  47669. this
  47670. }
  47671. ,
  47672. Ci.Skeleton = function(e, t, i) {
  47673. if (this.useVertexTexture = void 0 === i || i,
  47674. this.identityMatrix = new Ci.Matrix4,
  47675. e = e || [],
  47676. this.bones = e.slice(0),
  47677. this.useVertexTexture) {
  47678. var n = Math.sqrt(4 * this.bones.length);
  47679. n = Ci.Math.nextPowerOfTwo(Math.ceil(n)),
  47680. n = Math.max(n, 4),
  47681. this.boneTextureWidth = n,
  47682. this.boneTextureHeight = n,
  47683. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  47684. this.boneTexture = new Ci.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,Ci.RGBAFormat,Ci.FloatType)
  47685. } else
  47686. this.boneMatrices = new Float32Array(16 * this.bones.length);
  47687. if (void 0 === t)
  47688. this.calculateInverses();
  47689. else if (this.bones.length === t.length)
  47690. this.boneInverses = t.slice(0);
  47691. else {
  47692. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  47693. this.boneInverses = [];
  47694. for (var r = 0, o = this.bones.length; r < o; r++)
  47695. this.boneInverses.push(new Ci.Matrix4)
  47696. }
  47697. }
  47698. ,
  47699. Ci.Skeleton.prototype.calculateInverses = function() {
  47700. this.boneInverses = [];
  47701. for (var e = 0, t = this.bones.length; e < t; e++) {
  47702. var i = new Ci.Matrix4;
  47703. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  47704. this.boneInverses.push(i)
  47705. }
  47706. }
  47707. ,
  47708. Ci.Skeleton.prototype.pose = function() {
  47709. for (var e, t = 0, i = this.bones.length; t < i; t++)
  47710. (e = this.bones[t]) && e.matrixWorld.getInverse(this.boneInverses[t]);
  47711. for (t = 0,
  47712. i = this.bones.length; t < i; t++)
  47713. (e = this.bones[t]) && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  47714. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  47715. e.matrix.decompose(e.position, e.quaternion, e.scale))
  47716. }
  47717. ,
  47718. Ci.Skeleton.prototype.update = (wt = new Ci.Matrix4,
  47719. function() {
  47720. for (var e = 0, t = this.bones.length; e < t; e++) {
  47721. var i = this.bones[e] ? this.bones[e].matrixWorld : this.identityMatrix;
  47722. wt.multiplyMatrices(i, this.boneInverses[e]),
  47723. wt.flattenToArrayOffset(this.boneMatrices, 16 * e)
  47724. }
  47725. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  47726. }
  47727. ),
  47728. Ci.Skeleton.prototype.clone = function() {
  47729. return new Ci.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  47730. }
  47731. ,
  47732. Ci.SkinnedMesh = function(e, t, i) {
  47733. Ci.Mesh.call(this, e, t),
  47734. this.type = "SkinnedMesh",
  47735. this.bindMode = "attached",
  47736. this.bindMatrix = new Ci.Matrix4,
  47737. this.bindMatrixInverse = new Ci.Matrix4;
  47738. var n = [];
  47739. if (this.geometry && void 0 !== this.geometry.bones) {
  47740. for (var r, o, a = 0, s = this.geometry.bones.length; a < s; ++a)
  47741. o = this.geometry.bones[a],
  47742. r = new Ci.Bone(this),
  47743. n.push(r),
  47744. r.name = o.name,
  47745. r.position.fromArray(o.pos),
  47746. r.quaternion.fromArray(o.rotq),
  47747. void 0 !== o.scl && r.scale.fromArray(o.scl);
  47748. for (a = 0,
  47749. s = this.geometry.bones.length; a < s; ++a)
  47750. -1 !== (o = this.geometry.bones[a]).parent && null !== o.parent ? n[o.parent].add(n[a]) : this.add(n[a])
  47751. }
  47752. this.normalizeSkinWeights(),
  47753. this.updateMatrixWorld(!0),
  47754. this.bind(new Ci.Skeleton(n,void 0,i), this.matrixWorld)
  47755. }
  47756. ,
  47757. Ci.SkinnedMesh.prototype = Object.create(Ci.Mesh.prototype),
  47758. Ci.SkinnedMesh.prototype.constructor = Ci.SkinnedMesh,
  47759. Ci.SkinnedMesh.prototype.bind = function(e, t) {
  47760. this.skeleton = e,
  47761. void 0 === t && (this.updateMatrixWorld(!0),
  47762. this.skeleton.calculateInverses(),
  47763. t = this.matrixWorld),
  47764. this.bindMatrix.copy(t),
  47765. this.bindMatrixInverse.getInverse(t)
  47766. }
  47767. ,
  47768. Ci.SkinnedMesh.prototype.pose = function() {
  47769. this.skeleton.pose()
  47770. }
  47771. ,
  47772. Ci.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  47773. if (this.geometry instanceof Ci.Geometry)
  47774. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  47775. var t = this.geometry.skinWeights[e];
  47776. (r = 1 / t.lengthManhattan()) !== 1 / 0 ? t.multiplyScalar(r) : t.set(1, 0, 0, 0)
  47777. }
  47778. else if (this.geometry instanceof Ci.BufferGeometry) {
  47779. var i = new Ci.Vector4
  47780. , n = this.geometry.attributes.skinWeight;
  47781. for (e = 0; e < n.count; e++) {
  47782. var r;
  47783. i.x = n.getX(e),
  47784. i.y = n.getY(e),
  47785. i.z = n.getZ(e),
  47786. i.w = n.getW(e),
  47787. (r = 1 / i.lengthManhattan()) !== 1 / 0 ? i.multiplyScalar(r) : i.set(1, 0, 0, 0),
  47788. n.setXYZW(e, i.x, i.y, i.z, i.w)
  47789. }
  47790. }
  47791. }
  47792. ,
  47793. Ci.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  47794. Ci.Mesh.prototype.updateMatrixWorld.call(this, !0),
  47795. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  47796. }
  47797. ,
  47798. Ci.SkinnedMesh.prototype.clone = function() {
  47799. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  47800. }
  47801. ,
  47802. Ci.LOD = function() {
  47803. Ci.Object3D.call(this),
  47804. this.type = "LOD",
  47805. Object.defineProperties(this, {
  47806. levels: {
  47807. enumerable: !0,
  47808. value: []
  47809. },
  47810. objects: {
  47811. get: function() {
  47812. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  47813. this.levels
  47814. }
  47815. }
  47816. })
  47817. }
  47818. ,
  47819. Ci.LOD.prototype = Object.create(Ci.Object3D.prototype),
  47820. Ci.LOD.prototype.constructor = Ci.LOD,
  47821. Ci.LOD.prototype.addLevel = function(e, t) {
  47822. void 0 === t && (t = 0),
  47823. t = Math.abs(t);
  47824. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  47825. ;
  47826. i.splice(n, 0, {
  47827. distance: t,
  47828. object: e
  47829. }),
  47830. this.add(e)
  47831. }
  47832. ,
  47833. Ci.LOD.prototype.getObjectForDistance = function(e) {
  47834. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  47835. ;
  47836. return t[i - 1].object
  47837. }
  47838. ,
  47839. Ci.LOD.prototype.raycast = (bt = new Ci.Vector3,
  47840. function(e, t) {
  47841. bt.setFromMatrixPosition(this.matrixWorld);
  47842. var i = e.ray.origin.distanceTo(bt);
  47843. this.getObjectForDistance(i).raycast(e, t)
  47844. }
  47845. ),
  47846. Ci.LOD.prototype.update = (Et = new Ci.Vector3,
  47847. _t = new Ci.Vector3,
  47848. function(e) {
  47849. var t = this.levels;
  47850. if (1 < t.length) {
  47851. Et.setFromMatrixPosition(e.matrixWorld),
  47852. _t.setFromMatrixPosition(this.matrixWorld);
  47853. var i = Et.distanceTo(_t);
  47854. t[0].object.visible = !0;
  47855. for (var n = 1, r = t.length; n < r && i >= t[n].distance; n++)
  47856. t[n - 1].object.visible = !1,
  47857. t[n].object.visible = !0;
  47858. for (; n < r; n++)
  47859. t[n].object.visible = !1
  47860. }
  47861. }
  47862. ),
  47863. Ci.LOD.prototype.copy = function(e) {
  47864. Ci.Object3D.prototype.copy.call(this, e, !1);
  47865. for (var t = e.levels, i = 0, n = t.length; i < n; i++) {
  47866. var r = t[i];
  47867. this.addLevel(r.object.clone(), r.distance)
  47868. }
  47869. return this
  47870. }
  47871. ,
  47872. Ci.LOD.prototype.toJSON = function(e) {
  47873. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  47874. t.object.levels = [];
  47875. for (var i = this.levels, n = 0, r = i.length; n < r; n++) {
  47876. var o = i[n];
  47877. t.object.levels.push({
  47878. object: o.object.uuid,
  47879. distance: o.distance
  47880. })
  47881. }
  47882. return t
  47883. }
  47884. ,
  47885. Ci.Sprite = (yt = new Uint16Array([0, 1, 2, 0, 2, 3]),
  47886. At = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0]),
  47887. Ct = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  47888. (It = new Ci.BufferGeometry).setIndex(new Ci.BufferAttribute(yt,1)),
  47889. It.addAttribute("position", new Ci.BufferAttribute(At,3)),
  47890. It.addAttribute("uv", new Ci.BufferAttribute(Ct,2)),
  47891. function(e) {
  47892. Ci.Object3D.call(this),
  47893. this.type = "Sprite",
  47894. this.geometry = It,
  47895. this.material = void 0 !== e ? e : new Ci.SpriteMaterial
  47896. }
  47897. ),
  47898. Ci.Sprite.prototype = Object.create(Ci.Object3D.prototype),
  47899. Ci.Sprite.prototype.constructor = Ci.Sprite,
  47900. Ci.Sprite.prototype.raycast = (vt = new Ci.Vector3,
  47901. function(e, t) {
  47902. vt.setFromMatrixPosition(this.matrixWorld);
  47903. var i = e.ray.distanceSqToPoint(vt);
  47904. this.scale.x * this.scale.y < i || t.push({
  47905. distance: Math.sqrt(i),
  47906. point: this.position,
  47907. face: null,
  47908. object: this
  47909. })
  47910. }
  47911. ),
  47912. Ci.Sprite.prototype.clone = function() {
  47913. return new this.constructor(this.material).copy(this)
  47914. }
  47915. ,
  47916. Ci.Particle = Ci.Sprite,
  47917. Ci.LensFlare = function(e, t, i, n, r) {
  47918. Ci.Object3D.call(this),
  47919. this.lensFlares = [],
  47920. this.positionScreen = new Ci.Vector3,
  47921. (this.customUpdateCallback = void 0) !== e && this.add(e, t, i, n, r)
  47922. }
  47923. ,
  47924. Ci.LensFlare.prototype = Object.create(Ci.Object3D.prototype),
  47925. Ci.LensFlare.prototype.constructor = Ci.LensFlare,
  47926. Ci.LensFlare.prototype.add = function(e, t, i, n, r, o) {
  47927. void 0 === t && (t = -1),
  47928. void 0 === i && (i = 0),
  47929. void 0 === o && (o = 1),
  47930. void 0 === r && (r = new Ci.Color(16777215)),
  47931. void 0 === n && (n = Ci.NormalBlending),
  47932. i = Math.min(i, Math.max(0, i)),
  47933. this.lensFlares.push({
  47934. texture: e,
  47935. size: t,
  47936. distance: i,
  47937. x: 0,
  47938. y: 0,
  47939. z: 0,
  47940. scale: 1,
  47941. rotation: 0,
  47942. opacity: o,
  47943. color: r,
  47944. blending: n
  47945. })
  47946. }
  47947. ,
  47948. Ci.LensFlare.prototype.updateLensFlares = function() {
  47949. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  47950. for (e = 0; e < i; e++)
  47951. (t = this.lensFlares[e]).x = this.positionScreen.x + n * t.distance,
  47952. t.y = this.positionScreen.y + r * t.distance,
  47953. t.wantedRotation = t.x * Math.PI * .25,
  47954. t.rotation += .25 * (t.wantedRotation - t.rotation)
  47955. }
  47956. ,
  47957. Ci.LensFlare.prototype.copy = function(e) {
  47958. Ci.Object3D.prototype.copy.call(this, e),
  47959. this.positionScreen.copy(e.positionScreen),
  47960. this.customUpdateCallback = e.customUpdateCallback;
  47961. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  47962. this.lensFlares.push(e.lensFlares[t]);
  47963. return this
  47964. }
  47965. ,
  47966. Ci.Scene = function() {
  47967. Ci.Object3D.call(this),
  47968. this.type = "Scene",
  47969. this.fog = null,
  47970. this.overrideMaterial = null,
  47971. this.autoUpdate = !0
  47972. }
  47973. ,
  47974. Ci.Scene.prototype = Object.create(Ci.Object3D.prototype),
  47975. Ci.Scene.prototype.constructor = Ci.Scene,
  47976. Ci.Scene.prototype.copy = function(e, t) {
  47977. return Ci.Object3D.prototype.copy.call(this, e, t),
  47978. null !== e.fog && (this.fog = e.fog.clone()),
  47979. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  47980. this.autoUpdate = e.autoUpdate,
  47981. this.matrixAutoUpdate = e.matrixAutoUpdate,
  47982. this
  47983. }
  47984. ,
  47985. Ci.Fog = function(e, t, i) {
  47986. this.name = "",
  47987. this.color = new Ci.Color(e),
  47988. this.near = void 0 !== t ? t : 1,
  47989. this.far = void 0 !== i ? i : 1e3
  47990. }
  47991. ,
  47992. Ci.Fog.prototype.clone = function() {
  47993. return new Ci.Fog(this.color.getHex(),this.near,this.far)
  47994. }
  47995. ,
  47996. Ci.FogExp2 = function(e, t) {
  47997. this.name = "",
  47998. this.color = new Ci.Color(e),
  47999. this.density = void 0 !== t ? t : 25e-5
  48000. }
  48001. ,
  48002. Ci.FogExp2.prototype.clone = function() {
  48003. return new Ci.FogExp2(this.color.getHex(),this.density)
  48004. }
  48005. ,
  48006. Ci.ShaderChunk = {},
  48007. Ci.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  48008. Ci.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  48009. Ci.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  48010. Ci.ShaderChunk.aomap_fragment = "#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n",
  48011. Ci.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  48012. Ci.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  48013. Ci.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  48014. Ci.ShaderChunk.bsdfs = "bool testLightInRange( const in float lightDistance, const in float cutoffDistance ) {\n\treturn any( bvec2( cutoffDistance == 0.0, lightDistance < cutoffDistance ) );\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t\t}\n\t\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_Smith( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n",
  48015. Ci.ShaderChunk.bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n",
  48016. Ci.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  48017. Ci.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  48018. Ci.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  48019. Ci.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  48020. Ci.ShaderChunk.common = "#define PI 3.14159\n#define PI2 6.28318\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\n",
  48021. Ci.ShaderChunk.cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\nconst float cubeUV_textureSize = 1024.0;\nint getFaceFromDirection(vec3 direction) {\n vec3 absDirection = abs(direction);\n int face = -1;\n if( absDirection.x > absDirection.z ) {\n if(absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0 : 3;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n else {\n if(absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2 : 5;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n return face;\n}\nconst float cubeUV_maxLods1 = log2(cubeUV_textureSize*0.25) - 1.0;\nconst float cubeUV_rangeClamp = exp2((6.0 - 1.0) * 2.0);\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n float scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n float dxRoughness = dFdx(roughness);\n float dyRoughness = dFdy(roughness);\n vec3 dx = dFdx( vec * scale * dxRoughness );\n vec3 dy = dFdy( vec * scale * dyRoughness );\n float d = max( dot( dx, dx ), dot( dy, dy ) );\n d = clamp(d, 1.0, cubeUV_rangeClamp);\n float mipLevel = 0.5 * log2(d);\n return vec2(floor(mipLevel), fract(mipLevel));\n}\nconst float cubeUV_maxLods2 = log2(cubeUV_textureSize*0.25) - 2.0;\nconst float cubeUV_rcpTextureSize = 1.0 / cubeUV_textureSize;\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n mipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n float a = 16.0 * cubeUV_rcpTextureSize;\n vec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n vec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n float powScale = exp2_packed.x * exp2_packed.y;\n float scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n float mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n bool bRes = mipLevel == 0.0;\n scale = bRes && (scale < a) ? a : scale;\n vec3 r;\n vec2 offset;\n int face = getFaceFromDirection(direction);\n float rcpPowScale = 1.0 / powScale;\n if( face == 0) {\n r = vec3(direction.x, -direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 1) {\n r = vec3(direction.y, direction.x, direction.z);\n offset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 2) {\n r = vec3(direction.z, direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 3) {\n r = vec3(direction.x, direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else if( face == 4) {\n r = vec3(direction.y, direction.x, -direction.z);\n offset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else {\n r = vec3(direction.z, -direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n r = normalize(r);\n float texelOffset = 0.5 * cubeUV_rcpTextureSize;\n vec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n vec2 base = offset + vec2( texelOffset );\n return base + s * ( scale - 2.0 * texelOffset );\n}\nconst float cubeUV_maxLods3 = log2(cubeUV_textureSize*0.25) - 3.0;\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n float roughnessVal = roughness* cubeUV_maxLods3;\n float r1 = floor(roughnessVal);\n float r2 = r1 + 1.0;\n float t = fract(roughnessVal);\n vec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n float s = mipInfo.y;\n float level0 = mipInfo.x;\n float level1 = level0 + 1.0;\n level1 = level1 > 5.0 ? 5.0 : level1;\n level0 += min( floor( s + 0.5 ), 5.0 );\n vec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n vec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n vec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n vec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n vec4 result = mix(color10, color20, t);\n return vec4(result.rgb, 1.0);\n}\n#endif\n",
  48022. Ci.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  48023. Ci.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  48024. Ci.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  48025. Ci.ShaderChunk.emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",
  48026. Ci.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  48027. Ci.ShaderChunk.encodings_pars_fragment = "\nvec4 LinearToLinear( in vec4 value ) {\n return value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n float maxComponent = max( max( value.r, value.g ), value.b );\n float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n M = ceil( M * 255.0 ) / 255.0;\n return vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float D = max( maxRange / maxRGB, 1.0 );\n D = min( floor( D ) / 255.0, 1.0 );\n return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n vec4 vResult;\n vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n vResult.w = fract(Le);\n vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n return vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n float Le = value.z * 255.0 + value.w;\n vec3 Xp_Y_XYZp;\n Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n return vec4( max(vRGB, 0.0), 1.0 );\n}\n",
  48028. Ci.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  48029. Ci.ShaderChunk.envmap_fragment = "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#else\n\t\tfloat flipNormal = 1.0;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n",
  48030. Ci.ShaderChunk.envmap_pars_fragment = "#if defined( USE_ENVMAP ) || defined( STANDARD )\n\tuniform float reflectivity;\n\tuniform float envMapIntenstiy;\n#endif\n#ifdef USE_ENVMAP\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( STANDARD )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n",
  48031. Ci.ShaderChunk.envmap_pars_vertex = "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvarying vec3 vReflect;\n\tuniform float refractionRatio;\n#endif\n",
  48032. Ci.ShaderChunk.envmap_vertex = "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t#ifdef ENVMAP_MODE_REFLECTION\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t#else\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t#endif\n#endif\n",
  48033. Ci.ShaderChunk.fog_fragment = "#ifdef USE_FOG\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",
  48034. Ci.ShaderChunk.fog_pars_fragment = "#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",
  48035. Ci.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  48036. Ci.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  48037. Ci.ShaderChunk.lights_lambert_vertex = "vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tdirectLight = getPointDirectLightIrradiance( pointLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tdirectLight = getSpotDirectLightIrradiance( spotLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectLight = getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",
  48038. Ci.ShaderChunk.lights_pars = "uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tIncidentLight getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tIncidentLight getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tif ( testLightInRange( lightDistance, pointLight.distance ) ) {\n\t\t\tdirectLight.color = pointLight.color;\n\t\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tIncidentLight getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( all( bvec2( angleCos > spotLight.coneCos, testLightInRange( lightDistance, spotLight.distance ) ) ) ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( STANDARD )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t#endif\n\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n",
  48039. Ci.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  48040. Ci.ShaderChunk.lights_phong_pars_fragment = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",
  48041. Ci.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  48042. Ci.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  48043. Ci.ShaderChunk.lights_standard_fragment = "StandardMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\nmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n",
  48044. Ci.ShaderChunk.lights_standard_pars_fragment = "struct StandardMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n};\nvoid RE_Direct_Standard( const in IncidentLight directLight, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n}\nvoid RE_IndirectDiffuse_Standard( const in vec3 irradiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Standard( const in vec3 radiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectSpecular += radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Standard\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Standard\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Standard\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n",
  48045. Ci.ShaderChunk.lights_template = "\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tdirectLight = getPointDirectLightIrradiance( pointLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tdirectLight = getSpotDirectLightIrradiance( spotLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tdirectLight = getDirectionalDirectLightIrradiance( directionalLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t \tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\tRE_IndirectSpecular( radiance, geometry, material, reflectedLight );\n#endif\n",
  48046. Ci.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  48047. Ci.ShaderChunk.logdepthbuf_pars_fragment = "#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",
  48048. Ci.ShaderChunk.logdepthbuf_pars_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",
  48049. Ci.ShaderChunk.logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n",
  48050. Ci.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  48051. Ci.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  48052. Ci.ShaderChunk.map_particle_fragment = "#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",
  48053. Ci.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  48054. Ci.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  48055. Ci.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  48056. Ci.ShaderChunk.morphnormal_vertex = "#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",
  48057. Ci.ShaderChunk.morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",
  48058. Ci.ShaderChunk.morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n",
  48059. Ci.ShaderChunk.normal_fragment = "#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\t#endif\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",
  48060. Ci.ShaderChunk.normalmap_pars_fragment = "#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n",
  48061. Ci.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  48062. Ci.ShaderChunk.project_vertex = "#ifdef USE_SKINNING\n\tvec4 mvPosition = modelViewMatrix * skinned;\n#else\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n#endif\ngl_Position = projectionMatrix * mvPosition;\n",
  48063. Ci.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  48064. Ci.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  48065. Ci.ShaderChunk.shadowmap_pars_fragment = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat unpackDepth( const in vec4 rgba_depth ) {\n\t\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\t\treturn dot( rgba_depth, bit_shift );\n\t}\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn 1.0;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n",
  48066. Ci.ShaderChunk.shadowmap_pars_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n",
  48067. Ci.ShaderChunk.shadowmap_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n",
  48068. Ci.ShaderChunk.shadowmask_pars_fragment = "float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",
  48069. Ci.ShaderChunk.skinbase_vertex = "#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",
  48070. Ci.ShaderChunk.skinning_pars_vertex = "#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneGlobalMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n",
  48071. Ci.ShaderChunk.skinning_vertex = "#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned = bindMatrixInverse * skinned;\n#endif\n",
  48072. Ci.ShaderChunk.skinnormal_vertex = "#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n",
  48073. Ci.ShaderChunk.specularmap_fragment = "float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",
  48074. Ci.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  48075. Ci.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  48076. Ci.ShaderChunk.tonemapping_pars_fragment = "#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n",
  48077. Ci.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  48078. Ci.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  48079. Ci.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  48080. Ci.ShaderChunk.uv_pars_fragment = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",
  48081. Ci.ShaderChunk.uv_pars_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n",
  48082. Ci.ShaderChunk.uv_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",
  48083. Ci.ShaderChunk.worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( STANDARD ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\t#ifdef USE_SKINNING\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\t#else\n\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t#endif\n#endif\n",
  48084. Ci.UniformsUtils = {
  48085. merge: function(e) {
  48086. for (var t = {}, i = 0; i < e.length; i++) {
  48087. var n = this.clone(e[i]);
  48088. for (var r in n)
  48089. t[r] = n[r]
  48090. }
  48091. return t
  48092. },
  48093. clone: function(e) {
  48094. var t = {};
  48095. for (var i in e)
  48096. for (var n in t[i] = {},
  48097. e[i]) {
  48098. var r = e[i][n];
  48099. r instanceof Ci.Color || r instanceof Ci.Vector2 || r instanceof Ci.Vector3 || r instanceof Ci.Vector4 || r instanceof Ci.Matrix3 || r instanceof Ci.Matrix4 || r instanceof Ci.Texture ? t[i][n] = r.clone() : Array.isArray(r) ? t[i][n] = r.slice() : t[i][n] = r
  48100. }
  48101. return t
  48102. }
  48103. },
  48104. Ci.UniformsLib = {
  48105. common: {
  48106. diffuse: {
  48107. type: "c",
  48108. value: new Ci.Color(15658734)
  48109. },
  48110. opacity: {
  48111. type: "f",
  48112. value: 1
  48113. },
  48114. map: {
  48115. type: "t",
  48116. value: null
  48117. },
  48118. offsetRepeat: {
  48119. type: "v4",
  48120. value: new Ci.Vector4(0,0,1,1)
  48121. },
  48122. specularMap: {
  48123. type: "t",
  48124. value: null
  48125. },
  48126. alphaMap: {
  48127. type: "t",
  48128. value: null
  48129. },
  48130. envMap: {
  48131. type: "t",
  48132. value: null
  48133. },
  48134. flipEnvMap: {
  48135. type: "f",
  48136. value: -1
  48137. },
  48138. reflectivity: {
  48139. type: "f",
  48140. value: 1
  48141. },
  48142. refractionRatio: {
  48143. type: "f",
  48144. value: .98
  48145. }
  48146. },
  48147. aomap: {
  48148. aoMap: {
  48149. type: "t",
  48150. value: null
  48151. },
  48152. aoMapIntensity: {
  48153. type: "f",
  48154. value: 1
  48155. }
  48156. },
  48157. lightmap: {
  48158. lightMap: {
  48159. type: "t",
  48160. value: null
  48161. },
  48162. lightMapIntensity: {
  48163. type: "f",
  48164. value: 1
  48165. }
  48166. },
  48167. emissivemap: {
  48168. emissiveMap: {
  48169. type: "t",
  48170. value: null
  48171. }
  48172. },
  48173. bumpmap: {
  48174. bumpMap: {
  48175. type: "t",
  48176. value: null
  48177. },
  48178. bumpScale: {
  48179. type: "f",
  48180. value: 1
  48181. }
  48182. },
  48183. normalmap: {
  48184. normalMap: {
  48185. type: "t",
  48186. value: null
  48187. },
  48188. normalScale: {
  48189. type: "v2",
  48190. value: new Ci.Vector2(1,1)
  48191. }
  48192. },
  48193. displacementmap: {
  48194. displacementMap: {
  48195. type: "t",
  48196. value: null
  48197. },
  48198. displacementScale: {
  48199. type: "f",
  48200. value: 1
  48201. },
  48202. displacementBias: {
  48203. type: "f",
  48204. value: 0
  48205. }
  48206. },
  48207. roughnessmap: {
  48208. roughnessMap: {
  48209. type: "t",
  48210. value: null
  48211. }
  48212. },
  48213. metalnessmap: {
  48214. metalnessMap: {
  48215. type: "t",
  48216. value: null
  48217. }
  48218. },
  48219. fog: {
  48220. fogDensity: {
  48221. type: "f",
  48222. value: 25e-5
  48223. },
  48224. fogNear: {
  48225. type: "f",
  48226. value: 1
  48227. },
  48228. fogFar: {
  48229. type: "f",
  48230. value: 2e3
  48231. },
  48232. fogColor: {
  48233. type: "c",
  48234. value: new Ci.Color(16777215)
  48235. }
  48236. },
  48237. lights: {
  48238. ambientLightColor: {
  48239. type: "fv",
  48240. value: []
  48241. },
  48242. directionalLights: {
  48243. type: "sa",
  48244. value: [],
  48245. properties: {
  48246. direction: {
  48247. type: "v3"
  48248. },
  48249. color: {
  48250. type: "c"
  48251. },
  48252. shadow: {
  48253. type: "i"
  48254. },
  48255. shadowBias: {
  48256. type: "f"
  48257. },
  48258. shadowRadius: {
  48259. type: "f"
  48260. },
  48261. shadowMapSize: {
  48262. type: "v2"
  48263. }
  48264. }
  48265. },
  48266. directionalShadowMap: {
  48267. type: "tv",
  48268. value: []
  48269. },
  48270. directionalShadowMatrix: {
  48271. type: "m4v",
  48272. value: []
  48273. },
  48274. spotLights: {
  48275. type: "sa",
  48276. value: [],
  48277. properties: {
  48278. color: {
  48279. type: "c"
  48280. },
  48281. position: {
  48282. type: "v3"
  48283. },
  48284. direction: {
  48285. type: "v3"
  48286. },
  48287. distance: {
  48288. type: "f"
  48289. },
  48290. coneCos: {
  48291. type: "f"
  48292. },
  48293. penumbraCos: {
  48294. type: "f"
  48295. },
  48296. decay: {
  48297. type: "f"
  48298. },
  48299. shadow: {
  48300. type: "i"
  48301. },
  48302. shadowBias: {
  48303. type: "f"
  48304. },
  48305. shadowRadius: {
  48306. type: "f"
  48307. },
  48308. shadowMapSize: {
  48309. type: "v2"
  48310. }
  48311. }
  48312. },
  48313. spotShadowMap: {
  48314. type: "tv",
  48315. value: []
  48316. },
  48317. spotShadowMatrix: {
  48318. type: "m4v",
  48319. value: []
  48320. },
  48321. pointLights: {
  48322. type: "sa",
  48323. value: [],
  48324. properties: {
  48325. color: {
  48326. type: "c"
  48327. },
  48328. position: {
  48329. type: "v3"
  48330. },
  48331. decay: {
  48332. type: "f"
  48333. },
  48334. distance: {
  48335. type: "f"
  48336. },
  48337. shadow: {
  48338. type: "i"
  48339. },
  48340. shadowBias: {
  48341. type: "f"
  48342. },
  48343. shadowRadius: {
  48344. type: "f"
  48345. },
  48346. shadowMapSize: {
  48347. type: "v2"
  48348. }
  48349. }
  48350. },
  48351. pointShadowMap: {
  48352. type: "tv",
  48353. value: []
  48354. },
  48355. pointShadowMatrix: {
  48356. type: "m4v",
  48357. value: []
  48358. },
  48359. hemisphereLights: {
  48360. type: "sa",
  48361. value: [],
  48362. properties: {
  48363. direction: {
  48364. type: "v3"
  48365. },
  48366. skyColor: {
  48367. type: "c"
  48368. },
  48369. groundColor: {
  48370. type: "c"
  48371. }
  48372. }
  48373. }
  48374. },
  48375. points: {
  48376. diffuse: {
  48377. type: "c",
  48378. value: new Ci.Color(15658734)
  48379. },
  48380. opacity: {
  48381. type: "f",
  48382. value: 1
  48383. },
  48384. size: {
  48385. type: "f",
  48386. value: 1
  48387. },
  48388. scale: {
  48389. type: "f",
  48390. value: 1
  48391. },
  48392. map: {
  48393. type: "t",
  48394. value: null
  48395. },
  48396. offsetRepeat: {
  48397. type: "v4",
  48398. value: new Ci.Vector4(0,0,1,1)
  48399. }
  48400. }
  48401. },
  48402. Ci.ShaderChunk.cube_frag = "uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\t#include <logdepthbuf_fragment>\n}\n",
  48403. Ci.ShaderChunk.cube_vert = "varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t#include <logdepthbuf_vertex>\n}\n",
  48404. Ci.ShaderChunk.depth_frag = "uniform float mNear;\nuniform float mFar;\nuniform float opacity;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );\n\tgl_FragColor = vec4( vec3( color ), opacity );\n}\n",
  48405. Ci.ShaderChunk.depth_vert = "#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  48406. Ci.ShaderChunk.depthRGBA_frag = "#include <common>\n#include <logdepthbuf_pars_fragment>\nvec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}\n",
  48407. Ci.ShaderChunk.depthRGBA_vert = "#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  48408. Ci.ShaderChunk.distanceRGBA_frag = "uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include <common>\nvec4 pack1K ( float depth ) {\n\tdepth /= 1000.0;\n\tconst vec4 bitSh = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bitMsk = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bitSh * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bitMsk;\n\treturn res;\n}\nfloat unpack1K ( vec4 color ) {\n\tconst vec4 bitSh = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\treturn dot( color, bitSh ) * 1000.0;\n}\nvoid main () {\n\tgl_FragColor = pack1K( length( vWorldPosition.xyz - lightPos.xyz ) );\n}\n",
  48409. Ci.ShaderChunk.distanceRGBA_vert = "varying vec4 vWorldPosition;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\tvWorldPosition = worldPosition;\n}\n",
  48410. Ci.ShaderChunk.equirect_frag = "uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <logdepthbuf_fragment>\n}\n",
  48411. Ci.ShaderChunk.equirect_vert = "varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t#include <logdepthbuf_vertex>\n}\n",
  48412. Ci.ShaderChunk.linedashed_frag = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48413. Ci.ShaderChunk.linedashed_vert = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n}\n",
  48414. Ci.ShaderChunk.meshbasic_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight;\n\treflectedLight.directDiffuse = vec3( 0.0 );\n\treflectedLight.directSpecular = vec3( 0.0 );\n\treflectedLight.indirectDiffuse = diffuseColor.rgb;\n\treflectedLight.indirectSpecular = vec3( 0.0 );\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48415. Ci.ShaderChunk.meshbasic_vert = "#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n}\n",
  48416. Ci.ShaderChunk.meshlambert_frag = "uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48417. Ci.ShaderChunk.meshlambert_vert = "#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  48418. Ci.ShaderChunk.meshphong_frag = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48419. Ci.ShaderChunk.meshphong_vert = "#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <lights_phong_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_phong_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  48420. Ci.ShaderChunk.meshstandard_frag = "#define STANDARD\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\nuniform float envMapIntensity;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars>\n#include <lights_standard_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_standard_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48421. Ci.ShaderChunk.meshstandard_vert = "#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  48422. Ci.ShaderChunk.normal_frag = "uniform float opacity;\nvarying vec3 vNormal;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );\n\t#include <logdepthbuf_fragment>\n}\n",
  48423. Ci.ShaderChunk.normal_vert = "varying vec3 vNormal;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvNormal = normalize( normalMatrix * normal );\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  48424. Ci.ShaderChunk.points_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48425. Ci.ShaderChunk.points_vert = "uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  48426. Ci.ShaderLib = {
  48427. basic: {
  48428. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.fog]),
  48429. vertexShader: Ci.ShaderChunk.meshbasic_vert,
  48430. fragmentShader: Ci.ShaderChunk.meshbasic_frag
  48431. },
  48432. lambert: {
  48433. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  48434. emissive: {
  48435. type: "c",
  48436. value: new Ci.Color(0)
  48437. }
  48438. }]),
  48439. vertexShader: Ci.ShaderChunk.meshlambert_vert,
  48440. fragmentShader: Ci.ShaderChunk.meshlambert_frag
  48441. },
  48442. phong: {
  48443. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.bumpmap, Ci.UniformsLib.normalmap, Ci.UniformsLib.displacementmap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  48444. emissive: {
  48445. type: "c",
  48446. value: new Ci.Color(0)
  48447. },
  48448. specular: {
  48449. type: "c",
  48450. value: new Ci.Color(1118481)
  48451. },
  48452. shininess: {
  48453. type: "f",
  48454. value: 30
  48455. }
  48456. }]),
  48457. vertexShader: Ci.ShaderChunk.meshphong_vert,
  48458. fragmentShader: Ci.ShaderChunk.meshphong_frag
  48459. },
  48460. standard: {
  48461. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.bumpmap, Ci.UniformsLib.normalmap, Ci.UniformsLib.displacementmap, Ci.UniformsLib.roughnessmap, Ci.UniformsLib.metalnessmap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  48462. emissive: {
  48463. type: "c",
  48464. value: new Ci.Color(0)
  48465. },
  48466. roughness: {
  48467. type: "f",
  48468. value: .5
  48469. },
  48470. metalness: {
  48471. type: "f",
  48472. value: 0
  48473. },
  48474. envMapIntensity: {
  48475. type: "f",
  48476. value: 1
  48477. }
  48478. }]),
  48479. vertexShader: Ci.ShaderChunk.meshstandard_vert,
  48480. fragmentShader: Ci.ShaderChunk.meshstandard_frag
  48481. },
  48482. points: {
  48483. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.points, Ci.UniformsLib.fog]),
  48484. vertexShader: Ci.ShaderChunk.points_vert,
  48485. fragmentShader: Ci.ShaderChunk.points_frag
  48486. },
  48487. dashed: {
  48488. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.fog, {
  48489. scale: {
  48490. type: "f",
  48491. value: 1
  48492. },
  48493. dashSize: {
  48494. type: "f",
  48495. value: 1
  48496. },
  48497. totalSize: {
  48498. type: "f",
  48499. value: 2
  48500. }
  48501. }]),
  48502. vertexShader: Ci.ShaderChunk.linedashed_vert,
  48503. fragmentShader: Ci.ShaderChunk.linedashed_frag
  48504. },
  48505. depth: {
  48506. uniforms: {
  48507. mNear: {
  48508. type: "f",
  48509. value: 1
  48510. },
  48511. mFar: {
  48512. type: "f",
  48513. value: 2e3
  48514. },
  48515. opacity: {
  48516. type: "f",
  48517. value: 1
  48518. }
  48519. },
  48520. vertexShader: Ci.ShaderChunk.depth_vert,
  48521. fragmentShader: Ci.ShaderChunk.depth_frag
  48522. },
  48523. normal: {
  48524. uniforms: {
  48525. opacity: {
  48526. type: "f",
  48527. value: 1
  48528. }
  48529. },
  48530. vertexShader: Ci.ShaderChunk.normal_vert,
  48531. fragmentShader: Ci.ShaderChunk.normal_frag
  48532. },
  48533. cube: {
  48534. uniforms: {
  48535. tCube: {
  48536. type: "t",
  48537. value: null
  48538. },
  48539. tFlip: {
  48540. type: "f",
  48541. value: -1
  48542. }
  48543. },
  48544. vertexShader: Ci.ShaderChunk.cube_vert,
  48545. fragmentShader: Ci.ShaderChunk.cube_frag
  48546. },
  48547. equirect: {
  48548. uniforms: {
  48549. tEquirect: {
  48550. type: "t",
  48551. value: null
  48552. },
  48553. tFlip: {
  48554. type: "f",
  48555. value: -1
  48556. }
  48557. },
  48558. vertexShader: Ci.ShaderChunk.equirect_vert,
  48559. fragmentShader: Ci.ShaderChunk.equirect_frag
  48560. },
  48561. depthRGBA: {
  48562. uniforms: {},
  48563. vertexShader: Ci.ShaderChunk.depthRGBA_vert,
  48564. fragmentShader: Ci.ShaderChunk.depthRGBA_frag
  48565. },
  48566. distanceRGBA: {
  48567. uniforms: {
  48568. lightPos: {
  48569. type: "v3",
  48570. value: new Ci.Vector3(0,0,0)
  48571. }
  48572. },
  48573. vertexShader: Ci.ShaderChunk.distanceRGBA_vert,
  48574. fragmentShader: Ci.ShaderChunk.distanceRGBA_frag
  48575. }
  48576. },
  48577. Ci.WebGLRenderer = function(e) {
  48578. function S() {
  48579. return null === Q ? he : 1
  48580. }
  48581. function i(e, t, i, n) {
  48582. !0 === V && (e *= n,
  48583. t *= n,
  48584. i *= n),
  48585. _e.clearColor(e, t, i, n)
  48586. }
  48587. function t() {
  48588. _e.init(),
  48589. _e.scissor(ie.copy(ue).multiplyScalar(he)),
  48590. _e.viewport(re.copy(pe).multiplyScalar(he)),
  48591. i(ae.r, ae.g, ae.b, se)
  48592. }
  48593. function n() {
  48594. te = K = null,
  48595. ee = "",
  48596. $ = -1,
  48597. _e.reset()
  48598. }
  48599. function r(e) {
  48600. e.preventDefault(),
  48601. n(),
  48602. t(),
  48603. be.clear()
  48604. }
  48605. function f(e) {
  48606. var t = e.target;
  48607. t.removeEventListener("dispose", f),
  48608. function(e) {
  48609. var t = be.get(e);
  48610. if (e.image && t.__image__webglTextureCube)
  48611. X.deleteTexture(t.__image__webglTextureCube);
  48612. else {
  48613. if (void 0 === t.__webglInit)
  48614. return;
  48615. X.deleteTexture(t.__webglTexture)
  48616. }
  48617. be.delete(e)
  48618. }(t),
  48619. ye.textures--
  48620. }
  48621. function a(e) {
  48622. var t = e.target;
  48623. t.removeEventListener("dispose", a),
  48624. function(e) {
  48625. var t = be.get(e)
  48626. , i = be.get(e.texture);
  48627. if (e && void 0 !== i.__webglTexture) {
  48628. if (X.deleteTexture(i.__webglTexture),
  48629. e instanceof Ci.WebGLRenderTargetCube)
  48630. for (var n = 0; n < 6; n++)
  48631. X.deleteFramebuffer(t.__webglFramebuffer[n]),
  48632. X.deleteRenderbuffer(t.__webglDepthbuffer[n]);
  48633. else
  48634. X.deleteFramebuffer(t.__webglFramebuffer),
  48635. X.deleteRenderbuffer(t.__webglDepthbuffer);
  48636. be.delete(e.texture),
  48637. be.delete(e)
  48638. }
  48639. }(t),
  48640. ye.textures--
  48641. }
  48642. function v(e) {
  48643. var t = e.target;
  48644. t.removeEventListener("dispose", v),
  48645. function(e) {
  48646. y(e),
  48647. be.delete(e)
  48648. }(t)
  48649. }
  48650. function y(e) {
  48651. var t = be.get(e).program;
  48652. (e.program = void 0) !== t && Te.releaseProgram(t)
  48653. }
  48654. function M(e, t) {
  48655. return Math.abs(t[0]) - Math.abs(e[0])
  48656. }
  48657. function s(e, t) {
  48658. 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
  48659. }
  48660. function l(e, t) {
  48661. 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
  48662. }
  48663. function d(e, t, i, n, r) {
  48664. var o, a;
  48665. a = i.transparent ? (o = G,
  48666. ++W) : (o = H,
  48667. ++z);
  48668. var s = o[a];
  48669. void 0 !== s ? (s.id = e.id,
  48670. s.object = e,
  48671. s.geometry = t,
  48672. s.material = i,
  48673. s.z = me.z,
  48674. s.group = r) : (s = {
  48675. id: e.id,
  48676. object: e,
  48677. geometry: t,
  48678. material: i,
  48679. z: me.z,
  48680. group: r
  48681. },
  48682. o.push(s))
  48683. }
  48684. function c(e, t, i, n) {
  48685. for (var r = 0, o = e.length; r < o; r++) {
  48686. var a = e[r]
  48687. , s = a.object
  48688. , l = a.geometry
  48689. , c = void 0 === n ? a.material : n
  48690. , h = a.group;
  48691. if (s.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, s.matrixWorld),
  48692. s.normalMatrix.getNormalMatrix(s.modelViewMatrix),
  48693. s instanceof Ci.ImmediateRenderObject) {
  48694. R(c);
  48695. var u = P(t, i, c, s);
  48696. ee = "",
  48697. s.render(function(e) {
  48698. Z.renderBufferImmediate(e, u, c)
  48699. })
  48700. } else
  48701. Z.renderBufferDirect(t, i, l, c, s, h)
  48702. }
  48703. }
  48704. function R(e) {
  48705. (function(e) {
  48706. e.side !== Ci.DoubleSide ? _e.enable(X.CULL_FACE) : _e.disable(X.CULL_FACE),
  48707. _e.setFlipSided(e.side === Ci.BackSide)
  48708. }
  48709. )(e),
  48710. !0 === e.transparent ? _e.setBlending(e.blending, e.blendEquation, e.blendSrc, e.blendDst, e.blendEquationAlpha, e.blendSrcAlpha, e.blendDstAlpha, e.premultipliedAlpha) : _e.setBlending(Ci.NoBlending),
  48711. _e.setDepthFunc(e.depthFunc),
  48712. _e.setDepthTest(e.depthTest),
  48713. _e.setDepthWrite(e.depthWrite),
  48714. _e.setColorWrite(e.colorWrite),
  48715. _e.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  48716. }
  48717. function P(e, t, i, n) {
  48718. oe = 0;
  48719. var r = be.get(i);
  48720. void 0 === r.program && (i.needsUpdate = !0),
  48721. void 0 !== r.lightsHash && r.lightsHash !== ve.hash && (i.needsUpdate = !0),
  48722. i.needsUpdate && (function(e, t, i) {
  48723. var n = be.get(e)
  48724. , r = Te.getParameters(e, ve, t, i)
  48725. , o = Te.getProgramCode(e, r)
  48726. , a = n.program
  48727. , s = !0;
  48728. if (void 0 === a)
  48729. e.addEventListener("dispose", v);
  48730. else if (a.code !== o)
  48731. y(e);
  48732. else {
  48733. if (void 0 !== r.shaderID)
  48734. return;
  48735. s = !1
  48736. }
  48737. if (s) {
  48738. if (r.shaderID) {
  48739. var l = Ci.ShaderLib[r.shaderID];
  48740. n.__webglShader = {
  48741. name: e.type,
  48742. uniforms: Ci.UniformsUtils.clone(l.uniforms),
  48743. vertexShader: l.vertexShader,
  48744. fragmentShader: l.fragmentShader
  48745. }
  48746. } else
  48747. n.__webglShader = {
  48748. name: e.type,
  48749. uniforms: e.uniforms,
  48750. vertexShader: e.vertexShader,
  48751. fragmentShader: e.fragmentShader
  48752. };
  48753. e.__webglShader = n.__webglShader,
  48754. a = Te.acquireProgram(e, r, o),
  48755. n.program = a,
  48756. e.program = a
  48757. }
  48758. var c = a.getAttributes();
  48759. if (e.morphTargets)
  48760. for (var h = e.numSupportedMorphTargets = 0; h < Z.maxMorphTargets; h++)
  48761. 0 <= c["morphTarget" + h] && e.numSupportedMorphTargets++;
  48762. if (e.morphNormals)
  48763. for (h = e.numSupportedMorphNormals = 0; h < Z.maxMorphNormals; h++)
  48764. 0 <= c["morphNormal" + h] && e.numSupportedMorphNormals++;
  48765. n.uniformsList = [];
  48766. var u = n.__webglShader.uniforms
  48767. , d = n.program.getUniforms();
  48768. for (var p in u) {
  48769. var f = d[p];
  48770. f && n.uniformsList.push([n.__webglShader.uniforms[p], f])
  48771. }
  48772. (e instanceof Ci.MeshPhongMaterial || e instanceof Ci.MeshLambertMaterial || e instanceof Ci.MeshStandardMaterial || e.lights) && (n.lightsHash = ve.hash,
  48773. u.ambientLightColor.value = ve.ambient,
  48774. u.directionalLights.value = ve.directional,
  48775. u.spotLights.value = ve.spot,
  48776. u.pointLights.value = ve.point,
  48777. u.hemisphereLights.value = ve.hemi,
  48778. u.directionalShadowMap.value = ve.directionalShadowMap,
  48779. u.directionalShadowMatrix.value = ve.directionalShadowMatrix,
  48780. u.spotShadowMap.value = ve.spotShadowMap,
  48781. u.spotShadowMatrix.value = ve.spotShadowMatrix,
  48782. u.pointShadowMap.value = ve.pointShadowMap,
  48783. u.pointShadowMatrix.value = ve.pointShadowMatrix),
  48784. n.hasDynamicUniforms = !1;
  48785. for (var g = 0, m = n.uniformsList.length; g < m; g++) {
  48786. if (!0 === n.uniformsList[g][0].dynamic) {
  48787. n.hasDynamicUniforms = !0;
  48788. break
  48789. }
  48790. }
  48791. }(i, t, n),
  48792. i.needsUpdate = !1);
  48793. var o = !1
  48794. , a = !1
  48795. , s = !1
  48796. , l = r.program
  48797. , c = l.getUniforms()
  48798. , h = r.__webglShader.uniforms;
  48799. if (l.id !== K && (X.useProgram(l.program),
  48800. K = l.id,
  48801. s = a = o = !0),
  48802. i.id !== $ && ($ = i.id,
  48803. a = !0),
  48804. !o && e === te || (X.uniformMatrix4fv(c.projectionMatrix, !1, e.projectionMatrix.elements),
  48805. Ee.logarithmicDepthBuffer && X.uniform1f(c.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  48806. e !== te && (te = e,
  48807. s = a = !0),
  48808. (i instanceof Ci.ShaderMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial || i.envMap) && void 0 !== c.cameraPosition && (me.setFromMatrixPosition(e.matrixWorld),
  48809. X.uniform3f(c.cameraPosition, me.x, me.y, me.z)),
  48810. (i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshStandardMaterial || i instanceof Ci.ShaderMaterial || i.skinning) && void 0 !== c.viewMatrix && X.uniformMatrix4fv(c.viewMatrix, !1, e.matrixWorldInverse.elements),
  48811. void 0 !== c.toneMappingExposure && X.uniform1f(c.toneMappingExposure, Z.toneMappingExposure),
  48812. void 0 !== c.toneMappingWhitePoint && X.uniform1f(c.toneMappingWhitePoint, Z.toneMappingWhitePoint)),
  48813. i.skinning)
  48814. if (n.bindMatrix && void 0 !== c.bindMatrix && X.uniformMatrix4fv(c.bindMatrix, !1, n.bindMatrix.elements),
  48815. n.bindMatrixInverse && void 0 !== c.bindMatrixInverse && X.uniformMatrix4fv(c.bindMatrixInverse, !1, n.bindMatrixInverse.elements),
  48816. Ee.floatVertexTextures && n.skeleton && n.skeleton.useVertexTexture) {
  48817. if (void 0 !== c.boneTexture) {
  48818. var u = A();
  48819. X.uniform1i(c.boneTexture, u),
  48820. Z.setTexture(n.skeleton.boneTexture, u)
  48821. }
  48822. void 0 !== c.boneTextureWidth && X.uniform1i(c.boneTextureWidth, n.skeleton.boneTextureWidth),
  48823. void 0 !== c.boneTextureHeight && X.uniform1i(c.boneTextureHeight, n.skeleton.boneTextureHeight)
  48824. } else
  48825. n.skeleton && n.skeleton.boneMatrices && void 0 !== c.boneGlobalMatrices && X.uniformMatrix4fv(c.boneGlobalMatrices, !1, n.skeleton.boneMatrices);
  48826. return a && ((i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshStandardMaterial || i.lights) && function(e, t) {
  48827. e.ambientLightColor.needsUpdate = t,
  48828. e.directionalLights.needsUpdate = t,
  48829. e.pointLights.needsUpdate = t,
  48830. e.spotLights.needsUpdate = t,
  48831. e.hemisphereLights.needsUpdate = t
  48832. }(h, s),
  48833. t && i.fog && function(e, t) {
  48834. e.fogColor.value = t.color,
  48835. t instanceof Ci.Fog ? (e.fogNear.value = t.near,
  48836. e.fogFar.value = t.far) : t instanceof Ci.FogExp2 && (e.fogDensity.value = t.density)
  48837. }(h, t),
  48838. (i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial) && function(e, t) {
  48839. var i;
  48840. if (e.opacity.value = t.opacity,
  48841. e.diffuse.value = t.color,
  48842. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  48843. e.map.value = t.map,
  48844. e.specularMap.value = t.specularMap,
  48845. e.alphaMap.value = t.alphaMap,
  48846. t.aoMap && (e.aoMap.value = t.aoMap,
  48847. e.aoMapIntensity.value = t.aoMapIntensity),
  48848. 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),
  48849. void 0 !== i) {
  48850. i instanceof Ci.WebGLRenderTarget && (i = i.texture);
  48851. var n = i.offset
  48852. , r = i.repeat;
  48853. e.offsetRepeat.value.set(n.x, n.y, r.x, r.y)
  48854. }
  48855. e.envMap.value = t.envMap,
  48856. e.flipEnvMap.value = t.envMap instanceof Ci.WebGLRenderTargetCube ? 1 : -1,
  48857. e.reflectivity.value = t.reflectivity,
  48858. e.refractionRatio.value = t.refractionRatio
  48859. }(h, i),
  48860. i instanceof Ci.LineBasicMaterial ? p(h, i) : i instanceof Ci.LineDashedMaterial ? (p(h, i),
  48861. function(e, t) {
  48862. e.dashSize.value = t.dashSize,
  48863. e.totalSize.value = t.dashSize + t.gapSize,
  48864. e.scale.value = t.scale
  48865. }(h, i)) : i instanceof Ci.PointsMaterial ? function(e, t) {
  48866. if (e.diffuse.value = t.color,
  48867. e.opacity.value = t.opacity,
  48868. e.size.value = t.size * he,
  48869. e.scale.value = O.clientHeight / 2,
  48870. e.map.value = t.map,
  48871. null !== t.map) {
  48872. var i = t.map.offset
  48873. , n = t.map.repeat;
  48874. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  48875. }
  48876. }(h, i) : i instanceof Ci.MeshLambertMaterial ? function(e, t) {
  48877. t.lightMap && (e.lightMap.value = t.lightMap,
  48878. e.lightMapIntensity.value = t.lightMapIntensity),
  48879. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  48880. }(h, i) : i instanceof Ci.MeshPhongMaterial ? function(e, t) {
  48881. e.specular.value = t.specular,
  48882. e.shininess.value = Math.max(t.shininess, 1e-4),
  48883. t.lightMap && (e.lightMap.value = t.lightMap,
  48884. e.lightMapIntensity.value = t.lightMapIntensity),
  48885. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48886. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48887. e.bumpScale.value = t.bumpScale),
  48888. t.normalMap && (e.normalMap.value = t.normalMap,
  48889. e.normalScale.value.copy(t.normalScale)),
  48890. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48891. e.displacementScale.value = t.displacementScale,
  48892. e.displacementBias.value = t.displacementBias)
  48893. }(h, i) : i instanceof Ci.MeshStandardMaterial ? function(e, t) {
  48894. e.roughness.value = t.roughness,
  48895. e.metalness.value = t.metalness,
  48896. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  48897. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  48898. t.lightMap && (e.lightMap.value = t.lightMap,
  48899. e.lightMapIntensity.value = t.lightMapIntensity),
  48900. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48901. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48902. e.bumpScale.value = t.bumpScale),
  48903. t.normalMap && (e.normalMap.value = t.normalMap,
  48904. e.normalScale.value.copy(t.normalScale)),
  48905. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48906. e.displacementScale.value = t.displacementScale,
  48907. e.displacementBias.value = t.displacementBias),
  48908. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  48909. }(h, i) : i instanceof Ci.MeshDepthMaterial ? (h.mNear.value = e.near,
  48910. h.mFar.value = e.far,
  48911. h.opacity.value = i.opacity) : i instanceof Ci.MeshNormalMaterial && (h.opacity.value = i.opacity),
  48912. g(r.uniformsList)),
  48913. function(e, t) {
  48914. X.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  48915. e.normalMatrix && X.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  48916. }(c, n),
  48917. void 0 !== c.modelMatrix && X.uniformMatrix4fv(c.modelMatrix, !1, n.matrixWorld.elements),
  48918. !0 === r.hasDynamicUniforms && function(e, t, i) {
  48919. for (var n = [], r = 0, o = e.length; r < o; r++) {
  48920. var a = e[r][0]
  48921. , s = a.onUpdateCallback;
  48922. void 0 !== s && (s.bind(a)(t, i),
  48923. n.push(e[r]))
  48924. }
  48925. g(n)
  48926. }(r.uniformsList, n, e),
  48927. l
  48928. }
  48929. function p(e, t) {
  48930. e.diffuse.value = t.color,
  48931. e.opacity.value = t.opacity
  48932. }
  48933. function A() {
  48934. var e = oe;
  48935. return e >= Ee.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + Ee.maxTextures),
  48936. oe += 1,
  48937. e
  48938. }
  48939. function C(e, t, i, n) {
  48940. var r, o;
  48941. if ("1i" === t)
  48942. X.uniform1i(i, n);
  48943. else if ("1f" === t)
  48944. X.uniform1f(i, n);
  48945. else if ("2f" === t)
  48946. X.uniform2f(i, n[0], n[1]);
  48947. else if ("3f" === t)
  48948. X.uniform3f(i, n[0], n[1], n[2]);
  48949. else if ("4f" === t)
  48950. X.uniform4f(i, n[0], n[1], n[2], n[3]);
  48951. else if ("1iv" === t)
  48952. X.uniform1iv(i, n);
  48953. else if ("3iv" === t)
  48954. X.uniform3iv(i, n);
  48955. else if ("1fv" === t)
  48956. X.uniform1fv(i, n);
  48957. else if ("2fv" === t)
  48958. X.uniform2fv(i, n);
  48959. else if ("3fv" === t)
  48960. X.uniform3fv(i, n);
  48961. else if ("4fv" === t)
  48962. X.uniform4fv(i, n);
  48963. else if ("Matrix2fv" === t)
  48964. X.uniformMatrix2fv(i, !1, n);
  48965. else if ("Matrix3fv" === t)
  48966. X.uniformMatrix3fv(i, !1, n);
  48967. else if ("Matrix4fv" === t)
  48968. X.uniformMatrix4fv(i, !1, n);
  48969. else if ("i" === t)
  48970. X.uniform1i(i, n);
  48971. else if ("f" === t)
  48972. X.uniform1f(i, n);
  48973. else if ("v2" === t)
  48974. X.uniform2f(i, n.x, n.y);
  48975. else if ("v3" === t)
  48976. X.uniform3f(i, n.x, n.y, n.z);
  48977. else if ("v4" === t)
  48978. X.uniform4f(i, n.x, n.y, n.z, n.w);
  48979. else if ("c" === t)
  48980. X.uniform3f(i, n.r, n.g, n.b);
  48981. else if ("s" === t) {
  48982. var a = e.properties;
  48983. for (var s in a) {
  48984. var l = a[s]
  48985. , c = i[s]
  48986. , h = n[s];
  48987. C(l, l.type, c, h)
  48988. }
  48989. } else if ("sa" === t) {
  48990. a = e.properties;
  48991. for (var u = 0, d = n.length; u < d; u++)
  48992. for (var s in a) {
  48993. l = a[s],
  48994. c = i[u][s],
  48995. h = n[u][s];
  48996. C(l, l.type, c, h)
  48997. }
  48998. } else if ("iv1" === t)
  48999. X.uniform1iv(i, n);
  49000. else if ("iv" === t)
  49001. X.uniform3iv(i, n);
  49002. else if ("fv1" === t)
  49003. X.uniform1fv(i, n);
  49004. else if ("fv" === t)
  49005. X.uniform3fv(i, n);
  49006. else if ("v2v" === t) {
  49007. void 0 === e._array && (e._array = new Float32Array(2 * n.length));
  49008. u = 0;
  49009. for (var p = 0, f = n.length; u < f; u++,
  49010. p += 2)
  49011. e._array[p + 0] = n[u].x,
  49012. e._array[p + 1] = n[u].y;
  49013. X.uniform2fv(i, e._array)
  49014. } else if ("v3v" === t) {
  49015. void 0 === e._array && (e._array = new Float32Array(3 * n.length));
  49016. u = 0;
  49017. var g = 0;
  49018. for (f = n.length; u < f; u++,
  49019. g += 3)
  49020. e._array[g + 0] = n[u].x,
  49021. e._array[g + 1] = n[u].y,
  49022. e._array[g + 2] = n[u].z;
  49023. X.uniform3fv(i, e._array)
  49024. } else if ("v4v" === t) {
  49025. void 0 === e._array && (e._array = new Float32Array(4 * n.length));
  49026. u = 0;
  49027. var m = 0;
  49028. for (f = n.length; u < f; u++,
  49029. m += 4)
  49030. e._array[m + 0] = n[u].x,
  49031. e._array[m + 1] = n[u].y,
  49032. e._array[m + 2] = n[u].z,
  49033. e._array[m + 3] = n[u].w;
  49034. X.uniform4fv(i, e._array)
  49035. } else if ("m2" === t)
  49036. X.uniformMatrix2fv(i, !1, n.elements);
  49037. else if ("m3" === t)
  49038. X.uniformMatrix3fv(i, !1, n.elements);
  49039. else if ("m3v" === t) {
  49040. void 0 === e._array && (e._array = new Float32Array(9 * n.length));
  49041. for (u = 0,
  49042. f = n.length; u < f; u++)
  49043. n[u].flattenToArrayOffset(e._array, 9 * u);
  49044. X.uniformMatrix3fv(i, !1, e._array)
  49045. } else if ("m4" === t)
  49046. X.uniformMatrix4fv(i, !1, n.elements);
  49047. else if ("m4v" === t) {
  49048. void 0 === e._array && (e._array = new Float32Array(16 * n.length));
  49049. for (u = 0,
  49050. f = n.length; u < f; u++)
  49051. n[u].flattenToArrayOffset(e._array, 16 * u);
  49052. X.uniformMatrix4fv(i, !1, e._array)
  49053. } else if ("t" === t) {
  49054. if (r = n,
  49055. o = A(),
  49056. X.uniform1i(i, o),
  49057. !r)
  49058. return;
  49059. r instanceof Ci.CubeTexture || Array.isArray(r.image) && 6 === r.image.length ? _(r, o) : r instanceof Ci.WebGLRenderTargetCube ? b(r.texture, o) : r instanceof Ci.WebGLRenderTarget ? Z.setTexture(r.texture, o) : Z.setTexture(r, o)
  49060. } else if ("tv" === t) {
  49061. void 0 === e._array && (e._array = []);
  49062. for (u = 0,
  49063. f = e.value.length; u < f; u++)
  49064. e._array[u] = A();
  49065. X.uniform1iv(i, e._array);
  49066. for (u = 0,
  49067. f = e.value.length; u < f; u++)
  49068. r = e.value[u],
  49069. o = e._array[u],
  49070. r && (r instanceof Ci.CubeTexture || r.image instanceof Array && 6 === r.image.length ? _(r, o) : r instanceof Ci.WebGLRenderTarget ? Z.setTexture(r.texture, o) : r instanceof Ci.WebGLRenderTargetCube ? b(r.texture, o) : Z.setTexture(r, o))
  49071. } else
  49072. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  49073. }
  49074. function g(e) {
  49075. for (var t = 0, i = e.length; t < i; t++) {
  49076. var n = e[t][0];
  49077. if (!1 !== n.needsUpdate)
  49078. C(n, n.type, e[t][1], n.value)
  49079. }
  49080. }
  49081. function m(e, t, i) {
  49082. var n;
  49083. if (i ? (X.texParameteri(e, X.TEXTURE_WRAP_S, x(t.wrapS)),
  49084. X.texParameteri(e, X.TEXTURE_WRAP_T, x(t.wrapT)),
  49085. X.texParameteri(e, X.TEXTURE_MAG_FILTER, x(t.magFilter)),
  49086. X.texParameteri(e, X.TEXTURE_MIN_FILTER, x(t.minFilter))) : (X.texParameteri(e, X.TEXTURE_WRAP_S, X.CLAMP_TO_EDGE),
  49087. X.texParameteri(e, X.TEXTURE_WRAP_T, X.CLAMP_TO_EDGE),
  49088. t.wrapS === Ci.ClampToEdgeWrapping && t.wrapT === Ci.ClampToEdgeWrapping || console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.", t),
  49089. X.texParameteri(e, X.TEXTURE_MAG_FILTER, T(t.magFilter)),
  49090. X.texParameteri(e, X.TEXTURE_MIN_FILTER, T(t.minFilter)),
  49091. t.minFilter !== Ci.NearestFilter && t.minFilter !== Ci.LinearFilter && console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.", t)),
  49092. n = Ie.get("EXT_texture_filter_anisotropic")) {
  49093. if (t.type === Ci.FloatType && null === Ie.get("OES_texture_float_linear"))
  49094. return;
  49095. if (t.type === Ci.HalfFloatType && null === Ie.get("OES_texture_half_float_linear"))
  49096. return;
  49097. (1 < t.anisotropy || be.get(t).__currentAnisotropy) && (X.texParameterf(e, n.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, Z.getMaxAnisotropy())),
  49098. be.get(t).__currentAnisotropy = t.anisotropy)
  49099. }
  49100. }
  49101. function o(e, t, i) {
  49102. void 0 === e.__webglInit && (e.__webglInit = !0,
  49103. t.addEventListener("dispose", f),
  49104. e.__webglTexture = X.createTexture(),
  49105. ye.textures++),
  49106. _e.activeTexture(X.TEXTURE0 + i),
  49107. _e.bindTexture(X.TEXTURE_2D, e.__webglTexture),
  49108. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, t.flipY),
  49109. X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  49110. X.pixelStorei(X.UNPACK_ALIGNMENT, t.unpackAlignment);
  49111. var n = I(t.image, Ee.maxTextureSize);
  49112. !function(e) {
  49113. return e.wrapS !== Ci.ClampToEdgeWrapping || e.wrapT !== Ci.ClampToEdgeWrapping || e.minFilter !== Ci.NearestFilter && e.minFilter !== Ci.LinearFilter
  49114. }(t) || !1 !== E(n) || (n = function(e) {
  49115. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  49116. var t = document.createElement("canvas");
  49117. return t.width = Ci.Math.nearestPowerOfTwo(e.width),
  49118. t.height = Ci.Math.nearestPowerOfTwo(e.height),
  49119. t.getContext("2d").drawImage(e, 0, 0, t.width, t.height),
  49120. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  49121. t
  49122. }
  49123. return e
  49124. }(n));
  49125. var r = E(n)
  49126. , o = x(t.format)
  49127. , a = x(t.type);
  49128. m(X.TEXTURE_2D, t, r);
  49129. var s, l = t.mipmaps;
  49130. if (t instanceof Ci.DataTexture)
  49131. if (0 < l.length && r) {
  49132. for (var c = 0, h = l.length; c < h; c++)
  49133. s = l[c],
  49134. _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  49135. t.generateMipmaps = !1
  49136. } else
  49137. _e.texImage2D(X.TEXTURE_2D, 0, o, n.width, n.height, 0, o, a, n.data);
  49138. else if (t instanceof Ci.CompressedTexture)
  49139. for (c = 0,
  49140. h = l.length; c < h; c++)
  49141. s = l[c],
  49142. t.format !== Ci.RGBAFormat && t.format !== Ci.RGBFormat ? -1 < _e.getCompressedTextureFormats().indexOf(o) ? _e.compressedTexImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, s.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  49143. else if (0 < l.length && r) {
  49144. for (c = 0,
  49145. h = l.length; c < h; c++)
  49146. s = l[c],
  49147. _e.texImage2D(X.TEXTURE_2D, c, o, o, a, s);
  49148. t.generateMipmaps = !1
  49149. } else
  49150. _e.texImage2D(X.TEXTURE_2D, 0, o, o, a, n);
  49151. t.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  49152. e.__version = t.version,
  49153. t.onUpdate && t.onUpdate(t)
  49154. }
  49155. function I(e, t) {
  49156. if (e.width > t || e.height > t) {
  49157. var i = t / Math.max(e.width, e.height)
  49158. , n = document.createElement("canvas");
  49159. return n.width = Math.floor(e.width * i),
  49160. n.height = Math.floor(e.height * i),
  49161. n.getContext("2d").drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  49162. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  49163. n
  49164. }
  49165. return e
  49166. }
  49167. function E(e) {
  49168. return Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height)
  49169. }
  49170. function _(e, t) {
  49171. var i = be.get(e);
  49172. if (6 === e.image.length)
  49173. if (0 < e.version && i.__version !== e.version) {
  49174. i.__image__webglTextureCube || (e.addEventListener("dispose", f),
  49175. i.__image__webglTextureCube = X.createTexture(),
  49176. ye.textures++),
  49177. _e.activeTexture(X.TEXTURE0 + t),
  49178. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  49179. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, e.flipY);
  49180. for (var n = e instanceof Ci.CompressedTexture, r = e.image[0]instanceof Ci.DataTexture, o = [], a = 0; a < 6; a++)
  49181. !Z.autoScaleCubemaps || n || r ? o[a] = r ? e.image[a].image : e.image[a] : o[a] = I(e.image[a], Ee.maxCubemapSize);
  49182. var s = E(o[0])
  49183. , l = x(e.format)
  49184. , c = x(e.type);
  49185. m(X.TEXTURE_CUBE_MAP, e, s);
  49186. for (a = 0; a < 6; a++)
  49187. if (n)
  49188. for (var h, u = o[a].mipmaps, d = 0, p = u.length; d < p; d++)
  49189. h = u[d],
  49190. e.format !== Ci.RGBAFormat && e.format !== Ci.RGBFormat ? -1 < _e.getCompressedTextureFormats().indexOf(l) ? _e.compressedTexImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, d, l, h.width, h.height, 0, h.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()") : _e.texImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, d, l, h.width, h.height, 0, l, c, h.data);
  49191. else
  49192. r ? _e.texImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, 0, l, o[a].width, o[a].height, 0, l, c, o[a].data) : _e.texImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, 0, l, l, c, o[a]);
  49193. e.generateMipmaps && s && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  49194. i.__version = e.version,
  49195. e.onUpdate && e.onUpdate(e)
  49196. } else
  49197. _e.activeTexture(X.TEXTURE0 + t),
  49198. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  49199. }
  49200. function b(e, t) {
  49201. _e.activeTexture(X.TEXTURE0 + t),
  49202. _e.bindTexture(X.TEXTURE_CUBE_MAP, be.get(e).__webglTexture)
  49203. }
  49204. function h(e, t, i, n) {
  49205. var r = x(t.texture.format)
  49206. , o = x(t.texture.type);
  49207. _e.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  49208. X.bindFramebuffer(X.FRAMEBUFFER, e),
  49209. X.framebufferTexture2D(X.FRAMEBUFFER, i, n, be.get(t.texture).__webglTexture, 0),
  49210. X.bindFramebuffer(X.FRAMEBUFFER, null)
  49211. }
  49212. function u(e, t) {
  49213. X.bindRenderbuffer(X.RENDERBUFFER, e),
  49214. t.depthBuffer && !t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_COMPONENT16, t.width, t.height),
  49215. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_ATTACHMENT, X.RENDERBUFFER, e)) : t.depthBuffer && t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_STENCIL, t.width, t.height),
  49216. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_STENCIL_ATTACHMENT, X.RENDERBUFFER, e)) : X.renderbufferStorage(X.RENDERBUFFER, X.RGBA4, t.width, t.height),
  49217. X.bindRenderbuffer(X.RENDERBUFFER, null)
  49218. }
  49219. function w(e) {
  49220. var t = be.get(e)
  49221. , i = be.get(e.texture);
  49222. e.addEventListener("dispose", a),
  49223. i.__webglTexture = X.createTexture(),
  49224. ye.textures++;
  49225. var n = e instanceof Ci.WebGLRenderTargetCube
  49226. , r = Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height);
  49227. if (n) {
  49228. t.__webglFramebuffer = [];
  49229. for (var o = 0; o < 6; o++)
  49230. t.__webglFramebuffer[o] = X.createFramebuffer()
  49231. } else
  49232. t.__webglFramebuffer = X.createFramebuffer();
  49233. if (n) {
  49234. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__webglTexture),
  49235. m(X.TEXTURE_CUBE_MAP, e.texture, r);
  49236. for (o = 0; o < 6; o++)
  49237. h(t.__webglFramebuffer[o], e, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + o);
  49238. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  49239. _e.bindTexture(X.TEXTURE_CUBE_MAP, null)
  49240. } else
  49241. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture),
  49242. m(X.TEXTURE_2D, e.texture, r),
  49243. h(t.__webglFramebuffer, e, X.COLOR_ATTACHMENT0, X.TEXTURE_2D),
  49244. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  49245. _e.bindTexture(X.TEXTURE_2D, null);
  49246. e.depthBuffer && function(e) {
  49247. var t = be.get(e);
  49248. if (e instanceof Ci.WebGLRenderTargetCube) {
  49249. t.__webglDepthbuffer = [];
  49250. for (var i = 0; i < 6; i++)
  49251. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer[i]),
  49252. t.__webglDepthbuffer[i] = X.createRenderbuffer(),
  49253. u(t.__webglDepthbuffer[i], e)
  49254. } else
  49255. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer),
  49256. t.__webglDepthbuffer = X.createRenderbuffer(),
  49257. u(t.__webglDepthbuffer, e);
  49258. X.bindFramebuffer(X.FRAMEBUFFER, null)
  49259. }(e)
  49260. }
  49261. function T(e) {
  49262. return e === Ci.NearestFilter || e === Ci.NearestMipMapNearestFilter || e === Ci.NearestMipMapLinearFilter ? X.NEAREST : X.LINEAR
  49263. }
  49264. function x(e) {
  49265. var t;
  49266. if (e === Ci.RepeatWrapping)
  49267. return X.REPEAT;
  49268. if (e === Ci.ClampToEdgeWrapping)
  49269. return X.CLAMP_TO_EDGE;
  49270. if (e === Ci.MirroredRepeatWrapping)
  49271. return X.MIRRORED_REPEAT;
  49272. if (e === Ci.NearestFilter)
  49273. return X.NEAREST;
  49274. if (e === Ci.NearestMipMapNearestFilter)
  49275. return X.NEAREST_MIPMAP_NEAREST;
  49276. if (e === Ci.NearestMipMapLinearFilter)
  49277. return X.NEAREST_MIPMAP_LINEAR;
  49278. if (e === Ci.LinearFilter)
  49279. return X.LINEAR;
  49280. if (e === Ci.LinearMipMapNearestFilter)
  49281. return X.LINEAR_MIPMAP_NEAREST;
  49282. if (e === Ci.LinearMipMapLinearFilter)
  49283. return X.LINEAR_MIPMAP_LINEAR;
  49284. if (e === Ci.UnsignedByteType)
  49285. return X.UNSIGNED_BYTE;
  49286. if (e === Ci.UnsignedShort4444Type)
  49287. return X.UNSIGNED_SHORT_4_4_4_4;
  49288. if (e === Ci.UnsignedShort5551Type)
  49289. return X.UNSIGNED_SHORT_5_5_5_1;
  49290. if (e === Ci.UnsignedShort565Type)
  49291. return X.UNSIGNED_SHORT_5_6_5;
  49292. if (e === Ci.ByteType)
  49293. return X.BYTE;
  49294. if (e === Ci.ShortType)
  49295. return X.SHORT;
  49296. if (e === Ci.UnsignedShortType)
  49297. return X.UNSIGNED_SHORT;
  49298. if (e === Ci.IntType)
  49299. return X.INT;
  49300. if (e === Ci.UnsignedIntType)
  49301. return X.UNSIGNED_INT;
  49302. if (e === Ci.FloatType)
  49303. return X.FLOAT;
  49304. if (null !== (t = Ie.get("OES_texture_half_float")) && e === Ci.HalfFloatType)
  49305. return t.HALF_FLOAT_OES;
  49306. if (e === Ci.AlphaFormat)
  49307. return X.ALPHA;
  49308. if (e === Ci.RGBFormat)
  49309. return X.RGB;
  49310. if (e === Ci.RGBAFormat)
  49311. return X.RGBA;
  49312. if (e === Ci.LuminanceFormat)
  49313. return X.LUMINANCE;
  49314. if (e === Ci.LuminanceAlphaFormat)
  49315. return X.LUMINANCE_ALPHA;
  49316. if (e === Ci.AddEquation)
  49317. return X.FUNC_ADD;
  49318. if (e === Ci.SubtractEquation)
  49319. return X.FUNC_SUBTRACT;
  49320. if (e === Ci.ReverseSubtractEquation)
  49321. return X.FUNC_REVERSE_SUBTRACT;
  49322. if (e === Ci.ZeroFactor)
  49323. return X.ZERO;
  49324. if (e === Ci.OneFactor)
  49325. return X.ONE;
  49326. if (e === Ci.SrcColorFactor)
  49327. return X.SRC_COLOR;
  49328. if (e === Ci.OneMinusSrcColorFactor)
  49329. return X.ONE_MINUS_SRC_COLOR;
  49330. if (e === Ci.SrcAlphaFactor)
  49331. return X.SRC_ALPHA;
  49332. if (e === Ci.OneMinusSrcAlphaFactor)
  49333. return X.ONE_MINUS_SRC_ALPHA;
  49334. if (e === Ci.DstAlphaFactor)
  49335. return X.DST_ALPHA;
  49336. if (e === Ci.OneMinusDstAlphaFactor)
  49337. return X.ONE_MINUS_DST_ALPHA;
  49338. if (e === Ci.DstColorFactor)
  49339. return X.DST_COLOR;
  49340. if (e === Ci.OneMinusDstColorFactor)
  49341. return X.ONE_MINUS_DST_COLOR;
  49342. if (e === Ci.SrcAlphaSaturateFactor)
  49343. return X.SRC_ALPHA_SATURATE;
  49344. if (null !== (t = Ie.get("WEBGL_compressed_texture_s3tc"))) {
  49345. if (e === Ci.RGB_S3TC_DXT1_Format)
  49346. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  49347. if (e === Ci.RGBA_S3TC_DXT1_Format)
  49348. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  49349. if (e === Ci.RGBA_S3TC_DXT3_Format)
  49350. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  49351. if (e === Ci.RGBA_S3TC_DXT5_Format)
  49352. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  49353. }
  49354. if (null !== (t = Ie.get("WEBGL_compressed_texture_pvrtc"))) {
  49355. if (e === Ci.RGB_PVRTC_4BPPV1_Format)
  49356. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  49357. if (e === Ci.RGB_PVRTC_2BPPV1_Format)
  49358. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  49359. if (e === Ci.RGBA_PVRTC_4BPPV1_Format)
  49360. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  49361. if (e === Ci.RGBA_PVRTC_2BPPV1_Format)
  49362. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  49363. }
  49364. if (null !== (t = Ie.get("WEBGL_compressed_texture_etc1")) && e === Ci.RGB_ETC1_Format)
  49365. return t.COMPRESSED_RGB_ETC1_WEBGL;
  49366. if (null !== (t = Ie.get("EXT_blend_minmax"))) {
  49367. if (e === Ci.MinEquation)
  49368. return t.MIN_EXT;
  49369. if (e === Ci.MaxEquation)
  49370. return t.MAX_EXT
  49371. }
  49372. return 0
  49373. }
  49374. console.log("THREE.WebGLRenderer", Ci.REVISION);
  49375. var O = void 0 !== (e = e || {}).canvas ? e.canvas : document.createElement("canvas")
  49376. , L = void 0 !== e.context ? e.context : null
  49377. , D = void 0 !== e.alpha && e.alpha
  49378. , N = void 0 === e.depth || e.depth
  49379. , F = void 0 === e.stencil || e.stencil
  49380. , B = void 0 !== e.antialias && e.antialias
  49381. , V = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  49382. , k = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  49383. , U = []
  49384. , H = []
  49385. , z = -1
  49386. , G = []
  49387. , W = -1
  49388. , j = new Float32Array(8)
  49389. , Y = []
  49390. , q = [];
  49391. this.domElement = O,
  49392. this.context = null,
  49393. this.autoClear = !0,
  49394. this.autoClearColor = !0,
  49395. this.autoClearDepth = !0,
  49396. this.autoClearStencil = !0,
  49397. this.sortObjects = !0,
  49398. this.gammaFactor = 2,
  49399. this.gammaInput = !1,
  49400. this.gammaOutput = !1,
  49401. this.physicallyCorrectLights = !1,
  49402. this.toneMapping = Ci.LinearToneMapping,
  49403. this.toneMappingExposure = 1,
  49404. this.toneMappingWhitePoint = 1,
  49405. this.maxMorphTargets = 8,
  49406. this.maxMorphNormals = 4,
  49407. this.autoScaleCubemaps = !0;
  49408. var X, Z = this, K = null, Q = null, J = null, $ = -1, ee = "", te = null, ie = new Ci.Vector4, ne = null, re = new Ci.Vector4, oe = 0, ae = new Ci.Color(0), se = 0, le = O.width, ce = O.height, he = 1, ue = new Ci.Vector4(0,0,le,ce), de = !1, pe = new Ci.Vector4(0,0,le,ce), fe = new Ci.Frustum, ge = new Ci.Matrix4, me = new Ci.Vector3, ve = {
  49409. hash: "",
  49410. ambient: [0, 0, 0],
  49411. directional: [],
  49412. directionalShadowMap: [],
  49413. directionalShadowMatrix: [],
  49414. spot: [],
  49415. spotShadowMap: [],
  49416. spotShadowMatrix: [],
  49417. point: [],
  49418. pointShadowMap: [],
  49419. pointShadowMatrix: [],
  49420. hemi: [],
  49421. shadows: [],
  49422. shadowsPointLight: 0
  49423. }, ye = {
  49424. geometries: 0,
  49425. textures: 0
  49426. }, Ae = {
  49427. calls: 0,
  49428. vertices: 0,
  49429. faces: 0,
  49430. points: 0
  49431. };
  49432. this.info = {
  49433. render: Ae,
  49434. memory: ye,
  49435. programs: null
  49436. };
  49437. try {
  49438. var Ce = {
  49439. alpha: D,
  49440. depth: N,
  49441. stencil: F,
  49442. antialias: B,
  49443. premultipliedAlpha: V,
  49444. preserveDrawingBuffer: k
  49445. };
  49446. if (null === (X = L || O.getContext("webgl", Ce) || O.getContext("experimental-webgl", Ce)))
  49447. throw null !== O.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  49448. void 0 === X.getShaderPrecisionFormat && (X.getShaderPrecisionFormat = function() {
  49449. return {
  49450. rangeMin: 1,
  49451. rangeMax: 1,
  49452. precision: 1
  49453. }
  49454. }
  49455. ),
  49456. O.addEventListener("webglcontextlost", r, !1)
  49457. } catch (e) {
  49458. console.error("THREE.WebGLRenderer: " + e)
  49459. }
  49460. var Ie = new Ci.WebGLExtensions(X);
  49461. Ie.get("OES_texture_float"),
  49462. Ie.get("OES_texture_float_linear"),
  49463. Ie.get("OES_texture_half_float"),
  49464. Ie.get("OES_texture_half_float_linear"),
  49465. Ie.get("OES_standard_derivatives"),
  49466. Ie.get("ANGLE_instanced_arrays"),
  49467. Ie.get("OES_element_index_uint") && (Ci.BufferGeometry.MaxIndex = 4294967296);
  49468. var Ee = new Ci.WebGLCapabilities(X,Ie,e)
  49469. , _e = new Ci.WebGLState(X,Ie,x)
  49470. , be = new Ci.WebGLProperties
  49471. , we = new Ci.WebGLObjects(X,be,this.info)
  49472. , Te = new Ci.WebGLPrograms(this,Ee)
  49473. , xe = new Ci.WebGLLights;
  49474. this.info.programs = Te.programs;
  49475. var Se = new Ci.WebGLBufferRenderer(X,Ie,Ae)
  49476. , Me = new Ci.WebGLIndexedBufferRenderer(X,Ie,Ae);
  49477. t(),
  49478. this.context = X,
  49479. this.capabilities = Ee,
  49480. this.extensions = Ie,
  49481. this.properties = be,
  49482. this.state = _e;
  49483. var Re = new Ci.WebGLShadowMap(this,ve,we);
  49484. this.shadowMap = Re;
  49485. var Pe, Oe = new Ci.SpritePlugin(this,Y), Le = new Ci.LensFlarePlugin(this,q);
  49486. this.getContext = function() {
  49487. return X
  49488. }
  49489. ,
  49490. this.getContextAttributes = function() {
  49491. return X.getContextAttributes()
  49492. }
  49493. ,
  49494. this.forceContextLoss = function() {
  49495. Ie.get("WEBGL_lose_context").loseContext()
  49496. }
  49497. ,
  49498. this.getMaxAnisotropy = function() {
  49499. if (void 0 !== Pe)
  49500. return Pe;
  49501. var e = Ie.get("EXT_texture_filter_anisotropic");
  49502. return Pe = null !== e ? X.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  49503. }
  49504. ,
  49505. this.getPrecision = function() {
  49506. return Ee.precision
  49507. }
  49508. ,
  49509. this.getPixelRatio = function() {
  49510. return he
  49511. }
  49512. ,
  49513. this.setPixelRatio = function(e) {
  49514. void 0 !== e && (he = e,
  49515. this.setSize(pe.z, pe.w, !1))
  49516. }
  49517. ,
  49518. this.getSize = function() {
  49519. return {
  49520. width: le,
  49521. height: ce
  49522. }
  49523. }
  49524. ,
  49525. this.setSize = function(e, t, i, n) {
  49526. null != n && (he = n),
  49527. le = e,
  49528. ce = t,
  49529. O.width = e * he,
  49530. O.height = t * he,
  49531. !1 !== i && (O.style.width = e + "px",
  49532. O.style.height = t + "px"),
  49533. this.setViewport(0, 0, e, t)
  49534. }
  49535. ,
  49536. this.setViewport = function(e, t, i, n) {
  49537. _e.viewport(pe.set(e, t, i, n))
  49538. }
  49539. ,
  49540. this.setScissor = function(e, t, i, n) {
  49541. _e.scissor(ue.set(e, t, i, n))
  49542. }
  49543. ,
  49544. this.setScissorTest = function(e) {
  49545. _e.setScissorTest(de = e)
  49546. }
  49547. ,
  49548. this.getClearColor = function() {
  49549. return ae
  49550. }
  49551. ,
  49552. this.setClearColor = function(e, t) {
  49553. ae.set(e),
  49554. se = void 0 !== t ? t : 1,
  49555. i(ae.r, ae.g, ae.b, se)
  49556. }
  49557. ,
  49558. this.getClearAlpha = function() {
  49559. return se
  49560. }
  49561. ,
  49562. this.setClearAlpha = function(e) {
  49563. se = e,
  49564. i(ae.r, ae.g, ae.b, se)
  49565. }
  49566. ,
  49567. this.clear = function(e, t, i) {
  49568. var n = 0;
  49569. void 0 !== e && !e || (n |= X.COLOR_BUFFER_BIT),
  49570. void 0 !== t && !t || (n |= X.DEPTH_BUFFER_BIT),
  49571. void 0 !== i && !i || (n |= X.STENCIL_BUFFER_BIT),
  49572. X.clear(n)
  49573. }
  49574. ,
  49575. this.clearColor = function() {
  49576. this.clear(!0, !1, !1)
  49577. }
  49578. ,
  49579. this.clearDepth = function() {
  49580. this.clear(!1, !0, !1)
  49581. }
  49582. ,
  49583. this.clearStencil = function() {
  49584. this.clear(!1, !1, !0)
  49585. }
  49586. ,
  49587. this.clearTarget = function(e, t, i, n) {
  49588. this.setRenderTarget(e),
  49589. this.clear(t, i, n)
  49590. }
  49591. ,
  49592. this.resetGLState = n,
  49593. this.dispose = function() {
  49594. O.removeEventListener("webglcontextlost", r, !1)
  49595. }
  49596. ,
  49597. this.renderBufferImmediate = function(e, t, i) {
  49598. _e.initAttributes();
  49599. var n = be.get(e);
  49600. e.hasPositions && !n.position && (n.position = X.createBuffer()),
  49601. e.hasNormals && !n.normal && (n.normal = X.createBuffer()),
  49602. e.hasUvs && !n.uv && (n.uv = X.createBuffer()),
  49603. e.hasColors && !n.color && (n.color = X.createBuffer());
  49604. var r = t.getAttributes();
  49605. if (e.hasPositions && (X.bindBuffer(X.ARRAY_BUFFER, n.position),
  49606. X.bufferData(X.ARRAY_BUFFER, e.positionArray, X.DYNAMIC_DRAW),
  49607. _e.enableAttribute(r.position),
  49608. X.vertexAttribPointer(r.position, 3, X.FLOAT, !1, 0, 0)),
  49609. e.hasNormals) {
  49610. if (X.bindBuffer(X.ARRAY_BUFFER, n.normal),
  49611. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === Ci.FlatShading)
  49612. for (var o = 0, a = 3 * e.count; o < a; o += 9) {
  49613. var s = e.normalArray
  49614. , l = (s[o + 0] + s[o + 3] + s[o + 6]) / 3
  49615. , c = (s[o + 1] + s[o + 4] + s[o + 7]) / 3
  49616. , h = (s[o + 2] + s[o + 5] + s[o + 8]) / 3;
  49617. s[o + 0] = l,
  49618. s[o + 1] = c,
  49619. s[o + 2] = h,
  49620. s[o + 3] = l,
  49621. s[o + 4] = c,
  49622. s[o + 5] = h,
  49623. s[o + 6] = l,
  49624. s[o + 7] = c,
  49625. s[o + 8] = h
  49626. }
  49627. X.bufferData(X.ARRAY_BUFFER, e.normalArray, X.DYNAMIC_DRAW),
  49628. _e.enableAttribute(r.normal),
  49629. X.vertexAttribPointer(r.normal, 3, X.FLOAT, !1, 0, 0)
  49630. }
  49631. e.hasUvs && i.map && (X.bindBuffer(X.ARRAY_BUFFER, n.uv),
  49632. X.bufferData(X.ARRAY_BUFFER, e.uvArray, X.DYNAMIC_DRAW),
  49633. _e.enableAttribute(r.uv),
  49634. X.vertexAttribPointer(r.uv, 2, X.FLOAT, !1, 0, 0)),
  49635. e.hasColors && i.vertexColors !== Ci.NoColors && (X.bindBuffer(X.ARRAY_BUFFER, n.color),
  49636. X.bufferData(X.ARRAY_BUFFER, e.colorArray, X.DYNAMIC_DRAW),
  49637. _e.enableAttribute(r.color),
  49638. X.vertexAttribPointer(r.color, 3, X.FLOAT, !1, 0, 0)),
  49639. _e.disableUnusedAttributes(),
  49640. X.drawArrays(X.TRIANGLES, 0, e.count),
  49641. e.count = 0
  49642. }
  49643. ,
  49644. this.renderBufferDirect = function(e, t, i, n, r, o) {
  49645. R(n);
  49646. var a = P(e, t, n, r)
  49647. , s = !1
  49648. , l = i.id + "_" + a.id + "_" + n.wireframe;
  49649. l !== ee && (ee = l,
  49650. s = !0);
  49651. var c = r.morphTargetInfluences;
  49652. if (void 0 !== c) {
  49653. for (var h = [], u = 0, d = c.length; u < d; u++) {
  49654. var p = c[u];
  49655. h.push([p, u])
  49656. }
  49657. h.sort(M),
  49658. 8 < h.length && (h.length = 8);
  49659. var f = i.morphAttributes;
  49660. for (u = 0,
  49661. d = h.length; u < d; u++) {
  49662. p = h[u];
  49663. if (j[u] = p[0],
  49664. 0 !== p[0]) {
  49665. var g = p[1];
  49666. !0 === n.morphTargets && f.position && i.addAttribute("morphTarget" + u, f.position[g]),
  49667. !0 === n.morphNormals && f.normal && i.addAttribute("morphNormal" + u, f.normal[g])
  49668. } else
  49669. !0 === n.morphTargets && i.removeAttribute("morphTarget" + u),
  49670. !0 === n.morphNormals && i.removeAttribute("morphNormal" + u)
  49671. }
  49672. var m = a.getUniforms();
  49673. null !== m.morphTargetInfluences && X.uniform1fv(m.morphTargetInfluences, j),
  49674. s = !0
  49675. }
  49676. g = i.index;
  49677. var v, y = i.attributes.position;
  49678. !0 === n.wireframe && (g = we.getWireframeAttribute(i)),
  49679. null !== g ? (v = Me).setIndex(g) : v = Se,
  49680. s && (function(e, t, i, n) {
  49681. var r;
  49682. if (i instanceof Ci.InstancedBufferGeometry && null === (r = Ie.get("ANGLE_instanced_arrays")))
  49683. console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  49684. else {
  49685. void 0 === n && (n = 0),
  49686. _e.initAttributes();
  49687. var o = i.attributes
  49688. , a = t.getAttributes()
  49689. , s = e.defaultAttributeValues;
  49690. for (var l in a) {
  49691. var c = a[l];
  49692. if (0 <= c) {
  49693. var h = o[l];
  49694. if (void 0 !== h) {
  49695. var u = h.itemSize
  49696. , d = we.getAttributeBuffer(h);
  49697. if (h instanceof Ci.InterleavedBufferAttribute) {
  49698. var p = h.data
  49699. , f = p.stride
  49700. , g = h.offset;
  49701. p instanceof Ci.InstancedInterleavedBuffer ? (_e.enableAttributeAndDivisor(c, p.meshPerAttribute, r),
  49702. void 0 === i.maxInstancedCount && (i.maxInstancedCount = p.meshPerAttribute * p.count)) : _e.enableAttribute(c),
  49703. X.bindBuffer(X.ARRAY_BUFFER, d),
  49704. X.vertexAttribPointer(c, u, X.FLOAT, !1, f * p.array.BYTES_PER_ELEMENT, (n * f + g) * p.array.BYTES_PER_ELEMENT)
  49705. } else
  49706. h instanceof Ci.InstancedBufferAttribute ? (_e.enableAttributeAndDivisor(c, h.meshPerAttribute, r),
  49707. void 0 === i.maxInstancedCount && (i.maxInstancedCount = h.meshPerAttribute * h.count)) : _e.enableAttribute(c),
  49708. X.bindBuffer(X.ARRAY_BUFFER, d),
  49709. X.vertexAttribPointer(c, u, X.FLOAT, !1, 0, n * u * 4)
  49710. } else if (void 0 !== s) {
  49711. var m = s[l];
  49712. if (void 0 !== m)
  49713. switch (m.length) {
  49714. case 2:
  49715. X.vertexAttrib2fv(c, m);
  49716. break;
  49717. case 3:
  49718. X.vertexAttrib3fv(c, m);
  49719. break;
  49720. case 4:
  49721. X.vertexAttrib4fv(c, m);
  49722. break;
  49723. default:
  49724. X.vertexAttrib1fv(c, m)
  49725. }
  49726. }
  49727. }
  49728. }
  49729. _e.disableUnusedAttributes()
  49730. }
  49731. }(n, a, i),
  49732. null !== g && X.bindBuffer(X.ELEMENT_ARRAY_BUFFER, we.getAttributeBuffer(g)));
  49733. var A = 1 / 0;
  49734. null !== g ? A = g.count : void 0 !== y && (A = y.count);
  49735. var C = i.drawRange.start
  49736. , I = i.drawRange.count
  49737. , E = null !== o ? o.start : 0
  49738. , _ = null !== o ? o.count : 1 / 0
  49739. , b = Math.max(0, C, E)
  49740. , w = Math.min(0 + A, C + I, E + _) - 1
  49741. , T = Math.max(0, w - b + 1);
  49742. if (r instanceof Ci.Mesh)
  49743. if (!0 === n.wireframe)
  49744. _e.setLineWidth(n.wireframeLinewidth * S()),
  49745. v.setMode(X.LINES);
  49746. else
  49747. switch (r.drawMode) {
  49748. case Ci.TrianglesDrawMode:
  49749. v.setMode(X.TRIANGLES);
  49750. break;
  49751. case Ci.TriangleStripDrawMode:
  49752. v.setMode(X.TRIANGLE_STRIP);
  49753. break;
  49754. case Ci.TriangleFanDrawMode:
  49755. v.setMode(X.TRIANGLE_FAN)
  49756. }
  49757. else if (r instanceof Ci.Line) {
  49758. var x = n.linewidth;
  49759. void 0 === x && (x = 1),
  49760. _e.setLineWidth(x * S()),
  49761. r instanceof Ci.LineSegments ? v.setMode(X.LINES) : v.setMode(X.LINE_STRIP)
  49762. } else
  49763. r instanceof Ci.Points && v.setMode(X.POINTS);
  49764. i instanceof Ci.InstancedBufferGeometry ? 0 < i.maxInstancedCount && v.renderInstances(i, b, T) : v.render(b, T)
  49765. }
  49766. ,
  49767. this.render = function(e, t, i, n) {
  49768. if (t instanceof Ci.Camera != 0) {
  49769. var r = e.fog;
  49770. if (ee = "",
  49771. $ = -1,
  49772. !(te = null) === e.autoUpdate && e.updateMatrixWorld(),
  49773. null === t.parent && t.updateMatrixWorld(),
  49774. t.matrixWorldInverse.getInverse(t.matrixWorld),
  49775. ge.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  49776. fe.setFromMatrix(ge),
  49777. U.length = 0,
  49778. W = z = -1,
  49779. Y.length = 0,
  49780. q.length = 0,
  49781. function e(t, i) {
  49782. if (!1 !== t.visible) {
  49783. if (t.layers.test(i.layers))
  49784. if (t instanceof Ci.Light)
  49785. U.push(t);
  49786. else if (t instanceof Ci.Sprite)
  49787. !1 !== t.frustumCulled && !0 !== fe.intersectsObject(t) || Y.push(t);
  49788. else if (t instanceof Ci.LensFlare)
  49789. q.push(t);
  49790. else if (t instanceof Ci.ImmediateRenderObject)
  49791. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49792. me.applyProjection(ge)),
  49793. d(t, null, t.material, me.z, null);
  49794. else if ((t instanceof Ci.Mesh || t instanceof Ci.Line || t instanceof Ci.Points) && (t instanceof Ci.SkinnedMesh && t.skeleton.update(),
  49795. !1 === t.frustumCulled || !0 === fe.intersectsObject(t))) {
  49796. var n = t.material;
  49797. if (!0 === n.visible) {
  49798. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49799. me.applyProjection(ge));
  49800. var r = we.update(t);
  49801. if (n instanceof Ci.MultiMaterial)
  49802. for (var o = r.groups, a = n.materials, s = 0, l = o.length; s < l; s++) {
  49803. var c = o[s]
  49804. , h = a[c.materialIndex];
  49805. !0 === h.visible && d(t, r, h, me.z, c)
  49806. }
  49807. else
  49808. d(t, r, n, me.z, null)
  49809. }
  49810. }
  49811. var u = t.children;
  49812. for (s = 0,
  49813. l = u.length; s < l; s++)
  49814. e(u[s], i)
  49815. }
  49816. }(e, t),
  49817. H.length = z + 1,
  49818. G.length = W + 1,
  49819. !0 === Z.sortObjects && (H.sort(s),
  49820. G.sort(l)),
  49821. function(e, t) {
  49822. var i, n, r, o, a, s, l = 0, c = 0, h = 0, u = t.matrixWorldInverse, d = 0, p = 0, f = 0, g = 0, m = 0;
  49823. for (i = ve.shadowsPointLight = 0,
  49824. n = e.length; i < n; i++)
  49825. if (o = (r = e[i]).color,
  49826. a = r.intensity,
  49827. s = r.distance,
  49828. r instanceof Ci.AmbientLight)
  49829. l += o.r * a,
  49830. c += o.g * a,
  49831. h += o.b * a;
  49832. else if (r instanceof Ci.DirectionalLight) {
  49833. (v = xe.get(r)).color.copy(r.color).multiplyScalar(r.intensity),
  49834. v.direction.setFromMatrixPosition(r.matrixWorld),
  49835. me.setFromMatrixPosition(r.target.matrixWorld),
  49836. v.direction.sub(me),
  49837. v.direction.transformDirection(u),
  49838. v.shadow = r.castShadow,
  49839. r.castShadow && (v.shadowBias = r.shadow.bias,
  49840. v.shadowRadius = r.shadow.radius,
  49841. v.shadowMapSize = r.shadow.mapSize,
  49842. ve.shadows[m++] = r),
  49843. ve.directionalShadowMap[d] = r.shadow.map,
  49844. ve.directionalShadowMatrix[d] = r.shadow.matrix,
  49845. ve.directional[d++] = v
  49846. } else if (r instanceof Ci.SpotLight) {
  49847. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49848. v.position.applyMatrix4(u),
  49849. v.color.copy(o).multiplyScalar(a),
  49850. v.distance = s,
  49851. v.direction.setFromMatrixPosition(r.matrixWorld),
  49852. me.setFromMatrixPosition(r.target.matrixWorld),
  49853. v.direction.sub(me),
  49854. v.direction.transformDirection(u),
  49855. v.coneCos = Math.cos(r.angle),
  49856. v.penumbraCos = Math.cos(r.angle * (1 - r.penumbra)),
  49857. v.decay = 0 === r.distance ? 0 : r.decay,
  49858. v.shadow = r.castShadow,
  49859. r.castShadow && (v.shadowBias = r.shadow.bias,
  49860. v.shadowRadius = r.shadow.radius,
  49861. v.shadowMapSize = r.shadow.mapSize,
  49862. ve.shadows[m++] = r),
  49863. ve.spotShadowMap[f] = r.shadow.map,
  49864. ve.spotShadowMatrix[f] = r.shadow.matrix,
  49865. ve.spot[f++] = v
  49866. } else if (r instanceof Ci.PointLight) {
  49867. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49868. v.position.applyMatrix4(u),
  49869. v.color.copy(r.color).multiplyScalar(r.intensity),
  49870. v.distance = r.distance,
  49871. v.decay = 0 === r.distance ? 0 : r.decay,
  49872. v.shadow = r.castShadow,
  49873. r.castShadow && (v.shadowBias = r.shadow.bias,
  49874. v.shadowRadius = r.shadow.radius,
  49875. v.shadowMapSize = r.shadow.mapSize,
  49876. ve.shadows[m++] = r),
  49877. ve.pointShadowMap[p] = r.shadow.map,
  49878. void 0 === ve.pointShadowMatrix[p] && (ve.pointShadowMatrix[p] = new Ci.Matrix4),
  49879. me.setFromMatrixPosition(r.matrixWorld).negate(),
  49880. ve.pointShadowMatrix[p].identity().setPosition(me),
  49881. ve.point[p++] = v
  49882. } else if (r instanceof Ci.HemisphereLight) {
  49883. var v;
  49884. (v = xe.get(r)).direction.setFromMatrixPosition(r.matrixWorld),
  49885. v.direction.transformDirection(u),
  49886. v.direction.normalize(),
  49887. v.skyColor.copy(r.color).multiplyScalar(a),
  49888. v.groundColor.copy(r.groundColor).multiplyScalar(a),
  49889. ve.hemi[g++] = v
  49890. }
  49891. ve.ambient[0] = l,
  49892. ve.ambient[1] = c,
  49893. ve.ambient[2] = h,
  49894. ve.directional.length = d,
  49895. ve.spot.length = f,
  49896. ve.point.length = p,
  49897. ve.hemi.length = g,
  49898. ve.shadows.length = m,
  49899. ve.hash = d + "," + p + "," + f + "," + g + "," + m
  49900. }(U, t),
  49901. Re.render(e, t),
  49902. Ae.calls = 0,
  49903. Ae.vertices = 0,
  49904. Ae.faces = 0,
  49905. void (Ae.points = 0) === i && (i = null),
  49906. this.setRenderTarget(i),
  49907. (this.autoClear || n) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  49908. e.overrideMaterial) {
  49909. var o = e.overrideMaterial;
  49910. c(H, t, r, o),
  49911. c(G, t, r, o)
  49912. } else
  49913. _e.setBlending(Ci.NoBlending),
  49914. c(H, t, r),
  49915. c(G, t, r);
  49916. if (Oe.render(e, t),
  49917. Le.render(e, t, re),
  49918. i) {
  49919. var a = i.texture;
  49920. a.generateMipmaps && E(i) && a.minFilter !== Ci.NearestFilter && a.minFilter !== Ci.LinearFilter && function(e) {
  49921. var t = e instanceof Ci.WebGLRenderTargetCube ? X.TEXTURE_CUBE_MAP : X.TEXTURE_2D
  49922. , i = be.get(e.texture).__webglTexture;
  49923. _e.bindTexture(t, i),
  49924. X.generateMipmap(t),
  49925. _e.bindTexture(t, null)
  49926. }(i)
  49927. }
  49928. _e.setDepthTest(!0),
  49929. _e.setDepthWrite(!0),
  49930. _e.setColorWrite(!0)
  49931. } else
  49932. console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")
  49933. }
  49934. ,
  49935. this.setFaceCulling = function(e, t) {
  49936. e === Ci.CullFaceNone ? _e.disable(X.CULL_FACE) : (t === Ci.FrontFaceDirectionCW ? X.frontFace(X.CW) : X.frontFace(X.CCW),
  49937. e === Ci.CullFaceBack ? X.cullFace(X.BACK) : e === Ci.CullFaceFront ? X.cullFace(X.FRONT) : X.cullFace(X.FRONT_AND_BACK),
  49938. _e.enable(X.CULL_FACE))
  49939. }
  49940. ,
  49941. this.setTexture = function(e, t) {
  49942. var i = be.get(e);
  49943. if (0 < e.version && i.__version !== e.version) {
  49944. var n = e.image;
  49945. return void 0 === n ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined", e) : !1 === n.complete ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete", e) : void o(i, e, t)
  49946. }
  49947. _e.activeTexture(X.TEXTURE0 + t),
  49948. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture)
  49949. }
  49950. ,
  49951. this.getCurrentRenderTarget = function() {
  49952. return Q
  49953. }
  49954. ,
  49955. this.setRenderTarget = function(e) {
  49956. (Q = e) && void 0 === be.get(e).__webglFramebuffer && w(e);
  49957. var t, i = e instanceof Ci.WebGLRenderTargetCube;
  49958. if (e) {
  49959. var n = be.get(e);
  49960. t = i ? n.__webglFramebuffer[e.activeCubeFace] : n.__webglFramebuffer,
  49961. ie.copy(e.scissor),
  49962. ne = e.scissorTest,
  49963. re.copy(e.viewport)
  49964. } else
  49965. t = null,
  49966. ie.copy(ue).multiplyScalar(he),
  49967. ne = de,
  49968. re.copy(pe).multiplyScalar(he);
  49969. if (J !== t && (X.bindFramebuffer(X.FRAMEBUFFER, t),
  49970. J = t),
  49971. _e.scissor(ie),
  49972. _e.setScissorTest(ne),
  49973. _e.viewport(re),
  49974. i) {
  49975. var r = be.get(e.texture);
  49976. X.framebufferTexture2D(X.FRAMEBUFFER, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, r.__webglTexture, e.activeMipMapLevel)
  49977. }
  49978. }
  49979. ,
  49980. this.readRenderTargetPixels = function(e, t, i, n, r, o) {
  49981. if (e instanceof Ci.WebGLRenderTarget != 0) {
  49982. var a = be.get(e).__webglFramebuffer;
  49983. if (a) {
  49984. var s = !1;
  49985. a !== J && (X.bindFramebuffer(X.FRAMEBUFFER, a),
  49986. s = !0);
  49987. try {
  49988. var l = e.texture;
  49989. if (l.format !== Ci.RGBAFormat && x(l.format) !== X.getParameter(X.IMPLEMENTATION_COLOR_READ_FORMAT))
  49990. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  49991. if (!(l.type === Ci.UnsignedByteType || x(l.type) === X.getParameter(X.IMPLEMENTATION_COLOR_READ_TYPE) || l.type === Ci.FloatType && Ie.get("WEBGL_color_buffer_float") || l.type === Ci.HalfFloatType && Ie.get("EXT_color_buffer_half_float")))
  49992. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  49993. X.checkFramebufferStatus(X.FRAMEBUFFER) === X.FRAMEBUFFER_COMPLETE ? X.readPixels(t, i, n, r, x(l.format), x(l.type), o) : console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")
  49994. } finally {
  49995. s && X.bindFramebuffer(X.FRAMEBUFFER, J)
  49996. }
  49997. }
  49998. } else
  49999. console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")
  50000. }
  50001. }
  50002. ,
  50003. Ci.WebGLRenderTarget = function(e, t, i) {
  50004. this.uuid = Ci.Math.generateUUID(),
  50005. this.width = e,
  50006. this.height = t,
  50007. this.scissor = new Ci.Vector4(0,0,e,t),
  50008. this.scissorTest = !1,
  50009. this.viewport = new Ci.Vector4(0,0,e,t),
  50010. void 0 === (i = i || {}).minFilter && (i.minFilter = Ci.LinearFilter),
  50011. this.texture = new Ci.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  50012. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  50013. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  50014. }
  50015. ,
  50016. Ci.WebGLRenderTarget.prototype = {
  50017. constructor: Ci.WebGLRenderTarget,
  50018. setSize: function(e, t) {
  50019. this.width === e && this.height === t || (this.width = e,
  50020. this.height = t,
  50021. this.dispose()),
  50022. this.viewport.set(0, 0, e, t),
  50023. this.scissor.set(0, 0, e, t)
  50024. },
  50025. clone: function() {
  50026. return (new this.constructor).copy(this)
  50027. },
  50028. copy: function(e) {
  50029. return this.width = e.width,
  50030. this.height = e.height,
  50031. this.viewport.copy(e.viewport),
  50032. this.texture = e.texture.clone(),
  50033. this.depthBuffer = e.depthBuffer,
  50034. this.stencilBuffer = e.stencilBuffer,
  50035. this
  50036. },
  50037. dispose: function() {
  50038. this.dispatchEvent({
  50039. type: "dispose"
  50040. })
  50041. }
  50042. },
  50043. Ci.EventDispatcher.prototype.apply(Ci.WebGLRenderTarget.prototype),
  50044. Ci.WebGLRenderTargetCube = function(e, t, i) {
  50045. Ci.WebGLRenderTarget.call(this, e, t, i),
  50046. this.activeCubeFace = 0,
  50047. this.activeMipMapLevel = 0
  50048. }
  50049. ,
  50050. Ci.WebGLRenderTargetCube.prototype = Object.create(Ci.WebGLRenderTarget.prototype),
  50051. Ci.WebGLRenderTargetCube.prototype.constructor = Ci.WebGLRenderTargetCube,
  50052. Ci.WebGLBufferRenderer = function(r, o, a) {
  50053. var s;
  50054. this.setMode = function(e) {
  50055. s = e
  50056. }
  50057. ,
  50058. this.render = function(e, t) {
  50059. r.drawArrays(s, e, t),
  50060. a.calls++,
  50061. a.vertices += t,
  50062. s === r.TRIANGLES && (a.faces += t / 3)
  50063. }
  50064. ,
  50065. this.renderInstances = function(e) {
  50066. var t = o.get("ANGLE_instanced_arrays");
  50067. if (null !== t) {
  50068. var i = e.attributes.position
  50069. , n = 0;
  50070. n = i instanceof Ci.InterleavedBufferAttribute ? i.data.count : i.count,
  50071. t.drawArraysInstancedANGLE(s, 0, n, e.maxInstancedCount),
  50072. a.calls++,
  50073. a.vertices += n * e.maxInstancedCount,
  50074. s === r.TRIANGLES && (a.faces += e.maxInstancedCount * n / 3)
  50075. } else
  50076. console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")
  50077. }
  50078. }
  50079. ,
  50080. Ci.WebGLIndexedBufferRenderer = function(r, o, a) {
  50081. var s, l, c;
  50082. this.setMode = function(e) {
  50083. s = e
  50084. }
  50085. ,
  50086. this.setIndex = function(e) {
  50087. c = e.array instanceof Uint32Array && o.get("OES_element_index_uint") ? (l = r.UNSIGNED_INT,
  50088. 4) : (l = r.UNSIGNED_SHORT,
  50089. 2)
  50090. }
  50091. ,
  50092. this.render = function(e, t) {
  50093. r.drawElements(s, t, l, e * c),
  50094. a.calls++,
  50095. a.vertices += t,
  50096. s === r.TRIANGLES && (a.faces += t / 3)
  50097. }
  50098. ,
  50099. this.renderInstances = function(e, t, i) {
  50100. var n = o.get("ANGLE_instanced_arrays");
  50101. return null === n ? void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.") : (n.drawElementsInstancedANGLE(s, i, l, t * c, e.maxInstancedCount),
  50102. a.calls++,
  50103. a.vertices += i * e.maxInstancedCount,
  50104. void (s === r.TRIANGLES && (a.faces += e.maxInstancedCount * i / 3)))
  50105. }
  50106. }
  50107. ,
  50108. Ci.WebGLExtensions = function(i) {
  50109. var n = {};
  50110. this.get = function(e) {
  50111. if (void 0 !== n[e])
  50112. return n[e];
  50113. var t;
  50114. switch (e) {
  50115. case "EXT_texture_filter_anisotropic":
  50116. t = i.getExtension("EXT_texture_filter_anisotropic") || i.getExtension("MOZ_EXT_texture_filter_anisotropic") || i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  50117. break;
  50118. case "WEBGL_compressed_texture_s3tc":
  50119. t = i.getExtension("WEBGL_compressed_texture_s3tc") || i.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  50120. break;
  50121. case "WEBGL_compressed_texture_pvrtc":
  50122. t = i.getExtension("WEBGL_compressed_texture_pvrtc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  50123. break;
  50124. case "WEBGL_compressed_texture_etc1":
  50125. t = i.getExtension("WEBGL_compressed_texture_etc1");
  50126. break;
  50127. default:
  50128. t = i.getExtension(e)
  50129. }
  50130. return null === t && console.warn("THREE.WebGLRenderer: " + e + " extension not supported."),
  50131. n[e] = t
  50132. }
  50133. }
  50134. ,
  50135. Ci.WebGLCapabilities = function(t, e, i) {
  50136. function n(e) {
  50137. if ("highp" === e) {
  50138. if (0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.HIGH_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT).precision)
  50139. return "highp";
  50140. e = "mediump"
  50141. }
  50142. return "mediump" === e && 0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.MEDIUM_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.MEDIUM_FLOAT).precision ? "mediump" : "lowp"
  50143. }
  50144. this.getMaxPrecision = n,
  50145. this.precision = void 0 !== i.precision ? i.precision : "highp",
  50146. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  50147. this.maxTextures = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
  50148. this.maxVertexTextures = t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  50149. this.maxTextureSize = t.getParameter(t.MAX_TEXTURE_SIZE),
  50150. this.maxCubemapSize = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),
  50151. this.maxAttributes = t.getParameter(t.MAX_VERTEX_ATTRIBS),
  50152. this.maxVertexUniforms = t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),
  50153. this.maxVaryings = t.getParameter(t.MAX_VARYING_VECTORS),
  50154. this.maxFragmentUniforms = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),
  50155. this.vertexTextures = 0 < this.maxVertexTextures,
  50156. this.floatFragmentTextures = !!e.get("OES_texture_float"),
  50157. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  50158. var r = n(this.precision);
  50159. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  50160. this.precision = r),
  50161. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!e.get("EXT_frag_depth"))
  50162. }
  50163. ,
  50164. Ci.WebGLGeometries = function(i, o, a) {
  50165. function s(e) {
  50166. var t = e.target
  50167. , i = c[t.id];
  50168. null !== i.index && l(i.index),
  50169. function(e) {
  50170. for (var t in e)
  50171. l(e[t])
  50172. }(i.attributes),
  50173. t.removeEventListener("dispose", s),
  50174. delete c[t.id];
  50175. var n = o.get(t);
  50176. n.wireframe && l(n.wireframe),
  50177. o.delete(t);
  50178. var r = o.get(i);
  50179. r.wireframe && l(r.wireframe),
  50180. o.delete(i),
  50181. a.memory.geometries--
  50182. }
  50183. function l(e) {
  50184. var t = function(e) {
  50185. return e instanceof Ci.InterleavedBufferAttribute ? o.get(e.data).__webglBuffer : o.get(e).__webglBuffer
  50186. }(e);
  50187. void 0 !== t && (i.deleteBuffer(t),
  50188. function(e) {
  50189. e instanceof Ci.InterleavedBufferAttribute ? o.delete(e.data) : o.delete(e)
  50190. }(e))
  50191. }
  50192. var c = {};
  50193. this.get = function(e) {
  50194. var t, i = e.geometry;
  50195. return void 0 !== c[i.id] ? c[i.id] : (i.addEventListener("dispose", s),
  50196. i instanceof Ci.BufferGeometry ? t = i : i instanceof Ci.Geometry && (void 0 === i._bufferGeometry && (i._bufferGeometry = (new Ci.BufferGeometry).setFromObject(e)),
  50197. t = i._bufferGeometry),
  50198. c[i.id] = t,
  50199. a.memory.geometries++,
  50200. t)
  50201. }
  50202. }
  50203. ,
  50204. Ci.WebGLLights = function() {
  50205. var i = {};
  50206. this.get = function(e) {
  50207. if (void 0 !== i[e.id])
  50208. return i[e.id];
  50209. var t;
  50210. switch (e.type) {
  50211. case "DirectionalLight":
  50212. t = {
  50213. direction: new Ci.Vector3,
  50214. color: new Ci.Color,
  50215. shadow: !1,
  50216. shadowBias: 0,
  50217. shadowRadius: 1,
  50218. shadowMapSize: new Ci.Vector2
  50219. };
  50220. break;
  50221. case "SpotLight":
  50222. t = {
  50223. position: new Ci.Vector3,
  50224. direction: new Ci.Vector3,
  50225. color: new Ci.Color,
  50226. distance: 0,
  50227. coneCos: 0,
  50228. penumbraCos: 0,
  50229. decay: 0,
  50230. shadow: !1,
  50231. shadowBias: 0,
  50232. shadowRadius: 1,
  50233. shadowMapSize: new Ci.Vector2
  50234. };
  50235. break;
  50236. case "PointLight":
  50237. t = {
  50238. position: new Ci.Vector3,
  50239. color: new Ci.Color,
  50240. distance: 0,
  50241. decay: 0,
  50242. shadow: !1,
  50243. shadowBias: 0,
  50244. shadowRadius: 1,
  50245. shadowMapSize: new Ci.Vector2
  50246. };
  50247. break;
  50248. case "HemisphereLight":
  50249. t = {
  50250. direction: new Ci.Vector3,
  50251. skyColor: new Ci.Color,
  50252. groundColor: new Ci.Color
  50253. }
  50254. }
  50255. return i[e.id] = t
  50256. }
  50257. }
  50258. ,
  50259. Ci.WebGLObjects = function(g, m, e) {
  50260. function v(e, t) {
  50261. var i = e instanceof Ci.InterleavedBufferAttribute ? e.data : e
  50262. , n = m.get(i);
  50263. void 0 === n.__webglBuffer ? function(e, t, i) {
  50264. e.__webglBuffer = g.createBuffer(),
  50265. g.bindBuffer(i, e.__webglBuffer);
  50266. var n = t.dynamic ? g.DYNAMIC_DRAW : g.STATIC_DRAW;
  50267. g.bufferData(i, t.array, n),
  50268. e.version = t.version
  50269. }(n, i, t) : n.version !== i.version && function(e, t, i) {
  50270. g.bindBuffer(i, e.__webglBuffer),
  50271. !1 === t.dynamic || -1 === t.updateRange.count ? g.bufferSubData(i, 0, t.array) : 0 === t.updateRange.count ? console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.") : (g.bufferSubData(i, t.updateRange.offset * t.array.BYTES_PER_ELEMENT, t.array.subarray(t.updateRange.offset, t.updateRange.offset + t.updateRange.count)),
  50272. t.updateRange.count = 0),
  50273. e.version = t.version
  50274. }(n, i, t)
  50275. }
  50276. function y(e, t, i) {
  50277. if (i < t) {
  50278. var n = t;
  50279. t = i,
  50280. i = n
  50281. }
  50282. var r = e[t];
  50283. return void 0 === r ? (e[t] = [i],
  50284. !0) : -1 === r.indexOf(i) && (r.push(i),
  50285. !0)
  50286. }
  50287. var c = new Ci.WebGLGeometries(g,m,e);
  50288. this.getAttributeBuffer = function(e) {
  50289. return e instanceof Ci.InterleavedBufferAttribute ? m.get(e.data).__webglBuffer : m.get(e).__webglBuffer
  50290. }
  50291. ,
  50292. this.getWireframeAttribute = function(e) {
  50293. var t = m.get(e);
  50294. if (void 0 !== t.wireframe)
  50295. return t.wireframe;
  50296. var i, n = [], r = e.index, o = e.attributes, a = o.position;
  50297. if (null !== r)
  50298. for (var s = {}, l = 0, c = (i = r.array).length; l < c; l += 3) {
  50299. var h = i[l + 0]
  50300. , u = i[l + 1]
  50301. , d = i[l + 2];
  50302. y(s, h, u) && n.push(h, u),
  50303. y(s, u, d) && n.push(u, d),
  50304. y(s, d, h) && n.push(d, h)
  50305. }
  50306. else
  50307. for (l = 0,
  50308. c = (i = o.position.array).length / 3 - 1; l < c; l += 3) {
  50309. h = l + 0,
  50310. u = l + 1,
  50311. d = l + 2;
  50312. n.push(h, u, u, d, d, h)
  50313. }
  50314. var p = 65535 < a.count ? Uint32Array : Uint16Array
  50315. , f = new Ci.BufferAttribute(new p(n),1);
  50316. return v(f, g.ELEMENT_ARRAY_BUFFER),
  50317. t.wireframe = f
  50318. }
  50319. ,
  50320. this.update = function(e) {
  50321. var t = c.get(e);
  50322. e.geometry instanceof Ci.Geometry && t.updateFromObject(e);
  50323. var i = t.index
  50324. , n = t.attributes;
  50325. for (var r in null !== i && v(i, g.ELEMENT_ARRAY_BUFFER),
  50326. n)
  50327. v(n[r], g.ARRAY_BUFFER);
  50328. var o = t.morphAttributes;
  50329. for (var r in o)
  50330. for (var a = o[r], s = 0, l = a.length; s < l; s++)
  50331. v(a[s], g.ARRAY_BUFFER);
  50332. return t
  50333. }
  50334. }
  50335. ,
  50336. Ci.WebGLProgram = (Qt = 0,
  50337. Jt = /^([\w\d_]+)\.([\w\d_]+)$/,
  50338. $t = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  50339. ei = /^([\w\d_]+)\[0\]$/,
  50340. function(e, t, i, n) {
  50341. var r = e.context
  50342. , o = i.extensions
  50343. , a = i.defines
  50344. , s = i.__webglShader.vertexShader
  50345. , l = i.__webglShader.fragmentShader
  50346. , c = "SHADOWMAP_TYPE_BASIC";
  50347. n.shadowMapType === Ci.PCFShadowMap ? c = "SHADOWMAP_TYPE_PCF" : n.shadowMapType === Ci.PCFSoftShadowMap && (c = "SHADOWMAP_TYPE_PCF_SOFT");
  50348. var h = "ENVMAP_TYPE_CUBE"
  50349. , u = "ENVMAP_MODE_REFLECTION"
  50350. , d = "ENVMAP_BLENDING_MULTIPLY";
  50351. if (n.envMap) {
  50352. switch (i.envMap.mapping) {
  50353. case Ci.CubeReflectionMapping:
  50354. case Ci.CubeRefractionMapping:
  50355. h = "ENVMAP_TYPE_CUBE";
  50356. break;
  50357. case Ci.CubeUVReflectionMapping:
  50358. case Ci.CubeUVRefractionMapping:
  50359. h = "ENVMAP_TYPE_CUBE_UV";
  50360. break;
  50361. case Ci.EquirectangularReflectionMapping:
  50362. case Ci.EquirectangularRefractionMapping:
  50363. h = "ENVMAP_TYPE_EQUIREC";
  50364. break;
  50365. case Ci.SphericalReflectionMapping:
  50366. h = "ENVMAP_TYPE_SPHERE"
  50367. }
  50368. switch (i.envMap.mapping) {
  50369. case Ci.CubeRefractionMapping:
  50370. case Ci.EquirectangularRefractionMapping:
  50371. u = "ENVMAP_MODE_REFRACTION"
  50372. }
  50373. switch (i.combine) {
  50374. case Ci.MultiplyOperation:
  50375. d = "ENVMAP_BLENDING_MULTIPLY";
  50376. break;
  50377. case Ci.MixOperation:
  50378. d = "ENVMAP_BLENDING_MIX";
  50379. break;
  50380. case Ci.AddOperation:
  50381. d = "ENVMAP_BLENDING_ADD"
  50382. }
  50383. }
  50384. var p, f, g = 0 < e.gammaFactor ? e.gammaFactor : 1, m = function(e, t, i) {
  50385. return [(e = e || {}).derivatives || t.envMapCubeUV || t.bumpMap || t.normalMap || t.flatShading ? "#extension GL_OES_standard_derivatives : enable" : "", (e.fragDepth || t.logarithmicDepthBuffer) && i.get("EXT_frag_depth") ? "#extension GL_EXT_frag_depth : enable" : "", e.drawBuffers && i.get("WEBGL_draw_buffers") ? "#extension GL_EXT_draw_buffers : require" : "", (e.shaderTextureLOD || t.envMap) && i.get("EXT_shader_texture_lod") ? "#extension GL_EXT_shader_texture_lod : enable" : ""].filter(Pi).join("\n")
  50386. }(o, n, e.extensions), v = function(e) {
  50387. var t = [];
  50388. for (var i in e) {
  50389. var n = e[i];
  50390. !1 !== n && t.push("#define " + i + " " + n)
  50391. }
  50392. return t.join("\n")
  50393. }(a), y = r.createProgram();
  50394. f = i instanceof Ci.RawShaderMaterial ? p = "" : (p = ["precision " + n.precision + " float;", "precision " + n.precision + " int;", "#define SHADER_NAME " + i.__webglShader.name, v, n.supportsVertexTextures ? "#define VERTEX_TEXTURES" : "", "#define GAMMA_FACTOR " + g, "#define MAX_BONES " + n.maxBones, n.map ? "#define USE_MAP" : "", n.envMap ? "#define USE_ENVMAP" : "", n.envMap ? "#define " + u : "", n.lightMap ? "#define USE_LIGHTMAP" : "", n.aoMap ? "#define USE_AOMAP" : "", n.emissiveMap ? "#define USE_EMISSIVEMAP" : "", n.bumpMap ? "#define USE_BUMPMAP" : "", n.normalMap ? "#define USE_NORMALMAP" : "", n.displacementMap && n.supportsVertexTextures ? "#define USE_DISPLACEMENTMAP" : "", n.specularMap ? "#define USE_SPECULARMAP" : "", n.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", n.metalnessMap ? "#define USE_METALNESSMAP" : "", n.alphaMap ? "#define USE_ALPHAMAP" : "", n.vertexColors ? "#define USE_COLOR" : "", n.flatShading ? "#define FLAT_SHADED" : "", n.skinning ? "#define USE_SKINNING" : "", n.useVertexTexture ? "#define BONE_TEXTURE" : "", n.morphTargets ? "#define USE_MORPHTARGETS" : "", n.morphNormals && !1 === n.flatShading ? "#define USE_MORPHNORMALS" : "", n.doubleSided ? "#define DOUBLE_SIDED" : "", n.flipSided ? "#define FLIP_SIDED" : "", n.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", n.shadowMapEnabled ? "#define " + c : "", 0 < n.pointLightShadows ? "#define POINT_LIGHT_SHADOWS" : "", n.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", n.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", n.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", "uniform mat4 modelMatrix;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform mat4 viewMatrix;", "uniform mat3 normalMatrix;", "uniform vec3 cameraPosition;", "attribute vec3 position;", "attribute vec3 normal;", "attribute vec2 uv;", "#ifdef USE_COLOR", "\tattribute vec3 color;", "#endif", "#ifdef USE_MORPHTARGETS", "\tattribute vec3 morphTarget0;", "\tattribute vec3 morphTarget1;", "\tattribute vec3 morphTarget2;", "\tattribute vec3 morphTarget3;", "\t#ifdef USE_MORPHNORMALS", "\t\tattribute vec3 morphNormal0;", "\t\tattribute vec3 morphNormal1;", "\t\tattribute vec3 morphNormal2;", "\t\tattribute vec3 morphNormal3;", "\t#else", "\t\tattribute vec3 morphTarget4;", "\t\tattribute vec3 morphTarget5;", "\t\tattribute vec3 morphTarget6;", "\t\tattribute vec3 morphTarget7;", "\t#endif", "#endif", "#ifdef USE_SKINNING", "\tattribute vec4 skinIndex;", "\tattribute vec4 skinWeight;", "#endif", "\n"].filter(Pi).join("\n"),
  50395. [m, "precision " + n.precision + " float;", "precision " + n.precision + " int;", "#define SHADER_NAME " + i.__webglShader.name, v, n.alphaTest ? "#define ALPHATEST " + n.alphaTest : "", "#define GAMMA_FACTOR " + g, n.useFog && n.fog ? "#define USE_FOG" : "", n.useFog && n.fogExp ? "#define FOG_EXP2" : "", n.map ? "#define USE_MAP" : "", n.envMap ? "#define USE_ENVMAP" : "", n.envMap ? "#define " + h : "", n.envMap ? "#define " + u : "", n.envMap ? "#define " + d : "", n.lightMap ? "#define USE_LIGHTMAP" : "", n.aoMap ? "#define USE_AOMAP" : "", n.emissiveMap ? "#define USE_EMISSIVEMAP" : "", n.bumpMap ? "#define USE_BUMPMAP" : "", n.normalMap ? "#define USE_NORMALMAP" : "", n.specularMap ? "#define USE_SPECULARMAP" : "", n.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", n.metalnessMap ? "#define USE_METALNESSMAP" : "", n.alphaMap ? "#define USE_ALPHAMAP" : "", n.vertexColors ? "#define USE_COLOR" : "", n.flatShading ? "#define FLAT_SHADED" : "", n.doubleSided ? "#define DOUBLE_SIDED" : "", n.flipSided ? "#define FLIP_SIDED" : "", n.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", n.shadowMapEnabled ? "#define " + c : "", 0 < n.pointLightShadows ? "#define POINT_LIGHT_SHADOWS" : "", n.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "", n.physicallyCorrectLights ? "#define PHYSICALLY_CORRECT_LIGHTS" : "", n.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", n.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", n.envMap && e.extensions.get("EXT_shader_texture_lod") ? "#define TEXTURE_LOD_EXT" : "", "uniform mat4 viewMatrix;", "uniform vec3 cameraPosition;", n.toneMapping !== Ci.NoToneMapping ? "#define TONE_MAPPING" : "", n.toneMapping !== Ci.NoToneMapping ? Ci.ShaderChunk.tonemapping_pars_fragment : "", n.toneMapping !== Ci.NoToneMapping ? function(e, t) {
  50396. var i;
  50397. switch (t) {
  50398. case Ci.LinearToneMapping:
  50399. i = "Linear";
  50400. break;
  50401. case Ci.ReinhardToneMapping:
  50402. i = "Reinhard";
  50403. break;
  50404. case Ci.Uncharted2ToneMapping:
  50405. i = "Uncharted2";
  50406. break;
  50407. case Ci.CineonToneMapping:
  50408. i = "OptimizedCineon";
  50409. break;
  50410. default:
  50411. throw new Error("unsupported toneMapping: " + t)
  50412. }
  50413. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  50414. }("toneMapping", n.toneMapping) : "", n.outputEncoding || n.mapEncoding || n.envMapEncoding || n.emissiveMapEncoding ? Ci.ShaderChunk.encodings_pars_fragment : "", n.mapEncoding ? Ri("mapTexelToLinear", n.mapEncoding) : "", n.envMapEncoding ? Ri("envMapTexelToLinear", n.envMapEncoding) : "", n.emissiveMapEncoding ? Ri("emissiveMapTexelToLinear", n.emissiveMapEncoding) : "", n.outputEncoding ? function(e, t) {
  50415. var i = Mi(t);
  50416. return "vec4 " + e + "( vec4 value ) { return LinearTo" + i[0] + i[1] + "; }"
  50417. }("linearToOutputTexel", n.outputEncoding) : "", "\n"].filter(Pi).join("\n")),
  50418. s = Oi(s = Li(s), n),
  50419. l = Oi(l = Li(l), n),
  50420. i instanceof Ci.ShaderMaterial == 0 && (s = Di(s),
  50421. l = Di(l));
  50422. var A = p + s
  50423. , C = f + l
  50424. , I = Ci.WebGLShader(r, r.VERTEX_SHADER, A)
  50425. , E = Ci.WebGLShader(r, r.FRAGMENT_SHADER, C);
  50426. r.attachShader(y, I),
  50427. r.attachShader(y, E),
  50428. void 0 !== i.index0AttributeName ? r.bindAttribLocation(y, 0, i.index0AttributeName) : !0 === n.morphTargets && r.bindAttribLocation(y, 0, "position"),
  50429. r.linkProgram(y);
  50430. var _, b, w = r.getProgramInfoLog(y), T = r.getShaderInfoLog(I), x = r.getShaderInfoLog(E), S = !0, M = !0;
  50431. return !1 === r.getProgramParameter(y, r.LINK_STATUS) ? (S = !1,
  50432. console.error("THREE.WebGLProgram: shader error: ", r.getError(), "gl.VALIDATE_STATUS", r.getProgramParameter(y, r.VALIDATE_STATUS), "gl.getProgramInfoLog", w, T, x)) : "" !== w ? console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()", w) : "" !== T && "" !== x || (M = !1),
  50433. M && (this.diagnostics = {
  50434. runnable: S,
  50435. material: i,
  50436. programLog: w,
  50437. vertexShader: {
  50438. log: T,
  50439. prefix: p
  50440. },
  50441. fragmentShader: {
  50442. log: x,
  50443. prefix: f
  50444. }
  50445. }),
  50446. r.deleteShader(I),
  50447. r.deleteShader(E),
  50448. this.getUniforms = function() {
  50449. return void 0 === _ && (_ = function(e, t) {
  50450. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), r = 0; r < n; r++) {
  50451. var o = e.getActiveUniform(t, r).name
  50452. , a = e.getUniformLocation(t, o)
  50453. , s = Jt.exec(o);
  50454. if (s) {
  50455. var l = s[1]
  50456. , c = s[2]
  50457. , h = i[l];
  50458. (h = h || (i[l] = {}))[c] = a
  50459. } else if (s = $t.exec(o)) {
  50460. var u = s[1]
  50461. , d = s[2]
  50462. , p = s[3]
  50463. , f = i[u]
  50464. , g = (f = f || (i[u] = []))[d];
  50465. (g = g || (f[d] = {}))[p] = a
  50466. } else
  50467. (s = ei.exec(o)) ? i[u = s[1]] = a : i[o] = a
  50468. }
  50469. return i
  50470. }(r, y)),
  50471. _
  50472. }
  50473. ,
  50474. this.getAttributes = function() {
  50475. return void 0 === b && (b = function(e, t) {
  50476. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), r = 0; r < n; r++) {
  50477. var o = e.getActiveAttrib(t, r).name;
  50478. i[o] = e.getAttribLocation(t, o)
  50479. }
  50480. return i
  50481. }(r, y)),
  50482. b
  50483. }
  50484. ,
  50485. this.destroy = function() {
  50486. r.deleteProgram(y),
  50487. this.program = void 0
  50488. }
  50489. ,
  50490. Object.defineProperties(this, {
  50491. uniforms: {
  50492. get: function() {
  50493. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  50494. this.getUniforms()
  50495. }
  50496. },
  50497. attributes: {
  50498. get: function() {
  50499. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  50500. this.getAttributes()
  50501. }
  50502. }
  50503. }),
  50504. this.id = Qt++,
  50505. this.code = t,
  50506. this.usedTimes = 1,
  50507. this.program = y,
  50508. this.vertexShader = I,
  50509. this.fragmentShader = E,
  50510. this
  50511. }
  50512. ),
  50513. Ci.WebGLPrograms = function(s, l) {
  50514. function c(e, t) {
  50515. var i;
  50516. return e ? e instanceof Ci.Texture ? i = e.encoding : e instanceof Ci.WebGLRenderTarget && (i = e.texture.encoding) : i = Ci.LinearEncoding,
  50517. i === Ci.LinearEncoding && t && (i = Ci.GammaEncoding),
  50518. i
  50519. }
  50520. var h = []
  50521. , u = {
  50522. MeshDepthMaterial: "depth",
  50523. MeshNormalMaterial: "normal",
  50524. MeshBasicMaterial: "basic",
  50525. MeshLambertMaterial: "lambert",
  50526. MeshPhongMaterial: "phong",
  50527. MeshStandardMaterial: "standard",
  50528. LineBasicMaterial: "basic",
  50529. LineDashedMaterial: "dashed",
  50530. PointsMaterial: "points"
  50531. }
  50532. , a = ["precision", "supportsVertexTextures", "map", "mapEncoding", "envMap", "envMapMode", "envMapEncoding", "lightMap", "aoMap", "emissiveMap", "emissiveMapEncoding", "bumpMap", "normalMap", "displacementMap", "specularMap", "roughnessMap", "metalnessMap", "alphaMap", "combine", "vertexColors", "fog", "useFog", "fogExp", "flatShading", "sizeAttenuation", "logarithmicDepthBuffer", "skinning", "maxBones", "useVertexTexture", "morphTargets", "morphNormals", "maxMorphTargets", "maxMorphNormals", "premultipliedAlpha", "numDirLights", "numPointLights", "numSpotLights", "numHemiLights", "shadowMapEnabled", "pointLightShadows", "toneMapping", "physicallyCorrectLights", "shadowMapType", "alphaTest", "doubleSided", "flipSided"];
  50533. this.getParameters = function(e, t, i, n) {
  50534. var r = u[e.type]
  50535. , o = function(e) {
  50536. if (l.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  50537. return 1024;
  50538. var t = l.maxVertexUniforms
  50539. , i = Math.floor((t - 20) / 4);
  50540. return void 0 !== e && e instanceof Ci.SkinnedMesh && ((i = Math.min(e.skeleton.bones.length, i)) < e.skeleton.bones.length && console.warn("WebGLRenderer: too many bones - " + e.skeleton.bones.length + ", this GPU supports just " + i + " (try OpenGL instead of ANGLE)")),
  50541. i
  50542. }(n)
  50543. , a = s.getPrecision();
  50544. return null === e.precision || (a = l.getMaxPrecision(e.precision)) !== e.precision && console.warn("THREE.WebGLProgram.getParameters:", e.precision, "not supported, using", a, "instead."),
  50545. {
  50546. shaderID: r,
  50547. precision: a,
  50548. supportsVertexTextures: l.vertexTextures,
  50549. outputEncoding: c(s.getCurrentRenderTarget(), s.gammaOutput),
  50550. map: !!e.map,
  50551. mapEncoding: c(e.map, s.gammaInput),
  50552. envMap: !!e.envMap,
  50553. envMapMode: e.envMap && e.envMap.mapping,
  50554. envMapEncoding: c(e.envMap, s.gammaInput),
  50555. envMapCubeUV: !!e.envMap && (e.envMap.mapping === Ci.CubeUVReflectionMapping || e.envMap.mapping === Ci.CubeUVRefractionMapping),
  50556. lightMap: !!e.lightMap,
  50557. aoMap: !!e.aoMap,
  50558. emissiveMap: !!e.emissiveMap,
  50559. emissiveMapEncoding: c(e.emissiveMap, s.gammaInput),
  50560. bumpMap: !!e.bumpMap,
  50561. normalMap: !!e.normalMap,
  50562. displacementMap: !!e.displacementMap,
  50563. roughnessMap: !!e.roughnessMap,
  50564. metalnessMap: !!e.metalnessMap,
  50565. specularMap: !!e.specularMap,
  50566. alphaMap: !!e.alphaMap,
  50567. combine: e.combine,
  50568. vertexColors: e.vertexColors,
  50569. fog: i,
  50570. useFog: e.fog,
  50571. fogExp: i instanceof Ci.FogExp2,
  50572. flatShading: e.shading === Ci.FlatShading,
  50573. sizeAttenuation: e.sizeAttenuation,
  50574. logarithmicDepthBuffer: l.logarithmicDepthBuffer,
  50575. skinning: e.skinning,
  50576. maxBones: o,
  50577. useVertexTexture: l.floatVertexTextures && n && n.skeleton && n.skeleton.useVertexTexture,
  50578. morphTargets: e.morphTargets,
  50579. morphNormals: e.morphNormals,
  50580. maxMorphTargets: s.maxMorphTargets,
  50581. maxMorphNormals: s.maxMorphNormals,
  50582. numDirLights: t.directional.length,
  50583. numPointLights: t.point.length,
  50584. numSpotLights: t.spot.length,
  50585. numHemiLights: t.hemi.length,
  50586. pointLightShadows: t.shadowsPointLight,
  50587. shadowMapEnabled: s.shadowMap.enabled && n.receiveShadow && 0 < t.shadows.length,
  50588. shadowMapType: s.shadowMap.type,
  50589. toneMapping: s.toneMapping,
  50590. physicallyCorrectLights: s.physicallyCorrectLights,
  50591. premultipliedAlpha: e.premultipliedAlpha,
  50592. alphaTest: e.alphaTest,
  50593. doubleSided: e.side === Ci.DoubleSide,
  50594. flipSided: e.side === Ci.BackSide
  50595. }
  50596. }
  50597. ,
  50598. this.getProgramCode = function(e, t) {
  50599. var i = [];
  50600. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  50601. i.push(e.vertexShader)),
  50602. void 0 !== e.defines)
  50603. for (var n in e.defines)
  50604. i.push(n),
  50605. i.push(e.defines[n]);
  50606. for (var r = 0; r < a.length; r++) {
  50607. var o = a[r];
  50608. i.push(o),
  50609. i.push(t[o])
  50610. }
  50611. return i.join()
  50612. }
  50613. ,
  50614. this.acquireProgram = function(e, t, i) {
  50615. for (var n, r = 0, o = h.length; r < o; r++) {
  50616. var a = h[r];
  50617. if (a.code === i) {
  50618. ++(n = a).usedTimes;
  50619. break
  50620. }
  50621. }
  50622. return void 0 === n && (n = new Ci.WebGLProgram(s,i,e,t),
  50623. h.push(n)),
  50624. n
  50625. }
  50626. ,
  50627. this.releaseProgram = function(e) {
  50628. if (0 == --e.usedTimes) {
  50629. var t = h.indexOf(e);
  50630. h[t] = h[h.length - 1],
  50631. h.pop(),
  50632. e.destroy()
  50633. }
  50634. }
  50635. ,
  50636. this.programs = h
  50637. }
  50638. ,
  50639. Ci.WebGLProperties = function() {
  50640. var n = {};
  50641. this.get = function(e) {
  50642. var t = e.uuid
  50643. , i = n[t];
  50644. return void 0 === i && (i = {},
  50645. n[t] = i),
  50646. i
  50647. }
  50648. ,
  50649. this.delete = function(e) {
  50650. delete n[e.uuid]
  50651. }
  50652. ,
  50653. this.clear = function() {
  50654. n = {}
  50655. }
  50656. }
  50657. ,
  50658. Ci.WebGLShader = function(e, t, i) {
  50659. var n = e.createShader(t);
  50660. return e.shaderSource(n, i),
  50661. e.compileShader(n),
  50662. !1 === e.getShaderParameter(n, e.COMPILE_STATUS) && console.error("THREE.WebGLShader: Shader couldn't compile."),
  50663. "" !== e.getShaderInfoLog(n) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", t === e.VERTEX_SHADER ? "vertex" : "fragment", e.getShaderInfoLog(n), function(e) {
  50664. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  50665. t[i] = i + 1 + ": " + t[i];
  50666. return t.join("\n")
  50667. }(i)),
  50668. n
  50669. }
  50670. ,
  50671. Ci.WebGLShadowMap = function(P, O, L) {
  50672. function D(e, t, i, n) {
  50673. var r = e.geometry
  50674. , o = null
  50675. , a = p
  50676. , s = e.customDepthMaterial;
  50677. if (i && (a = f,
  50678. s = e.customDistanceMaterial),
  50679. s)
  50680. o = s;
  50681. else {
  50682. var l = void 0 !== r.morphTargets && 0 < r.morphTargets.length && t.morphTargets
  50683. , c = e instanceof Ci.SkinnedMesh && t.skinning
  50684. , h = 0;
  50685. l && (h |= u),
  50686. c && (h |= d),
  50687. o = a[h]
  50688. }
  50689. return o.visible = t.visible,
  50690. o.wireframe = t.wireframe,
  50691. o.wireframeLinewidth = t.wireframeLinewidth,
  50692. i && void 0 !== o.uniforms.lightPos && o.uniforms.lightPos.value.copy(n),
  50693. o
  50694. }
  50695. function N(e, t, i) {
  50696. if (!1 !== e.visible) {
  50697. if (e.layers.test(t.layers) && (e instanceof Ci.Mesh || e instanceof Ci.Line || e instanceof Ci.Points) && e.castShadow && (!1 === e.frustumCulled || !0 === V.intersectsObject(e)))
  50698. !0 === e.material.visible && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  50699. G.push(e));
  50700. for (var n = e.children, r = 0, o = n.length; r < o; r++)
  50701. N(n[r], t, i)
  50702. }
  50703. }
  50704. for (var F = P.context, B = P.state, V = new Ci.Frustum, k = new Ci.Matrix4, U = new Ci.Vector2, H = new Ci.Vector3, z = new Ci.Vector3, G = [], u = 1, d = 2, e = 1 + (u | d), p = new Array(e), f = new Array(e), W = [new Ci.Vector3(1,0,0), new Ci.Vector3(-1,0,0), new Ci.Vector3(0,0,1), new Ci.Vector3(0,0,-1), new Ci.Vector3(0,1,0), new Ci.Vector3(0,-1,0)], j = [new Ci.Vector3(0,1,0), new Ci.Vector3(0,1,0), new Ci.Vector3(0,1,0), new Ci.Vector3(0,1,0), new Ci.Vector3(0,0,1), new Ci.Vector3(0,0,-1)], Y = [new Ci.Vector4, new Ci.Vector4, new Ci.Vector4, new Ci.Vector4, new Ci.Vector4, new Ci.Vector4], t = Ci.ShaderLib.depthRGBA, i = Ci.UniformsUtils.clone(t.uniforms), n = Ci.ShaderLib.distanceRGBA, r = Ci.UniformsUtils.clone(n.uniforms), o = 0; o !== e; ++o) {
  50705. var a = 0 != (o & u)
  50706. , s = 0 != (o & d)
  50707. , l = new Ci.ShaderMaterial({
  50708. uniforms: i,
  50709. vertexShader: t.vertexShader,
  50710. fragmentShader: t.fragmentShader,
  50711. morphTargets: a,
  50712. skinning: s
  50713. });
  50714. p[o] = l;
  50715. var c = new Ci.ShaderMaterial({
  50716. defines: {
  50717. USE_SHADOWMAP: ""
  50718. },
  50719. uniforms: r,
  50720. vertexShader: n.vertexShader,
  50721. fragmentShader: n.fragmentShader,
  50722. morphTargets: a,
  50723. skinning: s
  50724. });
  50725. f[o] = c
  50726. }
  50727. var q = this;
  50728. this.enabled = !1,
  50729. this.autoUpdate = !0,
  50730. this.needsUpdate = !1,
  50731. this.type = Ci.PCFShadowMap,
  50732. this.cullFace = Ci.CullFaceFront,
  50733. this.render = function(e, t) {
  50734. var i, n, r = O.shadows;
  50735. if (0 !== r.length && !1 !== q.enabled && (!1 !== q.autoUpdate || !1 !== q.needsUpdate)) {
  50736. B.clearColor(1, 1, 1, 1),
  50737. B.disable(F.BLEND),
  50738. B.enable(F.CULL_FACE),
  50739. F.frontFace(F.CCW),
  50740. F.cullFace(q.cullFace === Ci.CullFaceFront ? F.FRONT : F.BACK),
  50741. B.setDepthTest(!0),
  50742. B.setScissorTest(!1);
  50743. for (var o = 0, a = r.length; o < a; o++) {
  50744. var s = r[o]
  50745. , l = s.shadow
  50746. , c = l.camera;
  50747. if (U.copy(l.mapSize),
  50748. s instanceof Ci.PointLight) {
  50749. i = 6,
  50750. n = !0;
  50751. var h = U.x
  50752. , u = U.y;
  50753. Y[0].set(2 * h, u, h, u),
  50754. Y[1].set(0, u, h, u),
  50755. Y[2].set(3 * h, u, h, u),
  50756. Y[3].set(h, u, h, u),
  50757. Y[4].set(3 * h, 0, h, u),
  50758. Y[5].set(h, 0, h, u),
  50759. U.x *= 4,
  50760. U.y *= 2
  50761. } else
  50762. n = !(i = 1);
  50763. if (null === l.map) {
  50764. var d = {
  50765. minFilter: Ci.NearestFilter,
  50766. magFilter: Ci.NearestFilter,
  50767. format: Ci.RGBAFormat
  50768. };
  50769. l.map = new Ci.WebGLRenderTarget(U.x,U.y,d),
  50770. s instanceof Ci.SpotLight && (c.aspect = U.x / U.y),
  50771. c.updateProjectionMatrix()
  50772. }
  50773. var p = l.map
  50774. , f = l.matrix;
  50775. z.setFromMatrixPosition(s.matrixWorld),
  50776. c.position.copy(z),
  50777. P.setRenderTarget(p),
  50778. P.clear();
  50779. for (var g = 0; g < i; g++) {
  50780. if (n) {
  50781. H.copy(c.position),
  50782. H.add(W[g]),
  50783. c.up.copy(j[g]),
  50784. c.lookAt(H);
  50785. var m = Y[g];
  50786. B.viewport(m)
  50787. } else
  50788. H.setFromMatrixPosition(s.target.matrixWorld),
  50789. c.lookAt(H);
  50790. c.updateMatrixWorld(),
  50791. c.matrixWorldInverse.getInverse(c.matrixWorld),
  50792. f.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  50793. f.multiply(c.projectionMatrix),
  50794. f.multiply(c.matrixWorldInverse),
  50795. k.multiplyMatrices(c.projectionMatrix, c.matrixWorldInverse),
  50796. V.setFromMatrix(k),
  50797. G.length = 0,
  50798. N(e, t, c);
  50799. for (var v = 0, y = G.length; v < y; v++) {
  50800. var A = G[v]
  50801. , C = L.update(A)
  50802. , I = A.material;
  50803. if (I instanceof Ci.MultiMaterial)
  50804. for (var E = C.groups, _ = I.materials, b = 0, w = E.length; b < w; b++) {
  50805. var T = E[b]
  50806. , x = _[T.materialIndex];
  50807. if (!0 === x.visible) {
  50808. var S = D(A, x, n, z);
  50809. P.renderBufferDirect(c, null, C, S, A, T)
  50810. }
  50811. }
  50812. else {
  50813. S = D(A, I, n, z);
  50814. P.renderBufferDirect(c, null, C, S, A, null)
  50815. }
  50816. }
  50817. }
  50818. }
  50819. var M = P.getClearColor()
  50820. , R = P.getClearAlpha();
  50821. P.setClearColor(M, R),
  50822. B.enable(F.BLEND),
  50823. q.cullFace === Ci.CullFaceFront && F.cullFace(F.BACK),
  50824. q.needsUpdate = !1
  50825. }
  50826. }
  50827. }
  50828. ,
  50829. Ci.WebGLState = function(l, i, c) {
  50830. var n = this
  50831. , r = new Ci.Vector4
  50832. , o = new Uint8Array(16)
  50833. , a = new Uint8Array(16)
  50834. , s = new Uint8Array(16)
  50835. , t = {}
  50836. , h = null
  50837. , u = null
  50838. , d = null
  50839. , p = null
  50840. , f = null
  50841. , g = null
  50842. , m = null
  50843. , v = null
  50844. , y = !1
  50845. , A = null
  50846. , C = null
  50847. , I = null
  50848. , E = null
  50849. , _ = null
  50850. , b = null
  50851. , w = null
  50852. , T = null
  50853. , x = null
  50854. , S = null
  50855. , M = null
  50856. , R = null
  50857. , P = null
  50858. , O = null
  50859. , L = null
  50860. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  50861. , N = void 0
  50862. , F = {}
  50863. , B = new Ci.Vector4
  50864. , V = null
  50865. , k = null
  50866. , U = new Ci.Vector4
  50867. , H = new Ci.Vector4
  50868. , z = l.createTexture();
  50869. l.bindTexture(l.TEXTURE_2D, z),
  50870. l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.LINEAR),
  50871. l.texImage2D(l.TEXTURE_2D, 0, l.RGB, 1, 1, 0, l.RGB, l.UNSIGNED_BYTE, new Uint8Array(3)),
  50872. this.init = function() {
  50873. this.clearColor(0, 0, 0, 1),
  50874. this.clearDepth(1),
  50875. this.clearStencil(0),
  50876. this.enable(l.DEPTH_TEST),
  50877. l.depthFunc(l.LEQUAL),
  50878. l.frontFace(l.CCW),
  50879. l.cullFace(l.BACK),
  50880. this.enable(l.CULL_FACE),
  50881. this.enable(l.BLEND),
  50882. l.blendEquation(l.FUNC_ADD),
  50883. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  50884. }
  50885. ,
  50886. this.initAttributes = function() {
  50887. for (var e = 0, t = o.length; e < t; e++)
  50888. o[e] = 0
  50889. }
  50890. ,
  50891. this.enableAttribute = function(e) {
  50892. o[e] = 1,
  50893. 0 === a[e] && (l.enableVertexAttribArray(e),
  50894. a[e] = 1),
  50895. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  50896. s[e] = 0)
  50897. }
  50898. ,
  50899. this.enableAttributeAndDivisor = function(e, t, i) {
  50900. o[e] = 1,
  50901. 0 === a[e] && (l.enableVertexAttribArray(e),
  50902. a[e] = 1),
  50903. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  50904. s[e] = t)
  50905. }
  50906. ,
  50907. this.disableUnusedAttributes = function() {
  50908. for (var e = 0, t = a.length; e < t; e++)
  50909. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  50910. a[e] = 0)
  50911. }
  50912. ,
  50913. this.enable = function(e) {
  50914. !0 !== t[e] && (l.enable(e),
  50915. t[e] = !0)
  50916. }
  50917. ,
  50918. this.disable = function(e) {
  50919. !1 !== t[e] && (l.disable(e),
  50920. t[e] = !1)
  50921. }
  50922. ,
  50923. this.getCompressedTextureFormats = function() {
  50924. if (null === h && (h = [],
  50925. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  50926. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  50927. h.push(e[t]);
  50928. return h
  50929. }
  50930. ,
  50931. this.setBlending = function(e, t, i, n, r, o, a, s) {
  50932. e === Ci.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  50933. e === u && s === y || (e === Ci.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50934. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  50935. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === Ci.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50936. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50937. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === Ci.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50938. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50939. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50940. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50941. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  50942. u = e,
  50943. y = s),
  50944. e === Ci.CustomBlending ? (r = r || t,
  50945. o = o || i,
  50946. a = a || n,
  50947. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  50948. d = t,
  50949. g = r),
  50950. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  50951. p = i,
  50952. f = n,
  50953. m = o,
  50954. v = a)) : v = m = g = f = p = d = null
  50955. }
  50956. ,
  50957. this.setDepthFunc = function(e) {
  50958. if (A !== e) {
  50959. if (e)
  50960. switch (e) {
  50961. case Ci.NeverDepth:
  50962. l.depthFunc(l.NEVER);
  50963. break;
  50964. case Ci.AlwaysDepth:
  50965. l.depthFunc(l.ALWAYS);
  50966. break;
  50967. case Ci.LessDepth:
  50968. l.depthFunc(l.LESS);
  50969. break;
  50970. case Ci.LessEqualDepth:
  50971. l.depthFunc(l.LEQUAL);
  50972. break;
  50973. case Ci.EqualDepth:
  50974. l.depthFunc(l.EQUAL);
  50975. break;
  50976. case Ci.GreaterEqualDepth:
  50977. l.depthFunc(l.GEQUAL);
  50978. break;
  50979. case Ci.GreaterDepth:
  50980. l.depthFunc(l.GREATER);
  50981. break;
  50982. case Ci.NotEqualDepth:
  50983. l.depthFunc(l.NOTEQUAL);
  50984. break;
  50985. default:
  50986. l.depthFunc(l.LEQUAL)
  50987. }
  50988. else
  50989. l.depthFunc(l.LEQUAL);
  50990. A = e
  50991. }
  50992. }
  50993. ,
  50994. this.setDepthTest = function(e) {
  50995. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  50996. }
  50997. ,
  50998. this.setDepthWrite = function(e) {
  50999. C !== e && (l.depthMask(e),
  51000. C = e)
  51001. }
  51002. ,
  51003. this.setColorWrite = function(e) {
  51004. I !== e && (l.colorMask(e, e, e, e),
  51005. I = e)
  51006. }
  51007. ,
  51008. this.setStencilFunc = function(e, t, i) {
  51009. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  51010. _ = e,
  51011. b = t,
  51012. w = i)
  51013. }
  51014. ,
  51015. this.setStencilOp = function(e, t, i) {
  51016. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  51017. T = e,
  51018. x = t,
  51019. S = i)
  51020. }
  51021. ,
  51022. this.setStencilTest = function(e) {
  51023. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  51024. }
  51025. ,
  51026. this.setStencilWrite = function(e) {
  51027. E !== e && (l.stencilMask(e),
  51028. E = e)
  51029. }
  51030. ,
  51031. this.setFlipSided = function(e) {
  51032. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  51033. M = e)
  51034. }
  51035. ,
  51036. this.setLineWidth = function(e) {
  51037. e !== R && (l.lineWidth(e),
  51038. R = e)
  51039. }
  51040. ,
  51041. this.setPolygonOffset = function(e, t, i) {
  51042. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  51043. !e || P === t && O === i || (l.polygonOffset(t, i),
  51044. P = t,
  51045. O = i)
  51046. }
  51047. ,
  51048. this.getScissorTest = function() {
  51049. return L
  51050. }
  51051. ,
  51052. this.setScissorTest = function(e) {
  51053. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  51054. }
  51055. ,
  51056. this.activeTexture = function(e) {
  51057. void 0 === e && (e = l.TEXTURE0 + D - 1),
  51058. N !== e && (l.activeTexture(e),
  51059. N = e)
  51060. }
  51061. ,
  51062. this.bindTexture = function(e, t) {
  51063. void 0 === N && n.activeTexture();
  51064. var i = F[N];
  51065. void 0 === i && (i = {
  51066. type: void 0,
  51067. texture: void 0
  51068. },
  51069. F[N] = i),
  51070. i.type === e && i.texture === t || (l.bindTexture(e, t || z),
  51071. i.type = e,
  51072. i.texture = t)
  51073. }
  51074. ,
  51075. this.compressedTexImage2D = function() {
  51076. try {
  51077. l.compressedTexImage2D.apply(l, arguments)
  51078. } catch (e) {
  51079. console.error(e)
  51080. }
  51081. }
  51082. ,
  51083. this.texImage2D = function() {
  51084. try {
  51085. l.texImage2D.apply(l, arguments)
  51086. } catch (e) {
  51087. console.error(e)
  51088. }
  51089. }
  51090. ,
  51091. this.clearColor = function(e, t, i, n) {
  51092. r.set(e, t, i, n),
  51093. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  51094. B.copy(r))
  51095. }
  51096. ,
  51097. this.clearDepth = function(e) {
  51098. V !== e && (l.clearDepth(e),
  51099. V = e)
  51100. }
  51101. ,
  51102. this.clearStencil = function(e) {
  51103. k !== e && (l.clearStencil(e),
  51104. k = e)
  51105. }
  51106. ,
  51107. this.scissor = function(e) {
  51108. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  51109. U.copy(e))
  51110. }
  51111. ,
  51112. this.viewport = function(e) {
  51113. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  51114. H.copy(e))
  51115. }
  51116. ,
  51117. this.reset = function() {
  51118. for (var e = 0; e < a.length; e++)
  51119. 1 === a[e] && (l.disableVertexAttribArray(e),
  51120. a[e] = 0);
  51121. t = {},
  51122. N = void 0,
  51123. F = {},
  51124. M = E = C = I = u = h = null
  51125. }
  51126. }
  51127. ,
  51128. Ci.LensFlarePlugin = function(v, y) {
  51129. function A() {
  51130. var e, t = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1]), i = new Uint16Array([0, 1, 2, 0, 2, 3]);
  51131. C = S.createBuffer(),
  51132. I = S.createBuffer(),
  51133. S.bindBuffer(S.ARRAY_BUFFER, C),
  51134. S.bufferData(S.ARRAY_BUFFER, t, S.STATIC_DRAW),
  51135. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  51136. S.bufferData(S.ELEMENT_ARRAY_BUFFER, i, S.STATIC_DRAW),
  51137. T = S.createTexture(),
  51138. x = S.createTexture(),
  51139. M.bindTexture(S.TEXTURE_2D, T),
  51140. S.texImage2D(S.TEXTURE_2D, 0, S.RGB, 16, 16, 0, S.RGB, S.UNSIGNED_BYTE, null),
  51141. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  51142. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  51143. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  51144. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  51145. M.bindTexture(S.TEXTURE_2D, x),
  51146. S.texImage2D(S.TEXTURE_2D, 0, S.RGBA, 16, 16, 0, S.RGBA, S.UNSIGNED_BYTE, null),
  51147. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  51148. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  51149. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  51150. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  51151. e = (w = 0 < S.getParameter(S.MAX_VERTEX_TEXTURE_IMAGE_UNITS)) ? {
  51152. 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"),
  51153. 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")
  51154. } : {
  51155. 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"),
  51156. 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")
  51157. },
  51158. E = function(e) {
  51159. var t = S.createProgram()
  51160. , i = S.createShader(S.FRAGMENT_SHADER)
  51161. , n = S.createShader(S.VERTEX_SHADER)
  51162. , r = "precision " + v.getPrecision() + " float;\n";
  51163. return S.shaderSource(i, r + e.fragmentShader),
  51164. S.shaderSource(n, r + e.vertexShader),
  51165. S.compileShader(i),
  51166. S.compileShader(n),
  51167. S.attachShader(t, i),
  51168. S.attachShader(t, n),
  51169. S.linkProgram(t),
  51170. t
  51171. }(e),
  51172. _ = {
  51173. vertex: S.getAttribLocation(E, "position"),
  51174. uv: S.getAttribLocation(E, "uv")
  51175. },
  51176. b = {
  51177. renderType: S.getUniformLocation(E, "renderType"),
  51178. map: S.getUniformLocation(E, "map"),
  51179. occlusionMap: S.getUniformLocation(E, "occlusionMap"),
  51180. opacity: S.getUniformLocation(E, "opacity"),
  51181. color: S.getUniformLocation(E, "color"),
  51182. scale: S.getUniformLocation(E, "scale"),
  51183. rotation: S.getUniformLocation(E, "rotation"),
  51184. screenPosition: S.getUniformLocation(E, "screenPosition")
  51185. }
  51186. }
  51187. var C, I, E, _, b, w, T, x, S = v.context, M = v.state;
  51188. this.render = function(e, t, i) {
  51189. if (0 !== y.length) {
  51190. var n = new Ci.Vector3
  51191. , r = i.w / i.z
  51192. , o = .5 * i.z
  51193. , a = .5 * i.w
  51194. , s = 16 / i.w
  51195. , l = new Ci.Vector2(s * r,s)
  51196. , c = new Ci.Vector3(1,1,0)
  51197. , h = new Ci.Vector2(1,1);
  51198. void 0 === E && A(),
  51199. S.useProgram(E),
  51200. M.initAttributes(),
  51201. M.enableAttribute(_.vertex),
  51202. M.enableAttribute(_.uv),
  51203. M.disableUnusedAttributes(),
  51204. S.uniform1i(b.occlusionMap, 0),
  51205. S.uniform1i(b.map, 1),
  51206. S.bindBuffer(S.ARRAY_BUFFER, C),
  51207. S.vertexAttribPointer(_.vertex, 2, S.FLOAT, !1, 16, 0),
  51208. S.vertexAttribPointer(_.uv, 2, S.FLOAT, !1, 16, 8),
  51209. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  51210. M.disable(S.CULL_FACE),
  51211. M.setDepthWrite(!1);
  51212. for (var u = 0, d = y.length; u < d; u++) {
  51213. s = 16 / i.w,
  51214. l.set(s * r, s);
  51215. var p = y[u];
  51216. if (n.set(p.matrixWorld.elements[12], p.matrixWorld.elements[13], p.matrixWorld.elements[14]),
  51217. n.applyMatrix4(t.matrixWorldInverse),
  51218. n.applyProjection(t.projectionMatrix),
  51219. c.copy(n),
  51220. h.x = c.x * o + o,
  51221. h.y = c.y * a + a,
  51222. w || 0 < h.x && h.x < i.z && 0 < h.y && h.y < i.w) {
  51223. M.activeTexture(S.TEXTURE0),
  51224. M.bindTexture(S.TEXTURE_2D, null),
  51225. M.activeTexture(S.TEXTURE1),
  51226. M.bindTexture(S.TEXTURE_2D, T),
  51227. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGB, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  51228. S.uniform1i(b.renderType, 0),
  51229. S.uniform2f(b.scale, l.x, l.y),
  51230. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  51231. M.disable(S.BLEND),
  51232. M.enable(S.DEPTH_TEST),
  51233. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  51234. M.activeTexture(S.TEXTURE0),
  51235. M.bindTexture(S.TEXTURE_2D, x),
  51236. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGBA, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  51237. S.uniform1i(b.renderType, 1),
  51238. M.disable(S.DEPTH_TEST),
  51239. M.activeTexture(S.TEXTURE1),
  51240. M.bindTexture(S.TEXTURE_2D, T),
  51241. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  51242. p.positionScreen.copy(c),
  51243. p.customUpdateCallback ? p.customUpdateCallback(p) : p.updateLensFlares(),
  51244. S.uniform1i(b.renderType, 2),
  51245. M.enable(S.BLEND);
  51246. for (var f = 0, g = p.lensFlares.length; f < g; f++) {
  51247. var m = p.lensFlares[f];
  51248. .001 < m.opacity && .001 < m.scale && (c.x = m.x,
  51249. c.y = m.y,
  51250. c.z = m.z,
  51251. s = m.size * m.scale / i.w,
  51252. l.x = s * r,
  51253. l.y = s,
  51254. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  51255. S.uniform2f(b.scale, l.x, l.y),
  51256. S.uniform1f(b.rotation, m.rotation),
  51257. S.uniform1f(b.opacity, m.opacity),
  51258. S.uniform3f(b.color, m.color.r, m.color.g, m.color.b),
  51259. M.setBlending(m.blending, m.blendEquation, m.blendSrc, m.blendDst),
  51260. v.setTexture(m.texture, 1),
  51261. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0))
  51262. }
  51263. }
  51264. }
  51265. M.enable(S.CULL_FACE),
  51266. M.enable(S.DEPTH_TEST),
  51267. M.setDepthWrite(!0),
  51268. v.resetGLState()
  51269. }
  51270. }
  51271. }
  51272. ,
  51273. Ci.SpritePlugin = function(u, d) {
  51274. function p() {
  51275. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  51276. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  51277. g = I.createBuffer(),
  51278. m = I.createBuffer(),
  51279. I.bindBuffer(I.ARRAY_BUFFER, g),
  51280. I.bufferData(I.ARRAY_BUFFER, e, I.STATIC_DRAW),
  51281. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  51282. I.bufferData(I.ELEMENT_ARRAY_BUFFER, t, I.STATIC_DRAW),
  51283. v = function() {
  51284. var e = I.createProgram()
  51285. , t = I.createShader(I.VERTEX_SHADER)
  51286. , i = I.createShader(I.FRAGMENT_SHADER);
  51287. return I.shaderSource(t, ["precision " + u.getPrecision() + " float;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform float rotation;", "uniform vec2 scale;", "uniform vec2 uvOffset;", "uniform vec2 uvScale;", "attribute vec2 position;", "attribute vec2 uv;", "varying vec2 vUV;", "void main() {", "vUV = uvOffset + uv * uvScale;", "vec2 alignedPosition = position * scale;", "vec2 rotatedPosition;", "rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;", "rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;", "vec4 finalPosition;", "finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );", "finalPosition.xy += rotatedPosition;", "finalPosition = projectionMatrix * finalPosition;", "gl_Position = finalPosition;", "}"].join("\n")),
  51288. I.shaderSource(i, ["precision " + u.getPrecision() + " float;", "uniform vec3 color;", "uniform sampler2D map;", "uniform float opacity;", "uniform int fogType;", "uniform vec3 fogColor;", "uniform float fogDensity;", "uniform float fogNear;", "uniform float fogFar;", "uniform float alphaTest;", "varying vec2 vUV;", "void main() {", "vec4 texture = texture2D( map, vUV );", "if ( texture.a < alphaTest ) discard;", "gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );", "if ( fogType > 0 ) {", "float depth = gl_FragCoord.z / gl_FragCoord.w;", "float fogFactor = 0.0;", "if ( fogType == 1 ) {", "fogFactor = smoothstep( fogNear, fogFar, depth );", "} else {", "const float LOG2 = 1.442695;", "fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );", "fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );", "}", "gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );", "}", "}"].join("\n")),
  51289. I.compileShader(t),
  51290. I.compileShader(i),
  51291. I.attachShader(e, t),
  51292. I.attachShader(e, i),
  51293. I.linkProgram(e),
  51294. e
  51295. }(),
  51296. y = {
  51297. position: I.getAttribLocation(v, "position"),
  51298. uv: I.getAttribLocation(v, "uv")
  51299. },
  51300. A = {
  51301. uvOffset: I.getUniformLocation(v, "uvOffset"),
  51302. uvScale: I.getUniformLocation(v, "uvScale"),
  51303. rotation: I.getUniformLocation(v, "rotation"),
  51304. scale: I.getUniformLocation(v, "scale"),
  51305. color: I.getUniformLocation(v, "color"),
  51306. map: I.getUniformLocation(v, "map"),
  51307. opacity: I.getUniformLocation(v, "opacity"),
  51308. modelViewMatrix: I.getUniformLocation(v, "modelViewMatrix"),
  51309. projectionMatrix: I.getUniformLocation(v, "projectionMatrix"),
  51310. fogType: I.getUniformLocation(v, "fogType"),
  51311. fogDensity: I.getUniformLocation(v, "fogDensity"),
  51312. fogNear: I.getUniformLocation(v, "fogNear"),
  51313. fogFar: I.getUniformLocation(v, "fogFar"),
  51314. fogColor: I.getUniformLocation(v, "fogColor"),
  51315. alphaTest: I.getUniformLocation(v, "alphaTest")
  51316. };
  51317. var i = document.createElement("canvas");
  51318. i.width = 8,
  51319. i.height = 8;
  51320. var n = i.getContext("2d");
  51321. n.fillStyle = "white",
  51322. n.fillRect(0, 0, 8, 8),
  51323. (C = new Ci.Texture(i)).needsUpdate = !0
  51324. }
  51325. function f(e, t) {
  51326. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  51327. }
  51328. var g, m, v, y, A, C, I = u.context, E = u.state, _ = new Ci.Vector3, b = new Ci.Quaternion, w = new Ci.Vector3;
  51329. this.render = function(e, t) {
  51330. if (0 !== d.length) {
  51331. void 0 === v && p(),
  51332. I.useProgram(v),
  51333. E.initAttributes(),
  51334. E.enableAttribute(y.position),
  51335. E.enableAttribute(y.uv),
  51336. E.disableUnusedAttributes(),
  51337. E.disable(I.CULL_FACE),
  51338. E.enable(I.BLEND),
  51339. I.bindBuffer(I.ARRAY_BUFFER, g),
  51340. I.vertexAttribPointer(y.position, 2, I.FLOAT, !1, 16, 0),
  51341. I.vertexAttribPointer(y.uv, 2, I.FLOAT, !1, 16, 8),
  51342. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  51343. I.uniformMatrix4fv(A.projectionMatrix, !1, t.projectionMatrix.elements),
  51344. E.activeTexture(I.TEXTURE0),
  51345. I.uniform1i(A.map, 0);
  51346. var i = 0
  51347. , n = 0
  51348. , r = e.fog;
  51349. r ? (I.uniform3f(A.fogColor, r.color.r, r.color.g, r.color.b),
  51350. r instanceof Ci.Fog ? (I.uniform1f(A.fogNear, r.near),
  51351. I.uniform1f(A.fogFar, r.far),
  51352. I.uniform1i(A.fogType, 1),
  51353. n = i = 1) : r instanceof Ci.FogExp2 && (I.uniform1f(A.fogDensity, r.density),
  51354. I.uniform1i(A.fogType, 2),
  51355. n = i = 2)) : (I.uniform1i(A.fogType, 0),
  51356. n = i = 0);
  51357. for (var o = 0, a = d.length; o < a; o++) {
  51358. (l = d[o]).modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  51359. l.z = -l.modelViewMatrix.elements[14]
  51360. }
  51361. d.sort(f);
  51362. var s = [];
  51363. for (o = 0,
  51364. a = d.length; o < a; o++) {
  51365. var l, c = (l = d[o]).material;
  51366. I.uniform1f(A.alphaTest, c.alphaTest),
  51367. I.uniformMatrix4fv(A.modelViewMatrix, !1, l.modelViewMatrix.elements),
  51368. l.matrixWorld.decompose(_, b, w),
  51369. s[0] = w.x,
  51370. s[1] = w.y;
  51371. var h = 0;
  51372. e.fog && c.fog && (h = n),
  51373. i !== h && (I.uniform1i(A.fogType, h),
  51374. i = h),
  51375. null !== c.map ? (I.uniform2f(A.uvOffset, c.map.offset.x, c.map.offset.y),
  51376. I.uniform2f(A.uvScale, c.map.repeat.x, c.map.repeat.y)) : (I.uniform2f(A.uvOffset, 0, 0),
  51377. I.uniform2f(A.uvScale, 1, 1)),
  51378. I.uniform1f(A.opacity, c.opacity),
  51379. I.uniform3f(A.color, c.color.r, c.color.g, c.color.b),
  51380. I.uniform1f(A.rotation, c.rotation),
  51381. I.uniform2fv(A.scale, s),
  51382. E.setBlending(c.blending, c.blendEquation, c.blendSrc, c.blendDst),
  51383. E.setDepthTest(c.depthTest),
  51384. E.setDepthWrite(c.depthWrite),
  51385. c.map && c.map.image && c.map.image.width ? u.setTexture(c.map, 0) : u.setTexture(C, 0),
  51386. I.drawElements(I.TRIANGLES, 6, I.UNSIGNED_SHORT, 0)
  51387. }
  51388. E.enable(I.CULL_FACE),
  51389. u.resetGLState()
  51390. }
  51391. }
  51392. }
  51393. ,
  51394. Object.defineProperties(Ci.Box2.prototype, {
  51395. empty: {
  51396. value: function() {
  51397. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  51398. this.isEmpty()
  51399. }
  51400. },
  51401. isIntersectionBox: {
  51402. value: function(e) {
  51403. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51404. this.intersectsBox(e)
  51405. }
  51406. }
  51407. }),
  51408. Object.defineProperties(Ci.Box3.prototype, {
  51409. empty: {
  51410. value: function() {
  51411. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  51412. this.isEmpty()
  51413. }
  51414. },
  51415. isIntersectionBox: {
  51416. value: function(e) {
  51417. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51418. this.intersectsBox(e)
  51419. }
  51420. },
  51421. isIntersectionSphere: {
  51422. value: function(e) {
  51423. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51424. this.intersectsSphere(e)
  51425. }
  51426. }
  51427. }),
  51428. Object.defineProperties(Ci.Matrix3.prototype, {
  51429. multiplyVector3: {
  51430. value: function(e) {
  51431. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  51432. e.applyMatrix3(this)
  51433. }
  51434. },
  51435. multiplyVector3Array: {
  51436. value: function(e) {
  51437. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51438. this.applyToVector3Array(e)
  51439. }
  51440. }
  51441. }),
  51442. Object.defineProperties(Ci.Matrix4.prototype, {
  51443. extractPosition: {
  51444. value: function(e) {
  51445. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  51446. this.copyPosition(e)
  51447. }
  51448. },
  51449. setRotationFromQuaternion: {
  51450. value: function(e) {
  51451. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  51452. this.makeRotationFromQuaternion(e)
  51453. }
  51454. },
  51455. multiplyVector3: {
  51456. value: function(e) {
  51457. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  51458. e.applyProjection(this)
  51459. }
  51460. },
  51461. multiplyVector4: {
  51462. value: function(e) {
  51463. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51464. e.applyMatrix4(this)
  51465. }
  51466. },
  51467. multiplyVector3Array: {
  51468. value: function(e) {
  51469. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51470. this.applyToVector3Array(e)
  51471. }
  51472. },
  51473. rotateAxis: {
  51474. value: function(e) {
  51475. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  51476. e.transformDirection(this)
  51477. }
  51478. },
  51479. crossVector: {
  51480. value: function(e) {
  51481. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51482. e.applyMatrix4(this)
  51483. }
  51484. },
  51485. translate: {
  51486. value: function(e) {
  51487. console.error("THREE.Matrix4: .translate() has been removed.")
  51488. }
  51489. },
  51490. rotateX: {
  51491. value: function(e) {
  51492. console.error("THREE.Matrix4: .rotateX() has been removed.")
  51493. }
  51494. },
  51495. rotateY: {
  51496. value: function(e) {
  51497. console.error("THREE.Matrix4: .rotateY() has been removed.")
  51498. }
  51499. },
  51500. rotateZ: {
  51501. value: function(e) {
  51502. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  51503. }
  51504. },
  51505. rotateByAxis: {
  51506. value: function(e, t) {
  51507. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  51508. }
  51509. }
  51510. }),
  51511. Object.defineProperties(Ci.Plane.prototype, {
  51512. isIntersectionLine: {
  51513. value: function(e) {
  51514. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  51515. this.intersectsLine(e)
  51516. }
  51517. }
  51518. }),
  51519. Object.defineProperties(Ci.Quaternion.prototype, {
  51520. multiplyVector3: {
  51521. value: function(e) {
  51522. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  51523. e.applyQuaternion(this)
  51524. }
  51525. }
  51526. }),
  51527. Object.defineProperties(Ci.Ray.prototype, {
  51528. isIntersectionBox: {
  51529. value: function(e) {
  51530. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51531. this.intersectsBox(e)
  51532. }
  51533. },
  51534. isIntersectionPlane: {
  51535. value: function(e) {
  51536. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  51537. this.intersectsPlane(e)
  51538. }
  51539. },
  51540. isIntersectionSphere: {
  51541. value: function(e) {
  51542. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51543. this.intersectsSphere(e)
  51544. }
  51545. }
  51546. }),
  51547. Object.defineProperties(Ci.Vector3.prototype, {
  51548. setEulerFromRotationMatrix: {
  51549. value: function() {
  51550. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  51551. }
  51552. },
  51553. setEulerFromQuaternion: {
  51554. value: function() {
  51555. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  51556. }
  51557. },
  51558. getPositionFromMatrix: {
  51559. value: function(e) {
  51560. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  51561. this.setFromMatrixPosition(e)
  51562. }
  51563. },
  51564. getScaleFromMatrix: {
  51565. value: function(e) {
  51566. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  51567. this.setFromMatrixScale(e)
  51568. }
  51569. },
  51570. getColumnFromMatrix: {
  51571. value: function(e, t) {
  51572. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  51573. this.setFromMatrixColumn(e, t)
  51574. }
  51575. }
  51576. }),
  51577. Ci.Face4 = function(e, t, i, n, r, o, a) {
  51578. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  51579. new Ci.Face3(e,t,i,r,o,a)
  51580. }
  51581. ,
  51582. Ci.Vertex = function(e, t, i) {
  51583. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  51584. new Ci.Vector3(e,t,i)
  51585. }
  51586. ,
  51587. Object.defineProperties(Ci.Object3D.prototype, {
  51588. eulerOrder: {
  51589. get: function() {
  51590. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51591. this.rotation.order
  51592. },
  51593. set: function(e) {
  51594. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51595. this.rotation.order = e
  51596. }
  51597. },
  51598. getChildByName: {
  51599. value: function(e) {
  51600. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  51601. this.getObjectByName(e)
  51602. }
  51603. },
  51604. renderDepth: {
  51605. set: function(e) {
  51606. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  51607. }
  51608. },
  51609. translate: {
  51610. value: function(e, t) {
  51611. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  51612. this.translateOnAxis(t, e)
  51613. }
  51614. },
  51615. useQuaternion: {
  51616. get: function() {
  51617. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51618. },
  51619. set: function(e) {
  51620. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51621. }
  51622. }
  51623. }),
  51624. Object.defineProperties(Ci, {
  51625. PointCloud: {
  51626. value: function(e, t) {
  51627. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  51628. new Ci.Points(e,t)
  51629. }
  51630. },
  51631. ParticleSystem: {
  51632. value: function(e, t) {
  51633. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  51634. new Ci.Points(e,t)
  51635. }
  51636. }
  51637. }),
  51638. Object.defineProperties(Ci.Light.prototype, {
  51639. onlyShadow: {
  51640. set: function(e) {
  51641. console.warn("THREE.Light: .onlyShadow has been removed.")
  51642. }
  51643. },
  51644. shadowCameraFov: {
  51645. set: function(e) {
  51646. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  51647. this.shadow.camera.fov = e
  51648. }
  51649. },
  51650. shadowCameraLeft: {
  51651. set: function(e) {
  51652. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  51653. this.shadow.camera.left = e
  51654. }
  51655. },
  51656. shadowCameraRight: {
  51657. set: function(e) {
  51658. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  51659. this.shadow.camera.right = e
  51660. }
  51661. },
  51662. shadowCameraTop: {
  51663. set: function(e) {
  51664. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  51665. this.shadow.camera.top = e
  51666. }
  51667. },
  51668. shadowCameraBottom: {
  51669. set: function(e) {
  51670. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  51671. this.shadow.camera.bottom = e
  51672. }
  51673. },
  51674. shadowCameraNear: {
  51675. set: function(e) {
  51676. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  51677. this.shadow.camera.near = e
  51678. }
  51679. },
  51680. shadowCameraFar: {
  51681. set: function(e) {
  51682. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  51683. this.shadow.camera.far = e
  51684. }
  51685. },
  51686. shadowCameraVisible: {
  51687. set: function(e) {
  51688. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  51689. }
  51690. },
  51691. shadowBias: {
  51692. set: function(e) {
  51693. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  51694. this.shadow.bias = e
  51695. }
  51696. },
  51697. shadowDarkness: {
  51698. set: function(e) {
  51699. console.warn("THREE.Light: .shadowDarkness has been removed.")
  51700. }
  51701. },
  51702. shadowMapWidth: {
  51703. set: function(e) {
  51704. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  51705. this.shadow.mapSize.width = e
  51706. }
  51707. },
  51708. shadowMapHeight: {
  51709. set: function(e) {
  51710. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  51711. this.shadow.mapSize.height = e
  51712. }
  51713. }
  51714. }),
  51715. Object.defineProperties(Ci.BufferAttribute.prototype, {
  51716. length: {
  51717. get: function() {
  51718. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  51719. this.array.length
  51720. }
  51721. }
  51722. }),
  51723. Object.defineProperties(Ci.BufferGeometry.prototype, {
  51724. drawcalls: {
  51725. get: function() {
  51726. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  51727. this.groups
  51728. }
  51729. },
  51730. offsets: {
  51731. get: function() {
  51732. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  51733. this.groups
  51734. }
  51735. },
  51736. addIndex: {
  51737. value: function(e) {
  51738. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  51739. this.setIndex(e)
  51740. }
  51741. },
  51742. addDrawCall: {
  51743. value: function(e, t, i) {
  51744. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  51745. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  51746. this.addGroup(e, t)
  51747. }
  51748. },
  51749. clearDrawCalls: {
  51750. value: function() {
  51751. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  51752. this.clearGroups()
  51753. }
  51754. },
  51755. computeTangents: {
  51756. value: function() {
  51757. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  51758. }
  51759. },
  51760. computeOffsets: {
  51761. value: function() {
  51762. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  51763. }
  51764. }
  51765. }),
  51766. Object.defineProperties(Ci.Material.prototype, {
  51767. wrapAround: {
  51768. get: function() {
  51769. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51770. },
  51771. set: function(e) {
  51772. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51773. }
  51774. },
  51775. wrapRGB: {
  51776. get: function() {
  51777. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  51778. new Ci.Color
  51779. }
  51780. }
  51781. }),
  51782. Object.defineProperties(Ci, {
  51783. PointCloudMaterial: {
  51784. value: function(e) {
  51785. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  51786. new Ci.PointsMaterial(e)
  51787. }
  51788. },
  51789. ParticleBasicMaterial: {
  51790. value: function(e) {
  51791. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  51792. new Ci.PointsMaterial(e)
  51793. }
  51794. },
  51795. ParticleSystemMaterial: {
  51796. value: function(e) {
  51797. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  51798. new Ci.PointsMaterial(e)
  51799. }
  51800. }
  51801. }),
  51802. Object.defineProperties(Ci.MeshPhongMaterial.prototype, {
  51803. metal: {
  51804. get: function() {
  51805. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  51806. !1
  51807. },
  51808. set: function(e) {
  51809. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  51810. }
  51811. }
  51812. }),
  51813. Object.defineProperties(Ci.ShaderMaterial.prototype, {
  51814. derivatives: {
  51815. get: function() {
  51816. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51817. this.extensions.derivatives
  51818. },
  51819. set: function(e) {
  51820. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51821. this.extensions.derivatives = e
  51822. }
  51823. }
  51824. }),
  51825. Object.defineProperties(Ci.WebGLRenderer.prototype, {
  51826. supportsFloatTextures: {
  51827. value: function() {
  51828. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  51829. this.extensions.get("OES_texture_float")
  51830. }
  51831. },
  51832. supportsHalfFloatTextures: {
  51833. value: function() {
  51834. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  51835. this.extensions.get("OES_texture_half_float")
  51836. }
  51837. },
  51838. supportsStandardDerivatives: {
  51839. value: function() {
  51840. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  51841. this.extensions.get("OES_standard_derivatives")
  51842. }
  51843. },
  51844. supportsCompressedTextureS3TC: {
  51845. value: function() {
  51846. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  51847. this.extensions.get("WEBGL_compressed_texture_s3tc")
  51848. }
  51849. },
  51850. supportsCompressedTexturePVRTC: {
  51851. value: function() {
  51852. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  51853. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  51854. }
  51855. },
  51856. supportsBlendMinMax: {
  51857. value: function() {
  51858. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  51859. this.extensions.get("EXT_blend_minmax")
  51860. }
  51861. },
  51862. supportsVertexTextures: {
  51863. value: function() {
  51864. return this.capabilities.vertexTextures
  51865. }
  51866. },
  51867. supportsInstancedArrays: {
  51868. value: function() {
  51869. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  51870. this.extensions.get("ANGLE_instanced_arrays")
  51871. }
  51872. },
  51873. enableScissorTest: {
  51874. value: function(e) {
  51875. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  51876. this.setScissorTest(e)
  51877. }
  51878. },
  51879. initMaterial: {
  51880. value: function() {
  51881. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  51882. }
  51883. },
  51884. addPrePlugin: {
  51885. value: function() {
  51886. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  51887. }
  51888. },
  51889. addPostPlugin: {
  51890. value: function() {
  51891. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  51892. }
  51893. },
  51894. updateShadowMap: {
  51895. value: function() {
  51896. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  51897. }
  51898. },
  51899. shadowMapEnabled: {
  51900. get: function() {
  51901. return this.shadowMap.enabled
  51902. },
  51903. set: function(e) {
  51904. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  51905. this.shadowMap.enabled = e
  51906. }
  51907. },
  51908. shadowMapType: {
  51909. get: function() {
  51910. return this.shadowMap.type
  51911. },
  51912. set: function(e) {
  51913. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  51914. this.shadowMap.type = e
  51915. }
  51916. },
  51917. shadowMapCullFace: {
  51918. get: function() {
  51919. return this.shadowMap.cullFace
  51920. },
  51921. set: function(e) {
  51922. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  51923. this.shadowMap.cullFace = e
  51924. }
  51925. }
  51926. }),
  51927. Object.defineProperties(Ci.WebGLRenderTarget.prototype, {
  51928. wrapS: {
  51929. get: function() {
  51930. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51931. this.texture.wrapS
  51932. },
  51933. set: function(e) {
  51934. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51935. this.texture.wrapS = e
  51936. }
  51937. },
  51938. wrapT: {
  51939. get: function() {
  51940. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51941. this.texture.wrapT
  51942. },
  51943. set: function(e) {
  51944. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51945. this.texture.wrapT = e
  51946. }
  51947. },
  51948. magFilter: {
  51949. get: function() {
  51950. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51951. this.texture.magFilter
  51952. },
  51953. set: function(e) {
  51954. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51955. this.texture.magFilter = e
  51956. }
  51957. },
  51958. minFilter: {
  51959. get: function() {
  51960. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51961. this.texture.minFilter
  51962. },
  51963. set: function(e) {
  51964. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51965. this.texture.minFilter = e
  51966. }
  51967. },
  51968. anisotropy: {
  51969. get: function() {
  51970. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51971. this.texture.anisotropy
  51972. },
  51973. set: function(e) {
  51974. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51975. this.texture.anisotropy = e
  51976. }
  51977. },
  51978. offset: {
  51979. get: function() {
  51980. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51981. this.texture.offset
  51982. },
  51983. set: function(e) {
  51984. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51985. this.texture.offset = e
  51986. }
  51987. },
  51988. repeat: {
  51989. get: function() {
  51990. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51991. this.texture.repeat
  51992. },
  51993. set: function(e) {
  51994. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51995. this.texture.repeat = e
  51996. }
  51997. },
  51998. format: {
  51999. get: function() {
  52000. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  52001. this.texture.format
  52002. },
  52003. set: function(e) {
  52004. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  52005. this.texture.format = e
  52006. }
  52007. },
  52008. type: {
  52009. get: function() {
  52010. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  52011. this.texture.type
  52012. },
  52013. set: function(e) {
  52014. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  52015. this.texture.type = e
  52016. }
  52017. },
  52018. generateMipmaps: {
  52019. get: function() {
  52020. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  52021. this.texture.generateMipmaps
  52022. },
  52023. set: function(e) {
  52024. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  52025. this.texture.generateMipmaps = e
  52026. }
  52027. }
  52028. }),
  52029. Ci.GeometryUtils = {
  52030. merge: function(e, t, i) {
  52031. var n;
  52032. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),
  52033. t instanceof Ci.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  52034. n = t.matrix,
  52035. t = t.geometry),
  52036. e.merge(t, n, i)
  52037. },
  52038. center: function(e) {
  52039. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  52040. e.center()
  52041. }
  52042. },
  52043. Ci.ImageUtils = {
  52044. crossOrigin: void 0,
  52045. loadTexture: function(e, t, i, n) {
  52046. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  52047. var r = new Ci.TextureLoader;
  52048. r.setCrossOrigin(this.crossOrigin);
  52049. var o = r.load(e, i, void 0, n);
  52050. return t && (o.mapping = t),
  52051. o
  52052. },
  52053. loadTextureCube: function(e, t, i, n) {
  52054. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  52055. var r = new Ci.CubeTextureLoader;
  52056. r.setCrossOrigin(this.crossOrigin);
  52057. var o = r.load(e, i, void 0, n);
  52058. return t && (o.mapping = t),
  52059. o
  52060. },
  52061. loadCompressedTexture: function() {
  52062. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  52063. },
  52064. loadCompressedTextureCube: function() {
  52065. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  52066. }
  52067. },
  52068. Ci.Projector = function() {
  52069. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  52070. this.projectVector = function(e, t) {
  52071. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  52072. e.project(t)
  52073. }
  52074. ,
  52075. this.unprojectVector = function(e, t) {
  52076. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  52077. e.unproject(t)
  52078. }
  52079. ,
  52080. this.pickingRay = function(e, t) {
  52081. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  52082. }
  52083. }
  52084. ,
  52085. Ci.CanvasRenderer = function() {
  52086. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  52087. this.domElement = document.createElement("canvas"),
  52088. this.clear = function() {}
  52089. ,
  52090. this.render = function() {}
  52091. ,
  52092. this.setClearColor = function() {}
  52093. ,
  52094. this.setSize = function() {}
  52095. }
  52096. ,
  52097. Ci.MeshFaceMaterial = Ci.MultiMaterial,
  52098. Ci.CurveUtils = {
  52099. tangentQuadraticBezier: function(e, t, i, n) {
  52100. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  52101. },
  52102. tangentCubicBezier: function(e, t, i, n, r) {
  52103. 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
  52104. },
  52105. tangentSpline: function(e, t, i, n, r) {
  52106. return 6 * e * e - 6 * e + (3 * e * e - 4 * e + 1) + (-6 * e * e + 6 * e) + (3 * e * e - 2 * e)
  52107. },
  52108. interpolate: function(e, t, i, n, r) {
  52109. var o = .5 * (i - e)
  52110. , a = .5 * (n - t)
  52111. , s = r * r;
  52112. return (2 * t - 2 * i + o + a) * (r * s) + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  52113. }
  52114. },
  52115. Ci.SceneUtils = {
  52116. createMultiMaterialObject: function(e, t) {
  52117. for (var i = new Ci.Group, n = 0, r = t.length; n < r; n++)
  52118. i.add(new Ci.Mesh(e,t[n]));
  52119. return i
  52120. },
  52121. detach: function(e, t, i) {
  52122. e.applyMatrix(t.matrixWorld),
  52123. t.remove(e),
  52124. i.add(e)
  52125. },
  52126. attach: function(e, t, i) {
  52127. var n = new Ci.Matrix4;
  52128. n.getInverse(i.matrixWorld),
  52129. e.applyMatrix(n),
  52130. t.remove(e),
  52131. i.add(e)
  52132. }
  52133. },
  52134. Ci.ShapeUtils = {
  52135. area: function(e) {
  52136. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  52137. i += e[n].x * e[r].y - e[r].x * e[n].y;
  52138. return .5 * i
  52139. },
  52140. triangulate: function(e, t) {
  52141. var i = e.length;
  52142. if (i < 3)
  52143. return null;
  52144. var n, r, o, a = [], s = [], l = [];
  52145. if (0 < Ci.ShapeUtils.area(e))
  52146. for (r = 0; r < i; r++)
  52147. s[r] = r;
  52148. else
  52149. for (r = 0; r < i; r++)
  52150. s[r] = i - 1 - r;
  52151. var c = i
  52152. , h = 2 * c;
  52153. for (r = c - 1; 2 < c; ) {
  52154. if (h-- <= 0)
  52155. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  52156. t ? l : a;
  52157. if (c <= (n = r) && (n = 0),
  52158. c <= (r = n + 1) && (r = 0),
  52159. c <= (o = r + 1) && (o = 0),
  52160. Si(e, n, r, o, c, s)) {
  52161. var u, d, p, f, g;
  52162. for (u = s[n],
  52163. d = s[r],
  52164. p = s[o],
  52165. a.push([e[u], e[d], e[p]]),
  52166. l.push([s[n], s[r], s[o]]),
  52167. g = (f = r) + 1; g < c; f++,
  52168. g++)
  52169. s[f] = s[g];
  52170. h = 2 * --c
  52171. }
  52172. }
  52173. return t ? l : a
  52174. },
  52175. triangulateShape: function(e, t) {
  52176. function w(e, t, i) {
  52177. 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
  52178. }
  52179. function b(e, t, i, n, r) {
  52180. var o = t.x - e.x
  52181. , a = t.y - e.y
  52182. , s = n.x - i.x
  52183. , l = n.y - i.y
  52184. , c = e.x - i.x
  52185. , h = e.y - i.y
  52186. , u = a * s - o * l
  52187. , d = a * c - o * h;
  52188. if (Math.abs(u) > Number.EPSILON) {
  52189. var p;
  52190. if (0 < u) {
  52191. if (d < 0 || u < d)
  52192. return [];
  52193. if ((p = l * c - s * h) < 0 || u < p)
  52194. return []
  52195. } else {
  52196. if (0 < d || d < u)
  52197. return [];
  52198. if (0 < (p = l * c - s * h) || p < u)
  52199. return []
  52200. }
  52201. if (0 === p)
  52202. return !r || 0 != d && d != u ? [e] : [];
  52203. if (p === u)
  52204. return !r || 0 != d && d != u ? [t] : [];
  52205. if (0 == d)
  52206. return [i];
  52207. if (d == u)
  52208. return [n];
  52209. var f = p / u;
  52210. return [{
  52211. x: e.x + f * o,
  52212. y: e.y + f * a
  52213. }]
  52214. }
  52215. if (0 != d || l * c != s * h)
  52216. return [];
  52217. var g, m, v, y, A, C, I, E, _ = 0 == o && 0 == a, b = 0 == s && 0 == l;
  52218. return _ && b ? e.x !== i.x || e.y !== i.y ? [] : [e] : _ ? w(i, n, e) ? [e] : [] : b ? w(e, t, i) ? [i] : [] : (E = 0 != o ? (y = e.x < t.x ? (v = (g = e).x,
  52219. (m = t).x) : (v = (g = t).x,
  52220. (m = e).x),
  52221. i.x < n.x ? (I = (A = i).x,
  52222. (C = n).x) : (I = (A = n).x,
  52223. (C = i).x)) : (y = e.y < t.y ? (v = (g = e).y,
  52224. (m = t).y) : (v = (g = t).y,
  52225. (m = e).y),
  52226. i.y < n.y ? (I = (A = i).y,
  52227. (C = n).y) : (I = (A = n).y,
  52228. (C = i).y)),
  52229. v <= I ? y < I ? [] : y === I ? r ? [] : [A] : y <= E ? [A, m] : [A, C] : E < v ? [] : v === E ? r ? [] : [g] : y <= E ? [g, m] : [g, C])
  52230. }
  52231. function T(e, t, i, n) {
  52232. var r = t.x - e.x
  52233. , o = t.y - e.y
  52234. , a = i.x - e.x
  52235. , s = i.y - e.y
  52236. , l = n.x - e.x
  52237. , c = n.y - e.y
  52238. , h = r * s - o * a
  52239. , u = r * c - o * l;
  52240. if (Math.abs(h) > Number.EPSILON) {
  52241. var d = l * s - c * a;
  52242. return 0 < h ? 0 <= u && 0 <= d : 0 <= u || 0 <= d
  52243. }
  52244. return 0 < u
  52245. }
  52246. for (var i, n, r, o, a, s, l = {}, c = e.concat(), h = 0, u = t.length; h < u; h++)
  52247. Array.prototype.push.apply(c, t[h]);
  52248. for (i = 0,
  52249. n = c.length; i < n; i++)
  52250. void 0 !== l[a = c[i].x + ":" + c[i].y] && console.warn("THREE.Shape: Duplicate point", a),
  52251. l[a] = i;
  52252. var d = function(e, a) {
  52253. function t(e, t) {
  52254. var i = m.length - 1
  52255. , n = e - 1;
  52256. n < 0 && (n = i);
  52257. var r = e + 1;
  52258. i < r && (r = 0);
  52259. var o = T(m[e], m[n], m[r], c[t]);
  52260. if (!o)
  52261. return !1;
  52262. var a = c.length - 1
  52263. , s = t - 1;
  52264. s < 0 && (s = a);
  52265. var l = t + 1;
  52266. return a < l && (l = 0),
  52267. !!(o = T(c[t], c[s], c[l], m[e]))
  52268. }
  52269. function i(e, t) {
  52270. var i, n;
  52271. for (i = 0; i < m.length; i++)
  52272. if (n = i + 1,
  52273. n %= m.length,
  52274. 0 < b(e, t, m[i], m[n], !0).length)
  52275. return !0;
  52276. return !1
  52277. }
  52278. function n(e, t) {
  52279. var i, n, r, o;
  52280. for (i = 0; i < v.length; i++)
  52281. for (n = a[v[i]],
  52282. r = 0; r < n.length; r++)
  52283. if (o = r + 1,
  52284. o %= n.length,
  52285. 0 < b(e, t, n[r], n[o], !0).length)
  52286. return !0;
  52287. return !1
  52288. }
  52289. for (var c, r, o, s, l, h, u, d, p, f, g, m = e.concat(), v = [], y = [], A = 0, C = a.length; A < C; A++)
  52290. v.push(A);
  52291. for (var I = 0, E = 2 * v.length; 0 < v.length; ) {
  52292. if (--E < 0) {
  52293. console.log("Infinite Loop! Holes left:" + v.length + ", Probably Hole outside Shape!");
  52294. break
  52295. }
  52296. for (o = I; o < m.length; o++) {
  52297. s = m[o],
  52298. r = -1;
  52299. for (A = 0; A < v.length; A++)
  52300. if (h = v[A],
  52301. void 0 === y[u = s.x + ":" + s.y + ":" + h]) {
  52302. c = a[h];
  52303. for (var _ = 0; _ < c.length; _++)
  52304. if (l = c[_],
  52305. t(o, _) && !i(s, l) && !n(s, l)) {
  52306. r = _,
  52307. v.splice(A, 1),
  52308. d = m.slice(0, o + 1),
  52309. p = m.slice(o),
  52310. f = c.slice(r),
  52311. g = c.slice(0, r + 1),
  52312. m = d.concat(f).concat(g).concat(p),
  52313. I = o;
  52314. break
  52315. }
  52316. if (0 <= r)
  52317. break;
  52318. y[u] = !0
  52319. }
  52320. if (0 <= r)
  52321. break
  52322. }
  52323. }
  52324. return m
  52325. }(e, t)
  52326. , p = Ci.ShapeUtils.triangulate(d, !1);
  52327. for (i = 0,
  52328. n = p.length; i < n; i++)
  52329. for (o = p[i],
  52330. r = 0; r < 3; r++)
  52331. void 0 !== (s = l[a = o[r].x + ":" + o[r].y]) && (o[r] = s);
  52332. return p.concat()
  52333. },
  52334. isClockWise: function(e) {
  52335. return Ci.ShapeUtils.area(e) < 0
  52336. },
  52337. b2: function(e, t, i, n) {
  52338. return function(e, t) {
  52339. var i = 1 - e;
  52340. return i * i * t
  52341. }(e, t) + function(e, t) {
  52342. return 2 * (1 - e) * e * t
  52343. }(e, i) + function(e, t) {
  52344. return e * e * t
  52345. }(e, n)
  52346. },
  52347. b3: function(e, t, i, n, r) {
  52348. return function(e, t) {
  52349. var i = 1 - e;
  52350. return i * i * i * t
  52351. }(e, t) + function(e, t) {
  52352. var i = 1 - e;
  52353. return 3 * i * i * e * t
  52354. }(e, i) + function(e, t) {
  52355. return 3 * (1 - e) * e * e * t
  52356. }(e, n) + function(e, t) {
  52357. return e * e * e * t
  52358. }(e, r)
  52359. }
  52360. },
  52361. Ci.Curve = function() {}
  52362. ,
  52363. Ci.Curve.prototype = {
  52364. constructor: Ci.Curve,
  52365. getPoint: function(e) {
  52366. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  52367. null
  52368. },
  52369. getPointAt: function(e) {
  52370. var t = this.getUtoTmapping(e);
  52371. return this.getPoint(t)
  52372. },
  52373. getPoints: function(e) {
  52374. e = e || 5;
  52375. var t, i = [];
  52376. for (t = 0; t <= e; t++)
  52377. i.push(this.getPoint(t / e));
  52378. return i
  52379. },
  52380. getSpacedPoints: function(e) {
  52381. e = e || 5;
  52382. var t, i = [];
  52383. for (t = 0; t <= e; t++)
  52384. i.push(this.getPointAt(t / e));
  52385. return i
  52386. },
  52387. getLength: function() {
  52388. var e = this.getLengths();
  52389. return e[e.length - 1]
  52390. },
  52391. getLengths: function(e) {
  52392. if (e = e || (this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  52393. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  52394. return this.cacheArcLengths;
  52395. this.needsUpdate = !1;
  52396. var t, i, n = [], r = this.getPoint(0), o = 0;
  52397. for (n.push(0),
  52398. i = 1; i <= e; i++)
  52399. o += (t = this.getPoint(i / e)).distanceTo(r),
  52400. n.push(o),
  52401. r = t;
  52402. return this.cacheArcLengths = n
  52403. },
  52404. updateArcLengths: function() {
  52405. this.needsUpdate = !0,
  52406. this.getLengths()
  52407. },
  52408. getUtoTmapping: function(e, t) {
  52409. var i, n = this.getLengths(), r = 0, o = n.length;
  52410. i = t || e * n[o - 1];
  52411. for (var a, s = 0, l = o - 1; s <= l; )
  52412. if ((a = n[r = Math.floor(s + (l - s) / 2)] - i) < 0)
  52413. s = r + 1;
  52414. else {
  52415. if (!(0 < a)) {
  52416. l = r;
  52417. break
  52418. }
  52419. l = r - 1
  52420. }
  52421. if (n[r = l] === i)
  52422. return r / (o - 1);
  52423. var c = n[r];
  52424. return (r + (i - c) / (n[r + 1] - c)) / (o - 1)
  52425. },
  52426. getTangent: function(e) {
  52427. var t = e - 1e-4
  52428. , i = e + 1e-4;
  52429. t < 0 && (t = 0),
  52430. 1 < i && (i = 1);
  52431. var n = this.getPoint(t);
  52432. return this.getPoint(i).clone().sub(n).normalize()
  52433. },
  52434. getTangentAt: function(e) {
  52435. var t = this.getUtoTmapping(e);
  52436. return this.getTangent(t)
  52437. }
  52438. },
  52439. Ci.Curve.create = function(e, t) {
  52440. return e.prototype = Object.create(Ci.Curve.prototype),
  52441. (e.prototype.constructor = e).prototype.getPoint = t,
  52442. e
  52443. }
  52444. ,
  52445. Ci.CurvePath = function() {
  52446. this.curves = [],
  52447. this.autoClose = !1
  52448. }
  52449. ,
  52450. Ci.CurvePath.prototype = Object.create(Ci.Curve.prototype),
  52451. Ci.CurvePath.prototype.constructor = Ci.CurvePath,
  52452. Ci.CurvePath.prototype.add = function(e) {
  52453. this.curves.push(e)
  52454. }
  52455. ,
  52456. Ci.CurvePath.prototype.closePath = function() {
  52457. var e = this.curves[0].getPoint(0)
  52458. , t = this.curves[this.curves.length - 1].getPoint(1);
  52459. e.equals(t) || this.curves.push(new Ci.LineCurve(t,e))
  52460. }
  52461. ,
  52462. Ci.CurvePath.prototype.getPoint = function(e) {
  52463. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  52464. if (i[n] >= t) {
  52465. var r = i[n] - t
  52466. , o = this.curves[n]
  52467. , a = 1 - r / o.getLength();
  52468. return o.getPointAt(a)
  52469. }
  52470. n++
  52471. }
  52472. return null
  52473. }
  52474. ,
  52475. Ci.CurvePath.prototype.getLength = function() {
  52476. var e = this.getCurveLengths();
  52477. return e[e.length - 1]
  52478. }
  52479. ,
  52480. Ci.CurvePath.prototype.getCurveLengths = function() {
  52481. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  52482. return this.cacheLengths;
  52483. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  52484. t += this.curves[i].getLength(),
  52485. e.push(t);
  52486. return this.cacheLengths = e
  52487. }
  52488. ,
  52489. Ci.CurvePath.prototype.createPointsGeometry = function(e) {
  52490. var t = this.getPoints(e);
  52491. return this.createGeometry(t)
  52492. }
  52493. ,
  52494. Ci.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  52495. var t = this.getSpacedPoints(e);
  52496. return this.createGeometry(t)
  52497. }
  52498. ,
  52499. Ci.CurvePath.prototype.createGeometry = function(e) {
  52500. for (var t = new Ci.Geometry, i = 0, n = e.length; i < n; i++) {
  52501. var r = e[i];
  52502. t.vertices.push(new Ci.Vector3(r.x,r.y,r.z || 0))
  52503. }
  52504. return t
  52505. }
  52506. ,
  52507. Ci.Font = function(e) {
  52508. this.data = e
  52509. }
  52510. ,
  52511. Ci.Font.prototype = {
  52512. constructor: Ci.Font,
  52513. generateShapes: function(e, s, b) {
  52514. function l(e, t, i) {
  52515. var n = w.glyphs[e] || w.glyphs["?"];
  52516. if (n) {
  52517. var r, o, a, s, l, c, h, u, d, p, f, g = new Ci.Path, m = [], v = Ci.ShapeUtils.b2, y = Ci.ShapeUtils.b3;
  52518. if (n.o)
  52519. for (var A = n._cachedOutline || (n._cachedOutline = n.o.split(" ")), C = 0, I = A.length; C < I; ) {
  52520. switch (A[C++]) {
  52521. case "m":
  52522. r = A[C++] * t + i,
  52523. o = A[C++] * t,
  52524. g.moveTo(r, o);
  52525. break;
  52526. case "l":
  52527. r = A[C++] * t + i,
  52528. o = A[C++] * t,
  52529. g.lineTo(r, o);
  52530. break;
  52531. case "q":
  52532. if (a = A[C++] * t + i,
  52533. s = A[C++] * t,
  52534. h = A[C++] * t + i,
  52535. u = A[C++] * t,
  52536. g.quadraticCurveTo(h, u, a, s),
  52537. f = m[m.length - 1]) {
  52538. l = f.x,
  52539. c = f.y;
  52540. for (var E = 1; E <= b; E++) {
  52541. v(_ = E / b, l, h, a),
  52542. v(_, c, u, s)
  52543. }
  52544. }
  52545. break;
  52546. case "b":
  52547. if (a = A[C++] * t + i,
  52548. s = A[C++] * t,
  52549. h = A[C++] * t + i,
  52550. u = A[C++] * t,
  52551. d = A[C++] * t + i,
  52552. p = A[C++] * t,
  52553. g.bezierCurveTo(h, u, d, p, a, s),
  52554. f = m[m.length - 1]) {
  52555. l = f.x,
  52556. c = f.y;
  52557. for (E = 1; E <= b; E++) {
  52558. var _;
  52559. y(_ = E / b, l, h, d, a),
  52560. y(_, c, u, p, s)
  52561. }
  52562. }
  52563. }
  52564. }
  52565. return {
  52566. offset: n.ha * t,
  52567. path: g
  52568. }
  52569. }
  52570. }
  52571. void 0 === s && (s = 100),
  52572. void 0 === b && (b = 4);
  52573. for (var w = this.data, t = function(e) {
  52574. for (var t = String(e).split(""), i = s / w.resolution, n = 0, r = [], o = 0; o < t.length; o++) {
  52575. var a = l(t[o], i, n);
  52576. n += a.offset,
  52577. r.push(a.path)
  52578. }
  52579. return r
  52580. }(e), i = [], n = 0, r = t.length; n < r; n++)
  52581. Array.prototype.push.apply(i, t[n].toShapes());
  52582. return i
  52583. }
  52584. },
  52585. Ci.Path = function(e) {
  52586. Ci.CurvePath.call(this),
  52587. this.actions = [],
  52588. e && this.fromPoints(e)
  52589. }
  52590. ,
  52591. Ci.Path.prototype = Object.create(Ci.CurvePath.prototype),
  52592. Ci.Path.prototype.constructor = Ci.Path,
  52593. Ci.Path.prototype.fromPoints = function(e) {
  52594. this.moveTo(e[0].x, e[0].y);
  52595. for (var t = 1, i = e.length; t < i; t++)
  52596. this.lineTo(e[t].x, e[t].y)
  52597. }
  52598. ,
  52599. Ci.Path.prototype.moveTo = function(e, t) {
  52600. this.actions.push({
  52601. action: "moveTo",
  52602. args: [e, t]
  52603. })
  52604. }
  52605. ,
  52606. Ci.Path.prototype.lineTo = function(e, t) {
  52607. var i = this.actions[this.actions.length - 1].args
  52608. , n = i[i.length - 2]
  52609. , r = i[i.length - 1]
  52610. , o = new Ci.LineCurve(new Ci.Vector2(n,r),new Ci.Vector2(e,t));
  52611. this.curves.push(o),
  52612. this.actions.push({
  52613. action: "lineTo",
  52614. args: [e, t]
  52615. })
  52616. }
  52617. ,
  52618. Ci.Path.prototype.quadraticCurveTo = function(e, t, i, n) {
  52619. var r = this.actions[this.actions.length - 1].args
  52620. , o = r[r.length - 2]
  52621. , a = r[r.length - 1]
  52622. , s = new Ci.QuadraticBezierCurve(new Ci.Vector2(o,a),new Ci.Vector2(e,t),new Ci.Vector2(i,n));
  52623. this.curves.push(s),
  52624. this.actions.push({
  52625. action: "quadraticCurveTo",
  52626. args: [e, t, i, n]
  52627. })
  52628. }
  52629. ,
  52630. Ci.Path.prototype.bezierCurveTo = function(e, t, i, n, r, o) {
  52631. var a = this.actions[this.actions.length - 1].args
  52632. , s = a[a.length - 2]
  52633. , l = a[a.length - 1]
  52634. , c = new Ci.CubicBezierCurve(new Ci.Vector2(s,l),new Ci.Vector2(e,t),new Ci.Vector2(i,n),new Ci.Vector2(r,o));
  52635. this.curves.push(c),
  52636. this.actions.push({
  52637. action: "bezierCurveTo",
  52638. args: [e, t, i, n, r, o]
  52639. })
  52640. }
  52641. ,
  52642. Ci.Path.prototype.splineThru = function(e) {
  52643. var t = Array.prototype.slice.call(arguments)
  52644. , i = this.actions[this.actions.length - 1].args
  52645. , n = i[i.length - 2]
  52646. , r = i[i.length - 1]
  52647. , o = [new Ci.Vector2(n,r)];
  52648. Array.prototype.push.apply(o, e);
  52649. var a = new Ci.SplineCurve(o);
  52650. this.curves.push(a),
  52651. this.actions.push({
  52652. action: "splineThru",
  52653. args: t
  52654. })
  52655. }
  52656. ,
  52657. Ci.Path.prototype.arc = function(e, t, i, n, r, o) {
  52658. var a = this.actions[this.actions.length - 1].args
  52659. , s = a[a.length - 2]
  52660. , l = a[a.length - 1];
  52661. this.absarc(e + s, t + l, i, n, r, o)
  52662. }
  52663. ,
  52664. Ci.Path.prototype.absarc = function(e, t, i, n, r, o) {
  52665. this.absellipse(e, t, i, i, n, r, o)
  52666. }
  52667. ,
  52668. Ci.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  52669. var l = this.actions[this.actions.length - 1].args
  52670. , c = l[l.length - 2]
  52671. , h = l[l.length - 1];
  52672. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  52673. }
  52674. ,
  52675. Ci.Path.prototype.absellipse = function(e, t, i, n, r, o, a, s) {
  52676. var l = [e, t, i, n, r, o, a, s || 0]
  52677. , c = new Ci.EllipseCurve(e,t,i,n,r,o,a,s);
  52678. this.curves.push(c);
  52679. var h = c.getPoint(1);
  52680. l.push(h.x),
  52681. l.push(h.y),
  52682. this.actions.push({
  52683. action: "ellipse",
  52684. args: l
  52685. })
  52686. }
  52687. ,
  52688. Ci.Path.prototype.getSpacedPoints = function(e) {
  52689. e = e || 40;
  52690. for (var t = [], i = 0; i < e; i++)
  52691. t.push(this.getPoint(i / e));
  52692. return this.autoClose && t.push(t[0]),
  52693. t
  52694. }
  52695. ,
  52696. Ci.Path.prototype.getPoints = function(e) {
  52697. e = e || 12;
  52698. for (var t, i, n, r, o, a, s, l, c, h, u, d = Ci.ShapeUtils.b2, p = Ci.ShapeUtils.b3, f = [], g = 0, m = this.actions.length; g < m; g++) {
  52699. var v = this.actions[g]
  52700. , y = v.action
  52701. , A = v.args;
  52702. switch (y) {
  52703. case "moveTo":
  52704. case "lineTo":
  52705. f.push(new Ci.Vector2(A[0],A[1]));
  52706. break;
  52707. case "quadraticCurveTo":
  52708. t = A[2],
  52709. i = A[3],
  52710. o = A[0],
  52711. a = A[1],
  52712. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52713. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52714. c[c.length - 1]);
  52715. for (var C = 1; C <= e; C++) {
  52716. h = d(O = C / e, s, o, t),
  52717. u = d(O, l, a, i),
  52718. f.push(new Ci.Vector2(h,u))
  52719. }
  52720. break;
  52721. case "bezierCurveTo":
  52722. t = A[4],
  52723. i = A[5],
  52724. o = A[0],
  52725. a = A[1],
  52726. n = A[2],
  52727. r = A[3],
  52728. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52729. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52730. c[c.length - 1]);
  52731. for (C = 1; C <= e; C++) {
  52732. h = p(O = C / e, s, o, n, t),
  52733. u = p(O, l, a, r, i),
  52734. f.push(new Ci.Vector2(h,u))
  52735. }
  52736. break;
  52737. case "splineThru":
  52738. c = this.actions[g - 1].args;
  52739. var I = [new Ci.Vector2(c[c.length - 2],c[c.length - 1])]
  52740. , E = e * A[0].length;
  52741. I = I.concat(A[0]);
  52742. var _ = new Ci.SplineCurve(I);
  52743. for (C = 1; C <= E; C++)
  52744. f.push(_.getPointAt(C / E));
  52745. break;
  52746. case "arc":
  52747. var b = A[0]
  52748. , w = A[1]
  52749. , T = A[2]
  52750. , x = A[3]
  52751. , S = A[4]
  52752. , M = !!A[5]
  52753. , R = S - x
  52754. , P = 2 * e;
  52755. for (C = 1; C <= P; C++) {
  52756. var O = C / P;
  52757. M || (O = 1 - O),
  52758. L = x + O * R,
  52759. h = b + T * Math.cos(L),
  52760. u = w + T * Math.sin(L),
  52761. f.push(new Ci.Vector2(h,u))
  52762. }
  52763. break;
  52764. case "ellipse":
  52765. b = A[0],
  52766. w = A[1];
  52767. var L, D, N, F = A[2], B = A[3], V = (x = A[4],
  52768. S = A[5],
  52769. M = !!A[6],
  52770. A[7]);
  52771. R = S - x,
  52772. P = 2 * e;
  52773. 0 !== V && (D = Math.cos(V),
  52774. N = Math.sin(V));
  52775. for (C = 1; C <= P; C++) {
  52776. O = C / P;
  52777. if (M || (O = 1 - O),
  52778. L = x + O * R,
  52779. h = b + F * Math.cos(L),
  52780. u = w + B * Math.sin(L),
  52781. 0 !== V) {
  52782. var k = h;
  52783. h = (k - b) * D - (u - w) * N + b,
  52784. u = (k - b) * N + (u - w) * D + w
  52785. }
  52786. f.push(new Ci.Vector2(h,u))
  52787. }
  52788. }
  52789. }
  52790. var U = f[f.length - 1];
  52791. return Math.abs(U.x - f[0].x) < Number.EPSILON && Math.abs(U.y - f[0].y) < Number.EPSILON && f.splice(f.length - 1, 1),
  52792. this.autoClose && f.push(f[0]),
  52793. f
  52794. }
  52795. ,
  52796. Ci.Path.prototype.toShapes = function(e, t) {
  52797. function i(e) {
  52798. for (var t = [], i = 0, n = e.length; i < n; i++) {
  52799. var r = e[i]
  52800. , o = new Ci.Shape;
  52801. o.actions = r.actions,
  52802. o.curves = r.curves,
  52803. t.push(o)
  52804. }
  52805. return t
  52806. }
  52807. function n(e, t) {
  52808. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  52809. var a = t[r]
  52810. , s = t[o]
  52811. , l = s.x - a.x
  52812. , c = s.y - a.y;
  52813. if (Math.abs(c) > Number.EPSILON) {
  52814. if (c < 0 && (a = t[o],
  52815. l = -l,
  52816. s = t[r],
  52817. c = -c),
  52818. e.y < a.y || e.y > s.y)
  52819. continue;
  52820. if (e.y === a.y) {
  52821. if (e.x === a.x)
  52822. return !0
  52823. } else {
  52824. var h = c * (e.x - a.x) - l * (e.y - a.y);
  52825. if (0 == h)
  52826. return !0;
  52827. if (h < 0)
  52828. continue;
  52829. n = !n
  52830. }
  52831. } else {
  52832. if (e.y !== a.y)
  52833. continue;
  52834. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  52835. return !0
  52836. }
  52837. }
  52838. return n
  52839. }
  52840. var r = Ci.ShapeUtils.isClockWise
  52841. , o = function(e) {
  52842. for (var t = [], i = new Ci.Path, n = 0, r = e.length; n < r; n++) {
  52843. var o = e[n]
  52844. , a = o.args
  52845. , s = o.action;
  52846. "moveTo" === s && 0 !== i.actions.length && (t.push(i),
  52847. i = new Ci.Path),
  52848. i[s].apply(i, a)
  52849. }
  52850. return 0 !== i.actions.length && t.push(i),
  52851. t
  52852. }(this.actions);
  52853. if (0 === o.length)
  52854. return [];
  52855. if (!0 === t)
  52856. return i(o);
  52857. var a, s, l, c = [];
  52858. if (1 === o.length)
  52859. return s = o[0],
  52860. (l = new Ci.Shape).actions = s.actions,
  52861. l.curves = s.curves,
  52862. c.push(l),
  52863. c;
  52864. var h = !r(o[0].getPoints());
  52865. h = e ? !h : h;
  52866. var u, d = [], p = [], f = [], g = 0;
  52867. p[g] = void 0,
  52868. f[g] = [];
  52869. for (var m = 0, v = o.length; m < v; m++)
  52870. a = r(u = (s = o[m]).getPoints()),
  52871. (a = e ? !a : a) ? (!h && p[g] && g++,
  52872. p[g] = {
  52873. s: new Ci.Shape,
  52874. p: u
  52875. },
  52876. p[g].s.actions = s.actions,
  52877. p[g].s.curves = s.curves,
  52878. h && g++,
  52879. f[g] = []) : f[g].push({
  52880. h: s,
  52881. p: u[0]
  52882. });
  52883. if (!p[0])
  52884. return i(o);
  52885. if (1 < p.length) {
  52886. for (var y = !1, A = [], C = 0, I = p.length; C < I; C++)
  52887. d[C] = [];
  52888. for (C = 0,
  52889. I = p.length; C < I; C++)
  52890. for (var E = f[C], _ = 0; _ < E.length; _++) {
  52891. for (var b = E[_], w = !0, T = 0; T < p.length; T++)
  52892. n(b.p, p[T].p) && (C !== T && A.push({
  52893. froms: C,
  52894. tos: T,
  52895. hole: _
  52896. }),
  52897. w ? (w = !1,
  52898. d[T].push(b)) : y = !0);
  52899. w && d[C].push(b)
  52900. }
  52901. 0 < A.length && (y || (f = d))
  52902. }
  52903. m = 0;
  52904. for (var x, S = p.length; m < S; m++) {
  52905. l = p[m].s,
  52906. c.push(l);
  52907. for (var M = 0, R = (x = f[m]).length; M < R; M++)
  52908. l.holes.push(x[M].h)
  52909. }
  52910. return c
  52911. }
  52912. ,
  52913. Ci.Shape = function() {
  52914. Ci.Path.apply(this, arguments),
  52915. this.holes = []
  52916. }
  52917. ,
  52918. Ci.Shape.prototype = Object.create(Ci.Path.prototype),
  52919. Ci.Shape.prototype.constructor = Ci.Shape,
  52920. Ci.Shape.prototype.extrude = function(e) {
  52921. return new Ci.ExtrudeGeometry(this,e)
  52922. }
  52923. ,
  52924. Ci.Shape.prototype.makeGeometry = function(e) {
  52925. return new Ci.ShapeGeometry(this,e)
  52926. }
  52927. ,
  52928. Ci.Shape.prototype.getPointsHoles = function(e) {
  52929. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  52930. t[i] = this.holes[i].getPoints(e);
  52931. return t
  52932. }
  52933. ,
  52934. Ci.Shape.prototype.extractAllPoints = function(e) {
  52935. return {
  52936. shape: this.getPoints(e),
  52937. holes: this.getPointsHoles(e)
  52938. }
  52939. }
  52940. ,
  52941. Ci.Shape.prototype.extractPoints = function(e) {
  52942. return this.extractAllPoints(e)
  52943. }
  52944. ,
  52945. Ci.LineCurve = function(e, t) {
  52946. this.v1 = e,
  52947. this.v2 = t
  52948. }
  52949. ,
  52950. Ci.LineCurve.prototype = Object.create(Ci.Curve.prototype),
  52951. Ci.LineCurve.prototype.constructor = Ci.LineCurve,
  52952. Ci.LineCurve.prototype.getPoint = function(e) {
  52953. var t = this.v2.clone().sub(this.v1);
  52954. return t.multiplyScalar(e).add(this.v1),
  52955. t
  52956. }
  52957. ,
  52958. Ci.LineCurve.prototype.getPointAt = function(e) {
  52959. return this.getPoint(e)
  52960. }
  52961. ,
  52962. Ci.LineCurve.prototype.getTangent = function(e) {
  52963. return this.v2.clone().sub(this.v1).normalize()
  52964. }
  52965. ,
  52966. Ci.QuadraticBezierCurve = function(e, t, i) {
  52967. this.v0 = e,
  52968. this.v1 = t,
  52969. this.v2 = i
  52970. }
  52971. ,
  52972. Ci.QuadraticBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52973. Ci.QuadraticBezierCurve.prototype.constructor = Ci.QuadraticBezierCurve,
  52974. Ci.QuadraticBezierCurve.prototype.getPoint = function(e) {
  52975. var t = Ci.ShapeUtils.b2;
  52976. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y))
  52977. }
  52978. ,
  52979. Ci.QuadraticBezierCurve.prototype.getTangent = function(e) {
  52980. var t = Ci.CurveUtils.tangentQuadraticBezier;
  52981. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y)).normalize()
  52982. }
  52983. ,
  52984. Ci.CubicBezierCurve = function(e, t, i, n) {
  52985. this.v0 = e,
  52986. this.v1 = t,
  52987. this.v2 = i,
  52988. this.v3 = n
  52989. }
  52990. ,
  52991. Ci.CubicBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52992. Ci.CubicBezierCurve.prototype.constructor = Ci.CubicBezierCurve,
  52993. Ci.CubicBezierCurve.prototype.getPoint = function(e) {
  52994. var t = Ci.ShapeUtils.b3;
  52995. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y))
  52996. }
  52997. ,
  52998. Ci.CubicBezierCurve.prototype.getTangent = function(e) {
  52999. var t = Ci.CurveUtils.tangentCubicBezier;
  53000. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y)).normalize()
  53001. }
  53002. ,
  53003. Ci.SplineCurve = function(e) {
  53004. this.points = null == e ? [] : e
  53005. }
  53006. ,
  53007. Ci.SplineCurve.prototype = Object.create(Ci.Curve.prototype),
  53008. Ci.SplineCurve.prototype.constructor = Ci.SplineCurve,
  53009. Ci.SplineCurve.prototype.getPoint = function(e) {
  53010. var t = this.points
  53011. , i = (t.length - 1) * e
  53012. , n = Math.floor(i)
  53013. , r = i - n
  53014. , o = t[0 === n ? n : n - 1]
  53015. , a = t[n]
  53016. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  53017. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  53018. , c = Ci.CurveUtils.interpolate;
  53019. return new Ci.Vector2(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r))
  53020. }
  53021. ,
  53022. Ci.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  53023. this.aX = e,
  53024. this.aY = t,
  53025. this.xRadius = i,
  53026. this.yRadius = n,
  53027. this.aStartAngle = r,
  53028. this.aEndAngle = o,
  53029. this.aClockwise = a,
  53030. this.aRotation = s || 0
  53031. }
  53032. ,
  53033. Ci.EllipseCurve.prototype = Object.create(Ci.Curve.prototype),
  53034. Ci.EllipseCurve.prototype.constructor = Ci.EllipseCurve,
  53035. Ci.EllipseCurve.prototype.getPoint = function(e) {
  53036. var t, i = this.aEndAngle - this.aStartAngle;
  53037. i < 0 && (i += 2 * Math.PI),
  53038. i > 2 * Math.PI && (i -= 2 * Math.PI),
  53039. t = !0 === this.aClockwise ? this.aEndAngle + (1 - e) * (2 * Math.PI - i) : this.aStartAngle + e * i;
  53040. var n = this.aX + this.xRadius * Math.cos(t)
  53041. , r = this.aY + this.yRadius * Math.sin(t);
  53042. if (0 !== this.aRotation) {
  53043. var o = Math.cos(this.aRotation)
  53044. , a = Math.sin(this.aRotation)
  53045. , s = n
  53046. , l = r;
  53047. n = (s - this.aX) * o - (l - this.aY) * a + this.aX,
  53048. r = (s - this.aX) * a + (l - this.aY) * o + this.aY
  53049. }
  53050. return new Ci.Vector2(n,r)
  53051. }
  53052. ,
  53053. Ci.ArcCurve = function(e, t, i, n, r, o) {
  53054. Ci.EllipseCurve.call(this, e, t, i, i, n, r, o)
  53055. }
  53056. ,
  53057. Ci.ArcCurve.prototype = Object.create(Ci.EllipseCurve.prototype),
  53058. Ci.ArcCurve.prototype.constructor = Ci.ArcCurve,
  53059. Ci.LineCurve3 = Ci.Curve.create(function(e, t) {
  53060. this.v1 = e,
  53061. this.v2 = t
  53062. }, function(e) {
  53063. var t = new Ci.Vector3;
  53064. return t.subVectors(this.v2, this.v1),
  53065. t.multiplyScalar(e),
  53066. t.add(this.v1),
  53067. t
  53068. }),
  53069. Ci.QuadraticBezierCurve3 = Ci.Curve.create(function(e, t, i) {
  53070. this.v0 = e,
  53071. this.v1 = t,
  53072. this.v2 = i
  53073. }, function(e) {
  53074. var t = Ci.ShapeUtils.b2;
  53075. return new Ci.Vector3(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y),t(e, this.v0.z, this.v1.z, this.v2.z))
  53076. }),
  53077. Ci.CubicBezierCurve3 = Ci.Curve.create(function(e, t, i, n) {
  53078. this.v0 = e,
  53079. this.v1 = t,
  53080. this.v2 = i,
  53081. this.v3 = n
  53082. }, function(e) {
  53083. var t = Ci.ShapeUtils.b3;
  53084. return new Ci.Vector3(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y),t(e, this.v0.z, this.v1.z, this.v2.z, this.v3.z))
  53085. }),
  53086. Ci.SplineCurve3 = Ci.Curve.create(function(e) {
  53087. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  53088. this.points = null == e ? [] : e
  53089. }, function(e) {
  53090. var t = this.points
  53091. , i = (t.length - 1) * e
  53092. , n = Math.floor(i)
  53093. , r = i - n
  53094. , o = t[0 == n ? n : n - 1]
  53095. , a = t[n]
  53096. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  53097. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  53098. , c = Ci.CurveUtils.interpolate;
  53099. return new Ci.Vector3(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r),c(o.z, a.z, s.z, l.z, r))
  53100. }),
  53101. Ci.CatmullRomCurve3 = (qt = new Ci.Vector3,
  53102. Xt = new xi,
  53103. Zt = new xi,
  53104. Kt = new xi,
  53105. xi.prototype.init = function(e, t, i, n) {
  53106. this.c0 = e,
  53107. this.c1 = i,
  53108. this.c2 = -3 * e + 3 * t - 2 * i - n,
  53109. this.c3 = 2 * e - 2 * t + i + n
  53110. }
  53111. ,
  53112. xi.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  53113. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  53114. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  53115. s *= o,
  53116. l *= o,
  53117. this.init(t, i, s, l)
  53118. }
  53119. ,
  53120. xi.prototype.initCatmullRom = function(e, t, i, n, r) {
  53121. this.init(t, i, r * (i - e), r * (n - t))
  53122. }
  53123. ,
  53124. xi.prototype.calc = function(e) {
  53125. var t = e * e
  53126. , i = t * e;
  53127. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  53128. }
  53129. ,
  53130. Ci.Curve.create(function(e) {
  53131. this.points = e || [],
  53132. this.closed = !1
  53133. }, function(e) {
  53134. var t, i, n, r, o, a, s, l, c = this.points;
  53135. if ((r = c.length) < 2 && console.log("duh, you need at least 2 points"),
  53136. n = (t = (r - (this.closed ? 0 : 1)) * e) - (i = Math.floor(t)),
  53137. this.closed ? i += 0 < i ? 0 : (Math.floor(Math.abs(i) / c.length) + 1) * c.length : 0 === n && i === r - 1 && (i = r - 2,
  53138. n = 1),
  53139. o = this.closed || 0 < i ? c[(i - 1) % r] : (qt.subVectors(c[0], c[1]).add(c[0]),
  53140. qt),
  53141. a = c[i % r],
  53142. s = c[(i + 1) % r],
  53143. l = this.closed || i + 2 < r ? c[(i + 2) % r] : (qt.subVectors(c[r - 1], c[r - 2]).add(c[r - 1]),
  53144. qt),
  53145. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  53146. var h = "chordal" === this.type ? .5 : .25
  53147. , u = Math.pow(o.distanceToSquared(a), h)
  53148. , d = Math.pow(a.distanceToSquared(s), h)
  53149. , p = Math.pow(s.distanceToSquared(l), h);
  53150. d < 1e-4 && (d = 1),
  53151. u < 1e-4 && (u = d),
  53152. p < 1e-4 && (p = d),
  53153. Xt.initNonuniformCatmullRom(o.x, a.x, s.x, l.x, u, d, p),
  53154. Zt.initNonuniformCatmullRom(o.y, a.y, s.y, l.y, u, d, p),
  53155. Kt.initNonuniformCatmullRom(o.z, a.z, s.z, l.z, u, d, p)
  53156. } else if ("catmullrom" === this.type) {
  53157. var f = void 0 !== this.tension ? this.tension : .5;
  53158. Xt.initCatmullRom(o.x, a.x, s.x, l.x, f),
  53159. Zt.initCatmullRom(o.y, a.y, s.y, l.y, f),
  53160. Kt.initCatmullRom(o.z, a.z, s.z, l.z, f)
  53161. }
  53162. return new Ci.Vector3(Xt.calc(n),Zt.calc(n),Kt.calc(n))
  53163. })),
  53164. Ci.ClosedSplineCurve3 = function(e) {
  53165. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  53166. Ci.CatmullRomCurve3.call(this, e),
  53167. this.type = "catmullrom",
  53168. this.closed = !0
  53169. }
  53170. ,
  53171. Ci.ClosedSplineCurve3.prototype = Object.create(Ci.CatmullRomCurve3.prototype),
  53172. Ci.BoxGeometry = function(e, t, i, n, r, o) {
  53173. Ci.Geometry.call(this),
  53174. this.type = "BoxGeometry",
  53175. this.parameters = {
  53176. width: e,
  53177. height: t,
  53178. depth: i,
  53179. widthSegments: n,
  53180. heightSegments: r,
  53181. depthSegments: o
  53182. },
  53183. this.fromBufferGeometry(new Ci.BoxBufferGeometry(e,t,i,n,r,o)),
  53184. this.mergeVertices()
  53185. }
  53186. ,
  53187. Ci.BoxGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53188. Ci.BoxGeometry.prototype.constructor = Ci.BoxGeometry,
  53189. Ci.CubeGeometry = Ci.BoxGeometry,
  53190. Ci.BoxBufferGeometry = function(e, t, i, n, r, o) {
  53191. function a(e, t, i, n, r, o, a, s, l, c, h) {
  53192. for (var u = o / l, d = a / c, p = o / 2, f = a / 2, g = s / 2, m = l + 1, v = c + 1, y = 0, A = 0, C = new Ci.Vector3, I = 0; I < v; I++)
  53193. for (var E = I * d - f, _ = 0; _ < m; _++) {
  53194. var b = _ * u - p;
  53195. C[e] = b * n,
  53196. C[t] = E * r,
  53197. C[i] = g,
  53198. P[D] = C.x,
  53199. P[D + 1] = C.y,
  53200. P[D + 2] = C.z,
  53201. C[e] = 0,
  53202. C[t] = 0,
  53203. C[i] = 0 < s ? 1 : -1,
  53204. O[D] = C.x,
  53205. O[D + 1] = C.y,
  53206. O[D + 2] = C.z,
  53207. L[N] = _ / l,
  53208. L[N + 1] = 1 - I / c,
  53209. D += 3,
  53210. N += 2,
  53211. y += 1
  53212. }
  53213. for (I = 0; I < c; I++)
  53214. for (_ = 0; _ < l; _++) {
  53215. var w = B + _ + m * I
  53216. , T = B + _ + m * (I + 1)
  53217. , x = B + (_ + 1) + m * (I + 1)
  53218. , S = B + (_ + 1) + m * I;
  53219. R[F] = w,
  53220. R[F + 1] = T,
  53221. R[F + 2] = S,
  53222. R[F + 3] = T,
  53223. R[F + 4] = x,
  53224. R[F + 5] = S,
  53225. F += 6,
  53226. A += 6
  53227. }
  53228. M.addGroup(V, A, h),
  53229. V += A,
  53230. B += y
  53231. }
  53232. Ci.BufferGeometry.call(this),
  53233. this.type = "BoxBufferGeometry",
  53234. this.parameters = {
  53235. width: e,
  53236. height: t,
  53237. depth: i,
  53238. widthSegments: n,
  53239. heightSegments: r,
  53240. depthSegments: o
  53241. };
  53242. var M = this;
  53243. n = Math.floor(n) || 1,
  53244. r = Math.floor(r) || 1,
  53245. o = Math.floor(o) || 1;
  53246. var s, l, c, h, u = (h = 0,
  53247. h += (s = n) * (l = r) * 2,
  53248. h += s * (c = o) * 2,
  53249. 4 * (h += c * l * 2)), d = u / 4 * 6, R = new (65535 < d ? Uint32Array : Uint16Array)(d), P = new Float32Array(3 * u), O = new Float32Array(3 * u), L = new Float32Array(2 * u), D = 0, N = 0, F = 0, B = 0, V = 0;
  53250. a("z", "y", "x", -1, -1, i, t, e, o, r, 0),
  53251. a("z", "y", "x", 1, -1, i, t, -e, o, r, 1),
  53252. a("x", "z", "y", 1, 1, e, i, t, n, o, 2),
  53253. a("x", "z", "y", 1, -1, e, i, -t, n, o, 3),
  53254. a("x", "y", "z", 1, -1, e, t, i, n, r, 4),
  53255. a("x", "y", "z", -1, -1, e, t, -i, n, r, 5),
  53256. this.setIndex(new Ci.BufferAttribute(R,1)),
  53257. this.addAttribute("position", new Ci.BufferAttribute(P,3)),
  53258. this.addAttribute("normal", new Ci.BufferAttribute(O,3)),
  53259. this.addAttribute("uv", new Ci.BufferAttribute(L,2))
  53260. }
  53261. ,
  53262. Ci.BoxBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53263. Ci.BoxBufferGeometry.prototype.constructor = Ci.BoxBufferGeometry,
  53264. Ci.CircleGeometry = function(e, t, i, n) {
  53265. Ci.Geometry.call(this),
  53266. this.type = "CircleGeometry",
  53267. this.parameters = {
  53268. radius: e,
  53269. segments: t,
  53270. thetaStart: i,
  53271. thetaLength: n
  53272. },
  53273. this.fromBufferGeometry(new Ci.CircleBufferGeometry(e,t,i,n))
  53274. }
  53275. ,
  53276. Ci.CircleGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53277. Ci.CircleGeometry.prototype.constructor = Ci.CircleGeometry,
  53278. Ci.CircleBufferGeometry = function(e, t, i, n) {
  53279. Ci.BufferGeometry.call(this),
  53280. this.type = "CircleBufferGeometry",
  53281. this.parameters = {
  53282. radius: e,
  53283. segments: t,
  53284. thetaStart: i,
  53285. thetaLength: n
  53286. },
  53287. e = e || 50,
  53288. t = void 0 !== t ? Math.max(3, t) : 8,
  53289. i = void 0 !== i ? i : 0,
  53290. n = void 0 !== n ? n : 2 * Math.PI;
  53291. var r = t + 2
  53292. , o = new Float32Array(3 * r)
  53293. , a = new Float32Array(3 * r)
  53294. , s = new Float32Array(2 * r);
  53295. a[2] = 1,
  53296. s[0] = .5,
  53297. s[1] = .5;
  53298. for (var l = 0, c = 3, h = 2; l <= t; l++,
  53299. c += 3,
  53300. h += 2) {
  53301. var u = i + l / t * n;
  53302. o[c] = e * Math.cos(u),
  53303. o[c + 1] = e * Math.sin(u),
  53304. a[c + 2] = 1,
  53305. s[h] = (o[c] / e + 1) / 2,
  53306. s[h + 1] = (o[c + 1] / e + 1) / 2
  53307. }
  53308. var d = [];
  53309. for (c = 1; c <= t; c++)
  53310. d.push(c, c + 1, 0);
  53311. this.setIndex(new Ci.BufferAttribute(new Uint16Array(d),1)),
  53312. this.addAttribute("position", new Ci.BufferAttribute(o,3)),
  53313. this.addAttribute("normal", new Ci.BufferAttribute(a,3)),
  53314. this.addAttribute("uv", new Ci.BufferAttribute(s,2)),
  53315. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53316. }
  53317. ,
  53318. Ci.CircleBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53319. Ci.CircleBufferGeometry.prototype.constructor = Ci.CircleBufferGeometry,
  53320. Ci.CylinderBufferGeometry = function(p, f, g, m, v, e, y, A) {
  53321. function t(e) {
  53322. var t, i, n, r = new Ci.Vector2, o = new Ci.Vector3, a = !0 === e ? p : f, s = !0 === e ? 1 : -1;
  53323. for (i = b,
  53324. t = 1; t <= m; t++)
  53325. I.setXYZ(b, 0, x * s, 0),
  53326. E.setXYZ(b, 0, s, 0),
  53327. !0 === e ? (r.x = t / m,
  53328. r.y = 0) : (r.x = (t - 1) / m,
  53329. r.y = 1),
  53330. _.setXY(b, r.x, r.y),
  53331. b++;
  53332. for (n = b,
  53333. t = 0; t <= m; t++) {
  53334. var l = t / m;
  53335. o.x = a * Math.sin(l * A + y),
  53336. o.y = x * s,
  53337. o.z = a * Math.cos(l * A + y),
  53338. I.setXYZ(b, o.x, o.y, o.z),
  53339. E.setXYZ(b, 0, s, 0),
  53340. _.setXY(b, l, !0 === e ? 1 : 0),
  53341. b++
  53342. }
  53343. for (t = 0; t < m; t++) {
  53344. var c = i + t
  53345. , h = n + t;
  53346. !0 === e ? (C.setX(w, h),
  53347. w++,
  53348. C.setX(w, h + 1)) : (C.setX(w, h + 1),
  53349. w++,
  53350. C.setX(w, h)),
  53351. w++,
  53352. C.setX(w, c),
  53353. w++
  53354. }
  53355. }
  53356. Ci.BufferGeometry.call(this),
  53357. this.type = "CylinderBufferGeometry",
  53358. this.parameters = {
  53359. radiusTop: p,
  53360. radiusBottom: f,
  53361. height: g,
  53362. radialSegments: m,
  53363. heightSegments: v,
  53364. openEnded: e,
  53365. thetaStart: y,
  53366. thetaLength: A
  53367. },
  53368. p = void 0 !== p ? p : 20,
  53369. f = void 0 !== f ? f : 20,
  53370. g = void 0 !== g ? g : 100,
  53371. m = Math.floor(m) || 8,
  53372. v = Math.floor(v) || 1,
  53373. e = void 0 !== e && e,
  53374. y = void 0 !== y ? y : 0,
  53375. A = void 0 !== A ? A : 2 * Math.PI;
  53376. var i, n, r = (n = (m + 1) * (v + 1),
  53377. !1 === e && (n += 2 * (m + 1) + 2 * m),
  53378. n), o = (i = m * v * 2 * 3,
  53379. !1 === e && (i += 2 * m * 3),
  53380. i), C = new Ci.BufferAttribute(new (65535 < o ? Uint32Array : Uint16Array)(o),1), I = new Ci.BufferAttribute(new Float32Array(3 * r),3), E = new Ci.BufferAttribute(new Float32Array(3 * r),3), _ = new Ci.BufferAttribute(new Float32Array(2 * r),2), b = 0, w = 0, T = [], x = g / 2;
  53381. (function() {
  53382. var e, t, i = new Ci.Vector3, n = new Ci.Vector3, r = (f - p) / g;
  53383. for (t = 0; t <= v; t++) {
  53384. var o = []
  53385. , a = t / v
  53386. , s = a * (f - p) + p;
  53387. for (e = 0; e <= m; e++) {
  53388. var l = e / m;
  53389. n.x = s * Math.sin(l * A + y),
  53390. n.y = -a * g + x,
  53391. n.z = s * Math.cos(l * A + y),
  53392. I.setXYZ(b, n.x, n.y, n.z),
  53393. i.copy(n),
  53394. (0 === p && 0 === t || 0 === f && t === v) && (i.x = Math.sin(l * A + y),
  53395. i.z = Math.cos(l * A + y)),
  53396. i.setY(Math.sqrt(i.x * i.x + i.z * i.z) * r).normalize(),
  53397. E.setXYZ(b, i.x, i.y, i.z),
  53398. _.setXY(b, l, 1 - a),
  53399. o.push(b),
  53400. b++
  53401. }
  53402. T.push(o)
  53403. }
  53404. for (e = 0; e < m; e++)
  53405. for (t = 0; t < v; t++) {
  53406. var c = T[t][e]
  53407. , h = T[t + 1][e]
  53408. , u = T[t + 1][e + 1]
  53409. , d = T[t][e + 1];
  53410. C.setX(w, c),
  53411. w++,
  53412. C.setX(w, h),
  53413. w++,
  53414. C.setX(w, d),
  53415. w++,
  53416. C.setX(w, h),
  53417. w++,
  53418. C.setX(w, u),
  53419. w++,
  53420. C.setX(w, d),
  53421. w++
  53422. }
  53423. }
  53424. )(),
  53425. !1 === e && (0 < p && t(!0),
  53426. 0 < f && t(!1)),
  53427. this.setIndex(C),
  53428. this.addAttribute("position", I),
  53429. this.addAttribute("normal", E),
  53430. this.addAttribute("uv", _)
  53431. }
  53432. ,
  53433. Ci.CylinderBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53434. Ci.CylinderBufferGeometry.prototype.constructor = Ci.CylinderBufferGeometry,
  53435. Ci.CylinderGeometry = function(e, t, i, n, r, o, a, s) {
  53436. Ci.Geometry.call(this),
  53437. this.type = "CylinderGeometry",
  53438. this.parameters = {
  53439. radiusTop: e,
  53440. radiusBottom: t,
  53441. height: i,
  53442. radialSegments: n,
  53443. heightSegments: r,
  53444. openEnded: o,
  53445. thetaStart: a,
  53446. thetaLength: s
  53447. },
  53448. this.fromBufferGeometry(new Ci.CylinderBufferGeometry(e,t,i,n,r,o,a,s)),
  53449. this.mergeVertices()
  53450. }
  53451. ,
  53452. Ci.CylinderGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53453. Ci.CylinderGeometry.prototype.constructor = Ci.CylinderGeometry,
  53454. Ci.EdgesGeometry = function(e, t) {
  53455. function i(e, t) {
  53456. return e - t
  53457. }
  53458. Ci.BufferGeometry.call(this),
  53459. t = void 0 !== t ? t : 1;
  53460. var n, r = Math.cos(Ci.Math.degToRad(t)), o = [0, 0], a = {}, s = ["a", "b", "c"];
  53461. e instanceof Ci.BufferGeometry ? (n = new Ci.Geometry).fromBufferGeometry(e) : n = e.clone(),
  53462. n.mergeVertices(),
  53463. n.computeFaceNormals();
  53464. for (var l = n.vertices, c = n.faces, h = 0, u = c.length; h < u; h++)
  53465. for (var d = c[h], p = 0; p < 3; p++) {
  53466. o[0] = d[s[p]],
  53467. o[1] = d[s[(p + 1) % 3]],
  53468. o.sort(i),
  53469. void 0 === a[g = o.toString()] ? a[g] = {
  53470. vert1: o[0],
  53471. vert2: o[1],
  53472. face1: h,
  53473. face2: void 0
  53474. } : a[g].face2 = h
  53475. }
  53476. var f = [];
  53477. for (var g in a) {
  53478. var m = a[g];
  53479. if (void 0 === m.face2 || c[m.face1].normal.dot(c[m.face2].normal) <= r) {
  53480. var v = l[m.vert1];
  53481. f.push(v.x),
  53482. f.push(v.y),
  53483. f.push(v.z),
  53484. v = l[m.vert2],
  53485. f.push(v.x),
  53486. f.push(v.y),
  53487. f.push(v.z)
  53488. }
  53489. }
  53490. this.addAttribute("position", new Ci.BufferAttribute(new Float32Array(f),3))
  53491. }
  53492. ,
  53493. Ci.EdgesGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53494. Ci.EdgesGeometry.prototype.constructor = Ci.EdgesGeometry,
  53495. Ci.ExtrudeGeometry = function(e, t) {
  53496. return void 0 === e ? void (e = []) : (Ci.Geometry.call(this),
  53497. this.type = "ExtrudeGeometry",
  53498. e = Array.isArray(e) ? e : [e],
  53499. this.addShapeList(e, t),
  53500. void this.computeFaceNormals())
  53501. }
  53502. ;
  53503. Ci.ExtrudeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53504. Ci.ExtrudeGeometry.prototype.constructor = Ci.ExtrudeGeometry,
  53505. Ci.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  53506. for (var i = e.length, n = 0; n < i; n++) {
  53507. var r = e[n];
  53508. this.addShape(r, t)
  53509. }
  53510. }
  53511. ,
  53512. Ci.ExtrudeGeometry.prototype.addShape = function(e, t) {
  53513. function i(e, t, i) {
  53514. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  53515. t.clone().multiplyScalar(i).add(e)
  53516. }
  53517. function n(e, t, i) {
  53518. var n, r, o = 1, a = e.x - t.x, s = e.y - t.y, l = i.x - e.x, c = i.y - e.y, h = a * a + s * s, u = a * c - s * l;
  53519. if (Math.abs(u) > Number.EPSILON) {
  53520. var d = Math.sqrt(h)
  53521. , p = Math.sqrt(l * l + c * c)
  53522. , f = t.x - s / d
  53523. , g = t.y + a / d
  53524. , m = ((i.x - c / p - f) * c - (i.y + l / p - g) * l) / (a * c - s * l)
  53525. , v = (n = f + a * m - e.x) * n + (r = g + s * m - e.y) * r;
  53526. if (v <= 2)
  53527. return new Ci.Vector2(n,r);
  53528. o = Math.sqrt(v / 2)
  53529. } else {
  53530. var y = !1;
  53531. a > Number.EPSILON ? l > Number.EPSILON && (y = !0) : a < -Number.EPSILON ? l < -Number.EPSILON && (y = !0) : Math.sign(s) === Math.sign(c) && (y = !0),
  53532. o = y ? (n = -s,
  53533. r = a,
  53534. Math.sqrt(h)) : (n = a,
  53535. r = s,
  53536. Math.sqrt(h / 2))
  53537. }
  53538. return new Ci.Vector2(n / o,r / o)
  53539. }
  53540. function r(e, t) {
  53541. var i, n;
  53542. for (G = e.length; 0 <= --G; ) {
  53543. (n = (i = G) - 1) < 0 && (n = e.length - 1);
  53544. var r = 0
  53545. , o = A + 2 * m;
  53546. for (r = 0; r < o; r++) {
  53547. var a = U * r
  53548. , s = U * (r + 1);
  53549. l(t + i + a, t + n + a, t + n + s, t + i + s, e, r, o, i, n)
  53550. }
  53551. }
  53552. }
  53553. function o(e, t, i) {
  53554. T.vertices.push(new Ci.Vector3(e,t,i))
  53555. }
  53556. function a(e, t, i) {
  53557. e += x,
  53558. t += x,
  53559. i += x,
  53560. T.faces.push(new Ci.Face3(e,t,i,null,null,0));
  53561. var n = E.generateTopUV(T, e, t, i);
  53562. T.faceVertexUvs[0].push(n)
  53563. }
  53564. function l(e, t, i, n) {
  53565. e += x,
  53566. t += x,
  53567. i += x,
  53568. n += x,
  53569. T.faces.push(new Ci.Face3(e,t,n,null,null,1)),
  53570. T.faces.push(new Ci.Face3(t,i,n,null,null,1));
  53571. var r = E.generateSideWallUV(T, e, t, i, n);
  53572. T.faceVertexUvs[0].push([r[0], r[1], r[3]]),
  53573. T.faceVertexUvs[0].push([r[1], r[2], r[3]])
  53574. }
  53575. var s, c, h, u, d, p = void 0 !== t.amount ? t.amount : 100, f = void 0 !== t.bevelThickness ? t.bevelThickness : 6, g = void 0 !== t.bevelSize ? t.bevelSize : f - 2, m = void 0 !== t.bevelSegments ? t.bevelSegments : 3, v = void 0 === t.bevelEnabled || t.bevelEnabled, y = void 0 !== t.curveSegments ? t.curveSegments : 12, A = void 0 !== t.steps ? t.steps : 1, C = t.extrudePath, I = !1, E = void 0 !== t.UVGenerator ? t.UVGenerator : Ci.ExtrudeGeometry.WorldUVGenerator;
  53576. C && (s = C.getSpacedPoints(A),
  53577. v = !(I = !0),
  53578. c = void 0 !== t.frames ? t.frames : new Ci.TubeGeometry.FrenetFrames(C,A,!1),
  53579. h = new Ci.Vector3,
  53580. u = new Ci.Vector3,
  53581. d = new Ci.Vector3),
  53582. v || (g = f = m = 0);
  53583. var _, b, w, T = this, x = this.vertices.length, S = e.extractPoints(y), M = S.shape, R = S.holes, P = !Ci.ShapeUtils.isClockWise(M);
  53584. if (P) {
  53585. for (M = M.reverse(),
  53586. b = 0,
  53587. w = R.length; b < w; b++)
  53588. _ = R[b],
  53589. Ci.ShapeUtils.isClockWise(_) && (R[b] = _.reverse());
  53590. P = !1
  53591. }
  53592. var O = Ci.ShapeUtils.triangulateShape(M, R)
  53593. , L = M;
  53594. for (b = 0,
  53595. w = R.length; b < w; b++)
  53596. _ = R[b],
  53597. M = M.concat(_);
  53598. for (var D, N, F, B, V, k, U = M.length, H = O.length, z = [], G = 0, W = L.length, j = W - 1, Y = G + 1; G < W; G++,
  53599. j++,
  53600. Y++)
  53601. j === W && (j = 0),
  53602. Y === W && (Y = 0),
  53603. z[G] = n(L[G], L[j], L[Y]);
  53604. var q, X, Z = [], K = z.concat();
  53605. for (b = 0,
  53606. w = R.length; b < w; b++) {
  53607. for (_ = R[b],
  53608. q = [],
  53609. G = 0,
  53610. j = (W = _.length) - 1,
  53611. Y = G + 1; G < W; G++,
  53612. j++,
  53613. Y++)
  53614. j === W && (j = 0),
  53615. Y === W && (Y = 0),
  53616. q[G] = n(_[G], _[j], _[Y]);
  53617. Z.push(q),
  53618. K = K.concat(q)
  53619. }
  53620. for (D = 0; D < m; D++) {
  53621. for (B = f * (1 - (F = D / m)),
  53622. N = g * Math.sin(F * Math.PI / 2),
  53623. G = 0,
  53624. W = L.length; G < W; G++)
  53625. o((V = i(L[G], z[G], N)).x, V.y, -B);
  53626. for (b = 0,
  53627. w = R.length; b < w; b++)
  53628. for (_ = R[b],
  53629. q = Z[b],
  53630. G = 0,
  53631. W = _.length; G < W; G++)
  53632. o((V = i(_[G], q[G], N)).x, V.y, -B)
  53633. }
  53634. for (N = g,
  53635. G = 0; G < U; G++)
  53636. V = v ? i(M[G], K[G], N) : M[G],
  53637. I ? (u.copy(c.normals[0]).multiplyScalar(V.x),
  53638. h.copy(c.binormals[0]).multiplyScalar(V.y),
  53639. d.copy(s[0]).add(u).add(h),
  53640. o(d.x, d.y, d.z)) : o(V.x, V.y, 0);
  53641. for (X = 1; X <= A; X++)
  53642. for (G = 0; G < U; G++)
  53643. V = v ? i(M[G], K[G], N) : M[G],
  53644. I ? (u.copy(c.normals[X]).multiplyScalar(V.x),
  53645. h.copy(c.binormals[X]).multiplyScalar(V.y),
  53646. d.copy(s[X]).add(u).add(h),
  53647. o(d.x, d.y, d.z)) : o(V.x, V.y, p / A * X);
  53648. for (D = m - 1; 0 <= D; D--) {
  53649. for (B = f * (1 - (F = D / m)),
  53650. N = g * Math.sin(F * Math.PI / 2),
  53651. G = 0,
  53652. W = L.length; G < W; G++)
  53653. o((V = i(L[G], z[G], N)).x, V.y, p + B);
  53654. for (b = 0,
  53655. w = R.length; b < w; b++)
  53656. for (_ = R[b],
  53657. q = Z[b],
  53658. G = 0,
  53659. W = _.length; G < W; G++)
  53660. V = i(_[G], q[G], N),
  53661. I ? o(V.x, V.y + s[A - 1].y, s[A - 1].x + B) : o(V.x, V.y, p + B)
  53662. }
  53663. (function() {
  53664. if (v) {
  53665. var e = 0
  53666. , t = U * e;
  53667. for (G = 0; G < H; G++)
  53668. a((k = O[G])[2] + t, k[1] + t, k[0] + t);
  53669. for (t = U * (e = A + 2 * m),
  53670. G = 0; G < H; G++)
  53671. a((k = O[G])[0] + t, k[1] + t, k[2] + t)
  53672. } else {
  53673. for (G = 0; G < H; G++)
  53674. a((k = O[G])[2], k[1], k[0]);
  53675. for (G = 0; G < H; G++)
  53676. a((k = O[G])[0] + U * A, k[1] + U * A, k[2] + U * A)
  53677. }
  53678. }
  53679. )(),
  53680. function() {
  53681. var e = 0;
  53682. for (r(L, e),
  53683. e += L.length,
  53684. b = 0,
  53685. w = R.length; b < w; b++)
  53686. r(_ = R[b], e),
  53687. e += _.length
  53688. }()
  53689. }
  53690. ,
  53691. Ci.ExtrudeGeometry.WorldUVGenerator = {
  53692. generateTopUV: function(e, t, i, n) {
  53693. var r = e.vertices
  53694. , o = r[t]
  53695. , a = r[i]
  53696. , s = r[n];
  53697. return [new Ci.Vector2(o.x,o.y), new Ci.Vector2(a.x,a.y), new Ci.Vector2(s.x,s.y)]
  53698. },
  53699. generateSideWallUV: function(e, t, i, n, r) {
  53700. var o = e.vertices
  53701. , a = o[t]
  53702. , s = o[i]
  53703. , l = o[n]
  53704. , c = o[r];
  53705. return Math.abs(a.y - s.y) < .01 ? [new Ci.Vector2(a.x,1 - a.z), new Ci.Vector2(s.x,1 - s.z), new Ci.Vector2(l.x,1 - l.z), new Ci.Vector2(c.x,1 - c.z)] : [new Ci.Vector2(a.y,1 - a.z), new Ci.Vector2(s.y,1 - s.z), new Ci.Vector2(l.y,1 - l.z), new Ci.Vector2(c.y,1 - c.z)]
  53706. }
  53707. },
  53708. Ci.ShapeGeometry = function(e, t) {
  53709. Ci.Geometry.call(this),
  53710. !(this.type = "ShapeGeometry") === Array.isArray(e) && (e = [e]),
  53711. this.addShapeList(e, t),
  53712. this.computeFaceNormals()
  53713. }
  53714. ,
  53715. Ci.ShapeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53716. Ci.ShapeGeometry.prototype.constructor = Ci.ShapeGeometry,
  53717. Ci.ShapeGeometry.prototype.addShapeList = function(e, t) {
  53718. for (var i = 0, n = e.length; i < n; i++)
  53719. this.addShape(e[i], t);
  53720. return this
  53721. }
  53722. ,
  53723. Ci.ShapeGeometry.prototype.addShape = function(e, t) {
  53724. void 0 === t && (t = {});
  53725. var i, n, r, o = void 0 !== t.curveSegments ? t.curveSegments : 12, a = t.material, s = void 0 === t.UVGenerator ? Ci.ExtrudeGeometry.WorldUVGenerator : t.UVGenerator, l = this.vertices.length, c = e.extractPoints(o), h = c.shape, u = c.holes, d = !Ci.ShapeUtils.isClockWise(h);
  53726. if (d) {
  53727. for (h = h.reverse(),
  53728. i = 0,
  53729. n = u.length; i < n; i++)
  53730. r = u[i],
  53731. Ci.ShapeUtils.isClockWise(r) && (u[i] = r.reverse());
  53732. d = !1
  53733. }
  53734. var p = Ci.ShapeUtils.triangulateShape(h, u);
  53735. for (i = 0,
  53736. n = u.length; i < n; i++)
  53737. r = u[i],
  53738. h = h.concat(r);
  53739. var f, g, m = h.length, v = p.length;
  53740. for (i = 0; i < m; i++)
  53741. f = h[i],
  53742. this.vertices.push(new Ci.Vector3(f.x,f.y,0));
  53743. for (i = 0; i < v; i++) {
  53744. var y = (g = p[i])[0] + l
  53745. , A = g[1] + l
  53746. , C = g[2] + l;
  53747. this.faces.push(new Ci.Face3(y,A,C,null,null,a)),
  53748. this.faceVertexUvs[0].push(s.generateTopUV(this, y, A, C))
  53749. }
  53750. }
  53751. ,
  53752. Ci.LatheBufferGeometry = function(e, t, i, n) {
  53753. Ci.BufferGeometry.call(this),
  53754. this.type = "LatheBufferGeometry",
  53755. this.parameters = {
  53756. points: e,
  53757. segments: t,
  53758. phiStart: i,
  53759. phiLength: n
  53760. },
  53761. t = Math.floor(t) || 12,
  53762. i = i || 0,
  53763. n = n || 2 * Math.PI,
  53764. n = Ci.Math.clamp(n, 0, 2 * Math.PI);
  53765. var r, o, a, s = (t + 1) * e.length, l = t * e.length * 2 * 3, c = new Ci.BufferAttribute(new (65535 < l ? Uint32Array : Uint16Array)(l),1), h = new Ci.BufferAttribute(new Float32Array(3 * s),3), u = new Ci.BufferAttribute(new Float32Array(2 * s),2), d = 0, p = 0, f = (e.length,
  53766. 1 / t), g = new Ci.Vector3, m = new Ci.Vector2;
  53767. for (o = 0; o <= t; o++) {
  53768. var v = i + o * f * n
  53769. , y = Math.sin(v)
  53770. , A = Math.cos(v);
  53771. for (a = 0; a <= e.length - 1; a++)
  53772. g.x = e[a].x * y,
  53773. g.y = e[a].y,
  53774. g.z = e[a].x * A,
  53775. h.setXYZ(d, g.x, g.y, g.z),
  53776. m.x = o / t,
  53777. m.y = a / (e.length - 1),
  53778. u.setXY(d, m.x, m.y),
  53779. d++
  53780. }
  53781. for (o = 0; o < t; o++)
  53782. for (a = 0; a < e.length - 1; a++) {
  53783. var C = r = a + o * e.length
  53784. , I = r + e.length
  53785. , E = r + e.length + 1
  53786. , _ = r + 1;
  53787. c.setX(p, C),
  53788. p++,
  53789. c.setX(p, I),
  53790. p++,
  53791. c.setX(p, _),
  53792. p++,
  53793. c.setX(p, I),
  53794. p++,
  53795. c.setX(p, E),
  53796. p++,
  53797. c.setX(p, _),
  53798. p++
  53799. }
  53800. if (this.setIndex(c),
  53801. this.addAttribute("position", h),
  53802. this.addAttribute("uv", u),
  53803. this.computeVertexNormals(),
  53804. n === 2 * Math.PI) {
  53805. var b = this.attributes.normal.array
  53806. , w = new Ci.Vector3
  53807. , T = new Ci.Vector3
  53808. , x = new Ci.Vector3;
  53809. for (r = t * e.length * 3,
  53810. a = o = 0; o < e.length; o++,
  53811. a += 3)
  53812. w.x = b[a + 0],
  53813. w.y = b[a + 1],
  53814. w.z = b[a + 2],
  53815. T.x = b[r + a + 0],
  53816. T.y = b[r + a + 1],
  53817. T.z = b[r + a + 2],
  53818. x.addVectors(w, T).normalize(),
  53819. b[a + 0] = b[r + a + 0] = x.x,
  53820. b[a + 1] = b[r + a + 1] = x.y,
  53821. b[a + 2] = b[r + a + 2] = x.z
  53822. }
  53823. }
  53824. ,
  53825. Ci.LatheBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53826. Ci.LatheBufferGeometry.prototype.constructor = Ci.LatheBufferGeometry,
  53827. Ci.LatheGeometry = function(e, t, i, n) {
  53828. Ci.Geometry.call(this),
  53829. this.type = "LatheGeometry",
  53830. this.parameters = {
  53831. points: e,
  53832. segments: t,
  53833. phiStart: i,
  53834. phiLength: n
  53835. },
  53836. this.fromBufferGeometry(new Ci.LatheBufferGeometry(e,t,i,n)),
  53837. this.mergeVertices()
  53838. }
  53839. ,
  53840. Ci.LatheGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53841. Ci.LatheGeometry.prototype.constructor = Ci.LatheGeometry,
  53842. Ci.PlaneGeometry = function(e, t, i, n) {
  53843. Ci.Geometry.call(this),
  53844. this.type = "PlaneGeometry",
  53845. this.parameters = {
  53846. width: e,
  53847. height: t,
  53848. widthSegments: i,
  53849. heightSegments: n
  53850. },
  53851. this.fromBufferGeometry(new Ci.PlaneBufferGeometry(e,t,i,n))
  53852. }
  53853. ,
  53854. Ci.PlaneGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53855. Ci.PlaneGeometry.prototype.constructor = Ci.PlaneGeometry,
  53856. Ci.PlaneBufferGeometry = function(e, t, i, n) {
  53857. Ci.BufferGeometry.call(this),
  53858. this.type = "PlaneBufferGeometry",
  53859. this.parameters = {
  53860. width: e,
  53861. height: t,
  53862. widthSegments: i,
  53863. heightSegments: n
  53864. };
  53865. for (var r = e / 2, o = t / 2, a = Math.floor(i) || 1, s = Math.floor(n) || 1, l = a + 1, c = s + 1, h = e / a, u = t / s, d = new Float32Array(l * c * 3), p = new Float32Array(l * c * 3), f = new Float32Array(l * c * 2), g = 0, m = 0, v = 0; v < c; v++)
  53866. for (var y = v * u - o, A = 0; A < l; A++) {
  53867. var C = A * h - r;
  53868. d[g] = C,
  53869. d[g + 1] = -y,
  53870. p[g + 2] = 1,
  53871. f[m] = A / a,
  53872. f[m + 1] = 1 - v / s,
  53873. g += 3,
  53874. m += 2
  53875. }
  53876. g = 0;
  53877. var I = new (65535 < d.length / 3 ? Uint32Array : Uint16Array)(a * s * 6);
  53878. for (v = 0; v < s; v++)
  53879. for (A = 0; A < a; A++) {
  53880. var E = A + l * v
  53881. , _ = A + l * (v + 1)
  53882. , b = A + 1 + l * (v + 1)
  53883. , w = A + 1 + l * v;
  53884. I[g] = E,
  53885. I[g + 1] = _,
  53886. I[g + 2] = w,
  53887. I[g + 3] = _,
  53888. I[g + 4] = b,
  53889. I[g + 5] = w,
  53890. g += 6
  53891. }
  53892. this.setIndex(new Ci.BufferAttribute(I,1)),
  53893. this.addAttribute("position", new Ci.BufferAttribute(d,3)),
  53894. this.addAttribute("normal", new Ci.BufferAttribute(p,3)),
  53895. this.addAttribute("uv", new Ci.BufferAttribute(f,2))
  53896. }
  53897. ,
  53898. Ci.PlaneBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53899. Ci.PlaneBufferGeometry.prototype.constructor = Ci.PlaneBufferGeometry,
  53900. Ci.RingBufferGeometry = function(e, t, i, n, r, o) {
  53901. Ci.BufferGeometry.call(this),
  53902. this.type = "RingBufferGeometry",
  53903. this.parameters = {
  53904. innerRadius: e,
  53905. outerRadius: t,
  53906. thetaSegments: i,
  53907. phiSegments: n,
  53908. thetaStart: r,
  53909. thetaLength: o
  53910. },
  53911. e = e || 20,
  53912. t = t || 50,
  53913. r = void 0 !== r ? r : 0,
  53914. o = void 0 !== o ? o : 2 * Math.PI;
  53915. var a, s, l, c = ((i = void 0 !== i ? Math.max(3, i) : 8) + 1) * ((n = void 0 !== n ? Math.max(1, n) : 1) + 1), h = i * n * 2 * 3, u = new Ci.BufferAttribute(new (65535 < h ? Uint32Array : Uint16Array)(h),1), d = new Ci.BufferAttribute(new Float32Array(3 * c),3), p = new Ci.BufferAttribute(new Float32Array(3 * c),3), f = new Ci.BufferAttribute(new Float32Array(2 * c),2), g = 0, m = 0, v = e, y = (t - e) / n, A = new Ci.Vector3, C = new Ci.Vector2;
  53916. for (s = 0; s <= n; s++) {
  53917. for (l = 0; l <= i; l++)
  53918. a = r + l / i * o,
  53919. A.x = v * Math.cos(a),
  53920. A.y = v * Math.sin(a),
  53921. d.setXYZ(g, A.x, A.y, A.z),
  53922. p.setXYZ(g, 0, 0, 1),
  53923. C.x = (A.x / t + 1) / 2,
  53924. C.y = (A.y / t + 1) / 2,
  53925. f.setXY(g, C.x, C.y),
  53926. g++;
  53927. v += y
  53928. }
  53929. for (s = 0; s < n; s++) {
  53930. var I = s * (i + 1);
  53931. for (l = 0; l < i; l++) {
  53932. var E = a = l + I
  53933. , _ = a + i + 1
  53934. , b = a + i + 2
  53935. , w = a + 1;
  53936. u.setX(m, E),
  53937. m++,
  53938. u.setX(m, _),
  53939. m++,
  53940. u.setX(m, b),
  53941. m++,
  53942. u.setX(m, E),
  53943. m++,
  53944. u.setX(m, b),
  53945. m++,
  53946. u.setX(m, w),
  53947. m++
  53948. }
  53949. }
  53950. this.setIndex(u),
  53951. this.addAttribute("position", d),
  53952. this.addAttribute("normal", p),
  53953. this.addAttribute("uv", f)
  53954. }
  53955. ,
  53956. Ci.RingBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53957. Ci.RingBufferGeometry.prototype.constructor = Ci.RingBufferGeometry,
  53958. Ci.RingGeometry = function(e, t, i, n, r, o) {
  53959. Ci.Geometry.call(this),
  53960. this.type = "RingGeometry",
  53961. this.parameters = {
  53962. innerRadius: e,
  53963. outerRadius: t,
  53964. thetaSegments: i,
  53965. phiSegments: n,
  53966. thetaStart: r,
  53967. thetaLength: o
  53968. },
  53969. this.fromBufferGeometry(new Ci.RingBufferGeometry(e,t,i,n,r,o))
  53970. }
  53971. ,
  53972. Ci.RingGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53973. Ci.RingGeometry.prototype.constructor = Ci.RingGeometry,
  53974. Ci.SphereGeometry = function(e, t, i, n, r, o, a) {
  53975. Ci.Geometry.call(this),
  53976. this.type = "SphereGeometry",
  53977. this.parameters = {
  53978. radius: e,
  53979. widthSegments: t,
  53980. heightSegments: i,
  53981. phiStart: n,
  53982. phiLength: r,
  53983. thetaStart: o,
  53984. thetaLength: a
  53985. },
  53986. this.fromBufferGeometry(new Ci.SphereBufferGeometry(e,t,i,n,r,o,a))
  53987. }
  53988. ,
  53989. Ci.SphereGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53990. Ci.SphereGeometry.prototype.constructor = Ci.SphereGeometry,
  53991. Ci.SphereBufferGeometry = function(e, t, i, n, r, o, a) {
  53992. Ci.BufferGeometry.call(this),
  53993. this.type = "SphereBufferGeometry",
  53994. this.parameters = {
  53995. radius: e,
  53996. widthSegments: t,
  53997. heightSegments: i,
  53998. phiStart: n,
  53999. phiLength: r,
  54000. thetaStart: o,
  54001. thetaLength: a
  54002. },
  54003. e = e || 50,
  54004. t = Math.max(3, Math.floor(t) || 8),
  54005. i = Math.max(2, Math.floor(i) || 6),
  54006. n = void 0 !== n ? n : 0,
  54007. r = void 0 !== r ? r : 2 * Math.PI;
  54008. for (var s = (o = void 0 !== o ? o : 0) + (a = void 0 !== a ? a : Math.PI), l = (t + 1) * (i + 1), c = new Ci.BufferAttribute(new Float32Array(3 * l),3), h = new Ci.BufferAttribute(new Float32Array(3 * l),3), u = new Ci.BufferAttribute(new Float32Array(2 * l),2), d = 0, p = [], f = new Ci.Vector3, g = 0; g <= i; g++) {
  54009. for (var m = [], v = g / i, y = 0; y <= t; y++) {
  54010. var A = y / t
  54011. , C = -e * Math.cos(n + A * r) * Math.sin(o + v * a)
  54012. , I = e * Math.cos(o + v * a)
  54013. , E = e * Math.sin(n + A * r) * Math.sin(o + v * a);
  54014. f.set(C, I, E).normalize(),
  54015. c.setXYZ(d, C, I, E),
  54016. h.setXYZ(d, f.x, f.y, f.z),
  54017. u.setXY(d, A, 1 - v),
  54018. m.push(d),
  54019. d++
  54020. }
  54021. p.push(m)
  54022. }
  54023. var _ = [];
  54024. for (g = 0; g < i; g++)
  54025. for (y = 0; y < t; y++) {
  54026. var b = p[g][y + 1]
  54027. , w = p[g][y]
  54028. , T = p[g + 1][y]
  54029. , x = p[g + 1][y + 1];
  54030. (0 !== g || 0 < o) && _.push(b, w, x),
  54031. (g !== i - 1 || s < Math.PI) && _.push(w, T, x)
  54032. }
  54033. this.setIndex(new (65535 < c.count ? Ci.Uint32Attribute : Ci.Uint16Attribute)(_,1)),
  54034. this.addAttribute("position", c),
  54035. this.addAttribute("normal", h),
  54036. this.addAttribute("uv", u),
  54037. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  54038. }
  54039. ,
  54040. Ci.SphereBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54041. Ci.SphereBufferGeometry.prototype.constructor = Ci.SphereBufferGeometry,
  54042. Ci.TextGeometry = function(e, t) {
  54043. var i = (t = t || {}).font;
  54044. if (i instanceof Ci.Font == 0)
  54045. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  54046. new Ci.Geometry;
  54047. var n = i.generateShapes(e, t.size, t.curveSegments);
  54048. t.amount = void 0 !== t.height ? t.height : 50,
  54049. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  54050. void 0 === t.bevelSize && (t.bevelSize = 8),
  54051. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  54052. Ci.ExtrudeGeometry.call(this, n, t),
  54053. this.type = "TextGeometry"
  54054. }
  54055. ,
  54056. Ci.TextGeometry.prototype = Object.create(Ci.ExtrudeGeometry.prototype),
  54057. Ci.TextGeometry.prototype.constructor = Ci.TextGeometry,
  54058. Ci.TorusBufferGeometry = function(e, t, i, n, r) {
  54059. Ci.BufferGeometry.call(this),
  54060. this.type = "TorusBufferGeometry",
  54061. this.parameters = {
  54062. radius: e,
  54063. tube: t,
  54064. radialSegments: i,
  54065. tubularSegments: n,
  54066. arc: r
  54067. },
  54068. e = e || 100,
  54069. t = t || 40,
  54070. i = Math.floor(i) || 8,
  54071. n = Math.floor(n) || 6,
  54072. r = r || 2 * Math.PI;
  54073. var o, a, s = (i + 1) * (n + 1), l = i * n * 2 * 3, c = new (65535 < l ? Uint32Array : Uint16Array)(l), h = new Float32Array(3 * s), u = new Float32Array(3 * s), d = new Float32Array(2 * s), p = 0, f = 0, g = 0, m = new Ci.Vector3, v = new Ci.Vector3, y = new Ci.Vector3;
  54074. for (o = 0; o <= i; o++)
  54075. for (a = 0; a <= n; a++) {
  54076. var A = a / n * r
  54077. , C = o / i * Math.PI * 2;
  54078. v.x = (e + t * Math.cos(C)) * Math.cos(A),
  54079. v.y = (e + t * Math.cos(C)) * Math.sin(A),
  54080. v.z = t * Math.sin(C),
  54081. h[p] = v.x,
  54082. h[p + 1] = v.y,
  54083. h[p + 2] = v.z,
  54084. m.x = e * Math.cos(A),
  54085. m.y = e * Math.sin(A),
  54086. y.subVectors(v, m).normalize(),
  54087. u[p] = y.x,
  54088. u[p + 1] = y.y,
  54089. u[p + 2] = y.z,
  54090. d[f] = a / n,
  54091. d[f + 1] = o / i,
  54092. p += 3,
  54093. f += 2
  54094. }
  54095. for (o = 1; o <= i; o++)
  54096. for (a = 1; a <= n; a++) {
  54097. var I = (n + 1) * o + a - 1
  54098. , E = (n + 1) * (o - 1) + a - 1
  54099. , _ = (n + 1) * (o - 1) + a
  54100. , b = (n + 1) * o + a;
  54101. c[g] = I,
  54102. c[g + 1] = E,
  54103. c[g + 2] = b,
  54104. c[g + 3] = E,
  54105. c[g + 4] = _,
  54106. c[g + 5] = b,
  54107. g += 6
  54108. }
  54109. this.setIndex(new Ci.BufferAttribute(c,1)),
  54110. this.addAttribute("position", new Ci.BufferAttribute(h,3)),
  54111. this.addAttribute("normal", new Ci.BufferAttribute(u,3)),
  54112. this.addAttribute("uv", new Ci.BufferAttribute(d,2))
  54113. }
  54114. ,
  54115. Ci.TorusBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54116. Ci.TorusBufferGeometry.prototype.constructor = Ci.TorusBufferGeometry,
  54117. Ci.TorusGeometry = function(e, t, i, n, r) {
  54118. Ci.Geometry.call(this),
  54119. this.type = "TorusGeometry",
  54120. this.parameters = {
  54121. radius: e,
  54122. tube: t,
  54123. radialSegments: i,
  54124. tubularSegments: n,
  54125. arc: r
  54126. },
  54127. this.fromBufferGeometry(new Ci.TorusBufferGeometry(e,t,i,n,r))
  54128. }
  54129. ,
  54130. Ci.TorusGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54131. Ci.TorusGeometry.prototype.constructor = Ci.TorusGeometry,
  54132. Ci.TorusKnotBufferGeometry = function(e, t, i, n, r, o) {
  54133. function a(e, t, i, n, r) {
  54134. var o = Math.cos(e)
  54135. , a = Math.sin(e)
  54136. , s = i / t * e
  54137. , l = Math.cos(s);
  54138. r.x = n * (2 + l) * .5 * o,
  54139. r.y = n * (2 + l) * a * .5,
  54140. r.z = n * Math.sin(s) * .5
  54141. }
  54142. Ci.BufferGeometry.call(this),
  54143. this.type = "TorusKnotBufferGeometry",
  54144. this.parameters = {
  54145. radius: e,
  54146. tube: t,
  54147. tubularSegments: i,
  54148. radialSegments: n,
  54149. p: r,
  54150. q: o
  54151. },
  54152. e = e || 100,
  54153. t = t || 40,
  54154. i = Math.floor(i) || 64,
  54155. r = r || 2,
  54156. o = o || 3;
  54157. var s, l, c = ((n = Math.floor(n) || 8) + 1) * (i + 1), h = n * i * 2 * 3, u = new Ci.BufferAttribute(new (65535 < h ? Uint32Array : Uint16Array)(h),1), d = new Ci.BufferAttribute(new Float32Array(3 * c),3), p = new Ci.BufferAttribute(new Float32Array(3 * c),3), f = new Ci.BufferAttribute(new Float32Array(2 * c),2), g = 0, m = 0, v = new Ci.Vector3, y = new Ci.Vector3, A = new Ci.Vector2, C = new Ci.Vector3, I = new Ci.Vector3, E = new Ci.Vector3, _ = new Ci.Vector3, b = new Ci.Vector3;
  54158. for (s = 0; s <= i; ++s) {
  54159. var w = s / i * r * Math.PI * 2;
  54160. for (a(w, r, o, e, C),
  54161. a(.01 + w, r, o, e, I),
  54162. _.subVectors(I, C),
  54163. b.addVectors(I, C),
  54164. E.crossVectors(_, b),
  54165. b.crossVectors(E, _),
  54166. E.normalize(),
  54167. b.normalize(),
  54168. l = 0; l <= n; ++l) {
  54169. var T = l / n * Math.PI * 2
  54170. , x = -t * Math.cos(T)
  54171. , S = t * Math.sin(T);
  54172. v.x = C.x + (x * b.x + S * E.x),
  54173. v.y = C.y + (x * b.y + S * E.y),
  54174. v.z = C.z + (x * b.z + S * E.z),
  54175. d.setXYZ(g, v.x, v.y, v.z),
  54176. y.subVectors(v, C).normalize(),
  54177. p.setXYZ(g, y.x, y.y, y.z),
  54178. A.x = s / i,
  54179. A.y = l / n,
  54180. f.setXY(g, A.x, A.y),
  54181. g++
  54182. }
  54183. }
  54184. for (l = 1; l <= i; l++)
  54185. for (s = 1; s <= n; s++) {
  54186. var M = (n + 1) * (l - 1) + (s - 1)
  54187. , R = (n + 1) * l + (s - 1)
  54188. , P = (n + 1) * l + s
  54189. , O = (n + 1) * (l - 1) + s;
  54190. u.setX(m, M),
  54191. m++,
  54192. u.setX(m, R),
  54193. m++,
  54194. u.setX(m, O),
  54195. m++,
  54196. u.setX(m, R),
  54197. m++,
  54198. u.setX(m, P),
  54199. m++,
  54200. u.setX(m, O),
  54201. m++
  54202. }
  54203. this.setIndex(u),
  54204. this.addAttribute("position", d),
  54205. this.addAttribute("normal", p),
  54206. this.addAttribute("uv", f)
  54207. }
  54208. ,
  54209. Ci.TorusKnotBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54210. Ci.TorusKnotBufferGeometry.prototype.constructor = Ci.TorusKnotBufferGeometry,
  54211. Ci.TorusKnotGeometry = function(e, t, i, n, r, o, a) {
  54212. Ci.Geometry.call(this),
  54213. this.type = "TorusKnotGeometry",
  54214. this.parameters = {
  54215. radius: e,
  54216. tube: t,
  54217. tubularSegments: i,
  54218. radialSegments: n,
  54219. p: r,
  54220. q: o
  54221. },
  54222. void 0 !== a && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  54223. this.fromBufferGeometry(new Ci.TorusKnotBufferGeometry(e,t,i,n,r,o)),
  54224. this.mergeVertices()
  54225. }
  54226. ,
  54227. Ci.TorusKnotGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54228. Ci.TorusKnotGeometry.prototype.constructor = Ci.TorusKnotGeometry,
  54229. Ci.TubeGeometry = function(e, t, i, n, r, o) {
  54230. Ci.Geometry.call(this),
  54231. this.type = "TubeGeometry",
  54232. this.parameters = {
  54233. path: e,
  54234. segments: t,
  54235. radius: i,
  54236. radialSegments: n,
  54237. closed: r,
  54238. taper: o
  54239. },
  54240. t = t || 64,
  54241. i = i || 1,
  54242. n = n || 8,
  54243. r = r || !1,
  54244. o = o || Ci.TubeGeometry.NoTaper;
  54245. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M = [], R = this, P = t + 1, O = new Ci.Vector3, L = new Ci.TubeGeometry.FrenetFrames(e,t,r), D = L.tangents, N = L.normals, F = L.binormals;
  54246. for (this.tangents = D,
  54247. this.normals = N,
  54248. this.binormals = F,
  54249. f = 0; f < P; f++)
  54250. for (M[f] = [],
  54251. l = f / (P - 1),
  54252. p = e.getPointAt(l),
  54253. D[f],
  54254. a = N[f],
  54255. s = F[f],
  54256. h = i * o(l),
  54257. g = 0; g < n; g++)
  54258. c = g / n * 2 * Math.PI,
  54259. u = -h * Math.cos(c),
  54260. d = h * Math.sin(c),
  54261. O.copy(p),
  54262. O.x += u * a.x + d * s.x,
  54263. O.y += u * a.y + d * s.y,
  54264. O.z += u * a.z + d * s.z,
  54265. M[f][g] = (T = O.x,
  54266. x = O.y,
  54267. S = O.z,
  54268. R.vertices.push(new Ci.Vector3(T,x,S)) - 1);
  54269. for (f = 0; f < t; f++)
  54270. for (g = 0; g < n; g++)
  54271. m = r ? (f + 1) % t : f + 1,
  54272. v = (g + 1) % n,
  54273. y = M[f][g],
  54274. A = M[m][g],
  54275. C = M[m][v],
  54276. I = M[f][v],
  54277. E = new Ci.Vector2(f / t,g / n),
  54278. _ = new Ci.Vector2((f + 1) / t,g / n),
  54279. b = new Ci.Vector2((f + 1) / t,(g + 1) / n),
  54280. w = new Ci.Vector2(f / t,(g + 1) / n),
  54281. this.faces.push(new Ci.Face3(y,A,I)),
  54282. this.faceVertexUvs[0].push([E, _, w]),
  54283. this.faces.push(new Ci.Face3(A,C,I)),
  54284. this.faceVertexUvs[0].push([_.clone(), b, w.clone()]);
  54285. this.computeFaceNormals(),
  54286. this.computeVertexNormals()
  54287. }
  54288. ,
  54289. Ci.TubeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54290. Ci.TubeGeometry.prototype.constructor = Ci.TubeGeometry,
  54291. Ci.TubeGeometry.NoTaper = function(e) {
  54292. return 1
  54293. }
  54294. ,
  54295. Ci.TubeGeometry.SinusoidalTaper = function(e) {
  54296. return Math.sin(Math.PI * e)
  54297. }
  54298. ,
  54299. Ci.TubeGeometry.FrenetFrames = function(e, t, i) {
  54300. var n, r, o, a, s, l, c, h = new Ci.Vector3, u = [], d = [], p = [], f = new Ci.Vector3, g = new Ci.Matrix4, m = t + 1;
  54301. for (this.tangents = u,
  54302. this.normals = d,
  54303. this.binormals = p,
  54304. l = 0; l < m; l++)
  54305. c = l / (m - 1),
  54306. u[l] = e.getTangentAt(c),
  54307. u[l].normalize();
  54308. for (d[0] = new Ci.Vector3,
  54309. p[0] = new Ci.Vector3,
  54310. r = Number.MAX_VALUE,
  54311. o = Math.abs(u[0].x),
  54312. a = Math.abs(u[0].y),
  54313. s = Math.abs(u[0].z),
  54314. o <= r && (r = o,
  54315. h.set(1, 0, 0)),
  54316. a <= r && (r = a,
  54317. h.set(0, 1, 0)),
  54318. s <= r && h.set(0, 0, 1),
  54319. f.crossVectors(u[0], h).normalize(),
  54320. d[0].crossVectors(u[0], f),
  54321. p[0].crossVectors(u[0], d[0]),
  54322. l = 1; l < m; l++)
  54323. d[l] = d[l - 1].clone(),
  54324. p[l] = p[l - 1].clone(),
  54325. f.crossVectors(u[l - 1], u[l]),
  54326. f.length() > Number.EPSILON && (f.normalize(),
  54327. n = Math.acos(Ci.Math.clamp(u[l - 1].dot(u[l]), -1, 1)),
  54328. d[l].applyMatrix4(g.makeRotationAxis(f, n))),
  54329. p[l].crossVectors(u[l], d[l]);
  54330. if (i)
  54331. for (n = Math.acos(Ci.Math.clamp(d[0].dot(d[m - 1]), -1, 1)),
  54332. n /= m - 1,
  54333. 0 < u[0].dot(f.crossVectors(d[0], d[m - 1])) && (n = -n),
  54334. l = 1; l < m; l++)
  54335. d[l].applyMatrix4(g.makeRotationAxis(u[l], n * l)),
  54336. p[l].crossVectors(u[l], d[l])
  54337. }
  54338. ,
  54339. Ci.PolyhedronGeometry = function(e, t, i, n) {
  54340. function f(e) {
  54341. var t = e.normalize().clone();
  54342. t.index = m.vertices.push(t) - 1;
  54343. var i = a(e) / 2 / Math.PI + .5
  54344. , n = function(e) {
  54345. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  54346. }(e) / Math.PI + .5;
  54347. return t.uv = new Ci.Vector2(i,1 - n),
  54348. t
  54349. }
  54350. function g(e, t, i, n) {
  54351. var r = new Ci.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,n);
  54352. m.faces.push(r),
  54353. y.copy(e).add(t).add(i).divideScalar(3);
  54354. var o = a(y);
  54355. m.faceVertexUvs[0].push([s(e.uv, e, o), s(t.uv, t, o), s(i.uv, i, o)])
  54356. }
  54357. function r(e, t) {
  54358. for (var i = Math.pow(2, t), n = f(m.vertices[e.a]), r = f(m.vertices[e.b]), o = f(m.vertices[e.c]), a = [], s = e.materialIndex, l = 0; l <= i; l++) {
  54359. a[l] = [];
  54360. for (var c = f(n.clone().lerp(o, l / i)), h = f(r.clone().lerp(o, l / i)), u = i - l, d = 0; d <= u; d++)
  54361. a[l][d] = 0 === d && l === i ? c : f(c.clone().lerp(h, d / u))
  54362. }
  54363. for (l = 0; l < i; l++)
  54364. for (d = 0; d < 2 * (i - l) - 1; d++) {
  54365. var p = Math.floor(d / 2);
  54366. d % 2 == 0 ? g(a[l][p + 1], a[l + 1][p], a[l][p], s) : g(a[l][p + 1], a[l + 1][p + 1], a[l + 1][p], s)
  54367. }
  54368. }
  54369. function a(e) {
  54370. return Math.atan2(e.z, -e.x)
  54371. }
  54372. function s(e, t, i) {
  54373. return i < 0 && 1 === e.x && (e = new Ci.Vector2(e.x - 1,e.y)),
  54374. 0 === t.x && 0 === t.z && (e = new Ci.Vector2(i / 2 / Math.PI + .5,e.y)),
  54375. e.clone()
  54376. }
  54377. Ci.Geometry.call(this),
  54378. this.type = "PolyhedronGeometry",
  54379. this.parameters = {
  54380. vertices: e,
  54381. indices: t,
  54382. radius: i,
  54383. detail: n
  54384. },
  54385. i = i || 1,
  54386. n = n || 0;
  54387. for (var m = this, o = 0, l = e.length; o < l; o += 3)
  54388. f(new Ci.Vector3(e[o],e[o + 1],e[o + 2]));
  54389. var c = this.vertices
  54390. , h = []
  54391. , u = (o = 0,
  54392. 0);
  54393. for (l = t.length; o < l; o += 3,
  54394. u++) {
  54395. var d = c[t[o]]
  54396. , p = c[t[o + 1]]
  54397. , v = c[t[o + 2]];
  54398. h[u] = new Ci.Face3(d.index,p.index,v.index,[d.clone(), p.clone(), v.clone()],void 0,u)
  54399. }
  54400. var y = new Ci.Vector3;
  54401. for (o = 0,
  54402. l = h.length; o < l; o++)
  54403. r(h[o], n);
  54404. for (o = 0,
  54405. l = this.faceVertexUvs[0].length; o < l; o++) {
  54406. var A = this.faceVertexUvs[0][o]
  54407. , C = A[0].x
  54408. , I = A[1].x
  54409. , E = A[2].x
  54410. , _ = Math.max(C, I, E)
  54411. , b = Math.min(C, I, E);
  54412. .9 < _ && b < .1 && (C < .2 && (A[0].x += 1),
  54413. I < .2 && (A[1].x += 1),
  54414. E < .2 && (A[2].x += 1))
  54415. }
  54416. for (o = 0,
  54417. l = this.vertices.length; o < l; o++)
  54418. this.vertices[o].multiplyScalar(i);
  54419. this.mergeVertices(),
  54420. this.computeFaceNormals(),
  54421. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,i)
  54422. }
  54423. ,
  54424. Ci.PolyhedronGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54425. Ci.PolyhedronGeometry.prototype.constructor = Ci.PolyhedronGeometry,
  54426. Ci.DodecahedronGeometry = function(e, t) {
  54427. var i = (1 + Math.sqrt(5)) / 2
  54428. , n = 1 / i
  54429. , r = [-1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 0, -n, -i, 0, -n, i, 0, n, -i, 0, n, i, -n, -i, 0, -n, i, 0, n, -i, 0, n, i, 0, -i, 0, -n, i, 0, -n, -i, 0, n, i, 0, n];
  54430. Ci.PolyhedronGeometry.call(this, r, [3, 11, 7, 3, 7, 15, 3, 15, 13, 7, 19, 17, 7, 17, 6, 7, 6, 15, 17, 4, 8, 17, 8, 10, 17, 10, 6, 8, 0, 16, 8, 16, 2, 8, 2, 10, 0, 12, 1, 0, 1, 18, 0, 18, 16, 6, 10, 2, 6, 2, 13, 6, 13, 15, 2, 16, 18, 2, 18, 3, 2, 3, 13, 18, 1, 9, 18, 9, 11, 18, 11, 3, 4, 14, 12, 4, 12, 0, 4, 0, 8, 11, 9, 5, 11, 5, 19, 11, 19, 7, 19, 5, 14, 19, 14, 4, 19, 4, 17, 1, 12, 14, 1, 14, 5, 1, 5, 9], e, t),
  54431. this.type = "DodecahedronGeometry",
  54432. this.parameters = {
  54433. radius: e,
  54434. detail: t
  54435. }
  54436. }
  54437. ,
  54438. Ci.DodecahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54439. Ci.DodecahedronGeometry.prototype.constructor = Ci.DodecahedronGeometry,
  54440. Ci.IcosahedronGeometry = function(e, t) {
  54441. var i = (1 + Math.sqrt(5)) / 2
  54442. , n = [-1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, 0, 0, -1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, i, 0, -1, i, 0, 1, -i, 0, -1, -i, 0, 1];
  54443. Ci.PolyhedronGeometry.call(this, n, [0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1], e, t),
  54444. this.type = "IcosahedronGeometry",
  54445. this.parameters = {
  54446. radius: e,
  54447. detail: t
  54448. }
  54449. }
  54450. ,
  54451. Ci.IcosahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54452. Ci.IcosahedronGeometry.prototype.constructor = Ci.IcosahedronGeometry,
  54453. Ci.OctahedronGeometry = function(e, t) {
  54454. Ci.PolyhedronGeometry.call(this, [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1], [0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2], e, t),
  54455. this.type = "OctahedronGeometry",
  54456. this.parameters = {
  54457. radius: e,
  54458. detail: t
  54459. }
  54460. }
  54461. ,
  54462. Ci.OctahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54463. Ci.OctahedronGeometry.prototype.constructor = Ci.OctahedronGeometry,
  54464. Ci.TetrahedronGeometry = function(e, t) {
  54465. Ci.PolyhedronGeometry.call(this, [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1], [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1], e, t),
  54466. this.type = "TetrahedronGeometry",
  54467. this.parameters = {
  54468. radius: e,
  54469. detail: t
  54470. }
  54471. }
  54472. ,
  54473. Ci.TetrahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54474. Ci.TetrahedronGeometry.prototype.constructor = Ci.TetrahedronGeometry,
  54475. Ci.ParametricGeometry = function(e, t, i) {
  54476. Ci.Geometry.call(this),
  54477. this.type = "ParametricGeometry",
  54478. this.parameters = {
  54479. func: e,
  54480. slices: t,
  54481. stacks: i
  54482. };
  54483. var n, r, o, a, s, l, c, h, u, d, p, f, g = this.vertices, m = this.faces, v = this.faceVertexUvs[0], y = t + 1;
  54484. for (n = 0; n <= i; n++)
  54485. for (a = n / i,
  54486. r = 0; r <= t; r++)
  54487. o = e(r / t, a),
  54488. g.push(o);
  54489. for (n = 0; n < i; n++)
  54490. for (r = 0; r < t; r++)
  54491. l = (s = n * y + r) + 1,
  54492. c = (n + 1) * y + r + 1,
  54493. h = (n + 1) * y + r,
  54494. u = new Ci.Vector2(r / t,n / i),
  54495. d = new Ci.Vector2((r + 1) / t,n / i),
  54496. p = new Ci.Vector2((r + 1) / t,(n + 1) / i),
  54497. f = new Ci.Vector2(r / t,(n + 1) / i),
  54498. m.push(new Ci.Face3(s,l,h)),
  54499. v.push([u, d, f]),
  54500. m.push(new Ci.Face3(l,c,h)),
  54501. v.push([d.clone(), p, f.clone()]);
  54502. this.computeFaceNormals(),
  54503. this.computeVertexNormals()
  54504. }
  54505. ,
  54506. Ci.ParametricGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54507. Ci.ParametricGeometry.prototype.constructor = Ci.ParametricGeometry,
  54508. Ci.WireframeGeometry = function(e) {
  54509. function t(e, t) {
  54510. return e - t
  54511. }
  54512. Ci.BufferGeometry.call(this);
  54513. var i = [0, 0]
  54514. , n = {}
  54515. , r = ["a", "b", "c"];
  54516. if (e instanceof Ci.Geometry) {
  54517. for (var o = e.vertices, a = e.faces, s = 0, l = new Uint32Array(6 * a.length), c = 0, h = a.length; c < h; c++)
  54518. for (var u = a[c], d = 0; d < 3; d++) {
  54519. i[0] = u[r[d]],
  54520. i[1] = u[r[(d + 1) % 3]],
  54521. i.sort(t),
  54522. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54523. l[2 * s + 1] = i[1],
  54524. n[E] = !0,
  54525. s++)
  54526. }
  54527. var p = new Float32Array(2 * s * 3);
  54528. for (c = 0,
  54529. h = s; c < h; c++)
  54530. for (d = 0; d < 2; d++) {
  54531. var f = o[l[2 * c + d]];
  54532. p[(_ = 6 * c + 3 * d) + 0] = f.x,
  54533. p[_ + 1] = f.y,
  54534. p[_ + 2] = f.z
  54535. }
  54536. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54537. } else if (e instanceof Ci.BufferGeometry)
  54538. if (null !== e.index) {
  54539. var g = e.index.array
  54540. , m = (o = e.attributes.position,
  54541. e.groups);
  54542. s = 0;
  54543. 0 === m.length && e.addGroup(0, g.length);
  54544. l = new Uint32Array(2 * g.length);
  54545. for (var v = 0, y = m.length; v < y; ++v)
  54546. for (var A = m[v], C = A.start, I = (c = C,
  54547. C + A.count); c < I; c += 3)
  54548. for (d = 0; d < 3; d++) {
  54549. var E;
  54550. i[0] = g[c + d],
  54551. i[1] = g[c + (d + 1) % 3],
  54552. i.sort(t),
  54553. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54554. l[2 * s + 1] = i[1],
  54555. n[E] = !0,
  54556. s++)
  54557. }
  54558. for (p = new Float32Array(2 * s * 3),
  54559. c = 0,
  54560. h = s; c < h; c++)
  54561. for (d = 0; d < 2; d++) {
  54562. var _ = 6 * c + 3 * d
  54563. , b = l[2 * c + d];
  54564. p[_ + 0] = o.getX(b),
  54565. p[_ + 1] = o.getY(b),
  54566. p[_ + 2] = o.getZ(b)
  54567. }
  54568. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54569. } else {
  54570. var w = (s = (o = e.attributes.position.array).length / 3) / 3;
  54571. for (p = new Float32Array(2 * s * 3),
  54572. c = 0,
  54573. h = w; c < h; c++)
  54574. for (d = 0; d < 3; d++) {
  54575. var T = 9 * c + 3 * d;
  54576. p[(_ = 18 * c + 6 * d) + 0] = o[T],
  54577. p[_ + 1] = o[1 + T],
  54578. p[_ + 2] = o[2 + T];
  54579. b = 9 * c + (d + 1) % 3 * 3;
  54580. p[_ + 3] = o[b],
  54581. p[_ + 4] = o[b + 1],
  54582. p[_ + 5] = o[b + 2]
  54583. }
  54584. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54585. }
  54586. }
  54587. ,
  54588. Ci.WireframeGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54589. Ci.WireframeGeometry.prototype.constructor = Ci.WireframeGeometry,
  54590. Ci.AxisHelper = function(e) {
  54591. e = e || 1;
  54592. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  54593. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  54594. , n = new Ci.BufferGeometry;
  54595. n.addAttribute("position", new Ci.BufferAttribute(t,3)),
  54596. n.addAttribute("color", new Ci.BufferAttribute(i,3));
  54597. var r = new Ci.LineBasicMaterial({
  54598. vertexColors: Ci.VertexColors
  54599. });
  54600. Ci.LineSegments.call(this, n, r)
  54601. }
  54602. ,
  54603. Ci.AxisHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54604. Ci.AxisHelper.prototype.constructor = Ci.AxisHelper,
  54605. Ci.ArrowHelper = function() {
  54606. var a = new Ci.Geometry;
  54607. a.vertices.push(new Ci.Vector3(0,0,0), new Ci.Vector3(0,1,0));
  54608. var s = new Ci.CylinderGeometry(0,.5,1,5,1);
  54609. return s.translate(0, -.5, 0),
  54610. function(e, t, i, n, r, o) {
  54611. Ci.Object3D.call(this),
  54612. void 0 === n && (n = 16776960),
  54613. void 0 === i && (i = 1),
  54614. void 0 === r && (r = .2 * i),
  54615. void 0 === o && (o = .2 * r),
  54616. this.position.copy(t),
  54617. this.line = new Ci.Line(a,new Ci.LineBasicMaterial({
  54618. color: n
  54619. })),
  54620. this.line.matrixAutoUpdate = !1,
  54621. this.add(this.line),
  54622. this.cone = new Ci.Mesh(s,new Ci.MeshBasicMaterial({
  54623. color: n
  54624. })),
  54625. this.cone.matrixAutoUpdate = !1,
  54626. this.add(this.cone),
  54627. this.setDirection(e),
  54628. this.setLength(i, r, o)
  54629. }
  54630. }(),
  54631. Ci.ArrowHelper.prototype = Object.create(Ci.Object3D.prototype),
  54632. Ci.ArrowHelper.prototype.constructor = Ci.ArrowHelper,
  54633. Ci.ArrowHelper.prototype.setDirection = (Ai = new Ci.Vector3,
  54634. function(e) {
  54635. .99999 < e.y ? this.quaternion.set(0, 0, 0, 1) : e.y < -.99999 ? this.quaternion.set(1, 0, 0, 0) : (Ai.set(e.z, 0, -e.x).normalize(),
  54636. yi = Math.acos(e.y),
  54637. this.quaternion.setFromAxisAngle(Ai, yi))
  54638. }
  54639. ),
  54640. Ci.ArrowHelper.prototype.setLength = function(e, t, i) {
  54641. void 0 === t && (t = .2 * e),
  54642. void 0 === i && (i = .2 * t),
  54643. this.line.scale.set(1, Math.max(0, e - t), 1),
  54644. this.line.updateMatrix(),
  54645. this.cone.scale.set(i, t, i),
  54646. this.cone.position.y = e,
  54647. this.cone.updateMatrix()
  54648. }
  54649. ,
  54650. Ci.ArrowHelper.prototype.setColor = function(e) {
  54651. this.line.material.color.set(e),
  54652. this.cone.material.color.set(e)
  54653. }
  54654. ,
  54655. Ci.BoxHelper = function(e) {
  54656. 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])
  54657. , i = new Float32Array(24)
  54658. , n = new Ci.BufferGeometry;
  54659. n.setIndex(new Ci.BufferAttribute(t,1)),
  54660. n.addAttribute("position", new Ci.BufferAttribute(i,3)),
  54661. Ci.LineSegments.call(this, n, new Ci.LineBasicMaterial({
  54662. color: 16776960
  54663. })),
  54664. void 0 !== e && this.update(e)
  54665. }
  54666. ,
  54667. Ci.BoxHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54668. Ci.BoxHelper.prototype.constructor = Ci.BoxHelper,
  54669. Ci.BoxHelper.prototype.update = (vi = new Ci.Box3,
  54670. function(e) {
  54671. if (vi.setFromObject(e),
  54672. !vi.isEmpty()) {
  54673. var t = vi.min
  54674. , i = vi.max
  54675. , n = this.geometry.attributes.position
  54676. , r = n.array;
  54677. r[0] = i.x,
  54678. r[1] = i.y,
  54679. r[2] = i.z,
  54680. r[3] = t.x,
  54681. r[4] = i.y,
  54682. r[5] = i.z,
  54683. r[6] = t.x,
  54684. r[7] = t.y,
  54685. r[8] = i.z,
  54686. r[9] = i.x,
  54687. r[10] = t.y,
  54688. r[11] = i.z,
  54689. r[12] = i.x,
  54690. r[13] = i.y,
  54691. r[14] = t.z,
  54692. r[15] = t.x,
  54693. r[16] = i.y,
  54694. r[17] = t.z,
  54695. r[18] = t.x,
  54696. r[19] = t.y,
  54697. r[20] = t.z,
  54698. r[21] = i.x,
  54699. r[22] = t.y,
  54700. r[23] = t.z,
  54701. n.needsUpdate = !0,
  54702. this.geometry.computeBoundingSphere()
  54703. }
  54704. }
  54705. ),
  54706. Ci.BoundingBoxHelper = function(e, t) {
  54707. var i = void 0 !== t ? t : 8947848;
  54708. this.object = e,
  54709. this.box = new Ci.Box3,
  54710. Ci.Mesh.call(this, new Ci.BoxGeometry(1,1,1), new Ci.MeshBasicMaterial({
  54711. color: i,
  54712. wireframe: !0
  54713. }))
  54714. }
  54715. ,
  54716. Ci.BoundingBoxHelper.prototype = Object.create(Ci.Mesh.prototype),
  54717. Ci.BoundingBoxHelper.prototype.constructor = Ci.BoundingBoxHelper,
  54718. Ci.BoundingBoxHelper.prototype.update = function() {
  54719. this.box.setFromObject(this.object),
  54720. this.box.size(this.scale),
  54721. this.box.center(this.position)
  54722. }
  54723. ,
  54724. Ci.CameraHelper = function(e) {
  54725. function t(e, t, i) {
  54726. n(e, i),
  54727. n(t, i)
  54728. }
  54729. function n(e, t) {
  54730. i.vertices.push(new Ci.Vector3),
  54731. i.colors.push(new Ci.Color(t)),
  54732. void 0 === o[e] && (o[e] = []),
  54733. o[e].push(i.vertices.length - 1)
  54734. }
  54735. var i = new Ci.Geometry
  54736. , r = new Ci.LineBasicMaterial({
  54737. color: 16777215,
  54738. vertexColors: Ci.FaceColors
  54739. })
  54740. , o = {}
  54741. , a = 16755200
  54742. , s = 16711680
  54743. , l = 3355443;
  54744. t("n1", "n2", a),
  54745. t("n2", "n4", a),
  54746. t("n4", "n3", a),
  54747. t("n3", "n1", a),
  54748. t("f1", "f2", a),
  54749. t("f2", "f4", a),
  54750. t("f4", "f3", a),
  54751. t("f3", "f1", a),
  54752. t("n1", "f1", a),
  54753. t("n2", "f2", a),
  54754. t("n3", "f3", a),
  54755. t("n4", "f4", a),
  54756. t("p", "n1", s),
  54757. t("p", "n2", s),
  54758. t("p", "n3", s),
  54759. t("p", "n4", s),
  54760. t("u1", "u2", 43775),
  54761. t("u2", "u3", 43775),
  54762. t("u3", "u1", 43775),
  54763. t("c", "t", 16777215),
  54764. t("p", "c", l),
  54765. t("cn1", "cn2", l),
  54766. t("cn3", "cn4", l),
  54767. t("cf1", "cf2", l),
  54768. t("cf3", "cf4", l),
  54769. Ci.LineSegments.call(this, i, r),
  54770. this.camera = e,
  54771. this.camera.updateProjectionMatrix(),
  54772. this.matrix = e.matrixWorld,
  54773. this.matrixAutoUpdate = !1,
  54774. this.pointMap = o,
  54775. this.update()
  54776. }
  54777. ,
  54778. Ci.CameraHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54779. Ci.CameraHelper.prototype.constructor = Ci.CameraHelper,
  54780. Ci.CameraHelper.prototype.update = (gi = new Ci.Vector3,
  54781. mi = new Ci.Camera,
  54782. function() {
  54783. pi = this.geometry,
  54784. fi = this.pointMap,
  54785. mi.projectionMatrix.copy(this.camera.projectionMatrix),
  54786. Ni("c", 0, 0, -1),
  54787. Ni("t", 0, 0, 1),
  54788. Ni("n1", -1, -1, -1),
  54789. Ni("n2", 1, -1, -1),
  54790. Ni("n3", -1, 1, -1),
  54791. Ni("n4", 1, 1, -1),
  54792. Ni("f1", -1, -1, 1),
  54793. Ni("f2", 1, -1, 1),
  54794. Ni("f3", -1, 1, 1),
  54795. Ni("f4", 1, 1, 1),
  54796. Ni("u1", .7, 1.1, -1),
  54797. Ni("u2", -.7, 1.1, -1),
  54798. Ni("u3", 0, 2, -1),
  54799. Ni("cf1", -1, 0, 1),
  54800. Ni("cf2", 1, 0, 1),
  54801. Ni("cf3", 0, -1, 1),
  54802. Ni("cf4", 0, 1, 1),
  54803. Ni("cn1", -1, 0, -1),
  54804. Ni("cn2", 1, 0, -1),
  54805. Ni("cn3", 0, -1, -1),
  54806. Ni("cn4", 0, 1, -1),
  54807. pi.verticesNeedUpdate = !0
  54808. }
  54809. ),
  54810. Ci.DirectionalLightHelper = function(e, t) {
  54811. Ci.Object3D.call(this),
  54812. this.light = e,
  54813. this.light.updateMatrixWorld(),
  54814. this.matrix = e.matrixWorld,
  54815. this.matrixAutoUpdate = !1,
  54816. t = t || 1;
  54817. var i = new Ci.Geometry;
  54818. i.vertices.push(new Ci.Vector3(-t,t,0), new Ci.Vector3(t,t,0), new Ci.Vector3(t,-t,0), new Ci.Vector3(-t,-t,0), new Ci.Vector3(-t,t,0));
  54819. var n = new Ci.LineBasicMaterial({
  54820. fog: !1
  54821. });
  54822. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54823. this.lightPlane = new Ci.Line(i,n),
  54824. this.add(this.lightPlane),
  54825. (i = new Ci.Geometry).vertices.push(new Ci.Vector3, new Ci.Vector3),
  54826. (n = new Ci.LineBasicMaterial({
  54827. fog: !1
  54828. })).color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54829. this.targetLine = new Ci.Line(i,n),
  54830. this.add(this.targetLine),
  54831. this.update()
  54832. }
  54833. ,
  54834. Ci.DirectionalLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54835. Ci.DirectionalLightHelper.prototype.constructor = Ci.DirectionalLightHelper,
  54836. Ci.DirectionalLightHelper.prototype.dispose = function() {
  54837. this.lightPlane.geometry.dispose(),
  54838. this.lightPlane.material.dispose(),
  54839. this.targetLine.geometry.dispose(),
  54840. this.targetLine.material.dispose()
  54841. }
  54842. ,
  54843. Ci.DirectionalLightHelper.prototype.update = (hi = new Ci.Vector3,
  54844. ui = new Ci.Vector3,
  54845. di = new Ci.Vector3,
  54846. function() {
  54847. hi.setFromMatrixPosition(this.light.matrixWorld),
  54848. ui.setFromMatrixPosition(this.light.target.matrixWorld),
  54849. di.subVectors(ui, hi),
  54850. this.lightPlane.lookAt(di),
  54851. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54852. this.targetLine.geometry.vertices[1].copy(di),
  54853. this.targetLine.geometry.verticesNeedUpdate = !0,
  54854. this.targetLine.material.color.copy(this.lightPlane.material.color)
  54855. }
  54856. ),
  54857. Ci.EdgesHelper = function(e, t, i) {
  54858. var n = void 0 !== t ? t : 16777215;
  54859. Ci.LineSegments.call(this, new Ci.EdgesGeometry(e.geometry,i), new Ci.LineBasicMaterial({
  54860. color: n
  54861. })),
  54862. this.matrix = e.matrixWorld,
  54863. this.matrixAutoUpdate = !1
  54864. }
  54865. ,
  54866. Ci.EdgesHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54867. Ci.EdgesHelper.prototype.constructor = Ci.EdgesHelper,
  54868. Ci.FaceNormalsHelper = function(e, t, i, n) {
  54869. this.object = e,
  54870. this.size = void 0 !== t ? t : 1;
  54871. var r = void 0 !== i ? i : 16776960
  54872. , o = void 0 !== n ? n : 1
  54873. , a = 0
  54874. , s = this.object.geometry;
  54875. s instanceof Ci.Geometry ? a = s.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  54876. var l = new Ci.BufferGeometry
  54877. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54878. l.addAttribute("position", c),
  54879. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54880. color: r,
  54881. linewidth: o
  54882. })),
  54883. this.matrixAutoUpdate = !1,
  54884. this.update()
  54885. }
  54886. ,
  54887. Ci.FaceNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54888. Ci.FaceNormalsHelper.prototype.constructor = Ci.FaceNormalsHelper,
  54889. Ci.FaceNormalsHelper.prototype.update = (si = new Ci.Vector3,
  54890. li = new Ci.Vector3,
  54891. ci = new Ci.Matrix3,
  54892. function() {
  54893. this.object.updateMatrixWorld(!0),
  54894. ci.getNormalMatrix(this.object.matrixWorld);
  54895. for (var e = this.object.matrixWorld, t = this.geometry.attributes.position, i = this.object.geometry, n = i.vertices, r = i.faces, o = 0, a = 0, s = r.length; a < s; a++) {
  54896. var l = r[a]
  54897. , c = l.normal;
  54898. si.copy(n[l.a]).add(n[l.b]).add(n[l.c]).divideScalar(3).applyMatrix4(e),
  54899. li.copy(c).applyMatrix3(ci).normalize().multiplyScalar(this.size).add(si),
  54900. t.setXYZ(o, si.x, si.y, si.z),
  54901. o += 1,
  54902. t.setXYZ(o, li.x, li.y, li.z),
  54903. o += 1
  54904. }
  54905. return t.needsUpdate = !0,
  54906. this
  54907. }
  54908. ),
  54909. Ci.GridHelper = function(e, t) {
  54910. var i = new Ci.Geometry
  54911. , n = new Ci.LineBasicMaterial({
  54912. vertexColors: Ci.VertexColors
  54913. });
  54914. this.color1 = new Ci.Color(4473924),
  54915. this.color2 = new Ci.Color(8947848);
  54916. for (var r = -e; r <= e; r += t) {
  54917. i.vertices.push(new Ci.Vector3(-e,0,r), new Ci.Vector3(e,0,r), new Ci.Vector3(r,0,-e), new Ci.Vector3(r,0,e));
  54918. var o = 0 === r ? this.color1 : this.color2;
  54919. i.colors.push(o, o, o, o)
  54920. }
  54921. Ci.LineSegments.call(this, i, n)
  54922. }
  54923. ,
  54924. Ci.GridHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54925. Ci.GridHelper.prototype.constructor = Ci.GridHelper,
  54926. Ci.GridHelper.prototype.setColors = function(e, t) {
  54927. this.color1.set(e),
  54928. this.color2.set(t),
  54929. this.geometry.colorsNeedUpdate = !0
  54930. }
  54931. ,
  54932. Ci.HemisphereLightHelper = function(e, t) {
  54933. Ci.Object3D.call(this),
  54934. this.light = e,
  54935. this.light.updateMatrixWorld(),
  54936. this.matrix = e.matrixWorld,
  54937. this.matrixAutoUpdate = !1,
  54938. this.colors = [new Ci.Color, new Ci.Color];
  54939. var i = new Ci.SphereGeometry(t,4,2);
  54940. i.rotateX(-Math.PI / 2);
  54941. for (var n = 0; n < 8; n++)
  54942. i.faces[n].color = this.colors[n < 4 ? 0 : 1];
  54943. var r = new Ci.MeshBasicMaterial({
  54944. vertexColors: Ci.FaceColors,
  54945. wireframe: !0
  54946. });
  54947. this.lightSphere = new Ci.Mesh(i,r),
  54948. this.add(this.lightSphere),
  54949. this.update()
  54950. }
  54951. ,
  54952. Ci.HemisphereLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54953. Ci.HemisphereLightHelper.prototype.constructor = Ci.HemisphereLightHelper,
  54954. Ci.HemisphereLightHelper.prototype.dispose = function() {
  54955. this.lightSphere.geometry.dispose(),
  54956. this.lightSphere.material.dispose()
  54957. }
  54958. ,
  54959. Ci.HemisphereLightHelper.prototype.update = (ai = new Ci.Vector3,
  54960. function() {
  54961. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  54962. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  54963. this.lightSphere.lookAt(ai.setFromMatrixPosition(this.light.matrixWorld).negate()),
  54964. this.lightSphere.geometry.colorsNeedUpdate = !0
  54965. }
  54966. ),
  54967. Ci.PointLightHelper = function(e, t) {
  54968. this.light = e,
  54969. this.light.updateMatrixWorld();
  54970. var i = new Ci.SphereGeometry(t,4,2)
  54971. , n = new Ci.MeshBasicMaterial({
  54972. wireframe: !0,
  54973. fog: !1
  54974. });
  54975. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54976. Ci.Mesh.call(this, i, n),
  54977. this.matrix = this.light.matrixWorld,
  54978. this.matrixAutoUpdate = !1
  54979. }
  54980. ,
  54981. Ci.PointLightHelper.prototype = Object.create(Ci.Mesh.prototype),
  54982. Ci.PointLightHelper.prototype.constructor = Ci.PointLightHelper,
  54983. Ci.PointLightHelper.prototype.dispose = function() {
  54984. this.geometry.dispose(),
  54985. this.material.dispose()
  54986. }
  54987. ,
  54988. Ci.PointLightHelper.prototype.update = function() {
  54989. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54990. }
  54991. ,
  54992. Ci.SkeletonHelper = function(e) {
  54993. this.bones = this.getBoneList(e);
  54994. for (var t = new Ci.Geometry, i = 0; i < this.bones.length; i++) {
  54995. this.bones[i].parent instanceof Ci.Bone && (t.vertices.push(new Ci.Vector3),
  54996. t.vertices.push(new Ci.Vector3),
  54997. t.colors.push(new Ci.Color(0,0,1)),
  54998. t.colors.push(new Ci.Color(0,1,0)))
  54999. }
  55000. t.dynamic = !0;
  55001. var n = new Ci.LineBasicMaterial({
  55002. vertexColors: Ci.VertexColors,
  55003. depthTest: !1,
  55004. depthWrite: !1,
  55005. transparent: !0
  55006. });
  55007. Ci.LineSegments.call(this, t, n),
  55008. this.root = e,
  55009. this.matrix = e.matrixWorld,
  55010. this.matrixAutoUpdate = !1,
  55011. this.update()
  55012. }
  55013. ,
  55014. Ci.SkeletonHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55015. Ci.SkeletonHelper.prototype.constructor = Ci.SkeletonHelper,
  55016. Ci.SkeletonHelper.prototype.getBoneList = function(e) {
  55017. var t = [];
  55018. e instanceof Ci.Bone && t.push(e);
  55019. for (var i = 0; i < e.children.length; i++)
  55020. t.push.apply(t, this.getBoneList(e.children[i]));
  55021. return t
  55022. }
  55023. ,
  55024. Ci.SkeletonHelper.prototype.update = function() {
  55025. for (var e = this.geometry, t = (new Ci.Matrix4).getInverse(this.root.matrixWorld), i = new Ci.Matrix4, n = 0, r = 0; r < this.bones.length; r++) {
  55026. var o = this.bones[r];
  55027. o.parent instanceof Ci.Bone && (i.multiplyMatrices(t, o.matrixWorld),
  55028. e.vertices[n].setFromMatrixPosition(i),
  55029. i.multiplyMatrices(t, o.parent.matrixWorld),
  55030. e.vertices[n + 1].setFromMatrixPosition(i),
  55031. n += 2)
  55032. }
  55033. e.verticesNeedUpdate = !0,
  55034. e.computeBoundingSphere()
  55035. }
  55036. ,
  55037. Ci.SpotLightHelper = function(e) {
  55038. Ci.Object3D.call(this),
  55039. this.light = e,
  55040. this.light.updateMatrixWorld(),
  55041. this.matrix = e.matrixWorld,
  55042. this.matrixAutoUpdate = !1;
  55043. var t = new Ci.CylinderGeometry(0,1,1,8,1,!0);
  55044. t.translate(0, -.5, 0),
  55045. t.rotateX(-Math.PI / 2);
  55046. var i = new Ci.MeshBasicMaterial({
  55047. wireframe: !0,
  55048. fog: !1
  55049. });
  55050. this.cone = new Ci.Mesh(t,i),
  55051. this.add(this.cone),
  55052. this.update()
  55053. }
  55054. ,
  55055. Ci.SpotLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  55056. Ci.SpotLightHelper.prototype.constructor = Ci.SpotLightHelper,
  55057. Ci.SpotLightHelper.prototype.dispose = function() {
  55058. this.cone.geometry.dispose(),
  55059. this.cone.material.dispose()
  55060. }
  55061. ,
  55062. Ci.SpotLightHelper.prototype.update = (ri = new Ci.Vector3,
  55063. oi = new Ci.Vector3,
  55064. function() {
  55065. var e = this.light.distance ? this.light.distance : 1e4
  55066. , t = e * Math.tan(this.light.angle);
  55067. this.cone.scale.set(t, t, e),
  55068. ri.setFromMatrixPosition(this.light.matrixWorld),
  55069. oi.setFromMatrixPosition(this.light.target.matrixWorld),
  55070. this.cone.lookAt(oi.sub(ri)),
  55071. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  55072. }
  55073. ),
  55074. Ci.VertexNormalsHelper = function(e, t, i, n) {
  55075. this.object = e,
  55076. this.size = void 0 !== t ? t : 1;
  55077. var r = void 0 !== i ? i : 16711680
  55078. , o = void 0 !== n ? n : 1
  55079. , a = 0
  55080. , s = this.object.geometry;
  55081. s instanceof Ci.Geometry ? a = 3 * s.faces.length : s instanceof Ci.BufferGeometry && (a = s.attributes.normal.count);
  55082. var l = new Ci.BufferGeometry
  55083. , c = new Ci.Float32Attribute(2 * a * 3,3);
  55084. l.addAttribute("position", c),
  55085. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  55086. color: r,
  55087. linewidth: o
  55088. })),
  55089. this.matrixAutoUpdate = !1,
  55090. this.update()
  55091. }
  55092. ,
  55093. Ci.VertexNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55094. Ci.VertexNormalsHelper.prototype.constructor = Ci.VertexNormalsHelper,
  55095. Ci.VertexNormalsHelper.prototype.update = (ti = new Ci.Vector3,
  55096. ii = new Ci.Vector3,
  55097. ni = new Ci.Matrix3,
  55098. function() {
  55099. var e = ["a", "b", "c"];
  55100. this.object.updateMatrixWorld(!0),
  55101. ni.getNormalMatrix(this.object.matrixWorld);
  55102. var t = this.object.matrixWorld
  55103. , i = this.geometry.attributes.position
  55104. , n = this.object.geometry;
  55105. if (n instanceof Ci.Geometry)
  55106. for (var r = n.vertices, o = n.faces, a = 0, s = 0, l = o.length; s < l; s++)
  55107. for (var c = o[s], h = 0, u = c.vertexNormals.length; h < u; h++) {
  55108. var d = r[c[e[h]]]
  55109. , p = c.vertexNormals[h];
  55110. ti.copy(d).applyMatrix4(t),
  55111. ii.copy(p).applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  55112. i.setXYZ(a, ti.x, ti.y, ti.z),
  55113. a += 1,
  55114. i.setXYZ(a, ii.x, ii.y, ii.z),
  55115. a += 1
  55116. }
  55117. else if (n instanceof Ci.BufferGeometry) {
  55118. var f = n.attributes.position
  55119. , g = n.attributes.normal;
  55120. for (h = a = 0,
  55121. u = f.count; h < u; h++)
  55122. ti.set(f.getX(h), f.getY(h), f.getZ(h)).applyMatrix4(t),
  55123. ii.set(g.getX(h), g.getY(h), g.getZ(h)),
  55124. ii.applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  55125. i.setXYZ(a, ti.x, ti.y, ti.z),
  55126. a += 1,
  55127. i.setXYZ(a, ii.x, ii.y, ii.z),
  55128. a += 1
  55129. }
  55130. return i.needsUpdate = !0,
  55131. this
  55132. }
  55133. ),
  55134. Ci.WireframeHelper = function(e, t) {
  55135. var i = void 0 !== t ? t : 16777215;
  55136. Ci.LineSegments.call(this, new Ci.WireframeGeometry(e.geometry), new Ci.LineBasicMaterial({
  55137. color: i
  55138. })),
  55139. this.matrix = e.matrixWorld,
  55140. this.matrixAutoUpdate = !1
  55141. }
  55142. ,
  55143. Ci.WireframeHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55144. Ci.WireframeHelper.prototype.constructor = Ci.WireframeHelper,
  55145. Ci.ImmediateRenderObject = function(e) {
  55146. Ci.Object3D.call(this),
  55147. this.material = e,
  55148. this.render = function(e) {}
  55149. }
  55150. ,
  55151. Ci.ImmediateRenderObject.prototype = Object.create(Ci.Object3D.prototype),
  55152. Ci.ImmediateRenderObject.prototype.constructor = Ci.ImmediateRenderObject,
  55153. Ci.MorphBlendMesh = function(e, t) {
  55154. Ci.Mesh.call(this, e, t),
  55155. this.animationsMap = {},
  55156. this.animationsList = [];
  55157. var i = this.geometry.morphTargets.length
  55158. , n = i - 1
  55159. , r = i / 1;
  55160. this.createAnimation("__default", 0, n, r),
  55161. this.setAnimationWeight("__default", 1)
  55162. }
  55163. ,
  55164. Ci.MorphBlendMesh.prototype = Object.create(Ci.Mesh.prototype),
  55165. Ci.MorphBlendMesh.prototype.constructor = Ci.MorphBlendMesh,
  55166. Ci.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  55167. var r = {
  55168. start: t,
  55169. end: i,
  55170. length: i - t + 1,
  55171. fps: n,
  55172. duration: (i - t) / n,
  55173. lastFrame: 0,
  55174. currentFrame: 0,
  55175. active: !1,
  55176. time: 0,
  55177. direction: 1,
  55178. weight: 1,
  55179. directionBackwards: !1,
  55180. mirroredLoop: !1
  55181. };
  55182. this.animationsMap[e] = r,
  55183. this.animationsList.push(r)
  55184. }
  55185. ,
  55186. Ci.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  55187. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  55188. var s = r.morphTargets[o].name.match(i);
  55189. if (s && 1 < s.length)
  55190. n[l = s[1]] || (n[l] = {
  55191. start: 1 / 0,
  55192. end: -1 / 0
  55193. }),
  55194. o < (c = n[l]).start && (c.start = o),
  55195. o > c.end && (c.end = o),
  55196. t = t || l
  55197. }
  55198. for (var l in n) {
  55199. var c = n[l];
  55200. this.createAnimation(l, c.start, c.end, e)
  55201. }
  55202. this.firstAnimation = t
  55203. }
  55204. ,
  55205. Ci.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  55206. var t = this.animationsMap[e];
  55207. t && (t.direction = 1,
  55208. t.directionBackwards = !1)
  55209. }
  55210. ,
  55211. Ci.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  55212. var t = this.animationsMap[e];
  55213. t && (t.direction = -1,
  55214. t.directionBackwards = !0)
  55215. }
  55216. ,
  55217. Ci.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  55218. var i = this.animationsMap[e];
  55219. i && (i.fps = t,
  55220. i.duration = (i.end - i.start) / i.fps)
  55221. }
  55222. ,
  55223. Ci.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  55224. var i = this.animationsMap[e];
  55225. i && (i.duration = t,
  55226. i.fps = (i.end - i.start) / i.duration)
  55227. }
  55228. ,
  55229. Ci.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  55230. var i = this.animationsMap[e];
  55231. i && (i.weight = t)
  55232. }
  55233. ,
  55234. Ci.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  55235. var i = this.animationsMap[e];
  55236. i && (i.time = t)
  55237. }
  55238. ,
  55239. Ci.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  55240. var t = 0
  55241. , i = this.animationsMap[e];
  55242. return i && (t = i.time),
  55243. t
  55244. }
  55245. ,
  55246. Ci.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  55247. var t = -1
  55248. , i = this.animationsMap[e];
  55249. return i && (t = i.duration),
  55250. t
  55251. }
  55252. ,
  55253. Ci.MorphBlendMesh.prototype.playAnimation = function(e) {
  55254. var t = this.animationsMap[e];
  55255. t ? (t.time = 0,
  55256. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  55257. }
  55258. ,
  55259. Ci.MorphBlendMesh.prototype.stopAnimation = function(e) {
  55260. var t = this.animationsMap[e];
  55261. t && (t.active = !1)
  55262. }
  55263. ,
  55264. Ci.MorphBlendMesh.prototype.update = function(e) {
  55265. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  55266. var n = this.animationsList[t];
  55267. if (n.active) {
  55268. var r = n.duration / n.length;
  55269. n.time += n.direction * e,
  55270. n.mirroredLoop ? (n.time > n.duration || n.time < 0) && (n.direction *= -1,
  55271. n.time > n.duration && (n.time = n.duration,
  55272. n.directionBackwards = !0),
  55273. n.time < 0 && (n.time = 0,
  55274. n.directionBackwards = !1)) : (n.time = n.time % n.duration,
  55275. n.time < 0 && (n.time += n.duration));
  55276. var o = n.start + Ci.Math.clamp(Math.floor(n.time / r), 0, n.length - 1)
  55277. , a = n.weight;
  55278. o !== n.currentFrame && (this.morphTargetInfluences[n.lastFrame] = 0,
  55279. this.morphTargetInfluences[n.currentFrame] = 1 * a,
  55280. this.morphTargetInfluences[o] = 0,
  55281. n.lastFrame = n.currentFrame,
  55282. n.currentFrame = o);
  55283. var s = n.time % r / r;
  55284. n.directionBackwards && (s = 1 - s),
  55285. n.currentFrame !== n.lastFrame ? (this.morphTargetInfluences[n.currentFrame] = s * a,
  55286. this.morphTargetInfluences[n.lastFrame] = (1 - s) * a) : this.morphTargetInfluences[n.currentFrame] = a
  55287. }
  55288. }
  55289. }
  55290. ,
  55291. void 0 !== i ? (void 0 !== t && t.exports && (i = t.exports = Ci),
  55292. i.THREE = Ci) : this.THREE = Ci
  55293. window.THREE = Ci
  55294. getObjLoader()
  55295. initByTHREE(THREE)
  55296. }
  55297. , {}]
  55298. }, {}, [116]);